diff --git a/1.4/Assemblies/RJW_Menstruation.dll b/1.4/Assemblies/RJW_Menstruation.dll index 631f7ee..510a8ed 100644 Binary files a/1.4/Assemblies/RJW_Menstruation.dll and b/1.4/Assemblies/RJW_Menstruation.dll differ diff --git a/1.4/source/RJW_Menstruation/RJW_Menstruation/Cum.cs b/1.4/source/RJW_Menstruation/RJW_Menstruation/Cum.cs index 3a2eb34..969dde3 100644 --- a/1.4/source/RJW_Menstruation/RJW_Menstruation/Cum.cs +++ b/1.4/source/RJW_Menstruation/RJW_Menstruation/Cum.cs @@ -171,7 +171,6 @@ namespace RJW_Menstruation Scribe_Values.Look(ref useCustomColor, "useCustomColor", false); Scribe_Values.Look(ref customColor, "customColor", default); Scribe_Defs.Look(ref filthDef, "filthDef"); - } public void MakeThinner(float speed) diff --git a/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs b/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs index 03c6ef7..130cf24 100644 --- a/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs +++ b/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs @@ -66,6 +66,7 @@ namespace RJW_Menstruation const float minmakefilthvalue = 1.0f; const int maxImplantDelayHours = 30 * GenDate.HoursPerDay; const int minImplantAgeHours = 3 * GenDate.HoursPerDay; + const float fluidLeakThreshold = 5.0f; const float pulloutSuccessRate = 0.8f; const float fetishPulloutSuccessModifier = 0.25f; @@ -116,6 +117,7 @@ namespace RJW_Menstruation protected float cycleVariability = -1; protected int currentIntervalTicks = -1; // Actual number of ticks equals this / cycleAcceleration protected float crampPain = -1; + protected float fluidToLeak = 0; protected Need sexNeed = null; protected string customwombtex = null; protected string customvagtex = null; @@ -641,6 +643,7 @@ namespace RJW_Menstruation Scribe_Values.Look(ref cycleVariability, "cycleVariability", cycleVariability, true); Scribe_Values.Look(ref currentIntervalTicks, "currentIntervalTicks", currentIntervalTicks, true); Scribe_Values.Look(ref crampPain, "crampPain", crampPain, true); + Scribe_Values.Look(ref fluidToLeak, "fluidToLeak", 0); Scribe_Values.Look(ref ovarypower, "ovarypower", ovarypower, true); Scribe_Values.Look(ref eggstack, "eggstack", 0); Scribe_Values.Look(ref estrusflag, "estrusflag", false); @@ -991,9 +994,15 @@ namespace RJW_Menstruation /// /// For natural leaking /// - protected virtual void AfterCumOut() + protected virtual void AfterCumOut(float amount, List filthlabels) { - Pawn.needs?.mood?.thoughts?.memories?.TryGainMemory(VariousDefOf.LeakingFluids); + fluidToLeak += amount; + if (fluidToLeak > fluidLeakThreshold) Pawn.needs?.mood?.thoughts?.memories?.TryGainMemory(VariousDefOf.LeakingFluids); + for (; fluidToLeak > fluidLeakThreshold; fluidToLeak -= fluidLeakThreshold) + { + if (cums.Count > 1) MakeCumFilthMixture(fluidLeakThreshold, filthlabels); + else if (cums.Count == 1) MakeCumFilth(cums.First(), fluidLeakThreshold); + } } /// @@ -1013,11 +1022,9 @@ namespace RJW_Menstruation /// public void CumOut() { - const float mlPerFilth = 5.0f; float leakfactor = 1.0f; float totalleak = 0f; float cumd = TotalCumPercent; - int preCumAmount = Mathf.CeilToInt(TotalCum / mlPerFilth); List filthlabels = new List(); BeforeCumOut(out Absorber absorber); if (cums.NullOrEmpty()) return; @@ -1033,17 +1040,11 @@ namespace RJW_Menstruation string tmp = "FilthLabelWithSource".Translate(cum.FilthDef.label, cum.pawn?.LabelShort ?? "Unknown", 1.ToString()); filthlabels.Add(tmp.Replace(" x1", "")); } - int postCumAmount = Mathf.CeilToInt(TotalCum / mlPerFilth); - for (int i = 0; i < preCumAmount - postCumAmount; i++) // Emit a filth every time the integer cum amount drops - { - if (cums.Count > 1) MakeCumFilthMixture(totalleak, filthlabels); - else if (cums.Count == 1) MakeCumFilth(cums.First(), totalleak); - } + AfterCumOut(totalleak, filthlabels); cums.RemoveAll(cum => cum.ShouldRemove()); + if (cums.NullOrEmpty()) fluidToLeak = 0; cumd = TotalCumPercent - cumd; - if (totalleak >= 1.0f) AfterCumOut(); AfterFluidOut(cumd); - } /// @@ -1073,6 +1074,7 @@ namespace RJW_Menstruation if (cums.Count > 1) MakeCumFilthMixture(totalleak, filthlabels); else if (cums.Count == 1) MakeCumFilth(cums.First(), totalleak); cums.RemoveAll(cum => removecums.Contains(cum)); + if (cums.NullOrEmpty()) fluidToLeak = 0; cumd = TotalCumPercent - cumd; AfterFluidOut(cumd); return outcum; @@ -1102,6 +1104,7 @@ namespace RJW_Menstruation if (cum.notcum) pure = false; } cums.RemoveAll(cum => removecums.Contains(cum)); + if (cums.NullOrEmpty()) fluidToLeak = 0; return new CumMixture(Pawn, totalleak, cumlabels, color, mixtureDef, pure); }