mirror of
https://gitgud.io/lutepickle/rjw_menstruation.git
synced 2024-08-14 22:46:52 +00:00
Compare commits
6 commits
ca895ef296
...
e4583fe9d7
Author | SHA1 | Date | |
---|---|---|---|
|
e4583fe9d7 | ||
|
5abdf52dbe | ||
|
69934d06f5 | ||
|
09f9438bcc | ||
|
91142d640f | ||
|
b28beb8eaa |
9 changed files with 47 additions and 5 deletions
Binary file not shown.
|
@ -18,6 +18,7 @@
|
||||||
<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>
|
||||||
|
@ -26,6 +27,7 @@
|
||||||
<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>
|
||||||
|
@ -34,6 +36,7 @@
|
||||||
<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>
|
||||||
|
@ -50,6 +53,7 @@
|
||||||
<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>
|
||||||
|
@ -58,6 +62,7 @@
|
||||||
<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>
|
||||||
|
@ -74,6 +79,7 @@
|
||||||
<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>
|
||||||
|
@ -82,6 +88,7 @@
|
||||||
<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>
|
||||||
|
@ -91,6 +98,7 @@
|
||||||
<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>
|
||||||
|
|
BIN
1.4/Textures/UI/Genes/Placeholder.png
Normal file
BIN
1.4/Textures/UI/Genes/Placeholder.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.1 KiB |
|
@ -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");
|
||||||
curStage = Stage.Pregnant;
|
GoNextStage(Stage.Pregnant);
|
||||||
}
|
}
|
||||||
|
|
||||||
BeforeSimulator();
|
BeforeSimulator();
|
||||||
|
|
||||||
if (pregnancy == null && (Pawn.health.capacities.GetLevel(xxx.reproduction) <= 0 || EggHealth <= 0 || Pawn.SterileGenes())) curStage = Stage.Infertile;
|
if (pregnancy == null && (Pawn.health.capacities.GetLevel(xxx.reproduction) <= 0 || EggHealth <= 0 || Pawn.SterileGenes())) GoNextStage(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: // Often unused
|
default:
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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)
|
||||||
curStage = Stage.Anestrus;
|
GoNextStage(Stage.Anestrus);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -111,6 +111,7 @@ 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;
|
||||||
|
@ -165,6 +166,7 @@ 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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -127,6 +127,7 @@ 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
|
||||||
);
|
);
|
||||||
|
@ -351,6 +352,7 @@ 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;
|
||||||
|
|
|
@ -26,8 +26,10 @@ 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}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,8 +39,10 @@ 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}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,6 +52,7 @@ 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;
|
||||||
}
|
}
|
||||||
|
@ -215,4 +220,28 @@ 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;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//}
|
||||||
}
|
}
|
|
@ -1,7 +1,8 @@
|
||||||
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.
|
||||||
- Added several menstruation-related genes.
|
- Properly give the opportunity to name a newborn with Biotech and multiple pregnancy.
|
||||||
|
- 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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue