예제 #1
0
        public void ResetCache(int profession)
        {
            SkillList.Clear();
            CarryList.Clear();

            var skillConfig = new ShareCacheStruct <Config_Skill>();
            var list        = skillConfig.FindAll(t => (
                                                      t.SkillGroup == profession /* && (t.SkillID % 10000 == 0 || t.SkillID % 10000 == 1)*/)
                                                  );

            foreach (var v in list)
            {
                AddSkill(v.SkillID);
            }

            if (list.Count > 3)
            {
                Random random = new Random();
                while (CarryList.Count < 3)
                {
                    int index      = random.Next(list.Count);
                    int addSkillId = list[index].SkillID;
                    if (addSkillId == 10000 || addSkillId == 20000)
                    {
                        continue;
                    }
                    if (CarryList.Find(t => t == addSkillId) == 0)
                    {
                        CarryList.Add(addSkillId);
                    }
                }
            }
        }
예제 #2
0
 private void UpdateSkills(Character currentCharacter)
 {
     if (SkillListObject == null)
     {
         return;
     }
     if (currentCharacter == null)
     {
         SkillListObject.Clear();
         return;
     }
     foreach (string skillname in currentCharacter.GetSkills())
     {
         SkillListObject.SetSkill(skillname,
                                  currentCharacter.GetSkillType(skillname),
                                  currentCharacter.GetSkillMod(skillname),
                                  currentCharacter.HasProficiency(skillname));
     }
 }
예제 #3
0
 public void AllClear()
 {
     SkillList.Clear();
     SkillItemList.Clear();
 }