You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.2 KiB
44 lines
1.2 KiB
3 years ago
|
namespace ET
|
||
|
{
|
||
|
[FriendClass(typeof(Skill))]
|
||
|
public static class SkillSystem
|
||
|
{
|
||
|
public static void FromMessage(this Skill self, SkillProto skillProto)
|
||
|
{
|
||
|
self.Id = skillProto.Id;
|
||
|
self.ConfigId = skillProto.ConfigId;
|
||
|
self.Level = skillProto.Level;
|
||
|
self.CoolTime = skillProto.CoolTime;
|
||
|
}
|
||
|
|
||
|
public static SkillProto ToMessage(this Skill self)
|
||
|
{
|
||
|
SkillProto skillProto=new SkillProto();
|
||
|
skillProto.Id = self.Id;
|
||
|
skillProto.Level = self.Level;
|
||
|
skillProto.ConfigId = self.ConfigId;
|
||
|
skillProto.CoolTime = self.CoolTime;
|
||
|
return skillProto;
|
||
|
}
|
||
|
|
||
|
public static void CloneSkill(this Skill self, Skill otherSkill)
|
||
|
{
|
||
|
self.Level = otherSkill.Level;
|
||
|
self.ConfigId = otherSkill.ConfigId;
|
||
|
self.CoolTime = otherSkill.CoolTime;
|
||
|
}
|
||
|
|
||
|
public static void ResetCd(this Skill self)
|
||
|
{
|
||
|
self.CoolTime = self.Config.CDParameter;
|
||
|
}
|
||
|
|
||
|
public static void CdOneTime(this Skill self)
|
||
|
{
|
||
|
if (self.CoolTime > 0)
|
||
|
{
|
||
|
self.CoolTime--;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|