private static void GiveSapientAnimalsNeeds(Pawn_NeedsTracker __instance, Pawn ___pawn, NeedDef nd, ref bool __result) { if (nd == PMNeedDefOf.SapientAnimalControl) { __result = Need_Control.IsEnabledFor(___pawn); return; } bool isColonist = ___pawn.Faction?.IsPlayer == true; bool moodIsEnabled = MoodIsEnabled(___pawn); if (nd == PMNeedDefOf.Joy && isColonist) { __result = moodIsEnabled; } if (moodIsEnabled) { var defExt = GetSapientAnimalNeed(nd); if (defExt != null) { __result = !defExt.mustBeColonist || ___pawn.IsColonist; } } if (__result) { __result = nd.IsValidFor(___pawn); } }
static void GiveSapientAnimalsNeeds(Pawn_NeedsTracker __instance, Pawn ___pawn, NeedDef nd, ref bool __result) { if (__result) { __result = nd.IsValidFor(___pawn); return; } if (___pawn?.IsSapientOrFeralFormerHuman() != true) { return; } if (nd?.defName == "SapientAnimalControl") { __result = true; return; } var isColonist = ___pawn.Faction?.IsPlayer == true; if (nd.defName == "Mood") { __result = true; } else if (nd.defName == "Joy" && isColonist) { __result = true; } }
private static void GiveSapientAnimalsNeeds(Pawn_NeedsTracker __instance, Pawn ___pawn, NeedDef nd, ref bool __result) { if (nd == PMNeedDefOf.SapientAnimalControl) { __result = Need_Control.IsEnabledFor(___pawn); return; } bool isColonist = ___pawn.Faction?.IsPlayer == true; bool moodIsEnabled = MoodIsEnabled(___pawn); if (nd == PMNeedDefOf.Joy && isColonist) { __result = moodIsEnabled; } if (nd == PMNeedDefOf.Mood || nd == PMNeedDefOf.Comfort || nd == PMNeedDefOf.Beauty) { __result = moodIsEnabled; } if (__result) { __result = nd.IsValidFor(___pawn); } }