private static void Postfix(WindowManage __instance, int skillId, int skillTyp, int levelTyp, int actorId, Toggle toggle, ref Text ___informationMassage, ref string ___baseGongFaMassage) { if (Main.enabled && skillTyp != 0 && skillTyp == 1) { int.Parse(DateFile.instance.gongFaDate[skillId][103]);//Get_activeInHierarchy int actorId2 = (actorId != -1) ? actorId : (!ActorMenu.instance.actorMenu.activeInHierarchy ? DateFile.instance.MianActorID() : ActorMenu.instance.acotrId); int num = (levelTyp != -1 && levelTyp != 0) ? 10 : ((skillId != 0) ? DateFile.instance.GetGongFaFLevel(actorId2, skillId) : 0); string str = ___baseGongFaMassage; string text = ""; string str2 = ""; int gongFaFTyp = DateFile.instance.GetGongFaFTyp(actorId2, skillId); int num2 = int.Parse(DateFile.instance.gongFaDate[skillId][103 + ((gongFaFTyp != 0) ? 1 : 0)]); int key = num2 + ((gongFaFTyp == 0) ? 1 : (-1)) * 5000; if (num2 > 0) { int num3 = (gongFaFTyp != 0) ? 1 : 0; str2 = string.Format("{0}{1}{2}\n\n", __instance.SetMassageTitle(8007, 3, 11 + num3, (num3 != 0) ? 20010 : 20005), __instance.Dit(), DateFile.instance.SetColoer(20002, string.Format("{0}{1}{2}{3}", DateFile.instance.gongFaFPowerDate[num2][99], (!(DateFile.instance.gongFaFPowerDate[num2][98] != "")) ? "" : DateFile.instance.massageDate[5001][4], DateFile.instance.gongFaFPowerDate[num2][98], DateFile.instance.massageDate[5001][5]))); str2 = DateFile.instance.SetColoer(20004, string.Format(" 如果{0}练\n", (num3 == 0) ? "正" : "逆")) + str2; text = string.Format("{0}{1}{2}\n\n", __instance.SetMassageTitle(8007, 3, 11 + Math.Abs(num3 - 1), (num3 != 0) ? 20005 : 20010), __instance.Dit(), DateFile.instance.SetColoer(20002, string.Format("{0}{1}\n{2}", new object[3] { DateFile.instance.gongFaFPowerDate[key][99], (!(DateFile.instance.gongFaFPowerDate[key][98] != "") || Math.Abs(num3 - 1) == 0) ? "" : DateFile.instance.massageDate[5001][4], DateFile.instance.gongFaFPowerDate[key][98] }))); text = DateFile.instance.SetColoer(20004, string.Format(" 如果{0}练\n", (num3 == 0) ? "逆" : "正")) + text; } str = (___baseGongFaMassage = ((num < 5 || gongFaFTyp == 2) ? (str + str2 + text) : (str + text))); ___informationMassage.text = str; } }
// 未练出心法效果或心法冲解则两种心法效果都显示 private static void Postfix(WindowManage __instance, int skillId, int skillTyp, int levelTyp, int actorId, Toggle toggle, ref Text ___informationMassage, ref string ___baseGongFaMassage) { if (Main.enabled && skillTyp != 0 && skillTyp == 1) { actorId = (actorId != -1) ? actorId : ((!ActorMenu.instance.actorMenu.activeInHierarchy) ? DateFile.instance.MianActorID() : ActorMenu.instance.actorId); int gongFaFLevel = (levelTyp != -1 && levelTyp != 0) ? 10 : ((skillId != 0) ? DateFile.instance.GetGongFaFLevel(actorId, skillId) : 0); // 心法正/逆类型 int gongFaFTyp = DateFile.instance.GetGongFaFTyp(actorId, skillId); // 心法正练效果 int gongFaFEffect = int.Parse(DateFile.instance.gongFaDate[skillId][103]); if (gongFaFEffect > 0) { // 心法逆练效果 int gongFaBadFEffect = int.Parse(DateFile.instance.gongFaDate[skillId][104]); str.Clear(); str.Append(___baseGongFaMassage); // 未练出心法效果或心法冲解则两种心法效果都显示 if (gongFaFLevel < 5 || gongFaFTyp == 2) { var gongFaTreeWindow = UIManager.Instance.GetUI("GongFaTreeWindow"); var isInGongFaTree = gongFaTreeWindow != null && gongFaTreeWindow.gameObject.activeInHierarchy; if (!isInGongFaTree) { str.Append(DateFile.instance.SetColoer(20004, $" 如果正练\n")) .Append(__instance.SetMassageTitle(8007, 3, 11, 20010)) .Append(__instance.Dit()) .Append(DateFile.instance.SetColoer(20002, $"{DateFile.instance.gongFaFPowerDate[gongFaFEffect][99]}{((DateFile.instance.gongFaFPowerDate[gongFaFEffect][98] == "") ? "" : DateFile.instance.massageDate[5001][4])}{DateFile.instance.gongFaFPowerDate[gongFaFEffect][98]}{DateFile.instance.massageDate[5001][5]}")) .Append("\n\n"); } str.Append(DateFile.instance.SetColoer(20004, $" 如果逆练\n")) .Append(__instance.SetMassageTitle(8007, 3, 12, 20005)) .Append(__instance.Dit()) .Append(DateFile.instance.SetColoer(20002, $"{DateFile.instance.gongFaFPowerDate[gongFaBadFEffect][99]}{((DateFile.instance.gongFaFPowerDate[gongFaBadFEffect][98] == "") ? "" : DateFile.instance.massageDate[5001][4])}{DateFile.instance.gongFaFPowerDate[gongFaBadFEffect][98]}{DateFile.instance.massageDate[5001][5]}")) .Append("\n\n"); } else { // 显示出已练成心法的另外一种心法效果 bool flag = gongFaFTyp == 0; int key = flag ? gongFaBadFEffect : gongFaFEffect; str.Append(DateFile.instance.SetColoer(20004, $" 如果{(flag ? "逆" : "正")}练\n")) .Append(__instance.SetMassageTitle(8007, 3, flag ? 12 : 11, flag ? 20010 : 20005)) .Append(__instance.Dit()) .Append(DateFile.instance.SetColoer(20002, $"{DateFile.instance.gongFaFPowerDate[key][99]}{((DateFile.instance.gongFaFPowerDate[key][98] == "") ? "" : DateFile.instance.massageDate[5001][4])}{DateFile.instance.gongFaFPowerDate[key][98]}{DateFile.instance.massageDate[5001][5]}")) .Append("\n\n"); } ___informationMassage.text = ___baseGongFaMassage = str.ToString(); } } }
static bool Prefix(WindowManage __instance, ref string __result) { if (!Main.enabled || !Main.ReadingItem) { return(true); } __result = $"{__instance.SetMassageTitle(8007, 0, 12)}{__instance.Dit()}{DateFile.instance.massageDate[8006][4]}\n\n"; return(false); }
public static string getBookInfo(WindowManage __instance, int itemId) { bool flag = false; if (ShopSystem.instance.shopWindow.activeInHierarchy || BookShopSystem.instance.shopWindow.activeInHierarchy || Warehouse.instance.warehouseWindow.activeInHierarchy || (ActorMenu.instance.actorMenu.activeInHierarchy && !ActorMenu.instance.isEnemy) || DateFile.instance.actorItemsDate[DateFile.instance.MianActorID()].ContainsKey(itemId)) { flag = true; } string text = ""; if (!flag) { text = string.Format("{0}{1}{2}\n\n", __instance.SetMassageTitle(8007, 0, 12, 10002) , DateFile.instance.massageDate[10][2] , DateFile.instance.massageDate[8006][4]); } else { //页信息 索引 int pagedataindex = int.Parse(DateFile.instance.GetItemDate(itemId, 32, true)); //技能类别 int skillcate = int.Parse(DateFile.instance.GetItemDate(itemId, 31, true)); int[] playerlearned = (skillcate != 17) ? ((!DateFile.instance.skillBookPages.ContainsKey(pagedataindex)) ? new int[10] : DateFile.instance.skillBookPages[pagedataindex]) : ((!DateFile.instance.gongFaBookPages.ContainsKey(pagedataindex)) ? new int[10] : DateFile.instance.gongFaBookPages[pagedataindex]); int[] curbookPage = DateFile.instance.GetBookPage(itemId); int itemtypeid = int.Parse(DateFile.instance.GetItemDate(itemId, 999, true)); //每页可读共计有几页 int[] bagpages = new int[10]; foreach (int actorid in new int[] { DateFile.instance.MianActorID(), -999 }) { foreach (int key in DateFile.instance.actorItemsDate[actorid].Keys) { if (DateFile.instance.GetItemDate(key, 999, true) == itemtypeid.ToString()) { var pages = DateFile.instance.GetBookPage(key); for (int z = 0; z < 10; z++) { if (pages[z] != 0) { bagpages[z]++; } } } } } if (curbookPage.Length > 0) { text += "背包功法页已读统计:\n"; for (int i = 0; i < curbookPage.Length; i++) { text += string.Format("{0}{1}{2}{3}{4}", new object[] { DateFile.instance.massageDate[10][2], DateFile.instance.massageDate[8][2].Split('|')[i], (curbookPage[i] != 1) ? DateFile.instance.SetColoer(20010, DateFile.instance.massageDate[7010][4].Split('|')[0], false) : DateFile.instance.SetColoer(20004, DateFile.instance.massageDate[7010][4].Split('|')[1], false), (playerlearned[i] != 1) ? DateFile.instance.SetColoer(20002, string.Format(" ({0})", DateFile.instance.massageDate[7009][4].Split('|')[2]), false) : DateFile.instance.SetColoer(20005, string.Format(" ({0})", DateFile.instance.massageDate[7009][4].Split('|')[3]), false), (bagpages[i] >= 1) ? DateFile.instance.SetColoer(20004, string.Format(" ○已有{0}页\n", bagpages[i])) : DateFile.instance.SetColoer(20010, string.Format(" ×无此页\n")) }); } text += "\n"; } if (skillcate == 17) { int num2 = int.Parse(DateFile.instance.gongFaDate[pagedataindex][103 + int.Parse(DateFile.instance.GetItemDate(itemId, 35, true))]); if (num2 > 0) { text += string.Format("{0}{1}{2}\n\n", __instance.SetMassageTitle(8007, 0, 14, 10002), DateFile.instance.massageDate[10][2], DateFile.instance.SetColoer(20002, string.Format("{0}{1}{2}{3}{4}", new object[] { DateFile.instance.massageDate[8006][5].Split(new char[] { '|' })[0], DateFile.instance.SetColoer(20001 + int.Parse(DateFile.instance.gongFaDate[pagedataindex][2]), DateFile.instance.gongFaDate[pagedataindex][0], false), DateFile.instance.massageDate[8006][5].Split(new char[] { '|' })[1], DateFile.instance.gongFaFPowerDate[num2][99], DateFile.instance.massageDate[5001][5] }), false)); } } } return(text); }
private static void Postfix(WindowManage __instance, int skillId, int skillTyp, int levelTyp, int actorId, Toggle toggle, ref Text ___informationMassage, ref string ___baseGongFaMassage) { if (Main.enabled && skillTyp != 0 && skillTyp == 1) { actorId = ((actorId != -1) ? actorId : ((!ActorMenu.instance.actorMenu.activeInHierarchy) ? DateFile.instance.MianActorID() : ActorMenu.instance.actorId)); int num = (levelTyp != -1 && levelTyp != 0) ? 10 : ((skillId != 0) ? DateFile.instance.GetGongFaFLevel(actorId, skillId, false) : 0); int gongFaFTyp = DateFile.instance.GetGongFaFTyp(actorId, skillId); int num2 = int.Parse(DateFile.instance.gongFaDate[skillId][103]); if (num2 > 0) { int num3 = int.Parse(DateFile.instance.gongFaDate[skillId][104]); WindowManage_ShowGongFaMassage_Patch.str.Clear(); WindowManage_ShowGongFaMassage_Patch.str.Append(___baseGongFaMassage); if (num < 5 || gongFaFTyp == 2) { WindowManage_ShowGongFaMassage_Patch.str.Append(DateFile.instance.SetColoer(20004, " 如果正练\n", false)).Append(__instance.SetMassageTitle(8007, 3, 11, 20010)).Append(__instance.Dit()).Append(DateFile.instance.SetColoer(20002, DateFile.instance.gongFaFPowerDate[num2][99] + ((DateFile.instance.gongFaFPowerDate[num2][98] == "") ? "" : DateFile.instance.massageDate[5001][4]) + DateFile.instance.gongFaFPowerDate[num2][98] + DateFile.instance.massageDate[5001][5], false)).Append("\n\n"); WindowManage_ShowGongFaMassage_Patch.str.Append(DateFile.instance.SetColoer(20004, " 如果逆练\n", false)).Append(__instance.SetMassageTitle(8007, 3, 12, 20005)).Append(__instance.Dit()).Append(DateFile.instance.SetColoer(20002, DateFile.instance.gongFaFPowerDate[num3][99] + ((DateFile.instance.gongFaFPowerDate[num3][98] == "") ? "" : DateFile.instance.massageDate[5001][4]) + DateFile.instance.gongFaFPowerDate[num3][98] + DateFile.instance.massageDate[5001][5], false)).Append("\n\n"); } else { bool flag = gongFaFTyp == 0; int key = flag ? num3 : num2; WindowManage_ShowGongFaMassage_Patch.str.Append(DateFile.instance.SetColoer(20004, " 如果" + (flag ? "逆" : "正") + "练\n", false)).Append(__instance.SetMassageTitle(8007, 3, flag ? 12 : 11, flag ? 20010 : 20005)).Append(__instance.Dit()).Append(DateFile.instance.SetColoer(20002, DateFile.instance.gongFaFPowerDate[key][99] + ((DateFile.instance.gongFaFPowerDate[key][98] == "") ? "" : DateFile.instance.massageDate[5001][4]) + DateFile.instance.gongFaFPowerDate[key][98] + DateFile.instance.massageDate[5001][5], false)).Append("\n\n"); } Text text = ___informationMassage; string text2; ___baseGongFaMassage = (text2 = WindowManage_ShowGongFaMassage_Patch.str.ToString()); text.text = text2; } } }