Add files via upload
This commit is contained in:
commit
ce44b3692c
|
@ -0,0 +1,39 @@
|
|||
<ModMetaData>
|
||||
<name>RJW Genes Addons</name>
|
||||
<author>Shaba</author>
|
||||
<packageId>Shaba.rjw.genes.addons</packageId>
|
||||
<supportedVersions>
|
||||
<li>1.4</li>
|
||||
</supportedVersions>
|
||||
<description>Adds additional contentfor RJW Genes</description>
|
||||
<modDependencies>
|
||||
<li>
|
||||
<packageId>ludeon.rimworld.biotech</packageId>
|
||||
<displayName>Biotech</displayName>
|
||||
</li>
|
||||
<li>
|
||||
<packageId>rim.job.world</packageId>
|
||||
<displayName>RimJobWorld</displayName>
|
||||
<downloadUrl>https://www.loverslab.com/files/file/7257-rimjobworld/</downloadUrl>
|
||||
</li>
|
||||
<li>
|
||||
<packageId>brrainz.harmony</packageId>
|
||||
<displayName>Harmony</displayName>
|
||||
<steamWorkshopUrl>steam://url/CommunityFilePage/2009463077</steamWorkshopUrl>
|
||||
<downloadUrl>https://github.com/pardeike/HarmonyRimWorld/releases/latest</downloadUrl>
|
||||
</li>
|
||||
<!--
|
||||
<li>
|
||||
<packageId>UnlimitedHugs.HugsLib</packageId>
|
||||
<displayName>HugsLib</displayName>
|
||||
<downloadUrl>https://github.com/UnlimitedHugs/RimworldHugsLib/releases/latest</downloadUrl>
|
||||
<steamWorkshopUrl>steam://url/CommunityFilePage/818773962</steamWorkshopUrl>
|
||||
</li>
|
||||
-->
|
||||
</modDependencies>
|
||||
<loadAfter>
|
||||
<li>rim.job.world</li>
|
||||
<li>brrainz.harmony</li>
|
||||
<li>ludeon.rimworld.biotech</li>
|
||||
</loadAfter>
|
||||
</ModMetaData>
|
Binary file not shown.
|
@ -0,0 +1,21 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<Defs>
|
||||
<!-- Mechbreeder -->
|
||||
<GeneDef>
|
||||
<defName>rjw_genes_mechbreeder</defName>
|
||||
<label>Mechbreeder</label>
|
||||
<description>Pawns with this gene are able to birth mechanoids unharmed.</description>
|
||||
<iconPath>World/WorldObjects/Expanding/Mechanoids</iconPath>
|
||||
<displayOrderInCategory>51</displayOrderInCategory>
|
||||
<displayCategory>Reproduction</displayCategory>
|
||||
</GeneDef>
|
||||
|
||||
<GeneDef>
|
||||
<defName>rjw_genes_insectincubator</defName>
|
||||
<label>InsectIncubator</label>
|
||||
<description>Pawns with this gene are able to hold more insect eggs.</description>
|
||||
<iconPath>World/WorldObjects/Expanding/Mechanoids</iconPath>
|
||||
<displayOrderInCategory>52</displayOrderInCategory>
|
||||
<displayCategory>Reproduction</displayCategory>
|
||||
</GeneDef>
|
||||
</Defs>
|
|
@ -0,0 +1,17 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Verse;
|
||||
using RimWorld;
|
||||
|
||||
namespace shabe_genesaddons
|
||||
{
|
||||
[DefOf]
|
||||
public static class GeneDefOf
|
||||
{
|
||||
public static readonly GeneDef rjw_genes_mechbreeder;
|
||||
public static readonly GeneDef rjw_genes_insectincubator;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Verse;
|
||||
|
||||
namespace shabe_genesaddons
|
||||
{
|
||||
public class GeneUtility
|
||||
{
|
||||
public static bool IsMechbreeder(Pawn pawn)
|
||||
{
|
||||
return pawn.genes.HasGene(GeneDefOf.rjw_genes_mechbreeder);
|
||||
}
|
||||
|
||||
public static bool IsInsectIncubator(Pawn pawn)
|
||||
{
|
||||
return pawn.genes.HasGene(GeneDefOf.rjw_genes_insectincubator);
|
||||
}
|
||||
|
||||
public static float MaxEggSizeMul(Pawn pawn)
|
||||
{
|
||||
float MaxEggSize = 1;
|
||||
if (IsInsectIncubator(pawn))
|
||||
{
|
||||
MaxEggSize *= 2;
|
||||
}
|
||||
return MaxEggSize;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Verse;
|
||||
using HarmonyLib;
|
||||
|
||||
|
||||
namespace shabe_genesaddons
|
||||
{
|
||||
[StaticConstructorOnStartup]
|
||||
internal static class HarmonyInit
|
||||
{
|
||||
static HarmonyInit()
|
||||
{
|
||||
Harmony harmony = new Harmony("shabe_genesaddons");
|
||||
harmony.PatchAll();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,58 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using System.Reflection.Emit;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using HarmonyLib;
|
||||
using rjw;
|
||||
namespace shabe_genesaddons
|
||||
{
|
||||
[HarmonyPatch(typeof(Hediff_MechanoidPregnancy), "GiveBirth")]
|
||||
public static class PatchMechBirth
|
||||
{
|
||||
[HarmonyTranspiler]
|
||||
public static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator il)
|
||||
{
|
||||
bool found_call = false;
|
||||
bool found_skip = false;
|
||||
Label skip_label = il.DefineLabel();
|
||||
MethodInfo ismechbreeder = AccessTools.Method(typeof(GeneUtility), "IsMechbreeder");
|
||||
foreach(CodeInstruction codeInstruction in instructions)
|
||||
{
|
||||
//Check if the first opcode after endfinally ldloc_0 is and in that case add the label to skip the code
|
||||
if (found_skip && codeInstruction.opcode == OpCodes.Ldloc_0)
|
||||
{
|
||||
codeInstruction.labels.Add(skip_label);
|
||||
}
|
||||
found_skip = false;
|
||||
if (codeInstruction.opcode == OpCodes.Endfinally)
|
||||
{
|
||||
found_skip = true;
|
||||
}
|
||||
|
||||
yield return codeInstruction;
|
||||
|
||||
if (codeInstruction.opcode == OpCodes.Call)
|
||||
{
|
||||
//Log.Message(codeInstruction.operand.ToString());
|
||||
if (codeInstruction.operand.ToString() == "Boolean TryMakeFilth(Verse.IntVec3, Verse.Map, Verse.ThingDef, System.String, Int32, RimWorld.FilthSourceFlags)")
|
||||
{
|
||||
found_call = true;
|
||||
}
|
||||
}
|
||||
//Triggers after the pop opcode (after generating filth in c#).
|
||||
else if (found_call)
|
||||
{
|
||||
//Load pawn, call function to check if a mechbreeder, and skip past the part which does damage
|
||||
yield return new CodeInstruction(OpCodes.Ldloc_0, null);
|
||||
yield return new CodeInstruction(OpCodes.Call, ismechbreeder);
|
||||
yield return new CodeInstruction(OpCodes.Brtrue_S, skip_label);
|
||||
found_call = false;
|
||||
}
|
||||
}
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection.Emit;
|
||||
using System.Reflection;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using HarmonyLib;
|
||||
using Verse;
|
||||
using RimWorld;
|
||||
using rjw;
|
||||
|
||||
namespace shabe_genesaddons
|
||||
{
|
||||
[HarmonyPatch(typeof(PregnancyHelper), "DoEgg")]
|
||||
static class PatchPregnancyHelper
|
||||
{
|
||||
[HarmonyTranspiler]
|
||||
public static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator il)
|
||||
{
|
||||
//MethodInfo isinsectincubator = AccessTools.Method(typeof(GeneUtility), "IsInsectIncubator");
|
||||
MethodInfo maxeggsizemul = AccessTools.Method(typeof(GeneUtility), "MaxEggSizeMul");
|
||||
FieldInfo partner = AccessTools.Field(typeof(SexProps), "partner");
|
||||
|
||||
Label skiplabel = il.DefineLabel();
|
||||
bool finished = false;
|
||||
foreach (CodeInstruction codeInstruction in instructions)
|
||||
{
|
||||
if (!finished)
|
||||
{
|
||||
if (codeInstruction.opcode == OpCodes.Ldc_R4 && codeInstruction.operand.ToString() == "0")
|
||||
{
|
||||
yield return new CodeInstruction(OpCodes.Ldarg_0, null);
|
||||
yield return new CodeInstruction(OpCodes.Ldfld, partner);
|
||||
//yield return new CodeInstruction(OpCodes.Call, isinsectincubator);
|
||||
yield return new CodeInstruction(OpCodes.Callvirt, maxeggsizemul);
|
||||
//yield return new CodeInstruction(OpCodes.Brfalse_S, skiplabel);
|
||||
yield return new CodeInstruction(OpCodes.Ldloc_0, null);
|
||||
//yield return new CodeInstruction(OpCodes.Ldc_R4, 2f);
|
||||
yield return new CodeInstruction(OpCodes.Mul, null);
|
||||
yield return new CodeInstruction(OpCodes.Stloc_0, null);
|
||||
//codeInstruction.labels.Add(skiplabel);
|
||||
finished = true;
|
||||
}
|
||||
}
|
||||
yield return codeInstruction;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("shabe_genesaddons")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("HP Inc.")]
|
||||
[assembly: AssemblyProduct("shabe_genesaddons")]
|
||||
[assembly: AssemblyCopyright("Copyright © HP Inc. 2022")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("3d62bdb2-ed7b-481b-b00b-0b634d99ec8d")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1 @@
|
|||
d59c68acf3ebb7bba9ec07e36b458fa423e5f1bb
|
|
@ -0,0 +1,4 @@
|
|||
C:\Program Files (x86)\Steam\steamapps\common\RimWorld\Mods\RJW-Genes-Addons\Common\Assemblies\shabe_genesaddons.dll
|
||||
C:\Program Files (x86)\Steam\steamapps\common\RimWorld\Mods\RJW-Genes-Addons\Source\shabe_genesaddons\obj\Debug\shabe_genesaddons.csproj.AssemblyReference.cache
|
||||
C:\Program Files (x86)\Steam\steamapps\common\RimWorld\Mods\RJW-Genes-Addons\Source\shabe_genesaddons\obj\Debug\shabe_genesaddons.csproj.CoreCompileInputs.cache
|
||||
C:\Program Files (x86)\Steam\steamapps\common\RimWorld\Mods\RJW-Genes-Addons\Source\shabe_genesaddons\obj\Debug\shabe_genesaddons.dll
|
Binary file not shown.
|
@ -0,0 +1,68 @@
|
|||
<?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>{3D62BDB2-ED7B-481B-B00B-0B634D99EC8D}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>shabe_genesaddons</RootNamespace>
|
||||
<AssemblyName>shabe_genesaddons</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<Deterministic>true</Deterministic>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>false</DebugSymbols>
|
||||
<DebugType>none</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\..\Common\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>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="0Harmony">
|
||||
<HintPath>..\..\..\Shaba_Addons\Assemblies\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="RJW">
|
||||
<HintPath>..\..\..\RJW\1.4\Assemblies\RJW.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" />
|
||||
<Reference Include="UnityEngine.CoreModule">
|
||||
<HintPath>..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="GeneDefOf.cs" />
|
||||
<Compile Include="HarmonyInit.cs" />
|
||||
<Compile Include="PatchMechBirth.cs" />
|
||||
<Compile Include="PatchPregnancyHelper.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="GeneUtility.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
|
@ -0,0 +1,25 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.2.32519.379
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "shabe_genesaddons", "shabe_genesaddons.csproj", "{3D62BDB2-ED7B-481B-B00B-0B634D99EC8D}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{3D62BDB2-ED7B-481B-B00B-0B634D99EC8D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{3D62BDB2-ED7B-481B-B00B-0B634D99EC8D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{3D62BDB2-ED7B-481B-B00B-0B634D99EC8D}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{3D62BDB2-ED7B-481B-B00B-0B634D99EC8D}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {D21AF08D-662F-448D-AF7A-30E300663E53}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
Loading…
Reference in New Issue