Don't cycle for egglaying genes (Alpha Genes and VE Saurid)

This commit is contained in:
lutepickle 2023-11-29 09:10:19 -08:00
parent cb5522b0c3
commit c12f9dbc87
5 changed files with 23 additions and 1 deletions

Binary file not shown.

View file

@ -397,7 +397,12 @@ namespace RJW_Menstruation
{ {
if (!Configurations.EnableAnimalCycle && pawn.IsAnimal()) return false; if (!Configurations.EnableAnimalCycle && pawn.IsAnimal()) return false;
if (pawn.RaceHasOviPregnancy()) return false; if (pawn.RaceHasOviPregnancy()) return false;
// TODO: Exclude egglaying genes if (ModsConfig.BiotechActive && pawn.genes != null)
{
foreach (Gene gene in pawn.genes.GenesListForReading)
if (VariousDefOf.EggLayerGenes.Contains(gene.def)) return false;
}
return true; return true;
} }

View file

@ -69,6 +69,7 @@ namespace RJW_Menstruation
private static HashSet<HediffDef> allvaginas = null; private static HashSet<HediffDef> allvaginas = null;
private static HashSet<HediffDef> allanuses = null; private static HashSet<HediffDef> allanuses = null;
private static HashSet<HediffDef> allbreasts = null; private static HashSet<HediffDef> allbreasts = null;
private static HashSet<GeneDef> egglayergenes = null;
public static List<ThingDef> AllRaces public static List<ThingDef> AllRaces
{ {
@ -161,6 +162,21 @@ namespace RJW_Menstruation
return allbreasts; return allbreasts;
} }
} }
public static HashSet<GeneDef> EggLayerGenes
{
get
{
if (egglayergenes != null) return egglayergenes;
egglayergenes = new HashSet<GeneDef>();
GeneDef AG_EggLaying = DefDatabase<GeneDef>.GetNamedSilentFail("AG_EggLaying"); // Alpha Genes
GeneDef VRESaurids_Oviparous = DefDatabase<GeneDef>.GetNamedSilentFail("VRESaurids_Oviparous"); // VE Saurid
if (AG_EggLaying != null) egglayergenes.Add(AG_EggLaying);
if (VRESaurids_Oviparous != null) egglayergenes.Add(VRESaurids_Oviparous);
return egglayergenes;
}
}
// Defs from Milkable Colonists // Defs from Milkable Colonists
public static readonly HediffDef Hediff_Lactating_Drug = DefDatabase<HediffDef>.GetNamedSilentFail("Lactating_Drug"); public static readonly HediffDef Hediff_Lactating_Drug = DefDatabase<HediffDef>.GetNamedSilentFail("Lactating_Drug");

View file

@ -5,6 +5,7 @@ Version 1.0.9.2
- Handle errors more gracefully when starting a pregnancy. - Handle errors more gracefully when starting a pregnancy.
- Fix implanting multiple eggs in an animal when configured to use Biotech pregnancies. - Fix implanting multiple eggs in an animal when configured to use Biotech pregnancies.
- Egglaying races no longer have a menstrual cycle, regardless of vagina type. - Egglaying races no longer have a menstrual cycle, regardless of vagina type.
- Pawns with the egglaying genes from Alpha Genes or VE Saurids no longer have a menstrual cycle.
- Tampons and pads are now allowed by default in the worker, soldier, and slave starting outfits. - Tampons and pads are now allowed by default in the worker, soldier, and slave starting outfits.
Version 1.0.9.1 Version 1.0.9.1