コード例 #1
0
ファイル: RummageEx.cs プロジェクト: yakoder/NRaas
        protected new void JournalismRummage(Sim rummager, IOutdoorAcceptsGarbage can)
        {
            Journalism job = OmniCareer.Career <Journalism>(rummager.Occupation);

            Common.DebugNotify("RummageEx:JournalismRummage");

            List <SimDescription> choices = new List <SimDescription>();

            foreach (SimDescription sim in Households.Humans(can.LotCurrent.Household))
            {
                if (sim.YoungAdultOrAbove && !job.SimsTrashScoped.Contains(sim))
                {
                    choices.Add(sim);
                }
            }
            if (choices.Count != 0x0)
            {
                SimDescription choice = RandomUtil.GetRandomObjectFromList(choices);

                Common.DebugNotify("JournalismRummage: " + choice.FullName);

                job.SimsTrashScoped.Add(choice);
                rummager.ShowTNSIfSelectable(Common.LocalizeEAString(rummager.IsFemale, "Gameplay/Objects/Miscellaneous/TrashcanOutside:RummageForInfo" + RandomUtil.GetInt(0x1, 0x3), new object[] { rummager, choice }), StyledNotification.NotificationStyle.kGameMessagePositive, ObjectGuid.InvalidObjectGuid, rummager.ObjectId);
            }
        }
コード例 #2
0
        protected override bool PrivateUpdate(ScenarioFrame frame)
        {
            Computer computer = ManagerLot.GetUsableComputer(Sim);

            if (computer == null)
            {
                IncStat("No Computer");
                return(false);
            }

            Career occupation = Sim.Occupation as Career;

            if (!occupation.CanWriteReport())
            {
                if (Sim.Occupation is LawEnforcement)
                {
                    LawEnforcement career = Sim.Occupation as LawEnforcement;

                    if (!career.CanInterview())
                    {
                        IncStat("Police Level Fail");
                        return(false);
                    }

                    foreach (SimDescription sim in Sims.Adults)
                    {
                        if (career.HasSimBeenInterviewed(sim))
                        {
                            continue;
                        }

                        career.SimInterviewed(sim);
                        break;
                    }
                }
                else if (Sim.Occupation is Journalism)
                {
                    Journalism career = Sim.Occupation as Journalism;

                    if (!career.CanInterview())
                    {
                        IncStat("Journalism Level Fail");
                        return(false);
                    }

                    foreach (SimDescription sim in Sims.Adults)
                    {
                        if (career.HasSimBeenInterviewed(sim))
                        {
                            continue;
                        }

                        career.SimInterviewed(sim);
                        break;
                    }
                }
            }

            return(Situations.PushInteraction <Computer>(this, Sim, computer, Computer.WriteReport.Singleton));
        }
コード例 #3
0
        public override bool Run()
        {
            StandardEntry();
            if (!Target.StartComputing(this, SurfaceHeight.Table, true))
            {
                StandardExit();
                return(false);
            }
            Target.StartVideo(Computer.VideoType.WordProcessor);
            BeginCommodityUpdates();

            bool succeeded = false;

            try
            {
                Definition interactionDefinition = InteractionDefinition as Definition;

                mJob = Actor.OccupationAsCareer;

                if (interactionDefinition.Scrap)
                {
                    AnimateSim("WorkTyping");
                    string name = (OmniCareer.Career <Journalism>(mJob) != null) ? "ScrapStoryWarning" : "ScrapReportWarning";
                    if (AcceptCancelDialog.Show(Computer.LocalizeString(name, new object[] { mJob.GetCurrentReportSubject() })))
                    {
                        base.AnimateSim("WorkTyping");
                        mJob.SetReportSubject(null);
                    }
                    EndCommodityUpdates(true);
                    Target.StopComputing(this, Computer.StopComputingAction.TurnOff, false);
                    StandardExit();
                    return(true);
                }
                if (!interactionDefinition.IsContinuing)
                {
                    Sim selectedObject = base.GetSelectedObject() as Sim;
                    mJob.SetReportSubject(selectedObject.SimDescription);
                    Journalism job = OmniCareer.Career <Journalism>(mJob);
                    if (job != null)
                    {
                        job.IsStoryNegative = interactionDefinition.IsNegativeReport;
                    }
                }
                ProgressMeter.ShowProgressMeter(Actor, mJob.GetCurrentReportCompletion() / 100f, ProgressMeter.GlowType.Weak);
                AnimateSim("WorkTyping");
                succeeded = DoLoop(~(ExitReason.Replan | ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached), new Interaction <Sim, Computer> .InsideLoopFunction(LoopDel), null, 1f);
                ProgressMeter.HideProgressMeter(Actor, succeeded);
            }
            finally
            {
                EndCommodityUpdates(succeeded);
            }

            Target.StopComputing(this, Computer.StopComputingAction.TurnOff, false);
            StandardExit();
            return(succeeded);
        }
