2022-10-24 01:02:02 +00:00
|
|
|
|
using RimWorld;
|
|
|
|
|
using rjw;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using Verse;
|
|
|
|
|
|
|
|
|
|
namespace RJW_Menstruation
|
|
|
|
|
{
|
|
|
|
|
public class FertPillOutcomeDoer : IngestionOutcomeDoer
|
|
|
|
|
{
|
|
|
|
|
protected override void DoIngestionOutcomeSpecial(Pawn pawn, Thing ingested)
|
|
|
|
|
{
|
|
|
|
|
foreach (HediffComp_Menstruation comp in pawn.GetMenstruationComps())
|
|
|
|
|
if (comp.curStage.Equals(HediffComp_Menstruation.Stage.Follicular)
|
|
|
|
|
|| comp.curStage.Equals(HediffComp_Menstruation.Stage.Luteal)
|
|
|
|
|
|| comp.curStage.Equals(HediffComp_Menstruation.Stage.Anestrus)
|
|
|
|
|
)
|
|
|
|
|
{
|
|
|
|
|
comp.SetEstrus();
|
2023-03-07 01:05:01 +00:00
|
|
|
|
comp.GoNextStage(HediffComp_Menstruation.Stage.Ovulatory);
|
2022-10-24 01:02:02 +00:00
|
|
|
|
comp.ovarypower--;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class InduceOvulationOutcomeDoer : IngestionOutcomeDoer
|
|
|
|
|
{
|
|
|
|
|
protected override void DoIngestionOutcomeSpecial(Pawn pawn, Thing ingested)
|
|
|
|
|
{
|
|
|
|
|
foreach (HediffComp_Menstruation comp in pawn.GetMenstruationComps())
|
|
|
|
|
if (comp.curStage.Equals(HediffComp_Menstruation.Stage.Follicular)
|
|
|
|
|
|| comp.curStage.Equals(HediffComp_Menstruation.Stage.Anestrus)
|
|
|
|
|
)
|
|
|
|
|
{
|
|
|
|
|
comp.SetEstrus();
|
2023-03-07 01:05:01 +00:00
|
|
|
|
comp.GoNextStage(HediffComp_Menstruation.Stage.Ovulatory);
|
2022-10-24 01:02:02 +00:00
|
|
|
|
comp.eggstack += ingested.stackCount - 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class IngestionOutcomeDoer_AdjustSeverity : IngestionOutcomeDoer
|
|
|
|
|
{
|
|
|
|
|
public HediffDef hediffDef;
|
|
|
|
|
public float severity;
|
|
|
|
|
|
|
|
|
|
protected override void DoIngestionOutcomeSpecial(Pawn pawn, Thing ingested)
|
|
|
|
|
{
|
|
|
|
|
Hediff hediff = pawn.health.hediffSet.GetFirstHediffOfDef(hediffDef);
|
|
|
|
|
if (hediff != null) hediff.Severity += severity;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class OvaryPillOutcomeDoer : IngestionOutcomeDoer
|
|
|
|
|
{
|
|
|
|
|
public float effectOffset;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected override void DoIngestionOutcomeSpecial(Pawn pawn, Thing ingested)
|
|
|
|
|
{
|
|
|
|
|
foreach (HediffComp_Menstruation comp in pawn.GetMenstruationComps())
|
|
|
|
|
if (Configurations.EnableMenopause) comp.RecoverOvary(1 + effectOffset);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class SuperOvulationOutcomeDoer : IngestionOutcomeDoer
|
|
|
|
|
{
|
|
|
|
|
protected override void DoIngestionOutcomeSpecial(Pawn pawn, Thing ingested)
|
|
|
|
|
{
|
|
|
|
|
foreach (HediffComp_Menstruation comp in pawn.GetMenstruationComps())
|
|
|
|
|
comp.eggstack += Rand.Range(1, 4);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class ContraceptiveOutcomeDoer : IngestionOutcomeDoer
|
|
|
|
|
{
|
|
|
|
|
protected override void DoIngestionOutcomeSpecial(Pawn pawn, Thing ingested)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
List<Thought_Memory> memories = pawn.needs?.mood?.thoughts?.memories?.Memories.FindAll(
|
|
|
|
|
x =>
|
|
|
|
|
x.def == VariousDefOf.CameInsideF
|
|
|
|
|
|| x.def == VariousDefOf.CameInsideFFetish
|
|
|
|
|
|| x.def == VariousDefOf.HaterCameInsideF);
|
|
|
|
|
if (memories.NullOrEmpty()) return;
|
|
|
|
|
foreach (Thought_Memory m in memories)
|
|
|
|
|
{
|
|
|
|
|
if (m.def == VariousDefOf.HaterCameInsideF) m.moodPowerFactor = 0.5f;
|
|
|
|
|
else m.moodPowerFactor = 0.3f;
|
|
|
|
|
|
|
|
|
|
}
|
2023-05-04 23:17:11 +00:00
|
|
|
|
if (pawn.IsProPregnancy()) pawn.needs.mood.thoughts.memories.TryGainMemoryFast(VariousDefOf.HateTookContraceptivePill);
|
2022-10-24 01:02:02 +00:00
|
|
|
|
else pawn.needs.mood.thoughts.memories.TryGainMemoryFast(VariousDefOf.TookContraceptivePill);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|