diff --git a/About/Manifest.xml b/About/Manifest.xml index ced33c3..b6ce083 100644 --- a/About/Manifest.xml +++ b/About/Manifest.xml @@ -1,7 +1,7 @@ RJW Menstruation - 1.0.1.13 + 1.0.1.14 diff --git a/Assemblies/RJW_Menstruation.dll b/Assemblies/RJW_Menstruation.dll index 977494d..24913f1 100644 Binary files a/Assemblies/RJW_Menstruation.dll and b/Assemblies/RJW_Menstruation.dll differ diff --git a/changelogs.txt b/changelogs.txt index 0574f05..d0137d1 100644 --- a/changelogs.txt +++ b/changelogs.txt @@ -1,3 +1,7 @@ +Version 1.0.1.14 + - requires RJW 4.6.1 or later + - fixed interspecies factor applied to normal pregnancy + Version 1.0.1.13 - requires RJW 4.6.1 or later - added induced ovulator diff --git a/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs b/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs index b3df198..a7c2ef2 100644 --- a/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs +++ b/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs @@ -1020,7 +1020,7 @@ namespace RJW_Menstruation return false; } - private Pawn Fertilize() + protected Pawn Fertilize() { if (cums.NullOrEmpty()) return null; foreach (Cum cum in cums) @@ -1036,7 +1036,7 @@ namespace RJW_Menstruation } //for now, only one egg can be implanted - private bool Implant() + protected bool Implant() { if (!eggs.NullOrEmpty()) { @@ -1107,7 +1107,7 @@ namespace RJW_Menstruation return false; } - private void BleedOut() + protected void BleedOut() { //FilthMaker.TryMakeFilth(parent.pawn.Position, parent.pawn.Map, ThingDefOf.Filth_Blood,parent.pawn.Label); CumIn(parent.pawn, Rand.Range(0.02f * Configurations.BleedingAmount, 0.04f * Configurations.BleedingAmount), Translations.Menstrual_Blood, -5.0f, ThingDefOf.Filth_Blood); @@ -1119,7 +1119,7 @@ namespace RJW_Menstruation /// /// /// - private void MakeCumFilth(Cum cum, float amount) + protected void MakeCumFilth(Cum cum, float amount) { if (amount >= minmakefilthvalue) FilthMaker.TryMakeFilth(parent.pawn.Position, parent.pawn.Map, cum.FilthDef, cum.pawn?.LabelShort ?? "Unknown"); } @@ -1131,7 +1131,7 @@ namespace RJW_Menstruation /// /// /// - private float AbsorbCum(Cum cum, float amount, Absorber absorber) + protected float AbsorbCum(Cum cum, float amount, Absorber absorber) { if (absorber != null) @@ -1163,7 +1163,7 @@ namespace RJW_Menstruation return 0; } - private float MakeCumFilthMixture(float amount, List cumlabels) + protected float MakeCumFilthMixture(float amount, List cumlabels) { if (amount >= minmakefilthvalue) @@ -1176,7 +1176,7 @@ namespace RJW_Menstruation - private void EggDecay() + protected void EggDecay() { List deadeggs = new List(); foreach (Egg egg in eggs) @@ -1196,7 +1196,7 @@ namespace RJW_Menstruation } } - private void AddCrampPain() + protected void AddCrampPain() { Hediff hediff = HediffMaker.MakeHediff(VariousDefOf.Hediff_MenstrualCramp, parent.pawn); hediff.Severity = crampPain * Rand.Range(0.9f, 1.1f); @@ -1578,18 +1578,22 @@ namespace RJW_Menstruation } - private int PeriodRandomizer(int intervalhours, float deviation) + protected int PeriodRandomizer(int intervalhours, float deviation) { return intervalhours + (int)(intervalhours * Rand.Range(-deviation, deviation)); } - private float InterspeciesImplantFactor(Pawn fertilizer) + protected float InterspeciesImplantFactor(Pawn fertilizer) { - if (RJWPregnancySettings.complex_interspecies) return SexUtility.BodySimilarity(parent.pawn, fertilizer); - else return RJWPregnancySettings.interspecies_impregnation_modifier; + if (fertilizer.def.defName == parent.pawn.def.defName) return 1.0f; + else + { + if (RJWPregnancySettings.complex_interspecies) return SexUtility.BodySimilarity(parent.pawn, fertilizer); + else return RJWPregnancySettings.interspecies_impregnation_modifier; + } } - private float PainRandomizer() + protected float PainRandomizer() { float rand = Rand.Range(0.0f, 1.0f); if (rand < 0.01f) return Rand.Range(0.0f, 0.2f); @@ -1599,7 +1603,7 @@ namespace RJW_Menstruation else return Rand.Range(0.6f, 1.0f); } - private Stage RandomStage() + protected Stage RandomStage() { int rand = Rand.Range(0, 2); diff --git a/source/RJW_Menstruation/RJW_Menstruation/Utility.cs b/source/RJW_Menstruation/RJW_Menstruation/Utility.cs index 61324fe..e47f545 100644 --- a/source/RJW_Menstruation/RJW_Menstruation/Utility.cs +++ b/source/RJW_Menstruation/RJW_Menstruation/Utility.cs @@ -139,22 +139,12 @@ namespace RJW_Menstruation if (hediff is Hediff_BasePregnancy) { Hediff_BasePregnancy h = (Hediff_BasePregnancy)hediff; - return h?.babies?.First() ?? null; - } - //else if (hediff is Hediff_HumanlikePregnancy) - //{ - // Hediff_HumanlikePregnancy h = (Hediff_HumanlikePregnancy)hediff; - // return h?.babies?.First() ?? null; - //} - //else if (hediff is Hediff_BestialPregnancy) - //{ - // Hediff_BestialPregnancy h = (Hediff_BestialPregnancy)hediff; - // return h?.babies?.First() ?? null; - //} - else if (hediff is Hediff_MechanoidPregnancy) - { - Hediff_MechanoidPregnancy h = (Hediff_MechanoidPregnancy)hediff; - return h?.babies?.First() ?? null; + if (!h.babies.NullOrEmpty()) return h.babies.First(); + else + { + Log.Error("Baby not exist: baby was not created or removed"); + return null; + } } @@ -368,7 +358,7 @@ namespace RJW_Menstruation } } - + } }