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

Merge pull request #38 from DCGO2/BT16-BugFixes

Bt16 bug fixes
Michael8818 1 год назад
Родитель
Сommit
daae6aaa41
19 измененных файлов с 1041 добавлено и 1000 удалено
  1. 141 122
      Assets/CardEffect/BT16/Black/AncientAngelOfSteel_BT16_097.cs
  2. 49 45
      Assets/CardEffect/BT16/Black/DoruGreymon_BT16_061.cs
  3. 2 1
      Assets/CardEffect/BT16/Black/MetropolitanPoliceDepartmentCommunitySafetyBureauCyberCrimeDivisionInvestigationUnitElevenDigimonCrimeResponeTeam_BT16_096.cs
  4. 32 36
      Assets/CardEffect/BT16/Black/Shakkoumon_BT16_063.cs
  5. 7 3
      Assets/CardEffect/BT16/Black/Zanmetsumon_BT16_062.cs
  6. 1 1
      Assets/CardEffect/BT16/Blue/ImperialdramonDragonMode_BT16_028.cs
  7. 76 56
      Assets/CardEffect/BT16/Blue/InvincibleDragonInsectFusion_BT16_092.cs
  8. 24 18
      Assets/CardEffect/BT16/Blue/Mantaraymon_BT16_022.cs
  9. 5 8
      Assets/CardEffect/BT16/Green/Achillesmon_BT16_047.cs
  10. 3 2
      Assets/CardEffect/BT16/Purple/DemonWoldOfTheCastleOfNineWolves_BT16_099.cs
  11. 89 133
      Assets/CardEffect/BT16/Purple/Dinobeemon_BT16_077.cs
  12. 121 97
      Assets/CardEffect/BT16/Purple/GesomonXAntibody_BT16_069.cs
  13. 156 184
      Assets/CardEffect/BT16/Purple/MaloMyotismon_BT16_081.cs
  14. 126 115
      Assets/CardEffect/BT16/Purple/Soloogarmon_BT16_076.cs
  15. 1 0
      Assets/CardEffect/BT16/Purple/ThunderflameCrusher_BT16_100.cs
  16. 2 2
      Assets/CardEffect/BT16/Red/Aquilamon_BT16_008.cs
  17. 166 135
      Assets/CardEffect/BT16/Red/BeastlyStormDanceofAffection_BT16_091.cs
  18. 39 41
      Assets/CardEffect/BT16/White/LuiOhwada_BT16_090.cs
  19. 1 1
      Assets/Scripts/CardEffectCommons/GiveEffect/GiveEffectToPermanent/CanNotUnsuspend.cs

+ 141 - 122
Assets/CardEffect/BT16/Black/AncientAngelOfSteel_BT16_097.cs

@@ -13,16 +13,18 @@ namespace DCGO.CardEffects.BT16
             List<ICardEffect> cardEffects = new List<ICardEffect>();
 
             #region Main - Option Skill
+
             if (timing == EffectTiming.OptionSkill)
             {
                 ActivateClass activateClass = new ActivateClass();
                 activateClass.SetUpICardEffect("Play 1 [Ankylomon] or [Angemon]", CanUseCondition, card);
-                activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, true, EffectDiscription());
+                activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDiscription());
                 cardEffects.Add(activateClass);
 
                 string EffectDiscription()
                 {
-                    return "[Main] You may play 1 [Ankylomon] or [Angemon] from your hand without paying the cost. Then, 2 of your Digimon may DNA digivolve into a Digimon card in your hand. If DNA digivolved by this effect, <Recovery +1(Deck)>";
+                    return
+                        "[Main] You may play 1 [Ankylomon] or [Angemon] from your hand without paying the cost. Then, 2 of your Digimon may DNA digivolve into a Digimon card in your hand. If DNA digivolved by this effect, <Recovery +1(Deck)>";
                 }
 
                 bool CanSelectCardCondition(CardSource cardSource)
@@ -58,12 +60,11 @@ namespace DCGO.CardEffects.BT16
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
+                    // Play [Ankylomon/Angemon]
                     if (card.Owner.HandCards.Count(CanSelectCardCondition) >= 1)
                     {
                         List<CardSource> selectedCards = new List<CardSource>();
 
-                        int maxCount = 1;
-
                         SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
 
                         selectHandEffect.SetUp(
@@ -71,7 +72,7 @@ namespace DCGO.CardEffects.BT16
                             canTargetCondition: CanSelectCardCondition,
                             canTargetCondition_ByPreSelecetedList: null,
                             canEndSelectCondition: null,
-                            maxCount: maxCount,
+                            maxCount: 1,
                             canNoSelect: true,
                             canEndNotMax: false,
                             isShowOpponent: true,
@@ -92,114 +93,124 @@ namespace DCGO.CardEffects.BT16
                             yield return null;
                         }
 
-                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(cardSources: selectedCards, activateClass: activateClass, payCost: false, isTapped: false, root: SelectCardEffect.Root.Hand, activateETB: true));
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(
+                            cardSources: selectedCards, activateClass: activateClass, payCost: false, isTapped: false,
+                            root: SelectCardEffect.Root.Hand, activateETB: true));
+                    }
 
-                        // DNA digivolve
-                        if (card.Owner.GetBattleAreaDigimons().Count >= 2)
+                    // DNA digivolve
+                    if (card.Owner.GetBattleAreaDigimons().Count >= 2)
+                    {
+                        if (card.Owner.HandCards.Count(CanSelectDNACardCondition) >= 1)
                         {
-                            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<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);
+                                selectedDNACards.Add(cardSource);
 
-                                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 null;
+                            }
 
-                                if (selectedDNACards.Count >= 1)
+                            if (selectedDNACards.Count >= 1)
+                            {
+                                foreach (CardSource selectedCard in selectedDNACards)
                                 {
-                                    foreach (CardSource selectedCard in selectedDNACards)
+                                    if (selectedCard.CanPlayJogress(true))
                                     {
-                                        if (selectedCard.CanPlayJogress(true))
-                                        {
-                                            _jogressEvoRootsFrameIDs = new int[0];
+                                        _jogressEvoRootsFrameIDs = new int[0];
 
-                                            yield return GManager.instance.photonWaitController.StartWait("AncientAngelOfSteel_BT16_097");
+                                        yield return GManager.instance.photonWaitController.StartWait("AncientAngelOfSteel_BT16_097");
 
-                                            if (card.Owner.isYou || GManager.instance.IsAI)
+                                        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)
                                             {
-                                                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)
                                                 {
-                                                    if (permanents.Count == 2)
-                                                    {
-                                                        _jogressEvoRootsFrameIDs = permanents.Distinct().ToArray().Map(permanent => permanent.PermanentFrame.FrameID);
-                                                    }
-
-                                                    yield return null;
+                                                    _jogressEvoRootsFrameIDs = permanents.Distinct().ToArray()
+                                                        .Map(permanent => permanent.PermanentFrame.FrameID);
                                                 }
 
-                                                photonView.RPC("SetJogressEvoRootsFrameIDs", RpcTarget.All, _jogressEvoRootsFrameIDs);
+                                                yield return null;
                                             }
 
-                                            else
-                                            {
-                                                GManager.instance.commandText.OpenCommandText("The opponent is choosing a card to DNA digivolve.");
-                                            }
+                                            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;
+                                        yield return new WaitWhile(() => !_endSelect);
+                                        _endSelect = false;
 
-                                            GManager.instance.commandText.CloseCommandText();
-                                            yield return new WaitWhile(() => GManager.instance.commandText.gameObject.activeSelf);
+                                        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));
+                                        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);
+                                            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);
+                                            playCard.SetJogress(_jogressEvoRootsFrameIDs);
 
-                                                yield return ContinuousController.instance.StartCoroutine(playCard.PlayCard());
+                                            yield return ContinuousController.instance.StartCoroutine(playCard.PlayCard());
 
-                                                if (CardEffectCommons.IsExistOnBattleArea(selectedCard))
+                                            if (CardEffectCommons.IsExistOnBattleArea(selectedCard))
+                                            {
+                                                if (card.Owner.LibraryCards.Count >= 1)
                                                 {
-                                                    if (card.Owner.LibraryCards.Count >= 1)
+                                                    if (card.Owner.CanAddSecurity(activateClass))
                                                     {
-                                                        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());
+                                                        ;
                                                     }
                                                 }
                                             }
@@ -211,19 +222,23 @@ namespace DCGO.CardEffects.BT16
                     }
                 }
             }
+
             #endregion
 
             #region Security Effect
+
             if (timing == EffectTiming.SecuritySkill)
             {
                 ActivateClass activateClass = new ActivateClass();
                 activateClass.SetUpICardEffect("Play 1 [Armadillomon] or [Patamon]", CanUseCondition, card);
                 activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDiscription());
+                activateClass.SetIsSecurityEffect(true);
                 cardEffects.Add(activateClass);
 
                 string EffectDiscription()
                 {
-                    return "[Security] You may play 1 [Armadillomon] or [Patamon] from your hand or trash without paying the cost. Then, add this card to the hand.";
+                    return
+                        "[Security] You may play 1 [Armadillomon] or [Patamon] from your hand or trash without paying the cost. Then, add this card to the hand.";
                 }
 
                 bool CanSelectCardCondition(CardSource cardSource)
@@ -247,15 +262,16 @@ namespace DCGO.CardEffects.BT16
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
                     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),
-                        };
+                    {
+                        new SelectionElement<bool>(message: $"Yes", value: true, spriteIndex: 0),
+                        new SelectionElement<bool>(message: $"No", value: false, spriteIndex: 1),
+                    };
 
                     string selectPlayerMessage = "Will you play a Digimon?";
                     string notSelectPlayerMessage = "The opponent is choosing effects.";
 
-                    GManager.instance.userSelectionManager.SetBoolSelection(selectionElements: selectionElements, selectPlayer: card.Owner, selectPlayerMessage: selectPlayerMessage, notSelectPlayerMessage: notSelectPlayerMessage);
+                    GManager.instance.userSelectionManager.SetBoolSelection(selectionElements: selectionElements, selectPlayer: card.Owner,
+                        selectPlayerMessage: selectPlayerMessage, notSelectPlayerMessage: notSelectPlayerMessage);
 
 
                     yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
@@ -264,7 +280,6 @@ namespace DCGO.CardEffects.BT16
 
                     if (playDigimon)
                     {
-
                         bool canSelectHand = card.Owner.HandCards.Count(CanSelectCardCondition) >= 1;
                         bool canSelectTrash = card.Owner.TrashCards.Count(CanSelectCardCondition) >= 1;
 
@@ -273,15 +288,17 @@ namespace DCGO.CardEffects.BT16
                             if (canSelectHand && canSelectTrash)
                             {
                                 List<SelectionElement<bool>> selectionElements1 = new List<SelectionElement<bool>>()
-                        {
-                            new SelectionElement<bool>(message: $"From hand", value : true, spriteIndex: 0),
-                            new SelectionElement<bool>(message: $"From trash", value : false, spriteIndex: 1),
-                        };
+                                {
+                                    new SelectionElement<bool>(message: $"From hand", value: true, spriteIndex: 0),
+                                    new SelectionElement<bool>(message: $"From trash", value: false, spriteIndex: 1),
+                                };
 
                                 string selectPlayerMessage1 = "From which area do you play a card?";
                                 string notSelectPlayerMessage1 = "The opponent is choosing from which area to play a card.";
 
-                                GManager.instance.userSelectionManager.SetBoolSelection(selectionElements: selectionElements1, selectPlayer: card.Owner, selectPlayerMessage: selectPlayerMessage1, notSelectPlayerMessage: notSelectPlayerMessage1);
+                                GManager.instance.userSelectionManager.SetBoolSelection(selectionElements: selectionElements1,
+                                    selectPlayer: card.Owner, selectPlayerMessage: selectPlayerMessage1,
+                                    notSelectPlayerMessage: notSelectPlayerMessage1);
                             }
 
                             else
@@ -289,7 +306,8 @@ namespace DCGO.CardEffects.BT16
                                 GManager.instance.userSelectionManager.SetBool(canSelectHand);
                             }
 
-                            yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
+                            yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager
+                                .WaitForEndSelect());
 
                             bool fromHand = GManager.instance.userSelectionManager.SelectedBoolValue;
 
@@ -335,24 +353,25 @@ namespace DCGO.CardEffects.BT16
                                 SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
 
                                 selectCardEffect.SetUp(
-                                            canTargetCondition: CanSelectCardCondition,
-                                            canTargetCondition_ByPreSelecetedList: null,
-                                            canEndSelectCondition: null,
-                                            canNoSelect: () => true,
-                                            selectCardCoroutine: SelectCardCoroutine,
-                                            afterSelectCardCoroutine: null,
-                                            message: "Select 1 card to play.",
-                                            maxCount: maxCount1,
-                                            canEndNotMax: false,
-                                            isShowOpponent: true,
-                                            mode: SelectCardEffect.Mode.Custom,
-                                            root: SelectCardEffect.Root.Custom,
-                                            customRootCardList: card.Owner.TrashCards,
-                                            canLookReverseCard: true,
-                                            selectPlayer: card.Owner,
-                                            cardEffect: activateClass);
-
-                                selectCardEffect.SetUpCustomMessage("Select 1 trash card to play.", "The opponent is selecting 1 trash card to play.");
+                                    canTargetCondition: CanSelectCardCondition,
+                                    canTargetCondition_ByPreSelecetedList: null,
+                                    canEndSelectCondition: null,
+                                    canNoSelect: () => true,
+                                    selectCardCoroutine: SelectCardCoroutine,
+                                    afterSelectCardCoroutine: null,
+                                    message: "Select 1 card to play.",
+                                    maxCount: maxCount1,
+                                    canEndNotMax: false,
+                                    isShowOpponent: true,
+                                    mode: SelectCardEffect.Mode.Custom,
+                                    root: SelectCardEffect.Root.Custom,
+                                    customRootCardList: card.Owner.TrashCards,
+                                    canLookReverseCard: true,
+                                    selectPlayer: card.Owner,
+                                    cardEffect: activateClass);
+
+                                selectCardEffect.SetUpCustomMessage("Select 1 trash card to play.",
+                                    "The opponent is selecting 1 trash card to play.");
                                 selectCardEffect.SetUpCustomMessage_ShowCard("Played Card");
 
                                 yield return StartCoroutine(selectCardEffect.Activate());
@@ -372,13 +391,13 @@ namespace DCGO.CardEffects.BT16
                                 isTapped: false,
                                 root: root,
                                 activateETB: true));
-
-                           
                         }
                     }
+
                     yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.AddThisCardToHand(card, activateClass));
                 }
             }
+
             #endregion
 
             return cardEffects;

+ 49 - 45
Assets/CardEffect/BT16/Black/DoruGreymon_BT16_061.cs

@@ -12,6 +12,7 @@ namespace DCGO.CardEffects.BT16
             List<ICardEffect> cardEffects = new List<ICardEffect>();
 
             #region Alternate Digivolution Requirement
+
             if (timing == EffectTiming.None)
             {
                 bool PermanentCondition(Permanent targetPermanent)
@@ -21,7 +22,7 @@ namespace DCGO.CardEffects.BT16
                         return true;
                     }
 
-                    if(targetPermanent.TopCard.Level == 4 && targetPermanent.TopCard.ContainsTraits("SoC"))
+                    if (targetPermanent.TopCard.Level == 4 && targetPermanent.TopCard.ContainsTraits("SoC"))
                     {
                         return true;
                     }
@@ -36,16 +37,20 @@ namespace DCGO.CardEffects.BT16
                     card: card,
                     condition: null));
             }
+
             #endregion
 
             #region Collision