コード例 #4
0
        public new void LoopDel(StateMachineClient smc, Interaction <Sim, Computer> .LoopData loopData)
        {
            Journalism job = OmniCareer.Career <Journalism>(Actor.Occupation);

            Definition def = InteractionDefinition as Definition;

            if (job.UpdateReview(def.Review))
            {
                Actor.AddExitReason(ExitReason.Finished);
            }
        }
コード例 #5
0
        public override bool InRabbitHole()
        {
            try
            {
                SetMovieGenre();

                if (Actor.IsSelectable)
                {
                    Target.PlayMovieGenreMusic(mMovieGenre);
                }

                Journalism journalism = OmniCareer.Career <Journalism>(Actor.Occupation);

                bool isReviewing = false;
                if (journalism != null)
                {
                    isReviewing = journalism.CanReviewRabbitHole(Target);
                }

                if (!InRabbitholePreLoop(isReviewing))
                {
                    return(false);
                }

                StartStages();
                BeginCommodityUpdates();
                bool succeeded = DoLoop(~(ExitReason.Replan | ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached));
                EndCommodityUpdates(succeeded);
                if (succeeded)
                {
                    Target.PostAttendShow(Actor);
                    if (isReviewing)
                    {
                        journalism.RabbitHolesReviewed.Add(new Journalism.ReviewedRabbitHole(Target, Target.ShowType));
                    }
                }

                ShowVenue.ApplyMovieBuff(mMovieGenre, Actor);
                return(succeeded);
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(Actor, Target, e);
                return(false);
            }
        }
コード例 #6
0
            // Methods
            public override string GetInteractionName(Sim a, Stadium target, InteractionObjectPair interaction)
            {
                Journalism job = OmniCareer.Career <Journalism>(a.Occupation);

                if ((job != null) && job.CanReviewRabbitHole(target))
                {
                    return(LocalizeString(a.SimDescription, "ReviewGame", new object[0x0]));
                }
                if (FamilyMemberOfSportsPlayer(a, false) == null)
                {
                    return(LocalizeString(a.SimDescription, "InteractionName", new object[] { Stadium.AttendGame.kCostToAttendGame }));
                }
                return(LocalizeString(a.SimDescription, "FreeInteractionName", new object[0x0]));
            }
コード例 #7
0
        public override float FindMetricValue(Career career)
        {
            Journalism journalism = OmniCareer.Career <Journalism>(career);
            int        num        = 0x0;

            if (journalism != null)
            {
                for (int i = 0x0; i < Journalism.kWindowForRememberingStories; i++)
                {
                    num += journalism.mStoriesWrittenPastNDays[i];
                }
                num += journalism.StoriesWrittenToday;
            }
            return((float)num);
        }
コード例 #8
0
        public static bool CanReviewRabbitHole(Sim sim, RabbitHole rabbitHole)
        {
            Journalism journalism = OmniCareer.Career <Journalism>(sim.Occupation);

            if (!OmniCareer.HasMetric <MetricStoriesAndReviews>(sim.Occupation))
            {
                return(false);
            }
            foreach (Journalism.ReviewedRabbitHole hole in journalism.RabbitHolesReviewed)
            {
                if (hole.EventLocation == rabbitHole)
                {
                    return(false);
                }
            }
            return(true);
        }
コード例 #9
0
            public override bool Test(Sim a, ShowVenue target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                if (!(a.Occupation is OmniCareer))
                {
                    return(false);
                }

                if ((!isAutonomous || !a.IsSelectable) || (AutonomyRestrictions.GetLevel() >= AutonomyLevel.Max))
                {
                    if (a.IsInGroupingSituation())
                    {
                        return(false);
                    }

                    Journalism journalism = OmniCareer.Career <Journalism>(a.Occupation);

                    int num = CalculateShowPriceEx(a, target);
                    if (((target.ShowType != ShowVenue.ShowTypes.kNoShow) && target.DoorsOpen) && ((a.FamilyFunds >= num) && ((journalism == null) || !journalism.BadReviewWrittenOnRabbitHole(target))))
                    {
                        return(true);
                    }

                    greyedOutTooltipCallback = delegate
                    {
                        if ((journalism != null) && journalism.BadReviewWrittenOnRabbitHole(target))
                        {
                            return(LocalizeString("NotWelcomeFromBadReview", new object[0x0]));
                        }

                        if (target.ShowType != ShowVenue.ShowTypes.kNoShow)
                        {
                            if (target.DoorsOpen)
                            {
                                return(LocalizeString("InsufficientFunds", new object[0x0]));
                            }
                            if (target.ShowInProgress)
                            {
                                return(LocalizeString("DoorsClosed", new object[0x0]));
                            }
                        }
                        return(ShowVenue.AttendShow.LocalizeString(target.NoShowTooltip, new object[0]));
                    };
                }
                return(false);
            }
コード例 #10
0
            public override void AddInteractions(InteractionObjectPair iop, Sim actor, Computer target, List <InteractionObjectPair> results)
            {
                Journalism job = OmniCareer.Career <Journalism>(actor.Occupation);

                if ((target.IsComputerUsable(actor, true, false, false) && (job != null)) && job.CanWriteReview())
                {
                    foreach (Journalism.ReviewedRabbitHole hole in job.RabbitHolesReviewed)
                    {
                        if ((hole.ReviewCompletion == 0f) || ((hole.ReviewCompletion < 100f) && !hole.IsReviewNegative))
                        {
                            string[] path = new string[] { Computer.LocalizeString("Writing", new object[0x0]), Computer.LocalizeString("GoodReview", new object[0x0]) };
                            results.Add(new InteractionObjectPair(new Definition(job.GetLocalizedEventName(hole.EventWatched), path, hole, false), iop.Target));
                        }

                        if ((hole.ReviewCompletion == 0f) || ((hole.ReviewCompletion < 100f) && hole.IsReviewNegative))
                        {
                            string[] strArray2 = new string[] { Computer.LocalizeString("Writing", new object[0x0]), Computer.LocalizeString("BadReview", new object[0x0]) };
                            results.Add(new InteractionObjectPair(new Definition(job.GetLocalizedEventName(hole.EventWatched), strArray2, hole, true), iop.Target));
                        }
                    }
                }
            }
コード例 #11
0
            public override void AddInteractions(InteractionObjectPair iop, Sim actor, Computer target, List <InteractionObjectPair> results)
            {
                Journalism     journalism  = OmniCareer.Career <Journalism>(actor.Occupation);
                LawEnforcement enforcement = OmniCareer.Career <LawEnforcement>(actor.Occupation);

                if (journalism != null)
                {
                    if (journalism.StorySubject != null)
                    {
                        results.Add(new InteractionObjectPair(new Definition(Computer.LocalizeString("ContinueStory", new object[] { journalism.StorySubject }), Computer.LocalizeString("Writing", new object[0x0]), true, true, false), iop.Target));
                        results.Add(new InteractionObjectPair(new Definition(Computer.LocalizeString("ScrapStory", new object[] { journalism.StorySubject }), Computer.LocalizeString("Writing", new object[0x0]), true, false, true), iop.Target));
                    }
                    else
                    {
                        if (journalism.ValidNegativeReportSubjects().Count > 0x0)
                        {
                            results.Add(new InteractionObjectPair(new Definition(Computer.LocalizeString("NegativeNewsStory", new object[0x0]), Computer.LocalizeString("Writing", new object[0x0]), true, false, false), iop.Target));
                        }

                        if (journalism.ValidPositiveReportSubjects().Count > 0x0)
                        {
                            results.Add(new InteractionObjectPair(new Definition(Computer.LocalizeString("PositiveNewsStory", new object[0x0]), Computer.LocalizeString("Writing", new object[0x0]), false, false, false), iop.Target));
                        }
                    }
                }

                if ((enforcement != null) && (enforcement.ValidPositiveReportSubjects().Count > 0x0))
                {
                    if (enforcement.ReportSubject != null)
                    {
                        results.Add(new InteractionObjectPair(new Definition(Computer.LocalizeString("ContinueReport", new object[] { enforcement.ReportSubject }), Computer.LocalizeString("Writing", new object[0x0]), true, true, false), iop.Target));
                        results.Add(new InteractionObjectPair(new Definition(Computer.LocalizeString("ScrapReport", new object[] { enforcement.ReportSubject }), Computer.LocalizeString("Writing", new object[0x0]), true, false, true), iop.Target));
                    }
                    else
                    {
                        results.Add(new InteractionObjectPair(new Definition(Computer.LocalizeString("LawEnforcementReport", new object[0x0]), Computer.LocalizeString("Writing", new object[0x0]), false, false, false), iop.Target));
                    }
                }
            }
コード例 #12
0
            public override void AddInteractions(InteractionObjectPair iop, Sim actor, Restaurant target, List <InteractionObjectPair> results)
            {
                try
                {
                    int breakfastLunchBrunchCost = target.RestaurantTuning.BreakfastLunchBrunchCost;
                    if (Food.GetCurrentMealTime() == Recipe.MealTime.Dinner)
                    {
                        breakfastLunchBrunchCost = target.RestaurantTuning.DinnerCost;
                    }
                    int costForSim = target.GetCostForSim(actor, breakfastLunchBrunchCost);

                    Journalism job = OmniCareer.Career <Journalism>(actor.Occupation);
                    if ((job != null) && job.CanReviewRabbitHole(target))
                    {
                        Definition definition = new Definition(Restaurant.EatType.Review, EatHere.LocalizeString("ReviewRestaurant", new object[0x0]), new string[] { EatHere.LocalizeString("EatHere", new object[0x0]) }, 0x0, target);
                        results.Add(new InteractionObjectPair(definition, target));
                    }
                }
                catch (Exception e)
                {
                    Common.Exception(actor, target, e);
                }
            }
コード例 #13
0
ファイル: RummageEx.cs プロジェクト: yakoder/NRaas
        public new void LoopDel(StateMachineClient smc, Interaction <Sim, IOutdoorAcceptsGarbage> .LoopData loopData)
        {
            int mLifeTime = (int)loopData.mLifeTime;

            if (Autonomous)
            {
                if (mLifeTime >= (TrashcanOutside.kRevealItemEveryXMinutes * TrashcanOutside.kRummageMaxItems))
                {
                    Actor.AddExitReason(ExitReason.Finished);
                }
            }
            else if ((mLifeTime % base.Target.RevealItemEveryXMinutes) == 0)
            {
                Target.GiveObject(mNetWorth, Actor);
                mNumItemsFound++;
                if (mNumItemsFound >= TrashcanOutside.kRummageMaxItems)
                {
                    Actor.AddExitReason(ExitReason.Finished);
                    if ((Target.LotCurrent != Actor.LotHome) && (Target.LotCurrent.Household != null))
                    {
                        Journalism     journalism = OmniCareer.Career <Journalism>(Actor.Occupation);
                        LawEnforcement law        = OmniCareer.Career <LawEnforcement>(Actor.Occupation);

                        Common.DebugNotify("RummageEx:LoopDel");

                        if ((journalism != null) && Actor.Occupation.CanInterview())
                        {
                            JournalismRummage(Actor, Target);
                        }
                        else if ((law != null) && Actor.Occupation.CanInterview())
                        {
                            LawEnforcementRummage(Actor, Target);
                        }
                    }
                }
            }
        }
