Example #1
0
        protected override string GetTextFor(Pawn pawn)
        {
            Need_Motivation motivation = pawn.needs.TryGetNeed <Need_Motivation>();

            if (motivation != null)
            {
                int value = (int)(motivation.CurLevelPercentage * 100f);
                return($"{value} %");
            }
            return("");
        }
 static FoodRestriction Postfix(FoodRestriction __result, Pawn_FoodRestrictionTracker __instance, Pawn getter)
 {
     if (__result == null && __instance.pawn.IsPrisonerOfColony && !__instance.pawn.InMentalState)
     {
         Need_Motivation motivation = __instance.pawn.needs.TryGetNeed <Need_Motivation>();
         if (motivation != null && (motivation.CurLevel > 0.7 || __instance.pawn.IsWatched()))
         {
             return(__instance.CurrentFoodRestriction);
         }
     }
     return(__result);
 }
Example #3
0
        public static bool IsReadyToEscape(Pawn pawn)
        {
            Need_Motivation need = pawn.needs.TryGetNeed <Need_Motivation>();

            if (need != null && !need.ReadyToRun)
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }