BagMainUIVo.cs 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868
  1. using System.Collections.Generic;
  2. using System.Linq;
  3. using UnityEngine;
  4. /// <summary>
  5. /// 背包主界面UIVo
  6. /// </summary>
  7. public class BagMainUIVo
  8. {
  9. public List<UserEquipmentVo> GetWeaponList()
  10. {
  11. return UserProxy.Instance.player.collectItem.GetWeaponList(); ;
  12. }
  13. /// <summary>
  14. /// 武器列表********type:0代表品质;1代表等级;order:0代表从大到小;1代表从小到大
  15. /// </summary>
  16. /// <returns></returns>
  17. public List<UserEquipmentVo> GetWeaponList(int type = 0,int order = 0)
  18. {
  19. var li = new List<UserEquipmentVo>();
  20. List<UserEquipmentVo> arr = UserProxy.Instance.player.collectItem.GetWeaponList();
  21. if (type == 0)//品质
  22. {
  23. Dictionary<int, List<UserEquipmentVo>> dic = new Dictionary<int, List<UserEquipmentVo>>();
  24. foreach (UserEquipmentVo vo in arr)
  25. {
  26. if (dic.ContainsKey(vo.nMo.quality))
  27. {
  28. dic[vo.nMo.quality].Add(vo);
  29. }
  30. else
  31. {
  32. List<UserEquipmentVo> list = new List<UserEquipmentVo>();
  33. list.Add(vo);
  34. dic.Add(vo.nMo.quality, list);
  35. }
  36. }
  37. Dictionary<int, List<UserEquipmentVo>> tempDic = new Dictionary<int, List<UserEquipmentVo>>();
  38. foreach (KeyValuePair<int,List<UserEquipmentVo>>kv in dic)
  39. {
  40. List<UserEquipmentVo> eList = kv.Value;
  41. for (int i = 0; i < eList.Count; i++)
  42. {
  43. //内循环
  44. for (int j = 0; j < eList.Count - 1; j++)
  45. {
  46. if (order == 0)
  47. {
  48. //从大到小排序 (改成< 就是从小到大)
  49. if (eList[i].level > eList[j].level)
  50. {
  51. UserEquipmentVo temp;
  52. temp = eList[i];
  53. eList[i] = eList[j];
  54. eList[j] = temp;
  55. }
  56. }
  57. else
  58. {
  59. //从大到小排序 (改成< 就是从小到大)
  60. if (eList[i].level < eList[j].level)
  61. {
  62. UserEquipmentVo temp;
  63. temp = eList[i];
  64. eList[i] = eList[j];
  65. eList[j] = temp;
  66. }
  67. }
  68. }
  69. }
  70. tempDic[kv.Key] = eList;
  71. }
  72. Dictionary<int, List<UserEquipmentVo>> retDic;
  73. if (order == 0)
  74. {
  75. retDic = tempDic.OrderByDescending(o => o.Key).ToDictionary(o => o.Key, p => p.Value);
  76. }
  77. else
  78. {
  79. retDic = tempDic.OrderBy(o => o.Key).ToDictionary(o => o.Key, p => p.Value);
  80. }
  81. foreach (KeyValuePair<int,List<UserEquipmentVo>>kv in retDic)
  82. {
  83. li.AddRange(kv.Value);
  84. }
  85. }
  86. else//等级
  87. {
  88. Dictionary<int, List<UserEquipmentVo>> dic = new Dictionary<int, List<UserEquipmentVo>>();
  89. foreach (UserEquipmentVo vo in arr)
  90. {
  91. if (dic.ContainsKey(vo.level))
  92. {
  93. dic[vo.level].Add(vo);
  94. }
  95. else
  96. {
  97. List<UserEquipmentVo> list = new List<UserEquipmentVo>();
  98. list.Add(vo);
  99. dic.Add(vo.level, list);
  100. }
  101. }
  102. Dictionary<int, List<UserEquipmentVo>> tempDic = new Dictionary<int, List<UserEquipmentVo>>();
  103. foreach (KeyValuePair<int, List<UserEquipmentVo>> kv in dic)
  104. {
  105. List<UserEquipmentVo> eList = kv.Value;
  106. for (int i = 0; i < eList.Count; i++)
  107. {
  108. //内循环
  109. for (int j = 0; j < eList.Count - 1; j++)
  110. {
  111. if (order == 0)
  112. {
  113. //从大到小排序 (改成< 就是从小到大)
  114. if (eList[i].nMo.quality > eList[j].nMo.quality)
  115. {
  116. UserEquipmentVo temp;
  117. temp = eList[i];
  118. eList[i] = eList[j];
  119. eList[j] = temp;
  120. }
  121. }
  122. else
  123. {
  124. //从大到小排序 (改成< 就是从小到大)
  125. if (eList[i].nMo.quality < eList[j].nMo.quality)
  126. {
  127. UserEquipmentVo temp;
  128. temp = eList[i];
  129. eList[i] = eList[j];
  130. eList[j] = temp;
  131. }
  132. }
  133. }
  134. }
  135. tempDic[kv.Key] = eList;
  136. }
  137. Dictionary<int, List<UserEquipmentVo>> retDic;
  138. if (order == 0)
  139. {
  140. retDic = tempDic.OrderByDescending(o => o.Key).ToDictionary(o => o.Key, p => p.Value);
  141. }
  142. else
  143. {
  144. retDic = tempDic.OrderBy(o => o.Key).ToDictionary(o => o.Key, p => p.Value);
  145. }
  146. foreach (KeyValuePair<int, List<UserEquipmentVo>> kv in retDic)
  147. {
  148. //foreach (UserEquipmentVo v in kv.Value)
  149. //{
  150. // Debug.Log(v.uid + "---------typeid=" + v.typeId + "---------q" + v.nMo.quality + "---------lv" + v.starLevel);
  151. //}
  152. li.AddRange(kv.Value);
  153. }
  154. }
  155. return li;
  156. }
  157. /// <summary>
  158. /// 碎片列表 (角色解锁、升阶用碎片)*****************
  159. /// </summary>
  160. /// <returns></returns>
  161. public List<ItemVo> GetSegmentList() {
  162. return UserProxy.Instance.player.collectItem.GetStoreData(EItemSubType.Segment);
  163. //return UserProxy.Instance.player.collectItem.GetItemList(EItemSubType.Segment);
  164. }
  165. /// <summary>
  166. /// 言灵召唤书碎片
  167. /// </summary>
  168. /// <returns></returns>
  169. public List<ItemVo> GetYanlingbookSegmentList()
  170. {
  171. return UserProxy.Instance.player.collectItem.GetItemList(EItemSubType.YanlingBookSegement);
  172. }
  173. /// <summary>
  174. /// 任务卡*****
  175. /// </summary>
  176. /// <returns></returns>
  177. public List<ItemVo> GetTaskCardList()
  178. {
  179. return UserProxy.Instance.player.collectItem.GetItemList(EItemSubType.TaskCard);
  180. }
  181. /// <summary>
  182. /// 任务道具
  183. /// </summary>
  184. /// <returns></returns>
  185. public List<ItemVo> GetTaskCardItemList()
  186. {
  187. var li = new List<ItemVo>();
  188. return li;
  189. }
  190. #region 材料子标签
  191. /// <summary>
  192. /// 消耗品分类*******这三个消耗品废弃了
  193. /// </summary>
  194. /// <returns></returns>
  195. public List<ItemVo> GetConsumablesList() {
  196. var li = new List<ItemVo>();
  197. var bag = UserProxy.Instance.player.collectItem;
  198. li.AddRange(bag.GetItemList(EItemSubType.BuffCard));
  199. li.AddRange(bag.GetItemList(EItemSubType.Package));
  200. li.AddRange(bag.GetItemList(EItemSubType.Pill));
  201. return li;
  202. }
  203. /// <summary>
  204. /// 基础材料分类********
  205. /// </summary>
  206. /// <returns></returns>
  207. public List<ItemVo> GetBaseMaterialList()
  208. {
  209. var li = new List<ItemVo>();
  210. var bag = UserProxy.Instance.player.collectItem;
  211. li.AddRange(bag.GetStoreData(EItemSubType.Gene));
  212. li.AddRange(bag.GetStoreData(EItemSubType.StrengthStone));
  213. li.AddRange(bag.GetStoreData(EItemSubType.StrengthStone_Wuqi));
  214. li.AddRange(bag.GetStoreData(EItemSubType.Gemstone));
  215. li.AddRange(bag.GetStoreData(EItemSubType.GemTuZhi));
  216. li.AddRange(bag.GetStoreData(EItemSubType.GemMaterial));
  217. //li.AddRange(bag.GetItemList(EItemSubType.Gene));
  218. //li.AddRange(bag.GetItemList(EItemSubType.StrengthStone));
  219. //li.AddRange(bag.GetItemList(EItemSubType.StrengthStone_Wuqi));
  220. //li.AddRange(bag.GetItemList(EItemSubType.Gemstone));
  221. //li.AddRange(bag.GetItemList(EItemSubType.GemTuZhi));
  222. //li.AddRange(bag.GetItemList(EItemSubType.GemMaterial));
  223. return li;
  224. }
  225. /// <summary>
  226. /// 进阶材料分类*********
  227. /// </summary>
  228. /// <returns></returns>
  229. public List<ItemVo> GetUpGradeMaterialList()
  230. {
  231. var li = new List<ItemVo>();
  232. var bag = UserProxy.Instance.player.collectItem;
  233. li.AddRange(bag.GetStoreData(EItemSubType.AdvancedStone));
  234. li.AddRange(bag.GetStoreData(EItemSubType.AdvancedFineStone));
  235. li.AddRange(bag.GetStoreData(EItemSubType.ForgingMaterial));
  236. li.AddRange(bag.GetStoreData(EItemSubType.Hunqi));
  237. li.AddRange(bag.GetStoreData(EItemSubType.ElementTuPoMaterial));
  238. li.AddRange(bag.GetStoreData(EItemSubType.professionTuPoMaterial));
  239. li.AddRange(bag.GetStoreData(EItemSubType.YanLingAdvancedStone));
  240. li.AddRange(bag.GetStoreData(EItemSubType.YanLingAdvancedMaterial));
  241. li.AddRange(bag.GetStoreData(EItemSubType.WuqiAdvancedStone));
  242. li.AddRange(bag.GetStoreData(EItemSubType.WuqiAdvancedMaterial));
  243. //li.AddRange(bag.GetItemList(EItemSubType.AdvancedStone));
  244. //li.AddRange(bag.GetItemList(EItemSubType.AdvancedFineStone));
  245. //li.AddRange(bag.GetItemList(EItemSubType.ForgingMaterial));
  246. //li.AddRange(bag.GetItemList(EItemSubType.Hunqi));
  247. //li.AddRange(bag.GetItemList(EItemSubType.ElementTuPoMaterial));
  248. //li.AddRange(bag.GetItemList(EItemSubType.professionTuPoMaterial));
  249. //li.AddRange(bag.GetItemList(EItemSubType.YanLingAdvancedStone));
  250. //li.AddRange(bag.GetItemList(EItemSubType.YanLingAdvancedMaterial));
  251. //li.AddRange(bag.GetItemList(EItemSubType.WuqiAdvancedStone));
  252. //li.AddRange(bag.GetItemList(EItemSubType.WuqiAdvancedMaterial));
  253. return li;
  254. }
  255. /// <summary>
  256. /// 活动道具分类*******
  257. /// </summary>
  258. /// <returns></returns>
  259. public List<ItemVo> GetActiveCardsList()
  260. {
  261. var li = new List<ItemVo>();
  262. var bag = UserProxy.Instance.player.collectItem;
  263. li.AddRange(bag.GetItemList(EItemSubType.Box));
  264. li.AddRange(bag.GetStoreData(EItemSubType.commonWishCoupons));
  265. li.AddRange(bag.GetStoreData(EItemSubType.ActiveWishCoupons));
  266. return li;
  267. }
  268. /// <summary>
  269. /// 言灵召唤书
  270. /// </summary>
  271. /// <returns></returns>
  272. public List<ItemVo> GetYanlingBookList() {
  273. var li = new List<ItemVo>();
  274. var bag = UserProxy.Instance.player.collectItem;
  275. li.AddRange(bag.GetItemList(EItemSubType.YanlingBook));
  276. return li;
  277. }
  278. #endregion
  279. #region 药瓶和回城卷标签
  280. /// <summary>
  281. /// 药瓶
  282. /// </summary>
  283. /// <returns></returns>
  284. public List<ItemVo> GetHPMPTPList()
  285. {
  286. var li = new List<ItemVo>();
  287. var bag = UserProxy.Instance.player.collectItem;
  288. Dictionary<int,Ins_battleItem> dic = UserProxy.Instance.player.StoreNewFeild.battleItem;
  289. List<ItemVo> list = new List<ItemVo>();
  290. list.AddRange(bag.GetItemList(EItemSubType.BattleItem_HP));
  291. list.AddRange(bag.GetItemList(EItemSubType.BattleItem_MP));
  292. foreach (ItemVo vo in list)
  293. {
  294. foreach (KeyValuePair<int,Ins_battleItem>kv in dic)
  295. {
  296. if (kv.Value.id == int.Parse(vo.typeId))
  297. {
  298. vo.uid = kv.Key.ToString();
  299. break;
  300. }
  301. }
  302. li.Add(vo);
  303. }
  304. li.AddRange(bag.GetItemList(EItemSubType.TownPortalScroll));
  305. return li;
  306. }
  307. /// <summary>
  308. /// 药瓶
  309. /// </summary>
  310. /// <returns></returns>
  311. public List<ItemVo> GetHPMPList()
  312. {
  313. var li = new List<ItemVo>();
  314. var bag = UserProxy.Instance.player.collectItem;
  315. Dictionary<int, Ins_battleItem> dic = UserProxy.Instance.player.StoreNewFeild.battleItem;
  316. List<ItemVo> list = new List<ItemVo>();
  317. list.AddRange(bag.GetItemList(EItemSubType.BattleItem_HP));
  318. list.AddRange(bag.GetItemList(EItemSubType.BattleItem_MP));
  319. foreach (ItemVo vo in list)
  320. {
  321. foreach (KeyValuePair<int, Ins_battleItem> kv in dic)
  322. {
  323. if (kv.Value.id == int.Parse(vo.typeId))
  324. {
  325. vo.uid = kv.Key.ToString();
  326. break;
  327. }
  328. }
  329. li.Add(vo);
  330. }
  331. return li;
  332. }
  333. #endregion
  334. /// <summary>
  335. /// 言灵列表 (下期)*********
  336. /// </summary>
  337. /// <returns></returns>
  338. public List<ItemVo> GetYanLingList()
  339. {
  340. return UserProxy.Instance.player.collectYanling.items.Values.ToList().ConvertAll(i=>i as ItemVo);
  341. //return UserProxy.Instance.player.collectItem.GetItemList(EItemSubType.YanLing);
  342. }
  343. public List<ItemVo> GetYanLingList(int type,int order)
  344. {
  345. var li = new List<ItemVo>();
  346. List<UserYanlingVo> arr = UserProxy.Instance.player.collectYanling.items.Values.ToList();
  347. if (type == 0)//品质
  348. {
  349. Dictionary<int, List<UserYanlingVo>> dic = new Dictionary<int, List<UserYanlingVo>>();
  350. foreach (UserYanlingVo vo in arr)
  351. {
  352. if (dic.ContainsKey(vo.nMo.quality))
  353. {
  354. dic[vo.nMo.quality].Add(vo);
  355. }
  356. else
  357. {
  358. List<UserYanlingVo> list = new List<UserYanlingVo>();
  359. list.Add(vo);
  360. dic.Add(vo.nMo.quality, list);
  361. }
  362. }
  363. Dictionary<int, List<UserYanlingVo>> tempDic = new Dictionary<int, List<UserYanlingVo>>();
  364. foreach (KeyValuePair<int, List<UserYanlingVo>> kv in dic)
  365. {
  366. List<UserYanlingVo> eList = kv.Value;
  367. for (int i = 0; i < eList.Count; i++)
  368. {
  369. //内循环
  370. for (int j = 0; j < eList.Count - 1; j++)
  371. {
  372. if (order == 0)
  373. {
  374. //从大到小排序 (改成< 就是从小到大)
  375. if (eList[i].level > eList[j].level)
  376. {
  377. UserYanlingVo temp;
  378. temp = eList[i];
  379. eList[i] = eList[j];
  380. eList[j] = temp;
  381. }
  382. }
  383. else
  384. {
  385. //从大到小排序 (改成< 就是从小到大)
  386. if (eList[i].level < eList[j].level)
  387. {
  388. UserYanlingVo temp;
  389. temp = eList[i];
  390. eList[i] = eList[j];
  391. eList[j] = temp;
  392. }
  393. }
  394. }
  395. }
  396. tempDic[kv.Key] = eList;
  397. }
  398. Dictionary<int, List<UserYanlingVo>> retDic;
  399. if (order == 0)
  400. {
  401. retDic = tempDic.OrderByDescending(o => o.Key).ToDictionary(o => o.Key, p => p.Value);
  402. }
  403. else
  404. {
  405. retDic = tempDic.OrderBy(o => o.Key).ToDictionary(o => o.Key, p => p.Value);
  406. }
  407. foreach (KeyValuePair<int, List<UserYanlingVo>> kv in retDic)
  408. {
  409. li.AddRange(kv.Value);
  410. }
  411. }
  412. else//等级
  413. {
  414. Dictionary<int, List<UserYanlingVo>> dic = new Dictionary<int, List<UserYanlingVo>>();
  415. foreach (UserYanlingVo vo in arr)
  416. {
  417. if (dic.ContainsKey(vo.level))
  418. {
  419. dic[vo.level].Add(vo);
  420. }
  421. else
  422. {
  423. List<UserYanlingVo> list = new List<UserYanlingVo>();
  424. list.Add(vo);
  425. dic.Add(vo.level, list);
  426. }
  427. }
  428. Dictionary<int, List<UserYanlingVo>> tempDic = new Dictionary<int, List<UserYanlingVo>>();
  429. foreach (KeyValuePair<int, List<UserYanlingVo>> kv in dic)
  430. {
  431. List<UserYanlingVo> eList = kv.Value;
  432. for (int i = 0; i < eList.Count; i++)
  433. {
  434. //内循环
  435. for (int j = 0; j < eList.Count - 1; j++)
  436. {
  437. if (order == 0)
  438. {
  439. //从大到小排序 (改成< 就是从小到大)
  440. if (eList[i].nMo.quality > eList[j].nMo.quality)
  441. {
  442. UserYanlingVo temp;
  443. temp = eList[i];
  444. eList[i] = eList[j];
  445. eList[j] = temp;
  446. }
  447. }
  448. else
  449. {
  450. //从大到小排序 (改成< 就是从小到大)
  451. if (eList[i].nMo.quality < eList[j].nMo.quality)
  452. {
  453. UserYanlingVo temp;
  454. temp = eList[i];
  455. eList[i] = eList[j];
  456. eList[j] = temp;
  457. }
  458. }
  459. }
  460. }
  461. tempDic[kv.Key] = eList;
  462. }
  463. Dictionary<int, List<UserYanlingVo>> retDic;
  464. if (order == 0)
  465. {
  466. retDic = tempDic.OrderByDescending(o => o.Key).ToDictionary(o => o.Key, p => p.Value);
  467. }
  468. else
  469. {
  470. retDic = tempDic.OrderBy(o => o.Key).ToDictionary(o => o.Key, p => p.Value);
  471. }
  472. foreach (KeyValuePair<int, List<UserYanlingVo>> kv in retDic)
  473. {
  474. li.AddRange(kv.Value);
  475. }
  476. }
  477. return li;
  478. //return UserProxy.Instance.player.collectYanling.items.Values.ToList().ConvertAll(i => i as ItemVo);
  479. //return UserProxy.Instance.player.collectItem.GetItemList(EItemSubType.YanLing);
  480. }
  481. #region------------>分类调整
  482. /// <summary>
  483. /// 养成道具
  484. /// </summary>
  485. /// <returns></returns>
  486. public List<ItemVo> GetYangChengItemList()
  487. {
  488. var li = new List<ItemVo>();
  489. var bag = UserProxy.Instance.player.collectItem;
  490. li.AddRange(bag.GetStoreData(EItemSubType.Gene));
  491. li.AddRange(bag.GetStoreData(EItemSubType.StrengthStone));
  492. li.AddRange(bag.GetStoreData(EItemSubType.StrengthStone_Wuqi));
  493. li.AddRange(bag.GetStoreData(EItemSubType.ElementTuPoMaterial));
  494. li.AddRange(bag.GetStoreData(EItemSubType.professionTuPoMaterial));
  495. li.AddRange(bag.GetStoreData(EItemSubType.YanLingAdvancedStone));
  496. li.AddRange(bag.GetStoreData(EItemSubType.YanLingAdvancedMaterial));
  497. li.AddRange(bag.GetStoreData(EItemSubType.WuqiAdvancedStone));
  498. li.AddRange(bag.GetStoreData(EItemSubType.WuqiAdvancedMaterial));
  499. li.AddRange(UserProxy.Instance.player.collectItem.GetStoreData(EItemSubType.Segment));
  500. li.AddRange(bag.GetStoreData(EItemSubType.Gemstone));
  501. li.AddRange(bag.GetStoreData(EItemSubType.GemTuZhi));
  502. li.AddRange(bag.GetStoreData(EItemSubType.GemMaterial));
  503. return li;
  504. }
  505. /// <summary>
  506. /// 养成道具----强化道具字标签
  507. /// </summary>
  508. /// <returns></returns>
  509. public List<ItemVo> GetYangchengStrengthenList()
  510. {
  511. var li = new List<ItemVo>();
  512. var bag = UserProxy.Instance.player.collectItem;
  513. li.AddRange(bag.GetStoreData(EItemSubType.Gene));
  514. li.AddRange(bag.GetStoreData(EItemSubType.StrengthStone));
  515. li.AddRange(bag.GetStoreData(EItemSubType.StrengthStone_Wuqi));
  516. return li;
  517. }
  518. /// <summary>
  519. /// 养成道具----突破道具子标签
  520. /// </summary>
  521. /// <returns></returns>
  522. public List<ItemVo> GetYangchengTuPoList()
  523. {
  524. var li = new List<ItemVo>();
  525. var bag = UserProxy.Instance.player.collectItem;
  526. li.AddRange(bag.GetStoreData(EItemSubType.ElementTuPoMaterial));
  527. li.AddRange(bag.GetStoreData(EItemSubType.professionTuPoMaterial));
  528. li.AddRange(bag.GetStoreData(EItemSubType.YanLingAdvancedStone));
  529. li.AddRange(bag.GetStoreData(EItemSubType.YanLingAdvancedMaterial));
  530. li.AddRange(bag.GetStoreData(EItemSubType.WuqiAdvancedStone));
  531. li.AddRange(bag.GetStoreData(EItemSubType.WuqiAdvancedMaterial));
  532. li.AddRange(UserProxy.Instance.player.collectItem.GetStoreData(EItemSubType.Segment));
  533. return li;
  534. }
  535. /// <summary>
  536. /// 养成道具----宝石子标签
  537. /// </summary>
  538. /// <returns></returns>
  539. public List<ItemVo> GetYangchengGemList()
  540. {
  541. var li = new List<ItemVo>();
  542. var bag = UserProxy.Instance.player.collectItem;
  543. li.AddRange(bag.GetStoreData(EItemSubType.Gemstone));
  544. li.AddRange(bag.GetStoreData(EItemSubType.GemTuZhi));
  545. li.AddRange(bag.GetStoreData(EItemSubType.GemMaterial));
  546. return li;
  547. }
  548. /// <summary>
  549. /// 材料
  550. /// </summary>
  551. /// <returns></returns>
  552. public List<ItemVo> GetMaterialItemList()
  553. {
  554. var li = new List<ItemVo>();
  555. var bag = UserProxy.Instance.player.collectItem;
  556. li.AddRange(bag.GetStoreData(EItemSubType.Hunqi));
  557. li.AddRange(bag.GetStoreData(EItemSubType.AdvancedStone));
  558. List<ItemVo> list = bag.GetItemList(EItemSubType.YanlingBook);
  559. List<ItemVo> tempList = new List<ItemVo>();
  560. foreach (ItemVo vo in list)
  561. {
  562. if (vo.count>1)
  563. {
  564. for(int i = 0; i < vo.count; i++)
  565. {
  566. ItemVo nVo = new ItemVo();
  567. nVo.typeId = vo.typeId;
  568. nVo.count = 1;
  569. tempList.Add(nVo);
  570. }
  571. }
  572. else
  573. {
  574. tempList.Add(vo);
  575. }
  576. }
  577. li.AddRange(tempList);
  578. return li;
  579. }
  580. public List<ItemVo> GetMaterialList()
  581. {
  582. List<ItemVo> li = this.GetMaterialItemList();
  583. List<ItemVo> list = new List<ItemVo>();
  584. if (li.Count != 0)
  585. {
  586. foreach (ItemVo vo in li)
  587. {
  588. if (vo.nMo.subType == (int)EItemSubType.Hunqi || vo.nMo.subType == (int)EItemSubType.AdvancedStone)
  589. {
  590. list.Add(vo);
  591. }
  592. }
  593. }
  594. return li;
  595. }
  596. public List<ItemVo> GetMaterialBookList()
  597. {
  598. List<ItemVo> li = this.GetMaterialItemList();
  599. List<ItemVo> list = new List<ItemVo>();
  600. if (li.Count != 0)
  601. {
  602. foreach (ItemVo vo in li)
  603. {
  604. if (vo.nMo.subType == (int)EItemSubType.YanlingBook)
  605. {
  606. list.Add(vo);
  607. }
  608. }
  609. }
  610. return li;
  611. }
  612. #endregion
  613. #region 子界面
  614. /// <summary>
  615. /// 获取武器详情信息(下期)
  616. /// </summary>
  617. /// <param name="_wp"></param>
  618. /// <returns></returns>
  619. public WeaponDetailUI GetWeaponDetails(EquipeMentVo _wp)
  620. {
  621. return new WeaponDetailUI(_wp);
  622. }
  623. /// <summary>
  624. /// 武器详情界面
  625. /// </summary>
  626. public class WeaponDetailUI
  627. {
  628. public EquipeMentVo weapon { get; }
  629. public WeaponDetailUI(EquipeMentVo _wp)
  630. {
  631. this.weapon = _wp;
  632. }
  633. /// <summary>
  634. /// 名称
  635. /// </summary>
  636. public string Title { get { return this.weapon.nMo.name; } }
  637. /// <summary>
  638. /// 锁定状态
  639. /// </summary>
  640. public bool IsLocked { get { return this.weapon.isLocked != 0; } }
  641. public string Img { get { return this.weapon.nMo.img; } }
  642. /// <summary>
  643. /// 用着这个武器的英雄
  644. /// </summary>
  645. public GameHeroVo UsingHero
  646. {
  647. get
  648. {
  649. // 根据id提取英雄.
  650. var hero = UserProxy.Instance.player.collectHero.GetHeroGameInfoByHeroUId(this.weapon.WhoIsUsing.ToString());
  651. if (hero != null)
  652. {
  653. return hero;
  654. }
  655. return null;
  656. }
  657. }
  658. /// <summary>
  659. /// 品质
  660. /// </summary>
  661. public int quality { get { return this.weapon.nMo.quality; } }
  662. /// <summary>
  663. /// 描述
  664. /// </summary>
  665. public string desc { get { return this.weapon.nMo.itemDesc; } }
  666. /// <summary>
  667. /// 当前等级
  668. /// </summary>
  669. public int level { get { return this.weapon.level; } }
  670. /// <summary>
  671. /// 最大等级
  672. /// </summary>
  673. public int maxLevel { get { return this.maxLevel; } }
  674. /// <summary>
  675. /// 当前经验
  676. /// </summary>
  677. public int exp { get { return this.weapon.exp; } }
  678. /// <summary>
  679. /// 升级所需经验
  680. /// </summary>
  681. public int maxExp { get { return sm_itemlevel.GetMoById(this.weapon.level).needExp; } }
  682. /// <summary>
  683. /// 攻击
  684. /// </summary>
  685. public int attack { get { return this.weapon.nMo.GetWeaponExt().atk; } }
  686. /// <summary>
  687. /// 会心一击,待议
  688. /// </summary>
  689. public int 会心 { get { return 1; } }
  690. /// <summary>
  691. /// 武器技能
  692. /// </summary>
  693. public List<sm_skill> Skills
  694. {
  695. get
  696. {
  697. var li = new List<sm_skill>();
  698. //this.weapon.nMo.skills;
  699. return li;
  700. }
  701. }
  702. }
  703. #endregion
  704. #region----->背包解锁新加字段
  705. /// <summary>
  706. /// 当前容量
  707. /// </summary>
  708. public int curCapacity
  709. {
  710. get
  711. {
  712. int initNum = int.Parse(GameConfigData.Ins.globalsettings.Item_Packet_InitNum_New.ToString());
  713. if (UserProxy.Instance.player.PrivateState.expandNum == 0)
  714. {
  715. return initNum;
  716. }
  717. int explandNum = UserProxy.Instance.player.PrivateState.expandNum;
  718. Dictionary<int, sm_expandStoreNum> expandStoreNum = GameConfigData.Ins.expandStoreNum;
  719. for (int i = 1;i<=explandNum;i++)
  720. {
  721. if (expandStoreNum.ContainsKey(i))
  722. {
  723. initNum += expandStoreNum[i].expandNum;
  724. }
  725. }
  726. return initNum;
  727. }
  728. }
  729. /// <summary>
  730. /// 最大容量
  731. /// </summary>
  732. public int maxCapacity
  733. {
  734. get
  735. {
  736. return int.Parse(GameConfigData.Ins.globalsettings.Item_Packet_MaxNum_New.ToString());
  737. }
  738. }
  739. /// <summary>
  740. /// 扩容消耗金币数量
  741. /// </summary>
  742. public int explandCostNum
  743. {
  744. get
  745. {
  746. int expandNum = UserProxy.Instance.player.PrivateState.expandNum;
  747. int count = GameConfigData.Ins.expandStoreNum.Count;
  748. if (expandNum >= count)
  749. {
  750. return 0;
  751. }
  752. return int.Parse(GameConfigData.Ins.GetexpandStoreNumMo(expandNum+1).cost);
  753. }
  754. }
  755. #endregion
  756. }