This commit is contained in:
Stardust3D 2022-01-23 22:06:32 +01:00
parent 7e1cb42210
commit 4300036667
10 changed files with 131 additions and 109 deletions

6
.gitignore vendored
View File

@ -301,9 +301,3 @@ __pycache__/
*.btm.cs *.btm.cs
*.odx.cs *.odx.cs
*.xsd.cs *.xsd.cs
Assemblies/0Harmony.dll
Assemblies/0Harmony.xml
Assemblies/0MultiplayerAPI.dll
Assemblies/Autopsy.dll
Assemblies/RJW.dll
Assemblies/RJW_patch_Autopsy.xml

Binary file not shown.

View File

@ -2,5 +2,5 @@
<Manifest> <Manifest>
<identifier>RJW patch - Harvest Organs Post Mortem</identifier> <identifier>RJW patch - Harvest Organs Post Mortem</identifier>
<version>4943.0.1.3</version> <version>4943.0.1.4</version>
</Manifest> </Manifest>

Binary file not shown.

View File

@ -1,10 +1,14 @@
 
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16 # Visual Studio Version 17
VisualStudioVersion = 16.0.31911.196 VisualStudioVersion = 17.1.32113.165
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RJW_patch_Autopsy", "RJW_patch_Autopsy\RJW_patch_Autopsy.csproj", "{F17C6B3F-BA9D-4133-A201-1265A64BCB71}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RJW_patch_Autopsy", "RJW_patch_Autopsy\RJW_patch_Autopsy.csproj", "{F17C6B3F-BA9D-4133-A201-1265A64BCB71}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RimJobWorld.Main", "..\..\rjw-base\1.3\Source\RimJobWorld.Main.csproj", "{22F82FFF-8BD4-4CEE-9F22-C7DA71281E72}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Autopsy", "..\..\RimwoldAutopsy\Source\Autopsy\Autopsy.csproj", "{CDD2AF9A-353D-4313-A9EF-517BF4547D3A}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -15,6 +19,14 @@ Global
{F17C6B3F-BA9D-4133-A201-1265A64BCB71}.Debug|Any CPU.Build.0 = Debug|Any CPU {F17C6B3F-BA9D-4133-A201-1265A64BCB71}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F17C6B3F-BA9D-4133-A201-1265A64BCB71}.Release|Any CPU.ActiveCfg = Release|Any CPU {F17C6B3F-BA9D-4133-A201-1265A64BCB71}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F17C6B3F-BA9D-4133-A201-1265A64BCB71}.Release|Any CPU.Build.0 = Release|Any CPU {F17C6B3F-BA9D-4133-A201-1265A64BCB71}.Release|Any CPU.Build.0 = Release|Any CPU
{22F82FFF-8BD4-4CEE-9F22-C7DA71281E72}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{22F82FFF-8BD4-4CEE-9F22-C7DA71281E72}.Debug|Any CPU.Build.0 = Debug|Any CPU
{22F82FFF-8BD4-4CEE-9F22-C7DA71281E72}.Release|Any CPU.ActiveCfg = Release|Any CPU
{22F82FFF-8BD4-4CEE-9F22-C7DA71281E72}.Release|Any CPU.Build.0 = Release|Any CPU
{CDD2AF9A-353D-4313-A9EF-517BF4547D3A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CDD2AF9A-353D-4313-A9EF-517BF4547D3A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CDD2AF9A-353D-4313-A9EF-517BF4547D3A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CDD2AF9A-353D-4313-A9EF-517BF4547D3A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

View File

@ -8,12 +8,22 @@ using HarmonyLib;
namespace RJW_patch_Autopsy namespace RJW_patch_Autopsy
{ {
[HarmonyPatch(typeof(NewMedicalRecipesUtility), "TraverseBody")] [HarmonyPatch(typeof(NewMedicalRecipesUtility), nameof(NewMedicalRecipesUtility.TraverseBody))]
public static class NewMedicalRecipesUtilityPatch public static class NewMedicalRecipesUtilityPatch
{ {
private const bool DO_LOG = false;
private static void log(String message)
{
if (DO_LOG)
{
Log.Message(message);
}
}
[HarmonyPostfix] [HarmonyPostfix]
public static void AddRjwParts(RecipeInfo recipeInfo, Corpse corpse, float skillChance, public static IEnumerable<Thing> AddRjwParts(IEnumerable<Thing> __result, RecipeInfo recipeInfo, Corpse corpse,
ref IEnumerable<Thing> __result) float skillChance)
{ {
/*//Collect vanilla parts /*//Collect vanilla parts
var core = corpse.InnerPawn.RaceProps.body.corePart; var core = corpse.InnerPawn.RaceProps.body.corePart;
@ -36,7 +46,7 @@ namespace RJW_patch_Autopsy
NewMedicalRecipesUtility.DamageHarvested(corpse.InnerPawn, part); NewMedicalRecipesUtility.DamageHarvested(corpse.InnerPawn, part);
*/ */
var results = __result.ToList(); var results = __result.ToList();
Log.Message($"Collected {results.Count} vanilla parts"); log($"Collected {results.Count} vanilla parts");
//Collect rjw rediffs //Collect rjw rediffs
var rjwNaturalDiffs = (from x in corpse.InnerPawn.health.hediffSet.hediffs var rjwNaturalDiffs = (from x in corpse.InnerPawn.health.hediffSet.hediffs
@ -46,7 +56,7 @@ namespace RJW_patch_Autopsy
where x is Hediff_PartBaseArtifical where x is Hediff_PartBaseArtifical
select x).ToList(); select x).ToList();
Log.Message($"Collected {rjwNaturalDiffs.Count} natural and {rjwArtificialDiffs.Count} artificial hediffs"); log($"Collected {rjwNaturalDiffs.Count} natural and {rjwArtificialDiffs.Count} artificial hediffs");
//Collect parts from hediffs rjw's surgery methods //Collect parts from hediffs rjw's surgery methods
var rjwNaturalThings = rjwNaturalDiffs.Select(hediff => var rjwNaturalThings = rjwNaturalDiffs.Select(hediff =>
@ -62,7 +72,7 @@ namespace RJW_patch_Autopsy
return tmp; return tmp;
}).ToList(); }).ToList();
Log.Message( log(
$"Collected {rjwNaturalThings.Count} things from {rjwNaturalDiffs.Count} natural and {rjwArtificialThings.Count} things from {rjwArtificialDiffs.Count} artificial hediffs"); $"Collected {rjwNaturalThings.Count} things from {rjwNaturalDiffs.Count} natural and {rjwArtificialThings.Count} things from {rjwArtificialDiffs.Count} artificial hediffs");
//Simulate success chance scaled with skill etc. //Simulate success chance scaled with skill etc.
@ -82,13 +92,13 @@ namespace RJW_patch_Autopsy
if (results.Count > recipeInfo.PartNumber) if (results.Count > recipeInfo.PartNumber)
{ {
var random = new Random(); var random = new Random();
__result = results.OrderBy(i => random.Next()).Take(recipeInfo.PartNumber); results = results.OrderBy(i => random.Next()).Take(recipeInfo.PartNumber).ToList();
}
else
{
__result = results;
} }
foreach (var result in results)
{
yield return result;
}
// return false; // return false;
} }
} }

View File

@ -11,7 +11,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")] [assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("RJW_patch_Autopsy")] [assembly: AssemblyProduct("RJW_patch_Autopsy")]
[assembly: AssemblyCopyright("©2021 Stardust3D")] [assembly: AssemblyCopyright("©2022 Stardust3D")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
@ -33,5 +33,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("4943.0.1.3")] [assembly: AssemblyVersion("4943.0.1.4")]
[assembly: AssemblyFileVersion("4943.0.1.3")] [assembly: AssemblyFileVersion("4943.0.1.4")]

View File

@ -13,6 +13,7 @@
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<TargetFrameworkProfile> <TargetFrameworkProfile>
</TargetFrameworkProfile> </TargetFrameworkProfile>
<AssemblyOriginatorKeyFile>RJW_patch_Autopsy.snk</AssemblyOriginatorKeyFile>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
@ -55,16 +56,10 @@
<HintPath>..\..\..\..\RimWorldWin64_Data\Managed\Assembly-CSharp.dll</HintPath> <HintPath>..\..\..\..\RimWorldWin64_Data\Managed\Assembly-CSharp.dll</HintPath>
<Private>False</Private> <Private>False</Private>
</Reference> </Reference>
<Reference Include="Autopsy">
<HintPath>..\..\..\RimwoldAutopsy\1.3\Assemblies\Autopsy.dll</HintPath>
</Reference>
<Reference Include="HugsLib"> <Reference Include="HugsLib">
<HintPath>..\..\..\..\..\..\workshop\content\294100\818773962\Assemblies\HugsLib.dll</HintPath> <HintPath>..\..\..\..\..\..\workshop\content\294100\818773962\Assemblies\HugsLib.dll</HintPath>
<Private>False</Private> <Private>False</Private>
</Reference> </Reference>
<Reference Include="RJW">
<HintPath>..\..\..\rjw-base\1.3\Assemblies\RJW.dll</HintPath>
</Reference>
<Reference Include="System.Core" /> <Reference Include="System.Core" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
@ -83,6 +78,17 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="packages.config" /> <None Include="packages.config" />
<None Include="RJW_patch_Autopsy.snk" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\RimwoldAutopsy\Source\Autopsy\Autopsy.csproj">
<Project>{f17c6b3f-ba9d-4133-a201-1265a64bcb71}</Project>
<Name>Autopsy</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\rjw-base\1.3\Source\RimJobWorld.Main.csproj">
<Project>{22f82fff-8bd4-4cee-9f22-c7da71281e72}</Project>
<Name>RimJobWorld.Main</Name>
</ProjectReference>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project> </Project>

Binary file not shown.

View File

@ -11,7 +11,7 @@ plugins {
//id("com.ullink.nunit") version "1.12" //id("com.ullink.nunit") version "1.12"
} }
version = "4943.0.1.3" version = "4943.0.1.4"
val friendlyName = "rjw-patch-autopsy" val friendlyName = "rjw-patch-autopsy"
tasks.register<com.ullink.Msbuild>("buildC#") { tasks.register<com.ullink.Msbuild>("buildC#") {