Przeglądaj źródła

bug fixes for ST20/21

mbunch_kascope 1 rok temu
rodzic
commit
5cc30ab48d

+ 1 - 1
Assets/CardBaseEntity/ST20/Red/Digimon/ST20_03.asset

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:8c8a46b92627124cc967f136398595fcec6ca619127d51966f39de4e31586b90
+oid sha256:cd2666eb36d8eec66db0eb4f3aa66534277d859fc362c6ca250d1e8a02d18823
 size 1372

+ 1 - 1
Assets/CardBaseEntity/ST21/Blue/Digimon/ST21_04.asset

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:bb944a8859b189457bee837398d5cf423a23e0af0e11ffae24378397c4aae02b
+oid sha256:b148b50950321ff3ecdd31a1cc4f73093b8e17f0c09e2422614e89d506c265e3
 size 1577

+ 1 - 1
Assets/CardBaseEntity/ST21/Green/Digimon/ST21_08.asset

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:658db6b7d92371b69fe65974f68c8c7285b94225cdc854e0eab6675481393121
+oid sha256:652fb75c66c78390c8b460b173131f685cbddd849e00c5fa36304baa37f7e472
 size 1367

+ 5 - 2
Assets/CardEffect/ST20/Black/ST20_11.cs

@@ -292,6 +292,7 @@ namespace DCGO.CardEffects.ST20
             {
                 return CardEffectCommons.IsMinDP(permanent, card.Owner.Enemy);
             }
+
             bool CanActivateAtkDigivolveCondition(Hashtable hashtable)
             {
                 if (CardEffectCommons.IsExistOnBattleArea(card))
@@ -328,7 +329,7 @@ namespace DCGO.CardEffects.ST20
                 {
                     if (CardEffectCommons.HasMatchConditionPermanent(CanSelectTargetCondition))
                     {
-                        SelectPermanentEffect selectPermanentEffect = new SelectPermanentEffect();
+                        SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
 
                         selectPermanentEffect.SetUp(
                             selectPlayer: card.Owner,
@@ -342,6 +343,7 @@ namespace DCGO.CardEffects.ST20
                             afterSelectPermanentCoroutine: null,
                             mode: SelectPermanentEffect.Mode.Destroy,
                             cardEffect: activateClass);
+
                         selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon to delete.", "The opponent is selecting 1 Digimon to delete.");
                         yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
                     }
@@ -371,7 +373,7 @@ namespace DCGO.CardEffects.ST20
                 {
                     if (CardEffectCommons.HasMatchConditionPermanent(CanSelectTargetCondition))
                     {
-                        SelectPermanentEffect selectPermanentEffect = new SelectPermanentEffect();
+                        SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
 
                         selectPermanentEffect.SetUp(
                             selectPlayer: card.Owner,
@@ -385,6 +387,7 @@ namespace DCGO.CardEffects.ST20
                             afterSelectPermanentCoroutine: null,
                             mode: SelectPermanentEffect.Mode.Destroy,
                             cardEffect: activateClass);
+
                         selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon to delete.", "The opponent is selecting 1 Digimon to delete.");
                         yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
                     }

+ 3 - 6
Assets/CardEffect/ST20/Black/ST20_13.cs

@@ -22,14 +22,11 @@ namespace DCGO.CardEffects.ST20
                 {
                     return "[Your Turn] When any Digimon cards with the [ADVENTURE] trait would be played from your hand, by suspending this Tamer, reduce the play cost by 1.";
                 }
+
                 bool PlayCardCondition(CardSource cardSource)
                 {
-                    if (CardEffectCommons.IsExistOnHand(cardSource))
-                    {
-                        return cardSource.EqualsTraits("ADVENTURE");
-                    }
-
-                    return false;
+                    return CardEffectCommons.IsExistOnHand(cardSource) &&
+                           cardSource.IsDigimon && cardSource.EqualsTraits("ADVENTURE");
                 }
 
                 bool CanUseCondition(Hashtable hashtable)

+ 3 - 2
Assets/CardEffect/ST20/Green/ST20_09.cs

@@ -46,7 +46,7 @@ namespace DCGO.CardEffects.ST20
 
             bool CanSelectPermanentCondition(Permanent permanent)
             {
-                return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card);
+                return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
             }
             #endregion 
 
@@ -115,7 +115,8 @@ namespace DCGO.CardEffects.ST20
 
                 bool CanUseCondition(Hashtable hashtable)
                 {
-                    return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card) && 
+                           CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
                 }
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)

