protected override bool PrivateUpdate(ScenarioFrame frame) { if (!SimTypes.IsSelectable(Sim)) { ManagerSim.IncrementLifetimeHappiness(Sim, Sims3.Gameplay.Rewards.LifeEventRewards.kLifetimeHappinessRewardForPromotion); } ManagerSim.TestInactiveLTWTask.Perform(this, Sim, Event); PerformRetireAtMax(this, frame); if (OnOnlyOneMayLeadScenario != null) { OnOnlyOneMayLeadScenario(this, frame); } if (OnJackOfAllTradesScenario != null) { OnJackOfAllTradesScenario(this, frame); } if (OnCareerBranchScenario != null) { OnCareerBranchScenario(this, frame); } if (OnCelebrityScenario != null) { OnCelebrityScenario(this, frame); } bool antiShowtime = false; if (Sim.LotHome == null && Sim.CareerManager != null && Sim.CareerManager.OccupationAsPerformanceCareer != null) { // if I see one more homeless Showtime promotion in the middle of the night I will scream :) antiShowtime = true; } if (ShouldReport && !antiShowtime) { Add(frame, new ReportScenario(Sim, Event.Career, mText), ScenarioResult.Start); } Add(frame, new CareerChangedScenario(Sim), ScenarioResult.Start); return(true); }
protected override bool PrivateUpdate(ScenarioFrame frame) { ManagerSim.IncrementLifetimeHappiness(Sim, Sims3.Gameplay.Rewards.LifeEventRewards.kLifetimeHappinessRewardForMarriage); return(true); }
protected override bool PrivateUpdate(ScenarioFrame frame) { Common.StringBuilder msg = new Common.StringBuilder("PrivateUpdate"); try { bool fullList = !GetValue <CustomNamesOnlyOption <ManagerLot>, bool>(); foreach (SimDescription baby in mBabies) { msg += Common.NewLine + baby.FullName; if (!SimTypes.IsSelectable(baby)) { baby.FirstName = Sims.EnsureUniqueName(baby); } List <SimDescription> parents = Relationships.GetParents(baby); parents.Remove(Sim); if ((mDad == null) && (parents.Count > 0)) { mDad = parents[0]; } msg += Common.NewLine + "A"; List <OccultTypes> choices = OccultTypeHelper.CreateList(Sim.OccultManager.CurrentOccultTypes, true); // Grandparent occult inheritance foreach (SimDescription parent in Relationships.GetParents(Sim)) { if (parent.OccultManager == null) { continue; } choices.AddRange(OccultTypeHelper.CreateList(parent.OccultManager.CurrentOccultTypes, true)); } msg += Common.NewLine + "B"; if ((mDad != null) && (mDad.OccultManager != null)) { choices.AddRange(OccultTypeHelper.CreateList(mDad.OccultManager.CurrentOccultTypes, true)); // Grandparent occult inheritance foreach (SimDescription parent in Relationships.GetParents(mDad)) { if (parent.OccultManager == null) { continue; } choices.AddRange(OccultTypeHelper.CreateList(parent.OccultManager.CurrentOccultTypes, true)); } } msg += Common.NewLine + "C"; Sims.ApplyOccultChance(this, baby, choices, GetValue <ChanceOfOccultBabyOptionV2, int>(), GetValue <MaximumNewbornOccultOption, int>()); msg += Common.NewLine + "D"; if ((SimTypes.IsServiceAlien(mDad)) || (SimTypes.IsServiceAlien(Sim))) { baby.SetAlienDNAPercentage(1f); } else { baby.SetAlienDNAPercentage(SimDescription.GetAlienDNAPercentage(mDad, Sim, true)); } } msg += Common.NewLine + "E"; if (OnRenameNewbornsScenario != null) { OnRenameNewbornsScenario(this, frame); } if (!SimTypes.IsSelectable(Sim)) { ManagerSim.IncrementLifetimeHappiness(Sim, Sims3.Gameplay.Rewards.LifeEventRewards.kLifetimeHappinessRewardForBaby); } SetElapsedTime <DayOfLastBabyOption>(Sim); msg += Common.NewLine + "F"; if (mDad != null) { if (!SimTypes.IsSelectable(mDad)) { ManagerSim.IncrementLifetimeHappiness(mDad, Sims3.Gameplay.Rewards.LifeEventRewards.kLifetimeHappinessRewardForBaby); } SetElapsedTime <DayOfLastBabyOption>(mDad); } msg += Common.NewLine + "G"; foreach (SimDescription baby in mBabies) { Manager.AddAlarm(new NormalBabyAgingScenario(baby)); } msg += Common.NewLine + "H"; if (OnBirthScenario != null) { OnBirthScenario(this, frame); } msg += Common.NewLine + "I"; // Do this at the end once everything else has done its thing foreach (SimDescription baby in mBabies) { msg += Common.NewLine + baby.FullName; HouseholdOptions houseData = GetHouseOptions(baby.Household); if (houseData != null) { int netWorth = houseData.GetValue <NetWorthOption, int>(); foreach (SimDescription parent in Relationships.GetParents(baby)) { SimData parentData = GetData(parent); if (parentData != null) { foreach (CasteOptions caste in parentData.Castes) { if (!caste.GetValue <CasteInheritedOption, bool>()) { continue; } if (!caste.Matches(baby, netWorth)) { continue; } SimData babyData = GetData(baby); if (babyData != null) { babyData.AddValue <ManualCasteOption, CasteOptions>(caste); } } } } } } msg += Common.NewLine + "J"; Add(frame, new SuccessScenario(), ScenarioResult.Start); } catch (Exception e) { Common.Exception(ToString() + Common.NewLine + msg.ToString(), e); } return(false); }