| | |
| | |
|
| | | public class ItemLogicUtility : Singleton<ItemLogicUtility>
|
| | | {
|
| | | private string normalGSFormula;
|
| | | // private string normalGSFormula;
|
| | |
|
| | |
|
| | | private List<int> equipBaseProperties = new List<int>();
|
| | | Dictionary<int, int> equipSkillScores = new Dictionary<int, int>();
|
| | | // private List<int> equipBaseProperties = new List<int>();
|
| | | // Dictionary<int, int> equipSkillScores = new Dictionary<int, int>();
|
| | |
|
| | | PackManager packModel { get { return PackManager.Instance; } }
|
| | | // BuffModel buffDatas { get { return ModelCenter.Instance.GetModel<BuffModel>(); } }
|
| | |
| | |
|
| | | public void Init()
|
| | | {
|
| | | var GSFormulaConfig = FuncConfigConfig.Get("EquipGSFormula");
|
| | | normalGSFormula = GSFormulaConfig.Numerical1;
|
| | | // var GSFormulaConfig = FuncConfigConfig.Get("EquipGSFormula");
|
| | | // normalGSFormula = GSFormulaConfig.Numerical1;
|
| | |
|
| | | var equipSkillScoreJson = JsonMapper.ToObject(GSFormulaConfig.Numerical4);
|
| | | foreach (var key in equipSkillScoreJson.Keys)
|
| | | {
|
| | | var skillId = 0;
|
| | | int.TryParse(key, out skillId);
|
| | | if (skillId != 0)
|
| | | {
|
| | | equipSkillScores[skillId] = (int)equipSkillScoreJson[key];
|
| | | }
|
| | | }
|
| | | // var equipSkillScoreJson = JsonMapper.ToObject(GSFormulaConfig.Numerical4);
|
| | | // foreach (var key in equipSkillScoreJson.Keys)
|
| | | // {
|
| | | // var skillId = 0;
|
| | | // int.TryParse(key, out skillId);
|
| | | // if (skillId != 0)
|
| | | // {
|
| | | // equipSkillScores[skillId] = (int)equipSkillScoreJson[key];
|
| | | // }
|
| | | // }
|
| | |
|
| | | var baseAttr = JsonMapper.ToObject(GSFormulaConfig.Numerical2);
|
| | | if (baseAttr.IsArray)
|
| | | {
|
| | | for (int i = 0; i < baseAttr.Count; i++)
|
| | | {
|
| | | equipBaseProperties.Add(int.Parse(baseAttr[i].ToString()));
|
| | | }
|
| | | }
|
| | | // var baseAttr = JsonMapper.ToObject(GSFormulaConfig.Numerical2);
|
| | | // if (baseAttr.IsArray)
|
| | | // {
|
| | | // for (int i = 0; i < baseAttr.Count; i++)
|
| | | // {
|
| | | // equipBaseProperties.Add(int.Parse(baseAttr[i].ToString()));
|
| | | // }
|
| | | // }
|
| | |
|
| | |
|
| | |
|
| | |
| | |
|
| | | }
|
| | |
|
| | | |
| | |
|
| | |
|
| | | // private Dictionary<int, int> GetEquipLegendProperties(int itemId)
|
| | | // {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | |
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | return isEnough;
|
| | | }
|
| | |
|
| | | public static bool CheckCurrencyCount(int moneyType, long needCount, bool needTips = false)
|
| | | {
|
| | | if (needCount <= 0)
|
| | | {
|
| | | return true;
|
| | | }
|
| | |
|
| | | long haveCount = UIHelper.GetMoneyCnt(moneyType);
|
| | |
|
| | | bool isEnough = haveCount >= needCount;
|
| | |
|
| | | if (!isEnough && needTips)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("LackMoney", moneyType);
|
| | | }
|
| | |
|
| | | return isEnough;
|
| | | }
|
| | |
|
| | | public event Action<string> GetBetterEquipEvent; //得到更好的装备 value 物品的实例ID
|
| | |
|
| | |
| | | // }
|
| | | #endregion
|
| | |
|
| | | |
| | |
|
| | |
|
| | | bool IsCanPutOn(ItemModel item)
|
| | | {
|
| | |
| | |
|
| | | // return itemModel.config.SuiteiD == 0 && itemConfig.SuiteiD != 0;
|
| | | // }
|
| | | #region 获得英雄物品展示立绘
|
| | | public List<int> poplhHeroIdList = new List<int>();
|
| | |
|
| | | public void SetHeroList(List<Item> items)
|
| | | {
|
| | | if (items.IsNullOrEmpty())
|
| | | return;
|
| | | foreach (var item in items)
|
| | | {
|
| | | int itemId = item.id;
|
| | | if (HeroConfig.HasKey(itemId) &&
|
| | | HeroConfig.Get(itemId).Quality >= HappyXBModel.Instance.lhQuality)
|
| | | {
|
| | | poplhHeroIdList.Add(itemId);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public void ShowHeroLHWin(List<Item> items)
|
| | | {
|
| | | SetHeroList(items);
|
| | | if (poplhHeroIdList.Count > 0)
|
| | | {
|
| | | if (!UIManager.Instance.IsOpenedInList<HeroShowLHWin>())
|
| | | {
|
| | | UIManager.Instance.OpenWindow<HeroShowLHWin>();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | public Action OnGetItem; //CommonGetItemWin界面关闭时触发
|
| | | public string getItemInfo { get; private set; } //通用显示获得的界面信息
|
| | |
| | | {
|
| | | UIManager.Instance.OpenWindow<CommonGetItemWin>();
|
| | | }
|
| | |
|
| | | ShowHeroLHWin(items);//有传奇以上英雄显示立绘
|
| | | }
|
| | |
|
| | | //可以指定打开的窗口
|
| | |
| | | {
|
| | | UIManager.Instance.OpenWindow<T>();
|
| | | }
|
| | |
|
| | | ShowHeroLHWin(items);//有传奇以上英雄显示立绘
|
| | | }
|
| | | public void ClearGetItem()
|
| | | {
|