mirror of
https://gitgud.io/lutepickle/rjw_menstruation.git
synced 2024-08-14 22:46:52 +00:00
Simplify the too young/old check in the ovulation calculation a little
This commit is contained in:
parent
8cc72acf36
commit
cb8d824a2c
1 changed files with 5 additions and 10 deletions
|
@ -308,18 +308,13 @@ namespace RJW_Menstruation
|
||||||
if (ModsConfig.BiotechActive && xxx.is_human(Pawn))
|
if (ModsConfig.BiotechActive && xxx.is_human(Pawn))
|
||||||
{
|
{
|
||||||
if (Pawn.SterileGenes()) return 0.0f;
|
if (Pawn.SterileGenes()) return 0.0f;
|
||||||
// Replicate how rjw.PawnCapacityWorker_Fertility.CalculateCapacityLevel does it, but without the age factor
|
|
||||||
if (!Pawn.RaceHasFertility()) return 0.0f;
|
if (!Pawn.RaceHasFertility()) return 0.0f;
|
||||||
if (AndroidsCompatibility.IsAndroid(Pawn) && parent.def != Genital_Helper.archotech_vagina) return 0.0f;
|
if (AndroidsCompatibility.IsAndroid(Pawn) && parent.def != Genital_Helper.archotech_vagina) return 0.0f;
|
||||||
foreach (StatPart part in StatDefOf.Fertility.parts)
|
|
||||||
{
|
float ageFactor = 1.0f;
|
||||||
if(part is StatPart_FertilityByGenderAge fertilityByAge)
|
StatDefOf.Fertility.GetStatPart<StatPart_FertilityByGenderAge>()?.TransformValue(StatRequest.For(Pawn), ref ageFactor);
|
||||||
{
|
if (ageFactor <= 0.0f) return 0.0f; // Too young or too old
|
||||||
float factor = 1.0f;
|
|
||||||
fertilityByAge.TransformValue(StatRequest.For(Pawn), ref factor);
|
|
||||||
if (factor <= 0.0f) return 0.0f; // Too young or too old
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (Pawn.HasQuirk(QuirkUtility.Quirks.Breeder)) ovulationChance *= 10.0f;
|
if (Pawn.HasQuirk(QuirkUtility.Quirks.Breeder)) ovulationChance *= 10.0f;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue