Made eating human milk raw + in meals a requirement

This commit is contained in:
c0ffee 2021-11-17 11:36:41 -08:00
parent e1a817c55f
commit 40c79dd0cd
5 changed files with 81 additions and 25 deletions

View file

@ -3,12 +3,17 @@
<HistoryEventDef>
<defName>DrankMilkRaw</defName>
<label>Drank Milk Raw</label>
<label>Drank milk Raw</label>
</HistoryEventDef>
<HistoryEventDef>
<defName>DrankMilkMeal</defName>
<label>Drank Milk with meal</label>
<label>Drank milk with meal</label>
</HistoryEventDef>
<HistoryEventDef>
<defName>DrankNonMilkMeal</defName>
<label>Ate meal without milk</label>
</HistoryEventDef>
</Defs>

View file

@ -16,7 +16,7 @@
<impact>High</impact>
<displayOrderInIssue>20</displayOrderInIssue>
<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>
<description>Milk from breasts is creamy and delicious. It should be produced and consumed on a regular basis. Lactating colonists can be converted to hucow, which will produce double the normal amount of milk.</description>
<comps>
<li Class="PreceptComp_SituationalThought">
<thought>Lactating_Essential</thought>
@ -27,13 +27,17 @@
<thought>Lactating_Essential_Social</thought>
<tooltipShowMoodRange>true</tooltipShowMoodRange>
</li>
<li Class="PreceptComp_SelfTookMemoryThought">
<eventDef>DrankNonMilkMeal</eventDef>
<thought>DrankNonMilkMeal_Essential</thought>
</li>
<li Class="PreceptComp_SelfTookMemoryThought">
<eventDef>DrankMilkRaw</eventDef>
<thought>DrankMilkRawReligion</thought>
<thought>DrankMilkRaw_Essential</thought>
</li>
<li Class="PreceptComp_SelfTookMemoryThought">
<eventDef>DrankMilkMeal</eventDef>
<thought>DrankMilkMealReligion</thought>
<thought>DrankMilkMeal_Essential</thought>
</li>
</comps>
</PreceptDef>
@ -69,8 +73,6 @@
</stages>
</ThoughtDef>
<ThoughtDef>
<defName>Lactating_Essential_Social</defName>
<thoughtClass>Thought_SituationalSocial</thoughtClass>
@ -86,36 +88,62 @@
</li>
<li>
<label>not producing milk (moderate expectations)</label>
<baseOpinionOffset>-20</baseOpinionOffset>
<baseOpinionOffset>-10</baseOpinionOffset>
</li>
<li>
<label>not producing milk (high expectations)</label>
<baseOpinionOffset>-40</baseOpinionOffset>
<baseOpinionOffset>-15</baseOpinionOffset>
</li>
</stages>
</ThoughtDef>
<ThoughtDef>
<defName>DrankMilkRawReligion</defName>
<ThoughtDef>
<defName>DrankMilkRaw_Essential</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>
<label>Drank human milk</label>
<description>The taste of fresh breast milk is sweet, fulfilling, and intimate.</description>
<baseMoodEffect>6</baseMoodEffect>
</li>
</stages>
</ThoughtDef>
</ThoughtDef>
<ThoughtDef>
<defName>DrankMilkMealReligion</defName>
<ThoughtDef>
<defName>DrankMilkMeal_Essential</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>
<label>Ate meal with human milk</label>
<description>The breast milk accentuated my meal beautifully.</description>
<baseMoodEffect>2</baseMoodEffect>
</li>
</stages>
</ThoughtDef>
<ThoughtDef>
<defName>DrankNonMilkMeal_Essential</defName>
<durationDays>1</durationDays>
<stages>
<li>
<label>Ate non-human milk food</label>
<description>I had to eat food that wasn't produced from a person's breasts. My beliefs strictly forbid such things.</description>
<baseMoodEffect>-2</baseMoodEffect>
</li>
</stages>
</ThoughtDef>
<ThoughtDef>
<defName>NoRecentHumanMilk_Essential</defName>
<thoughtClass>Thought_Situational</thoughtClass>
<workerClass>CRIALactation.ThoughtWorker_Precept_NoRecentHumanMilk</workerClass>
<doNotApplyToQuestLodgers>True</doNotApplyToQuestLodgers>
<stages>
<li>
<label>want human milk</label>
<description>It's been so long since I've tasted the milk of a woman's breasts. I should have had some by now.</description>
<baseMoodEffect>-6</baseMoodEffect>
</li>
</stages>
</ThoughtDef>

View file

@ -23,10 +23,14 @@ namespace CRIALactation
[HarmonyPatch(typeof(FoodUtility), "ThoughtsFromIngesting")]
public static void Postfix(ref List<FoodUtility.ThoughtFromIngesting> __result, ref List<FoodUtility.ThoughtFromIngesting> ___ingestThoughts, Pawn ingester, Thing foodSource, ThingDef foodDef)
{
/**
* checks if food has milk or not
*/
if (ingester.Ideo != null)
{
CompIngredients ingredients = foodSource.TryGetComp<CompIngredients>();
if (foodDef == ThingDefOf_Milk.HumanMilk || foodDef == ThingDefOf_Milk.HumanoidMilk)
{
AddThoughtsFromIdeo_Patch(HistoryEventDefOf_Milk.DrankMilkRaw, ingester, foodDef, FoodUtility.GetMeatSourceCategory(foodDef));
@ -34,6 +38,11 @@ namespace CRIALactation
__result = ___ingestThoughts;
}
else if (ingredients == null
|| !(ingredients.ingredients.Contains(ThingDefOf_Milk.HumanMilk) || (ingredients.ingredients.Contains(ThingDefOf_Milk.HumanoidMilk)))) {
AddThoughtsFromIdeo_Patch(HistoryEventDefOf_Milk.DrankNonMilkMeal, ingester, foodDef, FoodUtility.GetMeatSourceCategory(foodDef));
__result = ___ingestThoughts;
}
}
@ -57,5 +66,17 @@ namespace CRIALactation
}
[HarmonyPatch(typeof(FoodUtility), "GenerateGoodIngredients")]
public static void Postfix(Thing meal, Ideo ideo)
{
CompIngredients compIngredients = meal.TryGetComp<CompIngredients>();
if(ideo.HasPrecept(PreceptDefOf_Lactation.Lactating_Essential))
{
compIngredients.ingredients.Add(ThingDefOf_Milk.HumanMilk);
compIngredients.ingredients.Add(ThingDefOf_Milk.HumanoidMilk);
}
}
}
}

View file

@ -18,5 +18,7 @@ namespace CRIALactation
public static HistoryEventDef DrankMilkRaw;
public static HistoryEventDef DrankMilkMeal;
public static HistoryEventDef DrankNonMilkMeal;
}
}