-            if(timing == EffectTiming.OnCounterTiming)
-            {                
-                cardEffects.Add(CardEffectFactory.CollisionSelfStaticEffect(false,card, null));
+
+            if (timing == EffectTiming.OnCounterTiming)
+            {
+                cardEffects.Add(CardEffectFactory.CollisionSelfStaticEffect(false, card, null));
             }
+
             #endregion
 
             #region All Turns
+
             if (timing == EffectTiming.OnAttackTargetChanged)
             {
                 ActivateClass activateClass = new ActivateClass();
@@ -55,7 +60,8 @@ namespace DCGO.CardEffects.BT16
 
                 string EffectDiscription()
                 {
-                    return "[All Turns] When an attack target is switched, this Digimon with a Tamer card with the [SoC] trait in its digivolution cards may digivolve into a Digimon card with the [Beast Dragon], [Undead] or [SoC] trait in your hand without paying the cost.";
+                    return
+                        "[All Turns] When an attack target is switched, this Digimon with a Tamer card with the [SoC] trait in its digivolution cards may digivolve into a Digimon card with the [Beast Dragon], [Undead] or [SoC] trait in your hand without paying the cost.";
                 }
 
                 bool HasTamerCardCondition(CardSource cardSource)
@@ -73,7 +79,8 @@ namespace DCGO.CardEffects.BT16
 
                 bool CanSelectCardCondition(CardSource cardSource)
                 {
-                    if (cardSource.HasBeastDragonTraits || cardSource.CardTraits.Contains("Undead") || cardSource.CardTraits.Contains("SoC"))
+                    if (cardSource.HasBeastDragonTraits || cardSource.CardTraits.Contains("Undead") ||
+                        cardSource.CardTraits.Contains("SoC"))
                     {
                         if (cardSource.IsDigimon)
                         {
@@ -93,6 +100,7 @@ namespace DCGO.CardEffects.BT16
                             return true;
                         }
                     }
+
                     return false;
                 }
 
@@ -112,32 +120,35 @@ namespace DCGO.CardEffects.BT16
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
                     yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.DigivolveIntoHandOrTrashCard(
-                       targetPermanent: card.PermanentOfThisCard(),
-                       cardCondition: CanSelectCardCondition,
-                       payCost: false,
-                       reduceCostTuple: null,
-                       fixedCostTuple: null,
-                       ignoreDigivolutionRequirementFixedCost: -1,
-                       isHand: true,
-                       activateClass: activateClass,
-                       successProcess: null));
+                        targetPermanent: card.PermanentOfThisCard(),
+                        cardCondition: CanSelectCardCondition,
+                        payCost: false,
+                        reduceCostTuple: null,
+                        fixedCostTuple: null,
+                        ignoreDigivolutionRequirementFixedCost: -1,
+                        isHand: true,
+                        activateClass: activateClass,
+                        successProcess: null));
                 }
             }
+
             #endregion
 
             #region All Turns - ESS
+
             if (timing == EffectTiming.OnDestroyedAnyone || timing == EffectTiming.OnEndBattle)
             {
                 ActivateClass activateClass = new ActivateClass();
-                activateClass.SetUpICardEffect("Play 1 digimon 5 cost or less", CanUseCondition, card);
+                activateClass.SetUpICardEffect("Play 1 card with 5 cost or less", CanUseCondition, card);
                 activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, true, EffectDiscription());
                 activateClass.SetIsInheritedEffect(true);
-                activateClass.SetHashString("PlayDigimon_BT16_061");
+                activateClass.SetHashString("PlayCard_BT16_061");
                 cardEffects.Add(activateClass);
 
                 string EffectDiscription()
                 {
-                    return "[All Turns] (Once Per Turn) When this Digimon deletes another Digimon, you may play 1 card with the [X Antibody] or [SoC] trait and a play cost of 5 or less from your trash without paying the cost.";
+                    return
+                        "[All Turns] (Once Per Turn) When this Digimon deletes another Digimon, you may play 1 card with the [X Antibody] or [SoC] trait and a play cost of 5 or less from your trash without paying the cost.";
                 }
 
                 bool SelectCardCondition(CardSource cardSource)
@@ -158,39 +169,31 @@ namespace DCGO.CardEffects.BT16
                     return false;
                 }
 
-                bool DeletionCardEffect(ICardEffect cardEffect)
-                {
-                    return (cardEffect.EffectSourceCard.PermanentOfThisCard() == card.PermanentOfThisCard());
-                }
-
-                bool OpponentsPermenantCondition(Permanent permanent)
-                {
-                    return permanent.IsDigimon && CardEffectCommons.IsOpponentPermanent(permanent, card);
-                }
-
                 bool CanUseCondition(Hashtable hashtable)
                 {
                     if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
                     {
-                        if (CardEffectCommons.IsByBattle(hashtable))
-                        {
-                            bool WinnerCondition(Permanent permanent)
-                            {
-                                if (permanent == null)
-                                    permanent = card.PermanentOfThisCard();
+                        // Opponent's Digimon
+                        bool WinnerCondition(Permanent permanent) => permanent.cardSources.Contains(card);
 
-                                return permanent.cardSources.Contains(card);
-                            }
+                        bool LoserCondition(Permanent permanent) => permanent.IsDigimon;
 
-                            if (CardEffectCommons.CanTriggerWhenDeleteOpponentDigimon(hashtable, WinnerCondition, OpponentsPermenantCondition))
-                            {
-                                return true;
-                            }
+                        if (CardEffectCommons.CanTriggerWhenDeleteOpponentDigimon(hashtable: hashtable,
+                                winnerCondition: WinnerCondition, loserCondition: LoserCondition))
+                        {
+                            return true;
                         }
 
-                        if(CardEffectCommons.IsByEffect(hashtable, DeletionCardEffect))
+                        // Other Digimon
+                        bool DeletionCardEffect(ICardEffect cardEffect) =>
+                            cardEffect.EffectSourceCard.PermanentOfThisCard() == card.PermanentOfThisCard();
+
+                        bool DeletedPermanentCondition(Permanent permanent) =>
+                            permanent != card.PermanentOfThisCard() && permanent.IsDigimon;
+
+                        if (CardEffectCommons.IsByEffect(hashtable, DeletionCardEffect))
                         {
-                            if(CardEffectCommons.CanTriggerOnPermanentDeleted(hashtable, OpponentsPermenantCondition))
+                            if (CardEffectCommons.CanTriggerOnPermanentDeleted(hashtable, DeletedPermanentCondition))
                                 return true;
                         }
                     }
@@ -219,7 +222,7 @@ namespace DCGO.CardEffects.BT16
                             message: "Select 1 card to play",
                             maxCount: 1,
                             canEndNotMax: false,
-                            isShowOpponent:false,
+                            isShowOpponent: false,
                             mode: SelectCardEffect.Mode.Custom,
                             root: SelectCardEffect.Root.Trash,
                             customRootCardList: null,
@@ -236,16 +239,17 @@ namespace DCGO.CardEffects.BT16
                         if (selectedCardSources.Count >= 1)
                         {
                             yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(
-                                cardSources:selectedCardSources,
+                                cardSources: selectedCardSources,
                                 activateClass: activateClass,
                                 payCost: false,
                                 isTapped: false,
                                 root: SelectCardEffect.Root.Trash,
-                                activateETB:true));
+                                activateETB: true));
                         }
                     }
                 }
             }
+
             #endregion
 
 

+ 2 - 1
Assets/CardEffect/BT16/Black/MetropolitanPoliceDepartmentCommunitySafetyBureauCyberCrimeDivisionInvestigationUnitElevenDigimonCrimeResponeTeam_BT16_096.cs

@@ -68,7 +68,7 @@ namespace DCGO.CardEffects.BT16
 
                 string EffectDiscription()
                 {
-                    return "[Main] <Delay>\r\n Reveal the top 3 cards of your deck. You may play 1 card with the [D-Brigade] or [DigiPolice] trait and a play cost of 4 or less among them without paying the cost. Trash the rest.";
+                    return "[Main] <Delay>\r\n• Reveal the top 3 cards of your deck. You may play 1 card with the [D-Brigade] or [DigiPolice] trait and a play cost of 4 or less among them without paying the cost. Trash the rest.";
                 }
 
                 bool CanSelectCardCondition(CardSource cardSource)
@@ -139,6 +139,7 @@ namespace DCGO.CardEffects.BT16
                 ActivateClass activateClass = new ActivateClass();
                 activateClass.SetUpICardEffect("Reveal top 3, add 1 card", CanUseCondition, card);
                 activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDiscription());
+                activateClass.SetIsSecurityEffect(true);
                 cardEffects.Add(activateClass);
 
                 string EffectDiscription()

+ 32 - 36
Assets/CardEffect/BT16/Black/Shakkoumon_BT16_063.cs

@@ -123,41 +123,6 @@ namespace DCGO.CardEffects.BT16
                     return "[When Digivolving] This Digimon isn't affected by the effects of your opponent's Digimon until the end of their turn. Then, if DNA digivolving, place 1 of your opponent's Digimon whose level is less than or equal to the number of cards in yours or your opponent's security stack at the bottom of your opponent's security stack.";
                 }
 
-                #region Unaffected
-                bool CardUnaffectedCondition(CardSource cardSource)
-                {
-                    if (CardEffectCommons.IsExistOnBattleArea(card))
-                    {
-                        if (cardSource == card.PermanentOfThisCard().TopCard)
-                        {
-                            return true;
-                        }
-                    }
-
-                    return false;
-                }
-
-                bool SkillCondition(ICardEffect cardEffect)
-                {
-                    if (cardEffect != null)
-                    {
-                        if (cardEffect.EffectSourceCard != null)
-                        {
-                            if (cardEffect.EffectSourceCard.Owner == card.Owner.Enemy)
-                            {
-                                if (cardEffect.IsDigimonEffect)
-                                {
-                                    return true;
-                                }
-                            }
-                        }
-                    }
-
-                    return false;
-                }
-                #endregion
-
-                #region Place in security
                 bool CanSelectPermanentCondition(Permanent permanent)
                 {
                     if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
@@ -173,7 +138,6 @@ namespace DCGO.CardEffects.BT16
 
                     return false;
                 }
-                #endregion
 
                 bool CanUseCondition(Hashtable hashtable)
                 {
@@ -201,6 +165,38 @@ namespace DCGO.CardEffects.BT16
                         {
                             return CardEffectCommons.IsPermanentExistsOnBattleArea(selectedPermanent);
                         }
+                        
+                        bool CardUnaffectedCondition(CardSource cardSource)
+                        {
+                            if (CardEffectCommons.IsPermanentExistsOnBattleArea(selectedPermanent))
+                            {
+                                if (cardSource == selectedPermanent.TopCard)
+                                {
+                                    return true;
+                                }
+                            }
+
+                            return false;
+                        }
+
+                        bool SkillCondition(ICardEffect cardEffect)
+                        {
+                            if (cardEffect != null)
+                            {
+                                if (cardEffect.EffectSourceCard != null)
+                                {
+                                    if (cardEffect.EffectSourceCard.Owner == card.Owner.Enemy)
+                                    {
+                                        if (cardEffect.IsDigimonEffect)
+                                        {
+                                            return true;
+                                        }
+                                    }
+                                }
+                            }
+
+                            return false;
+                        }
                     }
 
                     if (CardEffectCommons.IsJogress(hashtable))

+ 7 - 3
Assets/CardEffect/BT16/Black/Zanmetsumon_BT16_062.cs

@@ -64,7 +64,9 @@ namespace DCGO.CardEffects.BT16
                 {
                     if (CardEffectCommons.IsPermanentExistsOnBattleArea(permanent))
                     {
-                        if(permanent.TopCard.HasPlayCost && permanent.TopCard.GetCostItself <= 3 && permanent.IsDigimon)
+                        if (permanent.IsDigimon &&
+                            permanent.TopCard.HasPlayCost && 
+                            permanent.TopCard.GetCostItself <= 3)
                         {
                             return true;
                         }
@@ -169,9 +171,11 @@ namespace DCGO.CardEffects.BT16
 
                 bool CanSelectDeletePermanentCondition(Permanent permanent)
                 {
-                    if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
+                    if (CardEffectCommons.IsPermanentExistsOnBattleArea(permanent))
                     {
-                        if (permanent.TopCard.HasPlayCost && permanent.TopCard.GetCostItself <= 3)
+                        if (permanent.IsDigimon &&
+                            permanent.TopCard.HasPlayCost && 
+                            permanent.TopCard.GetCostItself <= 3)
                         {
                             return true;
                         }

+ 1 - 1
Assets/CardEffect/BT16/Blue/ImperialdramonDragonMode_BT16_028.cs

@@ -150,7 +150,7 @@ namespace DCGO.CardEffects.BT16
                                 canTargetCondition: CanSelectOpponentsDigimonToSuspend,
                                 canEndSelectCondition: null,
                                 maxCount: 1,
-                                canNoSelect: false,
+                                canNoSelect: true,
                                 canEndNotMax: false,
                                 selectPermanentCoroutine: SelectSuspendCoroutine,
                                 afterSelectPermanentCoroutine: null,

+ 76 - 56
Assets/CardEffect/BT16/Blue/InvincibleDragonInsectFusion_BT16_092.cs

@@ -13,16 +13,18 @@ namespace DCGO.CardEffects.BT16
             List<ICardEffect> cardEffects = new List<ICardEffect>();
 
             #region Main - Option Skill
+
             if (timing == EffectTiming.OptionSkill)
             {
                 ActivateClass activateClass = new ActivateClass();
                 activateClass.SetUpICardEffect("Play 1 [ExVeemon] or [Stingmon]", CanUseCondition, card);
-                activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, true, EffectDiscription());
+                activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDiscription());
                 cardEffects.Add(activateClass);
 
                 string EffectDiscription()
                 {
-                    return "[Main] You may play 1 [ExVeemon] or [Stingmon] from your hand without paying the cost. Then, 2 of your Digimon may DNA digivolve into a Digimon card in your hand. Until the end of your opponent's turn, the Digimon this effect DNA digivolved can't be deleted in battle and gains <Blocker>.";
+                    return
+                        "[Main] You may play 1 [ExVeemon] or [Stingmon] from your hand without paying the cost. Then, 2 of your Digimon may DNA digivolve into a Digimon card in your hand. Until the end of your opponent's turn, the Digimon this effect DNA digivolved can't be deleted in battle and gains <Blocker>.";
                 }
 
                 bool CanSelectCardCondition(CardSource cardSource)
@@ -58,12 +60,11 @@ namespace DCGO.CardEffects.BT16
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
+                    // Play [ExVeemon/Stingmon]
                     if (card.Owner.HandCards.Count(CanSelectCardCondition) >= 1)
                     {
                         List<CardSource> selectedCards = new List<CardSource>();
 
-                        int maxCount = 1;
-
                         SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
 
                         selectHandEffect.SetUp(
@@ -71,7 +72,7 @@ namespace DCGO.CardEffects.BT16
                             canTargetCondition: CanSelectCardCondition,
                             canTargetCondition_ByPreSelecetedList: null,
                             canEndSelectCondition: null,
-                            maxCount: maxCount,
+                            maxCount: 1,
                             canNoSelect: true,
                             canEndNotMax: false,
                             isShowOpponent: true,
@@ -92,7 +93,9 @@ namespace DCGO.CardEffects.BT16
                             yield return null;
                         }
 
-                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(cardSources: selectedCards, activateClass: activateClass, payCost: false, isTapped: false, root: SelectCardEffect.Root.Hand, activateETB: true));
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(
+                            cardSources: selectedCards, activateClass: activateClass, payCost: false, isTapped: false,
+                            root: SelectCardEffect.Root.Hand, activateETB: true));
                     }
 
                     // DNA digivolve
@@ -118,7 +121,8 @@ namespace DCGO.CardEffects.BT16
                                 mode: SelectHandEffect.Mode.Custom,
                                 cardEffect: activateClass);
 
-                            selectDNAEffect.SetUpCustomMessage("Select 1 card to DNA digivolve.", "The opponent is selecting 1 card to DNA digivolve.");
+                            selectDNAEffect.SetUpCustomMessage("Select 1 card to DNA digivolve.",
+                                "The opponent is selecting 1 card to DNA digivolve.");
                             selectDNAEffect.SetNotShowCard();
 
                             yield return StartCoroutine(selectDNAEffect.Activate());
@@ -143,20 +147,22 @@ namespace DCGO.CardEffects.BT16
                                         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);
+                                            (card: selectedCard,
+                                                isLocal: true,
+                                                isPayCost: true,
+                                                canNoSelect: true,
+                                                endSelectCoroutine_SelectDigivolutionRoots: EndSelectCoroutine_SelectDigivolutionRoots,
+                                                noSelectCoroutine: null);
 
-                                            yield return ContinuousController.instance.StartCoroutine(GManager.instance.selectJogressEffect.SelectDigivolutionRoots());
+                                            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);
+                                                    _jogressEvoRootsFrameIDs = permanents.Distinct().ToArray()
+                                                        .Map(permanent => permanent.PermanentFrame.FrameID);
                                                 }
 
                                                 yield return null;
@@ -167,7 +173,8 @@ namespace DCGO.CardEffects.BT16
 
                                         else
                                         {
-                                            GManager.instance.commandText.OpenCommandText("The opponent is choosing a card to DNA digivolve.");
+                                            GManager.instance.commandText.OpenCommandText(
+                                                "The opponent is choosing a card to DNA digivolve.");
                                         }
 
                                         yield return new WaitWhile(() => !_endSelect);
@@ -178,7 +185,9 @@ namespace DCGO.CardEffects.BT16
 
                                         if (_jogressEvoRootsFrameIDs.Length == 2)
                                         {
-                                            yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().ShowCardEffect(new List<CardSource>() { selectedCard }, "Played Card", true, true));
+                                            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 },
@@ -200,14 +209,16 @@ namespace DCGO.CardEffects.BT16
                                                     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"));
+                                                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)
+                                                bool CanNotBeDestroyedByBattleCondition(Permanent permanent1, Permanent attackingPermanent,
+                                                    Permanent defendingPermanent, CardSource defendingCard)
                                                 {
                                                     return permanent1 == attackingPermanent || permanent1 == defendingPermanent;
                                                 }
@@ -220,19 +231,23 @@ namespace DCGO.CardEffects.BT16
                     }
                 }
             }
+
             #endregion
 
             #region Security Effect
+
             if (timing == EffectTiming.SecuritySkill)
             {
                 ActivateClass activateClass = new ActivateClass();
                 activateClass.SetUpICardEffect("Play 1 [Veemon] or [Wormmon]", CanUseCondition, card);
                 activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDiscription());
+                activateClass.SetIsSecurityEffect(true);
                 cardEffects.Add(activateClass);
 
                 string EffectDiscription()
                 {
-                    return "[Security] You may play 1 [Veemon] or [Wormmon] from your hand or trash without paying the cost. Then, add this card to the hand.";
+                    return
+                        "[Security] You may play 1 [Veemon] or [Wormmon] from your hand or trash without paying the cost. Then, add this card to the hand.";
                 }
 
                 bool CanSelectCardCondition(CardSource cardSource)
@@ -256,15 +271,16 @@ namespace DCGO.CardEffects.BT16
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
                     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),
-                        };
+                    {
+                        new SelectionElement<bool>(message: $"Yes", value: true, spriteIndex: 0),
+                        new SelectionElement<bool>(message: $"No", value: false, spriteIndex: 1),
+                    };
 
                     string selectPlayerMessage = "Will you play a Digimon?";
                     string notSelectPlayerMessage = "The opponent is choosing effects.";
 
-                    GManager.instance.userSelectionManager.SetBoolSelection(selectionElements: selectionElements, selectPlayer: card.Owner, selectPlayerMessage: selectPlayerMessage, notSelectPlayerMessage: notSelectPlayerMessage);
+                    GManager.instance.userSelectionManager.SetBoolSelection(selectionElements: selectionElements, selectPlayer: card.Owner,
+                        selectPlayerMessage: selectPlayerMessage, notSelectPlayerMessage: notSelectPlayerMessage);
 
 
                     yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
@@ -281,15 +297,17 @@ namespace DCGO.CardEffects.BT16
                             if (canSelectHand && canSelectTrash)
                             {
                                 List<SelectionElement<bool>> selectionElements1 = new List<SelectionElement<bool>>()
-                        {
-                            new SelectionElement<bool>(message: $"From hand", value : true, spriteIndex: 0),
-                            new SelectionElement<bool>(message: $"From trash", value : false, spriteIndex: 1),
-                        };
+                                {
+                                    new SelectionElement<bool>(message: $"From hand", value: true, spriteIndex: 0),
+                                    new SelectionElement<bool>(message: $"From trash", value: false, spriteIndex: 1),
+                                };
 
                                 string selectPlayerMessage1 = "From which area do you play a card?";
                                 string notSelectPlayerMessage1 = "The opponent is choosing from which area to play a card.";
 
-                                GManager.instance.userSelectionManager.SetBoolSelection(selectionElements: selectionElements1, selectPlayer: card.Owner, selectPlayerMessage: selectPlayerMessage1, notSelectPlayerMessage: notSelectPlayerMessage1);
+                                GManager.instance.userSelectionManager.SetBoolSelection(selectionElements: selectionElements1,
+                                    selectPlayer: card.Owner, selectPlayerMessage: selectPlayerMessage1,
+                                    notSelectPlayerMessage: notSelectPlayerMessage1);
                             }
 
                             else
@@ -297,7 +315,8 @@ namespace DCGO.CardEffects.BT16
                                 GManager.instance.userSelectionManager.SetBool(canSelectHand);
                             }
 
-                            yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
+                            yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager
+                                .WaitForEndSelect());
 
                             bool fromHand = GManager.instance.userSelectionManager.SelectedBoolValue;
 
@@ -343,24 +362,25 @@ namespace DCGO.CardEffects.BT16
                                 SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
 
                                 selectCardEffect.SetUp(
-                                            canTargetCondition: CanSelectCardCondition,
-                                            canTargetCondition_ByPreSelecetedList: null,
-                                            canEndSelectCondition: null,
-                                            canNoSelect: () => true,
-                                            selectCardCoroutine: SelectCardCoroutine,
-                                            afterSelectCardCoroutine: null,
-                                            message: "Select 1 card to play.",
-                                            maxCount: maxCount1,
-                                            canEndNotMax: false,
-                                            isShowOpponent: true,
-                                            mode: SelectCardEffect.Mode.Custom,
-                                            root: SelectCardEffect.Root.Custom,
-                                            customRootCardList: card.Owner.TrashCards,
-                                            canLookReverseCard: true,
-                                            selectPlayer: card.Owner,
-                                            cardEffect: activateClass);
-
-                                selectCardEffect.SetUpCustomMessage("Select 1 trash card to play.", "The opponent is selecting 1 trash card to play.");
+                                    canTargetCondition: CanSelectCardCondition,
+                                    canTargetCondition_ByPreSelecetedList: null,
+                                    canEndSelectCondition: null,
+                                    canNoSelect: () => true,
+                                    selectCardCoroutine: SelectCardCoroutine,
+                                    afterSelectCardCoroutine: null,
+                                    message: "Select 1 card to play.",
+                                    maxCount: maxCount1,
+                                    canEndNotMax: false,
+                                    isShowOpponent: true,
+                                    mode: SelectCardEffect.Mode.Custom,
+                                    root: SelectCardEffect.Root.Custom,
+                                    customRootCardList: card.Owner.TrashCards,
+                                    canLookReverseCard: true,
+                                    selectPlayer: card.Owner,
+                                    cardEffect: activateClass);
+
+                                selectCardEffect.SetUpCustomMessage("Select 1 trash card to play.",
+                                    "The opponent is selecting 1 trash card to play.");
                                 selectCardEffect.SetUpCustomMessage_ShowCard("Played Card");
 
                                 yield return StartCoroutine(selectCardEffect.Activate());
@@ -380,13 +400,13 @@ namespace DCGO.CardEffects.BT16
                                 isTapped: false,
                                 root: root,
                                 activateETB: true));
-
-                            
                         }
                     }
+
                     yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.AddThisCardToHand(card, activateClass));
                 }
             }
+
             #endregion
 
             return cardEffects;

+ 24 - 18
Assets/CardEffect/BT16/Blue/Mantaraymon_BT16_022.cs

@@ -7,13 +7,13 @@ namespace DCGO.CardEffects.BT16
 {
     public class Mantaraymon_BT16_022 : CEntity_Effect
     {
-        
         public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
         {
             var cardEffects = new List<ICardEffect>();
 
             #region Alternate Digivolution Requirement
-            if(timing == EffectTiming.None)
+
+            if (timing == EffectTiming.None)
             {
                 bool PermanentCondition(Permanent targetPermanent)
                 {
@@ -28,16 +28,20 @@ namespace DCGO.CardEffects.BT16
                     condition: null)
                 );
             }
+
             #endregion
-            
+
             #region Armor Purge
+
             if (timing == EffectTiming.WhenPermanentWouldBeDeleted)
             {
                 cardEffects.Add(CardEffectFactory.ArmorPurgeEffect(card: card));
             }
+
             #endregion
-            
+
             #region When Attacking
+
             if (timing == EffectTiming.OnAllyAttack)
             {
                 ActivateClass activateClass = new ActivateClass();
@@ -47,14 +51,14 @@ namespace DCGO.CardEffects.BT16
 
                 string EffectDiscription()
                 {
-                    return "[When Attacking] Trash any 1 digivolution card of 1 of your opponent's Digimon. Then, return 1 of your " +
-                           "opponent's Digimon with no digivolution cards gains <Security Attack -1> until the end of their turn.";
+                    return
+                        "[When Attacking] Trash any 1 digivolution card of 1 of your opponent's Digimon. Then, 1 of their Digimon with no " +
+                        "digivolution cards gains <Security Attack -1> until the end of their turn.";
                 }
 
                 bool CanSelectPermanentTrashCondition(Permanent permanent)
                 {
-                    return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card) &&
-                           permanent.DigivolutionCards.Count(CanSelectCardCondition) >= 1;
+                    return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
                 }
 
                 bool CanSelectPermanentDebuffCondition(Permanent permanent)
@@ -94,13 +98,13 @@ namespace DCGO.CardEffects.BT16
                 IEnumerator ActivateCoroutine(Hashtable _hashtable)
                 {
                     yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SelectTrashDigivolutionCards(
-                            permanentCondition: CanSelectPermanentTrashCondition,
-                            cardCondition: CanSelectCardCondition,
-                            maxCount: 1,
-                            canNoTrash: false,
-                            isFromOnly1Permanent: true,
-                            activateClass: activateClass
-                        ));
+                        permanentCondition: CanSelectPermanentTrashCondition,
+                        cardCondition: CanSelectCardCondition,
+                        maxCount: 1,
+                        canNoTrash: false,
+                        isFromOnly1Permanent: true,
+                        activateClass: activateClass
+                    ));
 
                     if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentDebuffCondition))
                     {
@@ -120,15 +124,17 @@ namespace DCGO.CardEffects.BT16
                             cardEffect: activateClass);
 
                         yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
-                        
+
                         IEnumerator SelectPermanentCoroutine(Permanent permanent)
                         {
-                            yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonSAttack(targetPermanent: permanent, changeValue: -1, effectDuration: EffectDuration.UntilOpponentTurnEnd, activateClass: activateClass));
+                            yield return ContinuousController.instance.StartCoroutine(
+                                CardEffectCommons.ChangeDigimonSAttack(targetPermanent: permanent, changeValue: -1,
+                                    effectDuration: EffectDuration.UntilOpponentTurnEnd, activateClass: activateClass));
                         }
                     }
                 }
             }
-            
+
             #endregion
 
             return cardEffects;

+ 5 - 8
Assets/CardEffect/BT16/Green/Achillesmon_BT16_047.cs

@@ -147,15 +147,12 @@ namespace DCGO.CardEffects.BT16
                 {
                     if (CardEffectCommons.IsExistOnBattleArea(card))
                     {
-                        if (CardEffectCommons.IsOwnerTurn(card))
-                        {
-                            bool WinnerCondition(Permanent permanent) => permanent.cardSources.Contains(card);
-                            bool LoserCondition(Permanent permanent) => CardEffectCommons.IsOpponentPermanent(permanent, card);
+                        bool WinnerCondition(Permanent permanent) => permanent.cardSources.Contains(card);
+                        bool LoserCondition(Permanent permanent) => CardEffectCommons.IsOpponentPermanent(permanent, card);
 
-                            if (CardEffectCommons.CanTriggerWhenDeleteOpponentDigimonByBattle(hashtable: hashtable, winnerCondition: WinnerCondition, loserCondition: LoserCondition, isOnlyWinnerSurvive: false))
-                            {
-                                return true;
-                            }
+                        if (CardEffectCommons.CanTriggerWhenDeleteOpponentDigimonByBattle(hashtable: hashtable, winnerCondition: WinnerCondition, loserCondition: LoserCondition, isOnlyWinnerSurvive: false))
+                        {
+                            return true;
                         }
                     }
 

+ 3 - 2
Assets/CardEffect/BT16/Purple/DemonWoldOfTheCastleOfNineWolves_BT16_099.cs

@@ -114,9 +114,9 @@ namespace DCGO.CardEffects.BT16
 
                 bool CanSelectCardCondition(CardSource cardSource)
                 {
-                    if (cardSource.HasPlayCost)
+                    if (cardSource.HasPlayCost && cardSource.ContainsTraits("SoC"))
                     {
-                        if (cardSource.ContainsTraits("SoC"))
+                        if (CardEffectCommons.CanPlayAsNewPermanent(cardSource: cardSource, payCost: true, cardEffect: activateClass))
                         {
                             return true;
                         }
@@ -276,6 +276,7 @@ namespace DCGO.CardEffects.BT16
                 ActivateClass activateClass = new ActivateClass();
                 activateClass.SetUpICardEffect(card.BaseENGCardNameFromEntity, CanUseCondition, card);
                 activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDiscription());
+                activateClass.SetIsSecurityEffect(true);
                 cardEffects.Add(activateClass);
 
                 string EffectDiscription()

+ 89 - 133
Assets/CardEffect/BT16/Purple/Dinobeemon_BT16_077.cs

@@ -1,7 +1,5 @@
 using System.Collections;
 using System.Collections.Generic;
-using UnityEngine;
-using System.Linq;
 using System;
 
 namespace DCGO.CardEffects.BT16
@@ -17,6 +15,7 @@ namespace DCGO.CardEffects.BT16
             partitionConditions.Add(new PartitionCondition(4, CardColor.Red));
 
             #region DNA Digivolution
+
             if (timing == EffectTiming.None)
             {
                 AddJogressConditionClass addJogressConditionClass = new AddJogressConditionClass();
@@ -31,7 +30,6 @@ namespace DCGO.CardEffects.BT16
                 }
 
 
-
                 JogressCondition GetJogress(CardSource cardSource)
                 {
                     if (cardSource == card)
@@ -94,9 +92,9 @@ namespace DCGO.CardEffects.BT16
 
                         JogressConditionElement[] elements = new JogressConditionElement[]
                         {
-                        new JogressConditionElement(PermanentCondition1, "a level 4 purple Digimon"),
+                            new JogressConditionElement(PermanentCondition1, "a level 4 purple Digimon"),
 
-                        new JogressConditionElement(PermanentCondition2, "a level 4 red Digimon"),
+                            new JogressConditionElement(PermanentCondition2, "a level 4 red Digimon"),
                         };
 
                         JogressCondition jogressCondition = new JogressCondition(elements, 0);
@@ -107,13 +105,16 @@ namespace DCGO.CardEffects.BT16
                     return null;
                 }
             }
+
             #endregion
 
             #region Raid
+
             if (timing == EffectTiming.OnAllyAttack)
             {
                 cardEffects.Add(CardEffectFactory.RaidSelfEffect(isInheritedEffect: false, card: card, condition: null));
             }
+
             #endregion
 
             #region Partition & Partition Inherit
@@ -137,6 +138,7 @@ namespace DCGO.CardEffects.BT16
                     cardSourceConditions: partitionConditions)
                 );
             }
+
             #endregion
 
             #region When Digivolving
