Compare commits

..

4 commits

Author SHA1 Message Date
lutepickle
f8913d1ec5 Double pheromone increase 2023-05-10 09:33:20 -07:00
lutepickle
f40eed6317 Capitalize EmitRatio 2023-05-09 23:01:55 -07:00
lutepickle
1cce07d312 Remove SexSatisfaction from the first stage of pheromones 2023-05-09 23:01:16 -07:00
lutepickle
4c788906c7 Remove intensity from pheromone properties since it's just a modifier on daysToMaxSeverity 2023-05-09 15:50:36 -07:00
3 changed files with 4 additions and 7 deletions

Binary file not shown.

View file

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

View file

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