Compare commits

..

No commits in common. "e4583fe9d75cc6206fcebad82caa3989b609c91c" and "ca895ef2964434101f303bdef673f6e9d3e55fcd" have entirely different histories.

9 changed files with 5 additions and 47 deletions

Binary file not shown.

View file

@ -18,7 +18,6 @@
<defName>Menstruation_ShortEggLifetime</defName> <defName>Menstruation_ShortEggLifetime</defName>
<label>short egg lifetime</label> <label>short egg lifetime</label>
<description>Unfertilized eggs with this gene last three-quarters as long.</description> <description>Unfertilized eggs with this gene last three-quarters as long.</description>
<iconPath>UI/Genes/Placeholder</iconPath>
<biostatMet>1</biostatMet> <biostatMet>1</biostatMet>
<displayOrderInCategory>10</displayOrderInCategory> <displayOrderInCategory>10</displayOrderInCategory>
</GeneDef> </GeneDef>
@ -27,7 +26,6 @@
<defName>Menstruation_DoubleEggLifetime</defName> <defName>Menstruation_DoubleEggLifetime</defName>
<label>double egg lifetime</label> <label>double egg lifetime</label>
<description>Unfertilized eggs with this gene last twice as long.</description> <description>Unfertilized eggs with this gene last twice as long.</description>
<iconPath>UI/Genes/Placeholder</iconPath>
<biostatMet>-1</biostatMet> <biostatMet>-1</biostatMet>
<displayOrderInCategory>12</displayOrderInCategory> <displayOrderInCategory>12</displayOrderInCategory>
</GeneDef> </GeneDef>
@ -36,7 +34,6 @@
<defName>Menstruation_QuadEggLifetime</defName> <defName>Menstruation_QuadEggLifetime</defName>
<label>quadrule egg lifetime</label> <label>quadrule egg lifetime</label>
<description>Eggs with this gene last four times as long.</description> <description>Eggs with this gene last four times as long.</description>
<iconPath>UI/Genes/Placeholder</iconPath>
<biostatMet>-2</biostatMet> <biostatMet>-2</biostatMet>
<biostatCpx>1</biostatCpx> <biostatCpx>1</biostatCpx>
<displayOrderInCategory>16</displayOrderInCategory> <displayOrderInCategory>16</displayOrderInCategory>
@ -53,7 +50,6 @@
<defName>Menstruation_NeverEstrus</defName> <defName>Menstruation_NeverEstrus</defName>
<label>never estrus</label> <label>never estrus</label>
<description>Carriers of this gene will never go into estrus.</description> <description>Carriers of this gene will never go into estrus.</description>
<iconPath>UI/Genes/Placeholder</iconPath>
<biostatMet>1</biostatMet> <biostatMet>1</biostatMet>
<displayOrderInCategory>20</displayOrderInCategory> <displayOrderInCategory>20</displayOrderInCategory>
</GeneDef> </GeneDef>
@ -62,7 +58,6 @@
<defName>Menstruation_FullEstrus</defName> <defName>Menstruation_FullEstrus</defName>
<label>full estrus</label> <label>full estrus</label>
<description>Carriers of this gene will enter full estrus every menstrual cycle, regardless of vagina type.</description> <description>Carriers of this gene will enter full estrus every menstrual cycle, regardless of vagina type.</description>
<iconPath>UI/Genes/Placeholder</iconPath>
<biostatMet>-1</biostatMet> <biostatMet>-1</biostatMet>
<biostatCpx>1</biostatCpx> <biostatCpx>1</biostatCpx>
<displayOrderInCategory>25</displayOrderInCategory> <displayOrderInCategory>25</displayOrderInCategory>
@ -79,7 +74,6 @@
<defName>Menstruation_DoubleOvulation</defName> <defName>Menstruation_DoubleOvulation</defName>
<label>double ovulation</label> <label>double ovulation</label>
<description>Carriers of this gene will ovulate twice as many eggs.</description> <description>Carriers of this gene will ovulate twice as many eggs.</description>
<iconPath>UI/Genes/Placeholder</iconPath>
<biostatMet>-1</biostatMet> <biostatMet>-1</biostatMet>
<displayOrderInCategory>30</displayOrderInCategory> <displayOrderInCategory>30</displayOrderInCategory>
</GeneDef> </GeneDef>
@ -88,7 +82,6 @@
<defName>Menstruation_QuadOvulation</defName> <defName>Menstruation_QuadOvulation</defName>
<label>quadruple ovulation</label> <label>quadruple ovulation</label>
<description>Carriers of this gene will ovulate four times as many eggs.</description> <description>Carriers of this gene will ovulate four times as many eggs.</description>
<iconPath>UI/Genes/Placeholder</iconPath>
<biostatMet>-1</biostatMet> <biostatMet>-1</biostatMet>
<displayOrderInCategory>35</displayOrderInCategory> <displayOrderInCategory>35</displayOrderInCategory>
</GeneDef> </GeneDef>
@ -98,7 +91,6 @@
<label>no bleeding</label> <label>no bleeding</label>
<displayCategory>Menstruation</displayCategory> <displayCategory>Menstruation</displayCategory>
<description>Carriers of this gene will not bleed at the end of their cycle.</description> <description>Carriers of this gene will not bleed at the end of their cycle.</description>
<iconPath>UI/Genes/Placeholder</iconPath>
<biostatMet>1</biostatMet> <biostatMet>1</biostatMet>
<displayOrderInCategory>40</displayOrderInCategory> <displayOrderInCategory>40</displayOrderInCategory>
</GeneDef> </GeneDef>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

View file

@ -673,12 +673,12 @@ namespace RJW_Menstruation
if (Pregnancy != null && curStage != Stage.Pregnant) if (Pregnancy != null && curStage != Stage.Pregnant)
{ {
Log.Warning($"{Pawn}'s womb has a pregnancy, but was not in the pregnant stage"); Log.Warning($"{Pawn}'s womb has a pregnancy, but was not in the pregnant stage");
GoNextStage(Stage.Pregnant); curStage = Stage.Pregnant;
} }
BeforeSimulator(); BeforeSimulator();
if (pregnancy == null && (Pawn.health.capacities.GetLevel(xxx.reproduction) <= 0 || EggHealth <= 0 || Pawn.SterileGenes())) GoNextStage(Stage.Infertile); if (pregnancy == null && (Pawn.health.capacities.GetLevel(xxx.reproduction) <= 0 || EggHealth <= 0 || Pawn.SterileGenes())) curStage = Stage.Infertile;
switch (curStage) switch (curStage)
{ {
case Stage.Follicular: case Stage.Follicular:
@ -1799,7 +1799,7 @@ namespace RJW_Menstruation
return (int)(Props.recoveryIntervalDays * 24 * Rand.Range(0.95f, 1.05f)); return (int)(Props.recoveryIntervalDays * 24 * Rand.Range(0.95f, 1.05f));
case Stage.Pregnant: case Stage.Pregnant:
return (int)MenstruationUtility.GestationHours(pregnancy); return (int)MenstruationUtility.GestationHours(pregnancy);
default: default: // Often unused
return 1; return 1;
} }
} }

View file

@ -33,7 +33,7 @@ namespace RJW_Menstruation
// Make the cutoff halfway into cycle, just to be sure there isn't a double-cycle the first time // Make the cutoff halfway into cycle, just to be sure there isn't a double-cycle the first time
if ((curStage == Stage.Follicular || curStage == Stage.Luteal || curStage == Stage.Bleeding) if ((curStage == Stage.Follicular || curStage == Stage.Luteal || curStage == Stage.Bleeding)
&& (averageCycleIntervalHours - hoursToNextCycle) / 2 >= 24 * (Props.follicularIntervalDays + Props.lutealIntervalDays) / cycleSpeed) && (averageCycleIntervalHours - hoursToNextCycle) / 2 >= 24 * (Props.follicularIntervalDays + Props.lutealIntervalDays) / cycleSpeed)
GoNextStage(Stage.Anestrus); curStage = Stage.Anestrus;
} }
} }

View file

@ -111,7 +111,6 @@ namespace RJW_Menstruation
{ {
baby.story.headType = firstbaby.story.headType; baby.story.headType = firstbaby.story.headType;
baby.story.hairDef = firstbaby.story.hairDef; baby.story.hairDef = firstbaby.story.hairDef;
baby.story.HairColor = firstbaby.story.HairColor;
baby.story.bodyType = firstbaby.story.bodyType; baby.story.bodyType = firstbaby.story.bodyType;
baby.story.furDef = firstbaby.story.furDef; baby.story.furDef = firstbaby.story.furDef;
baby.story.skinColorOverride = firstbaby.story.skinColorOverride; baby.story.skinColorOverride = firstbaby.story.skinColorOverride;
@ -166,7 +165,6 @@ namespace RJW_Menstruation
if (baby == null) return PawnGenerator.GeneratePawn(request); // Shouldn't happen if (baby == null) return PawnGenerator.GeneratePawn(request); // Shouldn't happen
baby.ageTracker.AgeBiologicalTicks = 0; baby.ageTracker.AgeBiologicalTicks = 0;
baby.ageTracker.AgeChronologicalTicks = 0; baby.ageTracker.AgeChronologicalTicks = 0;
baby.babyNamingDeadline = Find.TickManager.TicksGame + GenDate.TicksPerDay;
if (request.ForceDead) baby.Kill(null, null); if (request.ForceDead) baby.Kill(null, null);
return baby; return baby;
} }

View file

