Just let everyone use the menstruation genes

This commit is contained in:
lutepickle 2024-01-20 14:51:20 -08:00
parent d74d488d6e
commit a29aaf50c1
4 changed files with 1 additions and 27 deletions

Binary file not shown.

View File

@ -192,23 +192,6 @@ namespace RJW_Menstruation
}
}
[HarmonyPatch(typeof(Pawn_GeneTracker), "AddGene", new Type[] { typeof(Gene), typeof(bool) })]
public class AddGene_Patch
{
public static bool Prefix(ref Gene __result, Gene gene, Pawn ___pawn)
{
if (!VariousDefOf.WombGenes.Contains(gene.def)) return true;
bool keepGene;
if (PawnGenerator.IsBeingGenerated(___pawn))
// During pawn generation, the vagina hediff doesn't exist yet, so use gender to decide instead
// Not the most accurate, but close enough
keepGene = ___pawn.gender == Gender.Female;
else keepGene = ___pawn.GetMenstruationComps().Any();
if (!keepGene) __result = null;
return keepGene;
}
}
[HarmonyPatch(typeof(Pawn_GeneTracker), "Notify_GenesChanged")]
public class Notify_GenesChanged_Patch
{

View File

@ -54,16 +54,6 @@ namespace RJW_Menstruation
public static readonly GeneDef QuadOvulation = DefDatabase<GeneDef>.GetNamed("Menstruation_QuadOvulation");
public static readonly GeneDef NoBleeding = DefDatabase<GeneDef>.GetNamed("Menstruation_NoBleeding");
public static readonly HashSet<GeneDef> WombGenes = new HashSet<GeneDef>() {
ShortEggLifetime,
DoubleEggLifetime,
QuadEggLifetime,
NeverEstrus,
FullEstrus,
DoubleOvulation,
QuadOvulation,
NoBleeding };
private static List<ThingDef> allraces = null;
private static List<PawnKindDef> allkinds = null;
private static HashSet<HediffDef> allvaginas = null;

View File

@ -1,5 +1,6 @@
Version 1.0.9.3
- The biosculptor egg restoration cycle will now give more eggs to races that ovulate more than one egg at a time.
- All pawns can now use all menstruation genes, regardless of gender or having a womb.
Version 1.0.9.2
- Updated Traditional Chinese translation by Hydrogen.