diff --git a/1.5/Assemblies/RJW_Menstruation.dll b/1.5/Assemblies/RJW_Menstruation.dll
index 2efb79c..a62164e 100644
Binary files a/1.5/Assemblies/RJW_Menstruation.dll and b/1.5/Assemblies/RJW_Menstruation.dll differ
diff --git a/1.5/Defs/Drugs/Pills_Menstruation.xml b/1.5/Defs/Drugs/Pills_Menstruation.xml
index 9f65c17..e8077c0 100644
--- a/1.5/Defs/Drugs/Pills_Menstruation.xml
+++ b/1.5/Defs/Drugs/Pills_Menstruation.xml
@@ -91,6 +91,48 @@
+
+ Doublex
+
+ Glittertech drug that causes fertilized eggs to produce enzygotic twins.
+
+ Things/Item/SIA
+ Graphic_StackCount
+
+ false
+
+ 800
+ 250
+ 0.01
+
+ Ultra
+
+ Medical
+
+
+ Hediff_Doublex
+ 1.0
+
+
+
+
+ DrugProduction
+
+ DrugLab
+
+
+
+ 3
+ 2
+
+
+
+ 0
+ 1000
+
+
+
+
PainReliever
diff --git a/1.5/Defs/HediffDef/Hediffs_Menstruation.xml b/1.5/Defs/HediffDef/Hediffs_Menstruation.xml
index 7fe11f7..7da31c8 100644
--- a/1.5/Defs/HediffDef/Hediffs_Menstruation.xml
+++ b/1.5/Defs/HediffDef/Hediffs_Menstruation.xml
@@ -164,6 +164,32 @@
+
+
+ HediffWithComps
+ Hediff_Doublex
+
+ doublex
+ Ultratech drug that causes fertilized eggs to split resulting in identical twins.
+ (0.75,0.75,1.0)
+ false
+ false
+ false
+ false
+ 5
+ 1.0
+
+
+ true
+
+
+
+
+ -0.5
+
+
+
+
HediffWithComps
diff --git a/1.5/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs b/1.5/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs
index b9fba68..57b31d3 100644
--- a/1.5/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs
+++ b/1.5/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs
@@ -1429,7 +1429,9 @@ namespace RJW_Menstruation
pregnancy = HediffMaker.MakeHediff(HediffDefOf.PregnantHuman, Pawn);
if (Configurations.EnableBiotechTwins)
pregnancy.TryGetComp().AddNewBaby(Pawn, egg.fertilizer);
- ((Hediff_Pregnant)pregnancy).SetParents(Pawn, egg.fertilizer, PregnancyUtility.GetInheritedGeneSet(egg.fertilizer, Pawn));
+ Pawn father = egg.fertilizer;
+ if (Pawn == father) father = null;
+ ((Hediff_Pregnant)pregnancy).SetParents(Pawn, father, PregnancyUtility.GetInheritedGeneSet(father, Pawn));
Pawn.health.AddHediff(pregnancy);
pregnant = true;
deadeggs.Add(egg);
diff --git a/1.5/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_PregeneratedBabies.cs b/1.5/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_PregeneratedBabies.cs
index e687cb7..5d5afe4 100644
--- a/1.5/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_PregeneratedBabies.cs
+++ b/1.5/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_PregeneratedBabies.cs
@@ -234,6 +234,7 @@ namespace RJW_Menstruation
{
Pawn baby = comp.PeekBaby();
Pawn thisFather = baby.GetFather() ?? father;
+ if (thisFather == geneticMother || thisFather == mother) thisFather = null;
baby.relations.ClearAllRelations(); // To keep ApplyBirthOutcome from erroring when it tries to set up relations
PregnancyUtility.ApplyBirthOutcome_NewTemp(thisOutcome, quality, ritual, genes, geneticMother, birtherThing, thisFather, doctor, lordJobRitual, assignments, preventLetter);
@@ -293,6 +294,7 @@ namespace RJW_Menstruation
{
Pawn baby = comp.PeekBaby();
Pawn thisFather = baby.GetFather() ?? father;
+ if (thisFather == geneticMother || thisFather == mother) thisFather = null;
baby.relations.ClearAllRelations();
PregnancyUtility.ApplyBirthOutcome(outcome, quality, ritual, genes, geneticMother, birtherThing, thisFather, doctor, lordJobRitual, assignments);
diff --git a/1.5/source/RJW_Menstruation/RJW_Menstruation/Hediff_MultiplePregnancy.cs b/1.5/source/RJW_Menstruation/RJW_Menstruation/Hediff_MultiplePregnancy.cs
index e8d6939..a65f73a 100644
--- a/1.5/source/RJW_Menstruation/RJW_Menstruation/Hediff_MultiplePregnancy.cs
+++ b/1.5/source/RJW_Menstruation/RJW_Menstruation/Hediff_MultiplePregnancy.cs
@@ -320,7 +320,20 @@ namespace RJW_Menstruation
Pawn firstbaby = null;
int traitSeed = Rand.Int;
List parentTraits = GetInheritableTraits(mother, father);
- while (Rand.Chance(Configurations.EnzygoticTwinsChance) && division < Configurations.MaxEnzygoticTwins) division++;
+
+ //TODO: turn this into a proper function that can handle genes, fertility boosts, genital type effects etc.
+ float eTwinChance = Configurations.EnzygoticTwinsChance;
+ //Log.Message($"RJW_Menstration :: Configurations.EnzygoticTwinsChance = {Configurations.EnzygoticTwinsChance}");
+ if (mother.health.hediffSet.HasHediff(VariousDefOf.Hediff_Doublex))
+ {
+ division++;
+ eTwinChance = eTwinChance + (1 - eTwinChance) / 4;
+ }
+
+ //Log.Message($"RJW_Menstration :: TwinChance = {eTwinChance}");
+ while (Rand.Chance(eTwinChance) && division < Configurations.MaxEnzygoticTwins) division++;
+ //Log.Message($"RJW_Menstration :: division = {division}");
+
for (int i = 0; i < division; i++)
{
Pawn baby = GenerateBaby(request, mother, father, parentTraits, traitSeed);
diff --git a/1.5/source/RJW_Menstruation/RJW_Menstruation/VariousDefOf.cs b/1.5/source/RJW_Menstruation/RJW_Menstruation/VariousDefOf.cs
index 997db3c..7884cde 100644
--- a/1.5/source/RJW_Menstruation/RJW_Menstruation/VariousDefOf.cs
+++ b/1.5/source/RJW_Menstruation/RJW_Menstruation/VariousDefOf.cs
@@ -22,6 +22,7 @@ namespace RJW_Menstruation
public static readonly HediffDef Hediff_Estrus_Concealed = DefDatabase.GetNamed("Hediff_Estrus_Concealed");
public static readonly HediffDef Hediff_AffectedByPheromones = DefDatabase.GetNamed("Hediff_AffectedByPheromones");
public static readonly HediffDef Hediff_ASA = DefDatabase.GetNamed("Hediff_ASA");
+ public static readonly HediffDef Hediff_Doublex = DefDatabase.GetNamed("Hediff_Doublex");
public static readonly StatDef MaxAbsorbable = DefDatabase.GetNamed("MaxAbsorbable");
public static readonly NeedDef SexNeed = DefDatabase.GetNamed("Sex");
public static readonly JobDef VaginaWashing = DefDatabase.GetNamed("VaginaWashing");
diff --git a/About/Manifest.xml b/About/Manifest.xml
index 9d624d9..990d2b7 100644
--- a/About/Manifest.xml
+++ b/About/Manifest.xml
@@ -1,7 +1,7 @@
RJW Menstruation
- 1.5.0.1
+ 1.5.0.2