mirror of
https://gitgud.io/lutepickle/rjw_menstruation.git
synced 2024-08-14 22:46:52 +00:00
Have CalculatedImplantChance use the cached ovulation chance
This commit is contained in:
parent
e43a50522b
commit
a38d81424a
1 changed files with 3 additions and 5 deletions
|
@ -336,8 +336,7 @@ namespace RJW_Menstruation
|
|||
// Implant factor will be based solely on pawn age, plus any rollover from ovulation chance
|
||||
StatPart_FertilityByGenderAge fertilityStatPart = StatDefOf.Fertility.GetStatPart<StatPart_FertilityByGenderAge>();
|
||||
fertilityStatPart?.TransformValue(StatRequest.For(Pawn), ref factor);
|
||||
float ovulationOverflow = OvulationChance;
|
||||
if (ovulationOverflow > 1.0f) factor *= ovulationOverflow;
|
||||
if (OvulationChance > 1.0f) factor *= OvulationChance;
|
||||
return Props.baseImplantationChanceFactor * FertilityModifier * factor;
|
||||
}
|
||||
else
|
||||
|
@ -1642,10 +1641,9 @@ namespace RJW_Menstruation
|
|||
eggnum *= ovulationFactor;
|
||||
int toOvulate = (int)eggnum + eggstack;
|
||||
|
||||
float ovulationChance = OvulationChance;
|
||||
int ovulated = 0;
|
||||
for (int i = 0; i < toOvulate; i++)
|
||||
if (i < eggstack || Rand.Chance(ovulationChance)) // eggstack comes from drugs and are guaranteed ovulated
|
||||
if (i < eggstack || Rand.Chance(OvulationChance)) // eggstack comes from drugs and are guaranteed ovulated
|
||||
{
|
||||
eggs.Add(new Egg((int)(EggLifespanTicks / CycleFactor)));
|
||||
++ovulated;
|
||||
|
@ -1653,7 +1651,7 @@ namespace RJW_Menstruation
|
|||
ovarypower -= ovulated;
|
||||
eggstack = 0;
|
||||
if (Configurations.Debug && ovulated != toOvulate)
|
||||
Log.Message($"{Pawn} ovulated {ovulated}/{toOvulate} eggs ({ovulationChance.ToStringPercent()} chance)");
|
||||
Log.Message($"{Pawn} ovulated {ovulated}/{toOvulate} eggs ({OvulationChance.ToStringPercent()} chance)");
|
||||
|
||||
GoNextStage(Stage.Luteal);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue