mirror of
https://gitgud.io/lutepickle/rjw_menstruation.git
synced 2024-08-14 22:46:52 +00:00
Compare commits
2 commits
1d6dc1fc82
...
96109e7607
Author | SHA1 | Date | |
---|---|---|---|
|
96109e7607 | ||
|
034bf4d75a |
3 changed files with 16 additions and 19 deletions
Binary file not shown.
|
@ -210,25 +210,16 @@ namespace RJW_Menstruation
|
||||||
protected long CalculateLastBirth()
|
protected long CalculateLastBirth()
|
||||||
{
|
{
|
||||||
long youngestAge = (long)(BabyHalfAge * GenDate.TicksPerYear) * -2; // So a newborn isn't considered a new mother, either
|
long youngestAge = (long)(BabyHalfAge * GenDate.TicksPerYear) * -2; // So a newborn isn't considered a new mother, either
|
||||||
if ((Pawn.relations?.ChildrenCount ?? 0) > 0)
|
|
||||||
{
|
if ((Pawn.relations == null)) return youngestAge;
|
||||||
foreach (Pawn child in Pawn.relations.Children)
|
|
||||||
{
|
bool hasChild = Pawn.relations.Children.
|
||||||
bool isFetus = false;
|
Where(child => !Pawn.health.hediffSet.GetHediffs<Hediff_BasePregnancy>().Any(preg => preg.babies.Contains(child))). // no fetuses
|
||||||
if (Pawn.health.hediffSet.GetHediffs<Hediff_BasePregnancy>().Any(preg => preg.babies.Contains(child)))
|
Where(child => child.GetMother() == Pawn). // not Dad
|
||||||
{
|
TryMinBy(child => child.ageTracker.AgeBiologicalTicks, out Pawn youngest);
|
||||||
isFetus = true;
|
|
||||||
break;
|
if (hasChild) youngestAge = Pawn.ageTracker.AgeBiologicalTicks - youngest.ageTracker.AgeBiologicalTicks;
|
||||||
}
|
|
||||||
|
|
||||||
if (
|
|
||||||
Pawn.ageTracker.BirthAbsTicks - child.ageTracker.BirthAbsTicks > ageOfLastBirth &&
|
|
||||||
!isFetus &&
|
|
||||||
child.GetMother() == Pawn // Don't do Dad's boobs
|
|
||||||
)
|
|
||||||
youngestAge = Pawn.ageTracker.BirthAbsTicks - child.ageTracker.BirthAbsTicks;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return youngestAge;
|
return youngestAge;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -337,6 +328,11 @@ namespace RJW_Menstruation
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void GaveBirth()
|
||||||
|
{
|
||||||
|
ageOfLastBirth = Pawn.ageTracker.AgeBiologicalTicks;
|
||||||
|
}
|
||||||
|
|
||||||
public void AdjustNippleProgress(float amount)
|
public void AdjustNippleProgress(float amount)
|
||||||
{
|
{
|
||||||
nippleProgress = Mathf.Clamp01(nippleProgress + amount);
|
nippleProgress = Mathf.Clamp01(nippleProgress + amount);
|
||||||
|
|
|
@ -72,6 +72,7 @@ namespace RJW_Menstruation
|
||||||
pawn.health.RemoveHediff(this);
|
pawn.health.RemoveHediff(this);
|
||||||
HediffComp_Menstruation comp = this.GetMenstruationComp();
|
HediffComp_Menstruation comp = this.GetMenstruationComp();
|
||||||
if(comp != null) comp.Pregnancy = null;
|
if(comp != null) comp.Pregnancy = null;
|
||||||
|
pawn.GetBreastComp()?.GaveBirth();
|
||||||
}
|
}
|
||||||
|
|
||||||
public string GetBabyInfo()
|
public string GetBabyInfo()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue