Пример #1
0
        public static bool NeedPrivacy(bool inherent, Sim actor, Sim target)
        {
            if (inherent)
            {
                return(false);
            }
            else if (Woohooer.Settings.mEnforcePrivacy)
            {
                return(true);
            }
            else if ((Woohooer.Settings.mTraitScoredPrivacy) && (Woohooer.Settings.UsingTraitScoring))
            {
                if ((!WoohooScoring.TestScoringNormal(actor, target, "Privacy", false)) &&
                    (!WoohooScoring.TestScoringNormal(target, actor, "Privacy", false)))
                {
                    return(false);
                }

                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #2
0
        protected static void OnRecalulateDesire()
        {
            try
            {
                List <Sim> sims = new List <Sim>();
                foreach (Sim sim in LotManager.Actors)
                {
                    try
                    {
                        if (sim.InteractionQueue == null)
                        {
                            continue;
                        }

                        if (sim.InteractionQueue.GetCurrentInteraction() is SocialInteraction)
                        {
                            continue;
                        }

                        if (sim.Autonomy == null)
                        {
                            continue;
                        }

                        if (sim.Autonomy.SituationComponent == null)
                        {
                            continue;
                        }

                        if (sim.Autonomy.SituationComponent.mSituations == null)
                        {
                            continue;
                        }

                        if (sim.Autonomy.SituationComponent.mSituations.Count > 0)
                        {
                            ScoringLookup.IncStat("STC Desire In Situation");
                            continue;
                        }

                        sims.Add(sim);
                    }
                    catch (Exception e)
                    {
                        Common.Exception(sim, e);
                    }
                }

                foreach (Sim sim in sims)
                {
                    try
                    {
                        SocialComponent social = sim.SocialComponent;
                        if (social == null)
                        {
                            continue;
                        }

                        social.mShortTermDesireToSocializeWith.Clear();

                        if (!Woohooer.Settings.UsingTraitScoring)
                        {
                            continue;
                        }

                        if (sim.Autonomy.Actor == null)
                        {
                            continue;
                        }

                        if (!sim.Autonomy.ShouldRunLocalAutonomy)
                        {
                            continue;
                        }

                        if (sim.LotCurrent == null)
                        {
                            continue;
                        }

                        if (sim.LotCurrent.IsWorldLot)
                        {
                            continue;
                        }

                        SpeedTrap.Sleep();

                        if (!WoohooScoring.TestScoringNormal(sim, null, "InterestInRomance", true))
                        {
                            ScoringLookup.IncStat("STC Desire Fail");
                            continue;
                        }

                        ScoringLookup.IncStat("STC Desire Success");

                        List <Sim> others = new List <Sim>(sim.LotCurrent.GetAllActors());
                        foreach (Sim other in others)
                        {
                            if (sim == other)
                            {
                                continue;
                            }

                            string reason;
                            GreyedOutTooltipCallback callback = null;
                            if (!CommonSocials.CanGetRomantic(sim, other, true, false, true, ref callback, out reason))
                            {
                                continue;
                            }

                            int std = (int)(RelationshipEx.GetAttractionScore(sim.SimDescription, other.SimDescription, false) * 2);

                            ScoringLookup.AddStat("Desire " + sim.FullName, std);

                            social.AddShortTermDesireToSocializeWith(other, std);

                            SpeedTrap.Sleep();
                        }
                    }
                    catch (Exception e)
                    {
                        Common.Exception(sim, e);
                    }
                }
            }
            catch (Exception e)
            {
                Common.Exception("STCDesire:OnRecalculateDesire", e);
            }
        }