diff --git a/CRIALactation/1.3/Assemblies/CRIALactation.dll b/CRIALactation/1.3/Assemblies/CRIALactation.dll index dc0294d..365a7db 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 4e107d1..30d9d7e 100644 --- a/CRIALactation/CRIALactation.csproj +++ b/CRIALactation/CRIALactation.csproj @@ -74,12 +74,14 @@ + + @@ -88,6 +90,7 @@ + diff --git a/CRIALactation/Defs/HistoryEventDefs/HistoryEventDefs.xml b/CRIALactation/Defs/HistoryEventDefs/HistoryEventDefs.xml new file mode 100644 index 0000000..c2dffbb --- /dev/null +++ b/CRIALactation/Defs/HistoryEventDefs/HistoryEventDefs.xml @@ -0,0 +1,14 @@ + + + + + DrankMilkRaw + + + + + DrankMilkMeal + + + + diff --git a/CRIALactation/Defs/PreceptDefs/Precepts_Lactating.xml b/CRIALactation/Defs/PreceptDefs/Precepts_Lactating.xml index 8236b04..00c59d7 100644 --- a/CRIALactation/Defs/PreceptDefs/Precepts_Lactating.xml +++ b/CRIALactation/Defs/PreceptDefs/Precepts_Lactating.xml @@ -18,7 +18,6 @@ 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 @@ -28,6 +27,14 @@ Lactating_Essential_Social true
  • +
  • + DrankMilkRaw + DrankMilkRawReligion +
  • +
  • + DrankMilkMeal + DrankMilkMealReligion +
  • @@ -38,8 +45,8 @@
  • - Expressing milk fills me with maternal pride. - 3 + I'm a good cow to be producing milk. Moo! + 8
  • @@ -89,4 +96,27 @@ + + DrankMilkRawReligion + 1 + +
  • + + The taste of breast milk from humans is a taste of the gods! + 10 +
  • +
    + + + + DrankMilkMealReligion + 1 + +
  • + + Human breast milk with a meal is just the best! + 20 +
  • +
    +
    diff --git a/CRIALactation/Source/HarmonyPatches/HarmonyPatch_FoodUtility.cs b/CRIALactation/Source/HarmonyPatches/HarmonyPatch_FoodUtility.cs new file mode 100644 index 0000000..f01b771 --- /dev/null +++ b/CRIALactation/Source/HarmonyPatches/HarmonyPatch_FoodUtility.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using HarmonyLib; +using RimWorld; +using Verse; + +namespace CRIALactation +{ + [HarmonyPatch] + public static class HarmonyPatch_FoodUtility + { + + [HarmonyReversePatch(HarmonyReversePatchType.Snapshot)] + [HarmonyPatch(typeof(FoodUtility), "AddThoughtsFromIdeo")] + public static void AddThoughtsFromIdeo_Patch(HistoryEventDef eventDef, Pawn ingester, ThingDef foodDef, MeatSourceCategory meatSourceCategory) + { + throw new NotImplementedException("thoughts from ideo wasn't implemented!"); + } + + [HarmonyPatch(typeof(FoodUtility), "ThoughtsFromIngesting")] + public static void Postfix(ref List __result, Pawn ingester, Thing foodSource, ThingDef foodDef) + { + + if (ingester.Ideo != null) + { + + if (foodDef == ThingDefOf_Milk.HumanMilk || foodDef == ThingDefOf_Milk.HumanoidMilk) + { + AddThoughtsFromIdeo_Patch(HistoryEventDefOf_Milk.DrankMilkRaw, ingester, foodDef, FoodUtility.GetMeatSourceCategory(foodDef)); + } + + + } + + } + + [HarmonyPatch(typeof(FoodUtility), "AddIngestThoughtsFromIngredient")] + public static void Postfix(ThingDef ingredient, Pawn ingester) { + + MeatSourceCategory meatSourceCategory = FoodUtility.GetMeatSourceCategory(ingredient); + + if(ingredient == ThingDefOf_Milk.HumanoidMilk || ingredient == ThingDefOf_Milk.HumanMilk) + { + AddThoughtsFromIdeo_Patch(HistoryEventDefOf_Milk.DrankMilkMeal, ingester, ingredient, meatSourceCategory); + } + + } + + + } +} diff --git a/CRIALactation/Source/HistoryEventDefOf/HistoryEventDefOf_Milk.cs b/CRIALactation/Source/HistoryEventDefOf/HistoryEventDefOf_Milk.cs new file mode 100644 index 0000000..0e17b05 --- /dev/null +++ b/CRIALactation/Source/HistoryEventDefOf/HistoryEventDefOf_Milk.cs @@ -0,0 +1,22 @@ +using RimWorld; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CRIALactation +{ + [DefOf] + public static class HistoryEventDefOf_Milk + { + static HistoryEventDefOf_Milk() + { + DefOfHelper.EnsureInitializedInCtor(typeof(HistoryEventDefOf_Milk)); + } + + public static HistoryEventDef DrankMilkRaw; + + public static HistoryEventDef DrankMilkMeal; + } +} diff --git a/CRIALactation/Source/ThingDefOf/ThingDefOf_Milk.cs b/CRIALactation/Source/ThingDefOf/ThingDefOf_Milk.cs new file mode 100644 index 0000000..6964b77 --- /dev/null +++ b/CRIALactation/Source/ThingDefOf/ThingDefOf_Milk.cs @@ -0,0 +1,24 @@ +using RimWorld; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Verse; + +namespace CRIALactation +{ + [DefOf] + public static class ThingDefOf_Milk + { + static ThingDefOf_Milk() + { + DefOfHelper.EnsureInitializedInCtor(typeof(ThingDefOf_Milk)); + } + + public static ThingDef HumanMilk; + + public static ThingDef HumanoidMilk; + + } +}