static void Postfix(OcSkillManager __instance) { if (!Directory.Exists("Log")) { Directory.CreateDirectory("Log"); } // 出力する言語 string[] language = new string[] { "English", "Chinese (Simplified)", "Japanese" }; string[] filepathFix = new string[] { "En", "Cn", "Jp" }; string header = "ID\tCategory\tCategoryName\tTier\tSkillName\tMaxLevel\tDescription\tIconName"; for (int i = 0; i < language.Length; i++) { LanguageManager.ChangeLanguage(language[i]); SoSkillDataList skillList = Traverse.Create(__instance).Field("skillList").GetValue <SoSkillDataList>(); OcSkill[] skills = skillList.GetAll(); using (StreamWriter sw = new StreamWriter(SkillLogFilepath.Replace(":LANGUAGE", filepathFix[i]), false, Encoding.UTF8)) { sw.WriteLine(header); foreach (var skill in skills) { // 未実装のスキルは飛ばす if (skill.Category == OcPlSkillCategory.None) { continue; } sw.WriteLine($"{skill.ID}\t{skill.Category}\t{skill.SkillCategoryName}\t{skill.Tier}\t{skill.SkillName}\t{skill.MaxLevel}\t{skill.OriginDesc}\t{skill.SkillIcon.name}"); } } } }
/// <summary> /// /// </summary> /// <param name="__instance"></param> /// <param name="___reqSP_Basic">基本スキルの上位Tierに必要なポイント</param> /// <param name="___reqSP_Combat"></param> /// <param name="___reqSP_Magic"></param> /// <param name="___reqSP_Life"></param> /// <param name="___reqSP_Trick"></param> /// <param name="___reqSP_Tamer"></param> static void Postfix(OcSkillManager __instance, int[] ___reqSP_Basic, int[] ___reqSP_Combat, int[] ___reqSP_Magic, int[] ___reqSP_Life, int[] ___reqSP_Trick, int[] ___reqSP_Tamer) { if (!Directory.Exists("Log")) { Directory.CreateDirectory("Log"); } // 出力する言語 Dictionary <string, string> languages = new Dictionary <string, string>() { { "en", "English" }, { "cn", "Chinese (Simplified)" }, { "jp", "Japanese" }, }; // スキル情報出力 string header = "ID\tCategory\tCategoryName\tTier\tSkillName\tMaxLevel\tDescription\tIconName\n"; foreach (var lang in languages) { LanguageManager.ChangeLanguage(lang.Value); SoSkillDataList skillList = Traverse.Create(__instance).Field("skillList").GetValue <SoSkillDataList>(); OcSkill[] skills = skillList.GetAll(); StringBuilder sb = new StringBuilder(header); foreach (var skill in skills) { if (skill.Category == OcPlSkillCategory.None) { continue; } string desc = skill.OriginDesc.Replace("\r\n", "").Replace("\n", ""); sb.AppendLine($"{skill.ID}\t{skill.Category}\t{skill.SkillCategoryName}\t{skill.Tier}\t{skill.SkillName}\t{skill.MaxLevel}\t{desc}\t{skill.SkillIcon.name}"); } using (StreamWriter sw = new StreamWriter(SkillLogFilepath.Replace(":LANGUAGE", lang.Key), false, Encoding.UTF8)) { sw.WriteLine(sb.ToString()); } } // 上位Tier解除情報出力 { int unknownValueIndex = 2; var teirRange = Enumerable.Range(1, ___reqSP_Basic.Length - unknownValueIndex); string tierHeader = $"Category\t{string.Join("\t", teirRange)}\n"; StringBuilder sb = new StringBuilder(tierHeader); Dictionary <string, int[]> tiers = new Dictionary <string, int[]> { { "Basic", ___reqSP_Basic }, { "Combat", ___reqSP_Combat }, { "Magic", ___reqSP_Magic }, { "Life", ___reqSP_Life }, { "Trick", ___reqSP_Trick }, { "Tamer", ___reqSP_Tamer }, }; foreach (var tier in tiers) { sb.AppendLine($"{tier.Key}\t{string.Join("\t", tier.Value.Skip(unknownValueIndex))}"); } using (StreamWriter sw = new StreamWriter(TierLogFilepath, false, Encoding.UTF8)) { sw.WriteLine(sb.ToString()); } } }