mirror of
https://gitgud.io/c0ffeeeeeeee/coffees-rjw-ideology-addons.git
synced 2024-08-14 23:57:38 +00:00
Milk drink thoughts
This commit is contained in:
parent
a5d5cc1d44
commit
f30f494c3d
7 changed files with 150 additions and 3 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue