Compare commits

..

4 commits

5 changed files with 71 additions and 69 deletions

Binary file not shown.

View file

@ -189,51 +189,51 @@ namespace RJW_Menstruation
public override void ExposeData() public override void ExposeData()
{ {
Scribe_Values.Look(ref ImplantationChanceAdjust, "ImplantationChanceAdjust", ImplantationChanceAdjust, true); Scribe_Values.Look(ref ImplantationChanceAdjust, "ImplantationChanceAdjust", ImplantationChanceAdjustDefault);
Scribe_Values.Look(ref ImplantationChance, "ImplantationChance", ImplantationChance, true); Scribe_Values.Look(ref ImplantationChance, "ImplantationChance", ImplantationChanceDefault);
Scribe_Values.Look(ref FertilizeChanceAdjust, "FertilizeChanceAdjust", FertilizeChanceAdjust, true); Scribe_Values.Look(ref FertilizeChanceAdjust, "FertilizeChanceAdjust", FertilizeChanceAdjustDefault);
Scribe_Values.Look(ref FertilizeChance, "FertilizeChance", FertilizeChance, true); Scribe_Values.Look(ref FertilizeChance, "FertilizeChance", FertilizeChanceDefault);
Scribe_Values.Look(ref CumDecayRatioAdjust, "CumDecayRatioAdjust", CumDecayRatioAdjust, true); Scribe_Values.Look(ref CumDecayRatioAdjust, "CumDecayRatioAdjust", CumDecayRatioAdjustDefault);
Scribe_Values.Look(ref CumDecayRatio, "CumDecayRatio", CumDecayRatio, true); Scribe_Values.Look(ref CumDecayRatio, "CumDecayRatio", CumDecayRatioDefault);
Scribe_Values.Look(ref CumFertilityDecayRatioAdjust, "CumFertilityDecayRatioAdjust", CumFertilityDecayRatioAdjust, true); Scribe_Values.Look(ref CumFertilityDecayRatioAdjust, "CumFertilityDecayRatioAdjust", CumFertilityDecayRatioAdjustDefault);
Scribe_Values.Look(ref CumFertilityDecayRatio, "CumFertilityDecayRatio", CumFertilityDecayRatio, true); Scribe_Values.Look(ref CumFertilityDecayRatio, "CumFertilityDecayRatio", CumFertilityDecayRatioDefault);
Scribe_Values.Look(ref CycleAcceleration, "CycleAcceleration", CycleAcceleration, true); Scribe_Values.Look(ref CycleAcceleration, "CycleAcceleration", CycleAccelerationDefault);
Scribe_Values.Look(ref ColonistTickInterval, "ColonistTickInterval", ColonistTickInterval, true); Scribe_Values.Look(ref ColonistTickInterval, "ColonistTickInterval", ColonistTickIntervalDefault);
Scribe_Values.Look(ref NonColonistTickInterval, "NonColonistTickInterval", NonColonistTickInterval, true); Scribe_Values.Look(ref NonColonistTickInterval, "NonColonistTickInterval", NonColonistTickIntervalDefault);
Scribe_Values.Look(ref AnimalTickInterval, "AnimalTickInterval", AnimalTickInterval, true); Scribe_Values.Look(ref AnimalTickInterval, "AnimalTickInterval", AnimalTickIntervalDefault);
Scribe_Values.Look(ref EnableWombIcon, "EnableWombIcon", EnableWombIcon, true); Scribe_Values.Look(ref EnableWombIcon, "EnableWombIcon", true);
Scribe_Values.Look(ref EnableDraftedIcon, "EnableDraftedIcon", EnableDraftedIcon, true); Scribe_Values.Look(ref EnableDraftedIcon, "EnableDraftedIcon", true);
Scribe_Values.Look(ref EnableAnimalCycle, "EnableAnimalCycle", EnableAnimalCycle, true); Scribe_Values.Look(ref EnableAnimalCycle, "EnableAnimalCycle", false);
Scribe_Values.Look(ref DrawWombStatus, "DrawWombStatus", DrawWombStatus, true); Scribe_Values.Look(ref DrawWombStatus, "DrawWombStatus", true);
Scribe_Values.Look(ref DrawVaginaStatus, "DrawVaginaStatus", DrawVaginaStatus, true); Scribe_Values.Look(ref DrawVaginaStatus, "DrawVaginaStatus", true);
Scribe_Values.Look(ref DrawEggOverlay, "DrawEggOvray", DrawEggOverlay, true); Scribe_Values.Look(ref DrawEggOverlay, "DrawEggOvray", true);
Scribe_Values.Look(ref Debug, "Debug", Debug, true); Scribe_Values.Look(ref Debug, "Debug", false);
Scribe_Values.Look(ref infoDetail, "InfoDetail", infoDetail, true); Scribe_Values.Look(ref infoDetail, "InfoDetail", DetailLevel.All);
Scribe_Values.Look(ref EnableMenopause, "EnableMenopause", EnableMenopause, true); Scribe_Values.Look(ref EnableMenopause, "EnableMenopause", true);
Scribe_Values.Look(ref EstrusOverridesHookupSettings, "EstrusOverridesHookupSettings", EstrusOverridesHookupSettings, true); Scribe_Values.Look(ref EstrusOverridesHookupSettings, "EstrusOverridesHookupSettings", false);
Scribe_Values.Look(ref EstrusFuckabilityToHookup, "EstrusFuckabilityToHookup", EstrusFuckabilityToHookup, true); Scribe_Values.Look(ref EstrusFuckabilityToHookup, "EstrusFuckabilityToHookup", EstrusFuckabilityToHookup, true);
Scribe_Values.Look(ref EstrusAttractivenessToHookup, "EstrusAttractivenessToHookup", EstrusAttractivenessToHookup, true); Scribe_Values.Look(ref EstrusAttractivenessToHookup, "EstrusAttractivenessToHookup", EstrusAttractivenessToHookup, true);
Scribe_Values.Look(ref EstrusRelationshipToHookup, "EstrusRelationshipToHookup", EstrusRelationshipToHookup, true); Scribe_Values.Look(ref EstrusRelationshipToHookup, "EstrusRelationshipToHookup", EstrusRelationshipToHookup, true);
Scribe_Values.Look(ref PregnancySource, "PregnancySource", PregnancySource, true); Scribe_Values.Look(ref PregnancySource, "PregnancySource", PregnancyType.MultiplePregnancy);
Scribe_Values.Look(ref EnableBiotechTwins, "EnableBiotechTwins", EnableBiotechTwins, true); Scribe_Values.Look(ref EnableBiotechTwins, "EnableBiotechTwins", false);
Scribe_Values.Look(ref EnableHeteroOvularTwins, "EnableHeteroOvularTwins", EnableHeteroOvularTwins, true); Scribe_Values.Look(ref EnableHeteroOvularTwins, "EnableHeteroOvularTwins", true);
Scribe_Values.Look(ref EnableEnzygoticTwins, "EnableEnzygoticTwins", EnableEnzygoticTwins, true); Scribe_Values.Look(ref EnableEnzygoticTwins, "EnableEnzygoticTwins", true);
Scribe_Values.Look(ref EnzygoticTwinsChance, "EnzygoticTwinsChance", EnzygoticTwinsChance, true); Scribe_Values.Look(ref EnzygoticTwinsChance, "EnzygoticTwinsChance", EnzygoticTwinsChanceDefault);
Scribe_Values.Look(ref EnzygoticTwinsChanceAdjust, "EnzygoticTwinsChanceAdjust", EnzygoticTwinsChanceAdjust, true); Scribe_Values.Look(ref EnzygoticTwinsChanceAdjust, "EnzygoticTwinsChanceAdjust", EnzygoticTwinsChanceAdjustDefault);
Scribe_Values.Look(ref MaxEnzygoticTwins, "MaxEnzygoticTwins", MaxEnzygoticTwins, true); Scribe_Values.Look(ref MaxEnzygoticTwins, "MaxEnzygoticTwins", MaxEnzygoticTwinsDefault);
Scribe_Values.Look(ref BleedingAmount, "BleedingAmount", BleedingAmount, true); Scribe_Values.Look(ref BleedingAmount, "BleedingAmount", BleedingAmountDefault);
Scribe_Values.Look(ref EnableButtonInHT, "EnableButtonInHT", EnableButtonInHT, true); Scribe_Values.Look(ref EnableButtonInHT, "EnableButtonInHT", false);
Scribe_Values.Look(ref EnableGatherCumGizmo, "EnableGatherCumGizmo", true, true); Scribe_Values.Look(ref EnableGatherCumGizmo, "EnableGatherCumGizmo", true);
Scribe_Values.Look(ref ShowFlag, "ShowFlag", ShowFlag, true); Scribe_Values.Look(ref ShowFlag, "ShowFlag", PawnFlags.Colonist | PawnFlags.Prisoner);
Scribe_Values.Look(ref UseHybridExtention, "UseHybridExtention", UseHybridExtention, true); Scribe_Values.Look(ref UseHybridExtention, "UseHybridExtention", true);
Scribe_Values.Look(ref MotherFirst, "MotherFirst", MotherFirst, true); Scribe_Values.Look(ref MotherFirst, "MotherFirst", false);
Scribe_Values.Look(ref MaxBreastIncrementFactor, "MaxBreastIncrementFactor", MaxBreastIncrementFactor, true); Scribe_Values.Look(ref MaxBreastIncrementFactor, "MaxBreastIncrementFactor", MaxBreastIncrementFactorDefault);
Scribe_Values.Look(ref MaxNippleIncrementFactor, "MaxNippleIncrementFactor", MaxNippleIncrementFactor, true); Scribe_Values.Look(ref MaxNippleIncrementFactor, "MaxNippleIncrementFactor", MaxNippleIncrementFactorDefault);
Scribe_Values.Look(ref PermanentNippleChange, "PermanentNippleChange", PermanentNippleChange, true); Scribe_Values.Look(ref PermanentNippleChange, "PermanentNippleChange", PermanentNippleChangeDefault);
Scribe_Values.Look(ref AllowShrinkIcon, "AllowShrinkIcon", AllowShrinkIcon, true); Scribe_Values.Look(ref AllowShrinkIcon, "AllowShrinkIcon", false);
Scribe_Values.Look(ref EggLifespanMultiplier, "EggLifespanMultiplier", EggLifespanMultiplier, true); Scribe_Values.Look(ref EggLifespanMultiplier, "EggLifespanMultiplier", EggLifespanMultiplierDefault);
Scribe_Values.Look(ref EnableBirthVaginaMorph, "EnableBirthVaginaMorph", EnableBirthVaginaMorph, true); Scribe_Values.Look(ref EnableBirthVaginaMorph, "EnableBirthVaginaMorph", false);
Scribe_Values.Look(ref VaginaMorphPower, "VaginaMorphPower", VaginaMorphPower, true); Scribe_Values.Look(ref VaginaMorphPower, "VaginaMorphPower", VaginaMorphPowerDefault);
Scribe_Collections.Look(ref HybridOverride, saveDestroyedThings: true, label: "HybridOverride", lookMode: LookMode.Deep, ctorArgs: new object[0]); Scribe_Collections.Look(ref HybridOverride, saveDestroyedThings: true, label: "HybridOverride", lookMode: LookMode.Deep, ctorArgs: new object[0]);
base.ExposeData(); base.ExposeData();
} }

View file

@ -165,13 +165,12 @@ namespace RJW_Menstruation
Scribe_References.Look(ref pawn, "pawn", true); Scribe_References.Look(ref pawn, "pawn", true);
Scribe_Values.Look(ref volume, "volume", volume, true); Scribe_Values.Look(ref volume, "volume", volume, true);
Scribe_Values.Look(ref fertility, "fertility", fertility, true); Scribe_Values.Look(ref fertility, "fertility", fertility, true);
Scribe_Values.Look(ref notcumthickness, "notcumthickness", notcumthickness, true); Scribe_Values.Look(ref notcumthickness, "notcumthickness", 0);
Scribe_Values.Look(ref notcum, "notcum", notcum, true); Scribe_Values.Look(ref notcum, "notcum", false);
Scribe_Values.Look(ref notcumLabel, "notcumLabel", notcumLabel, true); Scribe_Values.Look(ref notcumLabel, "notcumLabel", "");
Scribe_Values.Look(ref useCustomColor, "useCustomColor", useCustomColor, true); Scribe_Values.Look(ref useCustomColor, "useCustomColor", false);
Scribe_Values.Look(ref customColor, "customColor", customColor, true); Scribe_Values.Look(ref customColor, "customColor", default);
Scribe_Defs.Look(ref filthDef, "filthDef"); Scribe_Defs.Look(ref filthDef, "filthDef");
} }
public void MakeThinner(float speed) public void MakeThinner(float speed)

View file

@ -66,6 +66,7 @@ namespace RJW_Menstruation
const float minmakefilthvalue = 1.0f; const float minmakefilthvalue = 1.0f;
const int maxImplantDelayHours = 30 * GenDate.HoursPerDay; const int maxImplantDelayHours = 30 * GenDate.HoursPerDay;
const int minImplantAgeHours = 3 * GenDate.HoursPerDay; const int minImplantAgeHours = 3 * GenDate.HoursPerDay;
const float fluidLeakThreshold = 5.0f;
const float pulloutSuccessRate = 0.8f; const float pulloutSuccessRate = 0.8f;
const float fetishPulloutSuccessModifier = 0.25f; const float fetishPulloutSuccessModifier = 0.25f;
@ -73,7 +74,7 @@ namespace RJW_Menstruation
public Stage curStage = Stage.Follicular; public Stage curStage = Stage.Follicular;
public int curStageTicks = 0; // Actual number of ticks equals this / cycleAcceleration public int curStageTicks = 0; // Actual number of ticks equals this / cycleAcceleration
private int tickInterval = -1; private int tickInterval = -1;
const int recalculateTickInterval = GenDate.TicksPerDay; const int recalculateTickInterval = GenTicks.TickLongInterval;
public bool loaded = false; public bool loaded = false;
public bool initError = false; public bool initError = false;
public int ovarypower = -100000; public int ovarypower = -100000;
@ -116,6 +117,7 @@ namespace RJW_Menstruation
protected float cycleVariability = -1; protected float cycleVariability = -1;
protected int currentIntervalTicks = -1; // Actual number of ticks equals this / cycleAcceleration protected int currentIntervalTicks = -1; // Actual number of ticks equals this / cycleAcceleration
protected float crampPain = -1; protected float crampPain = -1;
protected float fluidToLeak = 0;
protected Need sexNeed = null; protected Need sexNeed = null;
protected string customwombtex = null; protected string customwombtex = null;
protected string customvagtex = null; protected string customvagtex = null;
@ -641,11 +643,12 @@ namespace RJW_Menstruation
Scribe_Values.Look(ref cycleVariability, "cycleVariability", cycleVariability, true); Scribe_Values.Look(ref cycleVariability, "cycleVariability", cycleVariability, true);
Scribe_Values.Look(ref currentIntervalTicks, "currentIntervalTicks", currentIntervalTicks, true); Scribe_Values.Look(ref currentIntervalTicks, "currentIntervalTicks", currentIntervalTicks, true);
Scribe_Values.Look(ref crampPain, "crampPain", crampPain, 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 ovarypower, "ovarypower", ovarypower, true);
Scribe_Values.Look(ref eggstack, "eggstack", eggstack, true); Scribe_Values.Look(ref eggstack, "eggstack", 0);
Scribe_Values.Look(ref estrusflag, "estrusflag", estrusflag, true); Scribe_Values.Look(ref estrusflag, "estrusflag", false);
Scribe_Values.Look(ref originvagsize, "originvagsize", originvagsize, true); Scribe_Values.Look(ref originvagsize, "originvagsize", originvagsize, true);
Scribe_Values.Look(ref DoCleanWomb, "DoCleanWomb", DoCleanWomb, true); Scribe_Values.Look(ref DoCleanWomb, "DoCleanWomb", false);
Scribe_References.Look(ref pregnancy, "pregnancy"); Scribe_References.Look(ref pregnancy, "pregnancy");
} }
@ -991,9 +994,15 @@ namespace RJW_Menstruation
/// <summary> /// <summary>
/// For natural leaking /// For natural leaking
/// </summary> /// </summary>
protected virtual void AfterCumOut() protected virtual void AfterCumOut(float amount, List<string> 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);
}
} }
/// <summary> /// <summary>
@ -1013,11 +1022,9 @@ namespace RJW_Menstruation
/// </summary> /// </summary>
public void CumOut() public void CumOut()
{ {
const float mlPerFilth = 5.0f;
float leakfactor = 1.0f; float leakfactor = 1.0f;
float totalleak = 0f; float totalleak = 0f;
float cumd = TotalCumPercent; float cumd = TotalCumPercent;
int preCumAmount = Mathf.CeilToInt(TotalCum / mlPerFilth);
List<string> filthlabels = new List<string>(); List<string> filthlabels = new List<string>();
BeforeCumOut(out Absorber absorber); BeforeCumOut(out Absorber absorber);
if (cums.NullOrEmpty()) return; if (cums.NullOrEmpty()) return;
@ -1033,17 +1040,11 @@ namespace RJW_Menstruation
string tmp = "FilthLabelWithSource".Translate(cum.FilthDef.label, cum.pawn?.LabelShort ?? "Unknown", 1.ToString()); string tmp = "FilthLabelWithSource".Translate(cum.FilthDef.label, cum.pawn?.LabelShort ?? "Unknown", 1.ToString());
filthlabels.Add(tmp.Replace(" x1", "")); filthlabels.Add(tmp.Replace(" x1", ""));
} }
int postCumAmount = Mathf.CeilToInt(TotalCum / mlPerFilth); AfterCumOut(totalleak, filthlabels);
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);
}
cums.RemoveAll(cum => cum.ShouldRemove()); cums.RemoveAll(cum => cum.ShouldRemove());
if (cums.NullOrEmpty()) fluidToLeak = 0;
cumd = TotalCumPercent - cumd; cumd = TotalCumPercent - cumd;
if (totalleak >= 1.0f) AfterCumOut();
AfterFluidOut(cumd); AfterFluidOut(cumd);
} }
/// <summary> /// <summary>
@ -1073,6 +1074,7 @@ namespace RJW_Menstruation
if (cums.Count > 1) MakeCumFilthMixture(totalleak, filthlabels); if (cums.Count > 1) MakeCumFilthMixture(totalleak, filthlabels);
else if (cums.Count == 1) MakeCumFilth(cums.First(), totalleak); else if (cums.Count == 1) MakeCumFilth(cums.First(), totalleak);
cums.RemoveAll(cum => removecums.Contains(cum)); cums.RemoveAll(cum => removecums.Contains(cum));
if (cums.NullOrEmpty()) fluidToLeak = 0;
cumd = TotalCumPercent - cumd; cumd = TotalCumPercent - cumd;
AfterFluidOut(cumd); AfterFluidOut(cumd);
return outcum; return outcum;
@ -1102,6 +1104,7 @@ namespace RJW_Menstruation
if (cum.notcum) pure = false; if (cum.notcum) pure = false;
} }
cums.RemoveAll(cum => removecums.Contains(cum)); cums.RemoveAll(cum => removecums.Contains(cum));
if (cums.NullOrEmpty()) fluidToLeak = 0;
return new CumMixture(Pawn, totalleak, cumlabels, color, mixtureDef, pure); return new CumMixture(Pawn, totalleak, cumlabels, color, mixtureDef, pure);
} }

View file

@ -225,10 +225,10 @@ namespace RJW_Menstruation
Scribe_Values.Look(ref wearhours, "wearhours", wearhours, true); Scribe_Values.Look(ref wearhours, "wearhours", wearhours, true);
if (wearhours >= 0) wearTicks = wearhours * GenDate.TicksPerHour; if (wearhours >= 0) wearTicks = wearhours * GenDate.TicksPerHour;
} }
Scribe_Values.Look(ref absorbedfluids, "absorbedfluids", absorbedfluids, true); Scribe_Values.Look(ref absorbedfluids, "absorbedfluids", 0);
Scribe_Values.Look(ref dirty, "dirty", dirty, true); Scribe_Values.Look(ref dirty, "dirty", false);
Scribe_Values.Look(ref wearTicks, "wearTicks", wearTicks, true); Scribe_Values.Look(ref wearTicks, "wearTicks", 0);
Scribe_Values.Look(ref fluidColor, "fluidColor", fluidColor, true); Scribe_Values.Look(ref fluidColor, "fluidColor", Color.white);
} }
} }
@ -256,7 +256,7 @@ namespace RJW_Menstruation
public override void ExposeData() public override void ExposeData()
{ {
base.ExposeData(); base.ExposeData();
Scribe_Values.Look(ref color, "color", color, true); Scribe_Values.Look(ref color, "color", Color.white);
} }
public override Color DrawColor public override Color DrawColor