Răsfoiți Sursa

1.7.2-a build

mbunch_kascope 1 an în urmă
părinte
comite
8402ef9ea3

+ 1 - 1
Assets/CardBaseEntity/P/Green/Digimon/P_060.asset

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:077b1bcb846de9e141e58eb03540e1db561b4d1b25085b0f2c4ce148c40c4418
+oid sha256:11b5f5dee9fcae4ce84e72b377c4158e5734fe30da047151a99c3b4531846681
 size 1430

+ 3 - 3
Assets/CardEffect/BT19/Yellow/BT19_035.cs

@@ -194,8 +194,8 @@ namespace DCGO.CardEffects.BT19
                                 new(message: "From trash", value: false, spriteIndex: 1),
                             };
 
-                            string selectPlayerMessage = "From which area do you play a card?";
-                            string notSelectPlayerMessage = "The opponent is choosing from which area to play a card.";
+                            string selectPlayerMessage = "From which area do you place a card?";
+                            string notSelectPlayerMessage = "The opponent is choosing from which area to place a card.";
 
                             GManager.instance.userSelectionManager.SetBoolSelection(selectionElements: selectionElements,
                                 selectPlayer: card.Owner, selectPlayerMessage: selectPlayerMessage,
@@ -239,7 +239,7 @@ namespace DCGO.CardEffects.BT19
                                 cardEffect: activateClass);
 
                             selectHandEffect.SetUpCustomMessage("Select 1 card to place under a tamer.",
-                                "The opponent is selecting 1 card to play.");
+                                "The opponent is selecting 1 card to place.");
                             selectHandEffect.SetUpCustomMessage_ShowCard("Placed card");
 
                             yield return StartCoroutine(selectHandEffect.Activate());

+ 1 - 1
Assets/CardEffect/EX3/Yellow/EX3_069.cs

@@ -50,7 +50,7 @@ namespace DCGO.CardEffects.EX3
 
                 bool CanSelectCardCondition(CardSource cardSource)
                 {
-                    if (cardSource.CardTraits.Contains("Four Great Dragons") || cardSource.CardTraits.Contains("FourGreatDragons"))
+                    if (cardSource.EqualsTraits("Four Great Dragons"))
                     {
                         if (cardSource.IsDigimon)
                         {

+ 9 - 2
Assets/CardEffect/EX7/Black/EX7_048.cs

@@ -80,6 +80,8 @@ namespace DCGO.CardEffects.EX7
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
+                    CardSource selectedCard = null;
+
                     yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
                         revealCount: 6,
                         simplifiedSelectCardConditions:
@@ -98,16 +100,21 @@ namespace DCGO.CardEffects.EX7
                     ));
 
                     IEnumerator SelectCardCoroutine(CardSource cardSource)
+                    {
+                        selectedCard = cardSource;
+                        yield return null;
+                    }
+
+                    if(selectedCard != null)
                     {
                         yield return ContinuousController.instance.StartCoroutine(
                             CardEffectCommons.PlayOptionCards(
-                                cardSources: new List<CardSource>() { cardSource },
+                                cardSources: new List<CardSource>() { selectedCard },
                                 activateClass: activateClass,
                                 payCost: false,
                                 root: SelectCardEffect.Root.Library
                             )
                         );
-                        yield return null;
                     }
                 }
             }

+ 3 - 3
Assets/CardEffect/EX8/Blue/EX8_066.cs

@@ -89,13 +89,13 @@ namespace DCGO.CardEffects.EX8
 
                 bool CanUseCondition(Hashtable hashtable)
                 {
-                    return (CardEffectCommons.CanTriggerOnPermanentPlay(hashtable, EnterFieldPermanent) || CardEffectCommons.CanTriggerWhenPermanentDigivolving(hashtable, EnterFieldPermanent)) &&
-                           CardEffectCommons.CanActivateSuspendCostEffect(card);
+                    return (CardEffectCommons.CanTriggerOnPermanentPlay(hashtable, EnterFieldPermanent) || CardEffectCommons.CanTriggerWhenPermanentDigivolving(hashtable, EnterFieldPermanent));
                 }
 
                 bool CanActivateCondition(Hashtable hashtable)
                 {
-                    return isExistOnField(card);
+                    return isExistOnField(card) &&
+                           CardEffectCommons.CanActivateSuspendCostEffect(card);
                 }
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)

+ 7 - 1
Assets/CardEffect/EX8/Green/EX8_074.cs

@@ -167,7 +167,13 @@ namespace DCGO.CardEffects.EX8
 
                 bool CanUseCondition1(Hashtable hashtable1)
                 {
-                    return true;
+                    return CardEffectCommons.MatchConditionPermanentCount(PermanentCondition) >= 2;
+                }
+
+                bool PermanentCondition(Permanent permanent)
+                {
+                    return CardEffectCommons.IsPermanentExistsOnBattleAreaDigimon(permanent) &&
+                           !permanent.IsSuspended && permanent.CanSuspend;
                 }
 
                 int ChangeCost(CardSource cardSource, int cost, SelectCardEffect.Root root,

+ 2 - 2
Assets/CardEffect/EX8/Purple/EX8_059.cs

@@ -193,7 +193,7 @@ namespace DCGO.CardEffects.EX8
                                             SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
 
                                             selectHandEffect.SetUp(
-                                                selectPlayer: selectedPermanent.TopCard.Owner,
+                                                selectPlayer: card.Owner.Enemy,
                                                 canTargetCondition: (cardSource) => true,
                                                 canTargetCondition_ByPreSelecetedList: null,
                                                 canEndSelectCondition: null,
@@ -373,7 +373,7 @@ namespace DCGO.CardEffects.EX8
                                             SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
 
                                             selectHandEffect.SetUp(
-                                                selectPlayer: selectedPermanent.TopCard.Owner,
+                                                selectPlayer: card.Owner.Enemy,
                                                 canTargetCondition: (cardSource) => true,
                                                 canTargetCondition_ByPreSelecetedList: null,
                                                 canEndSelectCondition: null,

+ 1 - 1
Assets/CardEffect/LM/Blue/LM_006.cs

@@ -45,7 +45,7 @@ namespace DCGO.CardEffects.LM
                     {
                         if (CardEffectCommons.HasMatchConditionOwnersPermanent(card, CanSelectTamerCondition))
                         {
-                            if (CardEffectCommons.CanPlayAsNewPermanent(cardSource: card, payCost: true, cardEffect: activateClass))
+                            if (CardEffectCommons.CanPlayAsNewPermanent(cardSource: card, payCost: false, cardEffect: activateClass))
                             {
                                 return true;
                             }

+ 3 - 3
Assets/CardEffect/P/Green/P_143.cs

@@ -25,7 +25,7 @@ namespace DCGO.CardEffects.P
 
                 bool CanUseCondition(Hashtable hashtable)
                 {
-                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
                     {
                         if (CardEffectCommons.IsOwnerTurn(card))
                         {
@@ -38,11 +38,11 @@ namespace DCGO.CardEffects.P
 
                 bool CanActivateCondition(Hashtable hashtable)
                 {
-                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
                     {
                         if (card.Owner.GetBreedingAreaPermanents().Count == 0)
                         {
-                            return true;
+                            return GManager.instance.turnStateMachine.gameContext.TurnPlayer.CanMove;
                         }
                     }
                         return false;

+ 345 - 339
Assets/CardEffect/P/Purple/P_096.cs

@@ -1,487 +1,493 @@
-using System.Collections;
+using System;
+using System.Collections;
 using System.Collections.Generic;
-using UnityEngine;
 using System.Linq;
-using Photon;
-using System;
-using Photon.Pun;
 
-public class P_096 : CEntity_Effect
+namespace DCGO.CardEffects.P
 {
-    public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
+    public class P_096 : CEntity_Effect
     {
-        List<ICardEffect> cardEffects = new List<ICardEffect>();
-
-        if (timing == EffectTiming.None)
+        public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
         {
-            IgnoreColorConditionClass ignoreColorConditionClass = new IgnoreColorConditionClass();
-            ignoreColorConditionClass.SetUpICardEffect("Ignore color requirements", CanUseCondition, card);
-            ignoreColorConditionClass.SetUpIgnoreColorConditionClass(cardCondition: CardCondition);
-            cardEffects.Add(ignoreColorConditionClass);
+            List<ICardEffect> cardEffects = new List<ICardEffect>();
 
-            bool PermanentCondition(Permanent permanent)
+            #region Ignore Color Requirements
+            if (timing == EffectTiming.None)
             {
-                if (CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card))
+                IgnoreColorConditionClass ignoreColorConditionClass = new IgnoreColorConditionClass();
+                ignoreColorConditionClass.SetUpICardEffect("Ignore color requirements", CanUseCondition, card);
+                ignoreColorConditionClass.SetUpIgnoreColorConditionClass(cardCondition: CardCondition);
+                cardEffects.Add(ignoreColorConditionClass);
+
+                bool PermanentCondition(Permanent permanent)
                 {
-                    if (permanent.IsTamer)
+                    if (CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card))
                     {
-                        if (permanent.TopCard.CardTraits.Contains("Hunter"))
+                        if (permanent.IsTamer)
                         {
-                            return true;
+                            if (permanent.TopCard.CardTraits.Contains("Hunter"))
+                            {
+                                return true;
+                            }
                         }
                     }
-                }
 
-                return false;
-            }
+                    return false;
+                }
 
-            bool CanUseCondition(Hashtable hashtable)
-            {
-                if (CardEffectCommons.HasMatchConditionPermanent(PermanentCondition))
+                bool CanUseCondition(Hashtable hashtable)
                 {
-                    return true;
+                    if (CardEffectCommons.HasMatchConditionPermanent(PermanentCondition))
+                    {
+                        return true;
+                    }
+
+                    return false;
                 }
 
-                return false;
+                bool CardCondition(CardSource cardSource)
+                {
+                    return cardSource == card;
+                }
             }
+            #endregion
 
-            bool CardCondition(CardSource cardSource)
+            #region Main
+            if (timing == EffectTiming.OptionSkill)
             {
-                return cardSource == card;
-            }
-        }
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect(card.BaseENGCardNameFromEntity, CanUseCondition, card);
+                activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDiscription());
+                cardEffects.Add(activateClass);
 
-        if (timing == EffectTiming.OptionSkill)
-        {
-            ActivateClass activateClass = new ActivateClass();
-            activateClass.SetUpICardEffect(card.BaseENGCardNameFromEntity, CanUseCondition, card);
-            activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDiscription());
-            cardEffects.Add(activateClass);
-
-            string EffectDiscription()
-            {
-                return "[Main] By placing up to 2 Digimon cards with <Save> in their text from under your Tamers or your trash under 1 of your Digimon with <Save> in its text as its bottom digivolution cards, that Digimon gains +1000 DP for each card placed by this effect.";
-            }
+                string EffectDiscription()
+                {
+                    return "[Main] By placing up to 2 Digimon cards with <Save> in their text from under your Tamers or your trash under 1 of your Digimon with <Save> in its text as its bottom digivolution cards, that Digimon gains +1000 DP for each card placed by this effect.";
+                }
 
-            bool CanSelectGetDigivolutionCardsPermanentCondition(Permanent permanent)
-            {
-                if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
+                bool CanSelectGetDigivolutionCardsPermanentCondition(Permanent permanent)
                 {
-                    if (permanent.TopCard.HasSaveText)
+                    if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
                     {
-                        if (!permanent.IsToken)
+                        if (permanent.TopCard.HasSaveText)
                         {
-                            return true;
+                            if (!permanent.IsToken)
+                            {
+                                return true;
+                            }
                         }
                     }
-                }
-
-                return false;
-            }
 
-            bool CanUseCondition(Hashtable hashtable)
-            {
-                return CardEffectCommons.CanTriggerOptionMainEffect(hashtable, card);
-            }
+                    return false;
+                }
 
-            IEnumerator ActivateCoroutine(Hashtable _hashtable)
-            {
-                if (card.Owner.GetBattleAreaPermanents().Some(CanSelectGetDigivolutionCardsPermanentCondition))
+                bool CanUseCondition(Hashtable hashtable)
                 {
-                    List<CardSource> digivolutionCards = new List<CardSource>();
+                    return CardEffectCommons.CanTriggerOptionMainEffect(hashtable, card);
+                }
 
-                    bool CanSelectDigivolutionCardsCondition(CardSource cardSource)
+                IEnumerator ActivateCoroutine(Hashtable _hashtable)
+                {
+                    if (card.Owner.GetBattleAreaPermanents().Some(CanSelectGetDigivolutionCardsPermanentCondition))
                     {
-                        if (cardSource.IsDigimon)
+                        List<CardSource> digivolutionCards = new List<CardSource>();
+
+                        bool CanSelectDigivolutionCardsCondition(CardSource cardSource)
                         {
-                            if (cardSource.HasSaveText)
+                            if (cardSource.IsDigimon)
                             {
-                                if (!digivolutionCards.Contains(cardSource))
+                                if (cardSource.HasSaveText)
                                 {
-                                    return true;
+                                    if (!digivolutionCards.Contains(cardSource))
+                                    {
+                                        return true;
+                                    }
                                 }
                             }
-                        }
 
-                        return false;
-                    }
+                            return false;
+                        }
 
-                    bool CanSelectTamerCondition(Permanent permanent)
-                    {
-                        if (CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card))
+                        bool CanSelectTamerCondition(Permanent permanent)
                         {
-                            if (permanent.IsTamer)
+                            if (CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card))
                             {
-                                if (permanent.DigivolutionCards.Count(CanSelectDigivolutionCardsCondition) >= 1)
+                                if (permanent.IsTamer)
                                 {
-                                    return true;
+                                    if (permanent.DigivolutionCards.Count(CanSelectDigivolutionCardsCondition) >= 1)
+                                    {
+                                        return true;
+                                    }
                                 }
                             }
-                        }
 
-                        return false;
-                    }
+                            return false;
+                        }
 
-                    bool canSelectTamer() => card.Owner.GetBattleAreaPermanents().Some(CanSelectTamerCondition);
-                    bool canSelectTrash() => CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectDigivolutionCardsCondition);
+                        bool canSelectTamer() => card.Owner.GetBattleAreaPermanents().Some(CanSelectTamerCondition);
+                        bool canSelectTrash() => CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectDigivolutionCardsCondition);
 
-                    int maxSelectCardCount() => 2 - digivolutionCards.Count;
+                        int maxSelectCardCount() => 2 - digivolutionCards.Count;
 
-                    bool canSelect() => (canSelectTamer() || canSelectTrash()) && maxSelectCardCount() >= 1;
+                        bool canSelect() => (canSelectTamer() || canSelectTrash()) && maxSelectCardCount() >= 1;
 
-                    while (canSelect())
-                    {
-                        bool fromTrash = false;
-                        bool noSelect = false;
+                        while (canSelect())
+                        {
+                            bool fromTrash = false;
+                            bool noSelect = false;
 
-                        yield return GManager.instance.photonWaitController.StartWait("PrismGallet_Select");
+                            yield return GManager.instance.photonWaitController.StartWait("PrismGallet_Select");
 
-                        if (canSelectTamer() && canSelectTrash())
-                        {
-                            List<SelectionElement<int>> selectionElements = new List<SelectionElement<int>>()
+                            if (canSelectTamer() && canSelectTrash())
+                            {
+                                List<SelectionElement<int>> selectionElements = new List<SelectionElement<int>>()
                             {
                                 new SelectionElement<int>(message: $"Under Tamer", value : 0, spriteIndex: 0),
                                 new SelectionElement<int>(message: $"From trash", value : 1, spriteIndex: 0),
                                 new SelectionElement<int>(message: $"No Select", value : 2, spriteIndex: 1),
                             };
 
-                            string selectPlayerMessage = "From which area do you select cards?";
-                            string notSelectPlayerMessage = "The opponent is choosing from which area to select cards.";
+                                string selectPlayerMessage = "From which area do you select cards?";
+                                string notSelectPlayerMessage = "The opponent is choosing from which area to select cards.";
 
-                            GManager.instance.userSelectionManager.SetIntSelection(
-                                selectionElements: selectionElements,
-                                selectPlayer: card.Owner,
-                                selectPlayerMessage: selectPlayerMessage,
-                                notSelectPlayerMessage: notSelectPlayerMessage);
+                                GManager.instance.userSelectionManager.SetIntSelection(
+                                    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());
 
-                            if (GManager.instance.userSelectionManager.SelectedIntValue == 2)
-                            {
-                                noSelect = true;
-                            }
+                                if (GManager.instance.userSelectionManager.SelectedIntValue == 2)
+                                {
+                                    noSelect = true;
+                                }
 
-                            else
-                            {
-                                fromTrash = GManager.instance.userSelectionManager.SelectedIntValue == 1;
+                                else
+                                {
+                                    fromTrash = GManager.instance.userSelectionManager.SelectedIntValue == 1;
+                                }
                             }
-                        }
 
-                        else if (!canSelectTamer() && canSelectTrash())
-                        {
-                            List<SelectionElement<bool>> selectionElements = new List<SelectionElement<bool>>()
+                            else if (!canSelectTamer() && canSelectTrash())
+                            {
+                                List<SelectionElement<bool>> selectionElements = new List<SelectionElement<bool>>()
                             {
                                 new SelectionElement<bool>(message: $"Select", value : true, spriteIndex: 0),
                                 new SelectionElement<bool>(message: $"Not Select", value : false, spriteIndex: 1),
                             };
 
-                            string selectPlayerMessage = "Will you select cards from trash?";
-                            string notSelectPlayerMessage = "The opponent is choosing wheter to select cards from trash.";
+                                string selectPlayerMessage = "Will you select cards from trash?";
+                                string notSelectPlayerMessage = "The opponent is choosing wheter to select cards from trash.";
 
-                            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 doSelect = GManager.instance.userSelectionManager.SelectedBoolValue;
+                                bool doSelect = GManager.instance.userSelectionManager.SelectedBoolValue;
 
-                            if (doSelect)
-                            {
-                                fromTrash = true;
-                            }
+                                if (doSelect)
+                                {
+                                    fromTrash = true;
+                                }
 
-                            else
-                            {
-                                noSelect = true;
+                                else
+                                {
+                                    noSelect = true;
+                                }
                             }
-                        }
 
-                        else if (canSelectTamer() && !canSelectTrash())
-                        {
-                            List<SelectionElement<bool>> selectionElements = new List<SelectionElement<bool>>()
+                            else if (canSelectTamer() && !canSelectTrash())
+                            {
+                                List<SelectionElement<bool>> selectionElements = new List<SelectionElement<bool>>()
                             {
                                 new SelectionElement<bool>(message: $"Select", value : true, spriteIndex: 0),
                                 new SelectionElement<bool>(message: $"Not Select", value : false, spriteIndex: 1),
                             };
 
-                            string selectPlayerMessage = "Will you select cards from under Tamer?";
-                            string notSelectPlayerMessage = "The opponent is choosing wheter to select cards from under Tamer.";
+                                string selectPlayerMessage = "Will you select cards from under Tamer?";
+                                string notSelectPlayerMessage = "The opponent is choosing wheter to select cards from under Tamer.";
 
-                            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 doSelect = GManager.instance.userSelectionManager.SelectedBoolValue;
+                                bool doSelect = GManager.instance.userSelectionManager.SelectedBoolValue;
 
-                            if (doSelect)
-                            {
-                                fromTrash = false;
+                                if (doSelect)
+                                {
+                                    fromTrash = false;
+                                }
+
+                                else
+                                {
+                                    noSelect = true;
+                                }
                             }
 
                             else
                             {
                                 noSelect = true;
                             }
-                        }
-
-                        else
-                        {
-                            noSelect = true;
-                        }
 
-                        if (noSelect)
-                        {
-                            break;
-                        }
+                            if (noSelect)
+                            {
+                                break;
+                            }
 
-                        else
-                        {
-                            if (fromTrash)
+                            else
                             {
-                                if (canSelectTrash())
+                                if (fromTrash)
                                 {
-                                    List<CardSource> selectedCards = new List<CardSource>();
-
-                                    int _maxCount = maxSelectCardCount();
-
-                                    SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
-
-                                    selectCardEffect.SetUp(
-                                        canTargetCondition: CanSelectDigivolutionCardsCondition,
-                                        canTargetCondition_ByPreSelecetedList: null,
-                                        canEndSelectCondition: null,
-                                        canNoSelect: () => true,
-                                        selectCardCoroutine: SelectCardCoroutine,
-                                        afterSelectCardCoroutine: null,
-                                        message: "Select cards from trash to place in Digivolution cards.",
-                                        maxCount: 1,
-                                        canEndNotMax: true,
-                                        isShowOpponent: true,
-                                        mode: SelectCardEffect.Mode.Custom,
-                                        root: SelectCardEffect.Root.Trash,
-                                        customRootCardList: null,
-                                        canLookReverseCard: true,
-                                        selectPlayer: card.Owner,
-                                        cardEffect: activateClass);
-
-                                    yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
-
-                                    selectCardEffect.SetUpCustomMessage(
-                                        "Select cards from trash to place in Digivolution cards.",
-                                        "The opponent is selecting cards to place in Digivolution cards.");
-
-                                    yield return StartCoroutine(selectCardEffect.Activate());
-
-                                    IEnumerator SelectCardCoroutine(CardSource cardSource)
+                                    if (canSelectTrash())
                                     {
-                                        selectedCards.Add(cardSource);
-                                        digivolutionCards.Add(cardSource);
-                                        yield return null;
+                                        List<CardSource> selectedCards = new List<CardSource>();
+
+                                        int _maxCount = Math.Min(maxSelectCardCount(), CardEffectCommons.MatchConditionOwnersCardCountInTrash(card, CanSelectDigivolutionCardsCondition));
+
+                                        SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
+
+                                        selectCardEffect.SetUp(
+                                            canTargetCondition: CanSelectDigivolutionCardsCondition,
+                                            canTargetCondition_ByPreSelecetedList: null,
+                                            canEndSelectCondition: null,
+                                            canNoSelect: () => true,
+                                            selectCardCoroutine: SelectCardCoroutine,
+                                            afterSelectCardCoroutine: null,
+                                            message: "Select cards from trash to place in Digivolution cards.",
+                                            maxCount: _maxCount,
+                                            canEndNotMax: true,
+                                            isShowOpponent: true,
+                                            mode: SelectCardEffect.Mode.Custom,
+                                            root: SelectCardEffect.Root.Trash,
+                                            customRootCardList: null,
+                                            canLookReverseCard: true,
+                                            selectPlayer: card.Owner,
+                                            cardEffect: activateClass);
+
+                                        yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
+
+                                        selectCardEffect.SetUpCustomMessage(
+                                            "Select cards from trash to place in Digivolution cards.",
+                                            "The opponent is selecting cards to place in Digivolution cards.");
+
+                                        yield return StartCoroutine(selectCardEffect.Activate());
+
+                                        IEnumerator SelectCardCoroutine(CardSource cardSource)
+                                        {
+                                            selectedCards.Add(cardSource);
+                                            digivolutionCards.Add(cardSource);
+                                            yield return null;
+                                        }
                                     }
                                 }
-                            }
 
-                            else
-                            {
-                                if (canSelectTamer())
+                                else
                                 {
-                                    Permanent selectedPermanent = null;
+                                    if (canSelectTamer())
+                                    {
+                                        Permanent selectedPermanent = null;
 
-                                    int _maxCount = 1;
+                                        int _maxCount = 1;
 
-                                    SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+                                        SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
 
-                                    selectPermanentEffect.SetUp(
-                                        selectPlayer: card.Owner,
-                                        canTargetCondition: CanSelectTamerCondition,
-                                        canTargetCondition_ByPreSelecetedList: null,
-                                        canEndSelectCondition: null,
-                                        maxCount: 1,
-                                        canNoSelect: true,
-                                        canEndNotMax: true,
-                                        selectPermanentCoroutine: SelectPermanentCoroutine,
-                                        afterSelectPermanentCoroutine: null,
-                                        mode: SelectPermanentEffect.Mode.Custom,
-                                        cardEffect: activateClass);
+                                        selectPermanentEffect.SetUp(
+                                            selectPlayer: card.Owner,
+                                            canTargetCondition: CanSelectTamerCondition,
+                                            canTargetCondition_ByPreSelecetedList: null,
+                                            canEndSelectCondition: null,
+                                            maxCount: 1,
+                                            canNoSelect: true,
+                                            canEndNotMax: true,
+                                            selectPermanentCoroutine: SelectPermanentCoroutine,
+                                            afterSelectPermanentCoroutine: null,
+                                            mode: SelectPermanentEffect.Mode.Custom,
+                                            cardEffect: activateClass);
 
-                                    selectPermanentEffect.SetUpCustomMessage("Select 1 Tamer.", "The opponent is selecting 1 Tamer.");
+                                        selectPermanentEffect.SetUpCustomMessage("Select 1 Tamer.", "The opponent is selecting 1 Tamer.");
 
-                                    yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+                                        yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
 
-                                    IEnumerator SelectPermanentCoroutine(Permanent permanent)
-                                    {
-                                        selectedPermanent = permanent;
+                                        IEnumerator SelectPermanentCoroutine(Permanent permanent)
+                                        {
+                                            selectedPermanent = permanent;
 
-                                        yield return null;
-                                    }
+                                            yield return null;
+                                        }
 
-                                    if (selectedPermanent != null)
-                                    {
-                                        if (selectedPermanent.DigivolutionCards.Count(CanSelectDigivolutionCardsCondition) >= 1)
+                                        if (selectedPermanent != null)
                                         {
-                                            _maxCount = Math.Min(
-                                                maxSelectCardCount(),
-                                                selectedPermanent.DigivolutionCards.Count(CanSelectDigivolutionCardsCondition));
-
-                                            List<CardSource> selectedCards = new List<CardSource>();
-
-                                            SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
-
-                                            selectCardEffect.SetUp(
-                                                        canTargetCondition: CanSelectDigivolutionCardsCondition,
-                                                        canTargetCondition_ByPreSelecetedList: null,
-                                                        canEndSelectCondition: null,
-                                                        canNoSelect: () => true,
-                                                        selectCardCoroutine: SelectCardCoroutine,
-                                                        afterSelectCardCoroutine: null,
-                                                        message: "Select digivolution cards.",
-                                                        maxCount: 1,
-                                                        canEndNotMax: true,
-                                                        isShowOpponent: true,
-                                                        mode: SelectCardEffect.Mode.Custom,
-                                                        root: SelectCardEffect.Root.Custom,
-                                                        customRootCardList: selectedPermanent.DigivolutionCards,
-                                                        canLookReverseCard: true,
-                                                        selectPlayer: card.Owner,
-                                                        cardEffect: activateClass);
-
-                                            selectCardEffect.SetUpCustomMessage("Select digivolution cards.", "The opponent is selecting digivolution cards.");
-
-                                            yield return StartCoroutine(selectCardEffect.Activate());
-
-                                            IEnumerator SelectCardCoroutine(CardSource cardSource)
+                                            if (selectedPermanent.DigivolutionCards.Count(CanSelectDigivolutionCardsCondition) >= 1)
                                             {
-                                                selectedCards.Add(cardSource);
-                                                digivolutionCards.Add(cardSource);
-                                                yield return null;
+                                                _maxCount = Math.Min(
+                                                    maxSelectCardCount(),
+                                                    selectedPermanent.DigivolutionCards.Count(CanSelectDigivolutionCardsCondition));
+
+                                                List<CardSource> selectedCards = new List<CardSource>();
+
+                                                SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
+
+                                                selectCardEffect.SetUp(
+                                                            canTargetCondition: CanSelectDigivolutionCardsCondition,
+                                                            canTargetCondition_ByPreSelecetedList: null,
+                                                            canEndSelectCondition: null,
+                                                            canNoSelect: () => true,
+                                                            selectCardCoroutine: SelectCardCoroutine,
+                                                            afterSelectCardCoroutine: null,
+                                                            message: "Select digivolution cards.",
+                                                            maxCount: 1,
+                                                            canEndNotMax: true,
+                                                            isShowOpponent: true,
+                                                            mode: SelectCardEffect.Mode.Custom,
+                                                            root: SelectCardEffect.Root.Custom,
+                                                            customRootCardList: selectedPermanent.DigivolutionCards,
+                                                            canLookReverseCard: true,
+                                                            selectPlayer: card.Owner,
+                                                            cardEffect: activateClass);
+
+                                                selectCardEffect.SetUpCustomMessage("Select digivolution cards.", "The opponent is selecting digivolution cards.");
+
+                                                yield return StartCoroutine(selectCardEffect.Activate());
+
+                                                IEnumerator SelectCardCoroutine(CardSource cardSource)
+                                                {
+                                                    selectedCards.Add(cardSource);
+                                                    digivolutionCards.Add(cardSource);
+                                                    yield return null;
+                                                }
                                             }
                                         }
                                     }
                                 }
                             }
                         }
-                    }
-
-                    if (digivolutionCards.Count >= 1)
-                    {
-                        List<CardSource> digivolutionCards_fixed = new List<CardSource>();
 
-                        if (digivolutionCards.Count == 1)
+                        if (digivolutionCards.Count >= 1)
                         {
-                            digivolutionCards_fixed = digivolutionCards.Clone();
-                        }
+                            List<CardSource> digivolutionCards_fixed = new List<CardSource>();
 
-                        else
-                        {
-                            SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
-
-                            selectCardEffect.SetUp(
-                                canTargetCondition: (cardSource) => true,
-                                canTargetCondition_ByPreSelecetedList: null,
-                                canEndSelectCondition: null,
-                                canNoSelect: () => false,
-                                selectCardCoroutine: null,
-                                afterSelectCardCoroutine: AfterSelectCardCoroutine1,
-                                message: "Specify the order to place the cards in the digivolution cards\n(cards will be placed so that cards with lower numbers are on top).",
-                                maxCount: digivolutionCards.Count,
-                                canEndNotMax: false,
-                                isShowOpponent: false,
-                                mode: SelectCardEffect.Mode.Custom,
-                                root: SelectCardEffect.Root.Custom,
-                                customRootCardList: digivolutionCards,
-                                canLookReverseCard: true,
-                                selectPlayer: card.Owner,
-                                cardEffect: activateClass);
-
-                            selectCardEffect.SetNotShowCard();
-
-                            yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
-
-                            IEnumerator AfterSelectCardCoroutine1(List<CardSource> cardSources)
+                            if (digivolutionCards.Count == 1)
                             {
-                                foreach (CardSource cardSource in cardSources)
-                                {
-                                    digivolutionCards_fixed.Add(cardSource);
-                                }
-
-                                yield return null;
+                                digivolutionCards_fixed = digivolutionCards.Clone();
                             }
-                        }
-
-                        if (digivolutionCards_fixed.Count >= 1)
-                        {
-                            yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().ShowCardEffect2(digivolutionCards_fixed, "Digivolutuion Cards", true, true));
 
-                            if (card.Owner.GetBattleAreaPermanents().Count(CanSelectGetDigivolutionCardsPermanentCondition) >= 1)
+                            else
                             {
-                                int maxCount = 1;
-
-                                SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+                                SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
 
-                                selectPermanentEffect.SetUp(
-                                    selectPlayer: card.Owner,
-                                    canTargetCondition: CanSelectGetDigivolutionCardsPermanentCondition,
+                                selectCardEffect.SetUp(
+                                    canTargetCondition: (cardSource) => true,
                                     canTargetCondition_ByPreSelecetedList: null,
                                     canEndSelectCondition: null,
-                                    maxCount: maxCount,
-                                    canNoSelect: false,
+                                    canNoSelect: () => false,
+                                    selectCardCoroutine: null,
+                                    afterSelectCardCoroutine: AfterSelectCardCoroutine1,
+                                    message: "Specify the order to place the cards in the digivolution cards\n(cards will be placed so that cards with lower numbers are on top).",
+                                    maxCount: digivolutionCards.Count,
                                     canEndNotMax: false,
-                                    selectPermanentCoroutine: SelectPermanentCoroutine,
-                                    afterSelectPermanentCoroutine: null,
-                                    mode: SelectPermanentEffect.Mode.Custom,
+                                    isShowOpponent: false,
+                                    mode: SelectCardEffect.Mode.Custom,
+                                    root: SelectCardEffect.Root.Custom,
+                                    customRootCardList: digivolutionCards,
+                                    canLookReverseCard: true,
+                                    selectPlayer: card.Owner,
                                     cardEffect: activateClass);
 
-                                selectPermanentEffect.SetUpCustomMessage(
-                                    "Select 1 Digimon that will get digivolution cards.",
-                                    "The opponent is selecting 1 Digimon that will get digivolution cards.");
+                                selectCardEffect.SetNotShowCard();
+
+                                yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
+
+                                IEnumerator AfterSelectCardCoroutine1(List<CardSource> cardSources)
+                                {
+                                    foreach (CardSource cardSource in cardSources)
+                                    {
+                                        digivolutionCards_fixed.Add(cardSource);
+                                    }
+
+                                    yield return null;
+                                }
+                            }
 
-                                yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+                            if (digivolutionCards_fixed.Count >= 1)
+                            {
+                                yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().ShowCardEffect2(digivolutionCards_fixed, "Digivolutuion Cards", true, true));
 
-                                IEnumerator SelectPermanentCoroutine(Permanent permanent)
+                                if (card.Owner.GetBattleAreaPermanents().Count(CanSelectGetDigivolutionCardsPermanentCondition) >= 1)
                                 {
-                                    yield return ContinuousController.instance.StartCoroutine(permanent.AddDigivolutionCardsBottom(
-                                        digivolutionCards_fixed, activateClass));
+                                    int maxCount = 1;
 
-                                    int getDigivolutionCardsCount = digivolutionCards_fixed.Count((cardSource) =>
-                                    permanent.DigivolutionCards.Contains(cardSource));
+                                    SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
 
-                                    int plusDP = 1000 * getDigivolutionCardsCount;
+                                    selectPermanentEffect.SetUp(
+                                        selectPlayer: card.Owner,
+                                        canTargetCondition: CanSelectGetDigivolutionCardsPermanentCondition,
+                                        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 digivolution cards.",
+                                        "The opponent is selecting 1 Digimon that will get digivolution cards.");
+
+                                    yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
 
-                                    yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(
-                                        targetPermanent: permanent,
-                                        changeValue: plusDP,
-                                        effectDuration: EffectDuration.UntilEachTurnEnd,
-                                        activateClass: activateClass));
+                                    IEnumerator SelectPermanentCoroutine(Permanent permanent)
+                                    {
+                                        yield return ContinuousController.instance.StartCoroutine(permanent.AddDigivolutionCardsBottom(
+                                            digivolutionCards_fixed, activateClass));
+
+                                        int getDigivolutionCardsCount = digivolutionCards_fixed.Count((cardSource) =>
+                                        permanent.DigivolutionCards.Contains(cardSource));
+
+                                        int plusDP = 1000 * getDigivolutionCardsCount;
+
+                                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(
+                                            targetPermanent: permanent,
+                                            changeValue: plusDP,
+                                            effectDuration: EffectDuration.UntilEachTurnEnd,
+                                            activateClass: activateClass));
+                                    }
                                 }
                             }
                         }
                     }
                 }
             }
-        }
-
-        if (timing == EffectTiming.SecuritySkill)
-        {
-            ActivateClass activateClass = new ActivateClass();
-            activateClass.SetUpICardEffect($"Add this card to hand", CanUseCondition, card);
-            activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDiscription());
-            activateClass.SetIsSecurityEffect(true);
-            cardEffects.Add(activateClass);
+            #endregion
 
-            string EffectDiscription()
-            {
-                return "[Security] Add this card to its owner's hand.";
-            }
-            bool CanUseCondition(Hashtable hashtable)
+            #region Security Effect
+            if (timing == EffectTiming.SecuritySkill)
             {
-                return CardEffectCommons.CanTriggerSecurityEffect(hashtable, card);
-            }
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect($"Add this card to hand", CanUseCondition, card);
+                activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDiscription());
+                activateClass.SetIsSecurityEffect(true);
+                cardEffects.Add(activateClass);
 