+ 1 - 0
Assets/CardEffect/ST20/Red/ST20_03.cs

@@ -1,5 +1,6 @@
 using System.Collections;
 using System.Collections.Generic;
+using System.Diagnostics;
 
 //ST20-03 Birdramon
 namespace DCGO.CardEffects.ST20

+ 3 - 6
Assets/CardEffect/ST20/Red/ST20_12.cs

@@ -70,14 +70,11 @@ namespace DCGO.CardEffects.ST20
                 {
                     return "[Your Turn] When any Digimon cards with the [ADVENTURE] trait would be played from your hand, by suspending this Tamer, reduce the play cost by 1.";
                 }
+
                 bool PlayCardCondition(CardSource cardSource)
                 {
-                    if (CardEffectCommons.IsExistOnHand(cardSource))
-                    {
-                        return cardSource.EqualsTraits("ADVENTURE");
-                    }
-
-                    return false;
+                    return CardEffectCommons.IsExistOnHand(cardSource) &&
+                           cardSource.IsDigimon && cardSource.EqualsTraits("ADVENTURE");
                 }
 
                 bool CanUseCondition(Hashtable hashtable)

+ 16 - 9
Assets/CardEffect/ST20/Yellow/ST20_06.cs

@@ -49,13 +49,16 @@ namespace DCGO.CardEffects.ST20
                 {
                     if (CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card))
                     {
-                        foreach (CardSource cardSource in card.Owner.HandCards)
+                        if(permanent != card.PermanentOfThisCard())
                         {
-                            if (cardSource.EqualsTraits("ADVENTURE"))
+                            foreach (CardSource cardSource in card.Owner.HandCards)
                             {
-                                if (cardSource.CanPlayCardTargetFrame(permanent.PermanentFrame, false, activateClass))
+                                if (cardSource.EqualsTraits("ADVENTURE"))
                                 {
-                                    return true;
+                                    if (cardSource.CanPlayCardTargetFrame(permanent.PermanentFrame, false, activateClass))
+                                    {
+                                        return true;
+                                    }
                                 }
                             }
                         }
@@ -151,13 +154,16 @@ namespace DCGO.CardEffects.ST20
                 {
                     if (CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card))
                     {
-                        foreach (CardSource cardSource in card.Owner.HandCards)
+                        if (permanent != card.PermanentOfThisCard())
                         {
-                            if (cardSource.EqualsTraits("ADVENTURE"))
+                            foreach (CardSource cardSource in card.Owner.HandCards)
                             {
-                                if (cardSource.CanPlayCardTargetFrame(permanent.PermanentFrame, false, activateClass))
+                                if (cardSource.EqualsTraits("ADVENTURE"))
                                 {
-                                    return true;
+                                    if (cardSource.CanPlayCardTargetFrame(permanent.PermanentFrame, false, activateClass))
+                                    {
+                                        return true;
+                                    }
                                 }
                             }
                         }
@@ -175,7 +181,8 @@ namespace DCGO.CardEffects.ST20
 
                 bool CanUseCondition(Hashtable hashtable)
                 {
-                    return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card) && 
+                           CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
                 }
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)

+ 2 - 1
Assets/CardEffect/ST21/Yellow/ST21_06.cs

@@ -176,7 +176,7 @@ namespace DCGO.CardEffects.ST21
             if (timing == EffectTiming.OnEnterFieldAnyone)
             {
                 ActivateClass activateClass = new ActivateClass();
-                activateClass.SetUpICardEffect("Gain adventure then attack", CanUseCondition, card);
+                activateClass.SetUpICardEffect("Gain Alliance then attack", CanUseCondition, card);
                 activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, true, EffectDiscription());
                 activateClass.SetHashString("alliance-attack-ST21-006");
                 cardEffects.Add(activateClass);
