Merge branch 'dev'

This commit is contained in:
lutepickle 2022-11-16 07:46:22 -08:00
commit 06c1ade118
13 changed files with 263 additions and 97 deletions

Binary file not shown.

View File

@ -132,6 +132,7 @@
<CustomHybrid_List_Title>Custom Hybrid Editor</CustomHybrid_List_Title>
<CustomHybrid_Title>Hybrids of {0}</CustomHybrid_Title>
<CustomHybrid_Tooltip>When {0} breed with {1}, {2} will be born at {3} chance.&#10;If both races have hybrid definitions for each other, the father's definition will be used.</CustomHybrid_Tooltip>
<CannotNoEggs>No eggs</CannotNoEggs>
</LanguageData>

View File

@ -61,5 +61,16 @@
</comps>
</value>
</Operation>
<Operation Class="PatchOperationAdd">
<xpath>/Defs/rjw.HediffDef_PartBase[defName="UdderBreasts"]</xpath>
<value>
<comps>
<li Class="RJW_Menstruation.CompProperties_Breast">
<BreastTex>Breasts_Udder/Breast</BreastTex>
<BlacknippleColor>(55,20,0)</BlacknippleColor>
</li>
</comps>
</value>
</Operation>
</Patch>

View File

@ -10,7 +10,7 @@
<!-- total estrus days = estrusDaysBeforeOvulation + eggLifespanDays -->
<Patch>
<Operation Class="PatchOperationAdd">
<!--<Operation Class="PatchOperationAdd">
<xpath>/Defs/rjw.HediffDef_PartBase[defName="CervineVagina"]</xpath>
<value>
<comps>
@ -29,6 +29,26 @@
</li>
</comps>
</value>
</Operation>-->
<Operation Class="PatchOperationAdd">
<xpath>/Defs/rjw.HediffDef_PartBase[defName="BovineVagina"]</xpath>
<value>
<comps>
<li Class="RJW_Menstruation.CompProperties_Menstruation">
<maxCumCapacity>10</maxCumCapacity>
<baseImplantationChanceFactor>1.0</baseImplantationChanceFactor>
<basefertilizationChanceFactor>1.0</basefertilizationChanceFactor>
<follicularIntervalDays>4</follicularIntervalDays>
<lutealIntervalDays>17</lutealIntervalDays>
<bleedingIntervalDays>0</bleedingIntervalDays>
<recoveryIntervalDays>90</recoveryIntervalDays>
<eggLifespanDays>2</eggLifespanDays>
<wombTex>Womb/Womb</wombTex>
<vagTex>Genitals/Vagina</vagTex>
</li>
</comps>
</value>
</Operation>
<Operation Class="PatchOperationAdd">
@ -51,28 +71,108 @@
</comps>
</value>
</Operation>
<Operation Class="PatchOperationAdd">
<xpath>/Defs/rjw.HediffDef_PartBase[defName="TreeVagina"]</xpath>
<xpath>/Defs/rjw.HediffDef_PartBase[defName="ElephantVagina"]</xpath>
<value>
<comps>
<li Class="RJW_Menstruation.CompProperties_Menstruation">
<maxCumCapacity>15</maxCumCapacity>
<maxCumCapacity>18</maxCumCapacity>
<baseImplantationChanceFactor>1.0</baseImplantationChanceFactor>
<basefertilizationChanceFactor>1.0</basefertilizationChanceFactor>
<follicularIntervalDays>35</follicularIntervalDays>
<lutealIntervalDays>63</lutealIntervalDays>
<bleedingIntervalDays>0</bleedingIntervalDays>
<recoveryIntervalDays>30</recoveryIntervalDays>
<eggLifespanDays>3</eggLifespanDays>
<wombTex>Womb/Womb</wombTex>
<vagTex>Genitals/Vagina</vagTex>
</li>
</comps>
</value>
</Operation>
<Operation Class="PatchOperationAdd">
<xpath>/Defs/rjw.HediffDef_PartBase[defName="HyenaVagina"]</xpath>
<value>
<comps>
<li Class="RJW_Menstruation.CompProperties_Menstruation">
<maxCumCapacity>18</maxCumCapacity>
<baseImplantationChanceFactor>1.0</baseImplantationChanceFactor>
<basefertilizationChanceFactor>1.0</basefertilizationChanceFactor>
<follicularIntervalDays>7</follicularIntervalDays>
<lutealIntervalDays>7</lutealIntervalDays>
<bleedingIntervalDays>0</bleedingIntervalDays>
<recoveryIntervalDays>30</recoveryIntervalDays>
<eggLifespanDays>1</eggLifespanDays>
<wombTex>Womb/Womb</wombTex>
<vagTex>Genitals/Vagina</vagTex>
<concealedEstrus>true</concealedEstrus>
</li>
</comps>
</value>
</Operation>
<Operation Class="PatchOperationAdd">
<xpath>/Defs/rjw.HediffDef_PartBase[defName="MammalVagina"]</xpath>
<value>
<comps>
<li Class="RJW_Menstruation.CompProperties_Menstruation">
<maxCumCapacity>10</maxCumCapacity>
<baseImplantationChanceFactor>1.0</baseImplantationChanceFactor>
<basefertilizationChanceFactor>1.0</basefertilizationChanceFactor>
<follicularIntervalDays>14</follicularIntervalDays>
<lutealIntervalDays>14</lutealIntervalDays>
<bleedingIntervalDays>0</bleedingIntervalDays>
<recoveryIntervalDays>30</recoveryIntervalDays>
<eggLifespanDays>3</eggLifespanDays>
<wombTex>Womb/Womb</wombTex>
<vagTex>Genitals/Vagina</vagTex>
</li>
</comps>
</value>
</Operation>
<Operation Class="PatchOperationAdd">
<xpath>/Defs/rjw.HediffDef_PartBase[defName="MarineVagina"]</xpath>
<value>
<comps>
<li Class="RJW_Menstruation.CompProperties_Menstruation">
<maxCumCapacity>10</maxCumCapacity>
<baseImplantationChanceFactor>1.0</baseImplantationChanceFactor>
<basefertilizationChanceFactor>1.0</basefertilizationChanceFactor>
<follicularIntervalDays>10</follicularIntervalDays>
<lutealIntervalDays>12</lutealIntervalDays>
<lutealIntervalDays>20</lutealIntervalDays>
<bleedingIntervalDays>0</bleedingIntervalDays>
<recoveryIntervalDays>30</recoveryIntervalDays>
<eggLifespanDays>2</eggLifespanDays>
<wombTex>Womb/Womb</wombTex>
<vagTex>Genitals/Vagina</vagTex>
<breedingSeason>Fall</breedingSeason>
</li>
</comps>
</value>
</Operation>
<Operation Class="PatchOperationAdd">
<xpath>/Defs/rjw.HediffDef_PartBase[defName="PigVagina"]</xpath>
<value>
<comps>
<li Class="RJW_Menstruation.CompProperties_Menstruation">
<maxCumCapacity>18</maxCumCapacity>
<baseImplantationChanceFactor>1.0</baseImplantationChanceFactor>
<basefertilizationChanceFactor>1.0</basefertilizationChanceFactor>
<follicularIntervalDays>6</follicularIntervalDays>
<lutealIntervalDays>14</lutealIntervalDays>
<bleedingIntervalDays>0</bleedingIntervalDays>
<recoveryIntervalDays>24</recoveryIntervalDays>
<eggLifespanDays>2</eggLifespanDays>
<wombTex>Womb/Womb</wombTex>
<vagTex>Genitals/Vagina</vagTex>
</li>
</comps>
</value>
</Operation>
<Operation Class="PatchOperationAdd">
<xpath>/Defs/rjw.HediffDef_PartBase[defName="PistilVagina"]</xpath>
<value>
@ -94,27 +194,6 @@
</value>
</Operation>
<Operation Class="PatchOperationAdd">
<xpath>/Defs/rjw.HediffDef_PartBase[defName="NephilaSlimeVagina"]</xpath>
<value>
<comps>
<li Class="RJW_Menstruation.CompProperties_Menstruation">
<maxCumCapacity>12</maxCumCapacity>
<baseImplantationChanceFactor>1.0</baseImplantationChanceFactor>
<basefertilizationChanceFactor>1.0</basefertilizationChanceFactor>
<follicularIntervalDays>14</follicularIntervalDays>
<lutealIntervalDays>20</lutealIntervalDays>
<bleedingIntervalDays>0</bleedingIntervalDays>
<recoveryIntervalDays>30</recoveryIntervalDays>
<eggLifespanDays>8</eggLifespanDays>
<wombTex>Womb/Womb</wombTex>
<vagTex>Genitals/Vagina</vagTex>
</li>
</comps>
</value>
</Operation>
<Operation Class="PatchOperationAdd">
<xpath>/Defs/rjw.HediffDef_PartBase[defName="GhostVagina"]</xpath>
<value>
@ -134,29 +213,5 @@
</li>
</comps>
</value>
</Operation>
<Operation Class="PatchOperationAdd">
<xpath>/Defs/rjw.HediffDef_PartBase[defName="NecroVagina"]</xpath>
<value>
<comps>
<li Class="RJW_Menstruation.CompProperties_Menstruation">
<maxCumCapacity>10</maxCumCapacity>
<baseImplantationChanceFactor>0.1</baseImplantationChanceFactor>
<basefertilizationChanceFactor>0.1</basefertilizationChanceFactor>
<follicularIntervalDays>14</follicularIntervalDays>
<lutealIntervalDays>14</lutealIntervalDays>
<bleedingIntervalDays>0</bleedingIntervalDays>
<recoveryIntervalDays>0</recoveryIntervalDays>
<eggLifespanDays>1</eggLifespanDays>
<wombTex>Womb/Womb</wombTex>
<vagTex>Genitals/Vagina</vagTex>
<concealedEstrus>true</concealedEstrus>
</li>
</comps>
</value>
</Operation>
</Operation>
</Patch>