-            IEnumerator ActivateCoroutine(Hashtable _hashtable)
-            {
-                yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.AddThisCardToHand(card, activateClass));
+                string EffectDiscription()
+                {
+                    return "[Security] Add this card to its owner's hand.";
+                }
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.CanTriggerSecurityEffect(hashtable, card);
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable _hashtable)
+                {
+                    yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.AddThisCardToHand(card, activateClass));
+                }
             }
-        }
+            #endregion
 
-        return cardEffects;
+            return cardEffects;
+        }
     }
 }

+ 87 - 23
Assets/CardEffect/P/White/P_156.cs

@@ -85,6 +85,8 @@ namespace DCGO.CardEffects.P
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
+                    Permanent selectedPermanent = null;
+
                     if (CardEffectCommons.HasMatchConditionPermanent(HasTamer))
                     {
                         int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(HasTamer));
@@ -111,35 +113,97 @@ namespace DCGO.CardEffects.P
 
                     IEnumerator TamerSelected(Permanent permanent)
                     {
-                        if(permanent != null)
+                        selectedPermanent = permanent;
+
+                        yield return null;
+                    }
+
+                    if(selectedPermanent != null)
+                    {
+                        tamerColors = selectedPermanent.TopCard.CardColors;
+                        bool canSelectHand = CardEffectCommons.HasMatchConditionOwnersHand(card, SelectDigimonCondition);
+                        bool canSelectTrash = CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, SelectDigimonCondition);
+
+                        if (canSelectHand || canSelectTrash)
                         {
-                            tamerColors = permanent.TopCard.CardColors;
-                            List<CardSource> cardOptions = card.Owner.HandCards.Concat(card.Owner.TrashCards).ToList().Filter(SelectDigimonCondition);
-                            
-                            if (cardOptions.Count > 0)
+                            if (canSelectHand && canSelectTrash)
+                            {
+                                List<SelectionElement<bool>> selectionElements = new List<SelectionElement<bool>>
+                            {
+                                new(message: "From hand", value: true, spriteIndex: 0),
+                                new(message: "From trash", value: false, spriteIndex: 1),
+                            };
+
+                                string selectPlayerMessage = "From which area do you play a card?";
+                                string notSelectPlayerMessage = "The opponent is choosing from which area to play a card.";
+
+                                GManager.instance.userSelectionManager.SetBoolSelection(selectionElements: selectionElements,
+                                    selectPlayer: card.Owner, selectPlayerMessage: selectPlayerMessage,
+                                    notSelectPlayerMessage: notSelectPlayerMessage);
+                            }
+
+                            else
+                            {
+                                GManager.instance.userSelectionManager.SetBool(canSelectHand);
+                            }
+
+                            yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager
+                                .WaitForEndSelect());
+
+                            bool fromHand = GManager.instance.userSelectionManager.SelectedBoolValue;
+
+                            if (fromHand)
+                            {
+                                SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
+
+                                selectHandEffect.SetUp(
+                                    selectPlayer: card.Owner,
+                                    canTargetCondition: SelectDigimonCondition,
+                                    canTargetCondition_ByPreSelecetedList: null,
+                                    canEndSelectCondition: null,
+                                    maxCount: 1,
+                                    canNoSelect: false,
+                                    canEndNotMax: false,
+                                    isShowOpponent: true,
+                                    selectCardCoroutine: null,
+                                    afterSelectCardCoroutine: DigimonSelected,
+                                    mode: SelectHandEffect.Mode.Custom,
+                                    cardEffect: activateClass);
+
+                                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());
+                            }
+                            else
                             {
                                 SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
 
                                 selectCardEffect.SetUp(
-                                canTargetCondition: SelectDigimonCondition,
-                                canTargetCondition_ByPreSelecetedList: null,
-                                canEndSelectCondition: null,
-                                canNoSelect: () => true,
-                                selectCardCoroutine: null,
-                                afterSelectCardCoroutine: DigimonSelected,
-                                message: "Select Digimon to play.",
-                                maxCount: 1,
-                                canEndNotMax: false,
-                                isShowOpponent: false,
-                                mode: SelectCardEffect.Mode.Custom,
-                                root: SelectCardEffect.Root.Custom,
-                                customRootCardList: cardOptions,
-                                canLookReverseCard: true,
-                                selectPlayer: card.Owner,
-                                cardEffect: activateClass);
-
-                                yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
+                                    canTargetCondition: SelectDigimonCondition,
+                                    canTargetCondition_ByPreSelecetedList: null,
+                                    canEndSelectCondition: null,
+                                    canNoSelect: () => false,
+                                    selectCardCoroutine: null,
+                                    afterSelectCardCoroutine: DigimonSelected,
+                                    message: "Select Digimon 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 Digimon to play.",
+                                    "The opponent is selecting 1 Digimon to play.");
+
+                                yield return StartCoroutine(selectCardEffect.Activate());
                             }