@@ -144,13 +146,16 @@ namespace DCGO.CardEffects.BT16
             if (timing == EffectTiming.OnEnterFieldAnyone)
             {
                 ActivateClass activateClass = new ActivateClass();
-                activateClass.SetUpICardEffect("You may play 1 level 5 or lower Digimon with the [Free] trait. Then 1 Digimon gains [Rush] and can attack.", CanUseCondition, card);
-                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
+                activateClass.SetUpICardEffect(
+                    "You may play 1 level 5 or lower Digimon with the [Free] trait. Then 1 Digimon gains [Rush] and can attack.",
+                    CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDescription());
                 cardEffects.Add(activateClass);
 
-                string EffectDiscription()
+                string EffectDescription()
                 {
-                    return "[When Digivolving] If DNA digivolving, you may play 1 level 5 or lower Digimon with the [Free] trait from your trash without paying the cost. Then, 1 of your Digimon gains [Rush] for the turn and may attack the player.";
+                    return
+                        "[When Digivolving] If DNA digivolving, you may play 1 level 5 or lower Digimon with the [Free] trait from your trash without paying the cost. Then, 1 of your Digimon gains [Rush] for the turn and may attack the player.";
                 }
 
                 bool CanUseCondition(Hashtable hashtable)
@@ -160,164 +165,115 @@ namespace DCGO.CardEffects.BT16
 
                 bool CanSelectCardCondition(CardSource cardSource)
                 {
-                    if (CardEffectCommons.IsExistOnTrash(cardSource))
-                    {
-                        if (cardSource.Level <= 5 && cardSource.ContainsTraits("Free") && (cardSource.IsDigimon))
-                        {
-                            return true;
-                        }
-                    }
-
-                    return false;
+                    return cardSource.HasLevel && cardSource.Level <= 5 && cardSource.ContainsTraits("Free") &&
+                           CardEffectCommons.CanPlayAsNewPermanent(cardSource: cardSource, payCost: false, cardEffect: activateClass);
                 }
 
                 bool CanSelectPermanentCondition(Permanent permanent)
                 {
-                    if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
-                    {
-                        if (permanent.IsDigimon)
-                        {
-                            return true;
-                        }
-                    }
-                    return false;
+                    return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card);
                 }
 
                 bool CanActivateCondition(Hashtable hashtable)
                 {
-                    if (CardEffectCommons.IsExistOnBattleArea(card))
-                    {
-                        return true;
-                    }
-
-                    return false;
+                    return CardEffectCommons.IsExistOnBattleArea(card);
                 }
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
-                    List<CardSource> selectedCards = new List<CardSource>();
-
-                    if (CardEffectCommons.IsJogress(hashtable))
+                    if (CardEffectCommons.IsJogress(hashtable) &&
+                        CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectCardCondition))
                     {
-                        if (CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectCardCondition))
+                        List<CardSource> selectedCards = new List<CardSource>();
+
+                        SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
+
+                        selectCardEffect.SetUp(
+                            canTargetCondition: CanSelectCardCondition,
+                            canTargetCondition_ByPreSelecetedList: null,
+                            canEndSelectCondition: null,
+                            canNoSelect: () => true,
+                            selectCardCoroutine: SelectCardCoroutine,
+                            afterSelectCardCoroutine: null,
+                            message: "Select cards to play.",
+                            maxCount: 1,
+                            canEndNotMax: false,
+                            isShowOpponent: true,
+                            mode: SelectCardEffect.Mode.Custom,
+                            root: SelectCardEffect.Root.Trash,
+                            customRootCardList: null,
+                            canLookReverseCard: true,
+                            selectPlayer: card.Owner,
+                            cardEffect: activateClass);
+
+                        selectCardEffect.SetUpCustomMessage("Select 1 trash card to play.",
+                            "The opponent is selecting 1 trash card to play.");
+                        selectCardEffect.SetUpCustomMessage_ShowCard("Played Card");
+
+                        IEnumerator SelectCardCoroutine(CardSource cardSource)
                         {
-                            int maxCount1 = 1;
-
-                            SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
-
-                            selectCardEffect.SetUp(
-                                        canTargetCondition: CanSelectCardCondition,
-                                        canTargetCondition_ByPreSelecetedList: null,
-                                        canEndSelectCondition: null,
-                                        canNoSelect: () => true,
-                                        selectCardCoroutine: SelectCardCoroutine,
-                                        afterSelectCardCoroutine: null,
-                                        message: "Select 1 card to play.",
-                                        maxCount: maxCount1,
-                                        canEndNotMax: false,
-                                        isShowOpponent: true,
-                                        mode: SelectCardEffect.Mode.Custom,
-                                        root: SelectCardEffect.Root.Custom,
-                                        customRootCardList: card.Owner.TrashCards,
-                                        canLookReverseCard: true,
-                                        selectPlayer: card.Owner,
-                                        cardEffect: activateClass);
-
-                            selectCardEffect.SetUpCustomMessage("Select 1 trash card to play.", "The opponent is selecting 1 trash card to play.");
-                            selectCardEffect.SetUpCustomMessage_ShowCard("Played Card");
-
-
-                            IEnumerator SelectCardCoroutine(CardSource cardSource)
-                            {
-                                selectedCards.Add(cardSource);
+                            selectedCards.Add(cardSource);
 
-                                yield return null;
-                            }
+                            yield return null;
+                        }
 
-                            yield return StartCoroutine(selectCardEffect.Activate());
+                        yield return StartCoroutine(selectCardEffect.Activate());
 
-                            yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(
                             cardSources: selectedCards,
                             activateClass: activateClass,
                             payCost: false,
                             isTapped: false,
                             root: SelectCardEffect.Root.Trash,
                             activateETB: true));
-                        }
                     }
 
-                    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 select a Digimon to gain Rush and must attack?";
-                    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 gainRush = GManager.instance.userSelectionManager.SelectedBoolValue;
-
-                if (gainRush)
-                {
-                        if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
+                    if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
+                    {
+                        SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                        selectPermanentEffect.SetUp(
+                            selectPlayer: card.Owner,
+                            canTargetCondition: CanSelectPermanentCondition,
+                            canTargetCondition_ByPreSelecetedList: null,
+                            canEndSelectCondition: null,
+                            maxCount: 1,
+                            canNoSelect: true,
+                            canEndNotMax: false,
+                            selectPermanentCoroutine: SelectPermanentCoroutine,
+                            afterSelectPermanentCoroutine: null,
+                            mode: SelectPermanentEffect.Mode.Custom,
+                            cardEffect: activateClass);
+
+                        selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will gain Rush and attack a player.",
+                            "The opponent is selecting 1 Digimon that will gain Rush and attack a player.");
+
+                        yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+
+                        IEnumerator SelectPermanentCoroutine(Permanent permanent)
                         {
-                            int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
-
-                            SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
-
-                            selectPermanentEffect.SetUp(
-                                selectPlayer: card.Owner,
-                                canTargetCondition: CanSelectPermanentCondition,
-                                canTargetCondition_ByPreSelecetedList: null,
-                                canEndSelectCondition: null,
-                                maxCount: maxCount,
-                                canNoSelect: false,
-                                canEndNotMax: false,
-                                selectPermanentCoroutine: SelectPermanentCoroutine,
-                                afterSelectPermanentCoroutine: null,
-                                mode: SelectPermanentEffect.Mode.Custom,
-                                cardEffect: activateClass);
-
-                            selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will get Rush.", "The opponent is selecting 1 Digimon that will get Rush.");
+                            yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainRush(
+                                targetPermanent: permanent,
+                                effectDuration: EffectDuration.UntilEachTurnEnd,
+                                activateClass: activateClass));
 
-                            yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
-
-                            IEnumerator SelectPermanentCoroutine(Permanent permanent)
+                            if (permanent.CanAttack(activateClass))
                             {
-                                Permanent selectedPermanent = permanent;
-
-                                if (selectedPermanent != null)
-                                {
-                                    yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainRush(
-                                        targetPermanent: selectedPermanent,
-                                        effectDuration: EffectDuration.UntilEachTurnEnd,
-                                        activateClass: activateClass));
-
-                                    if (selectedPermanent.CanAttack(activateClass))
-                                    {
-                                        SelectAttackEffect selectAttackEffect = GManager.instance.GetComponent<SelectAttackEffect>();
-
-                                        selectAttackEffect.SetUp(
-                                            attacker: selectedPermanent,
-                                            canAttackPlayerCondition: () => true,
-                                            defenderCondition: (permanent) => false,
-                                            cardEffect: activateClass);
-
-                                        yield return ContinuousController.instance.StartCoroutine(selectAttackEffect.Activate());
-                                    }
-                                }
+                                SelectAttackEffect selectAttackEffect = GManager.instance.GetComponent<SelectAttackEffect>();
 
+                                selectAttackEffect.SetUp(
+                                    attacker: permanent,
+                                    canAttackPlayerCondition: () => true,
+                                    defenderCondition: _ => false,
+                                    cardEffect: activateClass);
 
+                                yield return ContinuousController.instance.StartCoroutine(selectAttackEffect.Activate());
                             }
                         }
+                    }
                 }
             }
-        }
+
             #endregion
 
             return cardEffects;

+ 121 - 97
Assets/CardEffect/BT16/Purple/GesomonXAntibody_BT16_069.cs

@@ -15,6 +15,7 @@ namespace DCGO.CardEffects.BT16
             List<ICardEffect> cardEffects = new List<ICardEffect>();
 
             #region Digivolution Condition
+
             if (timing == EffectTiming.None)
             {
                 bool PermanentCondition(Permanent targetPermanent)
@@ -22,11 +23,14 @@ namespace DCGO.CardEffects.BT16
                     return targetPermanent.TopCard.CardNames.Contains("Gesomon");
                 }
 
-                cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(permanentCondition: PermanentCondition, digivolutionCost: 0, ignoreDigivolutionRequirement: false, card: card, condition: null));
+                cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(permanentCondition: PermanentCondition,
+                    digivolutionCost: 0, ignoreDigivolutionRequirement: false, card: card, condition: null));
             }
+
             #endregion
 
             #region On Play
+
             if (timing == EffectTiming.OnEnterFieldAnyone)
             {
                 ActivateClass activateClass = new ActivateClass();
@@ -36,7 +40,8 @@ namespace DCGO.CardEffects.BT16
 
                 string EffectDiscription()
                 {
-                    return "[On Play] If [Gesomon] or [X-Antibody] is in this Digimon's digivolution cards, trash the bottom 3 cards under 1 of your opponent's Digimon or Tamers. Then, 1 of their Digimon or Tamers without cards under it can't suspend until the end of their turn.";
+                    return
+                        "[On Play] If [Gesomon] or [X-Antibody] is in this Digimon's digivolution cards, trash the bottom 3 cards under 1 of your opponent's Digimon or Tamers. Then, 1 of their Digimon or Tamers without cards under it can't suspend until the end of their turn.";
                 }
 
                 bool CanUseCondition(Hashtable hashtable)
@@ -44,13 +49,32 @@ namespace DCGO.CardEffects.BT16
                     return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
                 }
 
+                bool SelectSourceCardCondition(CardSource cardSource)
+                {
+                    return cardSource.EqualsCardName("Gesomon") || cardSource.CardNames.Contains("X Antibody") ||
+                           cardSource.CardNames.Contains("XAntibody");
+                }
+
                 bool CanSelectPermanentCondition(Permanent permanent)
                 {
                     if (CardEffectCommons.IsPermanentExistsOnOpponentBattleArea(permanent, card))
                     {
                         if (permanent.IsDigimon || permanent.IsTamer)
                         {
-                            if (permanent.DigivolutionCards.Count(CanSelectCardCondition1) >= 1)
+                            return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                bool CanSelectTrashSourceCondition(Permanent permanent)
+                {
+                    if (CardEffectCommons.IsPermanentExistsOnOpponentBattleArea(permanent, card))
+                    {
+                        if (permanent.IsDigimon || permanent.IsTamer)
+                        {
+                            if (permanent.DigivolutionCards.Count(CanSelectCardCondition) >= 1)
                             {
                                 return true;
                             }
@@ -60,12 +84,12 @@ namespace DCGO.CardEffects.BT16
                     return false;
                 }
 
-                bool CanSelectCardCondition1(CardSource cardSource)
+                bool CanSelectCardCondition(CardSource cardSource)
                 {
                     return !cardSource.CanNotTrashFromDigivolutionCards(activateClass);
                 }
 
-                bool CanSelectPermanentToNoSuspend(Permanent permanent)
+                bool CanSelectPermanentToNoSuspendCondition(Permanent permanent)
                 {
                     if (CardEffectCommons.IsPermanentExistsOnOpponentBattleArea(permanent, card))
                     {
@@ -83,9 +107,17 @@ namespace DCGO.CardEffects.BT16
 
                 bool CanActivateCondition(Hashtable hashtable)
                 {
-                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
                     {
-                        if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentToNoSuspend) || CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
+                        if (CardEffectCommons.HasMatchConditionPermanent(CanSelectTrashSourceCondition))
+                        {
+                            if (card.PermanentOfThisCard().DigivolutionCards.Some(SelectSourceCardCondition))
+                            {
+                                return true;
+                            }
+                        }
+
+                        if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentToNoSuspendCondition))
                         {
                             return true;
                         }
@@ -96,46 +128,29 @@ namespace DCGO.CardEffects.BT16
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
-                    if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition) && card.PermanentOfThisCard().DigivolutionCards.Count((cardSource) => cardSource.CardNames.Contains("Gesomon") || cardSource.CardNames.Contains("X Antibody") || cardSource.CardNames.Contains("XAntibody")) >= 1)
+                    if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition) &&
+                        card.PermanentOfThisCard().DigivolutionCards.Some(SelectSourceCardCondition))
                     {
-                        int maxCountToTrash = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
-
-                        SelectPermanentEffect selectPermanentEffectTrash = GManager.instance.GetComponent<SelectPermanentEffect>();
-
-                        selectPermanentEffectTrash.SetUp(
-                            selectPlayer: card.Owner,
-                            canTargetCondition: CanSelectPermanentCondition,
-                            canTargetCondition_ByPreSelecetedList: null,
-                            canEndSelectCondition: null,
-                            maxCount: maxCountToTrash,
-                            canNoSelect: false,
-                            canEndNotMax: false,
-                            selectPermanentCoroutine: SelectPermanentCoroutine,
-                            afterSelectPermanentCoroutine: null,
-                            mode: SelectPermanentEffect.Mode.Custom,
-                            cardEffect: activateClass);
-
-                        selectPermanentEffectTrash.SetUpCustomMessage("Select 1 Digimon or Tamer that will trash digivolution cards.", "The opponent is selecting 1 Digimon or Tamer that will trash digivolution cards.");
-
-                        yield return ContinuousController.instance.StartCoroutine(selectPermanentEffectTrash.Activate());
-
-                        IEnumerator SelectPermanentCoroutine(Permanent permanent)
-                        {
-                            Permanent selectedPermanent = permanent;
-
-                            yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.TrashDigivolutionCardsFromTopOrBottom(targetPermanent: selectedPermanent, trashCount: 3, isFromTop: false, activateClass: activateClass));
-                        }
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SelectTrashDigivolutionCards(
+                            permanentCondition: CanSelectTrashSourceCondition,
+                            cardCondition: CanSelectCardCondition,
+                            maxCount: 3,
+                            canNoTrash: false,
+                            isFromOnly1Permanent: true,
+                            activateClass: activateClass
+                        ));
                     }
 
-                    if (card.Owner.Enemy.GetBattleAreaPermanents().Count(CanSelectPermanentToNoSuspend) >= 1)
+                    if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentToNoSuspendCondition))
                     {
-                        int maxCount = Math.Min(1, card.Owner.Enemy.GetBattleAreaPermanents().Count(CanSelectPermanentToNoSuspend));
+                        int maxCount = Math.Min(1,
+                            card.Owner.Enemy.GetBattleAreaPermanents().Count(CanSelectPermanentToNoSuspendCondition));
 
                         SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
 
                         selectPermanentEffect.SetUp(
                             selectPlayer: card.Owner,
-                            canTargetCondition: CanSelectPermanentToNoSuspend,
+                            canTargetCondition: CanSelectPermanentToNoSuspendCondition,
                             canTargetCondition_ByPreSelecetedList: null,
                             canEndSelectCondition: null,
                             maxCount: maxCount,
@@ -146,7 +161,8 @@ namespace DCGO.CardEffects.BT16
                             mode: SelectPermanentEffect.Mode.Custom,
                             cardEffect: activateClass);
 
-                        selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon or Tamer that will get unable to suspend.", "The opponent is selecting 1 Digimon or Tamer that will get unable to suspend.");
+                        selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon or Tamer that will get unable to suspend.",
+                            "The opponent is selecting 1 Digimon or Tamer that will get unable to suspend.");
 
                         yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
 
@@ -163,7 +179,8 @@ namespace DCGO.CardEffects.BT16
 
                                 if (!selectedPermanent.TopCard.CanNotBeAffected(activateClass))
                                 {
-                                    yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().CreateDebuffEffect(selectedPermanent));
+                                    yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>()
+                                        .CreateDebuffEffect(selectedPermanent));
                                 }
 
                                 bool CanUseCondition1(Hashtable hashtable)
@@ -193,9 +210,11 @@ namespace DCGO.CardEffects.BT16
                     }
                 }
             }
+
             #endregion
 
             #region When Digivolving
+
             if (timing == EffectTiming.OnEnterFieldAnyone)
             {
                 ActivateClass activateClass = new ActivateClass();
@@ -205,7 +224,8 @@ namespace DCGO.CardEffects.BT16
 
                 string EffectDiscription()
                 {
-                    return "[When Digivolving] If [Gesomon] or [X-Antibody] is in this Digimon's digivolution cards, trash the bottom 3 cards under 1 of your opponent's Digimon or Tamers. Then, 1 of their Digimon or Tamers without cards under it can't suspend until the end of their turn.";
+                    return
+                        "[When Digivolving] If [Gesomon] or [X-Antibody] is in this Digimon's digivolution cards, trash the bottom 3 cards under 1 of your opponent's Digimon or Tamers. Then, 1 of their Digimon or Tamers without cards under it can't suspend until the end of their turn.";
                 }
 
                 bool CanUseCondition(Hashtable hashtable)
@@ -213,13 +233,32 @@ namespace DCGO.CardEffects.BT16
                     return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
                 }
 
