Simplify CalculatedImplantChance a little
This commit is contained in:
parent
3498caf3a2
commit
0dd3507010
|
@ -328,18 +328,17 @@ namespace RJW_Menstruation
|
||||||
|
|
||||||
protected float CalculatedImplantChance()
|
protected float CalculatedImplantChance()
|
||||||
{
|
{
|
||||||
float factor = 1.0f;
|
|
||||||
if (ModsConfig.BiotechActive && xxx.is_human(Pawn))
|
if (ModsConfig.BiotechActive && xxx.is_human(Pawn))
|
||||||
{
|
{
|
||||||
// Implant factor will be based solely on pawn age, plus any rollover from ovulation chance
|
// Implant factor will be based solely on pawn age, plus any rollover from ovulation chance
|
||||||
StatPart_FertilityByGenderAge fertilityStatPart = StatDefOf.Fertility.GetStatPart<StatPart_FertilityByGenderAge>();
|
float factor = 1.0f;
|
||||||
fertilityStatPart?.TransformValue(StatRequest.For(Pawn), ref factor);
|
StatDefOf.Fertility.GetStatPart<StatPart_FertilityByGenderAge>()?.TransformValue(StatRequest.For(Pawn), ref factor);
|
||||||
if (OvulationChance > 1.0f) factor *= OvulationChance;
|
if (OvulationChance > 1.0f) factor *= OvulationChance;
|
||||||
return Props.baseImplantationChanceFactor * FertilityModifier * factor;
|
return Props.baseImplantationChanceFactor * FertilityModifier * factor;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return Pawn.health.capacities.GetLevel(xxx.reproduction) * Props.baseImplantationChanceFactor * FertilityModifier * factor;
|
return Pawn.health.capacities.GetLevel(xxx.reproduction) * Props.baseImplantationChanceFactor * FertilityModifier;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue