zxl
/
CTT
forked from Cal/CTT
1
0
Fork 0
CTT/Server/Hotfix/Game/SkillSystem/NewSkill/System/ModifierLogicSystem.cs

45 lines
1.4 KiB
C#
Raw Normal View History

2021-04-08 20:09:59 +08:00
using Cal;
using System;
using System.Collections.Generic;
using System.Text;
namespace ET
{
2023-09-07 00:06:37 +08:00
public class ModifierLogicDstroySystem: DestroySystem<ModifierLogic>
2021-04-08 20:09:59 +08:00
{
public override void Destroy(ModifierLogic self)
{
self.overlay = 0;
self.interval = 0;
self.leastTime = 0;
self.shield = 0;
2023-09-07 00:06:37 +08:00
self.multiDamageX10000 = 0;
self.playAmount = 0;
2021-04-08 20:09:59 +08:00
self.modifierConfig = null;
self.cancellationToken?.Cancel();
self.cancellationToken = null;
2023-09-07 00:06:37 +08:00
self.skillConfigId = 0;
self.owner = null;
self.target = null;
2021-04-08 20:09:59 +08:00
}
}
2023-09-07 00:06:37 +08:00
2021-04-08 20:09:59 +08:00
public static class ModifierLogicSystem
{
public static void HandleEvent(this ModifierLogic self, ModifierEventCondition modifierEventCondition, ISkillSender skillSender)
{
2021-04-11 19:50:39 +08:00
Dictionary<ModifierEventCondition, SkillOptionBase[]> dic = self.modifierConfig.modifierEventDic;
2021-04-08 20:09:59 +08:00
if (dic == null) return;
2023-09-07 00:06:37 +08:00
if (!dic.TryGetValue(modifierEventCondition, out SkillOptionBase[] list))
2021-04-08 20:09:59 +08:00
{
return;
}
2023-09-07 00:06:37 +08:00
2021-04-11 19:50:39 +08:00
foreach (SkillOptionBase item in list)
2021-04-08 20:09:59 +08:00
{
2021-04-11 19:50:39 +08:00
SkillOptionLogicBase skillOptionLogicBase = SkillOptionFactory.AcquireSkillOptionLogic(item);
2023-09-07 00:06:37 +08:00
skillOptionLogicBase.HandleEvent(skillSender);
2021-04-08 20:09:59 +08:00
}
}
}
2023-09-07 00:06:37 +08:00
}