コード例 #14
0
        public override bool InRabbitHole()
        {
            try
            {
                Journalism job = OmniCareer.Career <Journalism>(Actor.Occupation);

                bool flag = (job != null) && job.CanReviewRabbitHole(Target);
                if (!flag)
                {
                    Sim sim = FamilyMemberOfSportsPlayer(Actor, false);
                    if (sim != null)
                    {
                        if (base.Actor == sim)
                        {
                            SimpleMessageDialog.Show(LocalizeString(Actor.SimDescription, "FreeGameTitle", new object[0x0]), LocalizeString(sim.SimDescription, "FreeGameForSportsPlayer", new object[] { sim }));
                        }
                        else
                        {
                            SimpleMessageDialog.Show(LocalizeString(Actor.SimDescription, "FreeGameTitle", new object[0x0]), LocalizeString(sim.SimDescription, "FreeGame", new object[] { base.Actor, sim }));
                        }
                    }
                    else
                    {
                        if (Actor.FamilyFunds < Stadium.AttendGame.kCostToAttendGame)
                        {
                            return(false);
                        }
                        Actor.ModifyFunds(-(int)Stadium.AttendGame.kCostToAttendGame);
                    }
                }
                ConfigureInteraction();
                StartStages();
                BeginCommodityUpdates();

                bool succeeded = false;

                try
                {
                    succeeded = DoLoop(~(ExitReason.Replan | ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached), new Interaction <Sim, Stadium> .InsideLoopFunction(WatchGameLoop), null);
                }
                finally
                {
                    EndCommodityUpdates(succeeded);
                }

                if (succeeded)
                {
                    EventTracker.SendEvent(new AttendedShowEvent(ShowVenue.ShowTypes.kStadiumGame, Actor));
                    EventTracker.SendEvent(EventTypeId.kWatchedStadiumGame, Actor, Target);
                    ChildUtils.AddBuffToParentAndChild(Actor, BuffNames.SawGreatGame, (Origin)(0x8bfc0021188986e0L));
                    if (flag)
                    {
                        job.RabbitHolesReviewed.Add(new Journalism.ReviewedRabbitHole(Target, ShowVenue.ShowTypes.kStadiumGame));
                    }
                }
                return(succeeded);
            }
            catch (Exception e)
            {
                Common.Exception(Actor, Target, e);
                return(false);
            }
        }
コード例 #15
0
            public override bool Test(Sim a, Stadium target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                if (!(a.Occupation is OmniCareer))
                {
                    if (FamilyMemberOfSportsPlayer(a, true) == null)
                    {
                        return(false);
                    }
                }

                GreyedOutTooltipCallback callback = null;

                if ((!isAutonomous || !a.IsSelectable) || (AutonomyRestrictions.GetLevel() >= AutonomyLevel.Max))
                {
                    ProSports job = OmniCareer.Career <ProSports>(a.Occupation);
                    if (((job != null) && job.HasWinLossRecordMetric()) && !job.IsDayOff)
                    {
                        return(false);
                    }
                    bool hasMoney = FamilyMemberOfSportsPlayer(a, false) != null;
                    if (!hasMoney)
                    {
                        hasMoney = a.FamilyFunds >= Stadium.AttendGame.kCostToAttendGame;
                    }
                    if (target.mGameForced)
                    {
                        return(true);
                    }

                    Journalism journalism = OmniCareer.Career <Journalism>(a.Occupation);

                    if ((ProSports.IsTodayGameDay() && SimClock.IsTimeBetweenTimes(SimClock.HoursPassedOfDay, ProSports.GameStartTime - Stadium.AttendGame.kDoorsOpenTime, ProSports.GameStartTime + Stadium.AttendGame.kDoorsCloseTime)) && (hasMoney && ((journalism == null) || !journalism.BadReviewWrittenOnRabbitHole(target))))
                    {
                        return(true);
                    }
                    if (callback == null)
                    {
                        callback = delegate
                        {
                            if ((journalism != null) && journalism.BadReviewWrittenOnRabbitHole(target))
                            {
                                return(LocalizeString(a.SimDescription, "NotWelcomeFromBadReview", new object[0x0]));
                            }
                            if (!ProSports.IsTodayGameDay() || !SimClock.IsTimeBetweenTimes(SimClock.HoursPassedOfDay, ProSports.GameStartTime, ProSports.GameEndTime))
                            {
                                int num = ProSports.DaysUntilNextGame();
                                if (num == 0x0)
                                {
                                    return(LocalizeString(a.SimDescription, "DoorsOpenTodayTooltip", new object[] { SimClockUtils.GetText(ProSports.GameStartTime) }));
                                }
                                return(LocalizeString(a.SimDescription, "DoorsOpenLaterTooltip", new object[] { num, SimClockUtils.GetText(ProSports.GameStartTime) }));
                            }
                            if (!hasMoney)
                            {
                                return(LocalizeString(a.SimDescription, "NeedMoneyTooltip", new object[0x0]));
                            }
                            return(LocalizeString(a.SimDescription, "DoorsClosedTooltip", new object[0x0]));
                        };
                    }
                    greyedOutTooltipCallback = callback;
                }
                return(false);
            }
コード例 #16
0
        public override bool ShouldAddTone(Career career)
        {
            try
            {
                if (!GameUtils.IsInstalled(mVersion))
                {
                    return(false);
                }

                if (!base.ShouldAddTone(career))
                {
                    return(false);
                }

                if (!string.IsNullOrEmpty(mBranch))
                {
                    if (career.CurLevelBranchName != mBranch)
                    {
                        return(false);
                    }
                }

                if (mMinLevel > career.CareerLevel)
                {
                    return(false);
                }

                if (mMaxLevel < career.CareerLevel)
                {
                    return(false);
                }

                if (career.OwnerDescription == null)
                {
                    return(false);
                }

                if (career.OwnerDescription.SkillManager == null)
                {
                    return(false);
                }

                if (mMetrics.Count > 0)
                {
                    foreach (MetricRate rate in mMetrics)
                    {
                        switch (rate.mMetric)
                        {
                        case MetricRate.MetricType.Reports:
                            LawEnforcement law = OmniCareer.Career <LawEnforcement>(career);
                            if (law != null)
                            {
                                if (!OmniCareer.HasMetric <LawEnforcement.MetricReportsWritten>(career))
                                {
                                    return(false);
                                }
                            }
                            break;

                        case MetricRate.MetricType.StoriesAndReviews:
                            Journalism journalism = OmniCareer.Career <Journalism>(career);
                            if (journalism != null)
                            {
                                if (!OmniCareer.HasMetric <Journalism.MetricStoriesAndReviews>(career))
                                {
                                    return(false);
                                }
                            }
                            break;
                        }
                    }
                }

                if (mSkills.Count > 0)
                {
                    bool needed = false;

                    foreach (SkillRate skill in mSkills)
                    {
                        if (mMustHaveVisibleSkill)
                        {
                            if (!career.OwnerDescription.SkillManager.IsPlayerVisible(skill.mSkill))
                            {
                                return(false);
                            }
                        }

                        if (skill.mSkill == SkillNames.Athletic)
                        {
                            if ((career.OwnerDescription.CreatedSim != null) &&
                                (career.OwnerDescription.CreatedSim.BuffManager != null) &&
                                (career.OwnerDescription.CreatedSim.BuffManager.HasElement(BuffNames.Fatigued)))
                            {
                                return(false);
                            }
                        }

                        if (mOnlyMetric)
                        {
                            bool found = false;
                            foreach (PerfMetric metric in career.CurLevel.Metrics)
                            {
                                MetricSkillX skillMetric = metric as MetricSkillX;
                                if (skillMetric == null)
                                {
                                    continue;
                                }

                                if (skillMetric.SkillGuid == skill.mSkill)
                                {
                                    found = true;
                                    break;
                                }
                            }

                            if (!found)
                            {
                                return(false);
                            }
                        }

                        Skill simSkill = career.OwnerDescription.SkillManager.GetSkill <Skill>(skill.mSkill);
                        if ((simSkill == null) || (simSkill.SkillLevel < simSkill.MaxSkillLevel))
                        {
                            needed = true;
                        }
                    }

                    if ((!needed) && (mOnlySkill))
                    {
                        return(false);
                    }
                }

                return(true);
            }
            catch (Exception exception)
            {
                Common.Exception(career.OwnerDescription, exception);
            }

            return(false);
        }
コード例 #17
0
        public override void OnTimePassed(InteractionInstance interactionInstance, float totalTime, float deltaTime)
        {
            try
            {
                foreach (MetricRate rate in mMetrics)
                {
                    float hoursElapsed = SimClock.ElapsedTime(TimeUnit.Hours) - rate.mStartTime;

                    if (hoursElapsed < rate.mHoursUntilChange)
                    {
                        continue;
                    }

                    rate.mStartTime = SimClock.ElapsedTime(TimeUnit.Hours);

                    switch (rate.mMetric)
                    {
                    case MetricRate.MetricType.ConcertsPerformed:
                        Music music = OmniCareer.Career <Music>(Career);
                        if (music != null)
                        {
                            music.ConcertsPerformed += rate.mRate;
                        }
                        break;

                    case MetricRate.MetricType.Journals:
                        OmniCareer journals = Career as OmniCareer;
                        if (journals != null)
                        {
                            journals.FinishedJournal();
                        }
                        break;

                    case MetricRate.MetricType.Recruitment:
                        OmniCareer recruit = Career as OmniCareer;
                        if (recruit != null)
                        {
                            recruit.AddToRecruits();
                        }
                        break;

                    case MetricRate.MetricType.Reports:
                        LawEnforcement law = OmniCareer.Career <LawEnforcement>(Career);
                        if (law != null)
                        {
                            law.ReportsCompltetedToday += rate.mRate;
                        }
                        break;

                    case MetricRate.MetricType.StoriesAndReviews:
                        Journalism journalism = OmniCareer.Career <Journalism>(Career);
                        if (journalism != null)
                        {
                            journalism.StoriesWrittenToday += rate.mRate;
                        }
                        break;

                    case MetricRate.MetricType.WinLossRecord:
                        ProSports proSports = OmniCareer.Career <ProSports>(Career);
                        if (proSports != null)
                        {
                            if (rate.mRate > 0)
                            {
                                proSports.mWinRecord += rate.mRate;
                                proSports.mTotalWins += rate.mRate;
                            }
                            else
                            {
                                proSports.mLossRecord -= rate.mRate;
                                proSports.mTotalLoss  -= rate.mRate;
                            }
                        }
                        break;

                    case MetricRate.MetricType.MeetingsHeld:
                        Business business = OmniCareer.Career <Business>(Career);
                        if (business != null)
                        {
                            business.MeetingsHeldToday += rate.mRate;
                        }
                        break;
                    }
                }
            }
            catch (Exception e)
            {
                Common.Exception(Career.OwnerDescription, e);
            }
        }
