//Sims3.Gameplay.Core.Mailbox//Oldprivate void PreReturnHome(){ GameStates.PreReturnHome -= new GameStates.TravelCallback(this.PreReturnHome); Sim activeActor = Sim.ActiveActor; List<IGameObject> list = base.Inventory.FindAll<IGameObject>(false); bool flag = (list.Count > 0) || (this.mInvisibleObjectList.Count > 0); foreach (GameObject obj2 in list) { if (base.Inventory.TryToRemove(obj2)) { if (obj2 is AttractionGift) { IAmPutInMailbox mailbox = obj2 as IAmPutInMailbox; if (mailbox != null) { mailbox.OnRemovalFromMailbox(activeActor); } } else { activeActor.Inventory.TryToAdd(obj2); } } } foreach (IGameObject obj3 in this.mInvisibleObjectList) { activeActor.Inventory.TryToAdd(obj3); } GameStates.ItemsAddedToTraveller = flag;}//Newprivate void PreReturnHome(){ GameStates.PreReturnHome -= new GameStates.TravelCallback(this.PreReturnHome); Sim activeActor = Sim.ActiveActor; List<IGameObject> list = base.Inventory.FindAll<IGameObject>(false); bool flag = (list.Count > 0) || (this.mInvisibleObjectList.Count > 0); foreach (GameObject obj2 in list) { IAmPutInMailbox mailbox = obj2 as IAmPutInMailbox; if (mailbox != null) { mailbox.OnRemovalFromMailbox(activeActor); } if ((base.Inventory.TryToRemove(obj2) && !(obj2 is AttractionGift)) && !(obj2 is LoveLetter)) { activeActor.Inventory.TryToAdd(obj2); } if (mailbox != null) { mailbox.OnTransferComplete(activeActor); } } foreach (IGameObject obj3 in this.mInvisibleObjectList) { activeActor.Inventory.TryToAdd(obj3); } GameStates.ItemsAddedToTraveller = flag;}
//Sims3.Gameplay.Core.Mailbox//Oldprivate bool GrabMail(IActor a){ bool flag = true; List<IAmPutInMailbox> list = new List<IAmPutInMailbox>(); foreach (GameObject obj2 in base.Inventory.FindAll<IGameObject>(false)) { IAmPutInMailbox item = obj2 as IAmPutInMailbox; if (item != null) { item.OnRemovalFromMailbox(a as Sim); list.Add(item); } if (base.Inventory.TryToRemove(obj2)) { if (!a.Inventory.TryToAdd(obj2)) { flag = false; } } else { flag = false; } } foreach (IAmPutInMailbox mailbox2 in list) { mailbox2.OnTransferComplete(a as Sim); } return flag;}//Newprivate bool GrabMail(IActor a){ bool flag = true; foreach (GameObject obj2 in base.Inventory.FindAll<IGameObject>(false)) { IAmPutInMailbox mailbox = obj2 as IAmPutInMailbox; if (mailbox != null) { mailbox.OnRemovalFromMailbox(a as Sim); } if (base.Inventory.TryToRemove(obj2)) { if ((!(obj2 is AttractionGift) && !(obj2 is LoveLetter)) && !a.Inventory.TryToAdd(obj2)) { flag = false; } } else { flag = false; } if (mailbox != null) { mailbox.OnTransferComplete(a as Sim); } } return flag;}
//Sims3.Gameplay.Core.LoveLetter//Oldpublic void OnRemovalFromMailbox(Sim actor){ IMiniSimDescription iMiniSimDescription; IMiniSimDescription description2; TNSNames loveLetterSpontaneousNoRomanticState; if (this.IsResponse) { bool accepted = this.DecideAcceptReject(out iMiniSimDescription, out description2); loveLetterSpontaneousNoRomanticState = accepted ? TNSNames.LoveLetterResponseAccept : TNSNames.LoveLetterResponseReject; string name = accepted ? "sting_loveletter_accept" : "sting_loveletter_reject"; Audio.StartObjectSound(actor.ObjectId, name, false); NotificationSystem.Show(loveLetterSpontaneousNoRomanticState, iMiniSimDescription.GetThumbnailKey(ThumbnailSize.Medium, 0), description2.GetThumbnailKey(ThumbnailSize.Medium, 0), null, null, new bool[] { iMiniSimDescription.IsFemale, description2.IsFemale }, false, null, new object[] { iMiniSimDescription, description2 }); this.UpdateLTRAndRomanceVisibilityIfNeeded(actor, accepted); } else { iMiniSimDescription = SimDescription.GetIMiniSimDescription(this.ActorSimID); description2 = SimDescription.GetIMiniSimDescription(this.TargetSimID); IMiniRelationship miniRelationship = iMiniSimDescription.GetMiniRelationship(description2); if (miniRelationship != null) { if (miniRelationship.AreRomantic()) { loveLetterSpontaneousNoRomanticState = (miniRelationship.CurrentLTRLiking >= kLTRForHighRomanceTNS) ? TNSNames.LoveLetterSpontaneousHighRomantic : TNSNames.LoveLetterSpontaneousMediumRomantic; } else { loveLetterSpontaneousNoRomanticState = TNSNames.LoveLetterSpontaneousNoRomanticState; } NotificationSystem.Show(loveLetterSpontaneousNoRomanticState, iMiniSimDescription.GetThumbnailKey(ThumbnailSize.Medium, 0), description2.GetThumbnailKey(ThumbnailSize.Medium, 0), null, null, new bool[] { iMiniSimDescription.IsFemale, description2.IsFemale }, false, null, new object[] { iMiniSimDescription, description2 }); } SimDescription description3 = iMiniSimDescription as SimDescription; if (description3 != null) { Sim createdSim = description3.CreatedSim; if (createdSim != null) { EventTracker.SendEvent(new MiniSimDescriptionTargetEvent(EventTypeId.kGetLoveLetterFromSim, createdSim, description2)); } } }}//Newpublic void OnRemovalFromMailbox(Sim actor){ IMiniSimDescription actorMSD = null; IMiniSimDescription targetMSD = null; TNSNames loveLetterSpontaneousNoRomanticState; if (this.IsResponse) { bool accepted = this.DecideAcceptReject(out actorMSD, out targetMSD); if ((actorMSD != null) && (targetMSD != null)) { loveLetterSpontaneousNoRomanticState = accepted ? TNSNames.LoveLetterResponseAccept : TNSNames.LoveLetterResponseReject; string name = accepted ? "sting_loveletter_accept" : "sting_loveletter_reject"; Audio.StartObjectSound(actor.ObjectId, name, false); NotificationSystem.Show(loveLetterSpontaneousNoRomanticState, actorMSD.GetThumbnailKey(ThumbnailSize.Medium, 0), targetMSD.GetThumbnailKey(ThumbnailSize.Medium, 0), null, null, new bool[] { actorMSD.IsFemale, targetMSD.IsFemale }, false, null, new object[] { actorMSD, targetMSD }); this.UpdateLTRAndRomanceVisibilityIfNeeded(actor, accepted); } } else { actorMSD = SimDescription.GetIMiniSimDescription(this.ActorSimID); targetMSD = SimDescription.GetIMiniSimDescription(this.TargetSimID); if ((actorMSD != null) && (targetMSD != null)) { IMiniRelationship miniRelationship = actorMSD.GetMiniRelationship(targetMSD); if (miniRelationship != null) { if (miniRelationship.AreRomantic()) { loveLetterSpontaneousNoRomanticState = (miniRelationship.CurrentLTRLiking >= kLTRForHighRomanceTNS) ? TNSNames.LoveLetterSpontaneousHighRomantic : TNSNames.LoveLetterSpontaneousMediumRomantic; } else { loveLetterSpontaneousNoRomanticState = TNSNames.LoveLetterSpontaneousNoRomanticState; } NotificationSystem.Show(loveLetterSpontaneousNoRomanticState, actorMSD.GetThumbnailKey(ThumbnailSize.Medium, 0), targetMSD.GetThumbnailKey(ThumbnailSize.Medium, 0), null, null, new bool[] { actorMSD.IsFemale, targetMSD.IsFemale }, false, null, new object[] { actorMSD, targetMSD }); } SimDescription description3 = actorMSD as SimDescription; if (description3 != null) { Sim createdSim = description3.CreatedSim; if (createdSim != null) { EventTracker.SendEvent(new MiniSimDescriptionTargetEvent(EventTypeId.kGetLoveLetterFromSim, createdSim, targetMSD)); } } } }}