mirror of
https://github.com/amevarashi/RJW-Sexperience.git
synced 2024-08-14 23:54:08 +00:00
Remove virgin trait if game generates a child
This commit is contained in:
parent
0bd8d809e0
commit
9e121d1f30
1 changed files with 18 additions and 0 deletions
|
@ -1,4 +1,5 @@
|
|||
using HarmonyLib;
|
||||
using RimWorld;
|
||||
using rjw;
|
||||
using System;
|
||||
using Verse;
|
||||
|
@ -22,4 +23,21 @@ namespace RJWSexperience
|
|||
Virginity.TraitHandler.GenerateVirginTrait(__result);
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPatch(typeof(ParentRelationUtility), nameof(ParentRelationUtility.SetMother))]
|
||||
public static class Rimworld_Patch_RemoveVirginOnSetMother
|
||||
{
|
||||
public static void Postfix(Pawn pawn, Pawn newMother)
|
||||
{
|
||||
if (!pawn.relations.DirectRelationExists(PawnRelationDefOf.Parent, newMother))
|
||||
return;
|
||||
|
||||
Trait virgin = newMother.story?.traits?.GetTrait(VariousDefOf.Virgin, Virginity.TraitDegree.FemaleVirgin);
|
||||
if (virgin != null)
|
||||
{
|
||||
newMother.story.traits.RemoveTrait(virgin);
|
||||
newMother.story.traits.GainTrait(new Trait(VariousDefOf.Virgin, Virginity.TraitDegree.FemaleAfterSurgery));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue