101 lines
3.0 KiB
C#
101 lines
3.0 KiB
C#
using Cal;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace ET
|
|
{
|
|
public class SkillLogicDstroySystem: DestroySystem<SkillLogic>
|
|
{
|
|
public override void Destroy(SkillLogic self)
|
|
{
|
|
self.dataX10000 = 1;
|
|
self.dataOldX10000 = 1;
|
|
self.owner = null;
|
|
self.skillLogicConfig = null;
|
|
self.lastCDTime = 0;
|
|
self.skillLevel = 0;
|
|
self.skillOptionLogics.Clear();
|
|
}
|
|
}
|
|
|
|
public static class SkillLogicSystem
|
|
{
|
|
public static void HandleEvent(this SkillLogic self, SkillEventCondition skillEventCondition, ISkillSender skillSender)
|
|
{
|
|
if (self?.skillLogicConfig?.skillEventDic == null) return;
|
|
|
|
if (!self.skillLogicConfig.skillEventDic.TryGetValue(skillEventCondition, out SkillOptionBase[] skillOptionBaseList))
|
|
{
|
|
return;
|
|
}
|
|
|
|
foreach (SkillOptionBase option in skillOptionBaseList)
|
|
{
|
|
SkillOptionLogicBase skillOptionLogicBase = SkillOptionFactory.AcquireSkillOptionLogic(option);
|
|
self.skillOptionLogics.Add(skillOptionLogicBase);
|
|
skillOptionLogicBase.HandleEvent(skillSender);
|
|
}
|
|
}
|
|
|
|
public static void UpdateLevel(this SkillLogic self)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public static void Clear(this SkillLogic self)
|
|
{
|
|
self.dataX10000 = 1;
|
|
self.dataOldX10000 = 1;
|
|
}
|
|
|
|
public static int GetPlayAmount(this SkillLogic self)
|
|
{
|
|
AttackComponent attacker = self.owner.GetComponent<AttackComponent>();
|
|
if (attacker == null)
|
|
{
|
|
Log.Error($"attacker == null");
|
|
return 1;
|
|
}
|
|
|
|
return attacker.playAmount;
|
|
}
|
|
|
|
public static void SetPlayAmount(this SkillLogic self, int value)
|
|
{
|
|
AttackComponent attacker = self.owner.GetComponent<AttackComponent>();
|
|
if (attacker == null)
|
|
{
|
|
Log.Error($"attacker == null");
|
|
return;
|
|
}
|
|
|
|
if (value < 1) value = 1;
|
|
attacker.playAmount = value;
|
|
}
|
|
|
|
public static float GetMultipleDamage(this SkillLogic self)
|
|
{
|
|
AttackComponent attacker = self.owner.GetComponent<AttackComponent>();
|
|
if (attacker == null)
|
|
{
|
|
Log.Error($"attacker == null");
|
|
return 1;
|
|
}
|
|
|
|
return attacker.multipleDamageX10000;
|
|
}
|
|
|
|
public static void SetMultipleDamage(this SkillLogic self, float value)
|
|
{
|
|
AttackComponent attacker = self.owner.GetComponent<AttackComponent>();
|
|
if (attacker == null)
|
|
{
|
|
Log.Error($"attacker == null");
|
|
return;
|
|
}
|
|
|
|
if (value < 1) value = 1;
|
|
attacker.multipleDamageX10000 = value;
|
|
}
|
|
}
|
|
} |