mbunch_kascope 2 лет назад
Родитель
Сommit
38feb15474

+ 88 - 7
Assets/CardEffect/EX6/Black/RaijiLudomon_EX6_042.cs

@@ -131,7 +131,7 @@ namespace DCGO.CardEffects.EX6
                                 maxCount: enemyCount,
                                 canNoSelect: false,
                                 canEndNotMax: false,
-                                selectPermanentCoroutine: SelectEnemyCoroutine,
+                                selectPermanentCoroutine: SelectPermanentCoroutine,
                                 afterSelectPermanentCoroutine: null,
                                 mode: SelectPermanentEffect.Mode.Custom,
                                 cardEffect: activateClass);
@@ -140,14 +140,95 @@ namespace DCGO.CardEffects.EX6
 
                             yield return ContinuousController.instance.StartCoroutine(selectEnemyEffect.Activate());
 
-                            IEnumerator SelectEnemyCoroutine(Permanent permanent)
+                            IEnumerator SelectPermanentCoroutine(Permanent permanent)
                             {
-                                selectedEnemy = permanent;
-                                yield return null;
+                                Permanent selectedPermanent = permanent;
+
+                                if (selectedPermanent != null)
+                                {
+                                    ActivateClass activateClass1 = new ActivateClass();
+                                    activateClass1.SetUpICardEffect("Attack with this Digimon", CanUseCondition1, selectedPermanent.TopCard);
+                                    activateClass1.SetUpActivateClass(CanActivateCondition1, ActivateCoroutine1, -1, false, EffectDiscription1());
+                                    activateClass1.SetEffectSourcePermanent(selectedPermanent);
+                                    selectedPermanent.UntilOwnerTurnEndEffects.Add(GetCardEffect);
+
+                                    if (!permanent.TopCard.CanNotBeAffected(activateClass))
+                                    {
+                                        yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().CreateDebuffEffect(selectedPermanent));
+                                    }
+
+                                    string EffectDiscription1()
+                                    {
+                                        return "[Start of Your Main Phase] Attack with this Digimon.";
+                                    }
+
+                                    bool CanUseCondition1(Hashtable hashtable1)
+                                    {
+                                        if (CardEffectCommons.IsPermanentExistsOnBattleArea(selectedPermanent))
+                                        {
+                                            if (selectedPermanent.TopCard.Owner.GetBattleAreaDigimons().Contains(selectedPermanent))
+                                            {
+                                                if (GManager.instance.turnStateMachine.gameContext.TurnPlayer == selectedPermanent.TopCard.Owner)
+                                                {
+                                                    return true;
+                                                }
+                                            }
+                                        }
+
+                                        return false;
+                                    }
+
+                                    bool CanActivateCondition1(Hashtable hashtable1)
+                                    {
+                                        if (CardEffectCommons.IsPermanentExistsOnBattleArea(selectedPermanent))
+                                        {
+                                            if (!permanent.TopCard.CanNotBeAffected(activateClass))
+                                            {
+                                                if (permanent.CanAttack(activateClass1))
+                                                {
+                                                    return true;
+                                                }
+                                            }
+                                        }
+
+                                        return false;
+                                    }
+
+                                    IEnumerator ActivateCoroutine1(Hashtable _hashtable1)
+                                    {
+                                        if (CardEffectCommons.IsPermanentExistsOnBattleArea(selectedPermanent))
+                                        {
+                                            if (permanent.CanAttack(activateClass1))
+                                            {
+                                                SelectAttackEffect selectAttackEffect = GManager.instance.GetComponent<SelectAttackEffect>();
+
+                                                selectAttackEffect.SetUp(
+                                                    attacker: selectedPermanent,
+                                                    canAttackPlayerCondition: () => true,
+                                                    defenderCondition: (permanent) => true,
+                                                    cardEffect: activateClass1);
+
+                                                selectAttackEffect.SetCanNotSelectNotAttack();
+
+                                                yield return ContinuousController.instance.StartCoroutine(selectAttackEffect.Activate());
+                                            }
+                                        }
+                                    }
+
+                                    ICardEffect GetCardEffect(EffectTiming _timing)
+                                    {
+                                        if (_timing == EffectTiming.OnStartMainPhase)
+                                        {
+                                            return activateClass1;
+                                        }
+
+                                        return null;
+                                    }
+                                }
                             }
                         }
 
-                        if (selectedEnemy != null)
+                        /*if (selectedEnemy != null)
                         {
                             ActivateClass activateClass1 = new ActivateClass();
                             activateClass1.SetUpICardEffect("Attack with this Digimon", CanUseCondition1, selectedEnemy.TopCard);
@@ -183,7 +264,7 @@ namespace DCGO.CardEffects.EX6
 
                             bool CanActivateCondition1(Hashtable hashtable1)
                             {
-                                if (CardEffectCommons.IsPermanentExistsOnBattleArea(selectedPermanent))
+                                if (CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(selectedPermanent))
                                 {
                                     if (!selectedEnemy.TopCard.CanNotBeAffected(activateClass))
                                     {
@@ -227,7 +308,7 @@ namespace DCGO.CardEffects.EX6
 
                                 return null;
                             }
-                        }
+                        }*/
 
                         yield return ContinuousController.instance.StartCoroutine(selectedPermanent.AddDigivolutionCardsBottom(
                                 new List<CardSource>() { card },

+ 86 - 135
Assets/CardEffect/EX6/Blue/Xiangpengmon_EX6_015.cs

@@ -86,86 +86,58 @@ namespace DCGO.CardEffects.EX6
                     return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
                 }
 
-
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
-                    int cardsAdded = 0;
-
-                    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),
-                        };
+                    List<CardSource> selectedCards = new List<CardSource>();
 
