コード例 #1
0
        public Job GetSpectateJob(Pawn pawn)
        {
            if (activityCurrentStage >= data.ActivityJobs.Count())
            {
                return(null);
            }

            PawnDuty duty = pawn.mindState.duty;

            if (duty == null)
            {
                return((Job)null);
            }

            IntVec3 cell;

            ActivityUtility.TrySendStageEndedSignal(pawn);

            if (pawn == data.Organizer)
            {
                Job job = new Job(JobDefOf.SpectateCeremony, (LocalTargetInfo)data.Facility.Position);
                OrganizerReserve(pawn, job);
            }

            if (!WatchBuildingUtility.TryFindBestWatchCell(data.Facility, pawn, true, out IntVec3 result, out Building chair))
            {
                WatchBuildingUtility.TryFindBestWatchCell(data.Facility, pawn, false, out result, out chair);
            }
            return(new Job(JobDefOf.SpectateCeremony, (LocalTargetInfo)result, (LocalTargetInfo)data.Facility));
        }
コード例 #2
0
 public static Toil StageEnded(Pawn pawn)
 {
     return(new Toil()
     {
         initAction = (Action)(() => ActivityUtility.TrySendStageEndedSignal(pawn))
     });
 }
コード例 #3
0
 private Toil StartActivity()
 {
     return(new Toil()
     {
         initAction = delegate
         {
             Religion religion = TargetFacility.AssignedReligion;
             Pawn organizer = pawn;
             List <LocalTargetInfo> targets = new List <LocalTargetInfo>();
             if (job.placedThings != null)
             {
                 foreach (ThingCountClass tcc in job.placedThings)
                 {
                     targets.Add(tcc.thing);
                 }
             }
             ActivityUtility.StartActivity(religion, organizer, ((ActivityJob)job).activityTask, targets);
         }
     });
 }
コード例 #4
0
 private static void Postfix(Pawn __instance)
 {
     ActivityUtility.Notify_ColonistUnavailable(__instance);
 }