rjw_menstruation/source/RJW_Menstruation/RJW_Menstruation/DrugOutcomDoers.cs

59 lines
1.7 KiB
C#
Raw Normal View History

2021-03-06 13:32:33 +00:00
using RimWorld;
2021-02-01 11:29:29 +00:00
using Verse;
namespace RJW_Menstruation
{
public class FertPillOutcomDoer : IngestionOutcomeDoer
{
protected override void DoIngestionOutcomeSpecial(Pawn pawn, Thing ingested)
{
HediffComp_Menstruation comp = Utility.GetMenstruationComp(pawn);
2021-03-06 13:32:33 +00:00
if (comp != null && (comp.curStage.Equals(HediffComp_Menstruation.Stage.Follicular)
2021-02-07 07:53:46 +00:00
|| comp.curStage.Equals(HediffComp_Menstruation.Stage.Luteal)
|| comp.curStage.Equals(HediffComp_Menstruation.Stage.ClimactericFollicular)
|| comp.curStage.Equals(HediffComp_Menstruation.Stage.ClimactericLuteal)
2021-06-12 15:51:34 +00:00
|| comp.curStage.Equals(HediffComp_Menstruation.Stage.Anestrus)
2021-02-12 15:24:54 +00:00
))
2021-02-07 07:53:46 +00:00
{
2021-02-25 09:09:24 +00:00
comp.SetEstrus(comp.Props.eggLifespanDays);
2021-02-07 07:53:46 +00:00
comp.curStage = HediffComp_Menstruation.Stage.Ovulatory;
comp.ovarypower--;
}
2021-02-01 11:29:29 +00:00
}
}
2021-02-07 07:53:46 +00:00
public class OvaryPillOutcomDoer : IngestionOutcomeDoer
{
public float effectOffset;
protected override void DoIngestionOutcomeSpecial(Pawn pawn, Thing ingested)
{
HediffComp_Menstruation comp = Utility.GetMenstruationComp(pawn);
if (comp != null)
{
comp.ovarypower = (int)(comp.ovarypower * (1 + effectOffset));
}
}
}
2021-02-12 15:24:54 +00:00
public class SuperOvulationOutcomDoer : IngestionOutcomeDoer
{
protected override void DoIngestionOutcomeSpecial(Pawn pawn, Thing ingested)
{
HediffComp_Menstruation comp = Utility.GetMenstruationComp(pawn);
if (comp != null)
{
2021-03-06 13:32:33 +00:00
comp.eggstack += Rand.Range(1, 4);
2021-02-12 15:24:54 +00:00
}
}
}
2021-02-07 07:53:46 +00:00
2021-02-01 11:29:29 +00:00
}