44 lines
1.4 KiB
C#
44 lines
1.4 KiB
C#
using Cal;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
|
|
namespace ET
|
|
{
|
|
public class ModifierLogicDstroySystem : DestroySystem<ModifierLogic>
|
|
{
|
|
public override void Destroy(ModifierLogic self)
|
|
{
|
|
self.overlay = 0;
|
|
self.interval = 0;
|
|
self.leastTime = 0;
|
|
self.shield = 0;
|
|
self.multiDamageX10000 =0;
|
|
self.playAmount =0;
|
|
self.modifierConfig = null;
|
|
self.cancellationToken?.Cancel();
|
|
self.cancellationToken = null;
|
|
self.skillLogic = null;
|
|
}
|
|
}
|
|
public static class ModifierLogicSystem
|
|
{
|
|
public static void HandleEvent(this ModifierLogic self, ModifierEventCondition modifierEventCondition, ISkillSender skillSender)
|
|
{
|
|
Dictionary<ModifierEventCondition, SkillOptionBase[]> dic = self.modifierConfig.modifierEventDic;
|
|
if (dic == null) return;
|
|
if(!dic.TryGetValue(modifierEventCondition,out SkillOptionBase[] list))
|
|
{
|
|
return;
|
|
}
|
|
foreach (SkillOptionBase item in list)
|
|
{
|
|
SkillOptionLogicBase skillOptionLogicBase = SkillOptionFactory.AcquireSkillOptionLogic(item);
|
|
skillSender.skillLogic.skillOptionLogics.Add(skillOptionLogicBase);
|
|
skillOptionLogicBase.HandleEvent(skillSender);
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|