From 6ee74a928c81af3ed9c28b32b35ea3510d47dd33 Mon Sep 17 00:00:00 2001 From: a4plane Date: Wed, 28 May 2025 14:09:32 +0900 Subject: [PATCH] =?UTF-8?q?=EB=90=A8=3F=20=3D>=20=EC=95=88=EB=90=A8=20vpe?= =?UTF-8?q?=20=ED=98=B8=ED=99=98=20=3D>=20=EB=A9=94=EC=84=9C=EB=93=9C?= =?UTF-8?q?=EB=A5=BC=20=EC=B0=BE=EC=A7=80=EB=A5=BC=20=EB=AA=BB=ED=95=A8=20?= =?UTF-8?q?=ED=83=80=EC=9E=85=20=ED=95=9C=EB=B2=88=20=EB=B4=90=EC=95=BC?= =?UTF-8?q?=ED=95=A0=EB=93=AF=20=EB=B0=94=EB=8B=90=EB=9D=BC=20=3D>=20?= =?UTF-8?q?=EB=A7=9D=EA=B0=80=EC=A7=90=20=EC=9C=84=EC=99=80=20=EB=B9=84?= =?UTF-8?q?=EC=8A=B7=ED=95=9C=20=EC=9D=B4=EC=9C=A0=EC=9D=BC=EB=93=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../.idea/.gitignore | 13 +++ .../.idea/indexLayout.xml | 8 ++ .../.idea/vcs.xml | 6 ++ psycastDontNeedPsyfocus/HarmonyPatch.cs | 80 +++++++++++++------ 4 files changed, 83 insertions(+), 24 deletions(-) create mode 100644 .idea/.idea.psycastDontNeedPsyfocus/.idea/.gitignore create mode 100644 .idea/.idea.psycastDontNeedPsyfocus/.idea/indexLayout.xml create mode 100644 .idea/.idea.psycastDontNeedPsyfocus/.idea/vcs.xml diff --git a/.idea/.idea.psycastDontNeedPsyfocus/.idea/.gitignore b/.idea/.idea.psycastDontNeedPsyfocus/.idea/.gitignore new file mode 100644 index 0000000..08fd53b --- /dev/null +++ b/.idea/.idea.psycastDontNeedPsyfocus/.idea/.gitignore @@ -0,0 +1,13 @@ +# 디폴트 무시된 파일 +/shelf/ +/workspace.xml +# Rider에서 무시된 파일 +/modules.xml +/.idea.psycastDontNeedPsyfocus.iml +/contentModel.xml +/projectSettingsUpdater.xml +# 에디터 기반 HTTP 클라이언트 요청 +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/.idea.psycastDontNeedPsyfocus/.idea/indexLayout.xml b/.idea/.idea.psycastDontNeedPsyfocus/.idea/indexLayout.xml new file mode 100644 index 0000000..7b08163 --- /dev/null +++ b/.idea/.idea.psycastDontNeedPsyfocus/.idea/indexLayout.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/.idea.psycastDontNeedPsyfocus/.idea/vcs.xml b/.idea/.idea.psycastDontNeedPsyfocus/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/.idea.psycastDontNeedPsyfocus/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/psycastDontNeedPsyfocus/HarmonyPatch.cs b/psycastDontNeedPsyfocus/HarmonyPatch.cs index a109427..ac15c1a 100644 --- a/psycastDontNeedPsyfocus/HarmonyPatch.cs +++ b/psycastDontNeedPsyfocus/HarmonyPatch.cs @@ -11,32 +11,64 @@ namespace psycastDontNeedPsyfocus static HarmonyPatches() { var harmony = new Harmony("com.a4plane.psycastDontNeedPsyfocus"); - harmony.PatchAll(Assembly.GetExecutingAssembly()); + //harmony.PatchAll(Assembly.GetExecutingAssembly()); + + var VPEMod = AccessTools.TypeByName("VanillaPsycastsExpanded.AbilityExtension"); + if (VPEMod != null) + { + Log.Message("find VPE"); + var method = AccessTools.Method(VPEMod, "GetPsyfocusUsedByPawn"); + if (method != null) + { + harmony.Patch(method, postfix: new HarmonyMethod(typeof(HarmonyPatches), nameof(Postfix_VPE))); + } + } + else + { + Log.Message("Cant find vpe"); + } + + var Vmethod = typeof(AbilityDef).GetProperty(nameof(AbilityDef.PsyfocusCost)).GetGetMethod(); + harmony.Patch(Vmethod, postfix: new HarmonyMethod(typeof(HarmonyPatch), nameof(Postfix_V))); + if (Vmethod != null) + { + Log.Message("find v method"); + } + } + + public static void Postfix_VPE(ref float __result) + { + Log.Message("qweqwwqe"); + __result = 0; + } + + public static void Postfix_V(ref float __result) + { + Log.Message("eweqw"); + __result = 0; } } - //def에서 초집중 값 읽어오는 부분 패치해서 됨 //todo ui에서 초집중 요소 날리기 - [HarmonyPatch] - class Patcher - { - public static MethodBase TargetMethod() - { - return typeof(AbilityDef).GetProperty(nameof(AbilityDef.PsyfocusCost)).GetGetMethod(); - } - - public static void Postfix(ref float __result) - { - //Log.Message("qewqwe"); - __result = 0f; - } - //public static class ValidateTarget_ValidateTarget_Patch - //{ - // static void postfix(ref bool __result/*,ref Ability ability*/) - // { - // Log.Message("aaa"); - // __result = true; - // } - //} - } + //[HarmonyPatch] + //class Patcher + //{ + // public static MethodBase TargetMethod() + // { + // return typeof(AbilityDef).GetProperty(nameof(AbilityDef.PsyfocusCost)).GetGetMethod(); + // } + // public static void Postfix(ref float __result) + // { + // //Log.Message("qewqwe"); + // __result = 0f; + // } + // //public static class ValidateTarget_ValidateTarget_Patch + // //{ + // // static void postfix(ref bool __result/*,ref Ability ability*/) + // // { + // // Log.Message("aaa"); + // // __result = true; + // // } + // //} + //} }