coffees-rjw-ideology-addons/CRIALactation/Source/Comps/CompAbilityEffects/CompAbilityEffect_ConvertHu...

45 lines
1.6 KiB
C#
Raw Normal View History

2021-08-02 18:55:46 +00:00
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;
2022-10-25 20:46:15 +00:00
return pawn != null && AbilityUtility.ValidateMustBeHuman(pawn, throwMessages, this.parent) &&
AbilityUtility.ValidateNoMentalState(pawn, throwMessages, this.parent) &&
AbilityUtility.ValidateSameIdeo(this.parent.pawn, pawn, throwMessages, this.parent) &&
2021-08-02 18:55:46 +00:00
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);
2023-02-06 03:05:01 +00:00
//let's expand the breasts too!
var breastList = pawn.GetBreastList();
if (!breastList.NullOrEmpty())
foreach (var breasts in breastList.Where(x => !x.TryGetComp<CompHediffBodyPart>().FluidType.NullOrEmpty()))
{
breasts.Severity += LactationSettings.hucowBreastSizeBonus; //this could make some big ones rediculous.
if (breasts.Severity < LactationSettings.hucowBreastSizeMinimum) breasts.Severity = LactationSettings.hucowBreastSizeMinimum;
}
2021-08-02 18:55:46 +00:00
}
}
}