void PrintMessagePro(string Message, bool NoNiecModText, float TimeOut) // Bypass if (Responder.Instance.TutorialModel.IsTutorialRunning()) { try { niec_native_func.OutputDebugString("NMPrint: " + Message); if (NotificationManager.sNotificationManager == null) { return; } StyledNotification.Format format = (!NoNiecModText) ? new StyledNotification.Format("NiecMod\n" + (Message == "" ? "No Message" : Message ?? "No Message"), StyledNotification.NotificationStyle.kGameMessagePositive) : new StyledNotification.Format((Message == "" ? "No Message" : Message ?? "No Message"), StyledNotification.NotificationStyle.kGameMessagePositive); format.mConnectionType = StyledNotification.ConnectionType.kSpeech; format.mTNSCategory = Instantiator.RootIsOpenDGSInstalled ? NotificationManager.TNSCategory.Information : NotificationManager.TNSCategory.Store; StyledNotification styledNotification = new StyledNotification(format, TimeOut, null, null, ProductVersion.BaseGame, ProductVersion.BaseGame); NFinalizeDeath.StyledNotification__Add(NotificationManager.sNotificationManager, styledNotification, format.mTNSCategory); } catch { } }
public bool CheckIfAttemptingPrankOnConsecutiveDay(Business business) { if ((business.LastPrankedSim == null) || (business.LastPrankedSim != business.SimAffectedByPrank)) { return false; } if (business.WasLastPrankSuccessful) { string titleText = LocalizeString(business.SimConspiringPrank, "AttemptToPrankAgain", new object[0x0]); StyledNotification.Format format = new StyledNotification.Format(titleText, business.SimAffectedByPrank.CreatedSim.ObjectId, StyledNotification.NotificationStyle.kSimTalking); StyledNotification.Show(format); } else { string str2 = LocalizeString(business.SimConspiringPrank, "BossGettingAngry", new object[] { business.SimConspiringPrank }); StyledNotification.Format format2 = new StyledNotification.Format(str2, StyledNotification.NotificationStyle.kGameMessagePositive); if (business.SimConspiringPrank.CreatedSim != null) { format2.mObject2 = business.SimConspiringPrank.CreatedSim.ObjectId; } else { format2.mObject2Key = business.SimConspiringPrank.GetThumbnailKey(ThumbnailSize.Medium, 0x0); } StyledNotification.Show(format2); business.AddPerformance(Business.kCareerPerformanceLostWhenPrankRepeated); } business.WasLastPrankSuccessful = false; business.IsPrankSet = false; return true; }
public void Show(string msg) { StyledNotification.Format format = new StyledNotification.Format(msg, StyledNotification.NotificationStyle.kSystemMessage); format.mConnectionType = StyledNotification.ConnectionType.kSpeech; format.mTNSCategory = NotificationManager.TNSCategory.Lessons; StyledNotification.Show(format); }
public override void OnTimePassed(InteractionInstance interactionInstance, float totalTime, float deltaTime) { base.OnTimePassed(interactionInstance, totalTime, deltaTime); Science career = base.Career as Science; if (career.mTimeSpentInIndependentExptSinceLastBenefit > Science.DoIndependentExperiment.kTimeSpentInDoExptToGainBenefit) { string str; float value = RandomUtil.GetFloat(0f, 1f); if (value < Science.DoIndependentExperiment.kChanceOfGettingPerformanceBonusFromDoIndependentExpt) { str = "IncreasedPerformance"; career.AddPerformance(Science.DoIndependentExperiment.kAmountOfBonusPerformance); } else if (value < Science.DoIndependentExperiment.kChanceOfGettingPromotionFromDoIndependentExpt) { str = "Promotion"; career.AddPerformance(100f); } else { str = "Failure"; } string titleText = LocalizeString(career.OwnerDescription, str, new object[] { career.OwnerDescription }); StyledNotification.Format format = new StyledNotification.Format(titleText, StyledNotification.NotificationStyle.kGameMessagePositive); StyledNotification.Show(format); career.mTimeSpentInIndependentExptSinceLastBenefit = 0f; } else { career.mTimeSpentInIndependentExptSinceLastBenefit += deltaTime / 60f; } }
public override bool Run() { base.StandardEntry(); if (!base.Target.StartComputing(this, SurfaceHeight.Table, true)) { base.StandardExit(); return(false); } mActor = Actor; base.Target.StartVideo(Computer.VideoType.Browse); base.BeginCommodityUpdates(); base.AnimateSim("WorkTyping"); bool flag = TwoButtonDialog.Show(Localization.LocalizeString("Lyralei/Localized/BuyClothingPatternDialog:InteractionName"), Localization.LocalizeString("Ui/Caption/Global:Yes", new object[0]), Localization.LocalizeString("Ui/Caption/Global:No", new object[0])); if (flag) { if (base.Actor.FamilyFunds >= kCost) { base.Actor.ModifyFunds(-kCost); } else if (!GameUtils.IsFutureWorld()) { //base.Actor.UnpaidBills += kCost; StyledNotification.Format format = new StyledNotification.Format(Localization.LocalizeString("Lyralei/Localized/NotEnoughMoney:Test", new object[0]), base.Actor.ObjectId, base.Target.ObjectId, StyledNotification.NotificationStyle.kGameMessageNegative); StyledNotification.Show(format); } Pattern pattern = Pattern.GetRandomClothingPattern(base.Actor); SimDescription ActorDesc = Actor.SimDescription; base.Actor.ShowTNSIfSelectable(Localization.LocalizeString("Lyralei/Localized/GotPattern:InteractionName", new object[0]) + pattern.mPatternInfo.Name, StyledNotification.NotificationStyle.kGameMessagePositive); } base.Target.StopComputing(this, Computer.StopComputingAction.TurnOff, false); base.EndCommodityUpdates(flag); base.StandardExit(); return(true); }
public override void Init(HousePartySituation parent) { CommodityKind commodity = parent.HostMotive(); parent.OnHappening(); parent.Host.Motives.CreateMotive(commodity); AddBeAtPartyMotive(parent.Host); Situation.CancelAutonomousInteractions(parent.Host); Lot lot = parent.Lot; Lot lotHome = parent.Host.LotHome; foreach (Sim sim in parent.OtherHosts) { Situation.CancelAutonomousInteractions(sim); sim.Motives.CreateMotive(commodity); AddBeAtPartyMotive(sim); } foreach (Sim sim2 in parent.Guests) { AddBeAtPartyMotive(sim2); } if (StoryProgression.Main.Situations.MatchesAlertLevel(parent.Host)) { string titleText = Common.LocalizeEAString(parent.Host.SimDescription.IsFemale, "Gameplay/Situations/Party:PartyBeginsTNS", new object[] { parent.Host.SimDescription }); StyledNotification.Format format = new StyledNotification.Format(titleText, ObjectGuid.InvalidObjectGuid, parent.Host.ObjectId, StyledNotification.NotificationStyle.kGameMessagePositive); StyledNotification.Show(format, "w_party"); } }
public bool CheckIfAttemptingPrankOnConsecutiveDay(Business business) { if ((business.LastPrankedSim == null) || (business.LastPrankedSim != business.SimAffectedByPrank)) { return(false); } if (business.WasLastPrankSuccessful) { string titleText = LocalizeString(business.SimConspiringPrank, "AttemptToPrankAgain", new object[0x0]); StyledNotification.Format format = new StyledNotification.Format(titleText, business.SimAffectedByPrank.CreatedSim.ObjectId, StyledNotification.NotificationStyle.kSimTalking); StyledNotification.Show(format); } else { string str2 = LocalizeString(business.SimConspiringPrank, "BossGettingAngry", new object[] { business.SimConspiringPrank }); StyledNotification.Format format2 = new StyledNotification.Format(str2, StyledNotification.NotificationStyle.kGameMessagePositive); if (business.SimConspiringPrank.CreatedSim != null) { format2.mObject2 = business.SimConspiringPrank.CreatedSim.ObjectId; } else { format2.mObject2Key = business.SimConspiringPrank.GetThumbnailKey(ThumbnailSize.Medium, 0x0); } StyledNotification.Show(format2); business.AddPerformance(Business.kCareerPerformanceLostWhenPrankRepeated); } business.WasLastPrankSuccessful = false; business.IsPrankSet = false; return(true); }
public static bool DisplayCAS(Sim simInCAS, Sim stylerSim, ref bool tookSemaphore, bool forceFailureOutfit) { if (!Responder.Instance.OptionsModel.SaveGameInProgress) { tookSemaphore = GameStates.WaitForInteractionStateChangeSemaphore(simInCAS, ~(ExitReason.Replan | ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached)); if (!tookSemaphore) { return(false); } Sim sim = stylerSim ?? simInCAS; if (sim.Household == Household.ActiveHousehold) { while ((Sims3.Gameplay.Gameflow.CurrentGameSpeed == Sims3.Gameplay.Gameflow.GameSpeed.Pause) || MoveDialog.InProgress()) { SpeedTrap.Sleep(); } StyledNotification notification = null; if (stylerSim != null) { Stylist occupation = stylerSim.Occupation as Stylist; if (occupation != null) { Stylist.Makeover currentJob = occupation.CurrentJob as Stylist.Makeover; if ((currentJob != null) && (currentJob.MakeoverTarget == simInCAS)) { string titleText = currentJob.JobTitle + ":" + Common.NewLine + Common.NewLine; foreach (TaskInfo info in occupation.GetTaskNames().Values) { titleText = titleText + "- " + info.TaskDescription + Common.NewLine; } StyledNotification.Format format = new StyledNotification.Format(titleText, StyledNotification.NotificationStyle.kGameMessagePositive); notification = StyledNotification.Show(format); } } } new Sims.Stylist().Perform(new GameHitParameters <GameObject>(simInCAS, simInCAS, GameObjectHit.NoHit)); if (forceFailureOutfit) { CASLogic.GetSingleton().SetOverrideExitOutfit(OutfitCategories.Makeover, 0x0); } while (GameStates.NextInWorldStateId != InWorldState.SubState.LiveMode) { SpeedTrap.Sleep(); } if (notification != null) { notification.CloseNow(); } Styling.UpdateJobTrackerIfNecessary(simInCAS, stylerSim, forceFailureOutfit); return(true); } } return(false); }
public void Show(GameObject owner, string msg) { StyledNotification.Format format = new StyledNotification.Format(msg, ObjectGuid.InvalidObjectGuid, owner.ObjectId, StyledNotification.NotificationStyle.kGameMessagePositive); //StyledNotification.Show(format, "tns_icon_bulb"); format.mConnectionType = StyledNotification.ConnectionType.kSpeech; format.mTNSCategory = NotificationManager.TNSCategory.Lessons; StyledNotification.Show(format, null, null, ProductVersion.BaseGame, ProductVersion.BaseGame); }
public static void GoToLotSuccessEx(Sim sim, float f) { if (sim.LotCurrent == null) { return; } ServiceData data = KamaSimtra.Settings.FindServiceDataInvolvingProfessionalAndLot(sim.SimDescription.SimDescriptionId, sim.LotCurrent.LotId); bool proceed = false; if (data != null) { SimDescription client = SimDescription.Find(data.mRequester); if (client != null && client.CreatedSim != null) { Relationship relationship = Relationship.Get(client, sim.SimDescription, true); if (relationship != null) { data.DisableAutonomy(); relationship.STC.Set(client.CreatedSim, sim, CommodityTypes.Amorous, 500f); client.CreatedSim.InteractionQueue.CancelAllInteractions(); while (client.CreatedSim.CurrentInteraction != null) { Common.Sleep(0); } data.SetupAlarm(); client.CreatedSim.GreetSimOnMyLotIfPossible(sim); CommonWoohoo.WoohooStyle style = CommonWoohoo.WoohooStyle.Safe; if (!Woohooer.Settings.ReplaceWithRisky && client.CreatedSim.IsSelectable && TwoButtonDialog.Show(Woohooer.Localize("FriskyConfirm:Prompt", sim.IsFemale, new object[] { sim, client.CreatedSim }), Woohooer.Localize("FriskyConfirm:Yes", sim.IsFemale, new object[] { sim, client.CreatedSim }), Woohooer.Localize("FriskyConfirm:No", sim.IsFemale, new object[] { sim, client.CreatedSim }))) { style = CommonWoohoo.WoohooStyle.Risky; } data.mStyle = style; KamaSimtra.Settings.SetServiceData(data.mRequester, data); new CommonWoohoo.PushWoohoo(sim, client.CreatedSim, false, style); proceed = true; if (client.CreatedSim.IsSelectable) { StyledNotification.Format format = new StyledNotification.Format(Common.Localize("OrderServices:Arrived", sim.IsFemale), sim.ObjectId, client.CreatedSim.ObjectId, StyledNotification.NotificationStyle.kSimTalking); StyledNotification.Show(format); } } } } if (!proceed && data != null) { data.Dispose(); } }
protected void Perform(List <Item> selection, ProcessObject onProcess) { if ((selection != null) && (selection.Count > 0)) { string msg = null; if (selection.Count == 1) { msg = Common.Localize(LocalizeKey + ":Single", false, new object[] { selection[0].Name }); } else { msg = Common.Localize(LocalizeKey + ":Multiple", false, new object[] { selection.Count }); } if (AcceptCancelDialog.Show(msg)) { int changed = 0; Dictionary <IGameObject, bool> objs = new Dictionary <IGameObject, bool>(); foreach (Item subitem in selection) { Item item = subitem as Item; foreach (IGameObject obj in item.mObjects) { if (objs.ContainsKey(obj)) { continue; } objs.Add(obj, true); } } foreach (IGameObject obj in objs.Keys) { try { if (onProcess(obj)) { changed++; } } catch { } } StyledNotification.Format format = new StyledNotification.Format(Common.Localize(LocalizeKey + ":Success", false, new object[] { changed }), ObjectGuid.InvalidObjectGuid, ObjectGuid.InvalidObjectGuid, StyledNotification.NotificationStyle.kSystemMessage); format.mTNSCategory = NotificationManager.TNSCategory.Lessons; StyledNotification.Show(format); } } }
// Token: 0x06006FBB RID: 28603 RVA: 0x0026CF1C File Offset: 0x0026BF1C private void EventCallbackResurrectSimUnlucky(StateMachineClient sender, IEvent evt) { this.mDeathProgress = GrimReaperSituation.ReapSoul.DeathProgress.UnluckyPostEvent; if (GrimReaperSituation.ShouldDoDeathEvent(this.Target)) { StyledNotification.Format format = new StyledNotification.Format(Localization.LocalizeString("Gameplay/Services/GrimReaper:Unlucky1", new object[] { this.Target }), this.Actor.ObjectId, StyledNotification.NotificationStyle.kSimTalking); StyledNotification.Show(format); } this.EventCallbackResurrectSim(); }
private static void OneDayPassedVacationUpdates(Household ths) { if (GameStates.CurrentDayOfTrip == GameStates.TripLength) { if (!GameStates.IsTravelling) { StyledNotification.Format format = new StyledNotification.Format(Common.LocalizeEAString("Gameplay/Vacation:OneDayLeft"), StyledNotification.NotificationStyle.kSystemMessage); StyledNotification.Show(format); } ths.mLastDayAlarm = AlarmManager.Global.AddAlarm(SimClock.HoursUntil(12f), TimeUnit.Hours, ths.HalfDayLeft, "Half Day left TNS", AlarmType.AlwaysPersisted, ths); } else if (GameStates.CurrentDayOfTrip > GameStates.TripLength) { bool denyTravel = false; if (!GameStates.IsTravelling) { foreach (Sim sim in Households.AllSims(ths)) { sim.VisaManager.UpdateDaysSpentInWorld(GameUtils.GetCurrentWorld(), GameStates.CurrentDayOfTrip - 0x1); if (sim.IsDying()) { denyTravel = true; } } } if (!denyTravel) { GameStates.StopSnappingPicturesIfNeccessary(); Sims3.Gameplay.UI.HudModel hudModel = Sims3.Gameplay.UI.Responder.Instance.HudModel as Sims3.Gameplay.UI.HudModel; if (hudModel != null) { WorldName currentWorld = GameUtils.GetCurrentWorld(); string str = hudModel.LocationName(currentWorld); SimpleMessageDialog.Show(TravelUtil.LocalizeString("TripOverCaption", new object[0x0]), TravelUtil.LocalizeString("TripOverText", new object[] { str }), ModalDialog.PauseMode.PauseSimulator); } } if (!denyTravel) { Traveler.SaveGame(); TravelUtil.PlayerMadeTravelRequest = true; // Calls custom function GameStatesEx.UpdateTelemetryAndTriggerTravelBackToHomeWorld(); } } }
private void makeEmployeePay(Sim theSim) { theSim.ModifyFunds(payPerDay); Lot roleLot = getRoleLot(); Household houseHold = Household.ActiveHousehold; if (roleLot == houseHold.LotHome) { houseHold.ModifyFamilyFunds(-payPerDay); } StyledNotification.Format format = new StyledNotification.Format("I earned §" + payPerDay + " today", theSim.ObjectId, ObjectGuid.InvalidObjectGuid, StyledNotification.NotificationStyle.kSimTalking); StyledNotification.Show(format); }
// Token: 0x06006FBC RID: 28604 RVA: 0x0026CF78 File Offset: 0x0026BF78 private void EventCallbackResurrectSimRanting(StateMachineClient sender, IEvent evt) { this.mDeathProgress = GrimReaperSituation.ReapSoul.DeathProgress.UnluckyPostEvent; if (GrimReaperSituation.ShouldDoDeathEvent(this.Target)) { StyledNotification.Format format = new StyledNotification.Format(Localization.LocalizeString("Gameplay/Services/GrimReaper:RantingWarning", new object[] { this.Target }), this.Actor.ObjectId, StyledNotification.NotificationStyle.kSimTalking); StyledNotification.Show(format); } this.Target.BuffManager.AddElement(BuffNames.ThereAndBackAgain, Origin.FromRanting); this.EventCallbackResurrectSim(); }
public void AddOrUpdateDoorSettings(ObjectGuid door, DoorPortalComponentEx.DoorSettings settings, bool doSimValidation) { if (mDoorSettings.ContainsKey(door)) { mDoorSettings[door] = settings; } else { mDoorSettings.Add(door, settings); } if (doSimValidation) { Door door2 = GameObject.GetObject(door) as Door; if (door2 != null && door2.LotCurrent != null) { foreach (Sim sim in door2.LotCurrent.mSims) { //door2.GetAdjoiningRoom(door2.RoomId) if (sim != null && sim.SimDescription != null && sim.RoomId == door2.RoomId && !LotManager.RoomIdIsOutside(sim.RoomId)) { if (!settings.IsSimAllowedThrough(sim.SimDescription.SimDescriptionId)) { StyledNotification.Format format = new StyledNotification.Format(Common.Localize("DoorFilter:WarningTrappedSims"), door2.ObjectId, ObjectGuid.InvalidObjectGuid, StyledNotification.NotificationStyle.kSystemMessage); format.mTNSCategory = NotificationManager.TNSCategory.Lessons; StyledNotification.Show(format); } } } foreach (Sim sim in LotManager.Actors) { if (sim == null || sim.mAllowedRooms == null) { continue; } sim.mAllowedRooms.Remove(door2.LotCurrent.LotId); } } } }
public override bool InRabbitHole() { BeginCommodityUpdates(); bool flag = DoTimedLoop(Abductor.Settings.mExamDuration * 60f); EndCommodityUpdates(flag); if (flag) { int compensation = Abductor.Settings.mBaseCompensation * RandomUtil.GetInt(1, Abductor.Settings.mMaxMultiplier); string text = Localization.LocalizeString("Duglarogg/Abductor/Interactions/VolunteerForExamination:TNS", new object[] { compensation }); StyledNotification.Format format = new StyledNotification.Format(text, Target.ObjectId, Actor.ObjectId, StyledNotification.NotificationStyle.kGameMessagePositive); StyledNotification.Show(format); Actor.ModifyFunds(compensation); Actor.TraitManager.AddHiddenElement(AlienUtilsEx.sAlreadyExamined); } return(flag); }
// Token: 0x06006FBA RID: 28602 RVA: 0x0026CE70 File Offset: 0x0026BE70 public void EventCallbackResurrectSimDeathFlower(StateMachineClient sender, IEvent evt) { EventTracker.SendEvent(EventTypeId.kGotSavedByDeathFlower, this.Target); this.mDeathProgress = GrimReaperSituation.ReapSoul.DeathProgress.DeathFlowerPostEvent; if (GrimReaperSituation.ShouldDoDeathEvent(this.Target)) { StyledNotification.Format format = new StyledNotification.Format(Localization.LocalizeString("Gameplay/Services/GrimReaper:DeathFlower1", new object[] { this.Target }), this.Actor.ObjectId, StyledNotification.NotificationStyle.kSimTalking); StyledNotification.Show(format); } ThoughtBalloonManager.BalloonData balloonData = new ThoughtBalloonManager.BalloonData(this.mDeathFlower.GetThoughtBalloonThumbnailKey()); balloonData.mPriority = ThoughtBalloonPriority.High; balloonData.Duration = ThoughtBalloonDuration.Medium; balloonData.mCoolDown = ThoughtBalloonCooldown.Medium; balloonData.LowAxis = ThoughtBalloonAxis.kLike; this.Actor.ThoughtBalloonManager.ShowBalloon(balloonData); this.EventCallbackResurrectSim(); }
public override void ShowPartyEndTNS(Party.PartyOutcomes partyResult) { string str; switch (partyResult) { case Party.PartyOutcomes.kBadParty: str = Common.LocalizeEAString(Host.IsFemale, "Gameplay/Notifications/Party:BadFuneral", new object[] { Host.SimDescription }); break; case Party.PartyOutcomes.kGoodParty: str = Common.LocalizeEAString(Host.IsFemale, "Gameplay/Notifications/Party:GoodFuneral", new object[] { Host.SimDescription }); break; default: str = Common.LocalizeEAString(Host.IsFemale, "Gameplay/Notifications/Party:NormalFuneral", new object[] { Host.SimDescription }); break; } StyledNotification.Format format = new StyledNotification.Format(str, ObjectGuid.InvalidObjectGuid, Host.ObjectId, StyledNotification.NotificationStyle.kGameMessagePositive); StyledNotification.Show(format, "w_party"); }
public virtual void ShowPartyEndTNS(Party.PartyOutcomes partyResult) { if (StoryProgression.Main.Situations.MatchesAlertLevel(Host)) { string str; switch (partyResult) { case Party.PartyOutcomes.kBadParty: str = Common.LocalizeEAString(Host.IsFemale, "Gameplay/Notifications/Party:BadParty", new object[] { Host.SimDescription }); break; case Party.PartyOutcomes.kGoodParty: str = Common.LocalizeEAString(Host.IsFemale, "Gameplay/Notifications/Party:GoodParty", new object[] { Host.SimDescription }); break; default: str = Common.LocalizeEAString(Host.IsFemale, "Gameplay/Notifications/Party:NormalParty", new object[] { Host.SimDescription }); break; } StyledNotification.Format format = new StyledNotification.Format(str, ObjectGuid.InvalidObjectGuid, Host.ObjectId, StyledNotification.NotificationStyle.kGameMessagePositive); StyledNotification.Show(format, "w_party"); } }
public override bool Run() { base.StandardEntry(); if (!base.Target.StartComputing(this, SurfaceHeight.Table, true)) { base.StandardExit(); return(false); } //mActor = Actor; base.Target.StartVideo(Computer.VideoType.Browse); base.BeginCommodityUpdates(); base.AnimateSim("WorkTyping"); bool flag = TwoButtonDialog.Show(Localization.LocalizeString("Lyralei/Localized/JoinPatternClubDesc:InteractionName", new object[0]) + kCost.ToString(), Localization.LocalizeString("Lyralei/Localized/JoinPatternClubYES:InteractionName", new object[0]), Localization.LocalizeString("Lyralei/Localized/JoinPatternClubNO:InteractionName", new object[0])); if (flag) { if (base.Actor.FamilyFunds >= kCost) { base.Actor.ModifyFunds(-kCost); } else if (!GameUtils.IsFutureWorld()) { //base.Actor.UnpaidBills += kCost; StyledNotification.Format format = new StyledNotification.Format(Localization.LocalizeString("Lyralei/Localized/NotEnoughMoney:Test", new object[0]), base.Actor.ObjectId, base.Target.ObjectId, StyledNotification.NotificationStyle.kGameMessageNegative); StyledNotification.Show(format); } Mailbox mailbox = Mailbox.GetMailboxOnLot(base.Actor.LotHome); mailbox.AddAlarmDay(1f, DaysOfTheWeek.Thursday, GlobalOptionsSewingTable.SendPatterns, "Mailbox: Pattern club " + base.Actor.mSimDescription.mSimDescriptionId.ToString(), AlarmType.AlwaysPersisted); GlobalOptionsSewingTable.retrieveData.whoIsInPatternClub.Add(Actor.SimDescription.mSimDescriptionId, true); base.Actor.ShowTNSIfSelectable(Localization.LocalizeString("Lyralei/Localized/JoinedPatternClub:InteractionName", new object[0]), StyledNotification.NotificationStyle.kGameMessagePositive); } base.Target.StopComputing(this, Computer.StopComputingAction.TurnOff, false); base.EndCommodityUpdates(flag); base.StandardExit(); return(true); }
protected static bool BumpUp(SimDescription a, SimDescription b, bool prompt, bool romantic) { Relationship relation = Relationship.Get(a, b, true); if (relation == null) { return(false); } LongTermRelationshipTypes currentState = relation.LTR.CurrentLTR; LongTermRelationshipTypes nextState = LongTermRelationshipTypes.Undefined; if (romantic) { nextState = NextPositiveRomanceState(currentState); } else { nextState = NextPositiveFriendState(currentState); } if (nextState == LongTermRelationshipTypes.Undefined) { if (prompt) { SimpleMessageDialog.Show(Common.Localize("Romance:BumpUpTitle"), Common.Localize("Romance:TooHigh")); } return(false); } /* * if (relation.LTR.RelationshipIsInappropriate(LTRData.Get(nextState))) * { * if (prompt) * { * SimpleMessageDialog.Show(Common.Localize("Romance:BumpUpTitle"), Common.Localize ("Romance:Improper", new object[] { Common.LocalizeStatus (a, b, nextState) })); * } * return false; * } */ if ((romantic) && (a.Genealogy.IsBloodRelated(b.Genealogy))) { if ((prompt) && (!AcceptCancelDialog.Show(Common.Localize("Romance:BloodPrompt", a.IsFemale, new object [] { a, b })))) { return(false); } } if ((currentState == LongTermRelationshipTypes.RomanticInterest) && (romantic)) { if ((a.Partner != null) && (a.Partner != b)) { if ((b.Partner != null) && (b.Partner != a)) { if ((prompt) && (!AcceptCancelDialog.Show(Common.Localize("Romance:DualPartnerPrompt", a.IsFemale, new object[] { a, b })))) { return(false); } } else { if ((prompt) && (!AcceptCancelDialog.Show(Common.Localize("Romance:PartnerPrompt", a.IsFemale, new object[] { a })))) { return(false); } } } else if ((b.Partner != null) && (b.Partner != a)) { if ((prompt) && (!AcceptCancelDialog.Show(Common.Localize("Romance:PartnerPrompt", b.IsFemale, new object[] { b })))) { return(false); } } if (a.Partner != null) { BumpDown(a, a.Partner, false, true); } if (b.Partner != null) { BumpDown(b, b.Partner, false, true); } if (a.TraitManager == null) { a.Fixup(); } if (b.TraitManager == null) { b.Fixup(); } Relationships.SetPartner(a, b); } ForceChangeState(relation, nextState); if (romantic) { if (prompt && relation.RomanceVisibilityState != null) { long time = 0; relation.TryGetActiveRomanceStartTime(out time); int days = 0; if (time != 0) { days = (int)SimClock.ElapsedTime(TimeUnit.Days, new DateAndTime(time)); } string text = StringInputDialog.Show(Common.Localize("Romance:StartTime"), Common.Localize("Romance:StartPrompt", a.IsFemale, new object[] { a, b, SimClock.ElapsedCalendarDays() }), days.ToString()); if (string.IsNullOrEmpty(text)) { return(false); } int mValue = 0; if (!int.TryParse(text, out mValue) || mValue > SimClock.ElapsedCalendarDays()) { SimpleMessageDialog.Show(Common.Localize("Romance:StartTime"), Common.Localize("Numeric:ErrorInputIgnored")); } else { relation.RomanceVisibilityState.mStartTime = SimClock.Subtract(SimClock.CurrentTime(), TimeUnit.Days, (float)mValue); } } } if (relation.LTR.CurrentLTR == LongTermRelationshipTypes.BestFriendsForever) { bool isPetBFF = ((!a.IsHuman) || (!b.IsHuman)); a.HasBFF = true; b.HasBFF = true; FindAndRemoveBFF(a, b, isPetBFF); FindAndRemoveBFF(b, a, isPetBFF); } if (currentState == relation.LTR.CurrentLTR) { return(false); } StyledNotification.Format format = new StyledNotification.Format(Common.Localize("Romance:Success", a.IsFemale, new object[] { a, b, LocalizeStatus(a, b, relation.LTR.CurrentLTR) }), StyledNotification.NotificationStyle.kGameMessagePositive); format.mTNSCategory = NotificationManager.TNSCategory.Lessons; StyledNotification.Show(format); return(true); }
private void Pulse() { try { if (SomeGuestsHaveArrived) { CheckIfGuestsNeedToGoHome(); } if (SimClock.CurrentTime().Ticks >= EarliestPossibleEndTime.Ticks) { if (SomeGuestsHaveArrived) { int num = 0x0; for (int i = Guests.Count - 0x1; i >= 0x0; i--) { Sim sim = Guests[i]; if ((Host != null) && (sim.Household == Host.Household)) { RemoveGuest(sim, false); SimsWhoLeftParty.Remove(sim); OtherHosts.Add(sim); } else if (sim.LotCurrent == Lot) { num++; } } foreach (Sim sim2 in SimsWhoLeftParty) { DateAndTime time; if ((mTimeForSimToLeave.TryGetValue(sim2.ObjectId, out time) && (sim2.LotCurrent == Lot)) && (SimClock.ElapsedTime(TimeUnit.Hours, time) <= HostedSituation.kTimeToLeaveHostedSituation)) { num++; } } if (num == 0x0) { SetState(new AllGuestsHaveLeft(this)); } if (Host.LotCurrent != Lot) { int num3 = 0x0; foreach (Sim sim3 in OtherHosts) { if (sim3.LotCurrent == Lot) { num3++; } } if (num3 == 0x0) { SetState(new AllHostsHaveLeft(this)); } } } else { if (Host.IsSelectable) { string titleText = Common.LocalizeEAString(Host.SimDescription.IsFemale, "Gameplay/Situations/Party:PartyNoShow", new object[] { Host.SimDescription }); StyledNotification.Format format = new StyledNotification.Format(titleText, ObjectGuid.InvalidObjectGuid, Host.ObjectId, StyledNotification.NotificationStyle.kGameMessagePositive); StyledNotification.Show(format, "w_party"); } Exit(); } } } catch (ResetException) { throw; } catch (Exception) { Exit(); } }
private static void AintAllDelDesc(bool loadworld) { try { if (NiecMod.KillNiec.AssemblyCheckByNiec.IsInstalled("DGSCore")) { //bool checkkillsimxxx = false; try { //Sleep(3.0); foreach (SimDescription sdtyf in NiecMod.Nra.NFinalizeDeath.TattoaX()) { try { if (!Sims3.NiecModList.Persistable.ListCollon.NiecSimDescriptions.Contains(sdtyf)) { Sims3.NiecModList.Persistable.ListCollon.NiecSimDescriptions.Add(sdtyf); } } catch { } } } catch { } //Sleep(3.0); try { CommandSystem.ExecuteCommandString("dgsunsafekill false"); } catch { } try { CommandSystem.ExecuteCommandString("dgspx false"); PlumbBob.ForceSelectActor(null); try { PlumbBob.sSingleton.mSelectedActor = null; } catch { } } catch { } try { List <MiniSimDescription> asdr = new List <MiniSimDescription>(MiniSimDescription.sMiniSims.Values); foreach (MiniSimDescription esdtyef in asdr) { try { if (esdtyef == null) { continue; } if (esdtyef.mProtectionFlags != null) { esdtyef.mProtectionFlags.Clear(); } esdtyef.Instantiated = false; esdtyef.mGenealogy = null; try { foreach (MiniRelationship miniRelationship in esdtyef.mMiniRelationships) { if (miniRelationship == null) { continue; } try { MiniSimDescription miniSimDescription2 = MiniSimDescription.Find(miniRelationship.SimDescriptionId); if (miniSimDescription2 != null) { if (miniSimDescription2.mProtectionFlags != null) { miniSimDescription2.mProtectionFlags.Clear(); } miniSimDescription2.Instantiated = false; miniSimDescription2.RemoveMiniRelatioship(esdtyef.mSimDescriptionId); miniSimDescription2.mGenealogy = null; } } catch { } } } catch { } if (esdtyef.mMiniRelationships != null) { esdtyef.mMiniRelationships.Clear(); } //MiniSimDescription.sMiniSims.Remove(esdtyef.mSimDescriptionId); } catch { } } } catch { } foreach (SimDescription sdtyef in Sims3.NiecModList.Persistable.ListCollon.NiecSimDescriptions) { try { if (sdtyef == null) { continue; } //sdtyef.RemoveOutfits(OutfitCategories.All, true); //sdtyef.RemoveOutfit(OutfitCategories.All, 0, true); if (!sdtyef.mIsValidDescription && !loadworld) { continue; } try { try { if (sdtyef.OccultManager != null) { sdtyef.OccultManager.RemoveAllOccultTypes(); } } catch { } sdtyef.OccultManager = null; } catch { } try { if (sdtyef.IsPregnant) { NRaas.CommonSpace.Helpers.CASParts.RemoveOutfits(sdtyef, OutfitCategories.All, false); } else { NRaas.CommonSpace.Helpers.CASParts.RemoveOutfits(sdtyef, OutfitCategories.All, true); } } catch { } sdtyef.Protected = false; MiniSimDescription inim = MiniSimDescription.Find(sdtyef.mSimDescriptionId); if (inim != null) { if (inim.mProtectionFlags != null) { inim.mProtectionFlags.Clear(); } inim.Instantiated = false; inim.mGenealogy = null; inim.ClearMiniRelationships(); } } catch { } try { Niec.iCommonSpace.KillPro.RemoveSimDescriptionRelationships(sdtyef); } catch { } try { Niec.iCommonSpace.KillPro.CleanseGenealogy(sdtyef); sdtyef.mGenealogy = null; } catch { } try { Niec.iCommonSpace.KillPro.RemoveSimDescriptionRelationships(sdtyef); } catch { } } List <Sim> asdo = new List <Sim>(); try { try { foreach (Sim simau in Sims3.Gameplay.Queries.GetObjects <Sim>()) { try { if (!asdo.Contains(simau)) { asdo.Add(simau); } } catch { } } foreach (Sim simau in LotManager.Actors) { try { if (!asdo.Contains(simau)) { asdo.Add(simau); } } catch { } } } catch { } try { foreach (Sim simaue in asdo) { try { NFinalizeDeath.ForceCancelAllInteractionsWithoutCleanup(simaue); } catch { } try { simaue.Genealogy.ClearAllGenealogyInformation(); } catch { } try { simaue.Genealogy.ClearMiniSimDescription(); } catch { } try { simaue.Destroy(); } catch { } try { (simaue as ScriptObject).Destroy(); } catch { } } } catch { } } catch { } finally { try { asdo.Clear(); } catch { } asdo = null; } foreach (SimDescription description in Sims3.NiecModList.Persistable.ListCollon.NiecSimDescriptions) { try { if (description == null) { continue; } if (!description.mIsValidDescription && !loadworld) { try { while (true) { Urnstone urnstone = null; urnstone = HelperNra.TFindGhostsGrave(description); if (urnstone != null) { urnstone.DeadSimsDescription = null; try { urnstone.Dispose(); } catch { } try { urnstone.Destroy(); } catch { } } else { break; } } } catch { } continue; } } catch { } try { if (description.IsPregnant) { NRaas.CommonSpace.Helpers.CASParts.RemoveOutfits(description, OutfitCategories.All, false); } else { NRaas.CommonSpace.Helpers.CASParts.RemoveOutfits(description, OutfitCategories.All, true); } } catch { } try { description.Genealogy.ClearMiniSimDescription(); } catch { } try { description.Genealogy.ClearDerivedData(); } catch { } try { description.Genealogy.ClearSimDescription(); } catch { } try { description.Genealogy.ClearAllGenealogyInformation(); } catch { } try { if (description.CreatedSim != null) { NFinalizeDeath.ForceCancelAllInteractionsWithoutCleanup(description.CreatedSim); } } catch { } try { Household household = description.Household; if (household != null) { household.Remove(description, !household.IsSpecialHousehold); } } catch { } try { while (true) { Urnstone urnstone = null; urnstone = HelperNra.TFindGhostsGrave(description); if (urnstone != null) { urnstone.DeadSimsDescription = null; try { urnstone.Dispose(); } catch { } try { urnstone.Destroy(); } catch { } } else { break; } } } catch { } try { MiniSimDescription.RemoveMSD(description.SimDescriptionId); } catch { } try { description.Dispose(); } catch { } /* * try * { * NRaas.CommonSpace.Helpers.Annihilation.Cleanse(description); * } * catch * { } */ description.mIsValidDescription = false; } try { //Sleep(3.0); foreach (Service allService in Services.AllServices) { try { if (!(allService is GrimReaper)) { allService.ClearServicePool(); } } catch { } } } catch { } try { //Sleep(3.0); foreach (Service allService in Services.AllServices) { try { if (!(allService is GrimReaper)) { Service.Destroy(allService); } } catch { } } } catch { } try { try { try { SimDescription.sLoadedSimDescriptions.Clear(); } catch { } SimDescription.sLoadedSimDescriptions = null; SimDescription.sLoadedSimDescriptions = new List <SimDescription>(); } catch { StyledNotification.Format afra = new StyledNotification.Format("Failed 1", StyledNotification.NotificationStyle.kSystemMessage); StyledNotification.Show(afra); } if (!loadworld) { try { Sims3.NiecModList.Persistable.ListCollon.NiecSimDescriptions.Clear(); Sims3.NiecModList.Persistable.ListCollon.NiecSimDescriptions = null; Sims3.NiecModList.Persistable.ListCollon.NiecSimDescriptions = new List <SimDescription>(); } catch { StyledNotification.Format afra = new StyledNotification.Format("Failed 2", StyledNotification.NotificationStyle.kSystemMessage); StyledNotification.Show(afra); } } try { MiniSimDescription.sMiniSims.Clear(); MiniSimDescription.sMiniSims = null; MiniSimDescription.sMiniSims = new Dictionary <ulong, MiniSimDescription>(); } catch { StyledNotification.Format afra = new StyledNotification.Format("Failed 3", StyledNotification.NotificationStyle.kSystemMessage); StyledNotification.Show(afra); } if (NiecMod.KillNiec.AssemblyCheckByNiec.IsInstalled("DGSCore")) { try { CommandSystem.ExecuteCommandString("dgsnocreate true"); StyledNotification.Format afra = new StyledNotification.Format("Termination Status: Perfect Execution!", StyledNotification.NotificationStyle.kGameMessageNegative); afra.mTNSCategory = NotificationManager.TNSCategory.Chatty; StyledNotification.Show(afra); } catch { } try { CommandSystem.ExecuteCommandString("dgsnocreate true"); } catch { } OptionsModel optionsModel = Sims3.Gameplay.UI.Responder.Instance.OptionsModel as OptionsModel; if (optionsModel != null) { optionsModel.SaveName = "ClearSave " + "No Name"; } try { GameStates.TransitionToEditTown(); } catch { } } } catch { } } } catch { } return; }
public void Debug(object sender, string msg) { string finalMsg = sender.GetType().ToString() + " - " + msg; StyledNotification.Format format = new StyledNotification.Format(finalMsg, StyledNotification.NotificationStyle.kSystemMessage); StyledNotification.Show(format); bool result; try { if (addHeader) { Common.sLogEnumerator++; string[] array = GameUtils.GetGenericString(GenericStringID.VersionLabels).Split(new char[] { '\n' }); string[] array2 = GameUtils.GetGenericString(GenericStringID.VersionData).Split(new char[] { '\n' }); string text2 = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + Common.NewLine; string text3 = text2; text2 = string.Concat(new string[] { text3, "<", VersionStamp.sNamespace, ">", Common.NewLine }); object obj = text2; text2 = string.Concat(new object[] { obj, "<ModVersion value=\"", VersionStamp.sVersion, "\"/>", Common.NewLine }); int num = (array.Length > array2.Length) ? array2.Length : array.Length; for (int i = 0; i < num; i++) { string text4 = array[i].Replace(":", "").Replace(" ", ""); string a; if ((a = text4) != null && (a == "GameVersion" || a == "BuildVersion")) { string text5 = text2; text2 = string.Concat(new string[] { text5, "<", text4, " value=\"", array2[i], "\"/>", Common.NewLine }); } } IGameUtils gameUtils = (IGameUtils)AppDomain.CurrentDomain.GetData("GameUtils"); if (gameUtils != null) { ProductVersion productFlags = (ProductVersion)gameUtils.GetProductFlags(); object obj2 = text2; text2 = string.Concat(new object[] { obj2, "<Installed=\"", productFlags, "\"/>", Common.NewLine }); } object obj3 = text2; text2 = string.Concat(new object[] { obj3, "<Enumerator value=\"", Common.sLogEnumerator, "\"/>", Common.NewLine }); text2 = text2 + "<Content>" + Common.NewLine; text = text2 + text.Replace("&", "&"); text = text + Common.NewLine + "</Content>"; string text6 = text; text = string.Concat(new string[] { text6, Common.NewLine, "</", VersionStamp.sNamespace, ">" }); } uint num2 = 0u; Simulator.CreateScriptErrorFile(ref num2); if (num2 != 0u) { CustomXmlWriter customXmlWriter = new CustomXmlWriter(num2); customXmlWriter.WriteToBuffer(text); customXmlWriter.WriteEndDocument(); } result = true; } catch { result = false; } return result; }
public void AddOrUpdateDoorSettings(ObjectGuid door, DoorPortalComponentEx.DoorSettings settings, bool doSimValidation) { if (mDoorSettings.ContainsKey(door)) { mDoorSettings[door] = settings; } else { mDoorSettings.Add(door, settings); } if (doSimValidation) { Door door2 = GameObject.GetObject(door) as Door; if (door2 != null && door2.LotCurrent != null) { foreach (Sim sim in door2.LotCurrent.mSims) { if (sim != null && sim.SimDescription != null && sim.RoomId == door2.GetAdjoiningRoom(door2.RoomId) && !LotManager.RoomIdIsOutside(sim.RoomId)) { if (!settings.IsSimAllowedThrough(sim.SimDescription.SimDescriptionId)) { StyledNotification.Format format = new StyledNotification.Format(Common.Localize("DoorFilter:WarningTrappedSims"), door2.ObjectId, ObjectGuid.InvalidObjectGuid, StyledNotification.NotificationStyle.kSystemMessage); format.mTNSCategory = NotificationManager.TNSCategory.Lessons; StyledNotification.Show(format); } } } foreach (Sim sim in LotManager.Actors) { if (sim == null || sim.mAllowedRooms == null) continue; sim.mAllowedRooms.Remove(door2.LotCurrent.LotId); } } } }
public static bool DisplayCAS(Sim simInCAS, Sim stylerSim, ref bool tookSemaphore, bool forceFailureOutfit) { if (!Responder.Instance.OptionsModel.SaveGameInProgress) { tookSemaphore = GameStates.WaitForInteractionStateChangeSemaphore(simInCAS, ~(ExitReason.Replan | ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached)); if (!tookSemaphore) { return false; } Sim sim = stylerSim ?? simInCAS; if (sim.Household == Household.ActiveHousehold) { while ((Sims3.Gameplay.Gameflow.CurrentGameSpeed == Sims3.Gameplay.Gameflow.GameSpeed.Pause) || MoveDialog.InProgress()) { SpeedTrap.Sleep(); } StyledNotification notification = null; if (stylerSim != null) { Stylist occupation = stylerSim.Occupation as Stylist; if (occupation != null) { Stylist.Makeover currentJob = occupation.CurrentJob as Stylist.Makeover; if ((currentJob != null) && (currentJob.MakeoverTarget == simInCAS)) { string titleText = currentJob.JobTitle + ":" + Common.NewLine + Common.NewLine; foreach (TaskInfo info in occupation.GetTaskNames().Values) { titleText = titleText + "- " + info.TaskDescription + Common.NewLine; } StyledNotification.Format format = new StyledNotification.Format(titleText, StyledNotification.NotificationStyle.kGameMessagePositive); notification = StyledNotification.Show(format); } } } new Sims.Stylist().Perform(new GameHitParameters<GameObject>(simInCAS, simInCAS, GameObjectHit.NoHit)); if (forceFailureOutfit) { CASLogic.GetSingleton().SetOverrideExitOutfit(OutfitCategories.Makeover, 0x0); } while (GameStates.NextInWorldStateId != InWorldState.SubState.LiveMode) { SpeedTrap.Sleep(); } if (notification != null) { notification.CloseNow(); } Styling.UpdateJobTrackerIfNecessary(simInCAS, stylerSim, forceFailureOutfit); return true; } } return false; }
public static void SetupSimFest(ShowStage ths) { Common.StringBuilder msg = new Common.StringBuilder("SetupSimFest"); try { if ((ths.OwnerProprietor == null) || (ths.OwnerProprietor.HasBeenDestroyed)) { if (ths.CurrentRole == null) return; ths.OwnerProprietor = ths.CurrentRole.SimInRole; if ((ths.OwnerProprietor == null) || (ths.OwnerProprietor.HasBeenDestroyed)) { return; } } CommonSpace.Helpers.ShowStageEx.Cleanup(ths, null); msg += "C"; List<Sim> list = new List<Sim>(); foreach (Sim sim in LotManager.Actors) { if (ths.BasicNPCPerformerTest(sim)) { list.Add(sim); } } ths.LoadStage(); PerformanceCareer.PerformanceAudiencePosture standing = PerformanceCareer.PerformanceAudiencePosture.Standing; ths.PreShowSetup(); foreach (IShowFloor floor in ths.LotCurrent.GetObjects<IShowFloor>()) { floor.ResetShowFloor(); switch (standing) { case PerformanceCareer.PerformanceAudiencePosture.Standing: floor.SetupShowFloorWithStandingLocations(); break; case PerformanceCareer.PerformanceAudiencePosture.Sitting: floor.SetupShowFloorWithSittingLocations(); break; } } msg += "A"; foreach (ICrowdMonster monster in ths.LotCurrent.GetObjects<ICrowdMonster>()) { switch (standing) { case PerformanceCareer.PerformanceAudiencePosture.Standing: monster.CreateStandingCrowdMonster(); break; case PerformanceCareer.PerformanceAudiencePosture.Sitting: monster.CreateSittingCrowdMonster(); break; } } msg += "B"; ths.mDoesPerformanceAllowDancing = false; ths.Controller.PostEvent(ShowEventType.kShowSetup); string titleText = ShowStage.LocalizeString(ths.OwnerProprietor.IsFemale, "AnnounceSimFestStart", new object[] { ths.LotCurrent.Name }); StyledNotification.Format format = new StyledNotification.Format(titleText, ths.OwnerProprietor.ObjectId, StyledNotification.NotificationStyle.kSystemMessage); StyledNotification.Show(format); ths.AddSimFestMapTags(); msg += "D"; bool addedAlarm = false; for (int i = 0x0; i < 0x3; i++) { // Custom Sim item = CreateAnNPCPerformer(ths); if (item != null) { list.Add(item); if (item.WasCreatedByAService && !addedAlarm) { addedAlarm = true; new Common.AlarmTask(9, TimeUnit.Hours, HibernateServiceSims); } } } msg += "E"; foreach (Sim sim3 in list) { if (sim3 != null) { ths.PushWatchTheShowOntoSim(sim3); } } msg += "F"; int audienceSize = ths.GetSimFestDesiredAudienceSize() - list.Count; if (audienceSize > 0x0) { ths.PullAudienceToLot(audienceSize); } msg += "G"; ths.mSimFestStartAlarm = ths.AddAlarmRepeating(10f, TimeUnit.Minutes, ths.SimFestWaitForPerformers, "SimFestWaitForPerformers", AlarmType.AlwaysPersisted); ShowStage.SimFestWait entry = ShowStage.SimFestWait.Singleton.CreateInstance(ths, ths.OwnerProprietor, new InteractionPriority(InteractionPriorityLevel.RequiredNPCBehavior), ths.OwnerProprietor.IsNPC, false) as ShowStage.SimFestWait; msg += "H"; entry.mAction = ShowStage.SimFestWait.SimFestWaitAction.WaitForPerformers; ths.OwnerProprietor.InteractionQueue.AddNext(entry); Common.DebugWriteLog(msg); } catch (ResetException) { throw; } catch (Exception e) { Common.Exception(msg, e); } }
protected void Perform(List<Item> selection, ProcessObject onProcess) { if ((selection != null) && (selection.Count > 0)) { string msg = null; if (selection.Count == 1) { msg = Common.Localize(LocalizeKey + ":Single", false, new object[] { selection[0].Name }); } else { msg = Common.Localize(LocalizeKey + ":Multiple", false, new object[] { selection.Count }); } if (AcceptCancelDialog.Show(msg)) { int changed = 0; Dictionary<IGameObject, bool> objs = new Dictionary<IGameObject, bool>(); foreach (Item subitem in selection) { Item item = subitem as Item; foreach (IGameObject obj in item.mObjects) { if (objs.ContainsKey(obj)) continue; objs.Add(obj, true); } } foreach (IGameObject obj in objs.Keys) { try { if (onProcess(obj)) { changed++; } } catch { } } StyledNotification.Format format = new StyledNotification.Format(Common.Localize(LocalizeKey + ":Success", false, new object[] { changed }), ObjectGuid.InvalidObjectGuid, ObjectGuid.InvalidObjectGuid, StyledNotification.NotificationStyle.kSystemMessage); format.mTNSCategory = NotificationManager.TNSCategory.Lessons; StyledNotification.Show(format); } } }
protected static bool BumpDown(SimDescription a, SimDescription b, bool prompt, bool romantic) { Relationship relation = Relationship.Get(a, b, true); if (relation == null) { return(false); } LongTermRelationshipTypes currentState = relation.LTR.CurrentLTR; LongTermRelationshipTypes nextState = LongTermRelationshipTypes.Undefined; if (romantic) { nextState = NextNegativeRomanceState(currentState); } else { nextState = NextNegativeEnemyState(currentState); } if (nextState == LongTermRelationshipTypes.Undefined) { if (prompt) { SimpleMessageDialog.Show(Common.Localize("Romance:BumpDownTitle"), Common.Localize("Romance:TooLow")); } return(false); } /* * if (relation.LTR.RelationshipIsInappropriate(LTRData.Get(nextState))) * { * if (prompt) * { * SimpleMessageDialog.Show(Common.Localize("Romance:BumpDownTitle"), Common.Localize ("Romance:Improper", new object[] { Common.LocalizeStatus (a, b, nextState) })); * } * return false; * } */ if ((a.Partner == b) || (b.Partner == a)) { try { a.Partner = null; } catch { } try { b.Partner = null; } catch { } } ForceChangeState(relation, nextState); if (nextState == LongTermRelationshipTypes.Stranger) { Relationship.RemoveRelationship(relation); } else { if (currentState == relation.LTR.CurrentLTR) { return(false); } } StyledNotification.Format format = new StyledNotification.Format(Common.Localize("Romance:Success", a.IsFemale, new object[] { a, b, LocalizeStatus(a, b, nextState) }), StyledNotification.NotificationStyle.kGameMessagePositive); format.mTNSCategory = NotificationManager.TNSCategory.Lessons; StyledNotification.Show(format); return(true); }
protected override void OnPerform() { Dictionary <Sim, Vector3> lastOnLotPositions = new Dictionary <Sim, Vector3>(); CaregiverRoutingMonitor monitor = new CaregiverRoutingMonitor(mHouse, mHouse.LotHome); bool stopMonitoring; Sim arbitraryChild; int caregiverCount; if (mHouse.LotHome == null) { return; } else if (CaregiverRoutingMonitor.EnoughCaregiversRemain(mHouse, mHouse.LotHome, lastOnLotPositions, true, out stopMonitoring, out caregiverCount, out arbitraryChild)) { return; } else { foreach (IBonehildaCoffin coffin in mHouse.LotHome.GetObjects <IBonehildaCoffin>()) { if (coffin.isActiveAndNoBonehilda()) { coffin.ForceSpawn(); return; } } //Common.DebugNotify(delegate { return mHouse.Name + " " + caregiverCount; }); bool flag2 = CaregiverRoutingMonitor.IsLotHomeOrDaycareForHousehold(mHouse, mHouse.LotHome); Sim closestSim = null; List <Sim> list = new List <Sim>(mHouse.Sims); DaycareWorkdaySituation daycareWorkdaySituationForLot = DaycareWorkdaySituation.GetDaycareWorkdaySituationForLot(mHouse.LotHome); if ((daycareWorkdaySituationForLot != null) && daycareWorkdaySituationForLot.IsServingHousehold(mHouse)) { list.AddRange(daycareWorkdaySituationForLot.Daycare.OwnerDescription.Household.Sims); } float minDistance = float.MaxValue; foreach (Sim sim3 in list) { if (sim3.SimDescription.TeenOrAbove) { Vector3 vector; if (monitor.IsReturningToLotInQuestion(sim3, arbitraryChild)) { return; } if (sim3.IsRouting && lastOnLotPositions.TryGetValue(sim3, out vector)) { float distance = (sim3.Position - vector).LengthSqr(); if (distance < minDistance) { minDistance = distance; closestSim = sim3; } } } } if (closestSim == null) { foreach (Sim sim4 in list) { if (sim4.SimDescription.TeenOrAbove) { float distance = (sim4.Position - arbitraryChild.Position).LengthSqr(); if (distance < minDistance) { minDistance = distance; closestSim = sim4; } } } } bool flag3; bool flag4; bool flag5; if (closestSim != null) { flag3 = false; flag4 = false; InteractionInstance headInteraction = closestSim.InteractionQueue.GetHeadInteraction(); if (headInteraction != null) { flag4 = !headInteraction.CancellableByPlayer; } flag5 = true; foreach (Sim sim5 in mHouse.Sims) { if ((sim5.LotCurrent == mHouse.LotHome) && (sim5.SimDescription.ToddlerOrBelow) && (sim5.CurrentInteraction is AgeUp)) { flag5 = false; break; } } } else { return; } if (flag5) { if ((!GoHere.Settings.mInactiveChildrenAsActive) && (closestSim.IsNPC || CaregiverRoutingMonitor.TreatPlayerSimsLikeNPCs)) { if ((caregiverCount == 0x0) && (!GoHere.Settings.mAllowChildHomeAlone)) { Common.FunctionTask.Perform(monitor.DematerializeChildren); } return; } else if (!GoHere.Settings.mAllowChildHomeAlone) { if ((mHouse != Household.ActiveHousehold) || mHouse.AutoBabysitter || flag4) { flag3 = true; if (mHouse == Household.ActiveHousehold) { string str; if (flag2) { str = ChildUtils.Localize(arbitraryChild.SimDescription.IsFemale, "AutoNannyTns", new object[] { arbitraryChild }); } else { str = ChildUtils.Localize(arbitraryChild.SimDescription.IsFemale, "AutoNannyAwayFromHomeTns", new object[] { arbitraryChild }); } StyledNotification.Format format = new StyledNotification.Format(str, closestSim.ObjectId, arbitraryChild.ObjectId, StyledNotification.NotificationStyle.kSimTalking); StyledNotification.Show(format); } } else { string str2; if (flag2) { str2 = ChildUtils.Localize(arbitraryChild.SimDescription.IsFemale, "NeedNannyDialogMessage", new object[] { arbitraryChild }); } else { str2 = ChildUtils.Localize(arbitraryChild.SimDescription.IsFemale, "NeedNannyAwayFromHomeDialogMessage", new object[] { arbitraryChild }); } flag3 = TwoButtonDialog.Show(str2, ChildUtils.Localize(arbitraryChild.SimDescription.IsFemale, "NeedNannyDialogYes", new object[0x0]), ChildUtils.Localize(arbitraryChild.SimDescription.IsFemale, "NeedNannyDialogNo", new object[0x0])); } } else { flag3 = true; flag5 = true; flag2 = true; } } if (!flag5 || !flag3) { Vector3 position; if (!lastOnLotPositions.TryGetValue(closestSim, out position)) { position = Vector3.Invalid; } monitor.PushGoBackIfNeeded(closestSim, position); } else { if (!flag2) { foreach (Sim sim6 in mHouse.LotHome.GetSims()) { if (sim6.SimDescription.TeenOrAbove && !sim6.IsRouting) { flag3 = false; break; } } } if ((GoHere.Settings.mInactiveChildrenAsActive) || ((flag3 && !closestSim.IsNPC) && !CaregiverRoutingMonitor.TreatPlayerSimsLikeNPCs)) { InitiateCaregiving(mHouse); } } } }
public static void SetupSimFest(ShowStage ths) { Common.StringBuilder msg = new Common.StringBuilder("SetupSimFest"); try { if ((ths.OwnerProprietor == null) || (ths.OwnerProprietor.HasBeenDestroyed)) { if (ths.CurrentRole == null) { return; } ths.OwnerProprietor = ths.CurrentRole.SimInRole; if ((ths.OwnerProprietor == null) || (ths.OwnerProprietor.HasBeenDestroyed)) { return; } } CommonSpace.Helpers.ShowStageEx.Cleanup(ths, null); msg += "C"; List <Sim> list = new List <Sim>(); foreach (Sim sim in LotManager.Actors) { if (ths.BasicNPCPerformerTest(sim)) { list.Add(sim); } } ths.LoadStage(); PerformanceCareer.PerformanceAudiencePosture standing = PerformanceCareer.PerformanceAudiencePosture.Standing; ths.PreShowSetup(); foreach (IShowFloor floor in ths.LotCurrent.GetObjects <IShowFloor>()) { floor.ResetShowFloor(); switch (standing) { case PerformanceCareer.PerformanceAudiencePosture.Standing: floor.SetupShowFloorWithStandingLocations(); break; case PerformanceCareer.PerformanceAudiencePosture.Sitting: floor.SetupShowFloorWithSittingLocations(); break; } } msg += "A"; foreach (ICrowdMonster monster in ths.LotCurrent.GetObjects <ICrowdMonster>()) { switch (standing) { case PerformanceCareer.PerformanceAudiencePosture.Standing: monster.CreateStandingCrowdMonster(); break; case PerformanceCareer.PerformanceAudiencePosture.Sitting: monster.CreateSittingCrowdMonster(); break; } } msg += "B"; ths.mDoesPerformanceAllowDancing = false; ths.Controller.PostEvent(ShowEventType.kShowSetup); string titleText = ShowStage.LocalizeString(ths.OwnerProprietor.IsFemale, "AnnounceSimFestStart", new object[] { ths.LotCurrent.Name }); StyledNotification.Format format = new StyledNotification.Format(titleText, ths.OwnerProprietor.ObjectId, StyledNotification.NotificationStyle.kSystemMessage); StyledNotification.Show(format); ths.AddSimFestMapTags(); msg += "D"; bool addedAlarm = false; for (int i = 0x0; i < 0x3; i++) { // Custom Sim item = CreateAnNPCPerformer(ths); if (item != null) { list.Add(item); if (item.WasCreatedByAService && !addedAlarm) { addedAlarm = true; new Common.AlarmTask(9, TimeUnit.Hours, HibernateServiceSims); } } } msg += "E"; foreach (Sim sim3 in list) { if (sim3 != null) { ths.PushWatchTheShowOntoSim(sim3); } } msg += "F"; int audienceSize = ths.GetSimFestDesiredAudienceSize() - list.Count; if (audienceSize > 0x0) { ths.PullAudienceToLot(audienceSize); } msg += "G"; ths.mSimFestStartAlarm = ths.AddAlarmRepeating(10f, TimeUnit.Minutes, ths.SimFestWaitForPerformers, "SimFestWaitForPerformers", AlarmType.AlwaysPersisted); ShowStage.SimFestWait entry = ShowStage.SimFestWait.Singleton.CreateInstance(ths, ths.OwnerProprietor, new InteractionPriority(InteractionPriorityLevel.RequiredNPCBehavior), ths.OwnerProprietor.IsNPC, false) as ShowStage.SimFestWait; msg += "H"; entry.mAction = ShowStage.SimFestWait.SimFestWaitAction.WaitForPerformers; ths.OwnerProprietor.InteractionQueue.AddNext(entry); Common.DebugWriteLog(msg); } catch (ResetException) { throw; } catch (Exception e) { Common.Exception(msg, e); } }
static void AlienRefreshCallback() { if (Abductor.Settings.mDebugging) { StyledNotification.Format format = new StyledNotification.Format("Alien Household Refresh Alarm triggered!", StyledNotification.NotificationStyle.kDebugAlert); StyledNotification.Show(format); } if (Household.AlienHousehold == null) { return; } if (Household.AlienHousehold.NumMembers < AlienUtils.kAlienHouseholdNumMembers) { CASAgeGenderFlags age = RandomUtil.GetRandomObjectFromList <CASAgeGenderFlags>(AlienUtils.kAlienHouseholdValidAges); CASAgeGenderFlags gender = RandomUtil.CoinFlip() ? CASAgeGenderFlags.Male : CASAgeGenderFlags.Female; SimDescription description = AlienGenetics.MakeAlien(age, gender, GameUtils.GetCurrentWorld(), 1f, true); description.SkillManager.AddElement(SkillNames.Logic); description.SkillManager.AddElement(SkillNames.Handiness); Skill element = description.SkillManager.GetElement(SkillNames.Logic); if (element != null) { element.ForceSkillLevelUp(RandomUtil.GetInt(Abductor.Settings.mLogicSkill[0], Abductor.Settings.mLogicSkill[1])); } element = description.SkillManager.GetElement(SkillNames.Handiness); if (element != null) { element.ForceSkillLevelUp(RandomUtil.GetInt(Abductor.Settings.mHandinessSkill[0], Abductor.Settings.mHandinessSkill[1])); } if (age == CASAgeGenderFlags.Teen) { description.SkillManager.AddElement(SkillNames.LearnToDrive); element = description.SkillManager.GetElement(SkillNames.LearnToDrive); if (element != null) { element.ForceSkillLevelUp(SkillManager.GetMaximumSupportedSkillLevel(SkillNames.LearnToDrive)); } } if (GameUtils.IsInstalled(ProductVersion.EP11) && Abductor.Settings.mFutureSim) { description.TraitManager.AddHiddenElement(TraitNames.FutureSim); description.SkillManager.AddElement(SkillNames.Future); element = description.SkillManager.GetElement(SkillNames.Future); if (element != null) { element.ForceSkillLevelUp(RandomUtil.GetInt(Abductor.Settings.mAdvancedTechnologySkill[0], Abductor.Settings.mAdvancedTechnologySkill[1])); } } Household.AlienHousehold.AddSilent(description); description.OnHouseholdChanged(Household.AlienHousehold, false); } }
static void AlienActivityCallback() { if (Abductor.Settings.mDebugging) { StyledNotification.Format format = new StyledNotification.Format("Alien Visitation Alarm triggered!", StyledNotification.NotificationStyle.kDebugAlert); StyledNotification.Show(format); } if (Household.AlienHousehold == null || Household.AlienHousehold.NumMembers == 0) { Logger.Append("Alien Activity Alarm: Alien Household Null or Empty"); return; } float chance = GetActivityChance(); if (!RandomUtil.RandomChance(chance)) { Logger.Append("Alien Activity Alarm: Chance Fail " + chance); ResetAbductionHelper(); return; } List <SimDescription> aliens = GetAliens(); if (aliens == null) { Logger.Append("Alien Activity Alarm: No valid aliens"); ResetAbductionHelper(); return; } SimDescription alien = RandomUtil.GetRandomObjectFromList <SimDescription>(aliens); chance = GetAbductionChance(); if (RandomUtil.RandomChance(chance)) { chance = GetAbductionChance(true); Lot target; Sim abductee; if (IsActiveTarget(chance)) { List <Sim> abductees = GetAbductees(Household.ActiveHousehold); if (abductees == null) { Logger.Append("Alien Abduction: No abductees"); ResetAbductionHelper(); return; } abductee = RandomUtil.GetRandomObjectFromList <Sim>(abductees); target = abductee.LotCurrent; } else { List <Lot> lots = GetLots(); if (lots == null) { Logger.Append("Alien Abduction: No lots"); ResetAbductionHelper(); return; } target = RandomUtil.GetRandomObjectFromList <Lot>(lots); List <Sim> abductees = GetAbductees(target); if (abductees == null) { Logger.Append("Alien Abduction: No abductess"); ResetAbductionHelper(); return; } abductee = RandomUtil.GetRandomObjectFromList <Sim>(abductees); } AlienAbductionSituationEx.Create(alien, abductee, target); } else { Logger.Append("Alien Abduction: Chance Fail " + chance); chance = GetVisitChance(); if (RandomUtil.RandomChance(chance)) { chance = GetVisitChance(true, alien); Lot farthestLot, target; Sim visitor; if (IsActiveTarget(chance)) { farthestLot = LotManager.GetFarthestLot(Household.ActiveHouseholdLot); target = Household.ActiveHouseholdLot; visitor = alien.InstantiateOffScreen(farthestLot); //AlienSituation.Create(visitor, Household.ActiveHouseholdLot); } else { List <Lot> lots = GetLots(); if (lots == null) { Logger.Append("Alien Visit: No lots"); ResetAbductionHelper(); return; } target = RandomUtil.GetRandomObjectFromList <Lot>(lots); farthestLot = LotManager.GetFarthestLot(target); visitor = alien.InstantiateOffScreen(farthestLot); } AlienSituation.Create(visitor, target); } else { Logger.Append("Alien Visit: Chance Fail " + chance); } } ResetAbductionHelper(); }
protected static void DisplayStory(SimDescription sim, List <Pair <int, IGameObject> > list, int totalSale, bool unsold, string bornSalesmanName, Curve reputationVsStoreFeeCurve, int numberOfTopSellingItems, float makeXSimoleonsOpportunityConsignmentFeeMultiplier) { try { int reportGate = Consigner.Settings.mReportGate; Consignment consignment = sim.SkillManager.AddElement(SkillNames.Consignment) as Consignment; if (list.Count > 0x0) { float num7 = Math.Max((float)1f, (float)(totalSale * reputationVsStoreFeeCurve.Fx(consignment.Reputation))); if (consignment.OppMoneyMadeLifetimeOpportunityCompleted) { num7 *= makeXSimoleonsOpportunityConsignmentFeeMultiplier; } StringBuilder builder = new StringBuilder(); builder.Append(ShoppingRegister.LocalizeString("ItemsSoldHeader", new object[] { totalSale, (int)num7 })); builder.Append(Common.NewLine); builder.Append(Common.NewLine); list.Sort(delegate(Pair <int, IGameObject> x, Pair <int, IGameObject> y) { return(y.First - x.First); }); for (int i = 0; (i < numberOfTopSellingItems) && (i < list.Count); i++) { try { builder.Append(ShoppingRegister.LocalizeString("ItemSoldBullet", new object[] { list[i].Second.GetLocalizedName(), list[i].First })); builder.Append(Common.NewLine); } catch { } } if (sim.TraitManager.HasElement(TraitNames.SuaveSeller)) { builder.Append(ShoppingRegister.LocalizeString("SuaveSellerMention", new object[] { sim.CreatedSim })); } if (!string.IsNullOrEmpty(bornSalesmanName)) { builder.Append(ShoppingRegister.LocalizeString("PositiveFeedbackMention", new object[] { bornSalesmanName })); builder.Append(Common.NewLine); builder.Append(Common.NewLine); } if (unsold) { builder.Append(ShoppingRegister.LocalizeString("SomeItemsUnsold", new object[0x0])); } if (SimTypes.IsSelectable(sim)) { sim.CreatedSim.ShowTNSAndPlayStingIfSelectable(builder.ToString(), StyledNotification.NotificationStyle.kGameMessagePositive, ObjectGuid.InvalidObjectGuid, sim.CreatedSim.ObjectId, "sting_sales_succes"); } else if ((totalSale > reportGate) && ((!sStoryProgressionMatchesAlertLevel.Valid) || (sStoryProgressionMatchesAlertLevel.Invoke <bool>(new object[] { "Money", sim })))) { StyledNotification.Format format = new StyledNotification.Format(builder.ToString(), ObjectGuid.InvalidObjectGuid, sim.CreatedSim.ObjectId, StyledNotification.NotificationStyle.kGameMessagePositive); StyledNotification.Show(format); } sim.ModifyFunds(totalSale - ((int)num7)); sStoryProgressionAdjustFunds.Invoke <bool>(new object[] { sim, "Consignment", totalSale - ((int)num7) }); foreach (Pair <int, IGameObject> pair in list) { pair.Second.Destroy(); } EventTracker.SendEvent(new IncrementalEvent(EventTypeId.kEarnedMoneyFromSelfEployment, sim.CreatedSim, null, (float)(totalSale - ((int)num7)))); } else if (unsold) { sim.CreatedSim.ShowTNSAndPlayStingIfSelectable(ShoppingRegister.LocalizeString("AllItemsUnsold", new object[0x0]), StyledNotification.NotificationStyle.kGameMessageNegative, ObjectGuid.InvalidObjectGuid, sim.CreatedSim.ObjectId, "sting_sales_fail"); } } catch (Exception e) { Common.DebugException(sim, e); } }
public static void OnAlarm() { if (sFirstAlarm) { sFirstAlarm = false; StyledNotification.Show(new StyledNotification.Format("Work Pusher Activated", ObjectGuid.InvalidObjectGuid, ObjectGuid.InvalidObjectGuid, StyledNotification.NotificationStyle.kSystemMessage)); } int iJobSync = 0, iSchoolSync = 0; int iJobTwoHourPush = 0, iSchoolTwoHourPush = 0; string sJobNames = null, sSchoolNames = null; DateAndTime NowTime = SimClock.CurrentTime(); DateAndTime TwoHourTime = SimClock.CurrentTime(); TwoHourTime.Ticks += SimClock.ConvertToTicks(2f, TimeUnit.Hours); List <Sim> sims = new List <Sim>(Sims3.Gameplay.Queries.GetObjects <Sim>()); foreach (Sim sim in sims) { if (sim.CareerManager == null) { continue; } if (sim.Household == null) { continue; } if (sim.Household.IsServiceNpcHousehold) { continue; } { Career job = sim.Job; if (job != null) { float fPrevValue = job.HoursUntilWork; job.SetHoursUntilWork(); if (fPrevValue > job.HoursUntilWork + 1f) { iJobSync++; } if (job.ShouldBeAtWork(NowTime)) { sCarPoolers.Remove(sim); InteractionInstance instance = job.CreateWorkInteractionInstance(); if (instance != null) { if ((((AutonomyRestrictions.GetLevel() >= AutonomyLevel.Two) && kPushActive) || sim.IsNPC) && (!sim.InteractionQueue.HasInteractionOfType(instance.InteractionDefinition))) { VisitSituation.AnnounceTimeToGoToWork(sim); sim.InteractionQueue.CancelAllInteractions(); sim.InteractionQueue.Add(instance); sJobNames += "\n" + sim.Name; } } } else { if ((!sCarPoolers.ContainsKey(sim)) && (job.CurLevel != null) && (job.ShouldBeAtWork(TwoHourTime))) { // Check to see if the timer is already running, and if so, don't bother if ((job.mRegularWorkDayGoToWorkHandle == AlarmHandle.kInvalidHandle) || (AlarmManager.Global.GetTimeLeft(job.mRegularWorkDayGoToWorkHandle, TimeUnit.Minutes) <= 0)) { iJobTwoHourPush++; if (job.mRegularWorkDayTwoHoursBeforeStartHandle != AlarmHandle.kInvalidHandle) { AlarmManager.Global.RemoveAlarm(job.mRegularWorkDayTwoHoursBeforeStartHandle); job.mRegularWorkDayTwoHoursBeforeStartHandle = AlarmHandle.kInvalidHandle; } if ((!sim.IsSelectable || !job.CarpoolEnabled) || !job.CurLevel.HasCarpool) { InteractionInstance instance = job.CreateWorkInteractionInstance(); if ((instance != null) && (!sim.InteractionQueue.HasInteractionOfType(instance.InteractionDefinition))) { sim.InteractionQueue.CancelAllInteractions(); } float num = ((job.CurLevel.StartTime - NowTime.Hour) + 24f) % 24f; float time = num - job.AverageTimeToReachWork; if (time < 0f) { time = 0f; } job.mRegularWorkDayGoToWorkHandle = AlarmManager.Global.AddAlarm(time, TimeUnit.Hours, new AlarmTimerCallback(job.RegularWorkDayGoToWorkHandle), "Career: time to push go to work", AlarmType.AlwaysPersisted, job.OwnerDescription); } else { sCarPoolers.Add(sim, true); StyledNotification.Format format = new StyledNotification.Format(Localization.LocalizeString("Gameplay/Objects/Vehicles/CarpoolManager:CarpoolComing", new object[] { sim }), ObjectGuid.InvalidObjectGuid, sim.ObjectId, StyledNotification.NotificationStyle.kGameMessagePositive); StyledNotification.Show(format, job.CareerIconColored); } } } } } } { School school = sim.CareerManager.School; if (school != null) { float fPrevValue = school.HoursUntilWork; school.SetHoursUntilWork(); if (fPrevValue > school.HoursUntilWork + 1f) { iSchoolSync++; } if (school.ShouldBeAtWork(NowTime)) { sBusPoolers.Remove(sim); InteractionInstance instance = school.CreateWorkInteractionInstance(); if (instance != null) { if ((((AutonomyRestrictions.GetLevel() >= AutonomyLevel.Two) && kPushActive) || sim.IsNPC) && (!sim.InteractionQueue.HasInteractionOfType(instance.InteractionDefinition))) { VisitSituation.AnnounceTimeToGoToWork(sim); sim.InteractionQueue.CancelAllInteractions(); sim.InteractionQueue.Add(instance); sSchoolNames += "\n" + sim.Name; } } } else { if ((!sBusPoolers.ContainsKey(sim)) && (school.ShouldBeAtWork(TwoHourTime))) { // Check to see if the timer is already running, and if so, don't bother if ((school.mRegularWorkDayGoToWorkHandle == AlarmHandle.kInvalidHandle) || (AlarmManager.Global.GetTimeLeft(school.mRegularWorkDayGoToWorkHandle, TimeUnit.Minutes) <= 0)) { iSchoolTwoHourPush++; if (school.mRegularWorkDayTwoHoursBeforeStartHandle != AlarmHandle.kInvalidHandle) { AlarmManager.Global.RemoveAlarm(school.mRegularWorkDayTwoHoursBeforeStartHandle); school.mRegularWorkDayTwoHoursBeforeStartHandle = AlarmHandle.kInvalidHandle; } if (school.PickUpCarpool != null) { sBusPoolers.Add(sim, true); school.PickUpCarpool.TryShowTNS(sim, Localization.LocalizeString("Gameplay/Objects/Vehicles/CarpoolManager:SchoolBusComing", new object[] { sim }), Localization.LocalizeString("Ui/Tooltip/Hud/School:SchoolBusArrives", new object[] { SimClockUtils.GetText((int)(school.CurLevel.StartTime - 1f), 0) })); } else { InteractionInstance instance = school.CreateWorkInteractionInstance(); if ((instance != null) && (!sim.InteractionQueue.HasInteractionOfType(instance.InteractionDefinition))) { sim.InteractionQueue.CancelAllInteractions(); } float num = ((school.CurLevel.StartTime - NowTime.Hour) + 24f) % 24f; float time = num - school.AverageTimeToReachWork; if (time < 0f) { time = 0f; } school.mRegularWorkDayGoToWorkHandle = AlarmManager.Global.AddAlarm(time, TimeUnit.Hours, new AlarmTimerCallback(school.RegularWorkDayGoToWorkHandle), "Career: time to push go to work", AlarmType.AlwaysPersisted, school.OwnerDescription); } } } } } } } bool bShow = false; string msg = "Work Pusher:"; if (iJobSync > 0) { msg += "\nWork Alarms Resync'd: " + iJobSync.ToString(); bShow = true; } if (iJobTwoHourPush > 0) { msg += "\nWork Two Hour Alarms: " + iJobTwoHourPush.ToString(); bShow = true; } if (sJobNames != null) { msg += "\nPushed to Work: " + sJobNames; bShow = true; } if (iSchoolSync > 0) { msg += "\nSchool Alarms Resync'd: " + iSchoolSync.ToString(); bShow = true; } if (iSchoolTwoHourPush > 0) { msg += "\nSchool Two Hour Alarms: " + iSchoolTwoHourPush.ToString(); bShow = true; } if (sSchoolNames != null) { msg += "\nPushed to School: " + sSchoolNames;// iSchoolCount.ToString(); bShow = true; } if ((bShow) && (sVerbose)) { StyledNotification.Show(new StyledNotification.Format(msg, ObjectGuid.InvalidObjectGuid, ObjectGuid.InvalidObjectGuid, StyledNotification.NotificationStyle.kSystemMessage)); } }