public static bool TryGetPassivitySkill(uint id, out Skill sk) { bool result = false; sk = new Skill(0, Class.None, string.Empty, string.Empty); if (AbnormalityManager.CurrentDb.Abnormalities.ContainsKey(id)) { var ab = AbnormalityManager.CurrentDb.Abnormalities[id]; result = true; sk = new Skill(id, Class.Common, ab.Name, ""); sk.SetSkillIcon(ab.IconName); } return(result); }
internal static bool TryGetItemSkill(uint itemId, out Skill sk) { bool result = false; sk = new Skill(0, Class.None, string.Empty, string.Empty); if (ItemsDatabase.Instance.Items.ContainsKey(itemId)) { var item = ItemsDatabase.Instance.Items[itemId]; result = true; sk = new Skill(itemId, Class.Common, item.Name, ""); sk.SetSkillIcon(item.Icon); } return(result); }
public static void Load() { var f = File.OpenText(Environment.CurrentDirectory + "/resources/data/skills.tsv"); SkillConnections = new List <SkillConnection>(); Skills = new Dictionary <Class, Dictionary <uint, Skill> >(); for (int i = 0; i <= 12; i++) { Skills.Add((Class)i, new Dictionary <uint, Skill>()); } Skills.Add(Class.Common, new Dictionary <uint, Skill>()); while (true) { var line = f.ReadLine(); if (line == null) { break; } var s = line.Split('\t'); var id = Convert.ToUInt32(s[0]); Enum.TryParse(s[1], out Class c); var name = s[2]; var tooltip = s[3]; var iconName = s[4]; var sk = new Skill(id, c, name, tooltip); sk.SetSkillIcon(iconName); Skills[c].Add(id, sk); var skc = new SkillConnection((int)id, c); for (int i = 5; i < s.Count(); i++) { skc.AddConnectedSkill(Convert.ToInt32(s[i])); } if (skc.ConnectedSkills.Count > 0) { SkillConnections.Add(skc); } } }
//static void AddConnectedSkills() //{ // foreach (var item in SkillConnections) // { // SetConnectedSkills(item); // } //} public static void Populate() { StrSheet_UserSkillsDocs = new List <XDocument>(); SkillIconData = new List <XDocument>(); Skills = new Dictionary <Class, Dictionary <uint, Skill> >(); for (int i = 0; i <= 12; i++) { Skills.Add((Class)i, new Dictionary <uint, Skill>()); } Skills.Add(Class.Common, new Dictionary <uint, Skill>()); LoadFiles(); var n = SkillIconData.Count; Progress?.Invoke(1 * 100 / (n - 1)); foreach (var doc in StrSheet_UserSkillsDocs) { ParseUserSkillDoc(doc); } Progress?.Invoke(2 * 100 / (n - 1)); foreach (var doc in SkillIconData) { ParseSkillIconDoc(doc); Progress?.Invoke((SkillIconData.IndexOf(doc) + 2) * 100 / (n + 1)); } //AddConnectedSkills(); var s = new Skill(60010, Class.Common, "Hurricane", ""); s.SetSkillIcon("Icon_Skills.Armorbreak_Tex"); Skills[Class.Common].Add(s.Id, s); ParseConnectedSkills(); SkillIconData.Clear(); StrSheet_UserSkillsDocs.Clear(); }