View File

@ -2,9 +2,21 @@
<Patch>
<Operation Class="PatchOperationAdd">
<xpath>/Defs/rjw.HediffDef_PartBase[defName="MammalBreasts"]</xpath>
<value>
<comps>
<li Class="RJW_Menstruation.CompProperties_Breast">
<BreastTex>Breasts/Breast</BreastTex>
<BlacknippleColor>(55,20,0)</BlacknippleColor>
</li>
</comps>
</value>
</Operation>
<Operation Class="PatchOperationAdd">
<xpath>/Defs/rjw.HediffDef_PartBase[defName="BigRaceBreats"]</xpath>
<xpath>/Defs/rjw.HediffDef_PartBase[defName="CatBreasts"]</xpath>
<value>
<comps>
<li Class="RJW_Menstruation.CompProperties_Breast">
@ -14,31 +26,6 @@
</comps>
</value>
</Operation>
<Operation Class="PatchOperationAdd">
<xpath>/Defs/rjw.HediffDef_PartBase[defName="OrcBreasts"]</xpath>
<value>
<comps>
<li Class="RJW_Menstruation.CompProperties_Breast">
<BreastTex>Breasts/Breast</BreastTex>
<BlacknippleColor>(55,20,0)</BlacknippleColor>
</li>
</comps>
</value>
</Operation>
<Operation Class="PatchOperationAdd">
<xpath>/Defs/rjw.HediffDef_PartBase[defName="GhoulBreasts"]</xpath>
<value>
<comps>
<li Class="RJW_Menstruation.CompProperties_Breast">
<BreastTex>Breasts/Breast</BreastTex>
<BlacknippleColor>(55,20,0)</BlacknippleColor>
</li>
</comps>
</value>
</Operation>
<Operation Class="PatchOperationAdd">
<xpath>/Defs/rjw.HediffDef_PartBase[defName="GhostBreasts"]</xpath>
<value>
@ -50,7 +37,28 @@
</comps>
</value>
</Operation>
<Operation Class="PatchOperationAdd">
<xpath>/Defs/rjw.HediffDef_PartBase[defName="CactoidBreasts"]</xpath>
<value>
<comps>
<li Class="RJW_Menstruation.CompProperties_Breast">
<BreastTex>Breasts/Breast</BreastTex>
<BlacknippleColor>(55,20,0)</BlacknippleColor>
</li>
</comps>
</value>
</Operation>
<Operation Class="PatchOperationAdd">
<xpath>/Defs/rjw.HediffDef_PartBase[defName="GhoulBreasts"]</xpath>
<value>
<comps>
<li Class="RJW_Menstruation.CompProperties_Breast">
<BreastTex>Breasts/Breast</BreastTex>
<BlacknippleColor>(55,20,0)</BlacknippleColor>
</li>
</comps>
</value>
</Operation>
<Operation Class="PatchOperationAdd">
<xpath>/Defs/rjw.HediffDef_PartBase[defName="NecroBreasts"]</xpath>
<value>
@ -62,9 +70,8 @@
</comps>
</value>
</Operation>
<Operation Class="PatchOperationAdd">
<xpath>/Defs/rjw.HediffDef_PartBase[defName="NephilaBreasts"]</xpath>
<xpath>/Defs/rjw.HediffDef_PartBase[defName="OrcBreasts"]</xpath>
<value>
<comps>
<li Class="RJW_Menstruation.CompProperties_Breast">
@ -74,9 +81,8 @@
</comps>
</value>
</Operation>
<Operation Class="PatchOperationAdd">
<xpath>/Defs/rjw.HediffDef_PartBase[defName="NephilaSlimeBreasts"]</xpath>
<xpath>/Defs/rjw.HediffDef_PartBase[defName="ScaleBreasts"]</xpath>
<value>
<comps>
<li Class="RJW_Menstruation.CompProperties_Breast">
@ -86,18 +92,16 @@
</comps>
</value>
</Operation>
<Operation Class="PatchOperationAdd">
<xpath>/Defs/rjw.HediffDef_PartBase[defName="UdderBreasts"]</xpath>
<xpath>/Defs/rjw.HediffDef_PartBase[defName="TreeBreasts"]</xpath>
<value>
<comps>
<li Class="RJW_Menstruation.CompProperties_Breast">
<BreastTex>Breasts_Udder/Breast</BreastTex>
<BreastTex>Breasts/Breast</BreastTex>
<BlacknippleColor>(55,20,0)</BlacknippleColor>
</li>
</comps>
</value>
</Operation>
</Patch>

