少年修仙传客户端代码仓库
client_linchunjie
2018-11-27 02e3c0c7d8ba5391335023b812edf70f280d2561
5108  【前端】【1.3】神兵新增解锁条件——人物等级
2个文件已修改
68 ■■■■ 已修改文件
System/Role/MagicianModel.cs 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Role/MagicianWin.cs 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Role/MagicianModel.cs
@@ -70,6 +70,7 @@
        public Dictionary<int, string> godWeaponIcons { get; private set; }
        public Dictionary<int, Dictionary<int, int>> godWeaponSkillDict = new Dictionary<int, Dictionary<int, int>>();
        Dictionary<int, List<GodWeaponCondition>> godWeaponConditions = new Dictionary<int, List<GodWeaponCondition>>();
        Dictionary<int, int> playerLevelConditions = new Dictionary<int, int>();
        public List<int> godWeaponSorts = new List<int>();
        Dictionary<int, AutoHammerCost> autoHammerCostDict = new Dictionary<int, AutoHammerCost>();
        Dictionary<int, List<int>> godWeaponStageDict = new Dictionary<int, List<int>>();
@@ -173,6 +174,13 @@
                        level = condition[1],
                    });
                }
            }
            json = LitJson.JsonMapper.ToObject(conditionConfig.Numerical3);
            foreach (var key in json.Keys)
            {
                var type = int.Parse(key);
                playerLevelConditions.Add(type, int.Parse(json[key].ToString()));
            }
            var sortConfig = Config.Instance.Get<FuncConfigConfig>("GodWeaponSort");
@@ -488,19 +496,39 @@
        public bool SatisfyUnlockCondition(int type)
        {
            if (!playerLevelConditions.ContainsKey(type)
                && !godWeaponConditions.ContainsKey(type))
            {
                return true;
            }
            List<GodWeaponCondition> list;
            bool satisfyCondition = false;
            if (godWeaponConditions.TryGetValue(type, out list))
            {
                bool satisfy = true;
                for (int i = 0; i < list.Count; i++)
                {
                    var godWeaponInfo = GetGodWeaponInfo(list[i].type);
                    if (godWeaponInfo == null || godWeaponInfo.level < list[i].level)
                    {
                        return false;
                        satisfy = false;
                        break;
                    }
                }
                if (satisfy)
                {
                    satisfyCondition = true;
                }
            }
            return true;
            var playerLevelLimit = 0;
            if (TryGetPlayerLevelCondition(type, out playerLevelLimit))
            {
                if (PlayerDatas.Instance.baseData.LV >= playerLevelLimit)
                {
                    satisfyCondition = true;
                }
            }
            return satisfyCondition;
        }
        public int GetAutoHammerCount(int type)
@@ -556,7 +584,7 @@
        public bool ContainsCondition(int type)
        {
            return godWeaponConditions.ContainsKey(type);
            return godWeaponConditions.ContainsKey(type) || playerLevelConditions.ContainsKey(type);
        }
        public bool TryGetConditions(int type, out List<GodWeaponCondition> list)
@@ -564,6 +592,11 @@
            return godWeaponConditions.TryGetValue(type, out list);
        }
        public bool TryGetPlayerLevelCondition(int type,out int level)
        {
            return playerLevelConditions.TryGetValue(type, out level);
        }
        public int GetGodWeaponStage(int type)
        {
            var stage = 0;
System/Role/MagicianWin.cs
@@ -524,8 +524,14 @@
            m_ContainerCondition.gameObject.SetActive(requireCondition);
            if (requireCondition)
            {
                var playerLevelLimit = 0;
                model.TryGetPlayerLevelCondition(model.selectType, out playerLevelLimit);
                List<GodWeaponCondition> list;
                if (model.TryGetConditions(model.selectType, out list))
                model.TryGetConditions(model.selectType, out list);
                var limitGodWeaponType = 0;
                var limitGodWeaponLevel = 0;
                if (list != null)
                {
                    var index = 0;
                    for (int i = 0; i < list.Count; i++)
@@ -545,11 +551,26 @@
                    }
                    if (index < list.Count)
                    {
                        var config = GodWeaponConfig.GetConfig(list[index].type, 1);
                        m_GodWeaponCondition.text = StringUtility.Contact(config.Name,
                            Language.Get("GodWeaponCondition", list[index].level));
                        limitGodWeaponType = list[index].type;
                        limitGodWeaponLevel = list[index].level;
                    }
                }
                if (playerLevelLimit > 0 && list != null)
                {
                    var config = GodWeaponConfig.GetConfig(limitGodWeaponType, 1);
                    m_GodWeaponCondition.text = Language.Get("GodWeaponCondition1", playerLevelLimit,
                        config.Name, limitGodWeaponLevel);
                }
                else if (playerLevelLimit > 0 && list == null)
                {
                    m_GodWeaponCondition.text = Language.Get("GodWeaponCondition2", playerLevelLimit);
                }
                else if (playerLevelLimit == 0 && list != null)
                {
                    var config = GodWeaponConfig.GetConfig(limitGodWeaponType, 1);
                    m_GodWeaponCondition.text = StringUtility.Contact(config.Name,
                        Language.Get("GodWeaponCondition", limitGodWeaponLevel));
                }
            }
        }