少年修仙传客户端代码仓库
5470 【bt9】成就系统领取奖励问题
5471 【bt9】增加成就可领取 前置显示
1个文件已修改
28 ■■■■■ 已修改文件
System/Achievement/AchievementModel.cs 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Achievement/AchievementModel.cs
@@ -17,7 +17,7 @@
        Dictionary<int, Achievement> achievements = new Dictionary<int, Achievement>();
        Dictionary<int, List<int>> achievementCategorys = new Dictionary<int, List<int>>();//客户端必须按group分类
        public Dictionary<int, int> groupToType = new Dictionary<int, int>();
        public Dictionary<int, List<int>> groupToType = new Dictionary<int, List<int>>();
        public Dictionary<int, List<int>> typeToGroup = new Dictionary<int, List<int>>(); //所有的类型对应组别
        public Dictionary<int, int> typeToGroupBP = new Dictionary<int, int>(); //战令的类型对应组别
@@ -87,7 +87,10 @@
            }
            foreach (var succGroup in SuccessBPArray)
            {
                UpdateSuccessBPRedpoint(0, groupToType[succGroup]);
                foreach (var type in groupToType[succGroup])
                {
                    UpdateSuccessBPRedpoint(0, type);
                }
            }
        }
@@ -205,12 +208,12 @@
                    if (Achievement.IsReach(_achievementId, _progress))
                    {
                        if (!reachSuccessIDs.Contains(_achievementId))
                            reachSuccessIDs.Add(_achievementId);
                        if (achievementAwardableEvent != null)
                        {
                            achievementAwardableEvent(_achievementId);
                        }
                        if (!reachSuccessIDs.Contains(_achievementId))
                            reachSuccessIDs.Add(_achievementId);
                    }
                }
            }
@@ -940,14 +943,27 @@
            SuccessBPArray =  GeneralDefine.GetIntArray("PracticeSuccess");
            for (int i = 0; i < SuccessBPArray.Length; i++)
            {
                typeToGroupBP[groupToType[SuccessBPArray[i]]] = SuccessBPArray[i];
                foreach (var type in groupToType[SuccessBPArray[i]])
                {
                    typeToGroupBP[type] = SuccessBPArray[i];
                }
            }
            SortAchievementCategorys();
        }
        //对于表:一个类型可以分不同组别(功能),一个组有多个类型
        //对于功能:一个类型只有一个组别,一个组有多个类型
        void UpdateGroupType(SuccessConfig config)
        {
            groupToType[config.Group] = config.Type;
            if (!groupToType.ContainsKey(config.Group))
            {
                groupToType[config.Group] = new List<int>();
            }
            if (groupToType[config.Group].IndexOf(config.Type) == -1)
            {
                groupToType[config.Group].Add(config.Type);
            }
            if (!typeToGroup.ContainsKey(config.Type))
            {
                typeToGroup[config.Type] = new List<int>();