+                bool SelectSourceCardCondition(CardSource cardSource)
+                {
+                    return cardSource.EqualsCardName("Gesomon") || cardSource.CardNames.Contains("X Antibody") ||
+                           cardSource.CardNames.Contains("XAntibody");
+                }
+
                 bool CanSelectPermanentCondition(Permanent permanent)
                 {
                     if (CardEffectCommons.IsPermanentExistsOnOpponentBattleArea(permanent, card))
                     {
                         if (permanent.IsDigimon || permanent.IsTamer)
                         {
-                            if (permanent.DigivolutionCards.Count(CanSelectCardCondition1) >= 1)
+                            return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                bool CanSelectTrashSourceCondition(Permanent permanent)
+                {
+                    if (CardEffectCommons.IsPermanentExistsOnOpponentBattleArea(permanent, card))
+                    {
+                        if (permanent.IsDigimon || permanent.IsTamer)
+                        {
+                            if (permanent.DigivolutionCards.Count(CanSelectCardCondition) >= 1)
                             {
                                 return true;
                             }
@@ -229,12 +268,12 @@ namespace DCGO.CardEffects.BT16
                     return false;
                 }
 
-                bool CanSelectCardCondition1(CardSource cardSource)
+                bool CanSelectCardCondition(CardSource cardSource)
                 {
                     return !cardSource.CanNotTrashFromDigivolutionCards(activateClass);
                 }
 
-                bool CanSelectPermanentToNoSuspend(Permanent permanent)
+                bool CanSelectPermanentToNoSuspendCondition(Permanent permanent)
                 {
                     if (CardEffectCommons.IsPermanentExistsOnOpponentBattleArea(permanent, card))
                     {
@@ -252,9 +291,17 @@ namespace DCGO.CardEffects.BT16
 
                 bool CanActivateCondition(Hashtable hashtable)
                 {
-                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
                     {
-                        if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentToNoSuspend) || CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
+                        if (CardEffectCommons.HasMatchConditionPermanent(CanSelectTrashSourceCondition))
+                        {
+                            if (card.PermanentOfThisCard().DigivolutionCards.Some(SelectSourceCardCondition))
+                            {
+                                return true;
+                            }
+                        }
+
+                        if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentToNoSuspendCondition))
                         {
                             return true;
                         }
@@ -265,46 +312,29 @@ namespace DCGO.CardEffects.BT16
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
-                    if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition) && card.PermanentOfThisCard().DigivolutionCards.Count((cardSource) => cardSource.CardNames.Contains("Gesomon") || cardSource.CardNames.Contains("X Antibody") || cardSource.CardNames.Contains("XAntibody")) >= 1)
+                    if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition) &&
+                        card.PermanentOfThisCard().DigivolutionCards.Some(SelectSourceCardCondition))
                     {
-                        int maxCountToTrash = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
-
-                        SelectPermanentEffect selectPermanentEffectTrash = GManager.instance.GetComponent<SelectPermanentEffect>();
-
-                        selectPermanentEffectTrash.SetUp(
-                            selectPlayer: card.Owner,
-                            canTargetCondition: CanSelectPermanentCondition,
-                            canTargetCondition_ByPreSelecetedList: null,
-                            canEndSelectCondition: null,
-                            maxCount: maxCountToTrash,
-                            canNoSelect: false,
-                            canEndNotMax: false,
-                            selectPermanentCoroutine: SelectPermanentCoroutine,
-                            afterSelectPermanentCoroutine: null,
-                            mode: SelectPermanentEffect.Mode.Custom,
-                            cardEffect: activateClass);
-
-                        selectPermanentEffectTrash.SetUpCustomMessage("Select 1 Digimon or Tamer that will trash digivolution cards.", "The opponent is selecting 1 Digimon or Tamer that will trash digivolution cards.");
-
-                        yield return ContinuousController.instance.StartCoroutine(selectPermanentEffectTrash.Activate());
-
-                        IEnumerator SelectPermanentCoroutine(Permanent permanent)
-                        {
-                            Permanent selectedPermanent = permanent;
-
-                            yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.TrashDigivolutionCardsFromTopOrBottom(targetPermanent: selectedPermanent, trashCount: 3, isFromTop: false, activateClass: activateClass));
-                        }
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SelectTrashDigivolutionCards(
+                            permanentCondition: CanSelectTrashSourceCondition,
+                            cardCondition: CanSelectCardCondition,
+                            maxCount: 3,
+                            canNoTrash: false,
+                            isFromOnly1Permanent: true,
+                            activateClass: activateClass
+                        ));
                     }
 
-                    if (card.Owner.Enemy.GetBattleAreaPermanents().Count(CanSelectPermanentToNoSuspend) >= 1)
+                    if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentToNoSuspendCondition))
                     {
-                        int maxCount = Math.Min(1, card.Owner.Enemy.GetBattleAreaPermanents().Count(CanSelectPermanentToNoSuspend));
+                        int maxCount = Math.Min(1,
+                            card.Owner.Enemy.GetBattleAreaPermanents().Count(CanSelectPermanentToNoSuspendCondition));
 
                         SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
 
                         selectPermanentEffect.SetUp(
                             selectPlayer: card.Owner,
-                            canTargetCondition: CanSelectPermanentToNoSuspend,
+                            canTargetCondition: CanSelectPermanentToNoSuspendCondition,
                             canTargetCondition_ByPreSelecetedList: null,
                             canEndSelectCondition: null,
                             maxCount: maxCount,
@@ -315,7 +345,8 @@ namespace DCGO.CardEffects.BT16
                             mode: SelectPermanentEffect.Mode.Custom,
                             cardEffect: activateClass);
 
-                        selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon or Tamer that will get unable to suspend.", "The opponent is selecting 1 Digimon or Tamer that will get unable to suspend.");
+                        selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon or Tamer that will get unable to suspend.",
+                            "The opponent is selecting 1 Digimon or Tamer that will get unable to suspend.");
 
                         yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
 
@@ -332,7 +363,8 @@ namespace DCGO.CardEffects.BT16
 
                                 if (!selectedPermanent.TopCard.CanNotBeAffected(activateClass))
                                 {
-                                    yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().CreateDebuffEffect(selectedPermanent));
+                                    yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>()
+                                        .CreateDebuffEffect(selectedPermanent));
                                 }
 
                                 bool CanUseCondition1(Hashtable hashtable)
@@ -362,21 +394,24 @@ namespace DCGO.CardEffects.BT16
                     }
                 }
             }
+
             #endregion
 
             #region Inherit
+
             if (timing == EffectTiming.OnAllyAttack)
             {
                 ActivateClass activateClass = new ActivateClass();
                 activateClass.SetUpICardEffect("Draw 1 and trash 1 card from hand", CanUseCondition, card);
-                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
                 activateClass.SetIsInheritedEffect(true);
-                activateClass.SetHashString("DrawTrashBT16_069");
+                activateClass.SetHashString("DrawTrashBT16_066");
                 cardEffects.Add(activateClass);
 
                 string EffectDiscription()
                 {
-                    return "[When Attacking] [Once Per Turn] Trigger <Draw 1>. (Draw 1 cards from your deck.) Then trash 1 card from your hand.";
+                    return
+                        "[When Attacking] [Once Per Turn] Trigger <Draw 1>. (Draw 1 cards from your deck.) Then trash 1 card from your hand.";
                 }
 
                 bool CanUseCondition(Hashtable hashtable)
@@ -386,25 +421,13 @@ namespace DCGO.CardEffects.BT16
 
                 bool CanActivateCondition(Hashtable hashtable)
                 {
-                    if (CardEffectCommons.CanActivateOnDeletionInherited(hashtable, card))
-                    {
-                        if (card.Owner.LibraryCards.Count >= 1)
-                        {
-                            return true;
-                        }
-
-                        if (card.Owner.HandCards.Count >= 1)
-                        {
-                            return true;
-                        }
-                    }
-
-                    return false;
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
                 }
 
                 IEnumerator ActivateCoroutine(Hashtable _hashtable)
                 {
-                    yield return ContinuousController.instance.StartCoroutine(new DrawClass(card.Owner, 1, activateClass).Draw());
+                    if (card.Owner.LibraryCards.Count >= 1)
+                        yield return ContinuousController.instance.StartCoroutine(new DrawClass(card.Owner, 1, activateClass).Draw());
 
                     if (card.Owner.HandCards.Count >= 1)
                     {
@@ -430,6 +453,7 @@ namespace DCGO.CardEffects.BT16
                     }
                 }
             }
+
             #endregion
 
             return cardEffects;

+ 156 - 184
Assets/CardEffect/BT16/Purple/MaloMyotismon_BT16_081.cs

@@ -1,10 +1,6 @@
 using System.Collections;
 using System.Collections.Generic;
-using UnityEngine;
-using System.Linq;
-using Photon;
 using System;
-using Photon.Pun;
 
 namespace DCGO.CardEffects.BT16
 {
@@ -15,51 +11,58 @@ namespace DCGO.CardEffects.BT16
             List<ICardEffect> cardEffects = new List<ICardEffect>();
 
             #region When Digivolving
+
             if (timing == EffectTiming.OnEnterFieldAnyone)
             {
                 ActivateClass activateClass = new ActivateClass();
-                activateClass.SetUpICardEffect("Delete your Digimon or Tamer to delete an opponent's unsuspended Digimon. Otherwise delete 1 of your opponent's tamers.", CanUseCondition, card);
-                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
+                activateClass.SetUpICardEffect(
+                    "Delete your Digimon or Tamer to delete an opponent's unsuspended Digimon. Otherwise delete 1 of your opponent's tamers.",
+                    CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription());
                 cardEffects.Add(activateClass);
 
-                string EffectDiscription()
+                string EffectDescription()
                 {
-                    return "[When Digivolving] By deleting one of your Digimon or Tamers, delete 1 of your opponent's unsuspended Digimon. If no Digimon is deleted by this effect, delete one of your opponent's tamers.";
+                    return
+                        "[When Digivolving] By deleting one of your Digimon or Tamers, delete 1 of your opponent's unsuspended Digimon. If no Digimon is deleted by this effect, delete one of your opponent's tamers.";
                 }
 
                 bool CanSelectPermanentCondition(Permanent permanent)
                 {
-                    if(CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent,card))
+                    if (CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card))
                     {
-                        if(permanent.IsDigimon || permanent.IsTamer)
+                        if (permanent.IsDigimon || permanent.IsTamer)
                         {
                             return true;
                         }
                     }
+
                     return false;
                 }
 
                 bool CanSelectOpponentUnsuspendedDigimon(Permanent permanent)
                 {
-                    if(CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent,card))
+                    if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
                     {
-                        if(permanent.IsDigimon && !permanent.IsSuspended)
+                        if (permanent.IsDigimon && !permanent.IsSuspended)
                         {
                             return true;
                         }
                     }
+
                     return false;
                 }
 
                 bool CanSelectOpponentTamer(Permanent permanent)
                 {
-                    if (CardEffectCommons.IsPermanentExistsOnOpponentBattleArea(permanent,card))
+                    if (CardEffectCommons.IsPermanentExistsOnOpponentBattleArea(permanent, card))
                     {
-                        if(permanent.IsTamer)
+                        if (permanent.IsTamer)
                         {
                             return true;
                         }
                     }
+
                     return false;
                 }
 
@@ -81,140 +84,122 @@ namespace DCGO.CardEffects.BT16
                     return false;
                 }
 
-                IEnumerator ActivateCoroutine(Hashtable _hashtable)
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
-                    List<Permanent> deleteTargetPermanents = new List<Permanent>();
-
-                    //Delete one of your digimon/tamers
-                    if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
+                    SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                    selectPermanentEffect.SetUp(
+                        selectPlayer: card.Owner,
+                        canTargetCondition: CanSelectPermanentCondition,
+                        canTargetCondition_ByPreSelecetedList: null,
+                        canEndSelectCondition: null,
+                        maxCount: 1,
+                        canNoSelect: true,
+                        canEndNotMax: false,
+                        selectPermanentCoroutine: SelectPermanentCoroutine1,
+                        afterSelectPermanentCoroutine: null,
+                        mode: SelectPermanentEffect.Mode.Custom,
+                        cardEffect: activateClass);
+
+                    selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon to delete.",
+                        "The opponent is selecting 1 Digimon to delete.");
+
+                    yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+
+                    IEnumerator SelectPermanentCoroutine1(Permanent permanent)
                     {
-                        int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
-
-                        SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
-
-                        selectPermanentEffect.SetUp(
-                            selectPlayer: card.Owner,
-                            canTargetCondition: CanSelectPermanentCondition,
-                            canTargetCondition_ByPreSelecetedList: null,
-                            canEndSelectCondition: null,
-                            maxCount: maxCount,
-                            canNoSelect: true,
-                            canEndNotMax: false,
-                            selectPermanentCoroutine: null,
-                            afterSelectPermanentCoroutine: AfterSelectPermanentCoroutine,
-                            mode: SelectPermanentEffect.Mode.Custom,
-                            cardEffect: activateClass);
-
-                        selectPermanentEffect.SetUpCustomMessage("Select 1 of your Digimon or Tamers to delete.", "The opponent is selecting 1 Digimon or Tamer to delete.");
-
-                        yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
-
-                        IEnumerator AfterSelectPermanentCoroutine(List<Permanent> permanents)
-                        {
-                            foreach (Permanent permanent in permanents)
-                            {
-                                deleteTargetPermanents.Add(permanent);
-                            }
-
-                            yield return null;
-                        }
+                        yield return ContinuousController.instance.StartCoroutine(
+                            CardEffectCommons.DeletePeremanentAndProcessAccordingToResult(
+                                targetPermanents: new List<Permanent>() { permanent }, activateClass: activateClass,
+                                successProcess: _ => SuccessProcess(), failureProcess: null));
                     }
 
-                    yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.DeletePeremanentAndProcessAccordingToResult(targetPermanents: deleteTargetPermanents, activateClass: activateClass, successProcess: permanents => SuccessProcess(), failureProcess: null));
-
-                    //Did I delete my Digimon/Tamer successfully
                     IEnumerator SuccessProcess()
                     {
                         List<Permanent> targetPermanents = new List<Permanent>();
 
                         if (CardEffectCommons.HasMatchConditionPermanent(CanSelectOpponentUnsuspendedDigimon))
                         {
-                            int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectOpponentUnsuspendedDigimon));
-
-                            SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+                            selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
 
                             selectPermanentEffect.SetUp(
                                 selectPlayer: card.Owner,
                                 canTargetCondition: CanSelectOpponentUnsuspendedDigimon,
                                 canTargetCondition_ByPreSelecetedList: null,
                                 canEndSelectCondition: null,
-                                maxCount: maxCount,
+                                maxCount: 1,
                                 canNoSelect: false,
                                 canEndNotMax: false,
-                                selectPermanentCoroutine: null,
-                                afterSelectPermanentCoroutine: AfterSelectPermanentCoroutine,
+                                selectPermanentCoroutine: SelectPermanentCoroutine2,
+                                afterSelectPermanentCoroutine: null,
                                 mode: SelectPermanentEffect.Mode.Custom,
                                 cardEffect: activateClass);
 
-                            selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon to delete.", "The opponent is selecting 1 Digimon to delete.");
+                            selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon to delete.",
+                                "The opponent is selecting 1 Digimon to delete.");
 
                             yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
 
-                            IEnumerator AfterSelectPermanentCoroutine(List<Permanent> permanents)
+                            IEnumerator SelectPermanentCoroutine2(Permanent permanent)
                             {
-                                foreach (Permanent permanent in permanents)
-                                {
-                                    targetPermanents.Add(permanent);
-                                }
+                                targetPermanents.Add(permanent);
 
                                 yield return null;
                             }
-
-
-                            yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.DeletePeremanentAndProcessAccordingToResult(targetPermanents: targetPermanents, activateClass: activateClass, successProcess: null, failureProcess: FailureProcess));
-                        }
-                        else
-                        {
-                            yield return ContinuousController.instance.StartCoroutine("FailureProcess");
                         }
 
+                        yield return ContinuousController.instance.StartCoroutine(
+                            CardEffectCommons.DeletePeremanentAndProcessAccordingToResult(targetPermanents: targetPermanents,
+                                activateClass: activateClass, successProcess: null, failureProcess: FailureProcess));
+
                         IEnumerator FailureProcess()
                         {
                             targetPermanents.Clear();
 
-                            if (CardEffectCommons.IsExistOnBattleArea(card))
+                            if (CardEffectCommons.HasMatchConditionPermanent(CanSelectOpponentTamer))
                             {
-                                if (CardEffectCommons.HasMatchConditionPermanent(CanSelectOpponentTamer))
-                                {
-                                    int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectOpponentTamer));
-
-                                    SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
-
-                                    selectPermanentEffect.SetUp(
-                                        selectPlayer: card.Owner,
-                                        canTargetCondition: CanSelectOpponentTamer,
-                                        canTargetCondition_ByPreSelecetedList: null,
-                                        canEndSelectCondition: null,
-                                        maxCount: maxCount,
-                                        canNoSelect: false,
-                                        canEndNotMax: false,
-                                        selectPermanentCoroutine: null,
-                                        afterSelectPermanentCoroutine: null,
-                                        mode: SelectPermanentEffect.Mode.Destroy,
-                                        cardEffect: activateClass);
-
-                                    selectPermanentEffect.SetUpCustomMessage("Select 1 Tamer to delete.", "The opponent is selecting 1 Tamer to delete.");
-
-                                    yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
-                                }
+                                selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                                selectPermanentEffect.SetUp(
+                                    selectPlayer: card.Owner,
+                                    canTargetCondition: CanSelectOpponentTamer,
+                                    canTargetCondition_ByPreSelecetedList: null,
+                                    canEndSelectCondition: null,
+                                    maxCount: 1,
+                                    canNoSelect: false,
+                                    canEndNotMax: false,
+                                    selectPermanentCoroutine: null,
+                                    afterSelectPermanentCoroutine: null,
+                                    mode: SelectPermanentEffect.Mode.Destroy,
+                                    cardEffect: activateClass);
+
+                                selectPermanentEffect.SetUpCustomMessage("Select 1 Tamer to delete.",
+                                    "The opponent is selecting 1 Tamer to delete.");
+
+                                yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
                             }
                         }
                     }
                 }
             }