+
                         }
                     }
 

+ 2 - 2
Assets/CardEffect/RB1/Blue/RB1_016.cs

@@ -331,7 +331,7 @@ public class RB1_016 : CEntity_Effect
                 {
                     if (permanent.TopCard.CardColors.Contains(CardColor.Blue))
                     {
-                        return true;
+                        return permanent.willBeRemoveField;
                     }
                 }
 
@@ -357,7 +357,7 @@ public class RB1_016 : CEntity_Effect
                 {
                     if (card.Owner.TrashCards.Count(CanSelectCardCondition) >= 3)
                     {
-                        return true;
+                        return CardEffectCommons.HasMatchConditionOwnersPermanent(card, PermanentCondition);
                     }
                 }
 

+ 207 - 164
Assets/CardEffect/ST13/Red/ST13_06.cs

@@ -6,163 +6,237 @@ using Photon;
 using System;
 using Photon.Pun;
 
-public class ST13_06 : CEntity_Effect
+namespace DCGO.CardEffects.ST13
 {
-    public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
+    public class ST13_06 : CEntity_Effect
     {
-        List<ICardEffect> cardEffects = new List<ICardEffect>();
-
-        if (timing == EffectTiming.None)
+        public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
         {
-            AddJogressConditionClass addJogressConditionClass = new AddJogressConditionClass();
-            addJogressConditionClass.SetUpICardEffect($"DNA Digivolution", CanUseCondition, card);
-            addJogressConditionClass.SetUpAddJogressConditionClass(getJogressCondition: GetJogress);
-            addJogressConditionClass.SetNotShowUI(true);
-            cardEffects.Add(addJogressConditionClass);
+            List<ICardEffect> cardEffects = new List<ICardEffect>();
 
-            bool CanUseCondition(Hashtable hashtable)
+            #region DNA Requirements
+            if (timing == EffectTiming.None)
             {
-                return true;
-            }
+                AddJogressConditionClass addJogressConditionClass = new AddJogressConditionClass();
+                addJogressConditionClass.SetUpICardEffect($"DNA Digivolution", CanUseCondition, card);
+                addJogressConditionClass.SetUpAddJogressConditionClass(getJogressCondition: GetJogress);
+                addJogressConditionClass.SetNotShowUI(true);
+                cardEffects.Add(addJogressConditionClass);
 
-            JogressCondition GetJogress(CardSource cardSource)
-            {
-                if (cardSource == card)
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return true;
+                }
+
+                JogressCondition GetJogress(CardSource cardSource)
                 {
-                    bool PermanentCondition1(Permanent permanent)
+                    if (cardSource == card)
                     {
-                        if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
+                        bool PermanentCondition1(Permanent permanent)
                         {
-                            if (permanent.TopCard.CardColors.Contains(CardColor.Red))
+                            if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
                             {
-                                if (permanent.Levels_ForJogress(card).Contains(6))
+                                if (permanent.TopCard.CardColors.Contains(CardColor.Red))
                                 {
-                                    return true;
+                                    if (permanent.Levels_ForJogress(card).Contains(6))
+                                    {
+                                        return true;
+                                    }
                                 }
                             }
-                        }
 
-                        return false;
-                    }
+                            return false;
+                        }
 
-                    bool PermanentCondition2(Permanent permanent)
-                    {
-                        if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
+                        bool PermanentCondition2(Permanent permanent)
                         {
-                            if (permanent.TopCard.CardColors.Contains(CardColor.Black))
+                            if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
                             {
-                                if (permanent.Levels_ForJogress(card).Contains(6))
+                                if (permanent.TopCard.CardColors.Contains(CardColor.Black))
                                 {
-                                    return true;
+                                    if (permanent.Levels_ForJogress(card).Contains(6))
+                                    {
+                                        return true;
+                                    }
                                 }
                             }
-                        }
 
-                        return false;
-                    }
+                            return false;
+                        }
 
-                    JogressConditionElement[] elements = new JogressConditionElement[]
-                    {
+                        JogressConditionElement[] elements = new JogressConditionElement[]
+                        {
                         new JogressConditionElement(PermanentCondition1, "a level 6 red Digimon"),
 
                         new JogressConditionElement(PermanentCondition2, "a level 6 black Digimon"),
-                    };
-
-                    JogressCondition jogressCondition = new JogressCondition(elements, 0);
+                        };
 
-                    return jogressCondition;
-                }
-
-                return null;
-            }
-        }
+                        JogressCondition jogressCondition = new JogressCondition(elements, 0);
 
