From 03e8954c0eac6a8c25205b27fc33bfcea7afafc4 Mon Sep 17 00:00:00 2001 From: MADxingjin <25790044+MADxingjin@users.noreply.github.com> Date: Tue, 13 Jun 2023 13:35:29 +0800 Subject: [PATCH] Project Created --- .gitignore | 3 + About/About.xml | 11 ++++ Assemblies/Isekaiob.OverPoweredMeditation.dll | Bin 0 -> 5632 bytes Assemblies/Isekaiob.OverPoweredMeditation.pdb | Bin 0 -> 24064 bytes .../Isekaiob.OverPoweredMeditation.csproj | 60 ++++++++++++++++++ .../Isekaiob.OverPoweredMeditation.sln | 25 ++++++++ .../PatchMain.cs | 30 +++++++++ .../Postfix_JobDriver_Meditate.cs | 36 +++++++++++ .../Properties/AssemblyInfo.cs | 36 +++++++++++ .../packages.config | 4 ++ 10 files changed, 205 insertions(+) create mode 100644 .gitignore create mode 100644 About/About.xml create mode 100644 Assemblies/Isekaiob.OverPoweredMeditation.dll create mode 100644 Assemblies/Isekaiob.OverPoweredMeditation.pdb create mode 100644 Source/Isekaiob.OverPoweredMeditation/Isekaiob.OverPoweredMeditation.csproj create mode 100644 Source/Isekaiob.OverPoweredMeditation/Isekaiob.OverPoweredMeditation.sln create mode 100644 Source/Isekaiob.OverPoweredMeditation/PatchMain.cs create mode 100644 Source/Isekaiob.OverPoweredMeditation/Postfix_JobDriver_Meditate.cs create mode 100644 Source/Isekaiob.OverPoweredMeditation/Properties/AssemblyInfo.cs create mode 100644 Source/Isekaiob.OverPoweredMeditation/packages.config diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b29134b --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +Source/isekaiob.OverPoweredMeditation/obj +Source/isekaiob.OverPoweredMeditation/.vs +Source/isekaiob.OverPoweredMeditation/packages \ No newline at end of file diff --git a/About/About.xml b/About/About.xml new file mode 100644 index 0000000..3c3c453 --- /dev/null +++ b/About/About.xml @@ -0,0 +1,11 @@ + + + + [IKOB]Overpowered Meditation + isekaiob + +
  • 1.4
  • +
    + isekaiob.OverPowredMeditation + Psycaster recoveres rest when meditating! +
    \ No newline at end of file diff --git a/Assemblies/Isekaiob.OverPoweredMeditation.dll b/Assemblies/Isekaiob.OverPoweredMeditation.dll new file mode 100644 index 0000000000000000000000000000000000000000..4bb27e46e3e92284024842663708efddf0b3b2d2 GIT binary patch literal 5632 zcmeHLYit}>6+W|LJGPU$iJf;VXA+0jb?jmNAdQoz^<$lQllXym;}YU@Gdp{|o_Ka< znVEIGga%hBpztb4mBJs8Q2EiQQpK~BN)-eNNK5krija_aq!mb!5CZ=21Br(3+}T}k z;>eK*zpCENJ@>rsx#ym9=iKXzef%q=5>XBM&6`B8V&pa;;p$)s;-($1HPQDQuI+qP zId*Mla?bL#yys>;Bd3{$;jwvcVd-=VW z%d1_dUD{eDO0*7~`jGp_Js36g0d%7E5|4y_Goy|Hwaw67t$im~l@g8l)Vk4oF&fq@hBqbtoWxH`7)bcC;wyVH}%H zkrryCtB^J#?4#iPQf-0e74;S9+^;r*|DVXifX}N8-&Pp@K|)9J|DuGaINSqAp0P~i zQe;Hp&nWBZB{if}x&Z1^h!o3In$&pTU){PxO@q!$>a$z7VFwB=hBA6Vodv})i&6t^ zQx)0(SV!9c8|e|i_0%n4zl4Jl#wGlygeN3405_2(@lQxtl<*nAI{GHycKQw-pq=z1 z$-hEBP#*%`9oa({rOq34EwYy`)2_&Vz<%{{`W1ac9in&WZS@fSlYXuoq2Ez$BuP50 z#W~Zdg$jTV(DQ(8^mV{JbOo?i!UGZxOa4*%1^5ZcIVqt@e*$No8Wf#;+N=!IIm##( z=mJ?vH`OeKrwD;5wM&R zdRPPrM0?t>3xXJniP?$SGDf(Toh&7aejsvs$&y}*1xu2aIX@-*fbnB)wtNC6jli5E zL^U;P_>+Foww!sA%t70xxG&}n%T4PO$oHgsR(K*)$~t1GXP^?U7)}{8EJr#tvKR=5 zvk>xAE6xmyRySVRikP*9$ytG|vkv7MlvCO@oR~Abyj;^VkzhaYkOtSAa1bFcDCFg& z)VL5CKj|6fyzrI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EBG~;&Zg2zV$bM1%RY(d#LMRU|ohw~vUOU&Qb-7ZRlGV^EXDo1C2 zU6cHSbnuq7cuJLq%#0*0W4eF9?Q1=Q85jG`d%xx~GX>sbxy)^zJ0vYCOJ$YflA8TMBx(6 zb$kc-F&PuUHatmb_}cp^19XEognlaXQQl7oN2v|ii~SVfUxzOpzOF?Spda$9!|!G6 z@=!0%9ynx@kIc9Sgf5|L=nuMv{-AHzqu>*^=V}V@QNh;XP`Cu9vgZnKmA5e8BmkQn zU}H1IpSQXM`2GK_uHpRe2V0-t|Kyj^j7x3D%#0iOq>7`TL@;aRu+dHQlMrSA@c;kiUEwTEE!MX2+uJ(NeQo=*{^L(w*QHb3{~s5o`J{;Z|7ZL) z*2FZv@tYF(@45ef29vmeD)6h1Q7E?mAAaS{6zIPVGyMP6gzuw(I|Lkyo&NuOD2?xc v?xuh{9o*;O{s7~_>HptAX`DCjrNI6FB!nUW?$ + + + + Debug + AnyCPU + {A0EC4299-4B3E-4FF6-8926-ECEB701A1C33} + Library + Properties + Isekaiob.OverPoweredMeditation + Isekaiob.OverPoweredMeditation + v4.7.2 + 512 + true + + + true + full + false + ..\..\Assemblies\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + ..\..\Assemblies\ + TRACE + prompt + 4 + + + + packages\Lib.Harmony.2.2.2\lib\net472\0Harmony.dll + False + + + ..\..\..\..\RimWorldWin64_Data\Managed\Assembly-CSharp.dll + False + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Source/Isekaiob.OverPoweredMeditation/Isekaiob.OverPoweredMeditation.sln b/Source/Isekaiob.OverPoweredMeditation/Isekaiob.OverPoweredMeditation.sln new file mode 100644 index 0000000..89bdcdb --- /dev/null +++ b/Source/Isekaiob.OverPoweredMeditation/Isekaiob.OverPoweredMeditation.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.6.33717.318 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Isekaiob.OverPoweredMeditation", "Isekaiob.OverPoweredMeditation.csproj", "{A0EC4299-4B3E-4FF6-8926-ECEB701A1C33}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {A0EC4299-4B3E-4FF6-8926-ECEB701A1C33}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A0EC4299-4B3E-4FF6-8926-ECEB701A1C33}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A0EC4299-4B3E-4FF6-8926-ECEB701A1C33}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A0EC4299-4B3E-4FF6-8926-ECEB701A1C33}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {25CC627E-AEA8-4AE8-B286-3486E335CB0B} + EndGlobalSection +EndGlobal diff --git a/Source/Isekaiob.OverPoweredMeditation/PatchMain.cs b/Source/Isekaiob.OverPoweredMeditation/PatchMain.cs new file mode 100644 index 0000000..d940ee8 --- /dev/null +++ b/Source/Isekaiob.OverPoweredMeditation/PatchMain.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using HarmonyLib; +using RimWorld; +using Verse; + +namespace Isekaiob.OverPoweredMeditation +{ + [StaticConstructorOnStartup] + public class PatchMain + { + static PatchMain() + { + Log.Message("[IKOB] OverPowered Meditation now patching Assemblies using harmony"); + Harmony hinstance = new Harmony("Isekaiob.OverPoweredMeditation"); + hinstance.PatchAll(Assembly.GetExecutingAssembly()); + +#if DEBUG + foreach (var VARIABLE in hinstance.GetPatchedMethods()) + { + Verse.Log.Message(string.Format("[IKOB]OPM Patched Method {0}", VARIABLE.Name)); + } +#endif + } + } +} diff --git a/Source/Isekaiob.OverPoweredMeditation/Postfix_JobDriver_Meditate.cs b/Source/Isekaiob.OverPoweredMeditation/Postfix_JobDriver_Meditate.cs new file mode 100644 index 0000000..67c2e4a --- /dev/null +++ b/Source/Isekaiob.OverPoweredMeditation/Postfix_JobDriver_Meditate.cs @@ -0,0 +1,36 @@ +// Isekaiob.OverPoweredMeditation / Isekaiob.OverPoweredMeditation / Postfix_JobDriver_Meditate.cs +// CREATED AT 2023 / 06 / 13 + +using HarmonyLib; +using RimWorld; +using Verse; +namespace Isekaiob.OverPoweredMeditation +{ + public static class PatchBody + { + [HarmonyPatch(typeof(RimWorld.JobDriver_Meditate),"MeditationTick")] + static class Patch_JobDriver_Meditation + { + static void Postfix(JobDriver_Meditate __instance) + { + var p = __instance.pawn; + if (!p.HasPsylink) + { +#if DEBUG + Log.Message($"{p.NameFullColored}Doesn`t have a psylink."); +#endif + return; + } + + if (p.needs.rest != null) + { + p.needs.rest.TickResting(p.GetStatValue(StatDefOf.PsychicSensitivity)); +#if DEBUG + Log.Message($"{p.NameFullColored}Successfully recovered rest need when meditating"); +#endif + return; + } + } + } + } +} \ No newline at end of file diff --git a/Source/Isekaiob.OverPoweredMeditation/Properties/AssemblyInfo.cs b/Source/Isekaiob.OverPoweredMeditation/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..4c8fa31 --- /dev/null +++ b/Source/Isekaiob.OverPoweredMeditation/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 有关程序集的一般信息由以下 +// 控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("Isekaiob.OverPoweredMeditation")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Isekaiob.OverPoweredMeditation")] +[assembly: AssemblyCopyright("Copyright © 2023")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 将 ComVisible 设置为 false 会使此程序集中的类型 +//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 +//请将此类型的 ComVisible 特性设置为 true。 +[assembly: ComVisible(false)] + +// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID +[assembly: Guid("a0ec4299-4b3e-4ff6-8926-eceb701a1c33")] + +// 程序集的版本信息由下列四个值组成: +// +// 主版本 +// 次版本 +// 生成号 +// 修订号 +// +//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 +//通过使用 "*",如下所示: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Source/Isekaiob.OverPoweredMeditation/packages.config b/Source/Isekaiob.OverPoweredMeditation/packages.config new file mode 100644 index 0000000..c5bef78 --- /dev/null +++ b/Source/Isekaiob.OverPoweredMeditation/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file