public void restoreOldRelationship(Sim buyer) { Sim seller = SimInRole(); if (mRelationsToRestore.ContainsKey(buyer) && seller != null) { RelationData relationshipBefore = mRelationsToRestore[buyer]; Relationship relationship = seller.GetRelationship(buyer, true); relationship.LTR.SetLiking(relationshipBefore.liking); if (!relationshipBefore.buyerLostAFriend && HasMoodlet(buyer, BuffNames.LostAFriend, Origin.FromSocialization)) { buyer.BuffManager.RemoveElement(BuffNames.LostAFriend); } if (!relationshipBefore.sellerLostAFriend && HasMoodlet(seller, BuffNames.LostAFriend, Origin.FromSocialization)) { seller.BuffManager.RemoveElement(BuffNames.LostAFriend); } if (!relationshipBefore.areRomantic) { relationship.LTR.RemoveInteractionBit(LongTermRelationship.InteractionBits.Romantic); } mRelationsToRestore.Remove(buyer); if (Message.Sender.IsDebugging()) { Message.Sender.Debug(this, "Relationship to " + buyer.FullName + " restored "); } } }
public void storeAndIncreaseRelationship(Sim buyer, Relationship relationship) { Sim seller = SimInRole(); if (!mRelationsToRestore.ContainsKey(buyer) && seller != null) { RelationData data = new RelationData(); data.buyerLostAFriend = HasMoodlet(buyer, BuffNames.LostAFriend, Origin.FromSocialization); data.sellerLostAFriend = HasMoodlet(seller, BuffNames.LostAFriend, Origin.FromSocialization); data.liking = relationship.CurrentLTRLiking; if (relationship.AreRomantic()) { data.areRomantic = true; } else { relationship.LTR.AddInteractionBit(LongTermRelationship.InteractionBits.Romantic); } if (relationship.AreFriends()) { data.areFriends = true; } else { relationship.LTR.SetLiking(100f); } mRelationsToRestore.Add(buyer, data); } }