protected override bool TargetAllow(SimDescription target) { if ((!IsFriendly) && (Sim.ToddlerOrBelow)) { IncStat("Too Young"); return(false); } else if ((IsRomantic) && (Sim.TeenOrAbove != target.TeenOrAbove)) { IncStat("Wrong Age"); return(false); } else if ((IsFriendly) && (TestRelationship) && (ManagerSim.GetLTR(Sim, Target) >= 100)) { IncStat("Max Liking"); return(false); } else if (Delta < 0) { if (target.ToddlerOrBelow) { IncStat("Too Young"); return(false); } else if ((TestRelationship) && (ManagerSim.GetLTR(Sim, Target) <= -100)) { IncStat("Min Liking"); return(false); } else if (!Friends.AllowEnemy(this, Sim, Target, Managers.Manager.AllowCheck.None)) { return(false); } else if ((!GetValue <AllowEnemyFamilyOption, bool>()) && ((Sim.Partner == Target) || (Relationships.IsCloselyRelated(Sim, Target, false)))) { IncStat("Closely Related Denied"); return(false); } } else if (Delta > 0) { if ((TestRelationship) && (target.CreatedSim != null) && (SnubManager.IsSnubbing(target.CreatedSim, target))) { IncStat("Snubbing"); return(false); } else if (!Friends.AllowFriend(this, Sim, Target, Managers.Manager.AllowCheck.None)) { return(false); } else if ((IsRomantic) && (!Flirts.Allow(this, Sim, Target))) { return(false); } } return(base.TargetAllow(target)); }
protected override bool CommonAllow(SimDescription sim) { if (!Flirts.Allow(this, sim)) { IncStat("User Denied"); return(false); } else if (AddScoring("Partner To Flirt Cooldown", TestElapsedTime <DayOfLastPartnerOption, MinTimeFromPartnerToFlirtOption>(sim)) < 0) { AddStat("Too Early", GetElapsedTime <DayOfLastPartnerOption>(sim)); return(false); } else if ((TestFlirtCooldown) && (AddScoring("Flirt To Flirt Cooldown", TestElapsedTime <DayOfLastRomanceOption, MinTimeBetweenFlirtsOption>(sim)) < 0)) { AddStat("Too Early", GetElapsedTime <DayOfLastRomanceOption>(sim)); return(false); } else { int maximum = GetValue <ScheduledFlirtScenario.MaximumFlirtsOption, int>(); if (maximum > 0) { int totalFlirts = 0; foreach (Relationship relation in Relationship.GetRelationships(sim)) { if (relation.AreRomantic()) { totalFlirts++; if (totalFlirts >= maximum) { IncStat("Maximum Exceeded"); return(false); } } } } } return(base.CommonAllow(sim)); }
protected override bool PrivateAllow(IScoringGenerator stats, SimDescription sim, AllowCheck check) { return(Flirts.Allow(stats, sim, check)); }