Esempio n. 1
0
        private static bool WillSimComeToParty(SimDescription guest, Sim host, float fMaxLTR, bool bHostIsLegendary)
        {
            if (bHostIsLegendary || host.HasTrait(TraitNames.PartyAnimal))
            {
                return(true);
            }

            Relationship relationshipToParty = null;

            try
            {
                relationshipToParty = HostedSituation.GetRelationshipToHostedSituation(host.SimDescription, guest);
            }
            catch
            { }

            if (relationshipToParty == null)
            {
                return(false);
            }
            if (relationshipToParty.AreFriends() || relationshipToParty.AreRomantic())
            {
                return(true);
            }
            float num = MathUtils.Clamp(relationshipToParty.LTR.Liking, HouseParty.kLTRMinToInvite, fMaxLTR);

            return(RandomUtil.InterpolatedChance(HouseParty.kLTRMinToInvite, fMaxLTR, (float)HouseParty.kChanceToComeAtMinLTR, (float)HouseParty.kChanceToComeAtMaxLTR, num));
        }
        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);
            }
        }
Esempio n. 3
0
        public bool HaveRelationship()
        {
            Relationship relationship = Actor.GetRelationship(Target, false);

            if (relationship != null && relationship.AreEnemies())
            {
                return(false);
            }

            // <WISHLIST> May checks for good Samaritan Sims </WISHLIST>
            if (relationship == null || !relationship.AreFriends())
            {
                return(false);
            }

            if (relationship.MarriedInGame)
            {
                return(true);
            }
            else if (Target.Genealogy.IsParentOrStepParent(Actor.Genealogy))
            {
                return(true);
            }
            else if (Actor.IsBloodRelated(Target))
            {
                return(true);
            }
            else if (relationship.AreRoommates())
            {
                return(true);
            }

            return(true);
        }
Esempio n. 4
0
            protected bool Matches(Relationship relation)
            {
                if (relation != null)
                {
                    if ((Value & AlertLevel.Friends) == AlertLevel.Friends)
                    {
                        if (relation.AreFriends())
                        {
                            return(true);
                        }
                    }

                    if ((Value & AlertLevel.Enemies) == AlertLevel.Enemies)
                    {
                        if (relation.AreEnemies())
                        {
                            return(true);
                        }
                    }

                    if ((Value & AlertLevel.Romantic) == AlertLevel.Romantic)
                    {
                        if (relation.AreRomantic())
                        {
                            return(true);
                        }
                    }
                }

                return(false);
            }
Esempio n. 5
0
        public static List <PhoneSimPicker.SimPickerInfo> ListOfAllSims(Sim me)
        {
            List <PhoneSimPicker.SimPickerInfo> sims = new List <PhoneSimPicker.SimPickerInfo>();

            List <Sim> list = new List <Sim>(Sims3.Gameplay.Queries.GetObjects <Sim>());

            foreach (Sim sim in list)
            {
                if (sim.LotCurrent != me.LotCurrent)
                {
                    continue;
                }

                if (!sim.SimDescription.TeenOrAbove)
                {
                    continue;
                }

                PhoneSimPicker.SimPickerInfo item = new PhoneSimPicker.SimPickerInfo();
                item.FirstName      = sim.SimDescription.LastName + ",";
                item.LastName       = sim.SimDescription.FirstName;
                item.Thumbnail      = sim.SimDescription.GetThumbnailKey(ThumbnailSize.Large, 0);
                item.SimDescription = sim.SimDescription;

                Relationship relation = Relationship.Get(sim.SimDescription, me.SimDescription, false);
                if (relation != null)
                {
                    item.RelationShip      = relation.LTR.Liking;
                    item.RelationshipImage = relation.LTR.CurrentLTR;
                    item.Friend            = relation.AreFriends();
                }
                else if (sim == me)
                {
                    item.RelationShip      = 100f;
                    item.RelationshipImage = "Best Friend";
                    item.Friend            = true;
                }
                else
                {
                    item.RelationShip      = 0f;
                    item.RelationshipImage = "Stranger";
                    item.Friend            = false;
                }

                item.RelationshipText          = LTRData.Get(item.RelationshipImage).GetName(me.SimDescription, sim.SimDescription);
                item.RelationshipWithFirstName = me.SimDescription.FirstName;

                item.CoWorker = false;
                if ((me.CareerManager != null) && (me.CareerManager.Job != null))
                {
                    if (sim.SimDescription == me.CareerManager.Job.Boss)
                    {
                        item.CoWorker = true;
                    }
                    else
                    {
                        foreach (SimDescription description2 in me.CareerManager.Job.Coworkers)
                        {
                            if (description2 == sim.SimDescription)
                            {
                                item.CoWorker = true;
                                break;
                            }
                        }
                    }
                }

                sims.Add(item);
            }

            return(sims);
        }