diff --git a/CRIALactation/1.3/Assemblies/CRIALactation.dll b/CRIALactation/1.3/Assemblies/CRIALactation.dll index c783e5f..dc0294d 100644 Binary files a/CRIALactation/1.3/Assemblies/CRIALactation.dll and b/CRIALactation/1.3/Assemblies/CRIALactation.dll differ diff --git a/CRIALactation/CRIALactation.csproj b/CRIALactation/CRIALactation.csproj index ac33fa6..4e107d1 100644 --- a/CRIALactation/CRIALactation.csproj +++ b/CRIALactation/CRIALactation.csproj @@ -84,7 +84,7 @@ - + diff --git a/CRIALactation/Defs/PreceptDefs/Precepts_Lactating.xml b/CRIALactation/Defs/PreceptDefs/Precepts_Lactating.xml index 8650ea3..8236b04 100644 --- a/CRIALactation/Defs/PreceptDefs/Precepts_Lactating.xml +++ b/CRIALactation/Defs/PreceptDefs/Precepts_Lactating.xml @@ -18,6 +18,7 @@ 100 Milk from breasts is creamy and delicious. It should be produced and consumed on a regular basis. Lactating colonists will produce double the normal amount of milk. +
  • Lactating_Essential Sizeable breasts must produce milk diff --git a/CRIALactation/Source/LactationUtility.cs b/CRIALactation/Source/LactationUtility.cs index ca967a5..9c0835e 100644 --- a/CRIALactation/Source/LactationUtility.cs +++ b/CRIALactation/Source/LactationUtility.cs @@ -36,7 +36,7 @@ namespace CRIALactation public static void StartLactating(Pawn p, bool natural) { - Hediff lactating = HediffMaker.MakeHediff(natural ? HediffDefOf_Milk.Lactating_Natural : HediffDefOf_Milk.Lactating_Drug, p, null); + Hediff lactating = HediffMaker.MakeHediff(HediffDefOf_Milk.Lactating_Natural, p, null); lactating.Severity = Rand.Value; p.health.AddHediff(lactating, Genital_Helper.get_breastsBPR(p)); } diff --git a/CRIALactation/Source/Precepts/PreceptComp_Lactation.cs b/CRIALactation/Source/Precepts/PreceptComp_Lactation.cs new file mode 100644 index 0000000..ba9cdf0 --- /dev/null +++ b/CRIALactation/Source/Precepts/PreceptComp_Lactation.cs @@ -0,0 +1,33 @@ +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 PreceptComp_Lactation : PreceptComp + { + + public override void Notify_MemberGenerated(Pawn pawn, Precept precept) + { + + if(precept.def == PreceptDefOf_Lactation.Lactating_Essential && + LactationUtility.HasMilkableBreasts(pawn)) + { + + if (!LactationUtility.IsLactating(pawn)) + { + LactationUtility.StartLactating(pawn, pawn.relations.ChildrenCount > 0); + Log.Message("Creating pawn with lact" + pawn.Name); + } + } + } + + + } +} diff --git a/CRIALactation/Source/Precepts/Precept_Lactation.cs b/CRIALactation/Source/Precepts/Precept_Lactation.cs deleted file mode 100644 index a1a4405..0000000 --- a/CRIALactation/Source/Precepts/Precept_Lactation.cs +++ /dev/null @@ -1,50 +0,0 @@ -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 -{ - /** //doesn't work because inheritance problems with rimworld - public class Precept_Lactation : Precept - { - - public override void Notify_MemberSpawned(Pawn pawn) - { - Log.Message("spawning pawn with lact"); - if (!pawn.IsColonistPlayerControlled && !LactationUtility.IsLactating(pawn)) - { - LactationUtility.StartLactating(pawn, pawn.relations.ChildrenCount > 0); - } - - //spawned into map - base.Notify_MemberSpawned(pawn); - } - - public override void Notify_MemberGenerated(Pawn pawn) - { - Log.Message("Creating pawn with lact"); - - //first created - if(pawn.IsColonistPlayerControlled && LactationUtility.HasMilkableBreasts(pawn)) - { - - if (!LactationUtility.IsLactating(pawn)) - { - LactationUtility.StartLactating(pawn, pawn.relations.ChildrenCount > 0); - Log.Message("Creating pawn with lact" + pawn.Name); - } - } - - base.Notify_MemberGenerated(pawn); - } - - - } - **/ -} diff --git a/CRIALactation/Source/WorkGivers/WorkGiver_MassageBreasts.cs b/CRIALactation/Source/WorkGivers/WorkGiver_MassageBreasts.cs index db54550..2d86b3e 100644 --- a/CRIALactation/Source/WorkGivers/WorkGiver_MassageBreasts.cs +++ b/CRIALactation/Source/WorkGivers/WorkGiver_MassageBreasts.cs @@ -16,12 +16,12 @@ namespace CRIALactation { public override IEnumerable PotentialWorkThingsGlobal(Pawn pawn) { - return pawn.Map.mapPawns.SpawnedPawnsInFaction(pawn.Faction); + return pawn.Map.mapPawns.AllPawnsSpawned; } public override bool ShouldSkip(Pawn pawn, bool forced = false) { - List list = pawn.Map.mapPawns.SpawnedPawnsInFaction(pawn.Faction); + List list = pawn.Map.mapPawns.AllPawnsSpawned; for(int i = 0; i < list.Count; i++) { if(LactationUtility.isMassageable(list[i]))