rjw_menstruation/source/RJW_Menstruation/RJW_Menstruation/DrugOutcomDoers.cs

50 lines
1.4 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using RimWorld;
using Verse;
namespace RJW_Menstruation
{
public class FertPillOutcomDoer : IngestionOutcomeDoer
{
protected override void DoIngestionOutcomeSpecial(Pawn pawn, Thing ingested)
{
HediffComp_Menstruation comp = Utility.GetMenstruationComp(pawn);
if (comp != null && comp.curStage.Equals(HediffComp_Menstruation.Stage.Follicular)
|| comp.curStage.Equals(HediffComp_Menstruation.Stage.Luteal)
|| comp.curStage.Equals(HediffComp_Menstruation.Stage.ClimactericFollicular)
|| comp.curStage.Equals(HediffComp_Menstruation.Stage.ClimactericLuteal)
)
{
comp.curStage = HediffComp_Menstruation.Stage.Ovulatory;
comp.ovarypower--;
}
}
}
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));
}
}
}
}