示例#1
0
        // 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);
        }
示例#2
0
        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);
        }
        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));
        }