Rename SimulationsPerHour to HoursBetweenSimulations. Also fix climacteric/menopause sex need calculation

This commit is contained in:
lutepickle 2023-06-22 21:56:26 -07:00
parent b10baf2ba5
commit f5a302c272
3 changed files with 9 additions and 9 deletions

Binary file not shown.

View File

@ -204,9 +204,9 @@ namespace RJW_Menstruation
{
// comp is used for Hydrogen's RJW Muscle Injury
float totalleak = volume;
float decayPerInterval = 1 - Mathf.Pow(1 - Configurations.CumDecayRatio, comp.SimulationsPerHour);
float fertilityDecayPerInterval = 1 - Mathf.Pow(1 - Configurations.CumFertilityDecayRatio, comp.SimulationsPerHour);
antisperm *= comp.SimulationsPerHour;
float decayPerInterval = 1 - Mathf.Pow(1 - Configurations.CumDecayRatio, comp.HoursBetweenSimulations);
float fertilityDecayPerInterval = 1 - Mathf.Pow(1 - Configurations.CumFertilityDecayRatio, comp.HoursBetweenSimulations);
antisperm *= comp.HoursBetweenSimulations;
volume *= Math.Max(0, 1 - decayPerInterval * (1 - DecayResist) * leakfactor);
fertility *= Math.Max(0, 1 - (fertilityDecayPerInterval * (1 - DecayResist) + antisperm));
CutMinor();

View File

@ -177,7 +177,7 @@ namespace RJW_Menstruation
set => tickInterval = value;
}
public float SimulationsPerHour => (float)TickInterval / GenDate.TicksPerHour;
public float HoursBetweenSimulations => (float)TickInterval / GenDate.TicksPerHour;
public Hediff Pregnancy {
get
@ -1060,9 +1060,9 @@ namespace RJW_Menstruation
if (Pawn.CurJobDef == xxx.knotted) leakfactor = 0f;
foreach (Cum cum in cums)
{
if (Rand.Chance(SimulationsPerHour)) cum.CumEffects(Pawn);
if (Rand.Chance(HoursBetweenSimulations)) cum.CumEffects(Pawn);
float vd = cum.DismishNatural(leakfactor, this, antisperm);
cum.MakeThinner((float)Configurations.CycleAcceleration * SimulationsPerHour);
cum.MakeThinner((float)Configurations.CycleAcceleration * HoursBetweenSimulations);
totalleak += AbsorbCum(vd, absorber);
string tmp = "FilthLabelWithSource".Translate(cum.FilthDef.label, cum.pawn?.LabelShort ?? "Unknown", 1.ToString());
filthlabels.Add(tmp.Replace(" x1", ""));
@ -1300,7 +1300,7 @@ namespace RJW_Menstruation
{
if (sexNeed == null) sexNeed = Pawn.needs.TryGetNeed(VariousDefOf.SexNeed);
if (sexNeed == null) return;
if (sexNeed.CurLevel < 0.5f) sexNeed.CurLevel += 0.01f / (SimulationsPerHour * Math.Max(1, Pawn.GetMenstruationComps().Count()));
if (sexNeed.CurLevel < 0.5f) sexNeed.CurLevel += 0.01f * HoursBetweenSimulations / Math.Max(1, Pawn.GetMenstruationComps().Count());
}
}
@ -1368,7 +1368,7 @@ namespace RJW_Menstruation
//float fertFailChancePerHour = Mathf.Pow(1.0f - Configurations.FertilizeChance, totalFertPower * Props.basefertilizationChanceFactor);
//float fertFailChancePerInterval = Mathf.Pow(fertFailChancePerHour, (float)TickInterval / GenDate.TicksPerHour);
float fertFailChancePerInterval = Mathf.Pow(1.0f - Configurations.FertilizeChance, totalFertPower * Props.basefertilizationChanceFactor * SimulationsPerHour);
float fertFailChancePerInterval = Mathf.Pow(1.0f - Configurations.FertilizeChance, totalFertPower * Props.basefertilizationChanceFactor * HoursBetweenSimulations);
if (Rand.Chance(fertFailChancePerInterval)) return null;
@ -1511,7 +1511,7 @@ namespace RJW_Menstruation
protected void BleedOut()
{
// ~1.5 per hour times acceleration
float bledAmount = 0.03f * Configurations.BleedingAmount * Configurations.CycleAcceleration * Rand.Range(0.5f, 1.5f) * SimulationsPerHour;
float bledAmount = 0.03f * Configurations.BleedingAmount * Configurations.CycleAcceleration * Rand.Range(0.5f, 1.5f) * HoursBetweenSimulations;
CumIn(Pawn, bledAmount, Translations.Menstrual_Blood, -5.0f, Pawn.RaceProps?.BloodDef ?? ThingDefOf.Filth_Blood);
Cum blood = GetNotCum(Translations.Menstrual_Blood);
if (blood != null) blood.Color = BloodColor;