84 lines
3.0 KiB
C#
84 lines
3.0 KiB
C#
|
using Cal.DataTable;
|
|||
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
|
|||
|
namespace ET
|
|||
|
{
|
|||
|
|
|||
|
public class UnitSkillDestroySystem : DestroySystem<UnitSkill>
|
|||
|
{
|
|||
|
public override void Destroy(UnitSkill self)
|
|||
|
{
|
|||
|
self.ResetSkillLevel();
|
|||
|
}
|
|||
|
}
|
|||
|
public static class UnitSkillSystem
|
|||
|
{
|
|||
|
//public static void UpdateSkillLevel(this UnitSkill self,Unit unit)
|
|||
|
//{
|
|||
|
// SkillBase skillBase = DataTableHelper.Get<SkillBase>((int)self.Id);
|
|||
|
// if(skillBase==null)
|
|||
|
// {
|
|||
|
// Log.Error($"【{ UserComponent.Instance.Get(unit.Id)?.NickName} ({ unit.Id})】skillBase == null where Id = {self.Id}");
|
|||
|
// return;
|
|||
|
// }
|
|||
|
// if (self.Level >=skillBase.LevelLimit)
|
|||
|
// {
|
|||
|
// return;
|
|||
|
// }
|
|||
|
// self.Level++;
|
|||
|
// if (skillBase.DamageType > 0) return;
|
|||
|
// EffectByPassiveSkill(self,unit);
|
|||
|
//}
|
|||
|
//public static string UpdateSkillLevel(this UnitSkill self, Unit unit,int level)
|
|||
|
//{
|
|||
|
// if(level - self.Level != 1)
|
|||
|
// {
|
|||
|
// return "技能书使用错误";
|
|||
|
// }
|
|||
|
// SkillBase skillBase = DataTableHelper.Get<SkillBase>((int)self.Id);
|
|||
|
// if (skillBase == null)
|
|||
|
// {
|
|||
|
// Log.Error($"【{ UserComponent.Instance.Get(unit.Id)?.NickName} ({ unit.Id})】skillBase == null where Id = {self.Id}");
|
|||
|
// return "系统错误";
|
|||
|
// }
|
|||
|
// if (self.Level >= skillBase.LevelLimit)
|
|||
|
// {
|
|||
|
// return "等级已经达到上限";
|
|||
|
// }
|
|||
|
// self.Level = level;
|
|||
|
// if (skillBase.DamageType > 0) return string.Empty;
|
|||
|
// EffectByPassiveSkill(self, unit);
|
|||
|
// return string.Empty;
|
|||
|
//}
|
|||
|
|
|||
|
//private static void EffectByPassiveSkill(UnitSkill self, Unit unit)
|
|||
|
//{
|
|||
|
// SkillLevel skillLevel = SkillHelper.GetSkillLevelInfo((int)self.Id, self.Level);
|
|||
|
// var num = unit.GetComponent<NumericComponent>();
|
|||
|
// num.AddSet(NumericType.MaxHpPct, skillLevel.BuffMaxHp1);
|
|||
|
// num.AddSet(NumericType.MaxHpAdd, skillLevel.BuffMaxHp2);
|
|||
|
|
|||
|
// num.AddSet(NumericType.MaxMpPct, skillLevel.BuffMaxMp1);
|
|||
|
// num.AddSet(NumericType.MaxMpAdd, skillLevel.BuffMaxMp2);
|
|||
|
|
|||
|
// num.AddSet(NumericType.StrPct, skillLevel.BuffStr1);
|
|||
|
// num.AddSet(NumericType.StrAdd, skillLevel.BuffStr2);
|
|||
|
|
|||
|
// num.AddSet(NumericType.QukPct, skillLevel.BuffQuk1);
|
|||
|
// num.AddSet(NumericType.QukAdd, skillLevel.BuffQuk2);
|
|||
|
|
|||
|
// num.AddSet(NumericType.SpiPct, skillLevel.BuffSpi1);
|
|||
|
// num.AddSet(NumericType.SpiAdd, skillLevel.BuffSpi2);
|
|||
|
|
|||
|
// num.AddSet(NumericType.WimPct, skillLevel.BuffWim1);
|
|||
|
// num.AddSet(NumericType.WimAdd, skillLevel.BuffWim2);
|
|||
|
//}
|
|||
|
|
|||
|
public static void ResetSkillLevel(this UnitSkill self)
|
|||
|
{
|
|||
|
self.Level = 0;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|