static bool HasJobOnThingPostfix(bool __result, WorkGiver_DeepDrill __instance, Pawn pawn, Thing t, bool forced)
 {
     Building building = t as Building;
     if (building != null && pawn != null && building.Faction.IsPlayer)
     {
         if (pawn.IsPrisonerOfColony)
         {
             return pawn.CanReserve(building, 1, -1, null, forced);
         }
         else if (pawn.Faction.IsPlayer)
         {
             return __result && !PrisonLaborUtility.IsDisabledByLabor(building.Position, pawn, __instance.def.workType);
         }                
     }
     return __result;
 }
Esempio n. 2
0
 public static Predicate <Thing> CreatePredicate(Pawn pawn, WorkGiver_Scanner scanner)
 {
     return(t => !t.IsForbidden(pawn) &&
            scanner.HasJobOnThing(pawn, t, false) &&
            !PrisonLaborUtility.IsDisabledByLabor(t.Position, pawn, scanner.def.workType));
 }
Esempio n. 3
0
 public static IEnumerable <IntVec3> RemoveFromListForbiddenCells(IEnumerable <IntVec3> list, Pawn pawn, WorkTypeDef workType)
 {
     return(list.Where(i => !PrisonLaborUtility.IsDisabledByLabor(i, pawn, workType)));
 }
Esempio n. 4
0
        public static Job postfix_Job(Job __result, Pawn pawn, Thing t, bool forced)
        {
            WorkTypeDef workDef = DefDatabase <WorkTypeDef> .GetNamed("QuarryMining");

            if (__result != null && !pawn.IsPrisonerOfColony && pawn.Faction != null && pawn.Faction.IsPlayer && PrisonLaborUtility.IsDisabledByLabor(__result.targetA.Cell, pawn, workDef))
            {
                return(null);
            }
            return(__result);
        }