Project Created

This commit is contained in:
MADxingjin 2023-06-13 13:35:29 +08:00
commit 03e8954c0e
10 changed files with 205 additions and 0 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
Source/isekaiob.OverPoweredMeditation/obj
Source/isekaiob.OverPoweredMeditation/.vs
Source/isekaiob.OverPoweredMeditation/packages

11
About/About.xml Normal file
View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<ModMetaData>
<name>[IKOB]Overpowered Meditation</name>
<author>isekaiob</author>
<supportedVersions>
<li>1.4</li>
</supportedVersions>
<packageId>isekaiob.OverPowredMeditation</packageId>
<description>Psycaster recoveres rest when meditating!</description>
</ModMetaData>

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,60 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{A0EC4299-4B3E-4FF6-8926-ECEB701A1C33}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Isekaiob.OverPoweredMeditation</RootNamespace>
<AssemblyName>Isekaiob.OverPoweredMeditation</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\Assemblies\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\..\Assemblies\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="0Harmony, Version=2.2.2.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\Lib.Harmony.2.2.2\lib\net472\0Harmony.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Assembly-CSharp">
<HintPath>..\..\..\..\RimWorldWin64_Data\Managed\Assembly-CSharp.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="PatchMain.cs" />
<Compile Include="Postfix_JobDriver_Meditate.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@ -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

View File

@ -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
}
}
}

View File

@ -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;
}
}
}
}
}

View File

@ -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")]

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Lib.Harmony" version="2.2.2" targetFramework="net472" />
</packages>