View File

@ -105,7 +105,46 @@
</comps>
</value>
</Operation>
<Operation Class="PatchOperationAdd">
<xpath>/Defs/rjw.HediffDef_PartBase[defName="NecroVagina"]</xpath>
<value>
<comps>
<li Class="RJW_Menstruation.CompProperties_Menstruation">
<maxCumCapacity>10</maxCumCapacity>
<baseImplantationChanceFactor>0.1</baseImplantationChanceFactor>
<basefertilizationChanceFactor>0.1</basefertilizationChanceFactor>
<follicularIntervalDays>14</follicularIntervalDays>
<lutealIntervalDays>14</lutealIntervalDays>
<bleedingIntervalDays>0</bleedingIntervalDays>
<recoveryIntervalDays>0</recoveryIntervalDays>
<eggLifespanDays>1</eggLifespanDays>
<wombTex>Womb/Womb</wombTex>
<vagTex>Genitals/Vagina</vagTex>
<concealedEstrus>true</concealedEstrus>
</li>
</comps>
</value>
</Operation>
<Operation Class="PatchOperationAdd">
<xpath>/Defs/rjw.HediffDef_PartBase[defName="TreeVagina"]</xpath>
<value>
<comps>
<li Class="RJW_Menstruation.CompProperties_Menstruation">
<maxCumCapacity>15</maxCumCapacity>
<baseImplantationChanceFactor>1.0</baseImplantationChanceFactor>
<basefertilizationChanceFactor>1.0</basefertilizationChanceFactor>
<follicularIntervalDays>10</follicularIntervalDays>
<lutealIntervalDays>12</lutealIntervalDays>
<bleedingIntervalDays>0</bleedingIntervalDays>
<recoveryIntervalDays>30</recoveryIntervalDays>
<eggLifespanDays>2</eggLifespanDays>
<wombTex>Womb/Womb</wombTex>
<vagTex>Genitals/Vagina</vagTex>
<breedingSeason>Fall</breedingSeason>
</li>
</comps>
</value>
</Operation>
</Patch>

