Пример #1
0
        public static bool SatisfiesTryForBaby(Sim actor, Sim target, string logName, bool isAutonomous, bool scoreTarget, ref GreyedOutTooltipCallback callback)
        {
            using (Common.TestSpan span = new Common.TestSpan(ScoringLookup.Stats, "Duration " + logName, Common.DebugLevel.Stats))
            {
                int speciesIndex = PersistedSettings.GetSpeciesIndex(actor);

                if (isAutonomous)
                {
                    if (!Woohooer.Settings.mTryForBabyAutonomousV2[speciesIndex])
                    {
                        return(false);
                    }

                    if (!Woohooer.Settings.mAllowOffLotTryForBabyAutonomous[speciesIndex])
                    {
                        if (actor.LotCurrent != Household.ActiveHousehold.LotHome)
                        {
                            return(false);
                        }
                    }
                }

                if ((!scoreTarget) && (!CommonWoohoo.SatisfiesUserLikingGate(actor, target, isAutonomous, true, logName)))
                {
                    callback = Common.DebugTooltip("Liking Gate Fail");
                    return(false);
                }

                if (!CommonSocials.SatisfiedInteractionLevel(actor, target, isAutonomous, ref callback))
                {
                    return(false);
                }

                if (!WoohooInteractionLevelSetting.Satisfies(actor, target, true))
                {
                    ScoringLookup.IncStat(logName + " Interaction Level Fail");

                    callback = Common.DebugTooltip("Interaction Level Fail");
                    return(false);
                }

                if (!CommonWoohoo.SatisfiesCooldown(actor, target, isAutonomous, ref callback))
                {
                    return(false);
                }

                string reason;
                if (!CanTryForBaby(actor, target, isAutonomous, CommonWoohoo.WoohooStyle.TryForBaby, ref callback, out reason))
                {
                    ScoringLookup.IncStat(logName + " " + reason);
                    return(false);
                }

                WoohooScoring.ScoreTestResult result = WoohooScoring.ScoreActor(logName, actor, target, isAutonomous, "InterestInTryForBaby", true);
                if (result != WoohooScoring.ScoreTestResult.Success)
                {
                    ScoringLookup.IncStat(logName + " " + result);

                    callback = Common.DebugTooltip("Actor Scoring Fail " + result);
                    return(false);
                }

                if (scoreTarget)
                {
                    result = WoohooScoring.ScoreTarget(logName, target, actor, isAutonomous, "InterestInTryForBaby", true);
                    if (result != WoohooScoring.ScoreTestResult.Success)
                    {
                        ScoringLookup.IncStat(logName + " " + result);

                        callback = Common.DebugTooltip("Target Scoring Fail " + result);
                        return(false);
                    }
                }

                ScoringLookup.IncStat(logName + " Success");
                return(true);
            }
        }
Пример #2
0
        public static bool SatisfiesWoohoo(Sim actor, Sim target, string logName, bool isAutonomous, bool scoreTarget, bool testLiking, ref GreyedOutTooltipCallback callback)
        {
            using (Common.TestSpan span = new Common.TestSpan(ScoringLookup.Stats, "Duration " + logName, Common.DebugLevel.Stats))
            {
                if (isAutonomous)
                {
                    if (!Woohooer.Settings.mWoohooAutonomousV2[PersistedSettings.GetSpeciesIndex(actor)])
                    {
                        callback = Common.DebugTooltip("Autonomous Denied");

                        ScoringLookup.IncStat(logName + " Autonomous Denied");
                        return(false);
                    }
                }

                if (!Woohooer.Settings.mAllowZombie)
                {
                    if ((actor.SimDescription.IsZombie) || (target.SimDescription.IsZombie))
                    {
                        callback = Common.DebugTooltip("Zombie");

                        ScoringLookup.IncStat(logName + " Zombie");
                        return(false);
                    }
                }

                if (testLiking)
                {
                    if (Woohooer.Settings.mHideWoohoo)
                    {
                        callback = Common.DebugTooltip("Hide Woohoo");

                        ScoringLookup.IncStat(logName + " Hide Woohoo");
                        return(false);
                    }

                    if ((!scoreTarget) && (!SatisfiesUserLikingGate(actor, target, isAutonomous, true, logName)))
                    {
                        callback = Common.DebugTooltip("Liking Gate Fail");

                        ScoringLookup.IncStat(logName + " Liking Gate Fail");
                        return(false);
                    }

                    if (!WoohooInteractionLevelSetting.Satisfies(actor, target, true))
                    {
                        ScoringLookup.IncStat(logName + " Interaction Level Fail");

                        callback = Common.DebugTooltip("Interaction Level Fail");
                        return(false);
                    }
                }

                if (!CommonSocials.SatisfiedInteractionLevel(actor, target, isAutonomous, ref callback))
                {
                    ScoringLookup.IncStat(logName + " InteractionLevel Fail");
                    return(false);
                }

                if (!SatisfiesCooldown(actor, target, isAutonomous, ref callback))
                {
                    ScoringLookup.IncStat(logName + " Cooldown Fail");
                    return(false);
                }

                string reason;
                if (!CommonSocials.CanGetRomantic(actor, target, isAutonomous, true, testLiking, ref callback, out reason))
                {
                    ScoringLookup.IncStat(logName + " " + reason);
                    return(false);
                }

                WoohooScoring.ScoreTestResult result = WoohooScoring.ScoreActor(logName, actor, target, isAutonomous, "InterestInWoohoo", true);
                if (result != WoohooScoring.ScoreTestResult.Success)
                {
                    ScoringLookup.IncStat(logName + " " + result);

                    callback = Common.DebugTooltip("Actor Scoring Fail " + result);
                    return(false);
                }

                if (scoreTarget)
                {
                    result = WoohooScoring.ScoreTarget(logName, target, actor, isAutonomous, "InterestInWoohoo", true);
                    if (result != WoohooScoring.ScoreTestResult.Success)
                    {
                        ScoringLookup.IncStat(logName + " " + result);

                        callback = Common.DebugTooltip("Target Scoring Fail " + result);
                        return(false);
                    }
                }

                ScoringLookup.IncStat(logName + " Success");
                return(true);
            }
        }