修复龙卷风没法正常显示的问题

This commit is contained in:
SD-20250424WZPW\Administrator 2025-05-08 17:06:26 +08:00
parent 0046012bdb
commit ca4d427906
4 changed files with 40 additions and 4 deletions

View File

@ -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);

View File

@ -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)
{