123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868 |
- using System.Collections.Generic;
- using System.Linq;
- using UnityEngine;
- /// <summary>
- /// 背包主界面UIVo
- /// </summary>
- public class BagMainUIVo
- {
- public List<UserEquipmentVo> GetWeaponList()
- {
- return UserProxy.Instance.player.collectItem.GetWeaponList(); ;
- }
- /// <summary>
- /// 武器列表********type:0代表品质;1代表等级;order:0代表从大到小;1代表从小到大
- /// </summary>
- /// <returns></returns>
- public List<UserEquipmentVo> GetWeaponList(int type = 0,int order = 0)
- {
- var li = new List<UserEquipmentVo>();
- List<UserEquipmentVo> arr = UserProxy.Instance.player.collectItem.GetWeaponList();
- if (type == 0)//品质
- {
- Dictionary<int, List<UserEquipmentVo>> dic = new Dictionary<int, List<UserEquipmentVo>>();
- foreach (UserEquipmentVo vo in arr)
- {
- if (dic.ContainsKey(vo.nMo.quality))
- {
- dic[vo.nMo.quality].Add(vo);
- }
- else
- {
- List<UserEquipmentVo> list = new List<UserEquipmentVo>();
- list.Add(vo);
- dic.Add(vo.nMo.quality, list);
- }
- }
- Dictionary<int, List<UserEquipmentVo>> tempDic = new Dictionary<int, List<UserEquipmentVo>>();
-
- foreach (KeyValuePair<int,List<UserEquipmentVo>>kv in dic)
- {
- List<UserEquipmentVo> eList = kv.Value;
- for (int i = 0; i < eList.Count; i++)
- {
- //内循环
- for (int j = 0; j < eList.Count - 1; j++)
- {
- if (order == 0)
- {
- //从大到小排序 (改成< 就是从小到大)
- if (eList[i].level > eList[j].level)
- {
- UserEquipmentVo temp;
- temp = eList[i];
- eList[i] = eList[j];
- eList[j] = temp;
- }
- }
- else
- {
- //从大到小排序 (改成< 就是从小到大)
- if (eList[i].level < eList[j].level)
- {
- UserEquipmentVo temp;
- temp = eList[i];
- eList[i] = eList[j];
- eList[j] = temp;
- }
- }
-
- }
- }
- tempDic[kv.Key] = eList;
- }
- Dictionary<int, List<UserEquipmentVo>> retDic;
- if (order == 0)
- {
- retDic = tempDic.OrderByDescending(o => o.Key).ToDictionary(o => o.Key, p => p.Value);
- }
- else
- {
- retDic = tempDic.OrderBy(o => o.Key).ToDictionary(o => o.Key, p => p.Value);
- }
-
- foreach (KeyValuePair<int,List<UserEquipmentVo>>kv in retDic)
- {
- li.AddRange(kv.Value);
- }
-
- }
- else//等级
- {
- Dictionary<int, List<UserEquipmentVo>> dic = new Dictionary<int, List<UserEquipmentVo>>();
- foreach (UserEquipmentVo vo in arr)
- {
- if (dic.ContainsKey(vo.level))
- {
- dic[vo.level].Add(vo);
- }
- else
- {
- List<UserEquipmentVo> list = new List<UserEquipmentVo>();
- list.Add(vo);
- dic.Add(vo.level, list);
- }
- }
- Dictionary<int, List<UserEquipmentVo>> tempDic = new Dictionary<int, List<UserEquipmentVo>>();
- foreach (KeyValuePair<int, List<UserEquipmentVo>> kv in dic)
- {
- List<UserEquipmentVo> eList = kv.Value;
- for (int i = 0; i < eList.Count; i++)
- {
- //内循环
- for (int j = 0; j < eList.Count - 1; j++)
- {
- if (order == 0)
- {
- //从大到小排序 (改成< 就是从小到大)
- if (eList[i].nMo.quality > eList[j].nMo.quality)
- {
- UserEquipmentVo temp;
- temp = eList[i];
- eList[i] = eList[j];
- eList[j] = temp;
- }
- }
- else
- {
- //从大到小排序 (改成< 就是从小到大)
- if (eList[i].nMo.quality < eList[j].nMo.quality)
- {
- UserEquipmentVo temp;
- temp = eList[i];
- eList[i] = eList[j];
- eList[j] = temp;
- }
- }
- }
- }
- tempDic[kv.Key] = eList;
- }
- Dictionary<int, List<UserEquipmentVo>> retDic;
- if (order == 0)
- {
- retDic = tempDic.OrderByDescending(o => o.Key).ToDictionary(o => o.Key, p => p.Value);
- }
- else
- {
- retDic = tempDic.OrderBy(o => o.Key).ToDictionary(o => o.Key, p => p.Value);
- }
- foreach (KeyValuePair<int, List<UserEquipmentVo>> kv in retDic)
- {
- //foreach (UserEquipmentVo v in kv.Value)
- //{
- // Debug.Log(v.uid + "---------typeid=" + v.typeId + "---------q" + v.nMo.quality + "---------lv" + v.starLevel);
- //}
- li.AddRange(kv.Value);
- }
- }
- return li;
- }
- /// <summary>
- /// 碎片列表 (角色解锁、升阶用碎片)*****************
- /// </summary>
- /// <returns></returns>
- public List<ItemVo> GetSegmentList() {
- return UserProxy.Instance.player.collectItem.GetStoreData(EItemSubType.Segment);
- //return UserProxy.Instance.player.collectItem.GetItemList(EItemSubType.Segment);
- }
- /// <summary>
- /// 言灵召唤书碎片
- /// </summary>
- /// <returns></returns>
- public List<ItemVo> GetYanlingbookSegmentList()
- {
- return UserProxy.Instance.player.collectItem.GetItemList(EItemSubType.YanlingBookSegement);
- }
- /// <summary>
- /// 任务卡*****
- /// </summary>
- /// <returns></returns>
- public List<ItemVo> GetTaskCardList()
- {
- return UserProxy.Instance.player.collectItem.GetItemList(EItemSubType.TaskCard);
- }
- /// <summary>
- /// 任务道具
- /// </summary>
- /// <returns></returns>
- public List<ItemVo> GetTaskCardItemList()
- {
- var li = new List<ItemVo>();
- return li;
- }
- #region 材料子标签
- /// <summary>
- /// 消耗品分类*******这三个消耗品废弃了
- /// </summary>
- /// <returns></returns>
- public List<ItemVo> GetConsumablesList() {
- var li = new List<ItemVo>();
- var bag = UserProxy.Instance.player.collectItem;
- li.AddRange(bag.GetItemList(EItemSubType.BuffCard));
- li.AddRange(bag.GetItemList(EItemSubType.Package));
- li.AddRange(bag.GetItemList(EItemSubType.Pill));
- return li;
- }
- /// <summary>
- /// 基础材料分类********
- /// </summary>
- /// <returns></returns>
- public List<ItemVo> GetBaseMaterialList()
- {
- var li = new List<ItemVo>();
- var bag = UserProxy.Instance.player.collectItem;
- li.AddRange(bag.GetStoreData(EItemSubType.Gene));
- li.AddRange(bag.GetStoreData(EItemSubType.StrengthStone));
- li.AddRange(bag.GetStoreData(EItemSubType.StrengthStone_Wuqi));
- li.AddRange(bag.GetStoreData(EItemSubType.Gemstone));
- li.AddRange(bag.GetStoreData(EItemSubType.GemTuZhi));
- li.AddRange(bag.GetStoreData(EItemSubType.GemMaterial));
- //li.AddRange(bag.GetItemList(EItemSubType.Gene));
- //li.AddRange(bag.GetItemList(EItemSubType.StrengthStone));
- //li.AddRange(bag.GetItemList(EItemSubType.StrengthStone_Wuqi));
- //li.AddRange(bag.GetItemList(EItemSubType.Gemstone));
- //li.AddRange(bag.GetItemList(EItemSubType.GemTuZhi));
- //li.AddRange(bag.GetItemList(EItemSubType.GemMaterial));
- return li;
- }
- /// <summary>
- /// 进阶材料分类*********
- /// </summary>
- /// <returns></returns>
- public List<ItemVo> GetUpGradeMaterialList()
- {
- var li = new List<ItemVo>();
- var bag = UserProxy.Instance.player.collectItem;
- li.AddRange(bag.GetStoreData(EItemSubType.AdvancedStone));
- li.AddRange(bag.GetStoreData(EItemSubType.AdvancedFineStone));
- li.AddRange(bag.GetStoreData(EItemSubType.ForgingMaterial));
-
- li.AddRange(bag.GetStoreData(EItemSubType.Hunqi));
- li.AddRange(bag.GetStoreData(EItemSubType.ElementTuPoMaterial));
- li.AddRange(bag.GetStoreData(EItemSubType.professionTuPoMaterial));
- li.AddRange(bag.GetStoreData(EItemSubType.YanLingAdvancedStone));
- li.AddRange(bag.GetStoreData(EItemSubType.YanLingAdvancedMaterial));
- li.AddRange(bag.GetStoreData(EItemSubType.WuqiAdvancedStone));
- li.AddRange(bag.GetStoreData(EItemSubType.WuqiAdvancedMaterial));
- //li.AddRange(bag.GetItemList(EItemSubType.AdvancedStone));
- //li.AddRange(bag.GetItemList(EItemSubType.AdvancedFineStone));
- //li.AddRange(bag.GetItemList(EItemSubType.ForgingMaterial));
-
- //li.AddRange(bag.GetItemList(EItemSubType.Hunqi));
- //li.AddRange(bag.GetItemList(EItemSubType.ElementTuPoMaterial));
- //li.AddRange(bag.GetItemList(EItemSubType.professionTuPoMaterial));
- //li.AddRange(bag.GetItemList(EItemSubType.YanLingAdvancedStone));
- //li.AddRange(bag.GetItemList(EItemSubType.YanLingAdvancedMaterial));
- //li.AddRange(bag.GetItemList(EItemSubType.WuqiAdvancedStone));
- //li.AddRange(bag.GetItemList(EItemSubType.WuqiAdvancedMaterial));
- return li;
- }
- /// <summary>
- /// 活动道具分类*******
- /// </summary>
- /// <returns></returns>
- public List<ItemVo> GetActiveCardsList()
- {
- var li = new List<ItemVo>();
- var bag = UserProxy.Instance.player.collectItem;
- li.AddRange(bag.GetItemList(EItemSubType.Box));
- li.AddRange(bag.GetStoreData(EItemSubType.commonWishCoupons));
- li.AddRange(bag.GetStoreData(EItemSubType.ActiveWishCoupons));
- return li;
- }
- /// <summary>
- /// 言灵召唤书
- /// </summary>
- /// <returns></returns>
- public List<ItemVo> GetYanlingBookList() {
- var li = new List<ItemVo>();
- var bag = UserProxy.Instance.player.collectItem;
- li.AddRange(bag.GetItemList(EItemSubType.YanlingBook));
- return li;
- }
- #endregion
- #region 药瓶和回城卷标签
- /// <summary>
- /// 药瓶
- /// </summary>
- /// <returns></returns>
- public List<ItemVo> GetHPMPTPList()
- {
- var li = new List<ItemVo>();
- var bag = UserProxy.Instance.player.collectItem;
- Dictionary<int,Ins_battleItem> dic = UserProxy.Instance.player.StoreNewFeild.battleItem;
- List<ItemVo> list = new List<ItemVo>();
- list.AddRange(bag.GetItemList(EItemSubType.BattleItem_HP));
- list.AddRange(bag.GetItemList(EItemSubType.BattleItem_MP));
- foreach (ItemVo vo in list)
- {
- foreach (KeyValuePair<int,Ins_battleItem>kv in dic)
- {
- if (kv.Value.id == int.Parse(vo.typeId))
- {
- vo.uid = kv.Key.ToString();
- break;
- }
- }
- li.Add(vo);
- }
- li.AddRange(bag.GetItemList(EItemSubType.TownPortalScroll));
- return li;
- }
- /// <summary>
- /// 药瓶
- /// </summary>
- /// <returns></returns>
- public List<ItemVo> GetHPMPList()
- {
- var li = new List<ItemVo>();
- var bag = UserProxy.Instance.player.collectItem;
- Dictionary<int, Ins_battleItem> dic = UserProxy.Instance.player.StoreNewFeild.battleItem;
- List<ItemVo> list = new List<ItemVo>();
- list.AddRange(bag.GetItemList(EItemSubType.BattleItem_HP));
- list.AddRange(bag.GetItemList(EItemSubType.BattleItem_MP));
- foreach (ItemVo vo in list)
- {
- foreach (KeyValuePair<int, Ins_battleItem> kv in dic)
- {
- if (kv.Value.id == int.Parse(vo.typeId))
- {
- vo.uid = kv.Key.ToString();
- break;
- }
- }
- li.Add(vo);
- }
-
- return li;
- }
- #endregion
- /// <summary>
- /// 言灵列表 (下期)*********
- /// </summary>
- /// <returns></returns>
- public List<ItemVo> GetYanLingList()
- {
- return UserProxy.Instance.player.collectYanling.items.Values.ToList().ConvertAll(i=>i as ItemVo);
- //return UserProxy.Instance.player.collectItem.GetItemList(EItemSubType.YanLing);
- }
- public List<ItemVo> GetYanLingList(int type,int order)
- {
- var li = new List<ItemVo>();
- List<UserYanlingVo> arr = UserProxy.Instance.player.collectYanling.items.Values.ToList();
- if (type == 0)//品质
- {
- Dictionary<int, List<UserYanlingVo>> dic = new Dictionary<int, List<UserYanlingVo>>();
- foreach (UserYanlingVo vo in arr)
- {
- if (dic.ContainsKey(vo.nMo.quality))
- {
- dic[vo.nMo.quality].Add(vo);
- }
- else
- {
- List<UserYanlingVo> list = new List<UserYanlingVo>();
- list.Add(vo);
- dic.Add(vo.nMo.quality, list);
- }
- }
- Dictionary<int, List<UserYanlingVo>> tempDic = new Dictionary<int, List<UserYanlingVo>>();
- foreach (KeyValuePair<int, List<UserYanlingVo>> kv in dic)
- {
- List<UserYanlingVo> eList = kv.Value;
- for (int i = 0; i < eList.Count; i++)
- {
- //内循环
- for (int j = 0; j < eList.Count - 1; j++)
- {
- if (order == 0)
- {
- //从大到小排序 (改成< 就是从小到大)
- if (eList[i].level > eList[j].level)
- {
- UserYanlingVo temp;
- temp = eList[i];
- eList[i] = eList[j];
- eList[j] = temp;
- }
- }
- else
- {
- //从大到小排序 (改成< 就是从小到大)
- if (eList[i].level < eList[j].level)
- {
- UserYanlingVo temp;
- temp = eList[i];
- eList[i] = eList[j];
- eList[j] = temp;
- }
- }
- }
- }
- tempDic[kv.Key] = eList;
- }
- Dictionary<int, List<UserYanlingVo>> retDic;
- if (order == 0)
- {
- retDic = tempDic.OrderByDescending(o => o.Key).ToDictionary(o => o.Key, p => p.Value);
- }
- else
- {
- retDic = tempDic.OrderBy(o => o.Key).ToDictionary(o => o.Key, p => p.Value);
- }
- foreach (KeyValuePair<int, List<UserYanlingVo>> kv in retDic)
- {
- li.AddRange(kv.Value);
- }
- }
- else//等级
- {
- Dictionary<int, List<UserYanlingVo>> dic = new Dictionary<int, List<UserYanlingVo>>();
- foreach (UserYanlingVo vo in arr)
- {
- if (dic.ContainsKey(vo.level))
- {
- dic[vo.level].Add(vo);
- }
- else
- {
- List<UserYanlingVo> list = new List<UserYanlingVo>();
- list.Add(vo);
- dic.Add(vo.level, list);
- }
- }
- Dictionary<int, List<UserYanlingVo>> tempDic = new Dictionary<int, List<UserYanlingVo>>();
- foreach (KeyValuePair<int, List<UserYanlingVo>> kv in dic)
- {
- List<UserYanlingVo> eList = kv.Value;
- for (int i = 0; i < eList.Count; i++)
- {
- //内循环
- for (int j = 0; j < eList.Count - 1; j++)
- {
- if (order == 0)
- {
- //从大到小排序 (改成< 就是从小到大)
- if (eList[i].nMo.quality > eList[j].nMo.quality)
- {
- UserYanlingVo temp;
- temp = eList[i];
- eList[i] = eList[j];
- eList[j] = temp;
- }
- }
- else
- {
- //从大到小排序 (改成< 就是从小到大)
- if (eList[i].nMo.quality < eList[j].nMo.quality)
- {
- UserYanlingVo temp;
- temp = eList[i];
- eList[i] = eList[j];
- eList[j] = temp;
- }
- }
- }
- }
- tempDic[kv.Key] = eList;
- }
- Dictionary<int, List<UserYanlingVo>> retDic;
- if (order == 0)
- {
- retDic = tempDic.OrderByDescending(o => o.Key).ToDictionary(o => o.Key, p => p.Value);
- }
- else
- {
- retDic = tempDic.OrderBy(o => o.Key).ToDictionary(o => o.Key, p => p.Value);
- }
- foreach (KeyValuePair<int, List<UserYanlingVo>> kv in retDic)
- {
- li.AddRange(kv.Value);
- }
- }
- return li;
- //return UserProxy.Instance.player.collectYanling.items.Values.ToList().ConvertAll(i => i as ItemVo);
- //return UserProxy.Instance.player.collectItem.GetItemList(EItemSubType.YanLing);
- }
- #region------------>分类调整
- /// <summary>
- /// 养成道具
- /// </summary>
- /// <returns></returns>
- public List<ItemVo> GetYangChengItemList()
- {
- var li = new List<ItemVo>();
- var bag = UserProxy.Instance.player.collectItem;
- li.AddRange(bag.GetStoreData(EItemSubType.Gene));
- li.AddRange(bag.GetStoreData(EItemSubType.StrengthStone));
- li.AddRange(bag.GetStoreData(EItemSubType.StrengthStone_Wuqi));
- li.AddRange(bag.GetStoreData(EItemSubType.ElementTuPoMaterial));
- li.AddRange(bag.GetStoreData(EItemSubType.professionTuPoMaterial));
- li.AddRange(bag.GetStoreData(EItemSubType.YanLingAdvancedStone));
- li.AddRange(bag.GetStoreData(EItemSubType.YanLingAdvancedMaterial));
- li.AddRange(bag.GetStoreData(EItemSubType.WuqiAdvancedStone));
- li.AddRange(bag.GetStoreData(EItemSubType.WuqiAdvancedMaterial));
- li.AddRange(UserProxy.Instance.player.collectItem.GetStoreData(EItemSubType.Segment));
- li.AddRange(bag.GetStoreData(EItemSubType.Gemstone));
- li.AddRange(bag.GetStoreData(EItemSubType.GemTuZhi));
- li.AddRange(bag.GetStoreData(EItemSubType.GemMaterial));
- return li;
- }
- /// <summary>
- /// 养成道具----强化道具字标签
- /// </summary>
- /// <returns></returns>
- public List<ItemVo> GetYangchengStrengthenList()
- {
- var li = new List<ItemVo>();
- var bag = UserProxy.Instance.player.collectItem;
- li.AddRange(bag.GetStoreData(EItemSubType.Gene));
- li.AddRange(bag.GetStoreData(EItemSubType.StrengthStone));
- li.AddRange(bag.GetStoreData(EItemSubType.StrengthStone_Wuqi));
- return li;
- }
- /// <summary>
- /// 养成道具----突破道具子标签
- /// </summary>
- /// <returns></returns>
- public List<ItemVo> GetYangchengTuPoList()
- {
- var li = new List<ItemVo>();
- var bag = UserProxy.Instance.player.collectItem;
- li.AddRange(bag.GetStoreData(EItemSubType.ElementTuPoMaterial));
- li.AddRange(bag.GetStoreData(EItemSubType.professionTuPoMaterial));
- li.AddRange(bag.GetStoreData(EItemSubType.YanLingAdvancedStone));
- li.AddRange(bag.GetStoreData(EItemSubType.YanLingAdvancedMaterial));
- li.AddRange(bag.GetStoreData(EItemSubType.WuqiAdvancedStone));
- li.AddRange(bag.GetStoreData(EItemSubType.WuqiAdvancedMaterial));
- li.AddRange(UserProxy.Instance.player.collectItem.GetStoreData(EItemSubType.Segment));
- return li;
- }
- /// <summary>
- /// 养成道具----宝石子标签
- /// </summary>
- /// <returns></returns>
- public List<ItemVo> GetYangchengGemList()
- {
- var li = new List<ItemVo>();
- var bag = UserProxy.Instance.player.collectItem;
- li.AddRange(bag.GetStoreData(EItemSubType.Gemstone));
- li.AddRange(bag.GetStoreData(EItemSubType.GemTuZhi));
- li.AddRange(bag.GetStoreData(EItemSubType.GemMaterial));
- return li;
- }
- /// <summary>
- /// 材料
- /// </summary>
- /// <returns></returns>
- public List<ItemVo> GetMaterialItemList()
- {
- var li = new List<ItemVo>();
- var bag = UserProxy.Instance.player.collectItem;
- li.AddRange(bag.GetStoreData(EItemSubType.Hunqi));
- li.AddRange(bag.GetStoreData(EItemSubType.AdvancedStone));
-
- List<ItemVo> list = bag.GetItemList(EItemSubType.YanlingBook);
- List<ItemVo> tempList = new List<ItemVo>();
- foreach (ItemVo vo in list)
- {
- if (vo.count>1)
- {
- for(int i = 0; i < vo.count; i++)
- {
- ItemVo nVo = new ItemVo();
- nVo.typeId = vo.typeId;
- nVo.count = 1;
- tempList.Add(nVo);
- }
- }
- else
- {
- tempList.Add(vo);
- }
- }
- li.AddRange(tempList);
- return li;
- }
- public List<ItemVo> GetMaterialList()
- {
- List<ItemVo> li = this.GetMaterialItemList();
- List<ItemVo> list = new List<ItemVo>();
- if (li.Count != 0)
- {
- foreach (ItemVo vo in li)
- {
- if (vo.nMo.subType == (int)EItemSubType.Hunqi || vo.nMo.subType == (int)EItemSubType.AdvancedStone)
- {
- list.Add(vo);
- }
- }
- }
- return li;
- }
- public List<ItemVo> GetMaterialBookList()
- {
- List<ItemVo> li = this.GetMaterialItemList();
- List<ItemVo> list = new List<ItemVo>();
- if (li.Count != 0)
- {
- foreach (ItemVo vo in li)
- {
- if (vo.nMo.subType == (int)EItemSubType.YanlingBook)
- {
- list.Add(vo);
- }
- }
- }
- return li;
- }
- #endregion
- #region 子界面
- /// <summary>
- /// 获取武器详情信息(下期)
- /// </summary>
- /// <param name="_wp"></param>
- /// <returns></returns>
- public WeaponDetailUI GetWeaponDetails(EquipeMentVo _wp)
- {
- return new WeaponDetailUI(_wp);
- }
- /// <summary>
- /// 武器详情界面
- /// </summary>
- public class WeaponDetailUI
- {
- public EquipeMentVo weapon { get; }
- public WeaponDetailUI(EquipeMentVo _wp)
- {
- this.weapon = _wp;
- }
- /// <summary>
- /// 名称
- /// </summary>
- public string Title { get { return this.weapon.nMo.name; } }
- /// <summary>
- /// 锁定状态
- /// </summary>
- public bool IsLocked { get { return this.weapon.isLocked != 0; } }
- public string Img { get { return this.weapon.nMo.img; } }
- /// <summary>
- /// 用着这个武器的英雄
- /// </summary>
- public GameHeroVo UsingHero
- {
- get
- {
- // 根据id提取英雄.
- var hero = UserProxy.Instance.player.collectHero.GetHeroGameInfoByHeroUId(this.weapon.WhoIsUsing.ToString());
- if (hero != null)
- {
- return hero;
- }
- return null;
- }
- }
- /// <summary>
- /// 品质
- /// </summary>
- public int quality { get { return this.weapon.nMo.quality; } }
- /// <summary>
- /// 描述
- /// </summary>
- public string desc { get { return this.weapon.nMo.itemDesc; } }
- /// <summary>
- /// 当前等级
- /// </summary>
- public int level { get { return this.weapon.level; } }
- /// <summary>
- /// 最大等级
- /// </summary>
- public int maxLevel { get { return this.maxLevel; } }
- /// <summary>
- /// 当前经验
- /// </summary>
- public int exp { get { return this.weapon.exp; } }
- /// <summary>
- /// 升级所需经验
- /// </summary>
- public int maxExp { get { return sm_itemlevel.GetMoById(this.weapon.level).needExp; } }
- /// <summary>
- /// 攻击
- /// </summary>
- public int attack { get { return this.weapon.nMo.GetWeaponExt().atk; } }
- /// <summary>
- /// 会心一击,待议
- /// </summary>
- public int 会心 { get { return 1; } }
- /// <summary>
- /// 武器技能
- /// </summary>
- public List<sm_skill> Skills
- {
- get
- {
- var li = new List<sm_skill>();
- //this.weapon.nMo.skills;
- return li;
- }
- }
-
- }
- #endregion
- #region----->背包解锁新加字段
- /// <summary>
- /// 当前容量
- /// </summary>
- public int curCapacity
- {
- get
- {
- int initNum = int.Parse(GameConfigData.Ins.globalsettings.Item_Packet_InitNum_New.ToString());
- if (UserProxy.Instance.player.PrivateState.expandNum == 0)
- {
- return initNum;
- }
-
- int explandNum = UserProxy.Instance.player.PrivateState.expandNum;
- Dictionary<int, sm_expandStoreNum> expandStoreNum = GameConfigData.Ins.expandStoreNum;
- for (int i = 1;i<=explandNum;i++)
- {
- if (expandStoreNum.ContainsKey(i))
- {
- initNum += expandStoreNum[i].expandNum;
- }
- }
- return initNum;
- }
- }
- /// <summary>
- /// 最大容量
- /// </summary>
- public int maxCapacity
- {
- get
- {
- return int.Parse(GameConfigData.Ins.globalsettings.Item_Packet_MaxNum_New.ToString());
- }
- }
- /// <summary>
- /// 扩容消耗金币数量
- /// </summary>
- public int explandCostNum
- {
- get
- {
- int expandNum = UserProxy.Instance.player.PrivateState.expandNum;
- int count = GameConfigData.Ins.expandStoreNum.Count;
- if (expandNum >= count)
- {
- return 0;
- }
- return int.Parse(GameConfigData.Ins.GetexpandStoreNumMo(expandNum+1).cost);
- }
- }
- #endregion
- }
|