Browse Source

Update to collision

mbunch_kascope 2 years ago
parent
commit
6d1da51c88

+ 1 - 1
Assets/CardBaseEntity/BT16/Black/Digimon/DoruGreymon-BT16-061.asset

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:0e1a4c217574f1ce88d64385fd8372462f8cc472d09f4a7c7902dd49bbf69a79
+oid sha256:8c31c5ba31dd8f906c21d5aab5621027736cc4538fcf15372b36a91f95b9a59c
 size 2462

+ 3 - 2
Assets/CardEffect/BT16/Black/DoruGreymon_BT16_061.cs

@@ -1,5 +1,6 @@
 using System.Collections;
 using System.Collections.Generic;
+using UnityEngine;
 using System.Linq;
 
 namespace DCGO.CardEffects.BT16
@@ -38,8 +39,8 @@ namespace DCGO.CardEffects.BT16
             #endregion
 
             #region Collision
-            if(timing == EffectTiming.OnAllyAttack)
-            {
+            if(timing == EffectTiming.OnCounterTiming)
+            {                
                 cardEffects.Add(CardEffectFactory.CollisionSelfStaticEffect(false,card, null));
             }
             #endregion

+ 1 - 1
Assets/CardEffect/BT16/Black/Dorugamon_BT16_058.cs

@@ -40,7 +40,7 @@ namespace DCGO.CardEffects.BT16
             #endregion
 
             #region Collision
-            if (timing == EffectTiming.OnAllyAttack)
+            if (timing == EffectTiming.OnCounterTiming)
             {
                 cardEffects.Add(CardEffectFactory.CollisionSelfStaticEffect(false, card, null));
             }

+ 2 - 2
Assets/CardEffect/BT16/Black/Dorugoramon_BT16_064.cs

@@ -40,8 +40,8 @@ namespace DCGO.CardEffects.BT16
             }
             #endregion
 
-            #region Collision - Blocker
-            if(timing == EffectTiming.OnAllyAttack)
+            #region Collision
+            if (timing == EffectTiming.OnCounterTiming)
             {
                 cardEffects.Add(CardEffectFactory.CollisionSelfStaticEffect(false, card, null));
             }

+ 2 - 2
Assets/CardEffect/BT16/Yellow/Sheepmon_BT16_032.cs

@@ -13,9 +13,9 @@ namespace DCGO.CardEffects.BT16
 
             #region Collision and Armor Purge
 
-            if (timing == EffectTiming.OnAllyAttack)
+            if (timing == EffectTiming.OnCounterTiming)
             {
-                cardEffects.Add(CardEffectFactory.CollisionSelfStaticEffect(isInheritedEffect: false, card: card, condition: null));
+                cardEffects.Add(CardEffectFactory.CollisionSelfStaticEffect(false, card, null));
             }
 
             if (timing == EffectTiming.WhenPermanentWouldBeDeleted)

+ 40 - 0
Assets/Editor/AdjustSetSpecificCardIndex.cs

@@ -0,0 +1,40 @@
+using MHLab.Patch.Core.IO;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using UnityEditor;
+using UnityEngine;
+
+namespace DCGO.Tools.Repair
+{
+    public class AdjustSetSpecificCardIndex : MonoBehaviour
+    {
+        [MenuItem("Window/DCGO/Repair/Fix Entity Card Index")]
+        static void FixEntityCardIndex()
+        {
+            int startingIndex = 3300;
+            string path = "Assets/CardBaseEntity/";
+
+            if (Selection.assetGUIDs.Length != 0)
+                path = AssetDatabase.GUIDToAssetPath(Selection.assetGUIDs[0]);
+
+            Debug.Log($"ASSET PATH: {path}");
+
+            List<CEntity_Base> List = GetAsset.LoadAll<CEntity_Base>(path)
+                .OrderBy(x => x.name.Substring(x.name.LastIndexOf("-")+1,3)).ToList();
+
+            foreach (CEntity_Base card in List)
+            {
+                Debug.Log($"{card.name}: {card.CardIndex} - {startingIndex}");
+            
+                card.CardIndex = startingIndex;
+                EditorUtility.SetDirty(card);
+                startingIndex++;
+            }
+
+
+            Debug.Log("Fixed all card index in CardBaseEntity");
+            return;
+        }
+    }
+}

+ 11 - 0
Assets/Editor/AdjustSetSpecificCardIndex.cs.meta

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

+ 3 - 6
Assets/Scripts/CardEffectFactory/KeyWordEffects/Collision.cs

@@ -49,14 +49,11 @@ public partial class CardEffectFactory
 
         bool CanUseCondition(Hashtable hashtable)
         {
-            if(CardEffectCommons.CanTriggerOnAttack(hashtable, card))
+            if (condition == null || condition())
             {
-                if (condition == null || condition())
-                {
-                    return true;
-                }
+                return true;
             }
-            
+
             return false;
         }