60 lines
1.9 KiB
C#
60 lines
1.9 KiB
C#
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;
|
|
}
|
|
foreach (ICombatBounds item in self.sources)
|
|
{
|
|
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;
|
|
}
|
|
|
|
}
|
|
}
|