mirror of
https://gitgud.io/lutepickle/rjw_menstruation.git
synced 2024-08-14 22:46:52 +00:00
Compare commits
3 commits
32800a3499
...
c6e4d81a20
Author | SHA1 | Date | |
---|---|---|---|
|
c6e4d81a20 | ||
|
1cdb12fd3a | ||
|
7e407a1cf9 |
4 changed files with 12 additions and 11 deletions
|
@ -1338,7 +1338,7 @@ namespace RJW_Menstruation
|
||||||
protected Pawn Fertilize()
|
protected Pawn Fertilize()
|
||||||
{
|
{
|
||||||
if (cums.NullOrEmpty()) return null;
|
if (cums.NullOrEmpty()) return null;
|
||||||
List<Cum> eligibleCum = cums.FindAll(cum => !cum.notcum && cum.FertVolume > 0 && cum.pawn != null && (RJWPregnancySettings.bestial_pregnancy_enabled || xxx.is_animal(Pawn) == xxx.is_animal(cum.pawn)));
|
List<Cum> eligibleCum = cums.FindAll(cum => !cum.notcum && cum.FertVolume > 0 && !(cum.pawn?.Destroyed ?? true) && (RJWPregnancySettings.bestial_pregnancy_enabled || xxx.is_animal(Pawn) == xxx.is_animal(cum.pawn)));
|
||||||
if (eligibleCum.Count == 0) return null;
|
if (eligibleCum.Count == 0) return null;
|
||||||
|
|
||||||
float totalFertPower = eligibleCum.Sum(cum => cum.FertVolume);
|
float totalFertPower = eligibleCum.Sum(cum => cum.FertVolume);
|
||||||
|
@ -1507,7 +1507,7 @@ namespace RJW_Menstruation
|
||||||
protected void BleedOut()
|
protected void BleedOut()
|
||||||
{
|
{
|
||||||
// ~1.5 per hour times acceleration
|
// ~1.5 per hour times acceleration
|
||||||
float bledAmount = 0.03f * Configurations.BleedingAmount * Configurations.CycleAcceleration * Rand.Range(0.5f, 1.5f) * HoursBetweenSimulations;
|
float bledAmount = Utility.VariationRange(0.03f * Configurations.BleedingAmount * Configurations.CycleAcceleration * HoursBetweenSimulations, 0.5f);
|
||||||
CumIn(Pawn, bledAmount, Translations.Menstrual_Blood, -5.0f, Pawn.RaceProps?.BloodDef ?? ThingDefOf.Filth_Blood);
|
CumIn(Pawn, bledAmount, Translations.Menstrual_Blood, -5.0f, Pawn.RaceProps?.BloodDef ?? ThingDefOf.Filth_Blood);
|
||||||
Cum blood = GetNotCum(Translations.Menstrual_Blood);
|
Cum blood = GetNotCum(Translations.Menstrual_Blood);
|
||||||
if (blood != null) blood.Color = BloodColor;
|
if (blood != null) blood.Color = BloodColor;
|
||||||
|
@ -1581,7 +1581,7 @@ namespace RJW_Menstruation
|
||||||
protected void AddCrampPain()
|
protected void AddCrampPain()
|
||||||
{
|
{
|
||||||
Hediff hediff = HediffMaker.MakeHediff(VariousDefOf.Hediff_MenstrualCramp, Pawn);
|
Hediff hediff = HediffMaker.MakeHediff(VariousDefOf.Hediff_MenstrualCramp, Pawn);
|
||||||
hediff.Severity = crampPain * Rand.Range(0.9f, 1.1f);
|
hediff.Severity = Utility.VariationRange(crampPain, 0.1f);
|
||||||
HediffCompProperties_SeverityPerDay Prop = (HediffCompProperties_SeverityPerDay)hediff.TryGetComp<HediffComp_SeverityPerDay>().props;
|
HediffCompProperties_SeverityPerDay Prop = (HediffCompProperties_SeverityPerDay)hediff.TryGetComp<HediffComp_SeverityPerDay>().props;
|
||||||
Prop.severityPerDay = -hediff.Severity / (currentIntervalTicks / GenDate.TicksPerDay) * Configurations.CycleAcceleration;
|
Prop.severityPerDay = -hediff.Severity / (currentIntervalTicks / GenDate.TicksPerDay) * Configurations.CycleAcceleration;
|
||||||
Pawn.health.AddHediff(hediff, parent.Part);
|
Pawn.health.AddHediff(hediff, parent.Part);
|
||||||
|
@ -1860,15 +1860,15 @@ namespace RJW_Menstruation
|
||||||
switch (stage)
|
switch (stage)
|
||||||
{
|
{
|
||||||
case Stage.Follicular:
|
case Stage.Follicular:
|
||||||
return (int)(Props.follicularIntervalDays * GenDate.TicksPerDay * (1 + Rand.Range(-cycleVariability, cycleVariability) * 1.5f * variabilityFactor) / (1 + (cycleSpeed - 1) * 1.5f));
|
return (int)(Utility.VariationRange(Props.follicularIntervalDays * GenDate.TicksPerDay, cycleVariability * 1.5f * variabilityFactor) / (1 + (cycleSpeed - 1) * 1.5f));
|
||||||
case Stage.Ovulatory:
|
case Stage.Ovulatory:
|
||||||
return Props.ovulationIntervalHours * GenDate.TicksPerHour; // No variability for now
|
return Props.ovulationIntervalHours * GenDate.TicksPerHour; // No variability for now
|
||||||
case Stage.Luteal:
|
case Stage.Luteal:
|
||||||
return (int)(Props.lutealIntervalDays * GenDate.TicksPerDay * (1 + Rand.Range(-cycleVariability, cycleVariability) * 0.5f * variabilityFactor) / (1 + (cycleSpeed - 1) * 0.5f));
|
return (int)(Utility.VariationRange(Props.lutealIntervalDays * GenDate.TicksPerDay, cycleVariability * 0.5f * variabilityFactor) / (1 + (cycleSpeed - 1) * 0.5f));
|
||||||
case Stage.Bleeding:
|
case Stage.Bleeding:
|
||||||
return (int)(Props.bleedingIntervalDays * GenDate.TicksPerDay * (1 + Rand.Range(-cycleVariability, cycleVariability) * 0.5f * variabilityFactor) / (1 + (cycleSpeed - 1) * 0.5f));
|
return (int)(Utility.VariationRange(Props.bleedingIntervalDays * GenDate.TicksPerDay, cycleVariability * 0.5f * variabilityFactor) / (1 + (cycleSpeed - 1) * 0.5f));
|
||||||
case Stage.Recover:
|
case Stage.Recover:
|
||||||
return (int)(Props.recoveryIntervalDays * GenDate.TicksPerDay * Rand.Range(0.95f, 1.05f));
|
return (int)Utility.VariationRange(Props.recoveryIntervalDays * GenDate.TicksPerDay, 0.05f);
|
||||||
case Stage.Pregnant:
|
case Stage.Pregnant:
|
||||||
return (int)(MenstruationUtility.GestationHours(pregnancy) * GenDate.TicksPerHour);
|
return (int)(MenstruationUtility.GestationHours(pregnancy) * GenDate.TicksPerHour);
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -99,14 +99,14 @@ namespace RJW_Menstruation
|
||||||
base.PregnantAction();
|
base.PregnantAction();
|
||||||
if (curStage != Stage.Pregnant)
|
if (curStage != Stage.Pregnant)
|
||||||
// Go halfway into the cycle
|
// Go halfway into the cycle
|
||||||
ticksToNextCycle = (int)(averageCycleIntervalTicks * (1 + Rand.Range(-cycleVariability, cycleVariability))) / 2;
|
ticksToNextCycle = (int)Utility.VariationRange(averageCycleIntervalTicks, cycleVariability) / 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void AnestrusAction()
|
protected override void AnestrusAction()
|
||||||
{
|
{
|
||||||
if (ticksToNextCycle <= 0 && IsBreedingSeason())
|
if (ticksToNextCycle <= 0 && IsBreedingSeason())
|
||||||
{
|
{
|
||||||
ticksToNextCycle = (int)(averageCycleIntervalTicks * (1 + Rand.Range(-cycleVariability, cycleVariability)));
|
ticksToNextCycle = (int)Utility.VariationRange(averageCycleIntervalTicks, cycleVariability);
|
||||||
GoNextStage(Stage.Follicular);
|
GoNextStage(Stage.Follicular);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -195,8 +195,9 @@ namespace RJW_Menstruation
|
||||||
[HarmonyPatch(typeof(Pawn_GeneTracker), "Notify_GenesChanged")]
|
[HarmonyPatch(typeof(Pawn_GeneTracker), "Notify_GenesChanged")]
|
||||||
public class Notify_GenesChanged_Patch
|
public class Notify_GenesChanged_Patch
|
||||||
{
|
{
|
||||||
public static void Postfix(Pawn_GeneTracker __instance)
|
public static void Postfix(Pawn_GeneTracker __instance, GeneDef addedOrRemovedGene)
|
||||||
{
|
{
|
||||||
|
if (!addedOrRemovedGene.HasModExtension<MenstruationModExtension>()) return;
|
||||||
foreach (HediffComp_Menstruation comp in __instance.pawn.GetMenstruationComps())
|
foreach (HediffComp_Menstruation comp in __instance.pawn.GetMenstruationComps())
|
||||||
comp.Notify_UpdatedGenes();
|
comp.Notify_UpdatedGenes();
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,7 +80,7 @@ namespace RJW_Menstruation
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
res = part.FluidAmmount * part.FluidModifier * pawn.BodySize / pawn.RaceProps.baseBodySize * Rand.Range(0.8f, 1.2f);
|
res = VariationRange(part.FluidAmmount * part.FluidModifier * pawn.BodySize / pawn.RaceProps.baseBodySize, 0.2f);
|
||||||
}
|
}
|
||||||
catch (NullReferenceException)
|
catch (NullReferenceException)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue