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);
                }
            }
Exemple #2
0
            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);
                }
            }