示例#1
0
文件: PlayGame.cs 项目: yakoder/NRaas
        // Methods
        public override bool BeforeEnteringRabbitHole()
        {
            ProSports job = OmniCareer.Career <ProSports>(Actor.Occupation);

            if (job == null)
            {
                return(false);
            }

            if (!job.IsAllowedToWork() && job.IsAllowedToWorkThisTime(ProSports.kGameStartTime, ProSports.kGameLength))
            {
                return(job.WaitForWork(Actor, Target));
            }
            return(true);
        }
示例#2
0
文件: PlayGame.cs 项目: yakoder/NRaas
            public override bool Test(Sim a, RabbitHole target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                GreyedOutTooltipCallback callback = null;

                if (!(a.Occupation is OmniCareer))
                {
                    return(false);
                }

                ProSports job = OmniCareer.Career <ProSports>(a.Occupation);

                RabbitHole hole = target;

                if (job != null)
                {
                    CareerLocation location;
                    if (!hole.CareerLocations.TryGetValue((ulong)job.Guid, out location) || (job.CareerLoc != location))
                    {
                        return(false);
                    }
                    bool flag = job.IsAllowedToWorkThisTime(ProSports.kGameStartTime, ProSports.kGameLength);
                    if (!job.SpecialWorkDay || !job.HasWinLossRecordMetric())
                    {
                        return(false);
                    }
                    if (flag && !job.IsDayOff)
                    {
                        return(true);
                    }
                    if (callback == null)
                    {
                        callback = delegate
                        {
                            int num = ProSports.DaysUntilNextGame();
                            if (num == 0)
                            {
                                return(PlayGame.LocalizeString(a.SimDescription, "GameGreyedTooltip", new object[] { SimClockUtils.GetText(ProSports.kGameStartTime) }));
                            }
                            return(PlayGame.LocalizeString(a.SimDescription, "GameGreyedTooltipFuture", new object[] { SimClockUtils.GetText(ProSports.kGameStartTime), num }));
                        };
                    }
                    greyedOutTooltipCallback = callback;
                }
                return(false);
            }