Beispiel #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);
            }
        }