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

fixing ex9 cards, fixing trash sources effect

mbunch_kascope 1 год назад
Родитель
Сommit
41858c269e

+ 1 - 6
Assets/CardEffect/EX9/Green/EX9_041.cs

@@ -46,7 +46,7 @@ namespace DCGO.CardEffects.EX9
             {
                 ActivateClass activateClass = new ActivateClass();
                 activateClass.SetUpICardEffect("Reduce the digivolution cost by 1 for each face-down source", CanUseCondition, card);
-                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
+                activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDiscription());
                 cardEffects.Add(activateClass);
 
                 string EffectDiscription()
@@ -82,11 +82,6 @@ namespace DCGO.CardEffects.EX9
                     return false;
                 }
 
-                bool CanActivateCondition(Hashtable hashtable)
-                {
-                    return CardEffectCommons.IsExistOnHand(card);
-                }
-
                 IEnumerator ActivateCoroutine(Hashtable _hashtable)
                 {
                     Hashtable hashtable = new Hashtable();

+ 2 - 7
Assets/CardEffect/EX9/Purple/EX9_063.cs

@@ -45,7 +45,7 @@ namespace DCGO.CardEffects.EX9
             {
                 ActivateClass activateClass = new ActivateClass();
                 activateClass.SetUpICardEffect("Reduce the digivolution cost by 1 for each face-down source", CanUseCondition, card);
-                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
+                activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDiscription());
                 cardEffects.Add(activateClass);
 
                 string EffectDiscription()
@@ -55,7 +55,7 @@ namespace DCGO.CardEffects.EX9
                 {
                     if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
                     {
-                        if (permanent.TopCard.EqualsTraits("Ver.3"))
+                        if (permanent.TopCard.EqualsTraits("Ver.4"))
                         {
                             return card.CanPlayCardTargetFrame(permanent.PermanentFrame, true, activateClass);
                         }
@@ -81,11 +81,6 @@ namespace DCGO.CardEffects.EX9
                     return false;
                 }
 
-                bool CanActivateCondition(Hashtable hashtable)
-                {
-                    return CardEffectCommons.IsExistOnHand(card);
-                }
-
                 IEnumerator ActivateCoroutine(Hashtable _hashtable)
                 {
                     Hashtable hashtable = new Hashtable();

+ 2 - 7
Assets/CardEffect/EX9/Yellow/EX9_031.cs

@@ -49,11 +49,11 @@ namespace DCGO.CardEffects.EX9
             {
                 ActivateClass activateClass = new ActivateClass();
                 activateClass.SetUpICardEffect("Reduce the digivolution cost by 1 for each face-down source", CanUseCondition, card);
-                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
+                activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDiscription());
                 cardEffects.Add(activateClass);
 
                 string EffectDiscription()
-                    => "When any of your [Ver.43] trait Digimon would digivolve into this card, for each of their face-down digivolution cards, reduce the digivolution cost by 1.";
+                    => "When any of your [Ver.3] trait Digimon would digivolve into this card, for each of their face-down digivolution cards, reduce the digivolution cost by 1.";
 
                 bool PermanentEvoCondition(Permanent permanent)
                 {
@@ -85,11 +85,6 @@ namespace DCGO.CardEffects.EX9
                     return false;
                 }
 
-                bool CanActivateCondition(Hashtable hashtable)
-                {
-                    return CardEffectCommons.IsExistOnHand(card);
-                }
-
                 IEnumerator ActivateCoroutine(Hashtable _hashtable)
                 {
                     Hashtable hashtable = new Hashtable();

+ 9 - 2
Assets/Scripts/CardEffectCommons/TrashDigivolutionCards.cs

@@ -61,6 +61,8 @@ public partial class CardEffectCommons
 
         int permanentSelectedCount = 0;
 
+        List<CardSource> selectedCards = new List<CardSource>();
+
         while (true)
         {
             if (isFromOnly1Permanent)
@@ -114,13 +116,13 @@ public partial class CardEffectCommons
                             maxDigivolutionDiscardCount - digivolutionDiscardedCount,
                             selectedPermanent.DigivolutionCards.Count(CanSelectCardCondition));
 
-                        List<CardSource> selectedCards = new List<CardSource>();
+                        
 
                         SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
 
                         selectCardEffect.SetUp(
                                     canTargetCondition: CanSelectCardCondition,
-                                    canTargetCondition_ByPreSelecetedList: null,
+                                    canTargetCondition_ByPreSelecetedList: CanTargetCondition_ByPreSelecetedList,
                                     canEndSelectCondition: null,
                                     canNoSelect: () => canNoTrash && NotSelectYet(),
                                     selectCardCoroutine: SelectCardCoroutine,
@@ -140,6 +142,11 @@ public partial class CardEffectCommons
 
                         yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
 
+                        bool CanTargetCondition_ByPreSelecetedList(List<CardSource> sources, CardSource source)
+                        {
+                            return !selectedCards.Contains(source);
+                        }
+
                         IEnumerator SelectCardCoroutine(CardSource cardSource)
                         {
                             selectedCards.Add(cardSource);