SkillConfigMo.cs 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using UnityEngine;
  6. public class SkillConfigMo
  7. {
  8. #region ' 属性 '
  9. /// <summary>
  10. /// 编号
  11. /// </summary>
  12. public int id { get; set; }
  13. public int baseId { get; set; }
  14. public string name { get; set; }
  15. public int level { get; set; }
  16. public int type { get; set; }
  17. public int attrType { get; set; }
  18. public int damageType { get; set; }
  19. public int actType { get; set; }
  20. public int damageValue { get; set; }
  21. public int actEffType { get; set; }
  22. public string actEffValue { get; set; }
  23. public int ratio1 { get; set; }
  24. public int ratio2 { get; set; }
  25. public int inc { get; set; }
  26. /// <summary>
  27. ///
  28. /// </summary>
  29. public string actShow { get; set; }
  30. public int islmm { get; set; }
  31. public int effType { get; set; }
  32. public int effParam { get; set; }
  33. /// <summary>
  34. ///
  35. /// </summary>
  36. public int costEnergyPoint { get; set; }
  37. /// <summary>
  38. ///
  39. /// </summary>
  40. public int cd { get; set; }
  41. public double moveDis { get; set; }
  42. public double moveSpeed { get; set; }
  43. public int hitCount { get; set; }
  44. public double attackRadius { get; set; }
  45. public double attackAngle { get; set; }
  46. public double delayTime { get; set; }
  47. public string effShow { get; set; }
  48. public string icon { get; set; }
  49. public string des { get; set; }
  50. public string unlockAttr { get; set; }
  51. public int unlockChips { get; set; }
  52. public int unlockChipId { get; set; }
  53. /// <summary>
  54. /// 蓄力时间(s)
  55. /// </summary>
  56. public int xulishijian { get; set; }
  57. #endregion
  58. #region ' 方法 '
  59. public E_SkillType sType
  60. {
  61. get
  62. {
  63. return (E_SkillType)type;
  64. }
  65. }
  66. public E_SkillActType sActType
  67. {
  68. get
  69. {
  70. return (E_SkillActType)actType;
  71. }
  72. }
  73. public E_SkillAttrType sAttrType
  74. {
  75. get
  76. {
  77. return (E_SkillAttrType)attrType;
  78. }
  79. }
  80. public E_SkillDamageType sDamageType
  81. {
  82. get
  83. {
  84. return (E_SkillDamageType)damageType;
  85. }
  86. }
  87. public E_SkillEffType sEffType
  88. {
  89. get
  90. {
  91. return (E_SkillEffType)effType;
  92. }
  93. }
  94. public Vector3 sActEffValue
  95. {
  96. get
  97. {
  98. Vector3 vec3;
  99. if (actEffValue == null || actEffValue == "")
  100. {
  101. vec3 = Vector3.zero;
  102. }
  103. else
  104. {
  105. string[] str = actEffValue.Split(new char[] { ',' });
  106. vec3 = new Vector3(float.Parse(str[0]), float.Parse(str[1]), float.Parse(str[2]));
  107. }
  108. return vec3;
  109. }
  110. }
  111. /// <summary>
  112. /// islmm转成bool
  113. /// </summary>
  114. /// <returns></returns>
  115. public bool IsLmm() { return islmm != 0; }
  116. /// <summary>
  117. /// 尚未解锁, 空或者类型不是必杀的必定解锁
  118. /// </summary>
  119. /// <returns>boolean</returns>
  120. public bool IsLocked()
  121. {
  122. if (sActType != E_SkillActType.Unique || // 非必杀技,无需解锁
  123. string.IsNullOrEmpty(unlockAttr)) // 未配置解锁条件
  124. {
  125. return false;
  126. }
  127. //if (req.user.skillInfo.IsSkillUnLocked(id))
  128. //{
  129. // return false;
  130. //}
  131. return true;
  132. //return KVList<int, int>.parser(unlockAttr).ToList()
  133. // .Exists(i => req.user.baseInfo.getAttrLevel((EAttrType)i.Key) < i.Value);
  134. }
  135. /// <summary>
  136. /// 是否满足解锁属性要求
  137. /// </summary>
  138. /// <param name="msg">提示信息</param>
  139. /// <returns></returns>
  140. public bool IsUnlockAttrOK(out string msg)
  141. {
  142. msg = "";
  143. //if (string.IsNullOrEmpty(unlockAttr)) // 未配置解锁条件
  144. //{
  145. // return true; // 那就ok
  146. //}
  147. //var lst = KVList<int, int>.parser(unlockAttr).ToList();
  148. //if (lst.All(i => req.user.baseInfo.getAttrLevel((EAttrType)i.Key) >= i.Value))
  149. //{
  150. // return true;
  151. //}
  152. //msg += "需要";
  153. //msg += lst.Where(i => req.user.baseInfo.getAttrLevel((EAttrType)i.Key) < i.Value)
  154. // .Select(i =>
  155. // {
  156. // var x = UserProxy.i.UserData();
  157. // var y = x.getAttrLevel((EAttrType)i.Key);
  158. // return y.name + string.Format("{0}级", i.Value);
  159. // })
  160. // .ToList().Implode("、");
  161. return false;
  162. //return KVList<int, int>.parser(unlockAttr).ToList()
  163. // .All(i => req.user.baseInfo.getAttrLevel((EAttrType)i.Key) >= i.Value);
  164. }
  165. /// <summary>
  166. /// 是否满足解锁碎片数量要求
  167. /// </summary>
  168. /// <returns></returns>
  169. public bool IsUnlockChipsOk()
  170. {
  171. //return unlockChips <= req.user.skillInfo.HasSkillChips(id);
  172. return true;
  173. }
  174. /// <summary>
  175. /// 是否满足技能升级属性要求
  176. /// </summary>
  177. /// <param name="msg"></param>
  178. /// <returns></returns>
  179. public bool IsUpgradeAttrOk(out string msg)
  180. {
  181. msg = "";
  182. //var skl = SkillLevelConfigMo.GetBattleSkillLevelConfigMo(id);
  183. //if (null == skl || string.IsNullOrEmpty(skl.attr))
  184. //{
  185. // return true;
  186. //}
  187. //var u = UserProxy.i.UserData();
  188. //var lst = KVList<int, int>.parser(skl.attr).ToList();
  189. //if (lst.All(i => u.getAttrLevel((EAttrType)i.Key).attrLevel >= i.Value))
  190. //{
  191. // return true;
  192. //}
  193. //msg += "需要";
  194. //msg += lst.Where(i => u.getAttrLevel((EAttrType)i.Key).attrLevel < i.Value)
  195. // .Select(i => u.getAttrLevel((EAttrType)i.Key).name + string.Format("{0}级", i.Value))
  196. // .ToList().Implode("、");
  197. return false;
  198. }
  199. /// <summary>
  200. ///是否满足技能升级碎片数量要求
  201. /// </summary>
  202. /// <returns></returns>
  203. public bool IsUpgradeChipsOk()
  204. {
  205. //var skl = SkillLevelConfigMo.GetBattleSkillLevelConfigMo(id);
  206. //if (null == skl || string.IsNullOrEmpty(skl.result)) // 找不到或者未配置
  207. //{
  208. // return true;
  209. //}
  210. //return skl.chips <= req.user.skillInfo.HasSkillChips(id);
  211. return true;
  212. }
  213. /// <summary>
  214. /// 是否最大等级(技能等级表result字段未填则没有下一级(最大级了))
  215. /// </summary>
  216. /// <returns></returns>
  217. public bool isMaxLv()
  218. {
  219. //var skl = SkillLevelConfigMo.GetBattleSkillLevelConfigMo(id);
  220. //if (null == skl || string.IsNullOrEmpty(skl.result))
  221. //{
  222. // return true;
  223. //}
  224. return false;
  225. }
  226. #endregion
  227. #region ' 静态方法 '
  228. public static SkillConfigMo GetBattleSkillConfigMo(int id)
  229. {
  230. return new SkillConfigMo();
  231. }
  232. #endregion
  233. #region ' 辅助方法 '
  234. #endregion
  235. }