mbunch_kascope пре 1 година
родитељ
комит
36c4300eca

+ 64 - 4
Assets/CardEffect/BT22/White/BT22_007.cs

@@ -1,6 +1,7 @@
 using System;
 using System.Collections;
 using System.Collections.Generic;
+using System.Diagnostics;
 using System.Linq;
 
 // Mother Eater
@@ -74,10 +75,13 @@ namespace DCGO.CardEffects.BT22
                         }
                     }
 
+
                     if (card.PermanentOfThisCard().DigivolutionCards.Count >= 10)
                     {
                         Permanent thisPermanent = card.PermanentOfThisCard();
-                        if (thisPermanent.DigivolutionCards.Count(CanSelectMother) >= 3)
+
+                        if (thisPermanent.DigivolutionCards.Count(CanSelectMother) >= 3 &&
+                            card.Owner.fieldCardFrames.Count((frame) => frame.IsEmptyFrame() && frame.IsBattleAreaFrame()) >= 3)
                         {
                             SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
 
@@ -93,7 +97,7 @@ namespace DCGO.CardEffects.BT22
                                 canEndNotMax: false,
                                 isShowOpponent: true,
                                 mode: SelectCardEffect.Mode.Custom,
-                                root: SelectCardEffect.Root.DigivolutionCards,
+                                root: SelectCardEffect.Root.Custom,
                                 customRootCardList: thisPermanent.DigivolutionCards,
                                 canLookReverseCard: true,
                                 selectPlayer: card.Owner,
@@ -109,6 +113,11 @@ namespace DCGO.CardEffects.BT22
                             {
                                 if (cardSources.Count == 3)
                                 {
+                                    foreach(CardSource source in cardSources)
+                                    {
+                                        source.SetDP(16000);
+                                    }
+
                                     yield return ContinuousController.instance.StartCoroutine(
                                         CardEffectCommons.PlayPermanentCards(
                                         cardSources: cardSources,
@@ -128,7 +137,7 @@ namespace DCGO.CardEffects.BT22
 
             #region All Turns
 
-            if (timing == EffectTiming.None)
+            /*if (timing == EffectTiming.None)
             {
                 string EffectDiscription()
                 {
@@ -160,7 +169,7 @@ namespace DCGO.CardEffects.BT22
                 card: card,
                 condition: Condition,
                 effectName: EffectDiscription));
-            }
+            }*/
 
             #endregion
 
@@ -284,6 +293,57 @@ namespace DCGO.CardEffects.BT22
 
             #endregion
 
+            #region Remove Field - Reset DP
+
+            if (timing == EffectTiming.WhenRemoveField)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("", CanUseCondition, card);
+                activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, true, "");
+                activateClass.SetIsBackgroundProcess(true);
+                cardEffects.Add(activateClass);
+
+                bool IsEaterDigimon(Permanent permanent)
+                {
+                    return CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card)
+                        && permanent.TopCard.EqualsCardName("Mother Eater");
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.CanTriggerWhenRemoveField(hashtable, card);
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    List<Permanent> permanets = new List<Permanent>();
+                    if (CardEffectCommons.IsPermanentExistsOnBreedingArea(card.PermanentOfThisCard()))
+                    {
+                        permanets = card.Owner.GetBattleAreaDigimons()
+                            .Filter(IsEaterDigimon)
+                            .ToList();
+                    }
+                    else
+                    {
+                        permanets.Add(card.PermanentOfThisCard());
+                        
+                    }
+
+                    foreach (Permanent permanent in permanets)
+                    {
+                        #region Remove Events from Permanent
+
+                        permanent.TopCard.SetDP(0);
+
+                        #endregion
+                    }
+
+                    yield return null;
+                }
+            }
+
+            #endregion
+
             return cardEffects;
         }
     }

+ 58 - 6
Assets/Editor/Fixing Scripts/FixErrataImages.cs

@@ -18,6 +18,7 @@ namespace DCGO.Tools.Repair
         string debugText = "";
         int matchedCount = 0;
 
+        #region Fix Errata Images
         [MenuItem("Window/DCGO/Repair/Fix Errata Images")]
         static void ErrataImages()
         {
@@ -42,8 +43,8 @@ namespace DCGO.Tools.Repair
                 }
 
                 string errataName = FindMatchingErrata(card.CardSpriteName, data);
-                
-                if(card.CardSpriteName != errataName)
+
+                if (card.CardSpriteName != errataName)
                 {
                     card.CardSpriteName = errataName;
                     EditorUtility.SetDirty(card);
@@ -58,23 +59,74 @@ namespace DCGO.Tools.Repair
         {
             string name = imageName;
 
-            foreach(AlternateArt AA in data.AAs)
+            foreach (AlternateArt AA in data.AAs)
             {
-                if (AA.id.Replace("-Errata","") != imageName)
+                if (AA.id.Replace("-Errata", "") != imageName)
                     continue;
 
                 name = AA.id;
             }
 
-            if(name != imageName)
+            if (name != imageName)
             {
                 debugText += $"{imageName}\n";
                 matchedCount++;
-            }               
+            }
 
             return name;
         }
 
+        #endregion
+
+        #region Fix Errata Images
+        [MenuItem("Window/DCGO/Repair/Fix Sample Images")]
+        static void SampleImages()
+        {
+            instance = new FixErrataImages();
+            instance.FixSampleImages();
+        }
+
+        void FixSampleImages()
+        {
+            string path = "Assets/CardBaseEntity/";
+
+            if (Selection.assetGUIDs.Length != 0)
+                path = AssetDatabase.GUIDToAssetPath(Selection.assetGUIDs[0]);
+
+            Debug.Log($"ASSET PATH: {path}");
+
+            List<CEntity_Base> Entities = GetAsset.LoadAll<CEntity_Base>(path);
+
+            foreach (CEntity_Base card in Entities)
+            {
+                string errataName = FindMatchingSample(card.CardSpriteName);
+
+                if (card.CardSpriteName != errataName)
+                {
+                    card.CardSpriteName = errataName;
+                    EditorUtility.SetDirty(card);
+                }
+            }
+
+            Debug.Log($"COMPLETED");
+        }
+
+        string FindMatchingSample(string imageName)
+        {
+            string name = imageName;
+
+            if (!name.Contains("_P"))
+                name += "-Sample";
+
+            return name;
+        }
+
+        #endregion
+
+
+
+
+
         IEnumerator GetJsonData()
         {
             string url = baseURL + "assets/cardlists/DigimonCards.json";

+ 1 - 0
Assets/Scripts/AutoProcessing.cs

@@ -159,6 +159,7 @@ public class AutoProcessing : MonoBehaviourPunCallbacks
         {
             if (permanent.TopCard != null)
             {
+                Debug.Log($"RULE CHECK: {permanent.DP}");
                 if (permanent.DP < 0)
                 {
                     if (permanent.IsPlaceToTrashDueToNotHavingDP)

+ 11 - 0
Assets/Scripts/CardEffectCommons/GiveEffect/GiveEffectToPermanent/CanNotSuspend.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 83625eba01817b3439d236e94a6e92fa
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 17 - 3
Assets/Scripts/CardSource.cs

@@ -1059,7 +1059,12 @@ public class CardSource : MonoBehaviour
             }
         }
 
-        if (IsDigiEgg)
+        if (!isBattleAreaFrame && frame.GetFramePermanent() == null && !isBreedingArea)
+        {
+            return false;
+        }
+
+        /*if (IsDigiEgg)
         {
             if (isBattleAreaFrame)
             {
@@ -1072,7 +1077,7 @@ public class CardSource : MonoBehaviour
             {
                 return false;
             }
-        }
+        }*/
 
         return true;
     }
@@ -2150,13 +2155,14 @@ public class CardSource : MonoBehaviour
 
     #region Whether this card has DP
 
-    public bool HasDP => IsDigimon || _cEntity_Base.DP > 0;
+    public bool HasDP => IsDigimon || _cEntity_Base.DP > 0 || BaseDP > 0;
 
     #endregion
 
     #region base card DP
 
     public int BaseCardDP => _cEntity_Base.DP;
+    public int BaseDP = 0;
 
     #endregion
 
@@ -2171,6 +2177,7 @@ public class CardSource : MonoBehaviour
             if (HasDP)
             {
                 cardDP = BaseCardDP;
+                cardDP += BaseDP;
 
                 #region card effects that change card DP
 
@@ -2231,6 +2238,13 @@ public class CardSource : MonoBehaviour
 
     #endregion
 
+    #region Set DP - Must be used in conjunction with when removed field
+    public void SetDP(int value)
+    {
+        BaseDP = value;
+    }
+    #endregion
+
     #region whether this card is token
 
     public bool IsToken { get; private set; } = false;

+ 1 - 0
Assets/Scripts/Permanent.cs

@@ -199,6 +199,7 @@ public class Permanent
             if (HasDP)
             {
                 BaseDP = TopCard.BaseCardDP;
+                BaseDP += TopCard.BaseDP;
 
                 #region 基礎DPを変更する効果