Compare commits

..

No commits in common. "f8913d1ec5387c51098377aef3d81d7b42d54ad3" and "28d77ed1fb848ac981013968a3506aae8989a2cb" have entirely different histories.

3 changed files with 7 additions and 4 deletions

Binary file not shown.

View file

@ -86,8 +86,9 @@
</stages>
<comps>
<li Class="RJW_Menstruation.CompProperties_Pheromones">
<daysToMaxSeverity>0.25</daysToMaxSeverity> <!-- The amount of time spent near someone in estrus for full effect -->
<daysToMaxSeverity>0.5</daysToMaxSeverity> <!-- The amount of time spent near someone in estrus for full effect -->
<range>6</range>
<intensity>1</intensity>
</li>
</comps>
</HediffDef>
@ -138,6 +139,7 @@
<label>weak</label>
<statFactors>
<SexFrequency>1.1</SexFrequency>
<SexSatisfaction>1.0</SexSatisfaction>
</statFactors>
</li>
<li>

View file

@ -13,6 +13,7 @@ namespace RJW_Menstruation
{
public float daysToMaxSeverity;
public float range;
public float intensity = 1.0f;
public CompProperties_Pheromones()
{
@ -24,7 +25,7 @@ namespace RJW_Menstruation
{
public CompProperties_Pheromones Props => (CompProperties_Pheromones)props;
public const int emitInterval = GenTicks.TickRareInterval;
public float EmitRatio => (float)emitInterval / GenDate.TicksPerDay;
public float emitRatio => (float)emitInterval / GenDate.TicksPerDay;
public override void CompPostTick(ref float severityAdjustment)
{
@ -82,12 +83,12 @@ namespace RJW_Menstruation
protected void ApplyEffectToPawn(Pawn target)
{
float intensity = GetEffectOnPawn(target);
float intensity = Props.intensity * GetEffectOnPawn(target);
if (intensity <= 0.0f) return;
Hediff pheromones = target.health.hediffSet.GetFirstHediffOfDef(VariousDefOf.Hediff_AffectedByPheromones);
float decay = VariousDefOf.Hediff_AffectedByPheromones.CompProps<HediffCompProperties_SeverityPerDay>().severityPerDay;
float raiseSeverityPerDay = intensity / Props.daysToMaxSeverity - decay; // Desired increase plus enough to overcome pheromone decay
float amountToApply = EmitRatio * raiseSeverityPerDay;
float amountToApply = emitRatio * raiseSeverityPerDay;
if (pheromones != null)
pheromones.Severity += amountToApply;
else