Fix cum not diminishing

This commit is contained in:
lutepickle 2023-04-13 21:06:32 -07:00
parent e37940abcf
commit a023c884d3
4 changed files with 8 additions and 7 deletions

Binary file not shown.

View File

@ -174,7 +174,7 @@ namespace RJW_Menstruation
}
public void MakeThinner(int speed)
public void MakeThinner(float speed)
{
cumthickness = cumthickness.LerpMultiple(DecayResist, 0.3f, speed);
}
@ -205,8 +205,8 @@ namespace RJW_Menstruation
{
// comp is used for Hydrogen's RJW Muscle Injury
float totalleak = volume;
float decayPerInterval = 1 - Mathf.Pow(1 - Configurations.CumDecayRatio, comp.TickInterval / GenDate.TicksPerHour);
float fertilityDecayPerInterval = 1 - Mathf.Pow(Configurations.CumFertilityDecayRatio, comp.TickInterval / GenDate.TicksPerHour);
float decayPerInterval = 1 - Mathf.Pow(1 - Configurations.CumDecayRatio, (float)comp.TickInterval / GenDate.TicksPerHour);
float fertilityDecayPerInterval = 1 - Mathf.Pow(Configurations.CumFertilityDecayRatio, (float)comp.TickInterval / GenDate.TicksPerHour);
volume *= Math.Max(0, 1 - decayPerInterval * (1 - DecayResist) * leakfactor);
fertility *= Math.Max(0, 1 - (fertilityDecayPerInterval * (1 - DecayResist) + antisperm));
CutMinor();

View File

@ -1025,15 +1025,16 @@ namespace RJW_Menstruation
if (Pawn.CurJobDef == xxx.knotted) leakfactor = 0f;
foreach (Cum cum in cums)
{
cum.CumEffects(Pawn);
if (Rand.Chance((float)TickInterval / GenDate.TicksPerHour)) cum.CumEffects(Pawn);
float vd = cum.DismishNatural(leakfactor, this, antisperm);
cum.MakeThinner(Configurations.CycleAcceleration);
cum.MakeThinner((float)Configurations.CycleAcceleration * TickInterval / GenDate.TicksPerHour);
totalleak += AbsorbCum(vd, absorber);
string tmp = "FilthLabelWithSource".Translate(cum.FilthDef.label, cum.pawn?.LabelShort ?? "Unknown", 1.ToString());
filthlabels.Add(tmp.Replace(" x1", ""));
}
int postCumAmount = Mathf.CeilToInt(TotalCum);
for (int i = 0; i < postCumAmount - preCumAmount; i++) // Emit a filth every time the integer cum amount drops
int totalFilth = preCumAmount - postCumAmount;
for (int i = 0; i < totalFilth; 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);

View File

@ -433,7 +433,7 @@ namespace RJW_Menstruation
}
public static float LerpMultiple(this float a, float b, float t, int num)
public static float LerpMultiple(this float a, float b, float t, float num)
{
float tmult = Mathf.Pow(1 - t, num);
return tmult * a + (1 - tmult) * b;