| | |
| | | PackModel packModel { get { return ModelCenter.Instance.GetModel<PackModel>(); } }
|
| | | EquipStrengthModel strengthModel { get { return ModelCenter.Instance.GetModel<EquipStrengthModel>(); } }
|
| | | ItemTipsModel itemTipsModel { get { return ModelCenter.Instance.GetModel<ItemTipsModel>(); } }
|
| | | EquipStarModel equipStarModel { get { return ModelCenter.Instance.GetModel<EquipStarModel>(); } }
|
| | | public void SetEquipStrengthFull(string equipGuid, int level, int equipPlace)
|
| | | {
|
| | | int equipIndex = EquipPlaceMapConfig.GetServerPlace(level, equipPlace);
|
| | |
| | | NeedMoney.text = SetMoneyText(itemPlus);
|
| | | m_TextNumber.text = "+" + equipLv;
|
| | | int equipType = strengthModel.GetEquipStrengthType(equipPlace);
|
| | | var equipMaxLv = strengthModel.EquipLevelMaxDic[equipType];
|
| | | if (equipMaxLv != null)
|
| | | {
|
| | | m_TextMaxLv.text = Language.Get("ZBQH_02", equipMaxLv.MaxStar, equipMaxLv.MaxLv);
|
| | | }
|
| | |
|
| | | var star = equipStarModel.GetEquipStarLevel(new Int2(level, equipPlace));
|
| | | var item = packModel.GetItemByGuid(equipGuid);
|
| | | var maxStar = EquipStarModel.GetMaxStarLevel(item.config.ItemColor, level);
|
| | | star = Mathf.Min(star, maxStar);
|
| | |
|
| | | var equipMaxLv = strengthModel.GetEquipLevelMax(equipType, star);
|
| | | m_TextMaxLv.text = Language.Get("ZBQH_02", star, equipMaxLv);
|
| | |
|
| | | if (item != null)
|
| | | {
|
| | | m_ItemEquip.Init(item);
|
| | |
| | | public class EquipStrengthModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk
|
| | | {
|
| | | public Dictionary<int, EquipStrength> EquipStrengthDic = new Dictionary<int, EquipStrength>();//强化数据
|
| | | public Dictionary<int, EquipMaxLvClass> EquipLevelMaxDic = new Dictionary<int, EquipMaxLvClass>();//强化类型的最大等级上限
|
| | | public Dictionary<int, Dictionary<int, int>> EquipLevelMaxDic = new Dictionary<int, Dictionary<int, int>>();//强化类型的最大等级上限
|
| | | public Dictionary<int, int> PartTypeDic = new Dictionary<int, int>();//强化的部位类型
|
| | | public Dictionary<int, int> EvolutionTypeMaxDic = new Dictionary<int, int>();
|
| | | public event Action EquipStrengthUpdate;//强化数据刷新
|
| | |
| | | var itemPlusMax = ItemPlusMaxConfig.GetValues();
|
| | | foreach (var value in itemPlusMax)
|
| | | {
|
| | | if (EquipLevelMaxDic.ContainsKey(value.EquipType))
|
| | | Dictionary<int, int> starLevelDict = null;
|
| | | if (!EquipLevelMaxDic.TryGetValue(value.EquipType, out starLevelDict))
|
| | | {
|
| | | var lv = EquipLevelMaxDic[value.EquipType].MaxLv;
|
| | | if (value.levelMax > lv)
|
| | | {
|
| | | EquipLevelMaxDic[value.EquipType].MaxLv = value.levelMax;
|
| | | EquipLevelMaxDic[value.EquipType].MaxStar = value.equipStar;
|
| | | }
|
| | | starLevelDict = new Dictionary<int, int>();
|
| | | EquipLevelMaxDic.Add(value.EquipType, starLevelDict);
|
| | | }
|
| | | else
|
| | | {
|
| | | EquipMaxLvClass equipMaxLvClass = new EquipMaxLvClass();
|
| | | equipMaxLvClass.MaxStar = value.equipStar;
|
| | | equipMaxLvClass.MaxLv = value.levelMax;
|
| | | EquipLevelMaxDic.Add(value.EquipType, equipMaxLvClass);
|
| | | }
|
| | | starLevelDict.Add(value.equipStar, value.levelMax);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | return type;
|
| | | }
|
| | |
|
| | | public int GetEquipLevelMax(int type)//获取某一类型的最大强化等级
|
| | | public int GetEquipLevelMax(int type,int star)//获取某一类型的最大强化等级
|
| | | {
|
| | | int lv = 0;
|
| | | if (EquipLevelMaxDic.ContainsKey(type))
|
| | | {
|
| | | lv = EquipLevelMaxDic[type].MaxLv;
|
| | | var starLevelDict = EquipLevelMaxDic[type];
|
| | | if (starLevelDict.ContainsKey(star))
|
| | | {
|
| | | return starLevelDict[star];
|
| | | }
|
| | | }
|
| | | return lv;
|
| | | }
|
| | |
| | | [SerializeField] Text m_TextMaxLv; |
| | | PackModel packModel { get { return ModelCenter.Instance.GetModel<PackModel>(); } } |
| | | EquipStrengthModel strengthModel { get { return ModelCenter.Instance.GetModel<EquipStrengthModel>(); } }
|
| | | ItemTipsModel itemTipsModel { get { return ModelCenter.Instance.GetModel<ItemTipsModel>(); } } |
| | | ItemTipsModel itemTipsModel { get { return ModelCenter.Instance.GetModel<ItemTipsModel>(); } }
|
| | | EquipStarModel equipStarModel { get { return ModelCenter.Instance.GetModel<EquipStarModel>(); } } |
| | | |
| | | int equipLevel = 0; |
| | | int equipPlace = 0; |
| | |
| | | DisplayMoney(); |
| | | |
| | | int equipType = strengthModel.GetEquipStrengthType(equipPlace); |
| | | var equipMaxLv = strengthModel.EquipLevelMaxDic[equipType]; |
| | | if (equipMaxLv != null) |
| | | { |
| | | m_TextMaxLv.text = Language.Get("ZBQH_02", equipMaxLv.MaxStar, equipMaxLv.MaxLv); |
| | | } |
| | | |
| | | var star = equipStarModel.GetEquipStarLevel(new Int2(level, equipPlace));
|
| | | var maxStar = EquipStarModel.GetMaxStarLevel(item.config.ItemColor, level);
|
| | | star = Mathf.Min(star, maxStar);
|
| | |
|
| | | var equipMaxLv = strengthModel.GetEquipLevelMax(equipType, star);
|
| | | m_TextMaxLv.text = Language.Get("ZBQH_02", star, equipMaxLv); |
| | | |
| | | ItemCellModel cellModel = new ItemCellModel(2100, true, (ulong)1); |
| | | m_ItemMoney.Init(cellModel); |
| | | m_ItemMoney.button.SetListener(() =>
|
| | |
| | | [SerializeField] Text m_TextMaxLv;
|
| | | PackModel packModel { get { return ModelCenter.Instance.GetModel<PackModel>(); } }
|
| | | EquipStrengthModel strengthModel { get { return ModelCenter.Instance.GetModel<EquipStrengthModel>(); } }
|
| | | ItemTipsModel itemTipsModel { get { return ModelCenter.Instance.GetModel<ItemTipsModel>(); } } |
| | | ItemTipsModel itemTipsModel { get { return ModelCenter.Instance.GetModel<ItemTipsModel>(); } }
|
| | | EquipStarModel equipStarModel { get { return ModelCenter.Instance.GetModel<EquipStarModel>(); } } |
| | | |
| | | int equipLevel = 0; |
| | | int equipPlace = 0; |
| | |
| | | return;
|
| | | }
|
| | | m_TextNumber.text = "+" + (equipLv);
|
| | | int equipType = strengthModel.GetEquipStrengthType(equipPlace);
|
| | | var equipMaxLv = strengthModel.EquipLevelMaxDic[equipType];
|
| | | if (equipMaxLv != null)
|
| | | {
|
| | | m_TextMaxLv.text = Language.Get("ZBQH_02", equipMaxLv.MaxStar, equipMaxLv.MaxLv);
|
| | | }
|
| | | var item = packModel.GetItemByGuid(equipGuid);
|
| | | if (item != null)
|
| | | {
|
| | |
| | | itemTipsModel.ShowUICtrl();
|
| | | });
|
| | | }
|
| | |
|
| | | var star = equipStarModel.GetEquipStarLevel(new Int2(level, equipPlace));
|
| | | var maxStar = EquipStarModel.GetMaxStarLevel(item.config.ItemColor, level);
|
| | | star = Mathf.Min(star, maxStar);
|
| | |
|
| | | int equipType = strengthModel.GetEquipStrengthType(equipPlace);
|
| | |
|
| | | var equipMaxLv = strengthModel.GetEquipLevelMax(equipType, star);
|
| | | m_TextMaxLv.text = Language.Get("ZBQH_02", star, equipMaxLv);
|
| | |
|
| | | ItemCellModel cellModel = new ItemCellModel(2100, true, (ulong)1);
|
| | | m_ItemMoney.Init(cellModel);
|
| | | m_ItemMoney.button.SetListener(() =>
|
| | |
| | | if (equiped)
|
| | | {
|
| | | int equipIndex = EquipPlaceMapConfig.GetServerPlace(equipLevel, equipPlace);
|
| | | int star = equipStarModel.GetStarLevel( new Int2(equipLevel, equipPlace));
|
| | | var item = packModel.GetItemByGuid(equipGuid);
|
| | | var maxStar = EquipStarModel.GetMaxStarLevel(item.config.ItemColor, equipLevel);
|
| | |
|
| | | int star = Mathf.Min(maxStar, equipStarModel.GetStarLevel(new Int2(equipLevel, equipPlace)));
|
| | |
|
| | | int equipLv = 0;
|
| | | int advancedLv = 0;
|
| | | if (strengthModel.EquipStrengthDic.ContainsKey(equipIndex))//获取当前强化等级
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | int maxLv = strengthModel.GetEquipLevelMax(equipType);//获取最大强化等级
|
| | | int maxLv = strengthModel.GetEquipLevelMax(equipType, maxStar);//获取最大强化等级
|
| | | m_EquipEvolution.gameObject.SetActive(true);
|
| | | m_EquipEvolution.SetEquipEvolution(equipPlace, advancedLv);
|
| | | if (equipLv >= maxLv)//满级
|