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> <HistoryEventDef>
<defName>DrankMilkRaw</defName> <defName>DrankMilkRaw</defName>
<label>Drank Milk Raw</label> <label>Drank milk Raw</label>
</HistoryEventDef> </HistoryEventDef>
<HistoryEventDef> <HistoryEventDef>
<defName>DrankMilkMeal</defName> <defName>DrankMilkMeal</defName>
<label>Drank Milk with meal</label> <label>Drank milk with meal</label>
</HistoryEventDef> </HistoryEventDef>
<HistoryEventDef>
<defName>DrankNonMilkMeal</defName>
<label>Ate meal without milk</label>
</HistoryEventDef>
</Defs> </Defs>

View File

@ -16,7 +16,7 @@
<impact>High</impact> <impact>High</impact>
<displayOrderInIssue>20</displayOrderInIssue> <displayOrderInIssue>20</displayOrderInIssue>
<displayOrderInImpact>100</displayOrderInImpact> <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> <comps>
<li Class="PreceptComp_SituationalThought"> <li Class="PreceptComp_SituationalThought">
<thought>Lactating_Essential</thought> <thought>Lactating_Essential</thought>
@ -27,14 +27,18 @@
<thought>Lactating_Essential_Social</thought> <thought>Lactating_Essential_Social</thought>
<tooltipShowMoodRange>true</tooltipShowMoodRange> <tooltipShowMoodRange>true</tooltipShowMoodRange>
</li> </li>
<li Class="PreceptComp_SelfTookMemoryThought">
<eventDef>DrankNonMilkMeal</eventDef>
<thought>DrankNonMilkMeal_Essential</thought>
</li>
<li Class="PreceptComp_SelfTookMemoryThought"> <li Class="PreceptComp_SelfTookMemoryThought">
<eventDef>DrankMilkRaw</eventDef> <eventDef>DrankMilkRaw</eventDef>
<thought>DrankMilkRawReligion</thought> <thought>DrankMilkRaw_Essential</thought>
</li> </li>
<li Class="PreceptComp_SelfTookMemoryThought"> <li Class="PreceptComp_SelfTookMemoryThought">
<eventDef>DrankMilkMeal</eventDef> <eventDef>DrankMilkMeal</eventDef>
<thought>DrankMilkMealReligion</thought> <thought>DrankMilkMeal_Essential</thought>
</li> </li>
</comps> </comps>
</PreceptDef> </PreceptDef>
@ -69,8 +73,6 @@
</stages> </stages>
</ThoughtDef> </ThoughtDef>
<ThoughtDef> <ThoughtDef>
<defName>Lactating_Essential_Social</defName> <defName>Lactating_Essential_Social</defName>
<thoughtClass>Thought_SituationalSocial</thoughtClass> <thoughtClass>Thought_SituationalSocial</thoughtClass>
@ -86,36 +88,62 @@
</li> </li>
<li> <li>
<label>not producing milk (moderate expectations)</label> <label>not producing milk (moderate expectations)</label>
<baseOpinionOffset>-20</baseOpinionOffset> <baseOpinionOffset>-10</baseOpinionOffset>
</li> </li>
<li> <li>
<label>not producing milk (high expectations)</label> <label>not producing milk (high expectations)</label>
<baseOpinionOffset>-40</baseOpinionOffset> <baseOpinionOffset>-15</baseOpinionOffset>
</li> </li>
</stages> </stages>
</ThoughtDef> </ThoughtDef>
<ThoughtDef> <ThoughtDef>
<defName>DrankMilkRawReligion</defName> <defName>DrankMilkRaw_Essential</defName>
<durationDays>1</durationDays> <durationDays>1</durationDays>
<stages> <stages>
<li> <li>
<label>Drank Humanoid Milk Ideology</label> <label>Drank human milk</label>
<description>The taste of breast milk from humans is a taste of the gods!</description> <description>The taste of fresh breast milk is sweet, fulfilling, and intimate.</description>
<baseMoodEffect>10</baseMoodEffect> <baseMoodEffect>6</baseMoodEffect>
</li> </li>
</stages> </stages>
</ThoughtDef> </ThoughtDef>
<ThoughtDef> <ThoughtDef>
<defName>DrankMilkMealReligion</defName> <defName>DrankMilkMeal_Essential</defName>
<durationDays>1</durationDays> <durationDays>1</durationDays>
<stages> <stages>
<li> <li>
<label>Humanoid Milk Meal Ideology</label> <label>Ate meal with human milk</label>
<description>Human breast milk with a meal is just the best!</description> <description>The breast milk accentuated my meal beautifully.</description>
<baseMoodEffect>20</baseMoodEffect> <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> </li>
</stages> </stages>
</ThoughtDef> </ThoughtDef>

View File

@ -23,10 +23,14 @@ namespace CRIALactation
[HarmonyPatch(typeof(FoodUtility), "ThoughtsFromIngesting")] [HarmonyPatch(typeof(FoodUtility), "ThoughtsFromIngesting")]
public static void Postfix(ref List<FoodUtility.ThoughtFromIngesting> __result, ref List<FoodUtility.ThoughtFromIngesting> ___ingestThoughts, Pawn ingester, Thing foodSource, ThingDef foodDef) 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) if (ingester.Ideo != null)
{ {
CompIngredients ingredients = foodSource.TryGetComp<CompIngredients>();
if (foodDef == ThingDefOf_Milk.HumanMilk || foodDef == ThingDefOf_Milk.HumanoidMilk) if (foodDef == ThingDefOf_Milk.HumanMilk || foodDef == ThingDefOf_Milk.HumanoidMilk)
{ {
AddThoughtsFromIdeo_Patch(HistoryEventDefOf_Milk.DrankMilkRaw, ingester, foodDef, FoodUtility.GetMeatSourceCategory(foodDef)); AddThoughtsFromIdeo_Patch(HistoryEventDefOf_Milk.DrankMilkRaw, ingester, foodDef, FoodUtility.GetMeatSourceCategory(foodDef));
@ -34,6 +38,11 @@ namespace CRIALactation
__result = ___ingestThoughts; __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 DrankMilkRaw;
public static HistoryEventDef DrankMilkMeal; public static HistoryEventDef DrankMilkMeal;
public static HistoryEventDef DrankNonMilkMeal;
} }
} }