Beispiel #1
0
        // From SocialComponent
        private static List <InteractionObjectPair> GetUnfilteredSocials(SocialComponent ths, Sim actor, Sim target, Relationship r)
        {
            string msg = actor.FullName;

            msg += Common.NewLine + target.FullName;

            bool isAutonomous = false;
            List <InteractionObjectPair> results = new List <InteractionObjectPair>();

            if (actor != target)
            {
                bool flag2;
                int  numSocials = STCData.GetNumSocials(ths.Conversation);

                SocialInteractionCandidateCollection candidates = new SocialInteractionCandidateCollectionEx(actor, target, r, ths.Conversation, isAutonomous, ref msg);

                Conversation.GetCurrentSTC(actor, target, r, ths.Conversation, out flag2);
                foreach (CommodityTypes str in CommodityData.AllPlayableCommodities)
                {
                    using (Common.TestSpan span = new Common.TestSpan(TimeSpanLogger.Bin, "Commodity: " + str, Common.DebugLevel.Stats))
                    {
                        msg += Common.NewLine + "1 " + str;

                        switch (str)
                        {
                        case CommodityTypes.Amorous:
                        {
                            if ((actor.CanGetRomantic(target, false) || !actor.SimDescription.IsHuman) || !target.SimDescription.IsHuman)
                            {
                                break;
                            }
                            results.Add(new InteractionObjectPair(Sim.BetrayedSimsFutileRomance.Singleton, target));
                            continue;
                        }

                        case CommodityTypes.Steamed:
                        {
                            if (!r.STC.IsPositive)
                            {
                                break;
                            }
                            continue;
                        }

                        case CommodityTypes.Insulting:
                            if (isAutonomous && actor.BuffManager.HasElement(BuffNames.Admonished))
                            {
                                continue;
                            }
                            break;
                        }

                        msg += Common.NewLine + "2 " + str;

                        int num2 = numSocials;
                        if (CommodityData.AppearsAsSubMenu(str))
                        {
                            msg += Common.NewLine + "AppearsAsSubMenu " + str;

                            List <SocialInteractionCandidate> socialsFor = candidates.GetSocialsFor(str);
                            if (socialsFor != null)
                            {
                                msg += Common.NewLine + "socialsFor " + str + " " + socialsFor.Count;

                                string changeToneText = CommodityData.Get(str).GetChangeToneText();
                                AddSocials(ths, actor, target, socialsFor, isAutonomous, num2, results, new string[] { changeToneText }, TraitNames.Unknown, ref msg);
                                if (str == CommodityTypes.Friendly)
                                {
                                    List <SocialInteractionCandidate> socials = candidates.GetSocialsFor(CommodityTypes.Neutral);
                                    if (socials != null)
                                    {
                                        AddSocials(ths, actor, target, socials, isAutonomous, num2, results, new string[] { changeToneText }, TraitNames.Unknown, ref msg);
                                    }
                                }
                            }
                        }
                    }
                }

                string str3 = Localization.LocalizeString("Gameplay/Socializing:Special", new object[0x0]);
                foreach (Trait trait in actor.TraitManager.List)
                {
                    List <SocialInteractionCandidate> list4 = candidates.GetSocialsFor(trait.Guid);
                    if ((list4 != null) && (list4.Count > 0x0))
                    {
                        string   str5             = trait.TraitName(actor.IsFemale);
                        string[] inlineParentMenu = new string[] { str3, str5 + Localization.Ellipsis };
                        AddSocials(ths, actor, target, list4, isAutonomous, numSocials, results, inlineParentMenu, trait.Guid, ref msg);
                    }
                }

                if (((ths.Conversation != null) && (actor.Household != target.Household)) && ((!actor.IsAtHome || target.IsAtHome) && (actor.IsAtHome || !target.IsAtHome)))
                {
                    SocialInteractionCandidate candidate = new SocialInteractionCandidate(ths.GetGoodbyeSocial(actor, target), new string[0], null);
                    ths.AddSocials(actor, target, new List <SocialInteractionCandidate>(new SocialInteractionCandidate[] { candidate }), isAutonomous, numSocials, results, new string[0x0], TraitNames.Unknown);
                }
            }

            Common.WriteLog(msg);

            return(results);
        }
