1.4 updates

This commit is contained in:
c0ffee 2022-10-25 13:46:15 -07:00
parent cd8fe17713
commit 6cdd801207
190 changed files with 12627 additions and 43 deletions

View file

@ -0,0 +1,23 @@
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 CompProperties_AbilityBeginInducingLactation : CompProperties_AbilityEffect
{
public CompProperties_AbilityBeginInducingLactation()
{
this.compClass = typeof(CompAbilityEffect_BeginInducingLactation);
}
}
}

View file

@ -1,5 +1,6 @@
using RimWorld;
using RimWorld.Planet;
using rjw;
using System;
using System.Collections.Generic;
using System.Linq;
@ -16,8 +17,10 @@ namespace CRIALactation
{
Pawn pawn = target.Pawn;
if (pawn == null) return false;
if (!pawn.IsColonistPlayerControlled || !pawn.IsSlaveOfColony || !pawn.IsPrisonerOfColony) return false;
if (!(pawn.IsColonistPlayerControlled || pawn.IsSlaveOfColony || pawn.IsPrisonerOfColony)) return false;
if (!Genital_Helper.has_breasts(pawn) || Genital_Helper.has_male_breasts(pawn)) return false;
if (LactationUtility.IsLactating(pawn)) return false;
return true;

View file

@ -16,9 +16,9 @@ namespace CRIALactation
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) &&
return pawn != null && AbilityUtility.ValidateMustBeHuman(pawn, throwMessages, this.parent) &&
AbilityUtility.ValidateNoMentalState(pawn, throwMessages, this.parent) &&
AbilityUtility.ValidateSameIdeo(this.parent.pawn, pawn, throwMessages, this.parent) &&
LactationUtility.IsLactating(pawn) &&
!LactationUtility.IsHucow(pawn);

View file

@ -19,6 +19,20 @@ namespace CRIALactation
Scribe_Values.Look<int>(ref this.lastHumanLactationIngestedTick, "lastHumanLactationIngestedTick", 0);
}
public override string CompInspectStringExtra()
{
if((parent as Pawn).health?.hediffSet?.GetFirstHediffOfDef(HediffDefOf_Milk.InducingLactation) != null
&& (parent as Pawn).health.hediffSet.GetFirstHediffOfDef(HediffDefOf_Milk.InducingLactation).TryGetComp<HediffComp_LactationInduction>().canMassage())
{
return "Ready to stimulate breasts for lactation.";
}
else
{
return "";
}
}
}

View file

@ -13,9 +13,11 @@ namespace CRIALactation
public class PreceptComp_Lactation : PreceptComp
{
public override void Notify_MemberGenerated(Pawn pawn, Precept precept)
public override void Notify_MemberGenerated(Pawn pawn, Precept precept, bool newborn)
{
if (newborn) return;
if((precept.def == PreceptDefOf_Lactation.Lactating_Essential
|| precept.def == PreceptDefOf_Lactation.Lactating_MandatoryHucow)
&& LactationUtility.HasMilkableBreasts(pawn))