-        if (timing == EffectTiming.OnEnterFieldAnyone)
-        {
-            ActivateClass activateClass = new ActivateClass();
-            activateClass.SetUpICardEffect("Blitz, delete Digimon and trash opponent's Security", CanUseCondition, card);
-            activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
-            cardEffects.Add(activateClass);
+                        return jogressCondition;
+                    }
 
-            string EffectDiscription()
-            {
-                return "[When Digivolving] <Blitz> (This Digimon can attack when your opponent has 1 or more memory.) When DNA digivolving, for every 4 cards in this Digimon's digivolution cards, delete 1 of your opponent's Digimon with a play cost of 20 or less and trash the top card of your opponent's security stack.";
+                    return null;
+                }
             }
+            #endregion
 
-            int count()
+            #region When Digivolving
+            if (timing == EffectTiming.OnEnterFieldAnyone)
             {
-                int count = 0;
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Blitz, delete Digimon and trash opponent's Security", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
+                cardEffects.Add(activateClass);
 
-                if (CardEffectCommons.IsExistOnBattleArea(card))
+                string EffectDiscription()
                 {
-                    count = card.PermanentOfThisCard().DigivolutionCards.Count / 4;
+                    return "[When Digivolving] <Blitz> (This Digimon can attack when your opponent has 1 or more memory.) When DNA digivolving, for every 4 cards in this Digimon's digivolution cards, delete 1 of your opponent's Digimon with a play cost of 20 or less and trash the top card of your opponent's security stack.";
                 }
 
-                return count;
-            }
+                int count()
+                {
+                    int count = 0;
 
-            bool CanSelectPermanentCondition(Permanent permanent)
-            {
-                if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    {
+                        count = card.PermanentOfThisCard().DigivolutionCards.Count / 4;
+                    }
+
+                    return count;
+                }
+
+                bool CanSelectPermanentCondition(Permanent permanent)
                 {
-                    if (permanent.TopCard.GetCostItself <= 20)
+                    if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
                     {
-                        if (permanent.TopCard.HasPlayCost)
+                        if (permanent.TopCard.GetCostItself <= 20)
                         {
-                            return true;
+                            if (permanent.TopCard.HasPlayCost)
+                            {
+                                return true;
+                            }
                         }
                     }
-                }
 
-                return false;
-            }
-
-            bool CanUseCondition(Hashtable hashtable)
-            {
-                if (CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card))
-                {
-                    return true;
+                    return false;
                 }
 