View File

@ -1030,7 +1030,7 @@ namespace RJW_Menstruation
if (cycleVariability < 0f) cycleVariability = MenstruationUtility.RandomVariabilityPercent();
if (currentIntervalHours < 0)
{
if (Pawn.health.capacities.GetLevel(xxx.reproduction) <= 0) curStage = Stage.Infertile;
if (Pawn.health.capacities.GetLevel(xxx.reproduction) <= 0 || Pawn.SterileGenes()) curStage = Stage.Infertile;
else if (!IsBreedingSeason()) curStage = Stage.Anestrus;
else curStage = RandomStage();
if (curStage == Stage.Follicular)
@ -1260,7 +1260,7 @@ namespace RJW_Menstruation
case Configurations.PregnancyType.BaseRJW:
if (Configurations.Debug) Log.Message($"Creating new base RJW pregnancy");
PregnancyHelper.PregnancyDecider(Pawn, egg.fertilizer);
PregnancyHelper.AddPregnancyHediff(Pawn, egg.fertilizer);
// I hate having to do this, but it gets the newest pregnancy
List<Hediff_BasePregnancy> pregnancies = new List<Hediff_BasePregnancy>();
Pawn.health.hediffSet.GetHediffs(ref pregnancies);

View File

@ -2,6 +2,7 @@
using System.Linq;
using RimWorld;
using Verse;
using System.Collections.Generic;
namespace RJW_Menstruation
{
@ -61,4 +62,50 @@ namespace RJW_Menstruation
__result = 0.999f;
}
}
[HarmonyPatch(typeof(Recipe_ExtractOvum), nameof(Recipe_ExtractOvum.AvailableReport))]
public class ExtractOvum_AvailableReport_Patch
{
public static void PostFix(Thing thing, ref AcceptanceReport __result)
{
if (!__result.Accepted) return;
Pawn pawn = (Pawn)thing;
if (pawn.IsRJWPregnant())
{
__result = "CannotPregnant".Translate();
return;
}
List<HediffComp_Menstruation> comps = pawn.GetMenstruationComps().ToList();
if (!comps.Any()) return;
if (comps.All(comp => comp.ovarypower <= 0))
{
__result = Translations.CannotNoEggs;
return;
}
return;
}
}
[HarmonyPatch(typeof(Recipe_ExtractOvum), "OnSurgerySuccess")]
public class ExtractOvum_OnSurgerySuccess_Patch
{
public static void PostFix(Pawn pawn)
{
List<HediffComp_Menstruation> comps = pawn.GetMenstruationComps().ToList();
if (!comps.Any()) return;
HediffComp_Menstruation mostEggs = comps.MaxBy(comp => comp.ovarypower);
if (mostEggs.ovarypower <= 0) return; // Shouldn't happen
mostEggs.ovarypower--;
}
}
[HarmonyPatch(typeof(Recipe_ImplantEmbryo), nameof(Recipe_ImplantEmbryo.ApplyOnPawn))]
public class ImplantEmbryo_ApplyOnPawn_Patch
{
public static void PostFix(Pawn pawn)
{
foreach (HediffComp_Menstruation comp in pawn.GetMenstruationComps())
comp.TakeLoosePregnancy();
}
}
}

View File

@ -38,7 +38,7 @@ namespace RJW_Menstruation
if (Genital_Helper.has_penis_fertile(pawn, pawnparts) && PregnancyHelper.CanImpregnate(pawn, partner, sextype))
{
PregnancyHelper.Doimpregnate(pawn, partner);
PregnancyHelper.DoImpregnate(pawn, partner);
return false;
}
else if (Genital_Helper.has_ovipositorM(pawn, pawnparts))
@ -95,7 +95,7 @@ namespace RJW_Menstruation
}
}
[HarmonyPatch(typeof(PregnancyHelper), nameof(PregnancyHelper.Doimpregnate))]
[HarmonyPatch(typeof(PregnancyHelper), nameof(PregnancyHelper.DoImpregnate))]
public static class Doimpregnate_Patch
{
public static bool Prefix(Pawn pawn, Pawn partner) // partner has vagina

View File

@ -135,6 +135,8 @@ namespace RJW_Menstruation
public static readonly string Gizmo_GatherCum = "Gizmo_GatherCum".Translate();
public static readonly string FloatMenu_CleanSelf = "FloatMenu_CleanSelf".Translate();
public static readonly string CannotNoEggs = "CannotNoEggs".Translate();
public static readonly string CustomHybrid_List_Title = "CustomHybrid_List_Title".Translate();
static public string CustomHybrid_Title(string label) { return TranslatorFormattedStringExtensions.Translate("CustomHybrid_Title", label); }
static public string CustomHybrid_Tooltip(string label, string breedee, string baby, string chance) { return TranslatorFormattedStringExtensions.Translate("CustomHybrid_Tooltip", label, breedee, baby, chance); }

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Manifest>
<identifier>RJW Menstruation</identifier>
<version>1.0.8.1</version>
<version>1.0.8.2</version>
<dependencies>
</dependencies>
<incompatibleWith />

View File

@ -1,3 +1,10 @@
Version 1.0.8.2
- Compatibility update for RJW 5.3.0.7
- Requires RJW 5.3.0.7
- Updated race support patches for new and removed vaginas.
- The Biotech extract ovum operation will now remove an egg from a pawn's ovaries.
- A pawn's womb should now recognize an implanted embryo.
Version 1.0.8.1
- Added the option for humans to start Biotech pregnancies if the DLC is enabled. If set, non-humans will use the old multiple pregnancy instead.
- Babies conceived through the multiple pregnancy option will now properly inherit xenotypes.