diff --git a/1.3/Assemblies/RJW_Menstruation.dll b/1.3/Assemblies/RJW_Menstruation.dll
index fdedd90..c8359b5 100644
Binary files a/1.3/Assemblies/RJW_Menstruation.dll and b/1.3/Assemblies/RJW_Menstruation.dll differ
diff --git a/1.3/Defs/HediffDef/Hediffs_Menstruation.xml b/1.3/Defs/HediffDef/Hediffs_Menstruation.xml
index 10f4947..7b08072 100644
--- a/1.3/Defs/HediffDef/Hediffs_Menstruation.xml
+++ b/1.3/Defs/HediffDef/Hediffs_Menstruation.xml
@@ -79,19 +79,13 @@
-
- 0.01
- 0.50
-
-
-
- RJW_Fertility
- 0.00
-
-
+
+
+ 0
+
@@ -113,62 +107,13 @@
-
-
- 0.50
- 0.8
-
-
-
- RJW_Fertility
- 0.50
-
-
-
-
-
- 0.2
-
- 0.25
- 0.7
-
-
-
- RJW_Fertility
- 0.25
-
-
-
-
-
- 0.4
-
- 0.10
- 0.6
-
-
-
- RJW_Fertility
- 0.10
-
-
-
-
-
- 0.6
-
- 0.05
- 0.5
-
-
-
- RJW_Fertility
- 0.01
-
-
+
+
+ 0
+
diff --git a/1.3/Languages/ChineseSimplified/DefInjected/HediffDef/RJWMenstruation.xml b/1.3/Languages/ChineseSimplified/DefInjected/HediffDef/RJWMenstruation.xml
index a880d69..c1baebe 100644
--- a/1.3/Languages/ChineseSimplified/DefInjected/HediffDef/RJWMenstruation.xml
+++ b/1.3/Languages/ChineseSimplified/DefInjected/HediffDef/RJWMenstruation.xml
@@ -7,14 +7,6 @@
恼人
疼痛
痛苦
- 更年期
- 到了更年期
- 初期
- 中期
- 后期
- 更年期
- 更年期
- 不孕
diff --git a/1.3/Languages/ChineseTraditional/DefInjected/HediffDef/RJWMenstruation.xml b/1.3/Languages/ChineseTraditional/DefInjected/HediffDef/RJWMenstruation.xml
index 07e22bd..3cce982 100644
--- a/1.3/Languages/ChineseTraditional/DefInjected/HediffDef/RJWMenstruation.xml
+++ b/1.3/Languages/ChineseTraditional/DefInjected/HediffDef/RJWMenstruation.xml
@@ -7,14 +7,6 @@
惱人
疼痛
痛苦
- 更年期
- 到了更年期
- 初期
- 中期
- 後期
- 更年期
- 更年期
- 不孕
diff --git a/1.3/Languages/English/Keyed/RJW_Menstruation.xml b/1.3/Languages/English/Keyed/RJW_Menstruation.xml
index 908b411..7f49f6c 100644
--- a/1.3/Languages/English/Keyed/RJW_Menstruation.xml
+++ b/1.3/Languages/English/Keyed/RJW_Menstruation.xml
@@ -12,6 +12,7 @@
Recovering from birth
None
Climacteric
+ Menopause
Anestrus
The ovaries are preparing to release an egg. Ovulation will occur at the end of this phase.
The ovaries are preparing to release an egg. Ovulation will occur if semen enters the womb.
@@ -22,6 +23,7 @@
The womb is recovering from its recent pregnancy.
The womb is not fertile and cannot become pregnant.
The ovaries have neared exhaustion and the menstrual cycle has become irregular.
+ The ovaries have been exhausted and the womb can no longer produce eggs.
The womb is out of breeding season. The cycle will resume once conditions are met.
Status
Lactate self
diff --git a/1.3/Languages/Korean/DefInjected/HediffDef/RJWMenstruation.xml b/1.3/Languages/Korean/DefInjected/HediffDef/RJWMenstruation.xml
index f3ab7ed..0b9539a 100644
--- a/1.3/Languages/Korean/DefInjected/HediffDef/RJWMenstruation.xml
+++ b/1.3/Languages/Korean/DefInjected/HediffDef/RJWMenstruation.xml
@@ -6,14 +6,6 @@
짜증남
아픔
고통스러움
- 갱년기
- 갱년기입니다.
- 초기
- 중기
- 후기
- 폐경
- 폐경
- 임신할수 없습니다.
발정기
발정기입니다.
발정기(숨김)
diff --git a/1.3/Patches/RJW_StatDefs.xml b/1.3/Patches/RJW_StatDefs.xml
new file mode 100644
index 0000000..f83365a
--- /dev/null
+++ b/1.3/Patches/RJW_StatDefs.xml
@@ -0,0 +1,19 @@
+
+
+
+
+ /Defs/StatDef[defName="SexFrequency"]/parts
+
+
+
+
+
+
+
+ /Defs/StatDef[defName="SexSatisfaction"]/parts
+
+
+
+
+
+
\ No newline at end of file
diff --git a/1.3/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_InducedOvulator.cs b/1.3/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_InducedOvulator.cs
index a2d7c06..5f5d08b 100644
--- a/1.3/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_InducedOvulator.cs
+++ b/1.3/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_InducedOvulator.cs
@@ -48,10 +48,10 @@ namespace RJW_Menstruation
return Mathf.CeilToInt((Pawn.relations?.ChildrenCount ?? 0) / Configurations.ImplantationChanceDefault);
}
- protected override void GoOvulatoryStage(bool climacteric)
+ protected override void GoOvulatoryStage()
{
estrusflag = false;
- GoNextStage(climacteric ? Stage.ClimactericLuteal : Stage.Luteal);
+ GoNextStage(Stage.Luteal);
}
protected override void AfterCumIn(Pawn cummer)
diff --git a/1.3/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs b/1.3/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs
index fbb76a7..07f68a0 100644
--- a/1.3/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs
+++ b/1.3/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs
@@ -85,9 +85,9 @@ namespace RJW_Menstruation
Recover,
None,
Young,
- ClimactericFollicular,
- ClimactericLuteal,
- ClimactericBleeding,
+ ClimactericFollicular, // obsolete
+ ClimactericLuteal, // obsolete
+ ClimactericBleeding, // obsolete
Anestrus
}
@@ -125,6 +125,30 @@ namespace RJW_Menstruation
protected float? originvagsize = null;
protected Hediff_BasePregnancy pregnancy = null;
+ private static readonly SimpleCurve SexFrequencyCurve = new SimpleCurve()
+ {
+ new CurvePoint(0.4f,0.05f),
+ new CurvePoint(0.6f,0.1f),
+ new CurvePoint(0.8f,0.25f),
+ new CurvePoint(1.0f,0.5f)
+ };
+
+ private static readonly SimpleCurve SexSatisfactionCurve = new SimpleCurve()
+ {
+ new CurvePoint(0.4f,0.5f),
+ new CurvePoint(0.6f,0.6f),
+ new CurvePoint(0.8f,0.7f),
+ new CurvePoint(1.0f,0.8f)
+ };
+
+ private static readonly SimpleCurve FertilityCurve = new SimpleCurve()
+ {
+ new CurvePoint(0.4f,0.01f),
+ new CurvePoint(0.6f,0.1f),
+ new CurvePoint(0.8f,0.25f),
+ new CurvePoint(1.0f,0.5f)
+ };
+
public Hediff_BasePregnancy Pregnancy {
get
{
@@ -163,6 +187,42 @@ namespace RJW_Menstruation
}
}
+ // >= 1: Normal cycles
+ // 1 - 0: Climacteric
+ // <= 0: Menopause
+ public float EggHealth
+ {
+ get
+ {
+ if (!Configurations.EnableMenopause) return Mathf.Min(1.0f, ovarypower / OvaryPowerThreshold);
+ else return ovarypower / OvaryPowerThreshold;
+ }
+ }
+
+ public float SexFrequencyModifier()
+ {
+ float eggHealth = EggHealth;
+ if (eggHealth >= 1) return 1.0f;
+ else if (eggHealth <= 0) return 0.01f;
+ else return SexFrequencyCurve.Evaluate(eggHealth);
+ }
+
+ public float SexSatisfactionModifier()
+ {
+ float eggHealth = EggHealth;
+ if (eggHealth >= 1) return 1.0f;
+ else if (eggHealth <= 0) return 0.5f;
+ else return SexSatisfactionCurve.Evaluate(eggHealth);
+ }
+
+ public float FertilityModifier()
+ {
+ float eggHealth = EggHealth;
+ if (eggHealth >= 1) return 1.0f;
+ else if (eggHealth <= 0) return 0.0f;
+ else return FertilityCurve.Evaluate(eggHealth);
+ }
+
public float TotalCum
{
get
@@ -210,7 +270,7 @@ namespace RJW_Menstruation
{
float factor = 1.0f;
if (Pawn.Has(Quirk.Breeder)) factor = 10.0f;
- return Pawn.health.capacities.GetLevel(xxx.reproduction) * Props.baseImplantationChanceFactor * factor;
+ return Pawn.health.capacities.GetLevel(xxx.reproduction) * Props.baseImplantationChanceFactor * FertilityModifier() * factor;
}
}
public IEnumerable GetCumsInfo
@@ -268,20 +328,21 @@ namespace RJW_Menstruation
switch (CurrentVisibleStage)
{
case Stage.Follicular:
- return Translations.Stage_Follicular;
+ return Translations.Stage_Follicular + (EggHealth < 1f ? Translations.Stage_Climacteric : "");
case Stage.Ovulatory:
- return Translations.Stage_Ovulatory;
+ return Translations.Stage_Ovulatory + (EggHealth < 1f ? Translations.Stage_Climacteric : "");
case Stage.Luteal:
- return Translations.Stage_Luteal;
+ return Translations.Stage_Luteal + (EggHealth < 1f ? Translations.Stage_Climacteric : "");
case Stage.Bleeding:
- return Translations.Stage_Bleeding;
+ return Translations.Stage_Bleeding + (EggHealth < 1f ? Translations.Stage_Climacteric : "");
case Stage.Pregnant:
return Translations.Stage_Pregnant;
case Stage.Recover:
return Translations.Stage_Recover;
case Stage.None:
case Stage.Young:
- return Translations.Stage_None;
+ if (EggHealth <= 0f) return Translations.Stage_Menopause;
+ else return Translations.Stage_None;
case Stage.ClimactericFollicular:
return Translations.Stage_Follicular + " - " + Translations.Stage_Climacteric;
case Stage.ClimactericLuteal:
@@ -303,20 +364,21 @@ namespace RJW_Menstruation
switch (CurrentVisibleStage)
{
case Stage.Follicular:
- return Translations.Stage_Follicular_Desc;
+ return Translations.Stage_Follicular_Desc + (EggHealth < 1f ? Translations.Stage_Climacteric_Desc : "");
case Stage.Ovulatory:
- return Translations.Stage_Ovulatory_Desc;
+ return Translations.Stage_Ovulatory_Desc + (EggHealth < 1f ? Translations.Stage_Climacteric_Desc : "");
case Stage.Luteal:
- return Translations.Stage_Luteal_Desc;
+ return Translations.Stage_Luteal_Desc + (EggHealth < 1f ? Translations.Stage_Climacteric_Desc : "");
case Stage.Bleeding:
- return Translations.Stage_Bleeding_Desc;
+ return Translations.Stage_Bleeding_Desc + (EggHealth < 1f ? Translations.Stage_Climacteric_Desc : "");
case Stage.Pregnant:
return Translations.Stage_Pregnant_Desc;
case Stage.Recover:
return Translations.Stage_Recover_Desc;
case Stage.None:
case Stage.Young:
- return Translations.Stage_None_Desc;
+ if (EggHealth <= 0f) return Translations.Stage_Menopause_Desc;
+ else return Translations.Stage_None_Desc;
case Stage.ClimactericFollicular:
return Translations.Stage_Follicular_Desc + " " + Translations.Stage_Climacteric_Desc;
case Stage.ClimactericLuteal:
@@ -566,20 +628,25 @@ namespace RJW_Menstruation
}
CumOut();
- if (pregnancy == null && Pawn.health.capacities.GetLevel(xxx.reproduction) <= 0) curStage = Stage.Young;
+
+ if (curStage == Stage.ClimactericFollicular) curStage = Stage.Follicular;
+ else if (curStage == Stage.ClimactericLuteal) curStage = Stage.Luteal;
+ else if (curStage == Stage.ClimactericBleeding) curStage = Stage.Bleeding;
+
+ if (pregnancy == null && (Pawn.health.capacities.GetLevel(xxx.reproduction) <= 0) || EggHealth <= 0) curStage = Stage.Young;
switch (curStage)
{
case Stage.Follicular:
- FollicularAction(false);
+ FollicularAction();
break;
case Stage.Ovulatory:
OvulatoryAction();
break;
case Stage.Luteal:
- LutealAction(false);
+ LutealAction();
break;
case Stage.Bleeding:
- BleedingAction(false);
+ BleedingAction();
break;
case Stage.Pregnant:
PregnantAction();
@@ -592,15 +659,6 @@ namespace RJW_Menstruation
case Stage.Young:
YoungAction();
break;
- case Stage.ClimactericFollicular:
- FollicularAction(true);
- break;
- case Stage.ClimactericLuteal:
- LutealAction(true);
- break;
- case Stage.ClimactericBleeding:
- BleedingAction(true);
- break;
case Stage.Anestrus:
AnestrusAction();
break;
@@ -1024,36 +1082,19 @@ namespace RJW_Menstruation
protected void InitOvary()
{
- if (!Configurations.EnableMenopause)
- {
- RemoveClimactericEffect();
- }
- else if (ovarypower < -50000)
+ if (ovarypower < -50000)
{
ovarypower = GetOvaryPowerByAge();
if (ovarypower < 1)
{
- Hediff hediff = HediffMaker.MakeHediff(VariousDefOf.Hediff_Menopause, Pawn);
- hediff.Severity = 0.2f;
- Pawn.health.AddHediff(hediff, Genital_Helper.get_genitalsBPR(Pawn));
curStage = Stage.Young;
}
- else if (ovarypower < OvaryPowerThreshold)
- {
- Hediff hediff = HediffMaker.MakeHediff(VariousDefOf.Hediff_Climacteric, Pawn);
- hediff.Severity = Mathf.InverseLerp(OvaryPowerThreshold, 0, ovarypower);
- Pawn.health.AddHediff(hediff, Genital_Helper.get_genitalsBPR(Pawn));
- }
}
}
public void RecoverOvary(float multiply = 1.2f)
{
ovarypower = Math.Max(0, (int)(ovarypower * multiply));
- if (ovarypower >= OvaryPowerThreshold)
- {
- RemoveClimactericEffect();
- }
}
@@ -1327,14 +1368,9 @@ namespace RJW_Menstruation
Pawn.health.AddHediff(hediff, Genital_Helper.get_genitalsBPR(Pawn));
}
- protected virtual void FollicularAction(bool climacteric)
+ protected virtual void FollicularAction()
{
- if (climacteric && !Configurations.EnableMenopause)
- {
- RemoveClimactericEffect();
- StayCurrentStage();
- }
- else if (!IsBreedingSeason())
+ if (!IsBreedingSeason())
{
estrusflag = false;
GoNextStage(Stage.Anestrus);
@@ -1342,12 +1378,7 @@ namespace RJW_Menstruation
}
else if (curStageHrs >= currentIntervalHours)
{
- GoOvulatoryStage(climacteric);
- }
- else if (climacteric && ovarypower < OvaryPowerThreshold / 3 && Rand.Range(0.0f, 1.0f) < 0.2f) //skips ovulatory
- {
- estrusflag = false;
- GoNextStage(Stage.ClimactericLuteal);
+ GoOvulatoryStage();
}
else
{
@@ -1388,47 +1419,30 @@ namespace RJW_Menstruation
i++;
} while (i < (int)eggnum);
eggstack = 0;
- if (Configurations.EnableMenopause && ovarypower < 1)
+ if (EggHealth <= 0)
{
eggs.Clear();
- Hediff hediff = Pawn.health.hediffSet.GetFirstHediffOfDef(VariousDefOf.Hediff_Climacteric);
- if (hediff != null) Pawn.health.RemoveHediff(hediff);
- hediff = HediffMaker.MakeHediff(VariousDefOf.Hediff_Menopause, Pawn);
- hediff.Severity = 0.2f;
- Pawn.health.AddHediff(hediff, Genital_Helper.get_genitalsBPR(Pawn));
ovarypower = 0;
GoNextStage(Stage.Young);
}
- else if (Configurations.EnableMenopause && ovarypower < OvaryPowerThreshold)
- {
- Hediff hediff = HediffMaker.MakeHediff(VariousDefOf.Hediff_Climacteric, Pawn);
- hediff.Severity = Mathf.InverseLerp(OvaryPowerThreshold, 0, ovarypower);
- Pawn.health.AddHediff(hediff, Genital_Helper.get_genitalsBPR(Pawn));
- GoNextStage(Stage.ClimactericLuteal);
- }
else
{
GoNextStage(Stage.Luteal);
}
}
- protected virtual void LutealAction(bool climacteric)
+ protected virtual void LutealAction()
{
- if (climacteric && !Configurations.EnableMenopause)
- {
- RemoveClimactericEffect();
- StayCurrentStage();
- }
- else if (curStageHrs > currentIntervalHours)
+ if (curStageHrs > currentIntervalHours)
{
eggs.Clear();
if (Props.bleedingIntervalDays == 0)
{
- GoNextStage(climacteric ? Stage.ClimactericFollicular : Stage.Follicular);
+ GoNextStage(Stage.Follicular);
}
- else if (climacteric && (ovarypower < OvaryPowerThreshold / 4 || (ovarypower < OvaryPowerThreshold / 3 && Rand.Range(0.0f, 1.0f) < 0.3f))) //skips bleeding
+ else if (EggHealth < 1f / 4f || (EggHealth < 1f / 3f && Rand.Range(0.0f, 1.0f) < 0.3f)) //skips bleeding
{
- GoNextStage(Stage.ClimactericFollicular);
+ GoNextStage(Stage.Follicular);
}
else
{
@@ -1436,7 +1450,7 @@ namespace RJW_Menstruation
{
AddCrampPain();
}
- GoNextStage(climacteric ? Stage.ClimactericBleeding : Stage.Bleeding);
+ GoNextStage(Stage.Bleeding);
}
}
else if (!eggs.NullOrEmpty())
@@ -1461,24 +1475,19 @@ namespace RJW_Menstruation
}
- protected virtual void BleedingAction(bool climacteric)
+ protected virtual void BleedingAction()
{
- if (climacteric && !Configurations.EnableMenopause)
- {
- RemoveClimactericEffect();
- StayCurrentStage();
- }
- else if (curStageHrs >= currentIntervalHours)
+ if (curStageHrs >= currentIntervalHours)
{
Hediff hediff = Pawn.health.hediffSet.GetFirstHediffOfDef(VariousDefOf.Hediff_MenstrualCramp);
if (hediff != null) Pawn.health.RemoveHediff(hediff);
- int totalFollicularHours = PeriodRandomizer(climacteric ? Stage.ClimactericFollicular : Stage.Follicular, climacteric ? 6.0f : 1.0f); // The total amount of time for both bleeding and follicular
+ int totalFollicularHours = PeriodRandomizer(Stage.Follicular); // The total amount of time for both bleeding and follicular
if (totalFollicularHours <= currentIntervalHours) // We've bled for so long that we completely missed the follicular phase
- GoOvulatoryStage(climacteric);
+ GoOvulatoryStage();
else
{
currentIntervalHours = totalFollicularHours - currentIntervalHours; // I.e., the remaining follicular hours equals the total minus the bleeding hours elapsed
- GoNextStage(climacteric ? Stage.ClimactericFollicular : Stage.Follicular, false);
+ GoNextStage(Stage.Follicular, false);
}
}
else
@@ -1514,17 +1523,13 @@ namespace RJW_Menstruation
{
if (curStageHrs >= currentIntervalHours)
{
- if (Pawn.health.capacities.GetLevel(xxx.reproduction) == 0)
+ if (Pawn.health.capacities.GetLevel(xxx.reproduction) == 0 || EggHealth <= 0)
{
GoNextStage(Stage.Young);
}
else if (!IsBreedingSeason())
{
GoNextStage(Stage.Anestrus);
- }
- else if (Configurations.EnableMenopause && ovarypower < OvaryPowerThreshold)
- {
- GoNextStage(Stage.ClimactericFollicular);
}
else
{
@@ -1540,11 +1545,7 @@ namespace RJW_Menstruation
protected virtual void YoungAction()
{
- if (!Configurations.EnableMenopause && ovarypower < 0 && ovarypower > -10000)
- {
- RemoveClimactericEffect();
- }
- if (Pawn.health.capacities.GetLevel(xxx.reproduction) <= 0)
+ if (Pawn.health.capacities.GetLevel(xxx.reproduction) <= 0 || EggHealth <= 0)
{
StayCurrentStageConst(Stage.Young);
}
@@ -1634,14 +1635,18 @@ namespace RJW_Menstruation
protected void GoNextStage(Stage nextstage, bool calculateHours = true)
{
curStageHrs = 0;
- float variabilityFactor = nextstage == Stage.ClimactericFollicular || nextstage == Stage.ClimactericLuteal || nextstage == Stage.ClimactericBleeding ? 6.0f : 1.0f;
- if (calculateHours) currentIntervalHours = PeriodRandomizer(nextstage, variabilityFactor);
+ if (calculateHours) currentIntervalHours = PeriodRandomizer(nextstage);
curStage = nextstage;
}
- protected virtual void GoOvulatoryStage(bool climacteric)
+ protected virtual void GoOvulatoryStage()
{
- GoNextStage(Stage.Ovulatory);
+ if (EggHealth < 1.0f / 3.0f && Rand.Range(0.0f, 1.0f) < 0.2f) // Skip ovulation if deep into climacteric
+ {
+ estrusflag = false;
+ GoNextStage(Stage.Luteal);
+ }
+ else GoNextStage(Stage.Ovulatory);
}
//stage can be interrupted in other reasons
@@ -1656,30 +1661,19 @@ namespace RJW_Menstruation
protected void GoFollicularOrBleeding()
{
- bool climacteric = Configurations.EnableMenopause && ovarypower < OvaryPowerThreshold;
if (Props.bleedingIntervalDays == 0)
{
- GoNextStage(climacteric ? Stage.ClimactericFollicular : Stage.Follicular);
+ GoNextStage(Stage.Follicular);
}
else
{
- GoNextStage(climacteric ? Stage.ClimactericBleeding : Stage.Bleeding);
+ GoNextStage(Stage.Bleeding);
}
}
- protected void RemoveClimactericEffect()
- {
- Hediff hediff = Pawn.health.hediffSet.GetFirstHediffOfDef(VariousDefOf.Hediff_Climacteric);
- if (hediff != null) Pawn.health.RemoveHediff(hediff);
- hediff = Pawn.health.hediffSet.GetFirstHediffOfDef(VariousDefOf.Hediff_Menopause);
- if (hediff != null) Pawn.health.RemoveHediff(hediff);
- if (curStage == Stage.ClimactericBleeding) curStage = Stage.Bleeding;
- else if (curStage == Stage.ClimactericFollicular) curStage = Stage.Follicular;
- else if (curStage == Stage.ClimactericLuteal) curStage = Stage.Luteal;
- }
-
- protected int PeriodRandomizer(Stage stage, float variabilityFactor = 1.0f)
+ protected int PeriodRandomizer(Stage stage)
{
+ float variabilityFactor = (EggHealth < 1.0f) ? 6.0f : 1.0f;
// Most cycle lengthening or shortening occurs in the follicular phase, so weight towards that
switch (stage)
{
diff --git a/1.3/source/RJW_Menstruation/RJW_Menstruation/RJW_Menstruation.csproj b/1.3/source/RJW_Menstruation/RJW_Menstruation/RJW_Menstruation.csproj
index 8d5f04e..4e1acfb 100644
--- a/1.3/source/RJW_Menstruation/RJW_Menstruation/RJW_Menstruation.csproj
+++ b/1.3/source/RJW_Menstruation/RJW_Menstruation/RJW_Menstruation.csproj
@@ -69,6 +69,7 @@
+
diff --git a/1.3/source/RJW_Menstruation/RJW_Menstruation/StatParts.cs b/1.3/source/RJW_Menstruation/RJW_Menstruation/StatParts.cs
new file mode 100644
index 0000000..60abd0a
--- /dev/null
+++ b/1.3/source/RJW_Menstruation/RJW_Menstruation/StatParts.cs
@@ -0,0 +1,90 @@
+using RimWorld;
+using System.Collections.Generic;
+using System.Linq;
+using Verse;
+
+namespace RJW_Menstruation
+{
+ public abstract class StatPart_Menstruation_Effects : StatPart
+ {
+ public override void TransformValue(StatRequest req, ref float val)
+ {
+ if (req.Thing is Pawn pawn && ApplicableComps(pawn).Any())
+ val *= GetFactor(pawn);
+ }
+ protected abstract IEnumerable ApplicableComps(Pawn pawn);
+
+ protected IEnumerable AllComps(Pawn pawn)
+ {
+ return pawn.GetMenstruationComps();
+ }
+
+ protected abstract float GetFactor(Pawn pawn);
+ }
+
+ public abstract class StatPart_Climacteric_Effects : StatPart_Menstruation_Effects
+ {
+ public override string ExplanationPart(StatRequest req)
+ {
+ if (req.Thing is Pawn pawn && ApplicableComps(pawn).Any())
+ {
+ return $"{Translations.Stage_Climacteric.CapitalizeFirst()}: x{GetFactor(pawn).ToStringPercent()}";
+ }
+ else return null;
+ }
+
+ protected override IEnumerable ApplicableComps(Pawn pawn)
+ {
+ return pawn.GetMenstruationComps().Where(comp => comp.EggHealth < 1f && comp.EggHealth > 0f);
+ }
+ }
+
+ public abstract class StatPart_Menopause_Effects : StatPart_Menstruation_Effects
+ {
+ public override string ExplanationPart(StatRequest req)
+ {
+ if (req.Thing is Pawn pawn && ApplicableComps(pawn).Any())
+ {
+ return $"{Translations.Stage_Menopause.CapitalizeFirst()}: x{GetFactor(pawn).ToStringPercent()}";
+ }
+ else return null;
+ }
+
+ protected override IEnumerable ApplicableComps(Pawn pawn)
+ {
+ return pawn.GetMenstruationComps().Where(comp => comp.EggHealth <= 0f);
+ }
+ }
+
+ public class StatPart_Climacteric_SexFrequency : StatPart_Climacteric_Effects
+ {
+ protected override float GetFactor(Pawn pawn)
+ {
+ return AllComps(pawn).Average(comp => comp.SexFrequencyModifier());
+ }
+ }
+
+ public class StatPart_Climacteric_SexSatisfaction : StatPart_Climacteric_Effects
+ {
+ protected override float GetFactor(Pawn pawn)
+ {
+ return AllComps(pawn).Average(comp => comp.SexSatisfactionModifier());
+ }
+ }
+
+ public class StatPart_Menopause_SexFrequency : StatPart_Menopause_Effects
+ {
+ protected override float GetFactor(Pawn pawn)
+ {
+ return AllComps(pawn).Average(comp => comp.SexFrequencyModifier());
+ }
+ }
+
+ public class StatPart_Menopause_SexSatisfaction : StatPart_Menopause_Effects
+ {
+ protected override float GetFactor(Pawn pawn)
+ {
+ return AllComps(pawn).Average(comp => comp.SexSatisfactionModifier());
+ }
+ }
+}
\ No newline at end of file
diff --git a/1.3/source/RJW_Menstruation/RJW_Menstruation/Translations.cs b/1.3/source/RJW_Menstruation/RJW_Menstruation/Translations.cs
index 320763d..8f0de67 100644
--- a/1.3/source/RJW_Menstruation/RJW_Menstruation/Translations.cs
+++ b/1.3/source/RJW_Menstruation/RJW_Menstruation/Translations.cs
@@ -15,6 +15,7 @@ namespace RJW_Menstruation
public static readonly string Stage_Recover = "Stage_Recover".Translate();
public static readonly string Stage_None = "Stage_None".Translate();
public static readonly string Stage_Climacteric = "Stage_Climacteric".Translate();
+ public static readonly string Stage_Menopause = "Stage_Menopause".Translate();
public static readonly string Stage_Anestrus = "Stage_Anestrus".Translate();
public static readonly string Stage_Follicular_Desc = "Stage_Follicular_Desc".Translate();
public static readonly string Stage_Follicular_Induced_Desc = "Stage_Follicular_Induced_Desc".Translate();
@@ -24,6 +25,7 @@ namespace RJW_Menstruation
public static readonly string Stage_Pregnant_Desc = "Stage_Pregnant_Desc".Translate();
public static readonly string Stage_Recover_Desc = "Stage_Recover_Desc".Translate();
public static readonly string Stage_None_Desc = "Stage_None_Desc".Translate();
+ public static readonly string Stage_Menopause_Desc = "Stage_Menopause_Desc".Translate();
public static readonly string Stage_Climacteric_Desc = "Stage_Climacteric_Desc".Translate();
public static readonly string Stage_Anestrus_Desc = "Stage_Anestrus_Desc".Translate();
public static readonly string Button_HealthTab = "Button_HealthTab".Translate();
diff --git a/1.3/source/RJW_Menstruation/RJW_Menstruation/VariousDefOf.cs b/1.3/source/RJW_Menstruation/RJW_Menstruation/VariousDefOf.cs
index 562ca62..71d28a9 100644
--- a/1.3/source/RJW_Menstruation/RJW_Menstruation/VariousDefOf.cs
+++ b/1.3/source/RJW_Menstruation/RJW_Menstruation/VariousDefOf.cs
@@ -17,8 +17,6 @@ namespace RJW_Menstruation
public static readonly ThingDef FilthMixture = DefDatabase.GetNamed("FilthMixture");
public static readonly HediffDef RJW_IUD = DefDatabase.GetNamed("RJW_IUD");
public static readonly HediffDef Hediff_MenstrualCramp = DefDatabase.GetNamed("Hediff_MenstrualCramp");
- public static readonly HediffDef Hediff_Climacteric = DefDatabase.GetNamed("Hediff_Climacteric");
- public static readonly HediffDef Hediff_Menopause = DefDatabase.GetNamed("Hediff_Menopause");
public static readonly HediffDef Hediff_Estrus = DefDatabase.GetNamed("Hediff_Estrus");
public static readonly HediffDef Hediff_Estrus_Concealed = DefDatabase.GetNamed("Hediff_Estrus_Concealed");
public static readonly HediffDef Hediff_ASA = DefDatabase.GetNamed("Hediff_ASA");
diff --git a/changelogs.txt b/changelogs.txt
index c5cc2bf..58c1e3c 100644
--- a/changelogs.txt
+++ b/changelogs.txt
@@ -1,4 +1,5 @@
Version 1.0.7.5
+ - Climacteric and menopause are now per-womb. Their effects on sex drive and satisfaction will be averaged.
Version 1.0.7.4
- Fix errors when using other mods with bad HediffCompProperties.