mirror of
https://gitgud.io/lutepickle/rjw_menstruation.git
synced 2024-08-14 22:46:52 +00:00
96 lines
3.5 KiB
C#
96 lines
3.5 KiB
C#
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();
|
|
comp.curStage = HediffComp_Menstruation.Stage.Ovulatory;
|
|
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();
|
|
comp.curStage = HediffComp_Menstruation.Stage.Ovulatory;
|
|
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;
|
|
|
|
}
|
|
if (pawn.Has(Quirk.Breeder)) pawn.needs.mood.thoughts.memories.TryGainMemoryFast(VariousDefOf.HateTookContraceptivePill);
|
|
else pawn.needs.mood.thoughts.memories.TryGainMemoryFast(VariousDefOf.TookContraceptivePill);
|
|
}
|
|
}
|
|
}
|