public static List <ThoughtDef> ThoughtsFromIngesting(Pawn ingester, Thing foodSource, ThingDef foodDef) { FoodUtility.ingestThoughts.Clear(); if (ingester.needs != null && ingester.needs.mood != null) { if (!ingester.story.traits.HasTrait(TraitDefOf.Ascetic) && foodDef.ingestible.tasteThought != null) { FoodUtility.ingestThoughts.Add(foodDef.ingestible.tasteThought); } CompIngredients compIngredients = foodSource.TryGetComp <CompIngredients>(); Building_NutrientPasteDispenser building_NutrientPasteDispenser = foodSource as Building_NutrientPasteDispenser; if (FoodUtility.IsHumanlikeMeat(foodDef) && ingester.RaceProps.Humanlike) { FoodUtility.ingestThoughts.Add((!ingester.story.traits.HasTrait(TraitDefOf.Cannibal)) ? ThoughtDefOf.AteHumanlikeMeatDirect : ThoughtDefOf.AteHumanlikeMeatDirectCannibal); } else if (compIngredients != null) { for (int i = 0; i < compIngredients.ingredients.Count; i++) { FoodUtility.AddIngestThoughtsFromIngredient(compIngredients.ingredients[i], ingester, FoodUtility.ingestThoughts); } } else if (building_NutrientPasteDispenser != null) { Thing thing = building_NutrientPasteDispenser.FindFeedInAnyHopper(); if (thing != null) { FoodUtility.AddIngestThoughtsFromIngredient(thing.def, ingester, FoodUtility.ingestThoughts); } } if (foodDef.ingestible.specialThoughtDirect != null) { FoodUtility.ingestThoughts.Add(foodDef.ingestible.specialThoughtDirect); } if (foodSource.IsNotFresh()) { FoodUtility.ingestThoughts.Add(ThoughtDefOf.AteRottenFood); } return(FoodUtility.ingestThoughts); } return(FoodUtility.ingestThoughts); }