diff --git a/Configs/GameConfig/Datas/GiftConfig.xlsx b/Configs/GameConfig/Datas/GiftConfig.xlsx index 56587ea7..d8a43083 100644 Binary files a/Configs/GameConfig/Datas/GiftConfig.xlsx and b/Configs/GameConfig/Datas/GiftConfig.xlsx differ diff --git a/UnityProject/Assets/AssetRaw/Configs/bytes/giftconfig_tbgiftconfig.bytes b/UnityProject/Assets/AssetRaw/Configs/bytes/giftconfig_tbgiftconfig.bytes index ca969529..9dd32a3c 100644 Binary files a/UnityProject/Assets/AssetRaw/Configs/bytes/giftconfig_tbgiftconfig.bytes and b/UnityProject/Assets/AssetRaw/Configs/bytes/giftconfig_tbgiftconfig.bytes differ diff --git a/UnityProject/Assets/GameScripts/HotFix/GameLogic/Actor/ActorHItem.cs b/UnityProject/Assets/GameScripts/HotFix/GameLogic/Actor/ActorHItem.cs index cfa66413..0ed1f4b5 100644 --- a/UnityProject/Assets/GameScripts/HotFix/GameLogic/Actor/ActorHItem.cs +++ b/UnityProject/Assets/GameScripts/HotFix/GameLogic/Actor/ActorHItem.cs @@ -198,6 +198,45 @@ namespace GameLogic if (m_Buffs.ContainsKey(unitPlayerData.protCustMessageData.openId)) { + + // 如果是负面Buff + if (buff.addPower < 0) + { + + Buff godBuff = null; + + // 先检查自身身上有没有无敌Buff ,Value == 0的 + foreach (var item in m_Buffs[unitPlayerData.protCustMessageData.openId]) + { + // 无敌 + if (item.addPower == 0) + { + + if (godBuff == null) + { + godBuff = item; + } + else + { + // 比较,看谁时间最短 + if (godBuff.m_CraeteTimer < item.m_CraeteTimer) + { + godBuff = item; + } + } + } + } + + // 抵消 + if (godBuff != null) + { + // 有效时间置空 + godBuff.m_CraeteTimer = godBuff.m_AllTimer; + Log.Debug("触发抵消机制"); + return; + } + } + // 累加设计 // 没有该Buff,则新增这个Buff m_Buffs[unitPlayerData.protCustMessageData.openId].Add(buff); diff --git a/UnityProject/Assets/GameScripts/HotFix/GameLogic/Actor/Buff/Buff.cs b/UnityProject/Assets/GameScripts/HotFix/GameLogic/Actor/Buff/Buff.cs index 501c11d9..d4bdc6bc 100644 --- a/UnityProject/Assets/GameScripts/HotFix/GameLogic/Actor/Buff/Buff.cs +++ b/UnityProject/Assets/GameScripts/HotFix/GameLogic/Actor/Buff/Buff.cs @@ -17,10 +17,7 @@ public class Buff public void OnInit(int id, float value, int timerLen, int addScale, int num) { m_Id = id; - // 记录一下,特殊Buff,正常计时。非特殊Buff,在Actor中计时 - m_CraeteTimer = id == EventConts.isZoneTimerBuffId ? Time.time : 0; - //isZoneTimer = id == EventConts.isZoneTimerBuffId; - //isAllPower = id == EventConts.isAllPowerBuffId; + //m_CraeteTimer = timerLen; addPower = value; if (isZoneTimer) {