Example #1
0
            protected override ManagerStory.Story PrintFormattedStory(StoryProgressionObject manager, string text, string summaryKey, object[] parameters, string[] extended, ManagerStory.StoryLogging logging)
            {
                if (SimTypes.IsSelectable(Sim))
                {
                    return(null);
                }

                if (mOldLevel >= Sim.CelebrityLevel)
                {
                    return(null);
                }

                if ((Sim.CelebrityLevel <= 1) && (!GetValue <ShowFirstLevelOption, bool>()))
                {
                    IncStat("First Level Denied");
                    return(null);
                }

                CelebrityManager celebrityManager = Sim.CelebrityManager;

                CelebrityLevelStaticData currentLevelStaticData = celebrityManager.GetCurrentLevelStaticData();

                if (currentLevelStaticData != null)
                {
                    string levelUpTnsLocalizationKey = currentLevelStaticData.LevelUpTnsLocalizationKey;
                    if (levelUpTnsLocalizationKey != null)
                    {
                        text = CelebrityManager.LocalizeSpreadsheetString(Sim.IsFemale, levelUpTnsLocalizationKey, new object[] { celebrityManager.LevelName, Sim });
                    }
                }

                if (extended == null)
                {
                    extended = new string[] { EAText.GetNumberString(Sim.CelebrityLevel) };
                }

                return(base.PrintFormattedStory(manager, text, "0x635e705292bc4b00", parameters, extended, logging));
            }
Example #2
0
        public override void OnDelayedWorldLoadFinished()
        {
            Overwatch.Log("CleanupCelebrityLevel");

            CelebrityLevelStaticData topLevel = null;

            if (CelebrityUtil.sCelebrityLevelData != null)
            {
                topLevel = CelebrityUtil.sCelebrityLevelData[CelebrityManager.HighestLevel];
            }

            foreach (SimDescription sim in SimListing.GetResidents(true).Values)
            {
                if (sim.CelebrityManager == null)
                {
                    sim.Fixup();
                }

                if (topLevel != null)
                {
                    if (sim.CelebrityManager.Points > topLevel.GoalPoints)
                    {
                        sim.CelebrityManager.mPoints = topLevel.GoalPoints;

                        Overwatch.Log("Celebrity Points Reset: " + sim.FullName);
                    }
                }

                if (sim.CelebrityLevel > CelebrityManager.HighestLevel)
                {
                    sim.CelebrityManager.mLevel = CelebrityManager.HighestLevel;

                    Overwatch.Log("Celebrity Level Reset: " + sim.FullName);
                }
            }
        }