Browse Source

Merge branch 'master' of http://192.168.123.2:3000/ck/XiuXianGame

lzx 3 days ago
parent
commit
7e355d0234

+ 18 - 18
Assets/Res/Config/BuffConfig.json

@@ -12,7 +12,7 @@
       "effectValue": [
         1.0
       ],
-      "timeType": 1,
+      "timeType": 2,
       "buffTime": 9.0,
       "buffType": 2,
       "dispelType": 1,
@@ -32,7 +32,7 @@
       "effectValue": [
         0.0
       ],
-      "timeType": 1,
+      "timeType": 2,
       "buffTime": 9.0,
       "buffType": 2,
       "dispelType": 1,
@@ -53,7 +53,7 @@
         2.0,
         10.0
       ],
-      "timeType": 1,
+      "timeType": 2,
       "buffTime": 9.0,
       "buffType": 2,
       "dispelType": 1,
@@ -73,7 +73,7 @@
       "effectValue": [
         1.0
       ],
-      "timeType": 1,
+      "timeType": 2,
       "buffTime": 9.0,
       "buffType": 2,
       "dispelType": 1,
@@ -93,7 +93,7 @@
       "effectValue": [
         1.0
       ],
-      "timeType": 1,
+      "timeType": 2,
       "buffTime": 9.0,
       "buffType": 2,
       "dispelType": 1,
@@ -113,7 +113,7 @@
       "effectValue": [
         0.0
       ],
-      "timeType": 1,
+      "timeType": 2,
       "buffTime": 9.0,
       "buffType": 2,
       "dispelType": 1,
@@ -133,7 +133,7 @@
       "effectValue": [
         0.0
       ],
-      "timeType": 1,
+      "timeType": 2,
       "buffTime": -1.0,
       "buffType": 2,
       "dispelType": 1,
@@ -153,7 +153,7 @@
       "effectValue": [
         0.0
       ],
-      "timeType": 1,
+      "timeType": 2,
       "buffTime": 9.0,
       "buffType": 2,
       "dispelType": 1,
@@ -173,7 +173,7 @@
       "effectValue": [
         0.0
       ],
-      "timeType": 1,
+      "timeType": 2,
       "buffTime": 9.0,
       "buffType": 2,
       "dispelType": 1,
@@ -193,7 +193,7 @@
       "effectValue": [
         5.0
       ],
-      "timeType": 1,
+      "timeType": 2,
       "buffTime": 9.0,
       "buffType": 2,
       "dispelType": 1,
@@ -213,7 +213,7 @@
       "effectValue": [
         2.0
       ],
-      "timeType": 1,
+      "timeType": 2,
       "buffTime": 9.0,
       "buffType": 2,
       "dispelType": 1,
@@ -234,7 +234,7 @@
         100.0,
         10.0
       ],
-      "timeType": 1,
+      "timeType": 2,
       "buffTime": 9.0,
       "buffType": 2,
       "dispelType": 1,
@@ -254,7 +254,7 @@
       "effectValue": [
         20.0
       ],
-      "timeType": 1,
+      "timeType": 2,
       "buffTime": 9.0,
       "buffType": 2,
       "dispelType": 1,
@@ -274,7 +274,7 @@
       "effectValue": [
         10.0
       ],
-      "timeType": 1,
+      "timeType": 2,
       "buffTime": 9.0,
       "buffType": 2,
       "dispelType": 1,
@@ -294,7 +294,7 @@
       "effectValue": [
         10.0
       ],
-      "timeType": 1,
+      "timeType": 2,
       "buffTime": 9.0,
       "buffType": 2,
       "dispelType": 1,
@@ -315,7 +315,7 @@
         10.0,
         2.0
       ],
-      "timeType": 1,
+      "timeType": 2,
       "buffTime": 9.0,
       "buffType": 2,
       "dispelType": 1,
@@ -336,7 +336,7 @@
         10.0,
         1.0
       ],
-      "timeType": 1,
+      "timeType": 2,
       "buffTime": 9.0,
       "buffType": 2,
       "dispelType": 1,
@@ -356,7 +356,7 @@
       "effectValue": [
         3.0
       ],
-      "timeType": 1,
+      "timeType": 2,
       "buffTime": 9.0,
       "buffType": 2,
       "dispelType": 1,

