CTT/Server/Hotfix/Game/System/User/CombatSystem.cs

60 lines
1.9 KiB
C#
Raw Normal View History

2021-04-08 20:09:59 +08:00
using Cal;
using System;
using System.Collections.Generic;
namespace ET
{
public class CombatDestroySystem : DestroySystem<Combat>
{
public override void Destroy(Combat self)
{
self.Destory();
}
}
public static class CombatSystem
{
public static float GetAtribute(this Combat self, AttributeType attributeType)
{
float value = 0;
if (self.sources == null)
{
Log.Error($"{self.Parent.Id} 没有ICombat组件");
return 0;
}
2021-04-11 19:50:39 +08:00
foreach (ICombatBounds item in self.sources)
2021-04-08 20:09:59 +08:00
{
if (item.getAttributeFunc == null)
value += 0;
else
value += item.getAttributeFunc.Invoke(attributeType);
}
switch (attributeType)
{
case AttributeType.:
case AttributeType.:
case AttributeType.:
case AttributeType.:
case AttributeType.:
case AttributeType.:
case AttributeType.:
case AttributeType.:
case AttributeType.:
case AttributeType.:
value += CharacterHelper.GetAttributeByPoint(self,attributeType,
GetAtribute(self, AttributeType.),
GetAtribute(self, AttributeType.),
GetAtribute(self, AttributeType.),
GetAtribute(self, AttributeType.),
GetAtribute(self, AttributeType.),
GetAtribute(self, AttributeType.));
break;
default:
break;
}
return value;
}
}
}