// Token: 0x0600002F RID: 47 RVA: 0x00002B5C File Offset: 0x00000D5C protected override Job TryGiveJob(Pawn pawn) { PawnDuty duty = pawn.mindState.duty; bool flag = duty == null; Job result; if (flag) { result = null; } else { IntVec3 cell; bool flag2 = !SpectatorCellFinder.TryFindSpectatorCellFor(pawn, duty.spectateRect, pawn.Map, out cell, duty.spectateRectAllowedSides, 1, null); if (flag2) { result = null; } else { IntVec3 centerCell = duty.spectateRect.CenterCell; Building edifice = cell.GetEdifice(pawn.Map); bool flag3 = edifice != null && edifice.def.category == ThingCategory.Building && edifice.def.building.isSittable && pawn.CanReserve(edifice, 1, -1, null, false); if (flag3) { result = new Job(JobDefOfArena.SpectateFightingMatch, edifice, centerCell); } else { result = new Job(JobDefOfArena.SpectateFightingMatch, cell, centerCell); } } } return(result); }
public override float VoluntaryJoinPriorityFor(Pawn p) { if (IsAborted()) { return(0f); } if (p == organizer) { return(100f); } if (IsGuest(p)) { if (!lord.ownedPawns.Contains(p)) { // 끝나가는 중에는 참여 불가 if (triggerProgress.TicksLeft < 300) { return(0f); } if (!SpectatorCellFinder.TryFindSpectatorCellFor(p, spectatorRect, Map, out IntVec3 _, SpectateRectSide.All)) { return(0f); } return(p.story.traits.HasTrait(RatkinTraitDefOf.Faith) ? 100f : VoluntarilyJoinableLordJobJoinPriorities.SocialGathering); } } return(0f); }
// Token: 0x06000833 RID: 2099 RVA: 0x00043630 File Offset: 0x00041A30 public override void Init() { base.Init(); this.Data.spectateRect = this.CalculateSpectateRect(); SpectateRectSide allowedSides = SpectateRectSide.All; if (this.Data.spectateRect.Width > this.Data.spectateRect.Height) { allowedSides = SpectateRectSide.Vertical; } else if (this.Data.spectateRect.Height > this.Data.spectateRect.Width) { allowedSides = SpectateRectSide.Horizontal; } this.Data.spectateRectAllowedSides = SpectatorCellFinder.FindSingleBestSide(this.Data.spectateRect, base.Map, allowedSides, 1); }
protected override Job TryGiveJob(Pawn pawn) { PawnDuty duty = pawn.mindState.duty; if (duty == null) { return(null); } if ((duty.spectateRectPreferredSide == SpectateRectSide.None || !SpectatorCellFinder.TryFindSpectatorCellFor(pawn, duty.spectateRect, pawn.Map, out IntVec3 cell, duty.spectateRectPreferredSide)) && !SpectatorCellFinder.TryFindSpectatorCellFor(pawn, duty.spectateRect, pawn.Map, out cell, duty.spectateRectAllowedSides)) { return(null); } IntVec3 centerCell = duty.spectateRect.CenterCell; Building edifice = cell.GetEdifice(pawn.Map); if (edifice != null && edifice.def.category == ThingCategory.Building && edifice.def.building.isSittable && pawn.CanReserve(edifice)) { return(JobMaker.MakeJob(RatkinJobDefOf.RK_Job_SpectatePray, edifice, centerCell)); } return(JobMaker.MakeJob(RatkinJobDefOf.RK_Job_SpectatePray, cell, centerCell)); }
private static void FlashSpectatorsCells() { Action <bool> act = delegate(bool bestSideOnly) { DebugTool tool = null; IntVec3 firstCorner = default(IntVec3); tool = new DebugTool("first watch rect corner...", delegate { firstCorner = UI.MouseCell(); DebugTools.curTool = new DebugTool("second watch rect corner...", delegate { IntVec3 second = UI.MouseCell(); CellRect spectateRect = CellRect.FromLimits(firstCorner, second).ClipInsideMap(Find.CurrentMap); SpectateRectSide allowedSides = SpectateRectSide.All; if (bestSideOnly) { allowedSides = SpectatorCellFinder.FindSingleBestSide(spectateRect, Find.CurrentMap); } SpectatorCellFinder.DebugFlashPotentialSpectatorCells(spectateRect, Find.CurrentMap, allowedSides); DebugTools.curTool = tool; }, firstCorner); }); DebugTools.curTool = tool; }; List <DebugMenuOption> list = new List <DebugMenuOption>(); list.Add(new DebugMenuOption("All sides", DebugMenuOptionMode.Action, delegate { act(obj: false); })); list.Add(new DebugMenuOption("Best side only", DebugMenuOptionMode.Action, delegate { act(obj: true); })); Find.WindowStack.Add(new Dialog_DebugOptionListLister(list)); }