static void Postfix(Thing __instance, float __result, Pawn ingester, float nutritionWanted) { if (ingester.RaceProps.Humanlike && __result > 0) { bool isHumanLike = false; if (__instance.def != null && __instance.def.IsIngestible) { isHumanLike = FoodUtility.IsHumanlikeCorpseOrHumanlikeMeatOrIngredient(__instance); } if (isHumanLike) { var progress = CanibalismProgression.For(ingester); progress.ProgressWithTrait(__result); } } }
static void Postfix(Thing __instance, float __result, Pawn ingester, float nutritionWanted) { if (__result > 0) { bool isHumanLike = false; if (FoodUtility.IsHumanlikeMeat(__instance.def)) { isHumanLike = true; } else { CompIngredients compIngredients = __instance.TryGetComp <CompIngredients>(); if (compIngredients != null) { foreach (var ing in compIngredients.ingredients) { if (FoodUtility.IsHumanlikeMeat(ing)) { isHumanLike = true; break; } } } } if (isHumanLike && ingester.RaceProps.Humanlike) { var progress = CanibalismProgression.For(ingester); if (!progress.Locked) { progress.Add(__result); progress.TryBecomeCannibal(); } } } }
static void Postfix(Pawn __instance) { CanibalismProgression.For(__instance).ExposeData(); ActionLog.For(__instance).ExposeData(); }