-                    string selectPlayerMessage = "Will you add digivolution cards?";
-                    string notSelectPlayerMessage = "The opponent is choosing effects.";
+                    if (CardEffectCommons.HasMatchConditionPermanent(CanSelectSharedOwnPermanentCondition))
+                    {
+                        // If there is other blue Digimon in owner Battle Area  
+                        int maxCount = Math.Min(3,
+                            CardEffectCommons.MatchConditionPermanentCount(CanSelectSharedOwnPermanentCondition));
 
-                    GManager.instance.userSelectionManager.SetBoolSelection(selectionElements: selectionElements, selectPlayer: card.Owner, selectPlayerMessage: selectPlayerMessage, notSelectPlayerMessage: notSelectPlayerMessage);
+                        SelectPermanentEffect selectPermanentEffect =
+                            GManager.instance.GetComponent<SelectPermanentEffect>();
 
+                        selectPermanentEffect.SetUp(
+                            selectPlayer: card.Owner,
+                            canTargetCondition: CanSelectSharedOwnPermanentCondition,
+                            canTargetCondition_ByPreSelecetedList: null,
+                            canEndSelectCondition: CanEndSelectCondition,
+                            maxCount: maxCount,
+                            canNoSelect: true,
+                            canEndNotMax: true,
+                            selectPermanentCoroutine: SelectPermanentCoroutine,
+                            afterSelectPermanentCoroutine: null,
+                            mode: SelectPermanentEffect.Mode.Custom,
+                            cardEffect: activateClass);
 
-                    yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
+                        selectPermanentEffect.SetUpCustomMessage(
+                            "Select up to 3 Digimon to place on bottom of digivolution cards.",
+                            "The opponent is selecting up to 3 Digimon to place on bottom of digivolution cards.");
 
-                    bool addDigivolutionCards = GManager.instance.userSelectionManager.SelectedBoolValue;
+                        yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
 
-                    if (addDigivolutionCards)
-                    {
-                        if (CardEffectCommons.HasMatchConditionPermanent(CanSelectSharedOwnPermanentCondition))
+                        bool CanEndSelectCondition(List<Permanent> permanents)
                         {
-                            List<CardSource> selectedCards = new List<CardSource>();
-
-                            // If there is other blue Digimon in owner Battle Area  
-                            int maxCount = Math.Min(3,
-                                CardEffectCommons.MatchConditionPermanentCount(CanSelectSharedOwnPermanentCondition));
-
-                            SelectPermanentEffect selectPermanentEffect =
-                                GManager.instance.GetComponent<SelectPermanentEffect>();
-
-                            selectPermanentEffect.SetUp(
-                                selectPlayer: card.Owner,
-                                canTargetCondition: CanSelectSharedOwnPermanentCondition,
-                                canTargetCondition_ByPreSelecetedList: null,
-                                canEndSelectCondition: CanEndSelectCondition,
-                                maxCount: maxCount,
-                                canNoSelect: true,
-                                canEndNotMax: true,
-                                selectPermanentCoroutine: SelectPermanentCoroutine,
-                                afterSelectPermanentCoroutine: null,
-                                mode: SelectPermanentEffect.Mode.Custom,
-                                cardEffect: activateClass);
-
-                            selectPermanentEffect.SetUpCustomMessage(
-                                "Select up to 3 Digimon to place on bottom of digivolution cards.",
-                                "The opponent is selecting up to 3 Digimon to place on bottom of digivolution cards.");
-
-                            yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
-
-                            bool CanEndSelectCondition(List<Permanent> permanents)
+                            if (CardEffectCommons.HasNoElement(permanents))
                             {
-                                if (CardEffectCommons.HasNoElement(permanents))
-                                {
-                                    return false;
-                                }
-
-                                return true;
+                                return false;
                             }
 
-                            IEnumerator SelectPermanentCoroutine(Permanent selectedPermanent)
-                            {
-                                selectedCards.Add(selectedPermanent.TopCard);
-
-                                yield return null;
-                            }
+                            return true;
+                        }
 
-                            if (selectedCards.Count >= 1)
-                            {
-                                yield return ContinuousController.instance.StartCoroutine(card.PermanentOfThisCard()
-                                    .AddDigivolutionCardsBottom(
-                                        selectedCards,
-                                        activateClass));
+                        IEnumerator SelectPermanentCoroutine(Permanent selectedPermanent)
+                        {
+                            selectedCards.Add(selectedPermanent.TopCard);
 
-                                cardsAdded = selectedCards.Count;
+                            yield return ContinuousController.instance.StartCoroutine(new IPlacePermanentToDigivolutionCards(
+                                new List<Permanent[]>() { new Permanent[] { selectedPermanent, card.PermanentOfThisCard() } },
+                                false,
+                                activateClass).PlacePermanentToDigivolutionCards());
 
-                            }
+                            yield return null;
                         }
                     }
 
@@ -173,9 +145,12 @@ namespace DCGO.CardEffects.EX6
                     {
                         if (CardEffectCommons.IsPermanentExistsOnBattleArea(permanent))
                         {
-                            if (!permanent.TopCard.CanNotBeAffected(activateClass))
+                            if(permanent != card.PermanentOfThisCard())
                             {
-                                return permanent.TopCard.HasLevel && permanent.Level <= 4 + cardsAdded;
+                                if (!permanent.TopCard.CanNotBeAffected(activateClass))
+                                {
+                                    return permanent.TopCard.HasLevel && permanent.Level <= 4 + selectedCards.Count;
+                                }
                             }
                         }
 
@@ -209,7 +184,7 @@ namespace DCGO.CardEffects.EX6
 
                 string EffectDescription()
                 {
-                    return "[On Play] You may place up to 3 of your other blue Digimon as this Digimon's bottom digivolution cards. Then, return all other level 4 or lower Digimon to the hand. For each card placed in this Digimon's digivolution cards, add 1 to the level this effect may return.";
+                    return "[When Digivolving] You may place up to 3 of your other blue Digimon as this Digimon's bottom digivolution cards. Then, return all other level 4 or lower Digimon to the hand. For each card placed in this Digimon's digivolution cards, add 1 to the level this effect may return.";
                 }
 
                 bool CanUseCondition(Hashtable hashtable)
@@ -224,83 +199,56 @@ namespace DCGO.CardEffects.EX6
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
-                    int cardsAdded = 0;
-
-                    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),
-                        };
+                    List<CardSource> selectedCards = new List<CardSource>();
 
-                    string selectPlayerMessage = "Will you add digivolution cards?";
-                    string notSelectPlayerMessage = "The opponent is choosing effects.";
+                    if (CardEffectCommons.HasMatchConditionPermanent(CanSelectSharedOwnPermanentCondition))
+                    {
+                        // If there is other blue Digimon in owner Battle Area  
+                        int maxCount = Math.Min(3,
+                            CardEffectCommons.MatchConditionPermanentCount(CanSelectSharedOwnPermanentCondition));
 
-                    GManager.instance.userSelectionManager.SetBoolSelection(selectionElements: selectionElements, selectPlayer: card.Owner, selectPlayerMessage: selectPlayerMessage, notSelectPlayerMessage: notSelectPlayerMessage);
+                        SelectPermanentEffect selectPermanentEffect =
+                            GManager.instance.GetComponent<SelectPermanentEffect>();
 
+                        selectPermanentEffect.SetUp(
+                            selectPlayer: card.Owner,
+                            canTargetCondition: CanSelectSharedOwnPermanentCondition,
+                            canTargetCondition_ByPreSelecetedList: null,
+                            canEndSelectCondition: CanEndSelectCondition,
+                            maxCount: maxCount,
+                            canNoSelect: true,
+                            canEndNotMax: true,
+                            selectPermanentCoroutine: SelectPermanentCoroutine,
+                            afterSelectPermanentCoroutine: null,
+                            mode: SelectPermanentEffect.Mode.Custom,
+                            cardEffect: activateClass);
 
-                    yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
+                        selectPermanentEffect.SetUpCustomMessage(
+                            "Select up to 3 Digimon to place on bottom of digivolution cards.",
+                            "The opponent is selecting up to 3 Digimon to place on bottom of digivolution cards.");
 
-                    bool addDigivolutionCards = GManager.instance.userSelectionManager.SelectedBoolValue;
+                        yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
 
-                    if (addDigivolutionCards)
-                    {
-                        if (CardEffectCommons.HasMatchConditionPermanent(CanSelectSharedOwnPermanentCondition))
+                        bool CanEndSelectCondition(List<Permanent> permanents)
                         {
-                            List<CardSource> selectedCards = new List<CardSource>();
-
-                            // If there is other blue Digimon in owner Battle Area  
-                            int maxCount = Math.Min(3,
-                                CardEffectCommons.MatchConditionPermanentCount(CanSelectSharedOwnPermanentCondition));
-
-                            SelectPermanentEffect selectPermanentEffect =
-                                GManager.instance.GetComponent<SelectPermanentEffect>();
-
-                            selectPermanentEffect.SetUp(
-                                selectPlayer: card.Owner,
-                                canTargetCondition: CanSelectSharedOwnPermanentCondition,
-                                canTargetCondition_ByPreSelecetedList: null,
-                                canEndSelectCondition: CanEndSelectCondition,
-                                maxCount: maxCount,
-                                canNoSelect: true,
-                                canEndNotMax: true,
-                                selectPermanentCoroutine: SelectPermanentCoroutine,
-                                afterSelectPermanentCoroutine: null,
-                                mode: SelectPermanentEffect.Mode.Custom,
-                                cardEffect: activateClass);
-
-                            selectPermanentEffect.SetUpCustomMessage(
-                                "Select up to 3 Digimon to place on bottom of digivolution cards.",
-                                "The opponent is selecting up to 3 Digimon to place on bottom of digivolution cards.");
-
-                            yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
-
-                            bool CanEndSelectCondition(List<Permanent> permanents)
+                            if (CardEffectCommons.HasNoElement(permanents))
                             {
-                                if (CardEffectCommons.HasNoElement(permanents))
-                                {
-                                    return false;
-                                }
-
-                                return true;
+                                return false;
                             }
 
-                            IEnumerator SelectPermanentCoroutine(Permanent selectedPermanent)
-                            {
-                                selectedCards.Add(selectedPermanent.TopCard);
-
-                                yield return null;
-                            }
+                            return true;
+                        }
 
-                            if (selectedCards.Count >= 1)
-                            {
-                                yield return ContinuousController.instance.StartCoroutine(card.PermanentOfThisCard()
-                                    .AddDigivolutionCardsBottom(
-                                        selectedCards,
-                                        activateClass));
+                        IEnumerator SelectPermanentCoroutine(Permanent selectedPermanent)
+                        {
+                            selectedCards.Add(selectedPermanent.TopCard);
 
-                                cardsAdded = selectedCards.Count;
+                            yield return ContinuousController.instance.StartCoroutine(new IPlacePermanentToDigivolutionCards(
+                                new List<Permanent[]>() { new Permanent[] { selectedPermanent, card.PermanentOfThisCard() } },
+                                false,
+                                activateClass).PlacePermanentToDigivolutionCards());
 
-                            }
+                            yield return null;
                         }
                     }
 
@@ -308,9 +256,12 @@ namespace DCGO.CardEffects.EX6
                     {
                         if (CardEffectCommons.IsPermanentExistsOnBattleArea(permanent))
                         {
-                            if (!permanent.TopCard.CanNotBeAffected(activateClass))
+                            if (permanent != card.PermanentOfThisCard())
                             {
-                                return permanent.TopCard.HasLevel && permanent.Level <= 4 + cardsAdded;
+                                if (!permanent.TopCard.CanNotBeAffected(activateClass))
+                                {
+                                    return permanent.TopCard.HasLevel && permanent.Level <= 4 + selectedCards.Count;
+                                }
                             }
                         }
 
@@ -368,7 +319,7 @@ namespace DCGO.CardEffects.EX6
                 
                 bool CanUseCondition(Hashtable hashtable)
                 {
-                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
                     {
                         if (CardEffectCommons.IsOwnerTurn(card))
                         {

+ 72 - 130
Assets/CardEffect/EX6/Green/Cherubimon_EX6_035.cs

@@ -32,7 +32,7 @@ namespace DCGO.CardEffects.EX6
 
                 bool PermanentConditionTwo(Permanent targetPermanent)
                 {
-                    if ((targetPermanent.TopCard.ContainsCardName("Cherubimon")) && (targetPermanent.TopCard.CardColors.Contains(CardColor.Purple)))
+                    if ((targetPermanent.TopCard.EqualsCardName("Cherubimon")) && (targetPermanent.TopCard.CardColors.Contains(CardColor.Purple)))
                     {
                         return true;
                     }
@@ -82,15 +82,7 @@ namespace DCGO.CardEffects.EX6
 
                 bool CanActivateCondition(Hashtable hashtable)
                 {
-                    if (CardEffectCommons.IsExistOnBattleArea(card))
-                    {
-                        if (card.Owner.HandCards.Count(CanSelectCardCondition) >= 1)
-                        {
-                            return true;
-                        }
-                    }
-
-                    return false;
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
                 }
 
                 bool CanSelectPermanentCondition(Permanent permanent)
@@ -102,14 +94,15 @@ namespace DCGO.CardEffects.EX6
                 {
                     if (CardEffectCommons.IsExistOnHand(cardSource))
                     {
-                        if (cardSource.IsDigimon && cardSource.Level <= 4 && cardSource.CardColors.Contains(CardColor.Green))
+                        if (cardSource.IsDigimon)
                         {
-                            return true;
-                        }
-
-                        if (cardSource.IsDigimon && cardSource.Level <= 4 && cardSource.CardColors.Contains(CardColor.Yellow))
-                        {
-                            return true;
+                            if (cardSource.HasLevel && cardSource.Level <= 4)
+                            {
+                                if (cardSource.CardColors.Contains(CardColor.Green) || cardSource.CardColors.Contains(CardColor.Yellow))
+                                {
+                                    return true;
+                                }
+                            }
                         }
                     }
 
@@ -118,63 +111,43 @@ namespace DCGO.CardEffects.EX6
 
                 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),
-                        };
-
-                    string selectPlayerMessage = "Will you play a level 4 or lower Digimon?";
-                    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 playDigimon = GManager.instance.userSelectionManager.SelectedBoolValue;
-
-                    if (playDigimon)
+                    if (card.Owner.HandCards.Count(CanSelectCardCondition) >= 1)
                     {
-                        if (card.Owner.HandCards.Count(CanSelectCardCondition) >= 1)
-                        {
-                            int maxCount = Math.Min(1, card.Owner.HandCards.Count(CanSelectCardCondition));
+                        int maxCount = Math.Min(1, card.Owner.HandCards.Count(CanSelectCardCondition));
 
-                            List<CardSource> selectedCards = new List<CardSource>();
+                        List<CardSource> selectedCards = new List<CardSource>();
 
-                            SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
+                        SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
 
-                            selectHandEffect.SetUp(
-                                selectPlayer: card.Owner,
-                                canTargetCondition: CanSelectCardCondition,
-                                canTargetCondition_ByPreSelecetedList: null,
-                                canEndSelectCondition: null,
-                                maxCount: 1,
-                                canNoSelect: true,
-                                canEndNotMax: false,
-                                isShowOpponent: true,
-                                selectCardCoroutine: SelectCardCoroutine,
-                                afterSelectCardCoroutine: null,
-                                mode: SelectHandEffect.Mode.Custom,
-                                cardEffect: activateClass);
+                        selectHandEffect.SetUp(
+                            selectPlayer: card.Owner,
+                            canTargetCondition: CanSelectCardCondition,
+                            canTargetCondition_ByPreSelecetedList: null,
+                            canEndSelectCondition: null,
+                            maxCount: 1,
+                            canNoSelect: true,
+                            canEndNotMax: false,
+                            isShowOpponent: true,
+                            selectCardCoroutine: SelectCardCoroutine,
+                            afterSelectCardCoroutine: null,
+                            mode: SelectHandEffect.Mode.Custom,
+                            cardEffect: activateClass);
 
-                            selectHandEffect.SetUpCustomMessage("Select 1 card to play.", "The opponent is selecting 1 card to play.");
-                            selectHandEffect.SetUpCustomMessage_ShowCard("Played Card");
+                        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());
+                        yield return StartCoroutine(selectHandEffect.Activate());
 
-                            IEnumerator SelectCardCoroutine(CardSource cardSource)
-                            {
-                                selectedCards.Add(cardSource);
+                        IEnumerator SelectCardCoroutine(CardSource cardSource)
+                        {
+                            selectedCards.Add(cardSource);
 
-                                yield return null;
-                            }
+                            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));
 
 
-                        }
                     }
 
                     if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
@@ -224,7 +197,7 @@ namespace DCGO.CardEffects.EX6
                 {
                     int minusDP = 0;
 
-                    minusDP += 4000 * card.Owner.GetBattleAreaDigimons().Count((permanent) => permanent.IsDigimon);
+                    minusDP += 4000 * card.Owner.GetBattleAreaDigimons().Count((permanent) => permanent.IsDigimon && permanent != card.PermanentOfThisCard());
 
                     return minusDP;
                 }
@@ -247,15 +220,7 @@ namespace DCGO.CardEffects.EX6
 
                 bool CanActivateCondition(Hashtable hashtable)
                 {
-                    if (CardEffectCommons.IsExistOnBattleArea(card))
-                    {
-                        if (card.Owner.HandCards.Count(CanSelectCardCondition) >= 1)
-                        {
-                            return true;
-                        }
-                    }
-
-                    return false;
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
                 }
 
                 bool CanSelectPermanentCondition(Permanent permanent)
@@ -265,18 +230,17 @@ namespace DCGO.CardEffects.EX6
 
                 bool CanSelectCardCondition(CardSource cardSource)
                 {
-
-
                     if (CardEffectCommons.IsExistOnHand(cardSource))
                     {
-                        if (cardSource.IsDigimon && cardSource.Level <= 4 && cardSource.CardColors.Contains(CardColor.Green))
+                        if (cardSource.IsDigimon)
                         {
-                            return true;
-                        }
-
-                        if (cardSource.IsDigimon && cardSource.Level <= 4 && cardSource.CardColors.Contains(CardColor.Yellow))
-                        {
-                            return true;
+                            if(cardSource.HasLevel && cardSource.Level <= 4)
+                            {
+                                if (cardSource.CardColors.Contains(CardColor.Green) || cardSource.CardColors.Contains(CardColor.Yellow))
+                                {
+                                    return true;
+                                }
+                            }
                         }
                     }
 
@@ -285,63 +249,41 @@ namespace DCGO.CardEffects.EX6
 
                 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),
-                        };
-
-                    string selectPlayerMessage = "Will you play a level 4 or lower Digimon?";
-                    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 playDigimon = GManager.instance.userSelectionManager.SelectedBoolValue;
-
-                    if (playDigimon)
+                    if (card.Owner.HandCards.Count(CanSelectCardCondition) >= 1)
                     {
-                        if (card.Owner.HandCards.Count(CanSelectCardCondition) >= 1)
-                        {
-                            int maxCount = Math.Min(1, card.Owner.HandCards.Count(CanSelectCardCondition));
+                        int maxCount = Math.Min(1, card.Owner.HandCards.Count(CanSelectCardCondition));
 
-                            List<CardSource> selectedCards = new List<CardSource>();
+                        List<CardSource> selectedCards = new List<CardSource>();
 
-                            SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
+                        SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
 
-                            selectHandEffect.SetUp(
-                                selectPlayer: card.Owner,
-                                canTargetCondition: CanSelectCardCondition,
-                                canTargetCondition_ByPreSelecetedList: null,
-                                canEndSelectCondition: null,
-                                maxCount: 1,
-                                canNoSelect: true,
-                                canEndNotMax: false,
-                                isShowOpponent: true,
-                                selectCardCoroutine: SelectCardCoroutine,
-                                afterSelectCardCoroutine: null,
-                                mode: SelectHandEffect.Mode.Custom,
-                                cardEffect: activateClass);
+                        selectHandEffect.SetUp(
+                            selectPlayer: card.Owner,
+                            canTargetCondition: CanSelectCardCondition,
+                            canTargetCondition_ByPreSelecetedList: null,
+                            canEndSelectCondition: null,
+                            maxCount: 1,
+                            canNoSelect: true,
+                            canEndNotMax: false,
+                            isShowOpponent: true,
+                            selectCardCoroutine: SelectCardCoroutine,
+                            afterSelectCardCoroutine: null,
+                            mode: SelectHandEffect.Mode.Custom,
+                            cardEffect: activateClass);
 
-                            selectHandEffect.SetUpCustomMessage("Select 1 card to play.", "The opponent is selecting 1 card to play.");
-                            selectHandEffect.SetUpCustomMessage_ShowCard("Played Card");
+                        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());
-
-                            IEnumerator SelectCardCoroutine(CardSource cardSource)
-                            {
-                                selectedCards.Add(cardSource);
-
-                                yield return null;
-                            }
-
-                            yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(cardSources: selectedCards, activateClass: activateClass, payCost: false, isTapped: false, root: SelectCardEffect.Root.Hand, activateETB: true));
+                        yield return StartCoroutine(selectHandEffect.Activate());
 
+                        IEnumerator SelectCardCoroutine(CardSource cardSource)
+                        {
+                            selectedCards.Add(cardSource);
 
+                            yield return null;
                         }
+
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(cardSources: selectedCards, activateClass: activateClass, payCost: false, isTapped: false, root: SelectCardEffect.Root.Hand, activateETB: true));
                     }
 
                     if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))

+ 3 - 6
Assets/CardEffect/EX6/Purple/Belphemon_Rage_Mode_EX6_060.cs

@@ -172,12 +172,9 @@ namespace DCGO.CardEffects.EX6
                 {
                     if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
                     {
-                        if (permanent.IsSuspended)
+                        if (CardEffectCommons.IsMinCost(permanent, card.Owner.Enemy, true, (permanent) => permanent.IsSuspended))
                         {
-                            if (CardEffectCommons.IsMinCost(permanent, card.Owner.Enemy, true))
-                            {
-                                return true;
-                            }
+                            return true;
                         }
                     }
 
@@ -231,7 +228,7 @@ namespace DCGO.CardEffects.EX6
                     {
                         SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
 
-                        int suspendCount = Math.Min(3, CardEffectCommons.MatchConditionOpponentsPermanentCount(card, OpponentsSuspendableTargets));
+                        int suspendCount = Math.Min(discarded.Count, CardEffectCommons.MatchConditionOpponentsPermanentCount(card, OpponentsSuspendableTargets));
 
                         selectPermanentEffect.SetUp(
                             selectPlayer: card.Owner,

+ 19 - 16
Assets/CardEffect/EX6/Purple/Lilithmon_EX6_057.cs

@@ -5,6 +5,7 @@ using System.Linq;
 using Photon;
 using System;
 using Photon.Pun;
+using static UnityEngine.Rendering.DebugUI;
 
 namespace DCGO.CardEffects.EX6
 {
@@ -309,7 +310,8 @@ namespace DCGO.CardEffects.EX6
             {
                 ActivateClass activateClass = new ActivateClass();
                 activateClass.SetUpICardEffect("Delete 1 level 5 or lower Digimon to prevent leaving the battle area", CanUseCondition, card);
-                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, true, EffectDiscription());
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
+                activateClass.SetHashString("Protection_EX6_057");
                 cardEffects.Add(activateClass);
 
                 string EffectDiscription()
@@ -317,6 +319,18 @@ namespace DCGO.CardEffects.EX6
                     return "[All Turns] [Once Per Turn] When this Digimon would leave the battle area other than in battle, by deleting 1 level 5 or lower Digimon, prevent it from leaving.";
                 }
 
+                bool CanSelectPermanentCondition(Permanent permanent)
+                {
+                    if (CardEffectCommons.IsPermanentExistsOnBattleArea(permanent))
+                    {
+                        if (permanent.Level <= 5)
+                        {
+                            return true;
+                        }
+                    }
+                    return false;
+                }
+
                 bool CanUseCondition(Hashtable hashtable)
                 {
                     if (CardEffectCommons.IsExistOnBattleArea(card))
@@ -333,27 +347,16 @@ namespace DCGO.CardEffects.EX6
                     return false;
                 }
 
-                bool CanSelectPermanentCondition(Permanent permanent)
-                {
-                    if(CardEffectCommons.IsPermanentExistsOnBattleArea(permanent))
-                    {
-                        if(permanent.Level <= 5)
-                        {
-                            return true;
-                        }
-                    }    
-                    return false;
-                }
-
                 bool CanActivateCondition(Hashtable hashtable)
                 {
-                    if(CardEffectCommons.IsExistOnBattleArea(card))
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
                     {
-                        if(CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
+                        if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
                         {
                             return true;
                         }
                     }
+
                     return false;
                 }
 
@@ -370,7 +373,7 @@ namespace DCGO.CardEffects.EX6
                             canTargetCondition_ByPreSelecetedList: null,
                             canEndSelectCondition: null,
                             maxCount: maxCount,
-                            canNoSelect: false,
+                            canNoSelect: true,
                             canEndNotMax: false,
                             selectPermanentCoroutine: SelectPermanentCoroutine,
                             afterSelectPermanentCoroutine: null,

+ 4 - 1
Assets/CardEffect/EX6/Purple/Rise_of_the_Seven_Great_Demon_Lords_EX6_069.cs

@@ -42,7 +42,10 @@ namespace DCGO.CardEffects.EX6
 
                 bool HasSevenGreatDemonLordTrait(CardSource cardSource)
                 {
-                    return cardSource.ContainsTraits("Seven Great Demon Lords");
+                    if (cardSource.IsDigimon)
+                        return cardSource.ContainsTraits("Seven Great Demon Lords");
+
+                    return false;
                 }
 
                 bool CanUseCondition(Hashtable hashtable)

+ 2 - 2
Assets/CardEffect/EX6/Yellow/Shu_Chong_Wong_EX6_064.cs

@@ -27,7 +27,7 @@ namespace DCGO.CardEffects.EX6
                 {
                     if (cardSource.IsDigimon)
                     {
-                        if (cardSource.ContainsTraits("Beast") || cardSource.ContainsTraits("Beastkin") || cardSource.ContainsTraits("Holy Beast") || cardSource.ContainsTraits("Cherub"))
+                        if (cardSource.CardTraits.Contains("Beast") || cardSource.ContainsTraits("Beastkin") || cardSource.ContainsTraits("Holy Beast") || cardSource.ContainsTraits("Cherub"))
                         {
                             return true;
                         }
@@ -120,7 +120,7 @@ namespace DCGO.CardEffects.EX6
 
                 bool CanSelectCardCondition(CardSource cardSource)
                 {
-                    return cardSource.IsDigimon && cardSource.HasLevel && cardSource.CardTraits.Contains("Beastkin") || cardSource.CardTraits.Contains("Holy Beast") || cardSource.CardTraits.Contains("Cherub");
+                    return cardSource.IsDigimon && cardSource.HasLevel && cardSource.ContainsTraits("Beastkin") || cardSource.ContainsTraits("Holy Beast") || cardSource.ContainsTraits("Cherub");
                 }
 
                 bool CanUseCondition(Hashtable hashtable)

+ 0 - 2
Assets/Scenes/ContinuousControllerScene.unity

@@ -3055,7 +3055,6 @@ MonoBehaviour:
   - {fileID: 11400000, guid: 34bf8a417ec5a0a468c8d16061c022ac, type: 2}
   - {fileID: 11400000, guid: cfd4b886d575a2345a45b59655b7e3cb, type: 2}
   - {fileID: 11400000, guid: f4a75c740d768fb4fb66d655ae28ac6d, type: 2}
-  - {fileID: 11400000, guid: c5709d81223c47042833c824d925f952, type: 2}
   - {fileID: 11400000, guid: 3aae03245f43b5c4283d9a12b7708930, type: 2}
   - {fileID: 11400000, guid: 9d2eaa38f703ded48b1d5e77b4ec2316, type: 2}
   - {fileID: 11400000, guid: 76c23d38f84f39e4f85c42e2177fe87e, type: 2}
@@ -7716,7 +7715,6 @@ MonoBehaviour:
   - {fileID: 11400000, guid: 32a3b95f42ea9fb41bcd9e9dcfdd9f08, type: 2}
   - {fileID: 11400000, guid: d617eed018835d04d99cc516a15c6b33, type: 2}
   - {fileID: 11400000, guid: 6a99df42570cb9b4082add9c0e97c176, type: 2}
-  - {fileID: 11400000, guid: c5709d81223c47042833c824d925f952, type: 2}
   - {fileID: 11400000, guid: c1e6da802ea8b804e97ce74b526a7a22, type: 2}
   - {fileID: 11400000, guid: 34bf8a417ec5a0a468c8d16061c022ac, type: 2}
   - {fileID: 11400000, guid: 03f5e14579a633043a99437490dfef8d, type: 2}

+ 2 - 1
Assets/Scripts/CardEffectCommons/MinMax_DP_Cost_Level/Cost/IsMinCost.cs

@@ -7,13 +7,14 @@ using System.Security;
 
 public partial class CardEffectCommons
 {
-    public static bool IsMinCost(Permanent permanent, Player owner, bool IsDigimonOnly)
+    public static bool IsMinCost(Permanent permanent, Player owner, bool IsDigimonOnly, Func<Permanent, bool> condition = null)
     {
         if (permanent == null) return false;
         if (permanent.TopCard == null) return false;
         if (permanent.TopCard.Owner != owner) return false;
         if (!IsPermanentExistsOnOwnerBattleArea(permanent, permanent.TopCard)) return false;
         if (!permanent.IsDigimon && !permanent.IsTamer) return false;
+        if (condition != null && !condition(permanent)) return false;
         if (!permanent.TopCard.HasPlayCost) return false;
 
         List<Permanent> permanents = permanent.TopCard.Owner.GetBattleAreaPermanents();

+ 1 - 2
Assets/Scripts/CardEffectCommons/MinMax_DP_Cost_Level/DP/IsMinDP.cs

@@ -13,8 +13,7 @@ public partial class CardEffectCommons
         if (permanent.TopCard == null) return false;
         if (permanent.TopCard.Owner != owner) return false;
         if (!IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, permanent.TopCard)) return false;
-        if(condition == null) return false;
-        if(!condition(permanent)) return false;
+        if(condition != null && !condition(permanent)) return false;
         if (!permanent.TopCard.HasDP && (permanent.BaseDP <= 0)) return false;
 
         List<int> DPs = permanent.TopCard.Owner.GetBattleAreaDigimons()

+ 10 - 0
Assets/Scripts/ContinuousController.cs

@@ -358,6 +358,16 @@ public class ContinuousController : MonoBehaviour
         File.WriteAllText($"{savePath}/{data.DeckName}_{data.DeckID}.txt", DeckCodeUtility.GetDeckBuilderFile(data));
     }
 
+    public void RenameDeck(DeckData data, string newName)
+    {
+        string savePath = StreamingAssetsUtility.GetStreamingAssetPath("Decks", false);
+        Debug.Log("RENAME DECK: " + File.Exists($"{savePath}/{data.DeckName}_{data.DeckID}.txt"));
+        if (File.Exists($"{savePath}/{data.DeckName}_{data.DeckID}.txt"))
+        {
+            File.Move($"{savePath}/{data.DeckName}_{data.DeckID}.txt", $"{savePath}/{newName}_{data.DeckID}.txt");
+        }
+    }
+
     public void DeleteDeck(DeckData data)
     {
         string filePath = StreamingAssetsUtility.GetStreamingAssetPath("Decks", false);

+ 1 - 1
Assets/Scripts/DeckCodeUtility.cs

@@ -61,7 +61,7 @@ public class DeckCodeUtility
 
             if (count >= 1)
             {
-                lineString += $"{count} {cEntity_Base.CardName_ENG}   {cEntity_Base.CardID} \n";
+                lineString += $"{count} {cEntity_Base.CardName_ENG}   {cEntity_Base.CardSpriteName} \n";
             }
 
             DeckBuilderDeckCode += lineString;

+ 2 - 3
Assets/Scripts/DeckInfoPanel.cs

@@ -248,10 +248,9 @@ public class DeckInfoPanel : MonoBehaviour
             text = text.Substring(0, text.Length - 1);
         }
 
-        ShowingDeckData.DeckName = text;
+        ContinuousController.instance.RenameDeck(ShowingDeckData, text);
 
-        ContinuousController.instance.SaveDeckDatas();
-        ContinuousController.instance.SaveDeckData(ShowingDeckData);
+        ShowingDeckData.DeckName = text;
 
         if (isFromSelectDeck)
         {

+ 3 - 1
Assets/Scripts/EditDeck.cs

@@ -346,7 +346,7 @@ public class EditDeck : MonoBehaviour
 
         CreateDeckObject.SetActive(false);
 
-        #region ひとつ前の画面をセットアップ
+        #region Set up previous screen
         if (_isFromSelectDeck)
         {
             Opening.instance.deck.selectDeck.ResetDeckInfoPanel();
@@ -552,6 +552,8 @@ public class EditDeck : MonoBehaviour
 
         deckName = DeckData.ValidateDeckName(deckName);
 
+        ContinuousController.instance.RenameDeck(EdittingDeckData, text);
+
         EdittingDeckData.DeckName = deckName;
 
         DeckNameInputField.onEndEdit.RemoveAllListeners();

+ 16 - 3
Assets/Scripts/Permanent.cs

@@ -3,7 +3,6 @@ using System.Collections.Generic;
 using UnityEngine;
 using System;
 using System.Linq;
-using static Cinemachine.DocumentationSortingAttribute;
 
 public class Permanent
 {
@@ -604,7 +603,14 @@ public class Permanent
     }
     #endregion
 
-    #region 進化元の一番上に置く
+    #region Add digivolution cards to top of sources
+    /// <summary>
+    /// IEnumerator to add a list of CardSource to a permanents top sources, CAN NOT be used to put a field permanent under must use IPlacePermanentToDigivolutionCards
+    /// </summary>
+    /// <param name="addedDigivolutionCards"></param>
+    /// <param name="cardEffect"></param>
+    /// <param name="skipEffectAndActivateSkill"></param>
+    /// <returns></returns>
     public IEnumerator AddDigivolutionCardsTop(List<CardSource> addedDigivolutionCards, ICardEffect cardEffect)
     {
         List<CardSource> addedCards = new List<CardSource>();
@@ -663,7 +669,14 @@ public class Permanent
     }
     #endregion
 
-    #region 進化元の一番下に置く
+    #region Add digivolution cards to bottom of sources
+    /// <summary>
+    /// IEnumerator to add a list of CardSource to a permanents bottom sources, CAN NOT be used to put a field permanent under must use IPlacePermanentToDigivolutionCards
+    /// </summary>
+    /// <param name="addedDigivolutionCards"></param>
+    /// <param name="cardEffect"></param>
+    /// <param name="skipEffectAndActivateSkill"></param>
+    /// <returns></returns>
     public IEnumerator AddDigivolutionCardsBottom(List<CardSource> addedDigivolutionCards, ICardEffect cardEffect, bool skipEffectAndActivateSkill = false)
     {
         List<CardSource> addedCards = new List<CardSource>();