protected override bool TestAffair(SimDescription sim, SimDescription target) { if (!Filter.AllowAffair) { return(false); } if (!TargetFilter.AllowAffair) { return(false); } Managers.Manager.AllowCheck check = Managers.Manager.AllowCheck.None; if (!Romances.AllowAdultery(this, sim, check)) { return(false); } if (target.Partner != null) { if (!Romances.AllowLiaison(this, sim, check)) { return(false); } } if (!Romances.AllowAdultery(this, target, check)) { return(false); } if (sim.Partner != null) { if (!Romances.AllowLiaison(this, target, check)) { return(false); } } return(true); }
protected override void PrivateUpdate(bool fullUpdate, bool initialPass) { if (initialPass) { UpdateEAFlag(); } if ((ProgressionEnabled) && (fullUpdate)) { mFlirtPool.Clear(); mFlirtySims.Clear(); float gaySims = 0; float straightSims = 0; CalculateGayRatio(ref gaySims, ref straightSims); int maximumGayRatio = GetValue <MaximumGayRatioOption, int>(); foreach (SimDescription sim in Sims.All) { if (sim.TeenOrAbove) { if (sim.Household == null) { continue; } bool allowGay = ((gaySims / straightSims) * 100) < maximumGayRatio; SetGenderPreference(sim, allowGay); DetermineGayRatio(sim, ref gaySims, ref straightSims); if (!Allow(this, sim)) { continue; } if (!sim.Marryable) { continue; } int score = 0; if (Romances.AllowAdultery(this, sim, AllowCheck.None)) { score = AddScoring("FlirtyPartner", sim); } bool bAddedToPool = false; if ((AddScoring("FlirtySingle", sim) > 0) && ((sim.Partner == null) || (score > 0))) { mFlirtySims.Add(sim); mFlirtPool.Add(sim); bAddedToPool = true; } if ((sim.Partner == null) && (!bAddedToPool)) { mFlirtPool.Add(sim); } } } AddStat("Flirty Sims", mFlirtySims.Count); AddStat("Flirt Pool", mFlirtPool.Count); mPreviousLoveLoss = null; } base.PrivateUpdate(fullUpdate, initialPass); }