using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
public class SkillConfigMo
{
#region ' 属性 '
///
/// 编号
///
public int id { get; set; }
public int baseId { get; set; }
public string name { get; set; }
public int level { get; set; }
public int type { get; set; }
public int attrType { get; set; }
public int damageType { get; set; }
public int actType { get; set; }
public int damageValue { get; set; }
public int actEffType { get; set; }
public string actEffValue { get; set; }
public int ratio1 { get; set; }
public int ratio2 { get; set; }
public int inc { get; set; }
///
///
///
public string actShow { get; set; }
public int islmm { get; set; }
public int effType { get; set; }
public int effParam { get; set; }
///
///
///
public int costEnergyPoint { get; set; }
///
///
///
public int cd { get; set; }
public double moveDis { get; set; }
public double moveSpeed { get; set; }
public int hitCount { get; set; }
public double attackRadius { get; set; }
public double attackAngle { get; set; }
public double delayTime { get; set; }
public string effShow { get; set; }
public string icon { get; set; }
public string des { get; set; }
public string unlockAttr { get; set; }
public int unlockChips { get; set; }
public int unlockChipId { get; set; }
///
/// 蓄力时间(s)
///
public int xulishijian { get; set; }
#endregion
#region ' 方法 '
public E_SkillType sType
{
get
{
return (E_SkillType)type;
}
}
public E_SkillActType sActType
{
get
{
return (E_SkillActType)actType;
}
}
public E_SkillAttrType sAttrType
{
get
{
return (E_SkillAttrType)attrType;
}
}
public E_SkillDamageType sDamageType
{
get
{
return (E_SkillDamageType)damageType;
}
}
public E_SkillEffType sEffType
{
get
{
return (E_SkillEffType)effType;
}
}
public Vector3 sActEffValue
{
get
{
Vector3 vec3;
if (actEffValue == null || actEffValue == "")
{
vec3 = Vector3.zero;
}
else
{
string[] str = actEffValue.Split(new char[] { ',' });
vec3 = new Vector3(float.Parse(str[0]), float.Parse(str[1]), float.Parse(str[2]));
}
return vec3;
}
}
///
/// islmm转成bool
///
///
public bool IsLmm() { return islmm != 0; }
///
/// 尚未解锁, 空或者类型不是必杀的必定解锁
///
/// boolean
public bool IsLocked()
{
if (sActType != E_SkillActType.Unique || // 非必杀技,无需解锁
string.IsNullOrEmpty(unlockAttr)) // 未配置解锁条件
{
return false;
}
//if (req.user.skillInfo.IsSkillUnLocked(id))
//{
// return false;
//}
return true;
//return KVList.parser(unlockAttr).ToList()
// .Exists(i => req.user.baseInfo.getAttrLevel((EAttrType)i.Key) < i.Value);
}
///
/// 是否满足解锁属性要求
///
/// 提示信息
///
public bool IsUnlockAttrOK(out string msg)
{
msg = "";
//if (string.IsNullOrEmpty(unlockAttr)) // 未配置解锁条件
//{
// return true; // 那就ok
//}
//var lst = KVList.parser(unlockAttr).ToList();
//if (lst.All(i => req.user.baseInfo.getAttrLevel((EAttrType)i.Key) >= i.Value))
//{
// return true;
//}
//msg += "需要";
//msg += lst.Where(i => req.user.baseInfo.getAttrLevel((EAttrType)i.Key) < i.Value)
// .Select(i =>
// {
// var x = UserProxy.i.UserData();
// var y = x.getAttrLevel((EAttrType)i.Key);
// return y.name + string.Format("{0}级", i.Value);
// })
// .ToList().Implode("、");
return false;
//return KVList.parser(unlockAttr).ToList()
// .All(i => req.user.baseInfo.getAttrLevel((EAttrType)i.Key) >= i.Value);
}
///
/// 是否满足解锁碎片数量要求
///
///
public bool IsUnlockChipsOk()
{
//return unlockChips <= req.user.skillInfo.HasSkillChips(id);
return true;
}
///
/// 是否满足技能升级属性要求
///
///
///
public bool IsUpgradeAttrOk(out string msg)
{
msg = "";
//var skl = SkillLevelConfigMo.GetBattleSkillLevelConfigMo(id);
//if (null == skl || string.IsNullOrEmpty(skl.attr))
//{
// return true;
//}
//var u = UserProxy.i.UserData();
//var lst = KVList.parser(skl.attr).ToList();
//if (lst.All(i => u.getAttrLevel((EAttrType)i.Key).attrLevel >= i.Value))
//{
// return true;
//}
//msg += "需要";
//msg += lst.Where(i => u.getAttrLevel((EAttrType)i.Key).attrLevel < i.Value)
// .Select(i => u.getAttrLevel((EAttrType)i.Key).name + string.Format("{0}级", i.Value))
// .ToList().Implode("、");
return false;
}
///
///是否满足技能升级碎片数量要求
///
///
public bool IsUpgradeChipsOk()
{
//var skl = SkillLevelConfigMo.GetBattleSkillLevelConfigMo(id);
//if (null == skl || string.IsNullOrEmpty(skl.result)) // 找不到或者未配置
//{
// return true;
//}
//return skl.chips <= req.user.skillInfo.HasSkillChips(id);
return true;
}
///
/// 是否最大等级(技能等级表result字段未填则没有下一级(最大级了))
///
///
public bool isMaxLv()
{
//var skl = SkillLevelConfigMo.GetBattleSkillLevelConfigMo(id);
//if (null == skl || string.IsNullOrEmpty(skl.result))
//{
// return true;
//}
return false;
}
#endregion
#region ' 静态方法 '
public static SkillConfigMo GetBattleSkillConfigMo(int id)
{
return new SkillConfigMo();
}
#endregion
#region ' 辅助方法 '
#endregion
}