coffees-rjw-ideology-addons/CRIALactation/Source/LactationUtility.cs

55 lines
1.5 KiB
C#
Raw Normal View History

2021-07-26 04:06:00 +00:00
using Milk;
2021-07-26 15:19:49 +00:00
using rjw;
2021-07-26 04:06:00 +00:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse;
namespace CRIALactation
{
public static class LactationUtility
{
public static bool IsLactating(Pawn p)
{
return
p.health.hediffSet.HasHediff(HediffDefOf_Milk.Lactating_Natural, false) ||
p.health.hediffSet.HasHediff(HediffDefOf_Milk.Lactating_Drug, false) ||
p.health.hediffSet.HasHediff(HediffDefOf_Milk.Lactating_Permanent, false) ||
p.health.hediffSet.HasHediff(HediffDefOf_Milk.Heavy_Lactating_Permanent, false);
}
2021-07-26 15:19:49 +00:00
public static bool HasMilkableBreasts(Pawn p)
{
if (Genital_Helper.has_breasts(p) && !Genital_Helper.has_male_breasts(p))
{
return true;
}
return false;
}
public static void StartLactating(Pawn p, bool natural)
{
Hediff lactating = HediffMaker.MakeHediff(natural ? HediffDefOf_Milk.Lactating_Natural : HediffDefOf_Milk.Lactating_Drug, p, null);
lactating.Severity = Rand.Value;
p.health.AddHediff(lactating, Genital_Helper.get_breastsBPR(p));
}
2021-07-30 01:33:08 +00:00
public static bool isMassageable(Pawn p)
{
CompInduceLactation c = p.TryGetComp<CompInduceLactation>();
if (c != null && c.isActive && c.CanMassage)
{
return true;
}
return false;
}
2021-07-26 04:06:00 +00:00
}
}