Milk drink thoughts

This commit is contained in:
dominiclopez391 2021-11-16 21:37:17 -08:00
parent a5d5cc1d44
commit f30f494c3d
7 changed files with 150 additions and 3 deletions

View file

@ -74,12 +74,14 @@
<Compile Include="Source\CompProperties\CompProperties_InduceLactation.cs" />
<Compile Include="Source\Comps\CompAbilityEffects\CompAbilityEffect_ConvertHucow.cs" />
<Compile Include="Source\Comps\CompInduceLactation.cs" />
<Compile Include="Source\HarmonyPatches\HarmonyPatch_FoodUtility.cs" />
<Compile Include="Source\HarmonyPatches\HarmonyPatch_Ideo.cs" />
<Compile Include="Source\HarmonyPatches\Harmony_PatchAll.cs" />
<Compile Include="Source\HarmonyPatches\RJW\HarmonyPatch_Milk_HumanCompHasGatherableBodyResource.cs" />
<Compile Include="Source\HediffDefOf\HediffDefOf_Milk.cs" />
<Compile Include="Source\Hediffs\HediffCompProperties_StopOnceNotLactating.cs" />
<Compile Include="Source\Hediffs\HediffComp_StopOnceNotLactating.cs" />
<Compile Include="Source\HistoryEventDefOf\HistoryEventDefOf_Milk.cs" />
<Compile Include="Source\JobDefOf\JobDefOf_CRIALactation.cs" />
<Compile Include="Source\JobDrivers\JobDriver_MassageBreasts.cs" />
<Compile Include="Source\LactationUtility.cs" />
@ -88,6 +90,7 @@
<Compile Include="Source\RoleEffects\RoleEffect_Hucow.cs" />
<Compile Include="Source\RoleRequirements\RoleRequirement_Lactating.cs" />
<Compile Include="Source\StatDefOf\StatDefOf_Lactation.cs" />
<Compile Include="Source\ThingDefOf\ThingDefOf_Milk.cs" />
<Compile Include="Source\Thoughts\ThoughtWorker_Precept_Lactating_Essential.cs" />
<Compile Include="Source\Thoughts\ThoughtWorker_Precept_Lactating_Essential_Social.cs" />
<Compile Include="Source\WorkGivers\WorkGiver_MassageBreasts.cs" />

View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<HistoryEventDef>
<defName>DrankMilkRaw</defName>
<label>Drank Milk Raw</label>
</HistoryEventDef>
<HistoryEventDef>
<defName>DrankMilkMeal</defName>
<label>Drank Milk with meal</label>
</HistoryEventDef>
</Defs>

View file

@ -18,7 +18,6 @@
<displayOrderInImpact>100</displayOrderInImpact>
<description>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.</description>
<comps>
<li Class="CRIALactation.PreceptComp_Lactation" />
<li Class="PreceptComp_SituationalThought">
<thought>Lactating_Essential</thought>
<description>Sizeable breasts must produce milk</description>
@ -28,6 +27,14 @@
<thought>Lactating_Essential_Social</thought>
<tooltipShowMoodRange>true</tooltipShowMoodRange>
</li>
<li Class="PreceptComp_SelfTookMemoryThought">
<eventDef>DrankMilkRaw</eventDef>
<thought>DrankMilkRawReligion</thought>
</li>
<li Class="PreceptComp_SelfTookMemoryThought">
<eventDef>DrankMilkMeal</eventDef>
<thought>DrankMilkMealReligion</thought>
</li>
</comps>
</PreceptDef>
@ -38,8 +45,8 @@
<stages>
<li>
<label>producing milk</label>
<description>Expressing milk fills me with maternal pride.</description>
<baseMoodEffect>3</baseMoodEffect>
<description>I'm a good cow to be producing milk. Moo!</description>
<baseMoodEffect>8</baseMoodEffect>
</li>
<li>
@ -89,4 +96,27 @@
</stages>
</ThoughtDef>
<ThoughtDef>
<defName>DrankMilkRawReligion</defName>
<durationDays>1</durationDays>
<stages>
<li>
<label>Drank Humanoid Milk Ideology</label>
<description>The taste of breast milk from humans is a taste of the gods!</description>
<baseMoodEffect>10</baseMoodEffect>
</li>
</stages>
</ThoughtDef>
<ThoughtDef>
<defName>DrankMilkMealReligion</defName>
<durationDays>1</durationDays>
<stages>
<li>
<label>Humanoid Milk Meal Ideology</label>
<description>Human breast milk with a meal is just the best!</description>
<baseMoodEffect>20</baseMoodEffect>
</li>
</stages>
</ThoughtDef>
</Defs>

View file

@ -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<FoodUtility.ThoughtFromIngesting> __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);
}
}
}
}

View file

@ -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;
}
}

View file

@ -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;
}
}