GameCollectYanling.cs 45 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384
  1. using Newtonsoft.Json.Linq;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. /// <summary>
  5. /// 言灵容器
  6. /// </summary>
  7. public class GameCollectYanling
  8. {
  9. /// <summary>
  10. /// 言灵集合
  11. /// </summary>
  12. public Dictionary<int, UserYanlingVo> items = new Dictionary<int, UserYanlingVo>();
  13. /// <summary>
  14. /// 言灵记录
  15. /// </summary>
  16. public List<string> yanlingRecord = new List<string>();
  17. /// <summary>
  18. /// 查询当前英雄可用的言灵列表
  19. /// </summary>
  20. /// <param name="heroTypeid"></param>
  21. /// <returns></returns>
  22. public List<UserYanlingVo> FindUseableYanlings(int heroTypeid)
  23. {
  24. var li = new List<UserYanlingVo>();
  25. foreach (var kv in items)
  26. {
  27. var mo = sm_item_yanling.GetMoById(int.Parse(kv.Value.typeId));
  28. if (null != mo)
  29. {
  30. if (mo.CanbeUsedForHero(heroTypeid))
  31. {
  32. li.Add(kv.Value);
  33. }
  34. }
  35. }
  36. return li;
  37. }
  38. /// <summary>
  39. /// 初始化言灵数据
  40. /// </summary>
  41. /// <param name="store"></param>
  42. public void InitItemData(JObject store)
  43. {
  44. if (store["yanling"] != null)
  45. {
  46. // {uid:{typeId:"",level:x,...},uid:{...},...}
  47. items = store["yanling"].ToObject<Dictionary<int, UserYanlingVo>>();
  48. foreach (var kv in items)
  49. {
  50. kv.Value.uid = kv.Key.ToString();
  51. }
  52. }
  53. if (store["yanlingRecord"] != null)
  54. {
  55. this.yanlingRecord.Clear();
  56. JArray arr = JArray.Parse(store["yanlingRecord"].ToString());
  57. foreach (JToken id in arr)
  58. {
  59. this.yanlingRecord.Add(id.ToString());
  60. }
  61. }
  62. }
  63. }
  64. /// <summary>
  65. /// 玩家言灵数据结构
  66. /// </summary>
  67. public class UserYanlingVo : ItemVo
  68. {
  69. /// <summary>
  70. /// 模板id
  71. /// </summary>
  72. //public int typeId;
  73. /// <summary>
  74. /// 装备此言灵的英雄的id, 默认0
  75. /// </summary>
  76. public int herouid;
  77. // todo: 其它字段带补充(后期加入强化后 --王刚2020年1月2日14:13:59)
  78. /// <summary>
  79. /// 当前等阶 2020.7.29 刘海要求改为0 20220512
  80. /// </summary>
  81. public int grade = 0;
  82. /// <summary>
  83. /// 等级
  84. /// </summary>
  85. public int level;
  86. /// <summary>
  87. /// 言灵星级
  88. /// </summary>
  89. public int starLv;
  90. /// <summary>
  91. /// 言灵当前经验
  92. /// </summary>
  93. public int exp;
  94. /// <summary>
  95. /// 镶嵌的宝石--没有镶嵌默认为0
  96. /// </summary>
  97. public int gemId;
  98. /// <summary>
  99. /// 升下一等级的经验
  100. /// </summary>
  101. public int nextExp
  102. {
  103. get
  104. {
  105. if (this.starLimitLv == this.level)
  106. {
  107. return exp;
  108. }
  109. var mo = GameConfigData.Ins.GetyanlingLevel_typeMo(sm_item_base.GetMoById(int.Parse(this.typeId)).quality, this.level + 1);
  110. if (mo != null)
  111. {
  112. return mo.requiredExp;
  113. }
  114. var lastMo = GameConfigData.Ins.GetyanlingLevel_typeMo(sm_item_base.GetMoById(int.Parse(this.typeId)).quality, this.level);
  115. if (lastMo != null)
  116. {
  117. return mo.requiredExp;
  118. }
  119. return 0;
  120. }
  121. }
  122. /// <summary>
  123. /// 当前星级限制的等级
  124. /// </summary>
  125. public int starLimitLv
  126. {
  127. get
  128. {
  129. sm_yanlingextra_level mo = sm_yanlingextra_level.GetMoById(int.Parse(this.typeId), this.starLv);
  130. if (mo == null)
  131. {
  132. return 0;
  133. }
  134. return mo.promoteLv;
  135. }
  136. }
  137. /// <summary>
  138. /// 突破的玩家等级限制
  139. /// </summary>
  140. public int userLimitLv
  141. {
  142. get
  143. {
  144. if (this.starLv >= 5)
  145. {
  146. return 0;
  147. }
  148. sm_yanlingextra_level mo = sm_yanlingextra_level.GetMoById(int.Parse(this.typeId), this.starLv + 1);
  149. return mo.userlvLimit;
  150. }
  151. }
  152. /// <summary>
  153. /// 突破后的星级等级限制
  154. /// </summary>
  155. public int lastStarLimitLv_Tupo
  156. {
  157. get
  158. {
  159. if (this.starLv >= 5)
  160. {
  161. return 0;
  162. }
  163. sm_yanlingextra_level mo = sm_yanlingextra_level.GetMoById(int.Parse(this.typeId), this.starLv + 1);
  164. if (mo == null)
  165. {
  166. return 0;
  167. }
  168. return mo.promoteLv;
  169. }
  170. }
  171. /// <summary>
  172. /// 是不是升级按钮 true:是
  173. /// </summary>
  174. public bool isUpgrade
  175. {
  176. get
  177. {
  178. if (this.starLv >= 5)
  179. {
  180. return true;
  181. }
  182. //&& UserProxy.Instance.player.baseInfo.level >= sm_heroextra_level_tupo.GetMoById(int.Parse(this.typeId), this.curStar + 1).userlvLimit
  183. if (this.level >= this.starLimitLv)
  184. {
  185. return false;
  186. }
  187. return true;
  188. }
  189. }
  190. /// <summary>
  191. /// 升级需要的材料道具
  192. /// </summary>
  193. public List<ItemVo> costItem_Upgrade
  194. {
  195. get
  196. {
  197. List<ItemVo> list = new List<ItemVo>();
  198. if (this.starLv >= 5)
  199. {
  200. return list;
  201. }
  202. List<sm_item_stones_type> stonelist = sm_item_stones_type.getItemStoneList(Enum_CostItemStonesType.YanLing);
  203. if (stonelist.Count == 0)
  204. {
  205. return list;
  206. }
  207. Dictionary<string, ItemVo> collectItemDic = UserProxy.Instance.player.collectItem.collectItemDic;
  208. foreach (sm_item_stones_type item in stonelist)
  209. {
  210. string typeId = item.typeId.ToString();
  211. foreach (KeyValuePair<string, ItemVo> kv in collectItemDic)
  212. {
  213. if (kv.Value.typeId == typeId)
  214. {
  215. ItemVo itVo = new ItemVo();
  216. itVo.typeId = typeId;
  217. itVo.count = kv.Value.count;
  218. list.Add(itVo);
  219. }
  220. }
  221. }
  222. return list;
  223. }
  224. }
  225. /// <summary>
  226. /// 消耗的道具----突破
  227. /// </summary>
  228. public List<ItemVo> costItem_tupo
  229. {
  230. get
  231. {
  232. List<ItemVo> list = new List<ItemVo>();
  233. if (this.starLv >= 5)
  234. {
  235. return list;
  236. }
  237. sm_yanlingextra_level mo = sm_yanlingextra_level.GetMoById(int.Parse(this.typeId), this.starLv + 1);
  238. string[] sList = mo.costItems.Split(';');
  239. foreach (string item in sList)
  240. {
  241. string[] str = item.Split(',');
  242. ItemVo vo = new ItemVo();
  243. vo.typeId = str[0];
  244. vo.count = int.Parse(str[1]);
  245. list.Add(vo);
  246. }
  247. return list;
  248. }
  249. }
  250. /// <summary>
  251. /// 当前星级经验
  252. /// </summary>
  253. public int curStarExp;
  254. /// <summary>
  255. /// 当前星升下一星需要的最大经验------------------废弃
  256. /// </summary>
  257. public int maxStarExp
  258. {
  259. get
  260. {
  261. return sm_item_yanling.GetMoById(int.Parse(this.typeId)).maxStarExp;
  262. }
  263. }
  264. public int costGold_tupo
  265. {
  266. get
  267. {
  268. if (this.starLv >= 5)
  269. {
  270. return 0;
  271. }
  272. sm_yanlingextra_level mo = sm_yanlingextra_level.GetMoById(int.Parse(this.typeId), this.starLv + 1);
  273. return mo.gold;
  274. }
  275. }
  276. /// <summary>
  277. /// 战力
  278. /// </summary>
  279. public int fightPower
  280. {
  281. get
  282. {
  283. float power = 0;
  284. Dictionary<EHeroProperties, int> baseAttr = this.baseAttr;
  285. Dictionary<EHeroAddProperties, int> rAttr = this.randAttr;
  286. Dictionary<EHeroAddProperties, int> gRandAttr = this.gemrRandAttr;
  287. List<yanlingComposeDataVo> ylComposeAttr = this.yanlingComposeAttr;
  288. foreach (KeyValuePair<EHeroProperties,int>kv in baseAttr)
  289. {
  290. int add = 0;
  291. if (kv.Key == EHeroProperties.HP)
  292. {
  293. if (rAttr.ContainsKey(EHeroAddProperties.additional_hpUpperlimit))
  294. {
  295. add += rAttr[EHeroAddProperties.additional_hpUpperlimit];
  296. }
  297. if (gRandAttr.ContainsKey(EHeroAddProperties.additional_hpUpperlimit))
  298. {
  299. add += gRandAttr[EHeroAddProperties.additional_hpUpperlimit];
  300. }
  301. if (ylComposeAttr.Count != 0)
  302. {
  303. foreach (yanlingComposeDataVo vo in ylComposeAttr)
  304. {
  305. if (vo.isShow == false)
  306. {
  307. continue;
  308. }
  309. if (vo.attr == EHeroAddProperties.additional_hpUpperlimit)
  310. {
  311. add += vo.val;
  312. }
  313. }
  314. }
  315. }
  316. else if (kv.Key == EHeroProperties.NENGLIANGZHI)
  317. {
  318. if (rAttr.ContainsKey(EHeroAddProperties.additional_manaUpperlimit))
  319. {
  320. add += rAttr[EHeroAddProperties.additional_manaUpperlimit];
  321. }
  322. if (gRandAttr.ContainsKey(EHeroAddProperties.additional_manaUpperlimit))
  323. {
  324. add += gRandAttr[EHeroAddProperties.additional_manaUpperlimit];
  325. }
  326. if (ylComposeAttr.Count != 0)
  327. {
  328. foreach (yanlingComposeDataVo vo in ylComposeAttr)
  329. {
  330. if (vo.isShow == false)
  331. {
  332. continue;
  333. }
  334. if (vo.attr == EHeroAddProperties.additional_manaUpperlimit)
  335. {
  336. add += vo.val;
  337. }
  338. }
  339. }
  340. }
  341. else if (kv.Key == EHeroProperties.WULIGONGJI)
  342. {
  343. if (rAttr.ContainsKey(EHeroAddProperties.additional_phyDamage))
  344. {
  345. add += rAttr[EHeroAddProperties.additional_phyDamage];
  346. }
  347. if (gRandAttr.ContainsKey(EHeroAddProperties.additional_phyDamage))
  348. {
  349. add += gRandAttr[EHeroAddProperties.additional_phyDamage];
  350. }
  351. if (ylComposeAttr.Count != 0)
  352. {
  353. foreach (yanlingComposeDataVo vo in ylComposeAttr)
  354. {
  355. if (vo.isShow == false)
  356. {
  357. continue;
  358. }
  359. if (vo.attr == EHeroAddProperties.additional_phyDamage)
  360. {
  361. add += vo.val;
  362. }
  363. }
  364. }
  365. }
  366. else if (kv.Key == EHeroProperties.FANGYUHUJIA)
  367. {
  368. if (rAttr.ContainsKey(EHeroAddProperties.additional_phyDefend))
  369. {
  370. add += rAttr[EHeroAddProperties.additional_phyDefend];
  371. }
  372. if (gRandAttr.ContainsKey(EHeroAddProperties.additional_phyDefend))
  373. {
  374. add += gRandAttr[EHeroAddProperties.additional_phyDefend];
  375. }
  376. if (ylComposeAttr.Count != 0)
  377. {
  378. foreach (yanlingComposeDataVo vo in ylComposeAttr)
  379. {
  380. if (vo.isShow == false)
  381. {
  382. continue;
  383. }
  384. if (vo.attr == EHeroAddProperties.additional_phyDefend)
  385. {
  386. add += vo.val;
  387. }
  388. }
  389. }
  390. }
  391. else if (kv.Key == EHeroProperties.CRICITAL)
  392. {
  393. if (rAttr.ContainsKey(EHeroAddProperties.additional_critDamage))
  394. {
  395. add += rAttr[EHeroAddProperties.additional_critDamage];
  396. }
  397. if (gRandAttr.ContainsKey(EHeroAddProperties.additional_critDamage))
  398. {
  399. add += gRandAttr[EHeroAddProperties.additional_critDamage];
  400. }
  401. if (ylComposeAttr.Count != 0)
  402. {
  403. foreach (yanlingComposeDataVo vo in ylComposeAttr)
  404. {
  405. if (vo.isShow == false)
  406. {
  407. continue;
  408. }
  409. if (vo.attr == EHeroAddProperties.additional_critDamage)
  410. {
  411. add += vo.val;
  412. }
  413. }
  414. }
  415. }
  416. else if (kv.Key == EHeroProperties.FASHUQIANGDU)
  417. {
  418. if (rAttr.ContainsKey(EHeroAddProperties.additional_magDamage))
  419. {
  420. add += rAttr[EHeroAddProperties.additional_magDamage];
  421. }
  422. if (gRandAttr.ContainsKey(EHeroAddProperties.additional_magDamage))
  423. {
  424. add += gRandAttr[EHeroAddProperties.additional_magDamage];
  425. }
  426. if (ylComposeAttr.Count != 0)
  427. {
  428. foreach (yanlingComposeDataVo vo in ylComposeAttr)
  429. {
  430. if (vo.isShow == false)
  431. {
  432. continue;
  433. }
  434. if (vo.attr == EHeroAddProperties.additional_magDamage)
  435. {
  436. add += vo.val;
  437. }
  438. }
  439. }
  440. }
  441. else if (kv.Key == EHeroProperties.MOFAKANGXING)
  442. {
  443. if (rAttr.ContainsKey(EHeroAddProperties.additional_magDefend))
  444. {
  445. add += rAttr[EHeroAddProperties.additional_magDefend];
  446. }
  447. if (gRandAttr.ContainsKey(EHeroAddProperties.additional_magDefend))
  448. {
  449. add += gRandAttr[EHeroAddProperties.additional_magDefend];
  450. }
  451. if (ylComposeAttr.Count != 0)
  452. {
  453. foreach (yanlingComposeDataVo vo in ylComposeAttr)
  454. {
  455. if (vo.isShow == false)
  456. {
  457. continue;
  458. }
  459. if (vo.attr == EHeroAddProperties.additional_magDefend)
  460. {
  461. add += vo.val;
  462. }
  463. }
  464. }
  465. }
  466. power += 1.0f * add / 100 * kv.Value + kv.Value;
  467. }
  468. //sm_yanlingextra_level mo = sm_yanlingextra_level.GetMoById(int.Parse(this.typeId), this.starLv);
  469. //生命
  470. //int hp = mo.hp + (this.level - 1) * mo.hpRate;
  471. //暴击
  472. //int crit = mo.baoji + (this.level - 1) * mo.baojiRate;
  473. //物理攻击
  474. //int phyAtk = mo.wuligongji + (this.level - 1) * mo.wuligongjiRate;
  475. //防御护甲
  476. //int phyDef = mo.fangyuhujia + (this.level - 1) * mo.fangyuhujiaRate;
  477. //攻击速度
  478. //int atkSpeed = mo.gongjisudu + (this.level - 1) * mo.gongjisuduRate;
  479. //法术强度
  480. //int fashuqiangdu = mo.fashuqiangdu + (this.level - 1) * mo.fashuqiangduRate;
  481. //魔法抗性
  482. //int mofakangxing = mo.mofakangxing + (this.level - 1) * mo.mofakangxingRate;
  483. ////生命
  484. //int hp = this.Mo().GetYanlingExt().hpBase + (this.level - 1) * this.Mo().GetYanlingExt().hpRate;
  485. ////暴击
  486. //int crit = this.Mo().GetYanlingExt().critBase + (this.level - 1) * this.Mo().GetYanlingExt().critRate;
  487. ////物理攻击
  488. //int phyAtk = this.Mo().GetYanlingExt().phyAtkBase + (this.level - 1) * this.Mo().GetYanlingExt().phyAtkRate;
  489. ////防御护甲
  490. //int phyDef = this.Mo().GetYanlingExt().phyDefBase + (this.level - 1) * this.Mo().GetYanlingExt().phyDefRate;
  491. ////攻击速度
  492. //int atkSpeed = this.Mo().GetYanlingExt().atkSpeedBase + (this.level - 1) * this.Mo().GetYanlingExt().atkSpeedRate;
  493. ////法术强度
  494. //int fashuqiangdu = this.Mo().GetYanlingExt().fashuqiangduBase + (this.level - 1) * this.Mo().GetYanlingExt().fashuqiangduRate;
  495. ////魔法抗性
  496. //int mofakangxing = this.Mo().GetYanlingExt().mofakangxingBase + (this.level - 1) * this.Mo().GetYanlingExt().mofakangxingRate;
  497. return (int)power;
  498. }
  499. }
  500. /// <summary>
  501. /// 基础属性---总览属性,升级
  502. /// </summary>
  503. public Dictionary<EHeroProperties, int> baseAttr
  504. {
  505. get
  506. {
  507. Dictionary<EHeroProperties, int> attr = new Dictionary<EHeroProperties, int>();
  508. sm_yanlingextra_level mo = sm_yanlingextra_level.GetMoById(int.Parse(this.typeId), this.starLv);
  509. //生命
  510. int hp = mo.hp + (this.level - 1) * mo.hpRate;
  511. if (hp != 0)
  512. {
  513. attr[EHeroProperties.HP] = hp;
  514. }
  515. //Mp 能量值
  516. int nengliangzhi = mo.nengliangzhi + (this.level - 1) * mo.nengliangzhiRate;
  517. if (nengliangzhi != 0)
  518. {
  519. attr[EHeroProperties.NENGLIANGZHI] = nengliangzhi;
  520. }
  521. //物理攻击
  522. int phyAtk = mo.wuligongji + (this.level - 1) * mo.wuligongjiRate;
  523. if (phyAtk != 0)
  524. {
  525. attr[EHeroProperties.WULIGONGJI] = phyAtk;
  526. }
  527. //防御护甲
  528. int phyDef = mo.fangyuhujia + (this.level - 1) * mo.fangyuhujiaRate;
  529. if (phyDef != 0)
  530. {
  531. attr[EHeroProperties.FANGYUHUJIA] = phyDef;
  532. }
  533. ////攻击速度
  534. //int atkSpeed = mo.gongjisudu + (this.level - 1) * mo.gongjisuduRate;
  535. //if (atkSpeed != 0)
  536. //{
  537. // attr[EHeroProperties.ATKSPEED] = atkSpeed;
  538. //}
  539. //法术强度
  540. int fashuqiangdu = mo.fashuqiangdu + (this.level - 1) * mo.fashuqiangduRate;
  541. if (fashuqiangdu != 0)
  542. {
  543. attr[EHeroProperties.FASHUQIANGDU] = fashuqiangdu;
  544. }
  545. //魔法抗性
  546. int mofakangxing = mo.mofakangxing + (this.level - 1) * mo.mofakangxingRate;
  547. if (mofakangxing != 0)
  548. {
  549. attr[EHeroProperties.MOFAKANGXING] = mofakangxing;
  550. }
  551. //暴击
  552. int crit = mo.baoji + (this.level - 1) * mo.baojiRate;
  553. if (crit != 0)
  554. {
  555. attr[EHeroProperties.CRICITAL] = crit;
  556. }
  557. //抗暴击
  558. int kangbaoji = mo.kangbaoji + (this.level - 1) * mo.kangbaojiRate;
  559. if (kangbaoji != 0)
  560. {
  561. attr[EHeroProperties.KANGBAOJI] = kangbaoji;
  562. }
  563. //言力
  564. int yanli = mo.yanli + (this.level - 1) * mo.yanliRate;
  565. if (yanli != 0)
  566. {
  567. attr[EHeroProperties.YANLI] = yanli;
  568. }
  569. return attr;
  570. //生命
  571. //int hp = this.Mo().GetYanlingExt().hpBase + (this.level - 1) * this.Mo().GetYanlingExt().hpRate;
  572. ////float addHp = hp + hp * (1.0f*this.Mo().GetYanlingExt().additional_hpUpperlimit/100);
  573. //if (hp != 0)
  574. //{
  575. // attr[EHeroProperties.HP] = hp;
  576. //}
  577. ////暴击
  578. //int crit = this.Mo().GetYanlingExt().critBase + (this.level - 1) * this.Mo().GetYanlingExt().critRate;
  579. ////float addCrit = crit + crit * 1.0f * this.Mo().GetYanlingExt().additional_critDamage/100;
  580. //if (crit != 0)
  581. //{
  582. // attr[EHeroProperties.CRICITAL] = crit;
  583. //}
  584. ////物理攻击
  585. //int phyAtk = this.Mo().GetYanlingExt().phyAtkBase + (this.level - 1) * this.Mo().GetYanlingExt().phyAtkRate;
  586. ////float addPhyAtk = phyAtk + phyAtk * 1.0f * this.Mo().GetYanlingExt().additional_phyDamage/100;
  587. //if (phyAtk != 0)
  588. //{
  589. // attr[EHeroProperties.WULIGONGJI] = phyAtk;
  590. //}
  591. ////防御护甲
  592. //int phyDef = this.Mo().GetYanlingExt().phyDefBase + (this.level - 1) * this.Mo().GetYanlingExt().phyDefRate;
  593. ////float addPhyDef = phyDef + phyDef * 1.0f * this.Mo().GetYanlingExt().additional_phyDefend/100;
  594. //if (phyDef != 0)
  595. //{
  596. // attr[EHeroProperties.FANGYUHUJIA] = phyDef;
  597. //}
  598. ////攻击速度
  599. //int atkSpeed = this.Mo().GetYanlingExt().atkSpeedBase + (this.level - 1) * this.Mo().GetYanlingExt().atkSpeedRate;
  600. ////float addAtkSpeed = atkSpeed + atkSpeed * 1.0f * this.Mo().GetYanlingExt().additional_atkSpeed/100;
  601. //if (atkSpeed != 0)
  602. //{
  603. // attr[EHeroProperties.ATKSPEED] = atkSpeed;
  604. //}
  605. ////法术强度
  606. //int fashuqiangdu = this.Mo().GetYanlingExt().fashuqiangduBase + (this.level - 1) * this.Mo().GetYanlingExt().fashuqiangduRate;
  607. //if (fashuqiangdu != 0)
  608. //{
  609. // attr[EHeroProperties.FASHUQIANGDU] = fashuqiangdu;
  610. //}
  611. ////魔法抗性
  612. //int mofakangxing = this.Mo().GetYanlingExt().mofakangxingBase + (this.level - 1) * this.Mo().GetYanlingExt().mofakangxingRate;
  613. //if (mofakangxing != 0)
  614. //{
  615. // attr[EHeroProperties.MOFAKANGXING] = mofakangxing;
  616. //}
  617. return attr;
  618. }
  619. }
  620. /// <summary>
  621. /// 随机属性---总览属性,升级
  622. /// </summary>
  623. public Dictionary<EHeroAddProperties,int> randAttr
  624. {
  625. get
  626. {
  627. Dictionary<EHeroAddProperties, int> randAttr = new Dictionary<EHeroAddProperties, int>();
  628. sm_yanlingextra_level mo = sm_yanlingextra_level.GetMoById(int.Parse(this.typeId), this.starLv);
  629. //hp
  630. int hpUpperlimit = mo.additional_hpUpperlimit;
  631. if (hpUpperlimit != 0)
  632. {
  633. randAttr[EHeroAddProperties.additional_hpUpperlimit] = hpUpperlimit;
  634. }
  635. //言能上限加成----Mp
  636. int manaUpperlimit = mo.additional_manaUpperlimit;
  637. if (manaUpperlimit != 0)
  638. {
  639. randAttr[EHeroAddProperties.additional_manaUpperlimit] = manaUpperlimit;
  640. }
  641. //物攻伤害加成
  642. int phyDamage = mo.additional_phyDamage;
  643. if (phyDamage != 0)
  644. {
  645. randAttr[EHeroAddProperties.additional_phyDamage] = phyDamage;
  646. }
  647. //防御护甲
  648. int phyDefend = mo.additional_phyDefend;
  649. if (phyDefend != 0)
  650. {
  651. randAttr[EHeroAddProperties.additional_phyDefend] = phyDefend;
  652. }
  653. //法术强度
  654. int magDamage = mo.additional_magDamage;
  655. if (magDamage != 0)
  656. {
  657. randAttr[EHeroAddProperties.additional_magDamage] = magDamage;
  658. }
  659. //魔法抗性
  660. int magDefend = mo.additional_magDefend;
  661. if (magDefend != 0)
  662. {
  663. randAttr[EHeroAddProperties.additional_magDefend] = magDefend;
  664. }
  665. //物伤减免加成
  666. int phyDamagereduce = mo.additional_phyDamagereduce;
  667. if (phyDamagereduce != 0)
  668. {
  669. randAttr[EHeroAddProperties.additional_phyDamagereduce] = phyDamagereduce;
  670. }
  671. //言伤减免加成
  672. int magDamagereduce = mo.additional_magDamagereduce;
  673. if (magDamagereduce != 0)
  674. {
  675. randAttr[EHeroAddProperties.additional_magDamagereduce] = magDamagereduce;
  676. }
  677. int monsterExp = mo.additional_monsterExp;
  678. if (monsterExp != 0)
  679. {
  680. randAttr[EHeroAddProperties.additional_monsterExp] = monsterExp;
  681. }
  682. int atkSpeed = mo.additional_atkSpeed;
  683. if (atkSpeed != 0)
  684. {
  685. randAttr[EHeroAddProperties.additional_atkSpeed] = atkSpeed;
  686. }
  687. int moveSpeed = mo.additional_moveSpeed;
  688. if (moveSpeed != 0)
  689. {
  690. randAttr[EHeroAddProperties.additional_moveSpeed] = moveSpeed;
  691. }
  692. int critProbability = mo.additional_critProbability;
  693. if (critProbability != 0)
  694. {
  695. randAttr[EHeroAddProperties.additional_critProbability] = critProbability;
  696. }
  697. int critDamage = mo.additional_critDamage;
  698. if (critDamage != 0)
  699. {
  700. randAttr[EHeroAddProperties.additional_critDamage] = critDamage;
  701. }
  702. return randAttr;
  703. }
  704. }
  705. /// <summary>
  706. /// 宝石加成
  707. /// </summary>
  708. public Dictionary<EHeroAddProperties, int> gemrRandAttr
  709. {
  710. get
  711. {
  712. Dictionary<EHeroAddProperties, int> randAttr = new Dictionary<EHeroAddProperties, int>();
  713. if (this.gemId == 0)
  714. {
  715. return randAttr;
  716. }
  717. sm_gemProperty mo = GameConfigData.Ins.GetgemPropertyMo(this.gemId);
  718. int additional_hpUpperlimit = mo.additional_hpUpperlimit;
  719. if (additional_hpUpperlimit != 0)
  720. {
  721. randAttr[EHeroAddProperties.additional_hpUpperlimit] = additional_hpUpperlimit;
  722. }
  723. int additional_phyDamage = mo.additional_phyDamage;
  724. if (additional_phyDamage != 0)
  725. {
  726. randAttr[EHeroAddProperties.additional_phyDamage] = additional_phyDamage;
  727. }
  728. int additional_magDamage = mo.additional_magDamage;
  729. if (additional_magDamage != 0)
  730. {
  731. randAttr[EHeroAddProperties.additional_magDamage] = additional_magDamage;
  732. }
  733. int additional_critDamage = mo.additional_critDamage;
  734. if (additional_critDamage != 0)
  735. {
  736. randAttr[EHeroAddProperties.additional_critDamage] = additional_critDamage;
  737. }
  738. int skillCoolTs = mo.skillCoolTs;
  739. if (skillCoolTs != 0)
  740. {
  741. randAttr[EHeroAddProperties.skillCoolTs] = skillCoolTs;
  742. }
  743. return randAttr;
  744. }
  745. }
  746. /// <summary>
  747. /// 突破后属性变化值
  748. /// </summary>
  749. public Dictionary<EHeroProperties, int> changeAttr
  750. {
  751. get
  752. {
  753. Dictionary<EHeroProperties, int> attr = new Dictionary<EHeroProperties, int>();
  754. int nextStar = this.starLv + 1;
  755. if (this.starLv >= 5)
  756. {
  757. nextStar = 5;
  758. }
  759. sm_yanlingextra_level mo = sm_yanlingextra_level.GetMoById(int.Parse(this.typeId), nextStar);
  760. //生命
  761. int hp = mo.hp + (this.level - 1) * mo.hpRate;
  762. if (hp != 0)
  763. {
  764. attr[EHeroProperties.HP] = hp;
  765. }
  766. //mp
  767. int mp = mo.nengliangzhi + (this.level - 1) * mo.nengliangzhiRate;
  768. if (mp != 0)
  769. {
  770. attr[EHeroProperties.NENGLIANGZHI] = mp;
  771. }
  772. //物理攻击
  773. int phyAtk = mo.wuligongji + (this.level - 1) * mo.wuligongjiRate;
  774. if (phyAtk != 0)
  775. {
  776. attr[EHeroProperties.WULIGONGJI] = phyAtk;
  777. }
  778. //防御护甲
  779. int phyDef = mo.fangyuhujia + (this.level - 1) * mo.fangyuhujiaRate;
  780. if (phyDef != 0)
  781. {
  782. attr[EHeroProperties.FANGYUHUJIA] = phyDef;
  783. }
  784. //攻击速度
  785. //int atkSpeed = mo.gongjisudu + (this.level - 1) * mo.gongjisuduRate;
  786. //if (atkSpeed != 0)
  787. //{
  788. // attr[EHeroProperties.ATKSPEED] = atkSpeed;
  789. //}
  790. //法术强度
  791. int fashuqiangdu = mo.fashuqiangdu + (this.level - 1) * mo.fashuqiangduRate;
  792. if (fashuqiangdu != 0)
  793. {
  794. attr[EHeroProperties.FASHUQIANGDU] = fashuqiangdu;
  795. }
  796. //魔法抗性
  797. int mofakangxing = mo.mofakangxing + (this.level - 1) * mo.mofakangxingRate;
  798. if (mofakangxing != 0)
  799. {
  800. attr[EHeroProperties.MOFAKANGXING] = mofakangxing;
  801. }
  802. //暴击
  803. int crit = mo.baoji + (this.level - 1) * mo.baojiRate;
  804. if (crit != 0)
  805. {
  806. attr[EHeroProperties.CRICITAL] = crit;
  807. }
  808. //抗暴击
  809. int kangbaoji = mo.kangbaoji + (this.level - 1) * mo.kangbaojiRate;
  810. if (kangbaoji != 0)
  811. {
  812. attr[EHeroProperties.KANGBAOJI] = kangbaoji;
  813. }
  814. //言力
  815. int yanli = mo.yanli + (this.level - 1) * mo.yanliRate;
  816. if (yanli != 0)
  817. {
  818. attr[EHeroProperties.YANLI] = yanli;
  819. }
  820. return attr;
  821. }
  822. }
  823. /// <summary>
  824. /// 言灵升星前后的属性变化--------废弃
  825. /// </summary>
  826. public Dictionary<EHeroProperties, int> addAttr
  827. {
  828. get
  829. {
  830. Dictionary<EHeroProperties, int> attr = new Dictionary<EHeroProperties, int>();
  831. //if (this.starLv >= 5)
  832. //{
  833. // return attr;
  834. //}
  835. //int nextId = this.Mo().GetYanlingExt().nextId;
  836. //sm_item_yanling mo = sm_item_yanling.GetMoById(nextId);
  837. ////生命
  838. //int hp = this.Mo().GetYanlingExt().hpBase + (this.level - 1) * this.Mo().GetYanlingExt().hpRate;
  839. //int newhp = mo.hpBase + (this.level - 1) * mo.hpRate;
  840. //if (newhp - hp != 0)
  841. //{
  842. // attr.Add(EHeroProperties.HP, newhp - hp);
  843. //}
  844. ////暴击
  845. //int crit = this.Mo().GetYanlingExt().critBase + (this.level - 1) * this.Mo().GetYanlingExt().critRate;
  846. //int newcrit = mo.critBase + (this.level - 1) * mo.critRate;
  847. //if (newcrit - crit != 0)
  848. //{
  849. // attr.Add(EHeroProperties.CRICITAL, newcrit - crit);
  850. //}
  851. ////物理攻击
  852. //int phyAtk = this.Mo().GetYanlingExt().phyAtkBase + (this.level - 1) * this.Mo().GetYanlingExt().phyAtkRate;
  853. //int newphyAtk = mo.phyAtkBase + (this.level - 1) * mo.phyAtkRate;
  854. //if (newphyAtk - phyAtk != 0)
  855. //{
  856. // attr.Add(EHeroProperties.WULIGONGJI, newphyAtk - phyAtk);
  857. //}
  858. ////防御护甲
  859. //int phyDef = this.Mo().GetYanlingExt().phyDefBase + (this.level - 1) * this.Mo().GetYanlingExt().phyDefRate;
  860. //int newphyDef = mo.phyDefBase + (this.level - 1) * mo.phyDefRate;
  861. //if (newphyDef - phyDef != 0)
  862. //{
  863. // attr.Add(EHeroProperties.FANGYUHUJIA, newphyDef - phyDef);
  864. //}
  865. ////攻击速度
  866. //int atkSpeed = this.Mo().GetYanlingExt().atkSpeedBase + (this.level - 1) * this.Mo().GetYanlingExt().atkSpeedRate;
  867. //int newatkSpeed = mo.atkSpeedBase + (this.level - 1) * mo.atkSpeedRate;
  868. //if (newatkSpeed - atkSpeed != 0)
  869. //{
  870. // attr.Add(EHeroProperties.ATKSPEED, newatkSpeed - atkSpeed);
  871. //}
  872. ////法术强度
  873. //int fashuqiangdu = this.Mo().GetYanlingExt().fashuqiangduBase + (this.level - 1) * this.Mo().GetYanlingExt().fashuqiangduRate;
  874. //int newfashuqiangdu = mo.fashuqiangduBase + (this.level - 1) * mo.fashuqiangduRate;
  875. //if (newfashuqiangdu - fashuqiangdu != 0)
  876. //{
  877. // attr.Add(EHeroProperties.FASHUQIANGDU, newfashuqiangdu - fashuqiangdu);
  878. //}
  879. ////魔法抗性
  880. //int mofakangxing = this.Mo().GetYanlingExt().mofakangxingBase + (this.level - 1) * this.Mo().GetYanlingExt().mofakangxingRate;
  881. //int newmofakangxing = mo.mofakangxingBase + (this.level - 1) * mo.mofakangxingRate;
  882. //if (newmofakangxing - mofakangxing != 0)
  883. //{
  884. // attr.Add(EHeroProperties.MOFAKANGXING, newmofakangxing - mofakangxing);
  885. //}
  886. return attr;
  887. }
  888. }
  889. /// <summary>
  890. /// 突破后随机属性变化值
  891. /// </summary>
  892. public Dictionary<EHeroAddProperties, int> randAddAttr
  893. {
  894. get
  895. {
  896. Dictionary<EHeroAddProperties, int> randAttr = new Dictionary<EHeroAddProperties, int>();
  897. //if (this.starLv >= 5)
  898. //{
  899. // return randAttr;
  900. //}
  901. //int nextId = this.Mo().GetYanlingExt().nextId;
  902. //sm_item_yanling mo = sm_item_yanling.GetMoById(nextId);
  903. int nextStar = this.starLv + 1;
  904. if (this.starLv >= 5)
  905. {
  906. nextStar = 5;
  907. }
  908. sm_yanlingextra_level mo = sm_yanlingextra_level.GetMoById(int.Parse(this.typeId), nextStar);
  909. if (mo.additional_hpUpperlimit != 0)
  910. {
  911. randAttr[EHeroAddProperties.additional_hpUpperlimit] = mo.additional_hpUpperlimit;
  912. }
  913. int manaUpperlimit = mo.additional_manaUpperlimit;
  914. if (manaUpperlimit != 0)
  915. {
  916. randAttr[EHeroAddProperties.additional_manaUpperlimit] = manaUpperlimit;
  917. }
  918. int phyDamage = mo.additional_phyDamage;
  919. if (phyDamage != 0)
  920. {
  921. randAttr[EHeroAddProperties.additional_phyDamage] = phyDamage;
  922. }
  923. int magDamage = mo.additional_magDamage;
  924. if (magDamage != 0)
  925. {
  926. randAttr[EHeroAddProperties.additional_magDamage] = magDamage;
  927. }
  928. int phyDefend = mo.additional_phyDefend;
  929. if (phyDefend != 0)
  930. {
  931. randAttr[EHeroAddProperties.additional_phyDefend] = phyDefend;
  932. }
  933. int magDefend = mo.additional_magDefend;
  934. if (magDefend != 0)
  935. {
  936. randAttr[EHeroAddProperties.additional_magDefend] = magDefend;
  937. }
  938. int phyDamagereduce = mo.additional_phyDamagereduce;
  939. if (phyDamagereduce != 0)
  940. {
  941. randAttr[EHeroAddProperties.additional_phyDamagereduce] = phyDamagereduce;
  942. }
  943. int magDamagereduce = mo.additional_magDamagereduce;
  944. if (magDamagereduce != 0)
  945. {
  946. randAttr[EHeroAddProperties.additional_magDamagereduce] = magDamagereduce;
  947. }
  948. int monsterExp = mo.additional_monsterExp;
  949. if (monsterExp != 0)
  950. {
  951. randAttr[EHeroAddProperties.additional_monsterExp] = monsterExp;
  952. }
  953. int atkSpeed = mo.additional_atkSpeed;
  954. if (atkSpeed != 0)
  955. {
  956. randAttr[EHeroAddProperties.additional_atkSpeed] = atkSpeed;
  957. }
  958. int moveSpeed = mo.additional_moveSpeed;
  959. if (moveSpeed != 0)
  960. {
  961. randAttr[EHeroAddProperties.additional_moveSpeed] = moveSpeed;
  962. }
  963. int critProbability = mo.additional_critProbability;
  964. if (critProbability != 0)
  965. {
  966. randAttr[EHeroAddProperties.additional_critProbability] = critProbability;
  967. }
  968. int critDamage = mo.additional_critDamage;
  969. if (critDamage != 0)
  970. {
  971. randAttr[EHeroAddProperties.additional_critDamage] = critDamage;
  972. }
  973. return randAttr;
  974. }
  975. }
  976. /// <summary>
  977. /// 言灵套系属性
  978. /// </summary>
  979. public List<yanlingComposeDataVo> yanlingComposeAttr
  980. {
  981. get
  982. {
  983. List<yanlingComposeDataVo> yanlingComposeAttr = new List<yanlingComposeDataVo>();
  984. int composeId = this.nMo.GetYanlingExt().composeId;
  985. if (composeId == 0)
  986. {
  987. return yanlingComposeAttr;
  988. }
  989. sm_yanling_compose mo = GameConfigData.Ins.Getyanling_composeMo(composeId);
  990. if (mo == null)
  991. {
  992. return yanlingComposeAttr;
  993. }
  994. int temp = 0;
  995. if (this.herouid != 0)
  996. {
  997. Dictionary<int, UserYanlingVo> hero_yanling = UserProxy.Instance.player.collectHero.collectHeroDic[this.herouid.ToString()].hero_yanling;
  998. foreach (KeyValuePair<int, UserYanlingVo> kt in hero_yanling)
  999. {
  1000. if (kt.Value.typeId == null)
  1001. {
  1002. continue;
  1003. }
  1004. int id = kt.Value.nMo.GetYanlingExt().composeId;
  1005. if (id == composeId)
  1006. {
  1007. temp += 1;
  1008. }
  1009. }
  1010. }
  1011. string[] twoList = mo.two_compose.Split(',');
  1012. int attrType = int.Parse(twoList[0]);
  1013. yanlingComposeDataVo vo = new yanlingComposeDataVo();
  1014. vo.composeId = composeId;
  1015. vo.isShow = false;
  1016. if (temp >= 2)
  1017. {
  1018. vo.isShow = true;
  1019. }
  1020. vo.attr = (EHeroAddProperties)attrType;
  1021. vo.attrName = mo.name;
  1022. vo.desc = mo.two_desc;
  1023. vo.type = int.Parse(twoList[1]);
  1024. vo.val = int.Parse(twoList[2]);
  1025. yanlingComposeAttr.Add(vo);
  1026. string[] threeList = mo.three_compose.Split(',');
  1027. int attrType_3 = int.Parse(threeList[0]);
  1028. yanlingComposeDataVo vo_3 = new yanlingComposeDataVo();
  1029. vo_3.composeId = composeId;
  1030. vo_3.isShow = false;
  1031. if (temp >= 3)
  1032. {
  1033. vo_3.isShow = true;
  1034. }
  1035. vo_3.attr = (EHeroAddProperties)attrType_3;
  1036. vo_3.attrName = mo.name;
  1037. vo_3.desc = mo.three_desc;
  1038. vo_3.type = int.Parse(threeList[1]);
  1039. vo_3.val = int.Parse(threeList[2]);
  1040. yanlingComposeAttr.Add(vo_3);
  1041. return yanlingComposeAttr;
  1042. }
  1043. }
  1044. /// <summary>
  1045. /// 1级消耗--------------废弃
  1046. /// </summary>
  1047. public List<ItemVo> singleCostList
  1048. {
  1049. get
  1050. {
  1051. List<ItemVo> list = new List<ItemVo>();
  1052. ItemVo gVo = new ItemVo();
  1053. gVo.typeId = 1.ToString();
  1054. gVo.count = GameConfigData.Ins.GetyanlingLeveMo(this.level).goldCost;
  1055. ItemVo pointVo = new ItemVo();
  1056. pointVo.typeId = 8.ToString();
  1057. pointVo.count = GameConfigData.Ins.GetyanlingLeveMo(this.level).pointCost;
  1058. list.Add(gVo);
  1059. list.Add(pointVo);
  1060. return list;
  1061. }
  1062. }
  1063. /// <summary>
  1064. /// 5级消耗--------------废弃
  1065. /// </summary>
  1066. public List<ItemVo> multiCostList
  1067. {
  1068. get
  1069. {
  1070. int max = this.level + 5;
  1071. Dictionary<int, int> dic = new Dictionary<int, int>();
  1072. for (int i = this.level; i < max; i++)
  1073. {
  1074. if (!GameConfigData.Ins.yanlingLeve.ContainsKey(i))
  1075. {
  1076. break;
  1077. }
  1078. sm_yanlingLeve mo = GameConfigData.Ins.GetyanlingLeveMo(i);
  1079. if (mo == null)
  1080. {
  1081. break;
  1082. }
  1083. string cost = "1,"+mo.goldCost + ";" +"8,"+ mo.pointCost;
  1084. string[] sList = cost.Split(';');
  1085. foreach (string item in sList)
  1086. {
  1087. string[] costList = item.Split(',');
  1088. if (dic.ContainsKey(int.Parse(costList[0])))
  1089. {
  1090. dic[int.Parse(costList[0])] += int.Parse(costList[1]);
  1091. }
  1092. else
  1093. {
  1094. dic[int.Parse(costList[0])] = int.Parse(costList[1]);
  1095. }
  1096. }
  1097. }
  1098. List<ItemVo> list = new List<ItemVo>();
  1099. foreach (KeyValuePair<int, int> kv in dic)
  1100. {
  1101. ItemVo vo = new ItemVo();
  1102. vo.count = kv.Value;
  1103. vo.typeId = kv.Key.ToString();
  1104. list.Add(vo);
  1105. }
  1106. return list;
  1107. }
  1108. }
  1109. /// <summary>
  1110. /// 当前等级是否是最大值 true:是 --------------废弃
  1111. /// </summary>
  1112. public bool isLevelMax
  1113. {
  1114. get
  1115. {
  1116. //Dictionary<int, sm_yanlingLeve> yanlingLeve = GameConfigData.Ins.yanlingLeve;
  1117. //if (this.level >= yanlingLeve.Count)
  1118. //{
  1119. // return true;
  1120. //}
  1121. return false;
  1122. }
  1123. }
  1124. /// <summary>
  1125. /// 获取言灵的Mo(基础数据), 获取扩展数据请继续.GetYanlingExt();
  1126. /// </summary>
  1127. /// <returns></returns>
  1128. public sm_item_base Mo()
  1129. {
  1130. return sm_item_base.GetMoById(int.Parse(this.typeId));
  1131. }
  1132. /// <summary>
  1133. /// 技能id
  1134. /// </summary>
  1135. public sm_skill skillMo
  1136. {
  1137. get
  1138. {
  1139. sm_item_yanling mo = this.nMo.GetYanlingExt();
  1140. if (mo!= null && mo.skill_id != 0)
  1141. {
  1142. return sm_skill.GetMoByID(mo.skill_id);
  1143. }
  1144. return null;
  1145. }
  1146. }
  1147. /// <summary>
  1148. /// 查找言灵技在几级解锁
  1149. /// </summary>
  1150. /// <returns>(等级, 技能id)</returns>
  1151. public (int grade, int skillId) FindSkillId()
  1152. {
  1153. if (CurGrade.skill_id > 0)
  1154. {
  1155. return (grade, CurGrade.skill_id);
  1156. }
  1157. for (var g = grade + 1; g <= 5; g++)
  1158. {
  1159. //var g = this.grade < 5 ? this.grade + 1 : this.grade;
  1160. var mo = sm_yanling_upgrade.GetMo(int.Parse(this.typeId), g);
  1161. if (null != mo && mo.skill_id > 0)
  1162. {
  1163. return (g, mo.skill_id);
  1164. }
  1165. }
  1166. return (0, 0);
  1167. }
  1168. /// <summary>
  1169. /// 前一等阶的数据
  1170. /// </summary>
  1171. public sm_yanling_upgrade PreGrade
  1172. {
  1173. get
  1174. {
  1175. var g = this.grade > 1 ? this.grade - 1 : this.grade;
  1176. return sm_yanling_upgrade.GetMo(int.Parse(this.typeId), g);
  1177. }
  1178. }
  1179. /// <summary>
  1180. /// 当前等阶的数据
  1181. /// </summary>
  1182. public sm_yanling_upgrade CurGrade => sm_yanling_upgrade.GetMo(int.Parse(this.typeId), this.grade);
  1183. /// <summary>
  1184. /// 下一等阶的数据
  1185. /// </summary>
  1186. public sm_yanling_upgrade NextGrade
  1187. {
  1188. get
  1189. {
  1190. var g = this.grade < 5 ? this.grade + 1 : this.grade;
  1191. return sm_yanling_upgrade.GetMo(int.Parse(this.typeId), g);
  1192. }
  1193. }
  1194. }
  1195. public class yanlingComposeDataVo
  1196. {
  1197. public int composeId { get; set; }
  1198. /// <summary>
  1199. /// 是否高亮显示 true:是
  1200. /// </summary>
  1201. public bool isShow { get; set; }
  1202. /// <summary>
  1203. /// 属性类型
  1204. /// </summary>
  1205. public EHeroAddProperties attr { get; set; }
  1206. /// <summary>
  1207. /// 属性名称
  1208. /// </summary>
  1209. public string attrName { get; set; }
  1210. /// <summary>
  1211. /// 描述信息
  1212. /// </summary>
  1213. public string desc { get; set; }
  1214. /// <summary>
  1215. /// 是数值还是百分比 1:数值;2:百分比
  1216. /// </summary>
  1217. public int type { get; set; }
  1218. /// <summary>
  1219. /// 属性值--百分比
  1220. /// </summary>
  1221. public int val { get; set; }
  1222. }