Skip to content
Snippets Groups Projects
Commit 37b9ba40 authored by Ed86's avatar Ed86
Browse files

added operations support for all races, probably needs exclusion filters for mechanoids and stuff

parent aea910d3
No related branches found
No related tags found
No related merge requests found
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using Harmony;
using RimWorld;
using Verse;
using System.Collections;
namespace rjw
{
/// <summary>
/// Patch all races into rjw genitals recipes
/// </summary>
[StaticConstructorOnStartup]
public static class HarmonyPatches
{
static HarmonyPatches()
{
foreach (RecipeDef x in
DefDatabase<RecipeDef>.AllDefsListForReading.Where(x => x.IsSurgery && (x.targetsBodyPart || !x.appliedOnFixedBodyParts.NullOrEmpty())))
{
try
{
if (x.appliedOnFixedBodyParts.Contains(DefDatabase<BodyPartDef>.GetNamed("Genitals"))
|| x.appliedOnFixedBodyParts.Contains(DefDatabase<BodyPartDef>.GetNamed("Chest"))
|| x.appliedOnFixedBodyParts.Contains(DefDatabase<BodyPartDef>.GetNamed("Anus"))
)
//Log.Message("2 " + x.defName);
foreach (ThingDef thingDef in DefDatabase<ThingDef>.AllDefs)
{
if (thingDef.race == null)
continue;
//filter something?
//if (thingDef.race. == "Human")
// continue;
if (!x.recipeUsers.Contains(thingDef))
x.recipeUsers.Add(item: thingDef);
}
}
catch
{ }
}
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment