RJW-Sexperience/RJWSexperience/RJWSexperience/Patches/Rimworld_Patch.cs

26 lines
644 B
C#
Raw Normal View History

using HarmonyLib;
2021-09-24 15:14:02 +00:00
using rjw;
using System;
using Verse;
2021-09-24 15:14:02 +00:00
namespace RJWSexperience
{
[HarmonyPatch(typeof(PawnGenerator), "GeneratePawn", new Type[] { typeof(PawnGenerationRequest) })]
public static class Rimworld_Patch_GeneratePawn
{
public static void Postfix(PawnGenerationRequest request, ref Pawn __result)
{
if (__result == null)
return;
bool doVirginTrait = true;
if (SexperienceMod.Settings.History.EnableRecordRandomizer && !request.Newborn && xxx.is_human(__result))
doVirginTrait = RecordRandomizer.Randomize(__result);
if (doVirginTrait)
Virginity.TraitHandler.AddVirginTrait(__result);
}
}
2021-09-24 15:14:02 +00:00
}