coffees-rjw-ideology-addons/CRIALactation/Source/Comps/CompAbilityEffects/CompAbilityEffect_ConvertHucow.cs
2021-08-02 11:55:46 -07:00

35 lines
1 KiB
C#

using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse;
using RimWorld;
using rjw;
using Milk;
using UnityEngine;
namespace CRIALactation
{
public class CompAbilityEffect_ConvertHucow : CompAbilityEffect
{
public override bool Valid(LocalTargetInfo target, bool throwMessages = false)
{
Pawn pawn = target.Pawn;
return pawn != null && AbilityUtility.ValidateMustBeHuman(pawn, throwMessages) &&
AbilityUtility.ValidateNoMentalState(pawn, throwMessages) &&
AbilityUtility.ValidateSameIdeo(this.parent.pawn, pawn, throwMessages) &&
LactationUtility.IsLactating(pawn) &&
!LactationUtility.IsHucow(pawn);
}
public override void Apply(LocalTargetInfo target, LocalTargetInfo dest)
{
base.Apply(target, dest);
Pawn pawn = target.Pawn;
LactationUtility.ExtendLactationDuration(pawn);
}
}
}