103 lines
3.1 KiB
C#
Executable File
103 lines
3.1 KiB
C#
Executable File
using Cal;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace ET
|
|
{
|
|
public class SkillLogicDstroySystem: DestroySystem<SkillLogic>
|
|
{
|
|
public override void Destroy(SkillLogic self)
|
|
{
|
|
self.owner = null;
|
|
self.skillLogicConfig = null;
|
|
self.skillConfig = null;
|
|
self.lastCDTime = 0;
|
|
self.skillLevel = 0;
|
|
self.ClearSkillLogic();
|
|
}
|
|
}
|
|
|
|
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);
|
|
skillOptionLogicBase.HandleEvent(skillSender);
|
|
}
|
|
}
|
|
|
|
public static void UpdateLevel(this SkillLogic self)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public static void ClearSkillLogic(this SkillLogic self)
|
|
{
|
|
self.skillOptionLogics.Clear();
|
|
}
|
|
|
|
public static void Clear(this SkillLogic self)
|
|
{
|
|
|
|
}
|
|
|
|
// 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;
|
|
// }
|
|
}
|
|
} |