+
             #endregion
 
             #region When Attacking
+
             if (timing == EffectTiming.OnAllyAttack)
             {
                 ActivateClass activateClass = new ActivateClass();
-                activateClass.SetUpICardEffect("Delete your Digimon or Tamer to delete an opponent's unsuspended Digimon. Otherwise delete 1 of your opponent's tamers.", CanUseCondition, card);
-                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
+                activateClass.SetUpICardEffect(
+                    "Delete your Digimon or Tamer to delete an opponent's unsuspended Digimon. Otherwise delete 1 of your opponent's tamers.",
+                    CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription());
                 cardEffects.Add(activateClass);
 
-                string EffectDiscription()
+                string EffectDescription()
                 {
-                    return "[When Attacking] By deleting one of your Digimon or Tamers, delete 1 of your opponent's unsuspended Digimon. If no Digimon is deleted by this effect, delete one of your opponent's tamers.";
+                    return
+                        "[When Attacking] By deleting one of your Digimon or Tamers, delete 1 of your opponent's unsuspended Digimon. If no Digimon is deleted by this effect, delete one of your opponent's tamers.";
                 }
 
                 bool CanSelectPermanentCondition(Permanent permanent)
@@ -226,6 +211,7 @@ namespace DCGO.CardEffects.BT16
                             return true;
                         }
                     }
+
                     return false;
                 }
 
@@ -238,6 +224,7 @@ namespace DCGO.CardEffects.BT16
                             return true;
                         }
                     }
+
                     return false;
                 }
 
@@ -250,6 +237,7 @@ namespace DCGO.CardEffects.BT16
                             return true;
                         }
                     }
+
                     return false;
                 }
 
@@ -271,152 +259,135 @@ namespace DCGO.CardEffects.BT16
                     return false;
                 }
 
-                IEnumerator ActivateCoroutine(Hashtable _hashtable)
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
-                    List<Permanent> deleteTargetPermanents = new List<Permanent>();
-
-                    //Delete one of your digimon/tamers
-                    if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
+                    SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                    selectPermanentEffect.SetUp(
+                        selectPlayer: card.Owner,
+                        canTargetCondition: CanSelectPermanentCondition,
+                        canTargetCondition_ByPreSelecetedList: null,
+                        canEndSelectCondition: null,
+                        maxCount: 1,
+                        canNoSelect: true,
+                        canEndNotMax: false,
+                        selectPermanentCoroutine: SelectPermanentCoroutine1,
+                        afterSelectPermanentCoroutine: null,
+                        mode: SelectPermanentEffect.Mode.Custom,
+                        cardEffect: activateClass);
+
+                    selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon to delete.",
+                        "The opponent is selecting 1 Digimon to delete.");
+
+                    yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+
+                    IEnumerator SelectPermanentCoroutine1(Permanent permanent)
                     {
-                        int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
-
-                        SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
-
-                        selectPermanentEffect.SetUp(
-                            selectPlayer: card.Owner,
-                            canTargetCondition: CanSelectPermanentCondition,
-                            canTargetCondition_ByPreSelecetedList: null,
-                            canEndSelectCondition: null,
-                            maxCount: maxCount,
-                            canNoSelect: true,
-                            canEndNotMax: false,
-                            selectPermanentCoroutine: null,
-                            afterSelectPermanentCoroutine: AfterSelectPermanentCoroutine,
-                            mode: SelectPermanentEffect.Mode.Custom,
-                            cardEffect: activateClass);
-
-                        selectPermanentEffect.SetUpCustomMessage("Select 1 of your Digimon or Tamers to delete.", "The opponent is selecting 1 Digimon or Tamer to delete.");
-
-                        yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
-
-                        IEnumerator AfterSelectPermanentCoroutine(List<Permanent> permanents)
-                        {
-                            foreach (Permanent permanent in permanents)
-                            {
-                                deleteTargetPermanents.Add(permanent);
-                            }
-
-                            yield return null;
-                        }
+                        yield return ContinuousController.instance.StartCoroutine(
+                            CardEffectCommons.DeletePeremanentAndProcessAccordingToResult(
+                                targetPermanents: new List<Permanent>() { permanent }, activateClass: activateClass,
+                                successProcess: _ => SuccessProcess(), failureProcess: null));
                     }
 
-                    yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.DeletePeremanentAndProcessAccordingToResult(targetPermanents: deleteTargetPermanents, activateClass: activateClass, successProcess: permanents => SuccessProcess(), failureProcess: null));
-
-                    //Did I delete my Digimon/Tamer successfully
                     IEnumerator SuccessProcess()
                     {
                         List<Permanent> targetPermanents = new List<Permanent>();
 
                         if (CardEffectCommons.HasMatchConditionPermanent(CanSelectOpponentUnsuspendedDigimon))
                         {
-                            int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectOpponentUnsuspendedDigimon));
-
-                            SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+                            selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
 
                             selectPermanentEffect.SetUp(
                                 selectPlayer: card.Owner,
                                 canTargetCondition: CanSelectOpponentUnsuspendedDigimon,
                                 canTargetCondition_ByPreSelecetedList: null,
                                 canEndSelectCondition: null,
-                                maxCount: maxCount,
+                                maxCount: 1,
                                 canNoSelect: false,
                                 canEndNotMax: false,
-                                selectPermanentCoroutine: null,
-                                afterSelectPermanentCoroutine: AfterSelectPermanentCoroutine,
+                                selectPermanentCoroutine: SelectPermanentCoroutine2,
+                                afterSelectPermanentCoroutine: null,
                                 mode: SelectPermanentEffect.Mode.Custom,
                                 cardEffect: activateClass);
 
-                            selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon to delete.", "The opponent is selecting 1 Digimon to delete.");
+                            selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon to delete.",
+                                "The opponent is selecting 1 Digimon to delete.");
 
                             yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
 
-                            IEnumerator AfterSelectPermanentCoroutine(List<Permanent> permanents)
+                            IEnumerator SelectPermanentCoroutine2(Permanent permanent)
                             {
-                                foreach (Permanent permanent in permanents)
-                                {
-                                    targetPermanents.Add(permanent);
-                                }
+                                targetPermanents.Add(permanent);
 
                                 yield return null;
                             }
-
-
-                            yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.DeletePeremanentAndProcessAccordingToResult(targetPermanents: targetPermanents, activateClass: activateClass, successProcess: null, failureProcess: FailureProcess));
-                        }
-                        else
-                        {
-                            yield return ContinuousController.instance.StartCoroutine("FailureProcess");
                         }
 
+                        yield return ContinuousController.instance.StartCoroutine(
+                            CardEffectCommons.DeletePeremanentAndProcessAccordingToResult(targetPermanents: targetPermanents,
+                                activateClass: activateClass, successProcess: null, failureProcess: FailureProcess));
+
                         IEnumerator FailureProcess()
                         {
                             targetPermanents.Clear();
 
-                            if (CardEffectCommons.IsExistOnBattleArea(card))
+                            if (CardEffectCommons.HasMatchConditionPermanent(CanSelectOpponentTamer))
                             {
-                                if (CardEffectCommons.HasMatchConditionPermanent(CanSelectOpponentTamer))
-                                {
-                                    int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectOpponentTamer));
-
-                                    SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
-
-                                    selectPermanentEffect.SetUp(
-                                        selectPlayer: card.Owner,
-                                        canTargetCondition: CanSelectOpponentTamer,
-                                        canTargetCondition_ByPreSelecetedList: null,
-                                        canEndSelectCondition: null,
-                                        maxCount: maxCount,
-                                        canNoSelect: false,
-                                        canEndNotMax: false,
-                                        selectPermanentCoroutine: null,
-                                        afterSelectPermanentCoroutine: null,
-                                        mode: SelectPermanentEffect.Mode.Destroy,
-                                        cardEffect: activateClass);
-
-                                    selectPermanentEffect.SetUpCustomMessage("Select 1 Tamer to delete.", "The opponent is selecting 1 Tamer to delete.");
-
-                                    yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
-                                }
+                                selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                                selectPermanentEffect.SetUp(
+                                    selectPlayer: card.Owner,
+                                    canTargetCondition: CanSelectOpponentTamer,
+                                    canTargetCondition_ByPreSelecetedList: null,
+                                    canEndSelectCondition: null,
+                                    maxCount: 1,
+                                    canNoSelect: false,
+                                    canEndNotMax: false,
+                                    selectPermanentCoroutine: null,
+                                    afterSelectPermanentCoroutine: null,
+                                    mode: SelectPermanentEffect.Mode.Destroy,
+                                    cardEffect: activateClass);
+
+                                selectPermanentEffect.SetUpCustomMessage("Select 1 Tamer to delete.",
+                                    "The opponent is selecting 1 Tamer to delete.");
+
+                                yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
                             }
                         }
                     }
                 }
             }
+
             #endregion
 
             #region All Turns
+
             if (timing == EffectTiming.OnDestroyedAnyone)
             {
                 ActivateClass activateClass = new ActivateClass();
-                activateClass.SetUpICardEffect("When one of your Digimon or Tamers are deleted by an effect, trash the top card of your opponent's security.", CanUseCondition, card);
+                activateClass.SetUpICardEffect(
+                    "When one of your Digimon or Tamers are deleted by an effect, trash the top card of your opponent's security.",
+                    CanUseCondition, card);
                 activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
                 activateClass.SetHashString("TrashSecurity_BT16_081");
                 cardEffects.Add(activateClass);
 
                 string EffectDiscription()
                 {
-                    return "[All Turns] [Once Per Turn] When one of your Digimon or Tamers is deleted by an effect, trash the top card of your opponent's security stack.";
+                    return
+                        "[All Turns] [Once Per Turn] When one of your Digimon or Tamers is deleted by an effect, trash the top card of your opponent's security stack.";
                 }
 
                 bool PermanentCondition(Permanent permanent)
                 {
-                    if(CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card))
+                    if (CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card))
                     {
-                        if(permanent.IsDigimon || permanent.IsTamer)
+                        if (permanent.IsDigimon || permanent.IsTamer)
                         {
                             return true;
                         }
                     }
+
                     return false;
                 }
 
@@ -455,6 +426,7 @@ namespace DCGO.CardEffects.BT16
                         true).DestroySecurity());
                 }
             }
+
             #endregion
 
             return cardEffects;

+ 126 - 115
Assets/CardEffect/BT16/Purple/Soloogarmon_BT16_076.cs

@@ -1,10 +1,5 @@
 using System.Collections;
 using System.Collections.Generic;
-using UnityEngine;
-using System.Linq;
-using Photon;
-using System;
-using Photon.Pun;
 
 namespace DCGO.CardEffects.BT16
 {
@@ -15,42 +10,50 @@ namespace DCGO.CardEffects.BT16
             List<ICardEffect> cardEffects = new List<ICardEffect>();
 
             #region Digivolve Condition
+
             if (timing == EffectTiming.None)
             {
                 bool PermanentCondition(Permanent targetPermanent)
                 {
-                    return targetPermanent.TopCard.ContainsTraits("SoC") && targetPermanent.TopCard.HasLevel && targetPermanent.TopCard.Level == 4;
+                    return targetPermanent.TopCard.ContainsTraits("SoC") && targetPermanent.TopCard.HasLevel &&
+                           targetPermanent.TopCard.Level == 4;
                 }
 
-                cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(permanentCondition: PermanentCondition, digivolutionCost: 3, ignoreDigivolutionRequirement: false, card: card, condition: null));
+                cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(permanentCondition: PermanentCondition,
+                    digivolutionCost: 3, ignoreDigivolutionRequirement: false, card: card, condition: null));
             }
+
             #endregion
 
             #region When Digivolving
+
             if (timing == EffectTiming.OnEnterFieldAnyone)
             {
                 ActivateClass activateClass = new ActivateClass();
-                activateClass.SetUpICardEffect("Delete an opponent's Digimon with 6000 DP or less, if the effect didn't delete, play a level 4 or lower [SoC] card.", CanUseCondition, card);
-                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
+                activateClass.SetUpICardEffect(
+                    "Delete an opponent's Digimon with 6000 DP or less, if the effect didn't delete, play a level 4 or lower [SoC] card.",
+                    CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDescription());
                 cardEffects.Add(activateClass);
 
-                string EffectDiscription()
+                string EffectDescription()
                 {
-                    return "[When Digivolving] By trashing 2 cards in your hand, delete 1 of your opponent's Digimon with 6000 DP or less. If this effect didn't delete, you may play 1 level 4 or lower card with the [SoC] trait from your trash without paying the cost.";
+                    return
+                        "[When Digivolving] By trashing 2 cards in your hand, delete 1 of your opponent's Digimon with 6000 DP or less. If this effect didn't delete, you may play 1 level 4 or lower card with the [SoC] trait from your trash without paying the cost.";
                 }
 
                 bool CanUseCondition(Hashtable hashtable)
                 {
-                    return CardEffectCommons.CanTriggerWhenDigivolving(hashtable,card);
+                    return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
                 }
 
                 bool CanSelectPermanentCondition(Permanent permanent)
                 {
-                    if(CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
+                    if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
                     {
                         if (permanent.TopCard.IsDigimon)
                         {
-                            if(permanent.HasDP && permanent.DP <= 6000)
+                            if (permanent.HasDP && permanent.DP <= 6000)
                             {
                                 return true;
                             }
@@ -62,9 +65,9 @@ namespace DCGO.CardEffects.BT16
 
                 bool CanSelectCardCondition(CardSource cardSource)
                 {
-                    if (CardEffectCommons.IsExistOnTrash(cardSource))
+                    if (cardSource.HasLevel && cardSource.Level <= 4 && cardSource.ContainsTraits("SoC"))
                     {
-                        if (cardSource.Level <= 4 && cardSource.ContainsTraits("SoC") && (cardSource.IsDigimon || cardSource.IsDigiEgg))
+                        if (CardEffectCommons.CanPlayAsNewPermanent(cardSource: cardSource, payCost: false, cardEffect: activateClass))
                         {
                             return true;
                         }
@@ -88,8 +91,6 @@ namespace DCGO.CardEffects.BT16
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
-                    List<CardSource> selectedCards = new List<CardSource>();
-
                     bool discarded = false;
                     List<Permanent> deleteTargetPermanents = new List<Permanent>();
 
@@ -101,7 +102,7 @@ namespace DCGO.CardEffects.BT16
 
                         selectHandEffect.SetUp(
                             selectPlayer: card.Owner,
-                            canTargetCondition: (cardSource) => true,
+                            canTargetCondition: _ => true,
                             canTargetCondition_ByPreSelecetedList: null,
                             canEndSelectCondition: null,
                             maxCount: discardCount,
@@ -127,7 +128,7 @@ namespace DCGO.CardEffects.BT16
 
                         if (discarded)
                         {
-                            if(CardEffectCommons.HasMatchConditionOpponentsPermanent(card, CanSelectPermanentCondition))
+                            if (CardEffectCommons.HasMatchConditionOpponentsPermanent(card, CanSelectPermanentCondition))
                             {
                                 SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
 
@@ -154,42 +155,43 @@ namespace DCGO.CardEffects.BT16
                                 }
                             }
 
-                            yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.DeletePeremanentAndProcessAccordingToResult(
-                                targetPermanents: deleteTargetPermanents,
-                                activateClass: activateClass,
-                                successProcess: null,
-                                failureProcess: FailureProcess));
+                            yield return ContinuousController.instance.StartCoroutine(
+                                CardEffectCommons.DeletePeremanentAndProcessAccordingToResult(
+                                    targetPermanents: deleteTargetPermanents,
+                                    activateClass: activateClass,
+                                    successProcess: null,
+                                    failureProcess: FailureProcess));
 
                             IEnumerator FailureProcess()
                             {
                                 if (CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectCardCondition))
                                 {
-                                    int maxCount1 = 1;
+                                    List<CardSource> selectedCards = new List<CardSource>();
 
                                     SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
 
                                     selectCardEffect.SetUp(
-                                                canTargetCondition: CanSelectCardCondition,
-                                                canTargetCondition_ByPreSelecetedList: null,
-                                                canEndSelectCondition: null,
-                                                canNoSelect: () => true,
-                                                selectCardCoroutine: SelectCardCoroutine,
-                                                afterSelectCardCoroutine: null,
-                                                message: "Select 1 card to play.",
-                                                maxCount: maxCount1,
-                                                canEndNotMax: false,
-                                                isShowOpponent: true,
-                                                mode: SelectCardEffect.Mode.Custom,
-                                                root: SelectCardEffect.Root.Custom,
-                                                customRootCardList: card.Owner.TrashCards,
-                                                canLookReverseCard: true,
-                                                selectPlayer: card.Owner,
-                                                cardEffect: activateClass);
-
-                                    selectCardEffect.SetUpCustomMessage("Select 1 trash card to play.", "The opponent is selecting 1 trash card to play.");
+                                        canTargetCondition: CanSelectCardCondition,
+                                        canTargetCondition_ByPreSelecetedList: null,
+                                        canEndSelectCondition: null,
+                                        canNoSelect: () => true,
+                                        selectCardCoroutine: SelectCardCoroutine,
+                                        afterSelectCardCoroutine: null,
+                                        message: "Select cards to play.",
+                                        maxCount: 1,
+                                        canEndNotMax: false,
+                                        isShowOpponent: true,
+                                        mode: SelectCardEffect.Mode.Custom,
+                                        root: SelectCardEffect.Root.Trash,
+                                        customRootCardList: null,
+                                        canLookReverseCard: true,
+                                        selectPlayer: card.Owner,
+                                        cardEffect: activateClass);
+
+                                    selectCardEffect.SetUpCustomMessage("Select 1 trash card to play.",
+                                        "The opponent is selecting 1 trash card to play.");
                                     selectCardEffect.SetUpCustomMessage_ShowCard("Played Card");
 
-
                                     IEnumerator SelectCardCoroutine(CardSource cardSource)
                                     {
                                         selectedCards.Add(cardSource);
@@ -200,47 +202,59 @@ namespace DCGO.CardEffects.BT16
                                     yield return StartCoroutine(selectCardEffect.Activate());
 
                                     yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(
-                                    cardSources: selectedCards,
-                                    activateClass: activateClass,
-                                    payCost: false,
-                                    isTapped: false,
-                                    root: SelectCardEffect.Root.Trash,
-                                    activateETB: true));
+                                        cardSources: selectedCards,
+                                        activateClass: activateClass,
+                                        payCost: false,
+                                        isTapped: false,
+                                        root: SelectCardEffect.Root.Trash,
+                                        activateETB: true));
                                 }
-                            }                            
+                            }
                         }
                     }
 
                     yield return null;
                 }
             }