Beispiel #2
0
        // From SocialComponent
        private static List<InteractionObjectPair> GetUnfilteredSocials(SocialComponent ths, Sim actor, Sim target, Relationship r)
        {
            string msg = actor.FullName;
            msg += Common.NewLine + target.FullName;

            bool isAutonomous = false;
            List<InteractionObjectPair> results = new List<InteractionObjectPair>();
            if (actor != target)
            {
                bool flag2;
                int numSocials = STCData.GetNumSocials(ths.Conversation);

                SocialInteractionCandidateCollection candidates = new SocialInteractionCandidateCollectionEx(actor, target, r, ths.Conversation, isAutonomous, ref msg);

                Conversation.GetCurrentSTC(actor, target, r, ths.Conversation, out flag2);
                foreach (CommodityTypes str in CommodityData.AllPlayableCommodities)
                {
                    using (Common.TestSpan span = new Common.TestSpan(TimeSpanLogger.Bin, "Commodity: " + str, Common.DebugLevel.Stats))
                    {
                        msg += Common.NewLine + "1 " + str;

                        switch (str)
                        {
                            case CommodityTypes.Amorous:
                                {
                                    if ((actor.CanGetRomantic(target, false) || !actor.SimDescription.IsHuman) || !target.SimDescription.IsHuman)
                                    {
                                        break;
                                    }
                                    results.Add(new InteractionObjectPair(Sim.BetrayedSimsFutileRomance.Singleton, target));
                                    continue;
                                }
                            case CommodityTypes.Steamed:
                                {
                                    if (!r.STC.IsPositive)
                                    {
                                        break;
                                    }
                                    continue;
                                }
                            case CommodityTypes.Insulting:
                                if (isAutonomous && actor.BuffManager.HasElement(BuffNames.Admonished))
                                {
                                    continue;
                                }
                                break;
                        }

                        msg += Common.NewLine + "2 " + str;

                        int num2 = numSocials;
                        if (CommodityData.AppearsAsSubMenu(str))
                        {
                            msg += Common.NewLine + "AppearsAsSubMenu " + str;

                            List<SocialInteractionCandidate> socialsFor = candidates.GetSocialsFor(str);
                            if (socialsFor != null)
                            {
                                msg += Common.NewLine + "socialsFor " + str + " " + socialsFor.Count;

                                string changeToneText = CommodityData.Get(str).GetChangeToneText();
                                AddSocials(ths, actor, target, socialsFor, isAutonomous, num2, results, new string[] { changeToneText }, TraitNames.Unknown, ref msg);
                                if (str == CommodityTypes.Friendly)
                                {
                                    List<SocialInteractionCandidate> socials = candidates.GetSocialsFor(CommodityTypes.Neutral);
                                    if (socials != null)
                                    {
                                        AddSocials(ths, actor, target, socials, isAutonomous, num2, results, new string[] { changeToneText }, TraitNames.Unknown, ref msg);
                                    }
                                }
                            }
                        }
                    }
                }

                string str3 = Localization.LocalizeString("Gameplay/Socializing:Special", new object[0x0]);
                foreach (Trait trait in actor.TraitManager.List)
                {
                    List<SocialInteractionCandidate> list4 = candidates.GetSocialsFor(trait.Guid);
                    if ((list4 != null) && (list4.Count > 0x0))
                    {
                        string str5 = trait.TraitName(actor.IsFemale);
                        string[] inlineParentMenu = new string[] { str3, str5 + Localization.Ellipsis };
                        AddSocials(ths, actor, target, list4, isAutonomous, numSocials, results, inlineParentMenu, trait.Guid, ref msg);
                    }
                }

                if (((ths.Conversation != null) && (actor.Household != target.Household)) && ((!actor.IsAtHome || target.IsAtHome) && (actor.IsAtHome || !target.IsAtHome)))
                {
                    SocialInteractionCandidate candidate = new SocialInteractionCandidate(ths.GetGoodbyeSocial(actor, target), new string[0], null);
                    ths.AddSocials(actor, target, new List<SocialInteractionCandidate>(new SocialInteractionCandidate[] { candidate }), isAutonomous, numSocials, results, new string[0x0], TraitNames.Unknown);
                }
            }

            Common.WriteLog(msg);

            return results;
        }