コード例 #18
0
            public override bool Test(Sim a, Computer target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                Journalism journalism = OmniCareer.Career <Journalism>(a.Occupation);

                return((target.IsComputerUsable(a, true, false, isAutonomous) && (journalism != null)) && journalism.CanWriteReview());
            }
コード例 #19
0
        protected new static string GetInteractionNameBase(Sim a, ShowVenue target)
        {
            Journalism journalism = OmniCareer.Career <Journalism>(a.Occupation);

            int num = CalculateShowPriceEx(a, target);

            switch (target.ShowType)
            {
            case ShowVenue.ShowTypes.kMovie:
                if ((journalism == null) || !CanReviewRabbitHole(a, target))
                {
                    if (num == 0)
                    {
                        return(LocalizeString(a.IsFemale, "AttendFreeMovie", new object[0]) + Localization.Ellipsis);
                    }
                    return(LocalizeString("AttendMovie", new object[] { num }) + Localization.Ellipsis);
                }
                return(LocalizeString(a.IsFemale, "ReviewMovie", new object[0]) + Localization.Ellipsis);

            case ShowVenue.ShowTypes.kPlay:
                if ((journalism == null) || !CanReviewRabbitHole(a, target))
                {
                    if (num == 0)
                    {
                        return(LocalizeString(a.IsFemale, "AttendFreePlayRandom", new object[] { LocalizeString(ShowVenue.kPlayNames[ShowVenue.sRandomPlay], new object[0]) }));
                    }
                    return(LocalizeString(a.IsFemale, "AttendPlayRandom", new object[] { LocalizeString(ShowVenue.kPlayNames[ShowVenue.sRandomPlay], new object[0]), num }));
                }
                return(LocalizeString("ReviewPlayRandom", new object[] { LocalizeString(ShowVenue.kPlayNames[ShowVenue.sRandomPlay], new object[0]) }));

            case ShowVenue.ShowTypes.kSymphony:
                if ((journalism == null) || !CanReviewRabbitHole(a, target))
                {
                    if (num == 0)
                    {
                        return(LocalizeString(a.IsFemale, "AttendFreeSymphonyRandom", new object[] { LocalizeString(ShowVenue.kSymphonyNames[ShowVenue.sRandomSymphony], new object[0]) }));
                    }
                    return(LocalizeString(a.IsFemale, "AttendSymphonyRandom", new object[] { LocalizeString(ShowVenue.kSymphonyNames[ShowVenue.sRandomSymphony], new object[0]), num }));
                }
                return(LocalizeString(a.IsFemale, "ReviewSymphonyRandom", new object[] { LocalizeString(ShowVenue.kSymphonyNames[ShowVenue.sRandomSymphony], new object[0]) }));

            case ShowVenue.ShowTypes.kConcert:
            case ShowVenue.ShowTypes.kPlayerConcert:
                if ((journalism == null) || !CanReviewRabbitHole(a, target))
                {
                    if (num == 0)
                    {
                        return(LocalizeString(a.IsFemale, "AttendFreeConcert", new object[0]));
                    }
                    return(LocalizeString(a.IsFemale, "AttendConcert", new object[] { num }));
                }
                return(LocalizeString(a.IsFemale, "ReviewConcert", new object[0]));

            case ShowVenue.ShowTypes.kEquestrianCenterRace:
                if (num != 0)
                {
                    return(LocalizeString(a.IsFemale, "AttendEquestrianCompetition", new object[] { num }));
                }
                return(LocalizeString(a.IsFemale, "AttendFreeEquestrianCompetition", new object[0]));
            }
            return(target.ShowTimeText());
        }
コード例 #20
0
 public Definition(string text, string[] path, Journalism.ReviewedRabbitHole review, bool isNegative)
     : base(text, path, review, isNegative)
 { }