-                return false;
-            }
-
-            bool CanActivateCondition(Hashtable hashtable)
-            {
-                if (CardEffectCommons.IsExistOnBattleArea(card))
+                bool CanUseCondition(Hashtable hashtable)
                 {
-                    if (CardEffectCommons.CanActivateBlitz(card, activateClass))
+                    if (CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card))
                     {
                         return true;
                     }
 
-                    if (CardEffectCommons.IsJogress(hashtable))
+                    return false;
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
                     {
-                        if (count() >= 1)
+                        if (CardEffectCommons.CanActivateBlitz(card, activateClass))
                         {
-                            if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
-                            {
-                                return true;
-                            }
+                            return true;
+                        }
 
-                            if (card.Owner.Enemy.SecurityCards.Count >= 1)
+                        if (CardEffectCommons.IsJogress(hashtable))
+                        {
+                            if (count() >= 1)
                             {
-                                return true;
+                                if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
+                                {
+                                    return true;
+                                }
+
+                                if (card.Owner.Enemy.SecurityCards.Count >= 1)
+                                {
+                                    return true;
+                                }
                             }
                         }
                     }
-                }
 
-                return false;
-            }
+                    return false;
+                }
 
-            IEnumerator ActivateCoroutine(Hashtable _hashtable)
-            {
-                if (CardEffectCommons.CanActivateBlitz(card, activateClass))
+                IEnumerator ActivateCoroutine(Hashtable _hashtable)
                 {
-                    yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.BlitzProcess(card, activateClass, BeforeOnAttackCoroutine));
+                    if (CardEffectCommons.CanActivateBlitz(card, activateClass))
+                    {
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.BlitzProcess(card, activateClass, BeforeOnAttackCoroutine));
 
-                    IEnumerator BeforeOnAttackCoroutine()
+                        IEnumerator BeforeOnAttackCoroutine()
+                        {
+                            if (CardEffectCommons.IsJogress(_hashtable))
+                            {
+                                if (count() >= 1)
+                                {
+                                    int maxCount = Math.Min(count(), 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: null,
+                                        afterSelectPermanentCoroutine: null,
+                                        mode: SelectPermanentEffect.Mode.Destroy,
+                                        cardEffect: activateClass);
+
+                                    yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+
+                                    yield return ContinuousController.instance.StartCoroutine(new IDestroySecurity(
+                                                        player: card.Owner.Enemy,
+                                                        destroySecurityCount: count(),
+                                                        cardEffect: activateClass,
+                                                        fromTop: true).DestroySecurity());
+                                }
+                            }
+                        }
+
+                        if(GManager.instance.attackProcess.IsAttacking && GManager.instance.attackProcess.AttackingPermanent == card.PermanentOfThisCard())
+                        {
+                            if (CardEffectCommons.IsJogress(_hashtable))
+                            {
+                                if (count() >= 1)
+                                {
+                                    int maxCount = Math.Min(count(), 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: null,
+                                        afterSelectPermanentCoroutine: null,
+                                        mode: SelectPermanentEffect.Mode.Destroy,
+                                        cardEffect: activateClass);
+
+                                    yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+
+                                    yield return ContinuousController.instance.StartCoroutine(new IDestroySecurity(
+                                                        player: card.Owner.Enemy,
+                                                        destroySecurityCount: count(),
+                                                        cardEffect: activateClass,
+                                                        fromTop: true).DestroySecurity());
+                                }
+                            }
+                        }
+                    }
+
+                    else
                     {
                         if (CardEffectCommons.IsJogress(_hashtable))
                         {
@@ -188,95 +262,64 @@ public class ST13_06 : CEntity_Effect
                                 yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
 
                                 yield return ContinuousController.instance.StartCoroutine(new IDestroySecurity(
-                                                    player: card.Owner.Enemy,
-                                                    destroySecurityCount: count(),
-                                                    cardEffect: activateClass,
-                                                    fromTop: true).DestroySecurity());
+                                                        player: card.Owner.Enemy,
+                                                        destroySecurityCount: count(),
+                                                        cardEffect: activateClass,
+                                                        fromTop: true).DestroySecurity());
                             }
                         }
                     }
                 }
+            }
+            #endregion
+
+            #region All Turns
+            if (timing == EffectTiming.OnLoseSecurity)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Unsuspend this Digimon", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
+                activateClass.SetHashString("Unsuspend_ ST13_06");
+                cardEffects.Add(activateClass);
+
+                string EffectDiscription()
+                {
+                    return "[All Turns][Once Per Turn] When a card is removed from a player's security stack, unsuspend this Digimon.";
+                }
 
-                else
+                bool CanUseCondition(Hashtable hashtable)
                 {
-                    if (CardEffectCommons.IsJogress(_hashtable))
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
                     {
-                        if (count() >= 1)
+                        if (CardEffectCommons.CanTriggerWhenLoseSecurity(hashtable, player => true))
                         {
-                            int maxCount = Math.Min(count(), 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: null,
-                                afterSelectPermanentCoroutine: null,
-                                mode: SelectPermanentEffect.Mode.Destroy,
-                                cardEffect: activateClass);
-
-                            yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
-
-                            yield return ContinuousController.instance.StartCoroutine(new IDestroySecurity(
-                                                    player: card.Owner.Enemy,
-                                                    destroySecurityCount: count(),
-                                                    cardEffect: activateClass,
-                                                    fromTop: true).DestroySecurity());
+                            return true;
                         }
                     }
-                }
-            }
-        }
 
