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