Exemplo n.º 1
0
        protected override bool TargetAllow(SimDescription sim)
        {
            if (!ManagerRomance.IsAffair(Sim, Target))
            {
                IncStat("Not Affair");
                return(false);
            }

            int scoreA = AddScoring("CaughtCheating", GetValue <CheatDiscoveryChanceOption, int>(Sim), ScoringLookup.OptionType.Chance, Sim);
            int scoreB = AddScoring("CaughtCheating", GetValue <CheatDiscoveryChanceOption, int>(Target), ScoringLookup.OptionType.Chance, Target);

            if ((scoreA <= 0) && (scoreB <= 0))
            {
                scoreA = 0;
                if ((Sim.Partner != null) && (AddScoring("PartnerAffairAcceptance", Sim.Partner) < 0))
                {
                    scoreA = AddScoring("CatchCheating", GetValue <CheatDiscoveryChanceOption, int>(Sim.Partner), ScoringLookup.OptionType.Chance, Sim.Partner);
                }

                scoreB = 0;
                if ((Target.Partner != null) && (AddScoring("PartnerAffairAcceptance", Target.Partner) < 0))
                {
                    scoreB = AddScoring("CatchCheating", GetValue <CheatDiscoveryChanceOption, int>(Target.Partner), ScoringLookup.OptionType.Chance, Target.Partner);
                }

                if ((scoreA <= 0) && (scoreB <= 0))
                {
                    IncStat("Score Fail");
                    return(false);
                }
            }

            return(base.TargetAllow(sim));
        }
Exemplo n.º 2
0
        protected override bool TargetAllow(SimDescription sim)
        {
            if (ManagerRomance.IsAffair(Sim, Target))
            {
                if (!TestAffair(Sim, Target))
                {
                    IncStat("Affair Denied");
                    return(false);
                }
            }

            return(base.TargetAllow(sim));
        }
Exemplo n.º 3
0
        // Externalized to Woohooer
        public static string AllowAffair(SimDescription actor, SimDescription target, bool autonomous)
        {
            try
            {
                if (StoryProgression.Main == null)
                {
                    return(null);
                }

                if (!ManagerRomance.IsAffair(actor, target))
                {
                    return(null);
                }

                if (actor.Partner != null)
                {
                    if (StoryProgression.Main.GetValue <ChanceOfAdulteryOption, int>(actor) == 0)
                    {
                        return("ChanceOfAdultery");
                    }

                    if (StoryProgression.Main.GetValue <ChanceOfLiaisonOption, int>(target) == 0)
                    {
                        return("ChanceOfLiaison");
                    }
                }

                if (target.Partner != null)
                {
                    if (StoryProgression.Main.GetValue <ChanceOfAdulteryOption, int>(target) == 0)
                    {
                        return("ChanceOfAdultery");
                    }

                    if (StoryProgression.Main.GetValue <ChanceOfLiaisonOption, int>(actor) == 0)
                    {
                        return("ChanceOfLiaison");
                    }
                }

                return(null);
            }
            catch (Exception e)
            {
                Common.Exception(actor, target, e);
                return(null);
            }
        }
Exemplo n.º 4
0
        protected override bool TargetAllow(SimDescription sim)
        {
            Relationship relation = ManagerSim.GetRelationship(Sim, Target);

            if (relation == null)
            {
                return(false);
            }

            if ((!mForce) && (relation.LTR.Liking <= Sims3.Gameplay.Actors.Sim.kRomanceUseLikingGate))
            {
                IncStat("Under Gate");
                return(false);
            }
            else if ((!AllowAffair) && (ManagerRomance.IsAffair(Sim, Target)))
            {
                IncStat("Affair");
                return(false);
            }

            if (Sim.Partner == Target)
            {
                IncStat("Already Partner");
                return(false);
            }
            else if (!Romances.Allow(this, Sim, Target))
            {
                return(false);
            }

            if (!mForce)
            {
                if (relation.LTR.Liking < GetValue <PartnerLikingGateOption, int>())
                {
                    AddStat("No Like", relation.LTR.Liking);
                    return(false);
                }
                else if (!relation.AreRomantic())
                {
                    IncStat("Not Romantic");
                    return(false);
                }
                else if (GetElapsedTime <DayOfLastPartnerOption>(Sim) < GetValue <MinTimeFromBreakupToPartnerOption, int>())
                {
                    AddStat("Too Early", GetElapsedTime <DayOfLastPartnerOption>(Sim));
                    return(false);
                }
                else if (GetElapsedTime <DayOfLastPartnerOption>(Target) < GetValue <MinTimeFromBreakupToPartnerOption, int>())
                {
                    AddStat("Too Early", GetElapsedTime <DayOfLastPartnerOption>(Target));
                    return(false);
                }
                else if ((AddScoring("SettleDown", Target, Sim) <= 0) &&
                         (AddScoring("SettleDown", Sim, Target) <= 0))
                {
                    IncStat("Score Fail");
                    return(false);
                }
            }

            return(base.TargetAllow(sim));
        }