This commit is contained in:
CortexCore
2025-08-03 02:28:22 +08:00
parent 87007c9c24
commit 519c93d651
26 changed files with 427 additions and 5 deletions

View File

@@ -35,6 +35,19 @@ namespace Net.Project.B.Buff
public void AddBuff(IBuff buff, float duration = 0)
{
for (var i = 0; i <_count ; i++)
{
ref var x = ref _buff[i];
if (x.GetType() == buff.GetType())
{
x.Value += buff.Value;
_durations[buff] = _durations.GetValueOrDefault(buff) + duration;
return;
}
}
_buff[_count++] = buff;
OnBuffAdded?.Invoke(buff);
if (duration > 0)