-        if (timing == EffectTiming.OnLoseSecurity)
-        {
-            ActivateClass activateClass = new ActivateClass();
-            activateClass.SetUpICardEffect("Unsuspend this Digimon", CanUseCondition, card);
-            activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
-            activateClass.SetHashString("Unsuspend_ ST13_06");
-            cardEffects.Add(activateClass);
-
-            string EffectDiscription()
-            {
-                return "[All Turns][Once Per Turn] When a card is removed from a player's security stack, unsuspend this Digimon.";
-            }
+                    return false;
+                }
 
-            bool CanUseCondition(Hashtable hashtable)
-            {
-                if (CardEffectCommons.IsExistOnBattleArea(card))
+                bool CanActivateCondition(Hashtable hashtable)
                 {
-                    if (CardEffectCommons.CanTriggerWhenLoseSecurity(hashtable, player => true))
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
                     {
                         return true;
                     }
-                }
 
-                return false;
-            }
+                    return false;
+                }
 
-            bool CanActivateCondition(Hashtable hashtable)
-            {
-                if (CardEffectCommons.IsExistOnBattleArea(card))
+                IEnumerator ActivateCoroutine(Hashtable _hashtable)
                 {
-                    return true;
-                }
+                    Permanent selectedPermanent = card.PermanentOfThisCard();
 
-                return false;
+                    yield return ContinuousController.instance.StartCoroutine(new IUnsuspendPermanents(new List<Permanent>() { selectedPermanent }, activateClass).Unsuspend());
+                }
             }
+            #endregion
 
-            IEnumerator ActivateCoroutine(Hashtable _hashtable)
-            {
-                Permanent selectedPermanent = card.PermanentOfThisCard();
-
-                yield return ContinuousController.instance.StartCoroutine(new IUnsuspendPermanents(new List<Permanent>() { selectedPermanent }, activateClass).Unsuspend());
-            }
+            return cardEffects;
         }
-
-        return cardEffects;
     }
 }

+ 2 - 2
ProjectSettings/ProjectSettings.asset

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:6a51b47f0a1f1e136de920a779d89295907807862d41fb943612e71cfd4e3c46
-size 20166
+oid sha256:e397d136ebfbd176166e7e02859b7b9a33a5146ba474e5a729ccd0602e94e2ae
+size 20168