+
             #endregion
 
-            #region End of Attack - Inherited Effect
-            if (timing == EffectTiming.OnEndAttack)
+            #region All Turns
+
+            if (timing == EffectTiming.OnDestroyedAnyone)
             {
                 ActivateClass activateClass = new ActivateClass();
-                activateClass.SetUpICardEffect("Unsuspend this Digimon.", CanUseCondition, card);
-                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
-                activateClass.SetIsInheritedEffect(true);
-                activateClass.SetHashString("Unsuspend_BT16_076");
+                activateClass.SetUpICardEffect("Digivolve into [Fenriloogamon] from your trash.", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDescription());
                 cardEffects.Add(activateClass);
 
-                string EffectDiscription()
+                string EffectDescription()
                 {
-                    return "[End of Attack] [Once Per Turn] If your opponent has 1 or more memory, unsuspend this Digimon.";
+                    return
+                        "[All Turns] When one of your other Digimon with the [SoC] trait is deleted, this Digimon with a Tamer with the [SoC] trait in its digivolution cards may digivolve into [Fenriloogamon] from your trash without paying the cost.";
                 }
 
-                bool CanUseCondition(Hashtable hashtable)
+                bool PermanentCondition(Permanent permanent)
                 {
-                    return CardEffectCommons.CanTriggerOnEndAttack(hashtable, card);
+                    if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
+                    {
+                        if (permanent != card.PermanentOfThisCard())
+                        {
+                            if (permanent.TopCard.CardTraits.Contains("SoC"))
+                            {
+                                return true;
+                            }
+                        }
+                    }
+
+                    return false;
                 }
 
-                bool CanActivateCondition(Hashtable hashtable)
+                bool CanUseCondition(Hashtable hashtable)
                 {
-                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
                     {
-                        if (card.Owner.Enemy.MemoryForPlayer >= 1)
+                        if (CardEffectCommons.CanTriggerOnPermanentDeleted(hashtable, PermanentCondition))
                         {
                             return true;
                         }
@@ -249,37 +263,19 @@ namespace DCGO.CardEffects.BT16
                     return false;
                 }
 
-                IEnumerator ActivateCoroutine(Hashtable _hashtable)
+                bool CanSelectFenriloogamonInTrash(CardSource cardSource)
                 {
-
-                    Permanent selectedPermanent = card.PermanentOfThisCard();
-
-                    yield return ContinuousController.instance.StartCoroutine(new IUnsuspendPermanents(new List<Permanent>() { selectedPermanent }, activateClass).Unsuspend());
-
+                    return cardSource.EqualsCardName("Fenriloogamon");
                 }
-            }
-            #endregion
 
-            #region All Turns
-            if (timing == EffectTiming.OnDestroyedAnyone)
-            {
-                ActivateClass activateClass = new ActivateClass();
-                activateClass.SetUpICardEffect("Digivolve into [FenriLoogamon] from your trash.", CanUseCondition, card);
-                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
-                cardEffects.Add(activateClass);
-
-                string EffectDiscription()
-                {
-                    return "[All Turns] When one of your other Digimon with the [SoC] trait is deleted, this Digimon with a Tamer with the [SoC] trait in its digivolution cards may digivolve into [FenriLoogamon] from your trash without paying the cost.";
-                }
-
-                bool PermanentCondition(Permanent permanent)
+                bool CanActivateCondition(Hashtable hashtable)
                 {
-                    if (CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card))
+                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
                     {
-                        if (permanent != card.PermanentOfThisCard())
+                        if (card.PermanentOfThisCard().DigivolutionCards
+                            .Some(cardSource => cardSource.CardTraits.Contains("SoC") && cardSource.IsTamer))
                         {
-                            if (permanent.TopCard.CardTraits.Contains("SoC"))
+                            if (CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectFenriloogamonInTrash))
                             {
                                 return true;
                             }
@@ -289,51 +285,66 @@ namespace DCGO.CardEffects.BT16
                     return false;
                 }
 
-                bool CanUseCondition(Hashtable hashtable)
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
-                    if (CardEffectCommons.IsExistOnBattleArea(card))
-                    {
-                        if (CardEffectCommons.CanTriggerOnPermanentDeleted(hashtable, PermanentCondition))
-                        {
-                            return true;
-                        } 
-                    }
+                    yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.DigivolveIntoHandOrTrashCard(
+                        targetPermanent: card.PermanentOfThisCard(),
+                        cardCondition: CanSelectFenriloogamonInTrash,
+                        payCost: false,
+                        reduceCostTuple: null,
+                        fixedCostTuple: null,
+                        ignoreDigivolutionRequirementFixedCost: -1,
+                        isHand: false,
+                        activateClass: activateClass,
+                        successProcess: null));
+                }
+            }
 
-                    return false;
+            #endregion
+
+            #region End of Attack - Inherited Effect
+
+            if (timing == EffectTiming.OnEndAttack)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Unsuspend this Digimon.", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDescription());
+                activateClass.SetIsInheritedEffect(true);
+                activateClass.SetHashString("Unsuspend_BT16_076");
+                cardEffects.Add(activateClass);
+
+                string EffectDescription()
+                {
+                    return "[End of Attack] [Once Per Turn] If your opponent has 1 or more memory, unsuspend this Digimon.";
                 }
 
-                bool CanSelectFenriInTrash(CardSource cardSource)
+                bool CanUseCondition(Hashtable hashtable)
                 {
-                    return cardSource.ContainsCardName("FenriLoogamon");
+                    return CardEffectCommons.CanTriggerOnEndAttack(hashtable, card);
                 }
 
                 bool CanActivateCondition(Hashtable hashtable)
                 {
-                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
                     {
-                        if (card.PermanentOfThisCard().DigivolutionCards.Count((cardSource) => (cardSource.CardTraits.Contains("SoC") && cardSource.IsTamer)) >= 1)
+                        if (card.Owner.Enemy.MemoryForPlayer >= 1)
                         {
-                            return CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectFenriInTrash);
+                            return true;
                         }
                     }
 
                     return false;
                 }
 
-                IEnumerator ActivateCoroutine(Hashtable _hashtable)
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
-                    yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.DigivolveIntoHandOrTrashCard(
-                    targetPermanent: card.PermanentOfThisCard(),
-                    cardCondition: CanSelectFenriInTrash,
-                    payCost: false,
-                    reduceCostTuple: null,
-                    fixedCostTuple: null,
-                    ignoreDigivolutionRequirementFixedCost: -1,
-                    isHand: false,
-                    activateClass: activateClass,
-                    successProcess: null));
+                    Permanent selectedPermanent = card.PermanentOfThisCard();
+
+                    yield return ContinuousController.instance.StartCoroutine(
+                        new IUnsuspendPermanents(new List<Permanent>() { selectedPermanent }, activateClass).Unsuspend());
                 }
             }
+
             #endregion
 
             return cardEffects;

+ 1 - 0
Assets/CardEffect/BT16/Purple/ThunderflameCrusher_BT16_100.cs

@@ -274,6 +274,7 @@ namespace DCGO.CardEffects.BT16
                 ActivateClass activateClass = new ActivateClass();
                 activateClass.SetUpICardEffect(card.BaseENGCardNameFromEntity, CanUseCondition, card);
                 activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDiscription());
+                activateClass.SetIsSecurityEffect(true);
                 cardEffects.Add(activateClass);
 
                 string EffectDiscription()

+ 2 - 2
Assets/CardEffect/BT16/Red/Aquilamon_BT16_008.cs

@@ -55,7 +55,7 @@ namespace DCGO.CardEffects.BT16
                 {
                     if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
                     {
-                        if (permanent.DP <= 3000)
+                        if (permanent.DP <= card.Owner.MaxDP_DeleteEffect(3000, activateClass))
                         {
                             return true;
                         }
@@ -127,7 +127,7 @@ namespace DCGO.CardEffects.BT16
                 {
                     if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
                     {
-                        if (permanent.DP <= 3000)
+                        if (permanent.DP <= card.Owner.MaxDP_DeleteEffect(3000, activateClass))
                         {
                             return true;
                         }

+ 166 - 135
Assets/CardEffect/BT16/Red/BeastlyStormDanceofAffection_BT16_091.cs

@@ -13,16 +13,18 @@ namespace DCGO.CardEffects.BT16
             List<ICardEffect> cardEffects = new List<ICardEffect>();
 
             #region Main - Option Skill
+
             if (timing == EffectTiming.OptionSkill)
             {
                 ActivateClass activateClass = new ActivateClass();
                 activateClass.SetUpICardEffect("Play 1 [Aquilamon] or [Gatomon]", CanUseCondition, card);
-                activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, true, EffectDiscription());
+                activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDiscription());
                 cardEffects.Add(activateClass);
 
                 string EffectDiscription()
                 {
-                    return "[Main] You may play 1 [Aquilamon] or [Gatomon] from your hand without paying the cost. Then, 2 of your Digimon may DNA digivolve into a Digimon card in your hand. The Digimon DNA Digivolved by this effect gains [Security A+1] for the turn, and may attack a player.";
+                    return
+                        "[Main] You may play 1 [Aquilamon] or [Gatomon] from your hand without paying the cost. Then, 2 of your Digimon may DNA digivolve into a Digimon card in your hand. The Digimon DNA Digivolved by this effect gains [Security A+1] for the turn, and may attack a player.";
                 }
 
                 bool CanSelectCardCondition(CardSource cardSource)
@@ -58,12 +60,11 @@ namespace DCGO.CardEffects.BT16
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
+                    // Play [Aquilamon/Gatomon]
                     if (card.Owner.HandCards.Count(CanSelectCardCondition) >= 1)
                     {
                         List<CardSource> selectedCards = new List<CardSource>();
 
-                        int maxCount = 1;
-
                         SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
 
                         selectHandEffect.SetUp(
@@ -71,7 +72,7 @@ namespace DCGO.CardEffects.BT16
                             canTargetCondition: CanSelectCardCondition,
                             canTargetCondition_ByPreSelecetedList: null,
                             canEndSelectCondition: null,
-                            maxCount: maxCount,
+                            maxCount: 1,
                             canNoSelect: true,
                             canEndNotMax: false,
                             isShowOpponent: true,
@@ -92,146 +93,162 @@ namespace DCGO.CardEffects.BT16
                             yield return null;
                         }
 
-                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(cardSources: selectedCards, activateClass: activateClass, payCost: false, isTapped: false, root: SelectCardEffect.Root.Hand, activateETB: true));
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(
+                            cardSources: selectedCards, activateClass: activateClass, payCost: false, isTapped: false,
+                            root: SelectCardEffect.Root.Hand, activateETB: true));
+                    }
 
-                        // DNA digivolve
-                        if (card.Owner.GetBattleAreaDigimons().Count >= 2)
-                        {
-                            bool DNADigivolved = false;
+                    // DNA digivolve
+                    if (card.Owner.GetBattleAreaDigimons().Count >= 2)
+                    {
+                        bool DNADigivolved = false;
 
-                            if (card.Owner.HandCards.Count(CanSelectDNACardCondition) >= 1)
+                        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<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);
+                                selectedDNACards.Add(cardSource);
 
-                                    yield return null;
-                                }
+                                yield return null;
+                            }
 
-                                if (selectedDNACards.Count >= 1)
+                            if (selectedDNACards.Count >= 1)
+                            {
+                                foreach (CardSource selectedCard in selectedDNACards)
                                 {
-                                    foreach (CardSource selectedCard in selectedDNACards)
+                                    if (selectedCard.CanPlayJogress(true))
                                     {
-                                        if (selectedCard.CanPlayJogress(true))
-                                        {
-                                            _jogressEvoRootsFrameIDs = new int[0];
+                                        _jogressEvoRootsFrameIDs = new int[0];
 
-                                            yield return GManager.instance.photonWaitController.StartWait("BeastlyStormDanceofAffection_BT16_091");
+                                        yield return GManager.instance.photonWaitController.StartWait(
+                                            "BeastlyStormDanceofAffection_BT16_091");
 
-                                            if (card.Owner.isYou || GManager.instance.IsAI)
+                                        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)
                                             {
-                                                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)
                                                 {
-                                                    if (permanents.Count == 2)
-                                                    {
-                                                        _jogressEvoRootsFrameIDs = permanents.Distinct().ToArray().Map(permanent => permanent.PermanentFrame.FrameID);
-                                                    }
-
-                                                    yield return null;
+                                                    _jogressEvoRootsFrameIDs = permanents.Distinct().ToArray()
+                                                        .Map(permanent => permanent.PermanentFrame.FrameID);
                                                 }
 
-                                                photonView.RPC("SetJogressEvoRootsFrameIDs", RpcTarget.All, _jogressEvoRootsFrameIDs);
+                                                yield return null;
                                             }
 
-                                            else
-                                            {
-                                                GManager.instance.commandText.OpenCommandText("The opponent is choosing a card to DNA digivolve.");
-                                            }
+                                            photonView.RPC("SetJogressEvoRootsFrameIDs", RpcTarget.All, _jogressEvoRootsFrameIDs);
+                                        }
 
-                                            yield return new WaitWhile(() => !_endSelect);
-                                            _endSelect = false;
+                                        else
+                                        {
+                                            GManager.instance.commandText.OpenCommandText(
+                                                "The opponent is choosing a card to DNA digivolve.");
+                                        }
 
-                                            GManager.instance.commandText.CloseCommandText();
-                                            yield return new WaitWhile(() => GManager.instance.commandText.gameObject.activeSelf);
+                                        yield return new WaitWhile(() => !_endSelect);
+                                        _endSelect = false;
 
-                                            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());
-
-                                                
-                                            }
+                                        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 (DNADigivolved)
+                                        {
+                                            List<SelectionElement<bool>> selectionElements = new List<SelectionElement<bool>>()
                                             {
-                                                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),
-                                                    };
+                                                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.";
+                                            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);
+                                            GManager.instance.userSelectionManager.SetBoolSelection(
+                                                selectionElements: selectionElements, selectPlayer: card.Owner,
+                                                selectPlayerMessage: selectPlayerMessage,
+                                                notSelectPlayerMessage: notSelectPlayerMessage);
 
