123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using UnityEngine;
- public class SkillConfigMo
- {
- #region ' 属性 '
- /// <summary>
- /// 编号
- /// </summary>
- 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; }
- /// <summary>
- ///
- /// </summary>
- public string actShow { get; set; }
- public int islmm { get; set; }
- public int effType { get; set; }
- public int effParam { get; set; }
- /// <summary>
- ///
- /// </summary>
- public int costEnergyPoint { get; set; }
- /// <summary>
- ///
- /// </summary>
- 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; }
- /// <summary>
- /// 蓄力时间(s)
- /// </summary>
- 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;
- }
- }
- /// <summary>
- /// islmm转成bool
- /// </summary>
- /// <returns></returns>
- public bool IsLmm() { return islmm != 0; }
- /// <summary>
- /// 尚未解锁, 空或者类型不是必杀的必定解锁
- /// </summary>
- /// <returns>boolean</returns>
- 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<int, int>.parser(unlockAttr).ToList()
- // .Exists(i => req.user.baseInfo.getAttrLevel((EAttrType)i.Key) < i.Value);
- }
- /// <summary>
- /// 是否满足解锁属性要求
- /// </summary>
- /// <param name="msg">提示信息</param>
- /// <returns></returns>
- public bool IsUnlockAttrOK(out string msg)
- {
- msg = "";
- //if (string.IsNullOrEmpty(unlockAttr)) // 未配置解锁条件
- //{
- // return true; // 那就ok
- //}
- //var lst = KVList<int, int>.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<int, int>.parser(unlockAttr).ToList()
- // .All(i => req.user.baseInfo.getAttrLevel((EAttrType)i.Key) >= i.Value);
- }
- /// <summary>
- /// 是否满足解锁碎片数量要求
- /// </summary>
- /// <returns></returns>
- public bool IsUnlockChipsOk()
- {
- //return unlockChips <= req.user.skillInfo.HasSkillChips(id);
- return true;
- }
- /// <summary>
- /// 是否满足技能升级属性要求
- /// </summary>
- /// <param name="msg"></param>
- /// <returns></returns>
- 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<int, int>.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;
- }
- /// <summary>
- ///是否满足技能升级碎片数量要求
- /// </summary>
- /// <returns></returns>
- 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;
- }
- /// <summary>
- /// 是否最大等级(技能等级表result字段未填则没有下一级(最大级了))
- /// </summary>
- /// <returns></returns>
- 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
- }
|