@ -127,7 +127,6 @@ namespace RJW_Menstruation
string label = bestOutcome.label; string label = bestOutcome.label;
string description = bestOutcome.description.Formatted(mother.Named("MOTHER")); string description = bestOutcome.description.Formatted(mother.Named("MOTHER"));
baby.babyNamingDeadline = Find.TickManager.TicksGame + GenDate.TicksPerDay;
ChoiceLetter_BabyBirth choiceLetter_BabyBirth = (ChoiceLetter_BabyBirth)LetterMaker.MakeLetter( ChoiceLetter_BabyBirth choiceLetter_BabyBirth = (ChoiceLetter_BabyBirth)LetterMaker.MakeLetter(
label, description, LetterDefOf.BabyBirth, baby label, description, LetterDefOf.BabyBirth, baby
); );
@ -352,7 +351,6 @@ namespace RJW_Menstruation
{ {
baby.story.headType = firstbaby.story.headType; baby.story.headType = firstbaby.story.headType;
baby.story.hairDef = firstbaby.story.hairDef; baby.story.hairDef = firstbaby.story.hairDef;
baby.story.HairColor = firstbaby.story.HairColor;
baby.story.bodyType = firstbaby.story.bodyType; baby.story.bodyType = firstbaby.story.bodyType;
baby.story.furDef = firstbaby.story.furDef; baby.story.furDef = firstbaby.story.furDef;
baby.story.skinColorOverride = firstbaby.story.skinColorOverride; baby.story.skinColorOverride = firstbaby.story.skinColorOverride;

View file

@ -26,10 +26,8 @@ namespace RJW_Menstruation
public static void Postfix(Hediff_Pregnant __instance) public static void Postfix(Hediff_Pregnant __instance)
{ {
HediffComp_Menstruation comp = __instance.GetMenstruationCompFromPregnancy(); HediffComp_Menstruation comp = __instance.GetMenstruationCompFromPregnancy();
if (Configurations.Debug) Log.Message($"{comp.Pawn}'s labor starting, menstruation comp is {comp}");
if (comp == null) return; if (comp == null) return;
comp.Pregnancy = __instance.pawn.health.hediffSet.GetFirstHediffOfDef(HediffDefOf.PregnancyLabor); comp.Pregnancy = __instance.pawn.health.hediffSet.GetFirstHediffOfDef(HediffDefOf.PregnancyLabor);
if (Configurations.Debug) Log.Message($"New pregnancy Hediff is {comp.Pregnancy}");
} }
} }
@ -39,10 +37,8 @@ namespace RJW_Menstruation
public static void PostFix(Hediff_Labor __instance) public static void PostFix(Hediff_Labor __instance)
{ {
HediffComp_Menstruation comp = __instance.GetMenstruationCompFromPregnancy(); HediffComp_Menstruation comp = __instance.GetMenstruationCompFromPregnancy();
if (Configurations.Debug) Log.Message($"{comp.Pawn}'s initial labor ending, menstruation comp is {comp}");
if (comp == null) return; if (comp == null) return;
comp.Pregnancy = __instance.pawn.health.hediffSet.GetFirstHediffOfDef(HediffDefOf.PregnancyLaborPushing); comp.Pregnancy = __instance.pawn.health.hediffSet.GetFirstHediffOfDef(HediffDefOf.PregnancyLaborPushing);
if (Configurations.Debug) Log.Message($"New pregnancy Hediff is {comp.Pregnancy}");
} }
} }
@ -52,7 +48,6 @@ namespace RJW_Menstruation
public static void PostFix(Hediff_LaborPushing __instance) public static void PostFix(Hediff_LaborPushing __instance)
{ {
HediffComp_Menstruation comp = __instance.GetMenstruationCompFromPregnancy(); HediffComp_Menstruation comp = __instance.GetMenstruationCompFromPregnancy();
if (Configurations.Debug) Log.Message($"{comp.Pawn}'s labor pushing ending, menstruation comp is {comp}");
if (comp == null) return; if (comp == null) return;
comp.Pregnancy = null; comp.Pregnancy = null;
} }
@ -220,28 +215,4 @@ namespace RJW_Menstruation
comp.Notify_UpdatedGenes(); comp.Notify_UpdatedGenes();
} }
} }
//[HarmonyPatch(typeof(ChildcareUtility), nameof(ChildcareUtility.SuckleFromLactatingPawn))]
//public class GreedyConsume_Patch
//{
// private static float ConsumeAndAdjustNipples(HediffComp_Chargeable instance, float desiredCharge)
// {
// // Pulling breast comp every tick might be too much for performance.
// const float averageNippleChangePerTick = 0.0025f / 50000f;
// instance.Pawn.GetBreastComp()?.AdjustNippleProgress(Rand.Range(0.0f, averageNippleChangePerTick * 2) * Configurations.MaxBreastIncrementFactor);
// return instance.GreedyConsume(desiredCharge);
// }
// private static readonly MethodInfo GreedyConsume = AccessTools.Method(typeof(HediffComp_Chargeable), nameof(HediffComp_Chargeable.GreedyConsume), new Type[] { typeof(HediffComp_Chargeable), typeof(float) });
// public static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)
// {
// if(GreedyConsume == null) throw new InvalidOperationException("GreedyConsume not found");
// foreach (var instruction in instructions)
// {
// if (instruction.Calls(GreedyConsume))
// yield return CodeInstruction.Call(typeof(GreedyConsume_Patch), nameof(GreedyConsume_Patch.ConsumeAndAdjustNipples));
// yield return instruction;
// }
// }
//}
} }

View file

@ -1,8 +1,7 @@
Version 1.0.8.6 Version 1.0.8.6
- Updated Traditional Chinese translation by Hydrogen. - Updated Traditional Chinese translation by Hydrogen.
- Fix error when trying to terminate a non-Biotech pregnancy. - Fix error when trying to terminate a non-Biotech pregnancy.
- Properly give the opportunity to name a newborn with Biotech and multiple pregnancy. - Added several menstruation-related genes.
- Added several menstruation-related genes, with a placeholder graphic for now.
- Added experimental support for twins and hybrids with Biotech pregnancies, disabled by default. - Added experimental support for twins and hybrids with Biotech pregnancies, disabled by default.
Version 1.0.8.5 Version 1.0.8.5