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)); }
public static Toil StageEnded(Pawn pawn) { return(new Toil() { initAction = (Action)(() => ActivityUtility.TrySendStageEndedSignal(pawn)) }); }
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); } }); }
private static void Postfix(Pawn __instance) { ActivityUtility.Notify_ColonistUnavailable(__instance); }