| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293 | 
							- using System;
 
- using System.Collections.Generic;
 
- using CombatLibrary.CombatLibrary.CombatCore.CustomizeTimeLogic.FxLogic;
 
- using Excel2Json;
 
- using Fort23.Core;
 
- using Fort23.UTool;
 
- using UnityEngine;
 
- using UTool.CustomizeTimeLogic.FxLogic.TimeLineEventinterface;
 
- namespace GameLogic.Combat.Buff
 
- {
 
-     public class BuffBasic : CObject
 
-     {
 
-         public CombatHeroEntity Source
 
-         {
 
-             get { return source; }
 
-         }
 
-         public CombatHeroEntity CombatHeroEntity
 
-         {
 
-             get { return combatHeroEntity; }
 
-         }
 
-         protected CombatHeroEntity combatHeroEntity;
 
-         // public BuffInfo buffInf;
 
-         protected CombatHeroEntity source;
 
-         protected TriggerData _triggerData;
 
-         public float _currTime;
 
-         protected float _jianGe;
 
-         public System.Action buffFinish;
 
-         private List<BuffStackInfo> _buffStackInfos = new List<BuffStackInfo>();
 
-         public BuffConfig BuffConfig;
 
-         public float buffTime;
 
-         public int count;
 
-         public int buffCount
 
-         {
 
-             get { return _count; }
 
-         }
 
-         protected int _count;
 
-         private float _time;
 
-         private BuffInfo myBuffInfo;
 
-         public void Init(CombatHeroEntity combatHeroEntity, CombatHeroEntity source, BuffInfo buffInfo)
 
-         {
 
-             myBuffInfo = null;
 
-             _triggerData.Source = this;
 
-             this.combatHeroEntity = combatHeroEntity;
 
-             this.BuffConfig = buffInfo.BuffConfig;
 
-             this.buffTime = buffInfo.buffTime;
 
-             this.count = buffInfo.count;
 
-             this.source = source;
 
-             ProInit();
 
-             AddBuffCount(source, buffInfo);
 
-         }
 
-         public int AddBuffCount(CombatHeroEntity source, BuffInfo buffInfo)
 
-         {
 
-             int ac = 0;
 
-             if (buffInfo.BuffConfig.timeType == 1)
 
-             {
 
-                 myBuffInfo = buffInfo;
 
-                 _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 0;
 
-                 }
 
-                 ac = c;
 
-                 _count += c;
 
-             }
 
-             else
 
-             {
 
-                 int c = buffCount + buffInfo.count;
 
-                 if (c > buffInfo.BuffConfig.overlayCount)
 
-                 {
 
-                     c = buffInfo.BuffConfig.overlayCount - buffCount;
 
-                 }
 
-                 else
 
-                 {
 
-                     c = buffInfo.count;
 
-                 }
 
-                 if (c <= 0)
 
-                 {
 
-                     return 0;
 
-                 }
 
-                 ac = c;
 
-                 buffInfo.count = c;
 
-                 _count += c;
 
-                 BuffStackInfo buffStackInfo = CObjectPool.Instance.Fetch<BuffStackInfo>();
 
-                 buffStackInfo.BuffBasic = this;
 
-                 buffStackInfo.BuffInfo = buffInfo;
 
-                 buffStackInfo.count = c;
 
-                 _buffStackInfos.Add(buffStackInfo);
 
-             }
 
-             UpdateEffect();
 
-             return ac;
 
-         }
 
-         protected virtual void ProInit()
 
-         {
 
-         }
 
-         public override void ActiveObj()
 
-         {
 
-         }
 
-         public void UpdateEffect()
 
-         {
 
-             ProUpdateEffect();
 
-         }
 
-         protected virtual void ProUpdateEffect()
 
-         {
 
-         }
 
-         public void ReduceCount(int count)
 
-         {
 
-             if (BuffConfig.timeType == 1)
 
-             {
 
-                 _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();
 
-         }
 
-         public TimeLineEventLogicGroupBasic ActivationTimeLineData(string groupName,
 
-             BetterList<ILifetCycleHitPoint> currTarget = null,
 
-             Vector3[] customizePos = null, System.Action finishCallBack = null, float startTime = default,
 
-             object extraData = null, int indexCount = 0)
 
-         {
 
-             TimeLineEventLogicGroupBasic timeLineEventLogicGroup =
 
-                 source.combatHeroTimeLineControl
 
-                     .GetTimeLineEventLogicGroup<TimeLineEventLogicGroupBasic>(groupName, null);
 
-             try
 
-             {
 
-                 if (timeLineEventLogicGroup != null)
 
-                 {
 
-                     timeLineEventLogicGroup.extraData = extraData;
 
-                     timeLineEventLogicGroup.SetCombatInfo(combatHeroEntity, null, currTarget, _triggerData,
 
-                         customizePos, indexCount);
 
-                     timeLineEventLogicGroup.TimeLineUpdateEnd = finishCallBack;
 
-                     timeLineEventLogicGroup.timeLineTime = startTime;
 
-                     combatHeroEntity.combatHeroTimeLineControl.AddEventLogicGroup(timeLineEventLogicGroup);
 
-                     // currUseAllTimeLineLogic.Add(timeLineEventLogicGroup);
 
-                 }
 
-             }
 
-             catch (Exception e)
 
-             {
 
-                 LogTool.Error(e);
 
-             }
 
-             return timeLineEventLogicGroup;
 
-         }
 
-         public override void DormancyObj()
 
-         {
 
-             buffFinish?.Invoke();
 
-             buffFinish = null;
 
-             _currTime = 0;
 
-             ProDormancyObj();
 
-             CObjectPool.Instance.Recycle(myBuffInfo);
 
-             myBuffInfo = null;
 
-             combatHeroEntity = null;
 
-         }
 
-         protected virtual void ProDormancyObj()
 
-         {
 
-         }
 
-         public void Update(float t)
 
-         {
 
-             if (BuffConfig.timeType == 1)
 
-             {
 
-                 _currTime += t;
 
-                 if (buffTime > 0 && _currTime > buffTime)
 
-                 {
 
-                     DelectBuff();
 
-                     return;
 
-                 }
 
-             }
 
-             else
 
-             {
 
-                 for (int i = 0; i < _buffStackInfos.Count; i++)
 
-                 {
 
-                     BuffStackInfo buffStackInfo = _buffStackInfos[i];
 
-                     buffStackInfo.Update(t);
 
-                 }
 
-             }
 
-             if (combatHeroEntity == null)
 
-             {
 
-                 return;
 
-             }
 
-             if (_jianGe > 0)
 
-             {
 
-                 _time += t;
 
-                 if (_time >= _jianGe)
 
-                 {
 
-                     _time -= _jianGe;
 
-                     UpdateJumping();
 
-                 }
 
-             }
 
-             ProUpdate(t);
 
-         }
 
-         public void DelectBuff()
 
-         {
 
-             combatHeroEntity.BuffControl.RemoveBuff(this);
 
-         }
 
-         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)
 
-         {
 
-         }
 
-     }
 
- }
 
 
  |