Ejemplo n.º 1
0
 static bool Prefix(LordToil_PrepareCaravan_Leave __instance)
 {
     if (Find.TickManager.TicksGame % 100 > RefcellRespeedConfig.currentTimeMultiplier - 1)
     {
         return(false);
     }
     GatherAnimalsAndSlavesForCaravanUtility.CheckArrived(
         __instance.lord, __instance.lord.ownedPawns, __instance.exitSpot, "ReadyToExitMap", (Predicate <Pawn>)(x => true));
     return(false);
 }
 public void CheckGathered(Lord lord, string memo, Predicate <Pawn> shouldCheck, bool validateFollow)
 {
     // this checks if all pawns have been gathered. It is analogous to GatherAnimalsAndSlavesForCaravanUtility.CheckGathered
     // except that it keeps track of pawns that have reached their destination and keeps counting them as gathered
     // even if they wander off to get food.
     for (int i = 0; i < lord.ownedPawns.Count; i++)
     {
         Pawn pawn = lord.ownedPawns[i];
         if (shouldCheck(pawn) &&
             (!validateFollow || GatherAnimalsAndSlavesForCaravanUtility.IsFollowingAnyone(pawn)) &&
             pawn.Spawned &&
             pawn.Position.InHorDistOf(meetingPoint, 10f) &&
             pawn.CanReach(meetingPoint, PathEndMode.ClosestTouch, Danger.Deadly))
         {
             SetGathered(pawn);
         }
     }
     if (AllGathered(lord.ownedPawns, shouldCheck))
     {
         lord.ReceiveMemo(memo);
     }
 }