mirror of
https://gitgud.io/lutepickle/rjw_menstruation.git
synced 2024-08-14 22:46:52 +00:00
Compare commits
4 commits
9aab479fe6
...
5924c73b2f
Author | SHA1 | Date | |
---|---|---|---|
|
5924c73b2f | ||
|
f7348ccee8 | ||
|
93855c5ee7 | ||
|
b81a07c172 |
6 changed files with 31 additions and 16 deletions
Binary file not shown.
Binary file not shown.
|
@ -700,6 +700,16 @@ namespace RJW_Menstruation
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool ShouldBeInfertile()
|
||||||
|
{
|
||||||
|
if (pregnancy != null) return false;
|
||||||
|
if (ImplantChance <= 0.0f) return true;
|
||||||
|
// Give the last egg ovulated a chance to implant
|
||||||
|
if (curStage == Stage.Luteal || curStage == Stage.Bleeding || curStage == Stage.Recover) return false;
|
||||||
|
if (EggHealth <= 0.0f) return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public override void CompPostTick(ref float severityAdjustment)
|
public override void CompPostTick(ref float severityAdjustment)
|
||||||
{
|
{
|
||||||
base.CompPostTick(ref severityAdjustment);
|
base.CompPostTick(ref severityAdjustment);
|
||||||
|
@ -727,7 +737,7 @@ namespace RJW_Menstruation
|
||||||
|
|
||||||
BeforeSimulator();
|
BeforeSimulator();
|
||||||
|
|
||||||
if (pregnancy == null && (ImplantChance <= 0.0f || EggHealth <= 0)) GoNextStage(Stage.Infertile);
|
if (ShouldBeInfertile()) GoNextStage(Stage.Infertile);
|
||||||
switch (curStage)
|
switch (curStage)
|
||||||
{
|
{
|
||||||
case Stage.Follicular:
|
case Stage.Follicular:
|
||||||
|
@ -1165,7 +1175,7 @@ namespace RJW_Menstruation
|
||||||
|
|
||||||
if (currentIntervalHours < 0)
|
if (currentIntervalHours < 0)
|
||||||
{
|
{
|
||||||
if (ImplantChance <= 0.0f || EggHealth <= 0) curStage = Stage.Infertile;
|
if (ShouldBeInfertile()) curStage = Stage.Infertile;
|
||||||
else if (!IsBreedingSeason()) curStage = Stage.Anestrus;
|
else if (!IsBreedingSeason()) curStage = Stage.Anestrus;
|
||||||
else curStage = RandomStage();
|
else curStage = RandomStage();
|
||||||
if (curStage == Stage.Follicular)
|
if (curStage == Stage.Follicular)
|
||||||
|
@ -1619,22 +1629,15 @@ namespace RJW_Menstruation
|
||||||
eggs.Add(new Egg((int)(EggLifespanHours / CycleFactor)));
|
eggs.Add(new Egg((int)(EggLifespanHours / CycleFactor)));
|
||||||
++ovulated;
|
++ovulated;
|
||||||
}
|
}
|
||||||
|
if(ovulated < ovarypower) ovulated = Math.Max(ovarypower, eggstack);
|
||||||
|
|
||||||
ovarypower -= ovulated;
|
ovarypower -= ovulated;
|
||||||
|
eggstack = 0;
|
||||||
if (Configurations.Debug && ovulated != toOvulate)
|
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)");
|
||||||
|
|
||||||
eggstack = 0;
|
|
||||||
if (EggHealth <= 0)
|
|
||||||
{
|
|
||||||
eggs.Clear();
|
|
||||||
ovarypower = 0;
|
|
||||||
GoNextStage(Stage.Infertile);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
GoNextStage(Stage.Luteal);
|
GoNextStage(Stage.Luteal);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
protected virtual void LutealAction()
|
protected virtual void LutealAction()
|
||||||
{
|
{
|
||||||
|
@ -1720,7 +1723,7 @@ namespace RJW_Menstruation
|
||||||
{
|
{
|
||||||
if (curStageHrs >= currentIntervalHours)
|
if (curStageHrs >= currentIntervalHours)
|
||||||
{
|
{
|
||||||
if (ImplantChance <= 0.0f || EggHealth <= 0)
|
if (ShouldBeInfertile())
|
||||||
{
|
{
|
||||||
GoNextStage(Stage.Infertile);
|
GoNextStage(Stage.Infertile);
|
||||||
}
|
}
|
||||||
|
@ -1742,7 +1745,7 @@ namespace RJW_Menstruation
|
||||||
|
|
||||||
protected virtual void InfertileAction()
|
protected virtual void InfertileAction()
|
||||||
{
|
{
|
||||||
if (ImplantChance <= 0 || EggHealth <= 0)
|
if (ShouldBeInfertile())
|
||||||
{
|
{
|
||||||
StayCurrentStageConst(Stage.Infertile);
|
StayCurrentStageConst(Stage.Infertile);
|
||||||
}
|
}
|
||||||
|
|
|
@ -214,6 +214,10 @@ namespace RJW_Menstruation
|
||||||
PregnancyUtility.ApplyBirthOutcome(thisOutcome, quality, ritual, genes, geneticMother, birtherThing, thisFather, doctor, lordJobRitual, assignments);
|
PregnancyUtility.ApplyBirthOutcome(thisOutcome, quality, ritual, genes, geneticMother, birtherThing, thisFather, doctor, lordJobRitual, assignments);
|
||||||
// No more babies if mom dies halfway through. Unrealistic maybe, but saves a lot of headache in ApplyBirthOutcome
|
// No more babies if mom dies halfway through. Unrealistic maybe, but saves a lot of headache in ApplyBirthOutcome
|
||||||
if (mother.health.Dead) break;
|
if (mother.health.Dead) break;
|
||||||
|
if (xxx.is_human(baby))
|
||||||
|
mother.records.Increment(xxx.CountOfBirthHuman);
|
||||||
|
else if (xxx.is_animal(baby))
|
||||||
|
mother.records.Increment(xxx.CountOfBirthAnimal);
|
||||||
thisOutcome = ((RitualOutcomeEffectWorker_ChildBirth)precept_Ritual.outcomeEffect).GetOutcome(birthQuality, null);
|
thisOutcome = ((RitualOutcomeEffectWorker_ChildBirth)precept_Ritual.outcomeEffect).GetOutcome(birthQuality, null);
|
||||||
} while (comp.HasBaby);
|
} while (comp.HasBaby);
|
||||||
|
|
||||||
|
@ -263,6 +267,10 @@ namespace RJW_Menstruation
|
||||||
|
|
||||||
PregnancyUtility.ApplyBirthOutcome(outcome, quality, ritual, genes, geneticMother, birtherThing, thisFather, doctor, lordJobRitual, assignments);
|
PregnancyUtility.ApplyBirthOutcome(outcome, quality, ritual, genes, geneticMother, birtherThing, thisFather, doctor, lordJobRitual, assignments);
|
||||||
if (mother.health.Dead) break;
|
if (mother.health.Dead) break;
|
||||||
|
if (xxx.is_human(baby))
|
||||||
|
mother.records.Increment(xxx.CountOfBirthHuman);
|
||||||
|
else if (xxx.is_animal(baby))
|
||||||
|
mother.records.Increment(xxx.CountOfBirthAnimal);
|
||||||
} while (comp.HasBaby);
|
} while (comp.HasBaby);
|
||||||
|
|
||||||
// The ritual version doesn't use the return value, either
|
// The ritual version doesn't use the return value, either
|
||||||
|
|
|
@ -463,6 +463,10 @@ namespace RJW_Menstruation
|
||||||
{
|
{
|
||||||
return Color.white;
|
return Color.white;
|
||||||
}
|
}
|
||||||
|
catch (InvalidOperationException) // And sometimes it can try to pull the value of a Nullable without checking, too
|
||||||
|
{
|
||||||
|
return Color.white;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@ Version 1.0.8.8
|
||||||
- Fix pawns skipping straight to menopause instead of going through climacteric stages.
|
- Fix pawns skipping straight to menopause instead of going through climacteric stages.
|
||||||
- Fix father appearing as "Null" in womb dialog for some Biotech pregnancies.
|
- Fix father appearing as "Null" in womb dialog for some Biotech pregnancies.
|
||||||
- Other bug fixes
|
- Other bug fixes
|
||||||
- Rework ovulation mechanics. A pawn's implantation chance is now dependent only on their age.
|
- Rework ovulation mechanics. A pawn's implantation chance is now dependent only on their age and climacteric effects.
|
||||||
- All other fertility-altering effects instead change the odds of ovulation occuring, rolled per-egg. This chance appears in the womb dialog.
|
- All other fertility-altering effects instead change the odds of ovulation occuring, rolled per-egg. This chance appears in the womb dialog.
|
||||||
- If the chance of ovulation goes above 100%, the implantation chance is increased.
|
- If the chance of ovulation goes above 100%, the implantation chance is increased.
|
||||||
- Drugs that increase the number of eggs ovulated are still guaranteed to work.
|
- Drugs that increase the number of eggs ovulated are still guaranteed to work.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue