x89rt2 3 месяцев назад
Родитель
Сommit
7c5bd59d84

+ 2 - 5
Assets/Scripts/CardEffect/BT25/Black/BT25_101.cs

@@ -216,14 +216,13 @@ namespace DCGO.CardEffects.BT25
                                             selectCardEffect.SetUpCustomMessage("Select 1 [TS] trait card from your trash to link.", "The opponent is selecting 1 [TS] trait card from their trash to link.");
                                             selectCardEffect.SetUpCustomMessage_ShowCard("Selected card");
                                             yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
-
                                             #endregion
 
                                             #region Select Digimon that will gain selected card as link
-                                            if (CardEffectCommons.MatchConditionOwnersPermanentCount(card, perm => CanLink(selectedCardToLink, perm)) > 1)
+                                            if (CardEffectCommons.HasMatchConditionPermanent(perm => CanLink(selectedCardToLink, perm)))
                                             {
                                                 SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
-                                                int maxCount = Math.Min(1, CardEffectCommons.MatchConditionOwnersPermanentCount(card, perm => CanLink(selectedCardToLink, perm)));
+                                                int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(perm => CanLink(selectedCardToLink, perm)));
 
                                                 selectPermanentEffect.SetUp(
                                                     selectPlayer: card.Owner,
@@ -241,12 +240,10 @@ namespace DCGO.CardEffects.BT25
                                                 selectPermanentEffect.SetUpCustomMessage("Select 1 digimon to gain link.", "The opponent is selecting 1 Digimon to gain link.");
                                                 yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
                                             }
-                                            else selectedPermament = card.Owner.GetBattleAreaPermanents().FirstOrDefault(per => CanLink(selectedCardToLink, per));
                                             #endregion
                                         }
 
                                         if (selectedPermament != null && selectedCardToLink != null) yield return ContinuousController.instance.StartCoroutine(selectedPermament.AddLinkCard(selectedCardToLink, activateClass));
-
                                     }
                                 }
                             }

+ 35 - 32
Assets/Scripts/CardEffect/BT25/Red/BT25_013.cs

@@ -66,39 +66,42 @@ namespace DCGO.CardEffects.BT25
 
                     IEnumerator AfterSelectCardCoroutine(List<CardSource> cardSources)
                     {
-                        bool CanSelectCardCondition(CardSource cardSource)
+                        if (cardSources.Count > 0)
                         {
-                            return cardSource.IsDigimon
-                                && cardSource.HasIliadTraits
-                                && (cardSource.HasCardColor(CardColor.Red, isDigimonOnly: true)
-                                    || cardSource.HasCardColor(CardColor.Blue, isDigimonOnly: true));
-                        }
-
-                        if (CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectCardCondition))
-                        {
-                            int maxCount = Math.Min(1, card.Owner.TrashCards.Count(CanSelectCardCondition));
-
-                            SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
-
-                            selectCardEffect.SetUp(
-                                canTargetCondition: CanSelectCardCondition,
-                                canTargetCondition_ByPreSelecetedList: null,
-                                canEndSelectCondition: null,
-                                canNoSelect: () => true,
-                                selectCardCoroutine: null,
-                                afterSelectCardCoroutine: null,
-                                message: "Select 1 card to add to your hand.",
-                                maxCount: maxCount,
-                                canEndNotMax: false,
-                                isShowOpponent: true,
-                                mode: SelectCardEffect.Mode.AddHand,
-                                root: SelectCardEffect.Root.Trash,
-                                customRootCardList: null,
-                                canLookReverseCard: true,
-                                selectPlayer: card.Owner,
-                                cardEffect: activateClass);
-
-                            yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
+                            bool CanSelectCardCondition(CardSource cardSource)
+                            {
+                                return cardSource.IsDigimon
+                                    && cardSource.HasIliadTraits
+                                    && (cardSource.HasCardColor(CardColor.Red, isDigimonOnly: true)
+                                        || cardSource.HasCardColor(CardColor.Blue, isDigimonOnly: true));
+                            }
+
+                            if (CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectCardCondition))
+                            {
+                                int maxCount = Math.Min(1, card.Owner.TrashCards.Count(CanSelectCardCondition));
+
+                                SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
+
+                                selectCardEffect.SetUp(
+                                    canTargetCondition: CanSelectCardCondition,
+                                    canTargetCondition_ByPreSelecetedList: null,
+                                    canEndSelectCondition: null,
+                                    canNoSelect: () => true,
+                                    selectCardCoroutine: null,
+                                    afterSelectCardCoroutine: null,
+                                    message: "Select 1 card to add to your hand.",
+                                    maxCount: maxCount,
+                                    canEndNotMax: false,
+                                    isShowOpponent: true,
+                                    mode: SelectCardEffect.Mode.AddHand,
+                                    root: SelectCardEffect.Root.Trash,
+                                    customRootCardList: null,
+                                    canLookReverseCard: true,
+                                    selectPlayer: card.Owner,
+                                    cardEffect: activateClass);
+
+                                yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
+                            }
                         }
                     }
                 }