@@ -319,6 +319,7 @@ namespace DCGO.CardEffects.ST21
                 cardEffects.Add(CardEffectFactory.AllianceSelfEffect(isInheritedEffect: true, card: card, condition: Condition));
             }
             #endregion
+
             return cardEffects;
         }
     }

+ 20 - 20
Assets/Scripts/Combinations.cs

@@ -10,9 +10,8 @@ public static class Combinations
     public static void Sample()
     {
         List<string[]> sourceList = new List<string[]>(3);
-        sourceList.Add(new string[] { "a", "b" });
-        sourceList.Add(new string[] { "c", "d", "e" });
-        sourceList.Add(new string[] { "f", "g", "h", "i" });
+        sourceList.Add(new string[] { "black", "green" });
+        sourceList.Add(new string[] { "red", "yellow"});
         List<string[]> resultList = GetCombinations(sourceList);
 
         foreach (string[] item in resultList)
@@ -50,7 +49,7 @@ public static class Combinations
         }
     }
 
-    //カードリストの内、異なる色を持つカードの枚数
+    //GetDifferenetColorCardCount
     public static int GetDifferenetColorCardCount(List<CardSource> cardSources)
     {
         List<CardColor[]> cardColors = new List<CardColor[]>();
@@ -64,23 +63,23 @@ public static class Combinations
 
         int maxColorCount = 0;
 
-        foreach (CardColor[] cardColorArray in colorCombinations)
-        {
-            //赤~白に対応するカード1枚を各色毎に格納する配列
-            CardSource[] cardsCorrespondingToColor = new CardSource[System.Enum.GetValues(typeof(CardColor)).Length - 1];
+        //赤~白に対応するカード1枚を各色毎に格納する配列
+        CardSource[] cardsCorrespondingToColor = new CardSource[System.Enum.GetValues(typeof(CardColor)).Length - 1];
 
-            for (int i = 0; i < cardsCorrespondingToColor.Length; i++)
-            {
-                cardsCorrespondingToColor[i] = null;
-            }
+        for (int i = 0; i < cardsCorrespondingToColor.Length; i++)
+        {
+            cardsCorrespondingToColor[i] = null;
+        }
 
+        foreach (CardColor[] cardColorArray in colorCombinations)
+        {
             if (cardColorArray.Length == cardSources.Count)
             {
                 for (int i = 0; i < cardColorArray.Length; i++)
                 {
                     CardSource cardSource = cardSources[i];
 
-                    bool skip = false;
+                    /*bool skip = false;
 
                     for (int j = 0; j < cardsCorrespondingToColor.Length; j++)
                     {
@@ -89,6 +88,7 @@ public static class Combinations
                             //既に同じ組み合わせの色のカードが配列に格納されている場合
                             if (Enumerable.SequenceEqual(cardSource.CardColors.OrderBy(e => e), cardsCorrespondingToColor[j].CardColors.OrderBy(e => e)))
                             {
+                                UnityEngine.Debug.Log($"SKIPPING: {cardSource.BaseENGCardNameFromEntity}");
                                 skip = true;
                                 break;
                             }
@@ -98,7 +98,7 @@ public static class Combinations
                     if (skip)
                     {
                         continue;
-                    }
+                    }*/
 
                     CardColor cardColor = cardColorArray[i];
 
@@ -113,13 +113,13 @@ public static class Combinations
                     }
                 }
             }
+        }
 
-            int colorCount = cardsCorrespondingToColor.ToList().Count((cardSource) => cardSource != null);
-
-            if (colorCount >= maxColorCount)
-            {
-                maxColorCount = colorCount;
-            }
+        int colorCount = cardsCorrespondingToColor.ToList().Count((cardSource) => cardSource != null);
+        UnityEngine.Debug.Log($"COUNTS: {colorCount} >= {maxColorCount}");
+        if (colorCount >= maxColorCount)
+        {
+            maxColorCount = colorCount;
         }
 
         return maxColorCount;