-                                                yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
+                                            yield return ContinuousController.instance.StartCoroutine(GManager.instance
+                                                .userSelectionManager.WaitForEndSelect());
 
-                                                bool willGiveEffects = GManager.instance.userSelectionManager.SelectedBoolValue;
+                                            bool willGiveEffects = GManager.instance.userSelectionManager.SelectedBoolValue;
 
-                                                if (willGiveEffects)
-                                                {
-                                                    yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonSAttack(selectedCard.PermanentOfThisCard(), 1, EffectDuration.UntilEachTurnEnd, activateClass));
+                                            if (willGiveEffects)
+                                            {
+                                                yield return ContinuousController.instance.StartCoroutine(
+                                                    CardEffectCommons.ChangeDigimonSAttack(selectedCard.PermanentOfThisCard(), 1,
+                                                        EffectDuration.UntilEachTurnEnd, activateClass));
 
-                                                    if (selectedCard.PermanentOfThisCard() != null)
+                                                if (selectedCard.PermanentOfThisCard() != null)
+                                                {
+                                                    if (selectedCard.PermanentOfThisCard().CanAttack(activateClass))
                                                     {
-                                                        if (selectedCard.PermanentOfThisCard().CanAttack(activateClass))
-                                                        {
-                                                            SelectAttackEffect selectAttackEffect = GManager.instance.GetComponent<SelectAttackEffect>();
-
-                                                            selectAttackEffect.SetUp(
-                                                                attacker: selectedCard.PermanentOfThisCard(),
-                                                                canAttackPlayerCondition: () => true,
-                                                                defenderCondition: (permanent) => false,
-                                                                cardEffect: activateClass);
-
-                                                            yield return ContinuousController.instance.StartCoroutine(selectAttackEffect.Activate());
-                                                        }
+                                                        SelectAttackEffect selectAttackEffect =
+                                                            GManager.instance.GetComponent<SelectAttackEffect>();
+
+                                                        selectAttackEffect.SetUp(
+                                                            attacker: selectedCard.PermanentOfThisCard(),
+                                                            canAttackPlayerCondition: () => true,
+                                                            defenderCondition: (permanent) => false,
+                                                            cardEffect: activateClass);
+
+                                                        yield return ContinuousController.instance.StartCoroutine(selectAttackEffect
+                                                            .Activate());
                                                     }
                                                 }
                                             }
@@ -243,19 +260,23 @@ namespace DCGO.CardEffects.BT16
                     }
                 }
             }
+
             #endregion
 
             #region Security Effect
+
             if (timing == EffectTiming.SecuritySkill)
             {
                 ActivateClass activateClass = new ActivateClass();
                 activateClass.SetUpICardEffect("Play 1 [Hawkmon] or [Salamon]", CanUseCondition, card);
                 activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDiscription());
+                activateClass.SetIsSecurityEffect(true);
                 cardEffects.Add(activateClass);
 
                 string EffectDiscription()
                 {
-                    return "[Security] You may play 1 [Hawkmon] or [Salamon] from your hand or trash without paying the cost. Then, add this card to the hand.";
+                    return
+                        "[Security] You may play 1 [Hawkmon] or [Salamon] from your hand or trash without paying the cost. Then, add this card to the hand.";
                 }
 
                 bool CanSelectCardCondition(CardSource cardSource)
@@ -279,15 +300,16 @@ namespace DCGO.CardEffects.BT16
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
                     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),
-                        };
+                    {
+                        new SelectionElement<bool>(message: $"Yes", value: true, spriteIndex: 0),
+                        new SelectionElement<bool>(message: $"No", value: false, spriteIndex: 1),
+                    };
 
                     string selectPlayerMessage = "Will you play a Digimon?";
                     string notSelectPlayerMessage = "The opponent is choosing effects.";
 
-                    GManager.instance.userSelectionManager.SetBoolSelection(selectionElements: selectionElements, selectPlayer: card.Owner, selectPlayerMessage: selectPlayerMessage, notSelectPlayerMessage: notSelectPlayerMessage);
+                    GManager.instance.userSelectionManager.SetBoolSelection(selectionElements: selectionElements, selectPlayer: card.Owner,
+                        selectPlayerMessage: selectPlayerMessage, notSelectPlayerMessage: notSelectPlayerMessage);
 
 
                     yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
@@ -304,15 +326,17 @@ namespace DCGO.CardEffects.BT16
                             if (canSelectHand && canSelectTrash)
                             {
                                 List<SelectionElement<bool>> selectionElements1 = new List<SelectionElement<bool>>()
-                        {
-                            new SelectionElement<bool>(message: $"From hand", value : true, spriteIndex: 0),
-                            new SelectionElement<bool>(message: $"From trash", value : false, spriteIndex: 1),
-                        };
+                                {
+                                    new SelectionElement<bool>(message: $"From hand", value: true, spriteIndex: 0),
+                                    new SelectionElement<bool>(message: $"From trash", value: false, spriteIndex: 1),
+                                };
 
                                 string selectPlayerMessage1 = "From which area do you select a card?";
                                 string notSelectPlayerMessage1 = "The opponent is choosing from which area to select a card.";
 
-                                GManager.instance.userSelectionManager.SetBoolSelection(selectionElements: selectionElements1, selectPlayer: card.Owner, selectPlayerMessage: selectPlayerMessage1, notSelectPlayerMessage: notSelectPlayerMessage1);
+                                GManager.instance.userSelectionManager.SetBoolSelection(selectionElements: selectionElements1,
+                                    selectPlayer: card.Owner, selectPlayerMessage: selectPlayerMessage1,
+                                    notSelectPlayerMessage: notSelectPlayerMessage1);
                             }
 
                             else
@@ -320,7 +344,8 @@ namespace DCGO.CardEffects.BT16
                                 GManager.instance.userSelectionManager.SetBool(canSelectHand);
                             }
 
-                            yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
+                            yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager
+                                .WaitForEndSelect());
 
                             bool fromHand = GManager.instance.userSelectionManager.SelectedBoolValue;
 
@@ -348,7 +373,8 @@ namespace DCGO.CardEffects.BT16
                                         mode: SelectHandEffect.Mode.Custom,
                                         cardEffect: activateClass);
 
-                                    selectHandEffect.SetUpCustomMessage("Select 1 Digimon to play.", "The opponent is selecting 1 Digimon to play.");
+                                    selectHandEffect.SetUpCustomMessage("Select 1 Digimon to play.",
+                                        "The opponent is selecting 1 Digimon to play.");
                                     selectHandEffect.SetUpCustomMessage_ShowCard("Played Card");
 
                                     yield return StartCoroutine(selectHandEffect.Activate());
@@ -360,7 +386,9 @@ namespace DCGO.CardEffects.BT16
                                         yield return null;
                                     }
 
-                                    yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(cardSources: selectedCards, activateClass: activateClass, payCost: false, isTapped: false, root: SelectCardEffect.Root.Hand, activateETB: true));
+                                    yield return ContinuousController.instance.StartCoroutine(
+                                        CardEffectCommons.PlayPermanentCards(cardSources: selectedCards, activateClass: activateClass,
+                                            payCost: false, isTapped: false, root: SelectCardEffect.Root.Hand, activateETB: true));
                                 }
                             }
                             else
@@ -392,7 +420,8 @@ namespace DCGO.CardEffects.BT16
                                         cardEffect: activateClass);
 
                                     selectCardEffect.SetUpCustomMessage_ShowCard("Played Card");
-                                    selectCardEffect.SetUpCustomMessage("Select 1 Digimon to play.", "The opponent is selecting 1 Digimon to play.");
+                                    selectCardEffect.SetUpCustomMessage("Select 1 Digimon to play.",
+                                        "The opponent is selecting 1 Digimon to play.");
 
                                     yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
 
@@ -403,7 +432,9 @@ namespace DCGO.CardEffects.BT16
                                         yield return null;
                                     }
 
-                                    yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(cardSources: selectedCards, activateClass: activateClass, payCost: false, isTapped: false, root: SelectCardEffect.Root.Trash, activateETB: true));
+                                    yield return ContinuousController.instance.StartCoroutine(
+                                        CardEffectCommons.PlayPermanentCards(cardSources: selectedCards, activateClass: activateClass,
+                                            payCost: false, isTapped: false, root: SelectCardEffect.Root.Trash, activateETB: true));
                                 }
                             }
                         }
@@ -412,8 +443,8 @@ namespace DCGO.CardEffects.BT16
                     yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.AddThisCardToHand(card, activateClass));
                 }
             }
-            #endregion
 
+            #endregion
 
             return cardEffects;
         }

+ 39 - 41
Assets/CardEffect/BT16/White/LuiOhwada_BT16_090.cs

@@ -15,24 +15,28 @@ namespace DCGO.CardEffects.BT16
             List<ICardEffect> cardEffects = new List<ICardEffect>();
 
             #region On Start Turn
+
             if (timing == EffectTiming.OnStartTurn)
             {
                 cardEffects.Add(CardEffectFactory.SetMemoryTo3TamerEffect(card));
             }
+
             #endregion
 
             #region Main Effect
+
             if (timing == EffectTiming.OnDeclaration)
             {
                 ActivateClass activateClass = new ActivateClass();
                 activateClass.SetUpICardEffect("Delete [Ukkomon] and breeding area Digimon to play [BigUkkomon]", CanUseCondition, card);
-                activateClass.SetUpActivateClass(null, ActivateCoroutine, 1, true, EffectDiscription());
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, true, EffectDiscription());
                 activateClass.SetHashString("Play_ST16_090");
                 cardEffects.Add(activateClass);
 
                 string EffectDiscription()
                 {
-                    return "[Main] [Once Per Turn] By deleting 1 of your [Ukkomon] and trashing 1 of your Digimon in the breeding area, you may play 1 [BigUkkomon] in your breeding area from your hand for a cost of 3.";
+                    return
+                        "[Main] [Once Per Turn] By deleting 1 of your [Ukkomon] and trashing 1 of your Digimon in the breeding area, you may play 1 [BigUkkomon] in your breeding area from your hand for a cost of 3.";
                 }
 
                 bool CanSelectPermanentCondition(Permanent permanent)
@@ -67,28 +71,33 @@ namespace DCGO.CardEffects.BT16
                     {
                         return true;
                     }
+
                     return false;
                 }
 
                 bool CanUseCondition(Hashtable hashtable)
                 {
-                    if(CardEffectCommons.IsExistOnBattleArea(card))
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
                     {
-                        Debug.Log($"CAN USE: {CardEffectCommons.HasMatchConditionOwnersPermanent(card, CanSelectPermanentCondition)} - {card.Owner.GetBreedingAreaPermanents().Count(CanSelectBreedingAreaDigimon)}");
-
-                        if (CardEffectCommons.HasMatchConditionOwnersPermanent(card, CanSelectPermanentCondition) && card.Owner.GetBreedingAreaPermanents().Count(CanSelectBreedingAreaDigimon) >= 1)
+                        if (CardEffectCommons.HasMatchConditionOwnersPermanent(card, CanSelectPermanentCondition) &&
+                            card.Owner.GetBreedingAreaPermanents().Count(CanSelectBreedingAreaDigimon) >= 1)
                         {
-                            Debug.Log($"CAN USE: {card.Owner.HandCards.Count(CanSelectCardCondition)}");
                             if (card.Owner.HandCards.Count(CanSelectCardCondition) >= 1)
                             {
                                 return true;
                             }
                         }
                     }
+
                     return false;
                 }
 
-                IEnumerator ActivateCoroutine(Hashtable _hashtable)
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistOnBattleArea(card);
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
                     bool ukkomonDeleted = false;
                     bool breedingAreaPermanentDeleted = false;
@@ -110,13 +119,17 @@ namespace DCGO.CardEffects.BT16
                             mode: SelectPermanentEffect.Mode.Custom,
                             cardEffect: activateClass);
 
-                        selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon to delete.", "The opponent is selecting 1 Digimon to delete.");
+                        selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon to delete.",
+                            "The opponent is selecting 1 Digimon to delete.");
 
                         yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
 
                         IEnumerator SelectPermanentCoroutine(Permanent permanent)
                         {
-                            yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.DeletePeremanentAndProcessAccordingToResult(targetPermanents: new List<Permanent>() { permanent }, activateClass: activateClass, successProcess: permanents => SuccessProcess(), failureProcess: null));
+                            yield return ContinuousController.instance.StartCoroutine(
+                                CardEffectCommons.DeletePeremanentAndProcessAccordingToResult(
+                                    targetPermanents: new List<Permanent>() { permanent }, activateClass: activateClass,
+                                    successProcess: _ => SuccessProcess(), failureProcess: null));
 
                             IEnumerator SuccessProcess()
                             {
@@ -130,43 +143,26 @@ namespace DCGO.CardEffects.BT16
 
                         if (card.Owner.GetBreedingAreaPermanents().Count(CanSelectBreedingAreaDigimon) >= 1)
                         {
+                            List<Permanent> digitamaPermanents = card.Owner.GetBreedingAreaPermanents()
+                                .Filter(permanent => permanent.IsDigimon)
+                                .Clone();
 
-                            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 trash breeding area Digimon to play [BigUkkomon] from your hand?";
-                            string notSelectPlayerMessage = "The opponent is choosing whether or not to trash cards.";
-
-                            GManager.instance.userSelectionManager.SetBoolSelection(selectionElements: selectionElements, selectPlayer: card.Owner, selectPlayerMessage: selectPlayerMessage, notSelectPlayerMessage: notSelectPlayerMessage);
-
-                            yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
-
-                            bool trashBreedingAreaDigimon = GManager.instance.userSelectionManager.SelectedBoolValue;
-
-                            if (trashBreedingAreaDigimon)
+                            if (digitamaPermanents.Count >= 1)
                             {
-                                List<Permanent> DigitamaPermanents = card.Owner.GetBreedingAreaPermanents()
-                                                .Filter(permanent => permanent.IsDigimon)
-                                                .Clone();
-
-                                if (DigitamaPermanents.Count >= 1)
+                                foreach (Permanent permanent in digitamaPermanents)
                                 {
-                                    foreach (Permanent permanent in DigitamaPermanents)
-                                    {
-                                        yield return ContinuousController.instance.StartCoroutine(permanent.DiscardEvoRoots());
+                                    yield return ContinuousController.instance.StartCoroutine(permanent.DiscardEvoRoots());
 
-                                        CardSource cardSource = permanent.TopCard;
+                                    CardSource cardSource = permanent.TopCard;
 
-                                        ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().ShowCardEffect(new List<CardSource>() { cardSource }, "Cards put to trash", true, true));
+                                    ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>()
+                                        .ShowCardEffect(new List<CardSource>() { cardSource }, "Cards put to trash", true, true));
 
 
-                                        yield return ContinuousController.instance.StartCoroutine(CardObjectController.RemoveField(permanent));
-                                        yield return ContinuousController.instance.StartCoroutine(CardObjectController.AddTrashCard(cardSource));
-                                        breedingAreaPermanentDeleted = true;
-                                    }
+                                    yield return ContinuousController.instance.StartCoroutine(CardObjectController.RemoveField(permanent));
+                                    yield return ContinuousController.instance.StartCoroutine(
+                                        CardObjectController.AddTrashCard(cardSource));
+                                    breedingAreaPermanentDeleted = true;
                                 }
                             }
 
@@ -194,7 +190,8 @@ namespace DCGO.CardEffects.BT16
                                         mode: SelectHandEffect.Mode.Custom,
                                         cardEffect: activateClass);
 
-                                    selectHandEffect.SetUpCustomMessage("Select 1 card to play.", "The opponent is selecting 1 card to play.");
+                                    selectHandEffect.SetUpCustomMessage("Select 1 card to play.",
+                                        "The opponent is selecting 1 card to play.");
                                     selectHandEffect.SetUpCustomMessage_ShowCard("Played Card");
 
                                     yield return StartCoroutine(selectHandEffect.Activate());
@@ -221,6 +218,7 @@ namespace DCGO.CardEffects.BT16
                     }
                 }
             }
+
             #endregion
 
             #region Security Skill

+ 1 - 1
Assets/Scripts/CardEffectCommons/GiveEffect/GiveEffectToPermanent/CanNotUnsuspend.cs

@@ -33,7 +33,7 @@ public partial class CardEffectCommons
 
         yield return ContinuousController.instance.StartCoroutine(GainCanNotUnsuspend(
             targetPermanent: targetPermanent,
-            effectDuration: EffectDuration.UntilOpponentTurnEnd,
+            effectDuration: EffectDuration.UntilNextUntap,
             activateClass: activateClass,
             condition: CanUseCondition,
             effectName: effectName