+ 113 - 24
Assets/Scripts/GameLogic/Combat/Buff/BuffBasic.cs

@@ -1,4 +1,5 @@
 using System;
+using System.Collections.Generic;
 using CombatLibrary.CombatLibrary.CombatCore.CustomizeTimeLogic.FxLogic;
 using Fort23.Core;
 using Fort23.UTool;
@@ -18,6 +19,8 @@ namespace GameLogic.Combat.Buff
         protected float _jianGe;
         public System.Action buffFinish;
 
+        private List<BuffStackInfo> _buffStackInfos = new List<BuffStackInfo>();
+
         public int buffCount
         {
             get { return _count; }
@@ -25,6 +28,7 @@ namespace GameLogic.Combat.Buff
 
         protected int _count;
         private float _time;
+
         public void Init(CombatHeroEntity combatHeroEntity, CombatHeroEntity source, BuffInfo buffInfo)
         {
             _triggerData.Source = this;
@@ -37,23 +41,53 @@ namespace GameLogic.Combat.Buff
 
         public void AddBuffCount(CombatHeroEntity source, BuffInfo buffInfo)
         {
-            _currTime = 0;
-            int c = buffCount + buffInfo.count;
-            if (c > buffInfo.BuffConfig.overlayCount)
+            if (buffInfo.BuffConfig.timeType == 1)
             {
-                c = buffInfo.BuffConfig.overlayCount - buffCount;
+                _currTime = 0;
+                int c = buffCount + buffInfo.count;
+                if (c > buffInfo.BuffConfig.overlayCount)
+                {
+                    c = buffInfo.BuffConfig.overlayCount - buffCount;
+                }
+                else
+                {
+                    c = buffInfo.count;
+                }
+
+                if (c <= 0)
+                {
+                    return;
+                }
+
+                _count += c;
             }
             else
             {
-                c = buffInfo.count;
-            }
+                int c = buffCount + buffInfo.count;
+                if (c > buffInfo.BuffConfig.overlayCount)
+                {
+                    c = buffInfo.BuffConfig.overlayCount - buffCount;
+                }
+                else
+                {
+                    c = buffInfo.count;
+                }
 
-            if (c <= 0)
-            {
-                return;
+                if (c <= 0)
+                {
+                    return;
+                }
+
+                buffInfo.count = c;
+                _count += c;
+                BuffStackInfo buffStackInfo = CObjectPool.Instance.Fetch<BuffStackInfo>();
+                buffStackInfo.BuffBasic = this;
+                buffStackInfo.BuffInfo = buffInfo;
+                buffStackInfo.count = c;
+                _buffStackInfos.Add(buffStackInfo);
             }
 
-            _count += c;
+
             UpdateEffect();
         }
 
@@ -67,7 +101,6 @@ namespace GameLogic.Combat.Buff
 
         public void UpdateEffect()
         {
-            
             ProUpdateEffect();
         }
 
@@ -78,11 +111,45 @@ namespace GameLogic.Combat.Buff
 
         public void ReduceCount(int count)
         {
-            _count -= count;
-            if (_count <= 0)
+            if (buffInf.BuffConfig.timeType == 1)
             {
-                combatHeroEntity.BuffControl.RemoveBuff(this);
-                return;
+                _count -= count;
+                if (_count <= 0)
+                {
+                    combatHeroEntity.BuffControl.RemoveBuff(this);
+                    return;
+                }
+            }
+            else
+            {
+                while (count > 0)
+                {
+                    if (_buffStackInfos.Count <= 0)
+                    {
+                        combatHeroEntity.BuffControl.RemoveBuff(this);
+                        return;
+                    }
+
+                    BuffStackInfo buffStackInfo = _buffStackInfos[0];
+                    if (buffStackInfo.count >= count)
+                    {
+                        buffStackInfo.count -= count;
+                        _count -= count;
+                        count = 0;
+                        if (buffStackInfo.count == 0)
+                        {
+                            RemoveBuffStackInfo(buffStackInfo);
+                        }
+                    }
+                    else
+                    {
+                        int c = buffStackInfo.count;
+                        count -= c;
+                        _count -= c;
+                        buffStackInfo.count = 0;
+                        RemoveBuffStackInfo(buffStackInfo);
+                    }
+                }
             }
 
             UpdateEffect();
@@ -126,7 +193,6 @@ namespace GameLogic.Combat.Buff
             CObjectPool.Instance.Recycle(buffInf);
             buffInf = null;
             combatHeroEntity = null;
-           
         }
 
         protected virtual void ProDormancyObj()
@@ -135,15 +201,24 @@ namespace GameLogic.Combat.Buff
 
         public void Update(float t)
         {
-        
-
-           
-            _currTime += t;
-            if (buffInf.buffTime > 0 && _currTime > buffInf.buffTime)
+            if (buffInf.BuffConfig.timeType == 1)
             {
-                combatHeroEntity.BuffControl.RemoveBuff(this);
-                return;
+                _currTime += t;
+                if (buffInf.buffTime > 0 && _currTime > buffInf.buffTime)
+                {
+                    combatHeroEntity.BuffControl.RemoveBuff(this);
+                    return;
+                }
+            }
+            else
+            {
+                for (int i = 0; i < _buffStackInfos.Count; i++)
+                {
+                    BuffStackInfo buffStackInfo = _buffStackInfos[i];
+                    buffStackInfo.Update(t);
+                }
             }
+
             if (_jianGe > 0)
             {
                 _time += t;
@@ -153,12 +228,26 @@ namespace GameLogic.Combat.Buff
                     UpdateJumping();
                 }
             }
+
             ProUpdate(t);
         }
 
+        public void RemoveBuffStackInfo(BuffStackInfo buffStackInfo)
+        {
+            _buffStackInfos.Remove(buffStackInfo);
+            _count -= buffStackInfo.count;
+            CObjectPool.Instance.Recycle(buffStackInfo);
+            if (_buffStackInfos.Count <= 0)
+            {
+                combatHeroEntity.BuffControl.RemoveBuff(this);
+                return;
+            }
+
+            UpdateEffect();
+        }
+
         protected virtual void UpdateJumping()
         {
-            
         }
 
         protected virtual void ProUpdate(float t)

+ 34 - 0
Assets/Scripts/GameLogic/Combat/Buff/BuffStackInfo.cs

@@ -0,0 +1,34 @@
+using Fort23.Core;
+
+namespace GameLogic.Combat.Buff
+{
+    public class BuffStackInfo : CObject
+    {
+        public BuffInfo BuffInfo;
+        public int count;
+        public float _currTime;
+        public BuffBasic BuffBasic;
+
+        public override void ActiveObj()
+        {
+        }
+
+        public override void DormancyObj()
+        {
+            BuffInfo = null;
+            count = 0;
+            _currTime = 0;
+            BuffBasic = null;
+        }
+
+        public void Update(float time)
+        {
+            _currTime += time;
+            if (BuffInfo.buffTime > 0 && _currTime > BuffInfo.buffTime)
+            {
+                BuffBasic.RemoveBuffStackInfo(this);
+                return;
+            }
+        }
+    }
+}

+ 3 - 0
Assets/Scripts/GameLogic/Combat/Buff/BuffStackInfo.cs.meta

@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: f3fffdb5885847de8ed8b6e96e0dd653
+timeCreated: 1750669422

+ 12 - 12
Assets/Scripts/GameLogic/Combat/CombatTool/CombatCameraControllder.cs

@@ -53,18 +53,18 @@ namespace GameLogic.Combat.CombatTool
 
         private void SencenBesselPathAlter(IEventData eventData)
         {
-            isUpdateCameraToPath = true;
-            currValue = _cameraSelectValue;
-            if (CombatController.currActiveCombat.CombatSenceController.currBesselPath.isCentre)
-            {
-                targetValue = 0.5f;
-            }
-            else
-            {
-                targetValue = 0.7f;
-            }
-
-            _currTime = 0;
+            // isUpdateCameraToPath = true;
+            // currValue = _cameraSelectValue;
+            // if (CombatController.currActiveCombat.CombatSenceController.currBesselPath.isCentre)
+            // {
+            //     targetValue = 0.5f;
+            // }
+            // else
+            // {
+            //     targetValue = 0.7f;
+            // }
+            //
+            // _currTime = 0;
         }
 
         protected void HeroClick(IEventData eventData)

BIN
Excel2Json/Excel/Buff.xlsx