// this was done because the scoring causes the stack depth to be exceeded when a value in the PrivateAllow // function calls SimData so I check the value in the scoring instead public bool Allow(IScoringGenerator stats, SimDescription sim, bool fromScoring) { AllowCheck check = AllowCheck.None; check &= AllowCheck.Scoring; return(PrivateAllow(stats, sim, check)); }
protected bool PrivateAllow(IScoringGenerator stats, Sim sim, AllowCheck check) { if (sim == null) { return(false); } return(PrivateAllow(stats, sim.SimDescription, check)); }
public bool AllowImpregnation(IScoringGenerator stats, SimDescription sim, AllowCheck check) { if (!Allow(stats, sim, check)) { return(false); } if (SimTypes.IsTourist(sim)) { stats.IncStat("Allow: Tourist"); return(false); } if ((check & AllowCheck.Active) == AllowCheck.Active) { if (sim.Household.IsTravelHousehold) { stats.IncStat("Allow: Travel Household"); return(false); } } if (sim.LotHome == null) { if (!GetValue <NewcomerGoneScenario.AllowHomelessMoveInOptionV2, bool>()) { stats.IncStat("Allow: Homeless Move In Denied"); return(false); } } if (SimTypes.IsServiceOrRole(sim, false)) { if (SimTypes.IsOccult(sim, Sims3.UI.Hud.OccultTypes.ImaginaryFriend)) { stats.IncStat("Allow: Service Imaginary Denied"); return(false); } } if (!GetValue <AllowCanBePregnantOption, bool>(sim)) { stats.IncStat("Allow: Can Be Pregnant Denied"); return(false); } if ((sim.IsHuman) && ((check & AllowCheck.UserDirected) == AllowCheck.None)) { if (!TestNearElderLimit(stats, sim, GetValue <NearElderLimitOption, int>())) { return(false); } } return(true); }
public bool AllowMarriage(IScoringGenerator stats, SimDescription sim, AllowCheck check) { if (!Allow(stats, sim, check)) { return(false); } if (!GetValue <AllowMarriageOption, bool>(sim)) { stats.IncStat("Allow: Marriage Denied"); return(false); } return(true); }
public bool AllowLiaison(IScoringGenerator stats, SimDescription sim, AllowCheck check) { if (OnAllowLiaison == null) { return(false); } SimData settings = GetData(sim); foreach (OnAllow del in OnAllowLiaison.GetInvocationList()) { if (!del(stats, settings, check)) { return(false); } } return(true); }
public bool AllowBreakup(IScoringGenerator stats, SimDescription sim, AllowCheck check) { if (sim.Partner == null) { return(true); } if (OnAllowBreakup == null) { return(false); } SimData simData = GetData(sim); foreach (OnAllow allow in OnAllowBreakup.GetInvocationList()) { if (!allow(stats, simData, check)) { return(false); } } return(true); }
protected override bool PrivateAllow(IScoringGenerator stats, SimDescription sim, SimData settings, AllowCheck check) { if (sim.Household != null) { if (SimTypes.IsTourist(sim)) { stats.IncStat("Allow: Tourist"); return(false); } if (sim.Household.IsTravelHousehold) { stats.IncStat("Allow: Travel Household"); return(false); } } if (!settings.GetValue <AllowMoveFamilyOption, bool>()) { stats.IncStat("Allow: Move Denied"); return(false); } return(true); }
protected override bool PrivateAllow(IScoringGenerator stats, SimDescription sim, SimData settings, AllowCheck check) { if (sim.Household == null) { stats.IncStat("Allow: No Home"); return(false); } if (!settings.GetValue <AllowPregnancyParticipationOption, bool>()) { stats.IncStat("Allow: Participation Denied"); return(false); } return(true); }
public bool Allow(IScoringGenerator stats, SimDescription actor, SimDescription target, AllowCheck check) { if (!Allow(stats, actor, check)) { return(false); } if (!Allow(stats, target, check)) { return(false); } if (!Flirts.CanHaveAutonomousRomance(stats, actor, target, ((check & AllowCheck.Active) == AllowCheck.Active))) { return(false); } SimData actorData = GetData(actor); SimData targetData = GetData(target); if (!actorData.Allowed <AllowCasteCanBePregnantOption>(targetData, false)) { stats.IncStat("Can Be Caste Denied"); return(false); } else if (actorData.Disallowed <DisallowCasteCanBePregnantOption>(targetData, false)) { stats.IncStat("Can Be Caste Denied"); return(false); } else if (!actorData.Allowed <AllowCastePregnancyOption>(targetData, true)) { stats.IncStat("Participation Caste Denied"); return(false); } else if (actorData.Disallowed <DisallowCastePregnancyOption>(targetData, true)) { stats.IncStat("Participation Caste Denied"); return(false); } else if (!DualAllow(stats, actorData, targetData, check)) { return(false); } return(true); }
public bool AllowPartner(IScoringGenerator stats, SimDescription actor, SimDescription target, AllowCheck check) { if (!Allow(stats, actor, check)) { return(false); } if (!Allow(stats, target, check)) { return(false); } SimData actorData = GetData(actor); SimData targetData = GetData(target); if (!actorData.Allowed <AllowCasteRomanceOption>(targetData, true)) { stats.IncStat("Caste Romance Denied"); return(false); } else if (actorData.Disallowed <DisallowCasteRomanceOption>(targetData, true)) { stats.IncStat("Caste Romance Denied"); return(false); } else if (!DualAllow(stats, actorData, targetData, check)) { return(false); } return(true); }
public bool Allow(IScoringGenerator stats, Sim sim, AllowCheck check) { return(PrivateAllow(stats, sim, check)); }
protected override bool PrivateAllow(IScoringGenerator stats, SimDescription sim, SimData settings, AllowCheck check) { bool testRomance = true; if ((sim.Household != null) && ((check & AllowCheck.UserDirected) == AllowCheck.None)) { if (SimTypes.InServicePool(sim, ServiceType.GrimReaper)) { stats.IncStat("Allow: Reaper"); return(false); } if (sim.LotHome == null) { if (!GetValue <NewcomerGoneScenario.AllowHomelessMoveInOptionV2, bool>()) { stats.IncStat("Allow: Homeless Move In Denied"); return(false); } } } else { if (SimTypes.IsService(sim)) { testRomance = false; } } if (sim.IsEP11Bot) { if (!sim.TraitManager.HasAnyElement(sFlirtChips)) { stats.IncStat("Allow: Missing Chips"); return(false); } } if (testRomance) { if (!settings.GetValue <AllowRomanceOption, bool>()) { stats.IncStat("Allow: Romance Denied"); return(false); } } return(true); }
protected override bool PrivateAllow(IScoringGenerator stats, SimDescription sim, SimData settings, AllowCheck check) { if (!base.PrivateAllow(stats, sim, settings, check)) { return(false); } if (SimTypes.IsDead(sim)) { stats.IncStat("Allow: Dead"); return(false); } if (sim.ChildOrBelow) { stats.IncStat("Allow: Too Young"); return(false); } if (sim.IsPregnant) { stats.IncStat("Allow: Pregnant"); return(false); } if (!sim.AgingEnabled) { stats.IncStat("Allow: Aging Disabled"); return(false); } if (settings.GetValue <PushDeathChanceOption, int>() <= 0) { stats.IncStat("Allow: Sim Push Death Denied"); return(false); } return(true); }
protected override bool PrivateAllow(IScoringGenerator stats, SimDescription sim, SimData settings, AllowCheck check) { if (!settings.GetValue <AllowCasteOption, bool>()) { stats.IncStat("Allow: Caste Denied"); return(false); } return(true); }
public bool Allow(IHasPersonality stats, SimDescription sim, AllowCheck check) { return(PrivateAllow(stats, sim, check)); }
protected override bool PrivateAllow(IScoringGenerator stats, SimDescription sim, SimData settings, AllowCheck check) { if (sim.LotHome == null) { stats.IncStat("Allow: Homeless"); return(false); } if (!settings.GetValue <AllowPersonalityOption, bool>()) { stats.IncStat("Allow: User Denied"); return(false); } SimPersonality personality = stats as SimPersonality; if (personality == null) { IHasPersonality hasPersonality = stats as IHasPersonality; if (hasPersonality != null) { personality = hasPersonality.Personality; } else { Scenario scenario = stats as Scenario; if (scenario != null) { personality = scenario.Manager as SimPersonality; } } } if (personality == null) { Common.DebugStackLog(stats.GetType().ToString()); //stats.IncStat("Allow: Incorrect Manager"); //return false; } else if (settings.HasValue <DisallowPersonalityOption, SimPersonality>(personality)) { stats.IncStat("Allow: Personality Denied"); return(false); } return(true); }
protected override bool PrivateAllow(IScoringGenerator stats, SimDescription sim, AllowCheck check) { if (sim == null) { return(false); } return(PrivateAllow(stats, sim, GetData(sim), check)); }
public bool AllowAffair(IScoringGenerator stats, SimDescription actor, SimDescription target, AllowCheck check) { if (!IsAffair(actor, target)) { return(true); } if (OnAllowAffair == null) { return(false); } SimData actorData = GetData(actor); SimData targetData = GetData(target); foreach (OnDualAllowFunc del in OnAllowAffair.GetInvocationList()) { if (!del(stats, actorData, targetData, check)) { return(false); } } return(true); }
public bool Allow(IScoringGenerator stats, SimDescription actor, SimDescription target, AllowCheck check) { if (Personalities.IsOpposing(stats, actor, target, true)) { stats.IncStat("Opposing Clan"); return(false); } else if (!Flirts.CanHaveAutonomousRomance(stats, actor, target, ((check & AllowCheck.Active) == AllowCheck.Active))) { return(false); } return(AllowPartner(stats, actor, target, check)); }
protected override bool PrivateAllow(IScoringGenerator stats, SimDescription sim, AllowCheck check) { check &= ~AllowCheck.Active; return(base.PrivateAllow(stats, sim, check)); }
protected override bool PrivateAllow(IScoringGenerator stats, SimDescription sim, AllowCheck check) { return(Flirts.Allow(stats, sim, check)); }
public bool Allow(IHasSkill stats, SimDescription sim, AllowCheck check) { return(PrivateAllow(stats, sim, check)); }
public bool AllowMarriage(IScoringGenerator stats, SimDescription actor, SimDescription target, AllowCheck check) { if (!AllowMarriage(stats, actor, check)) { return(false); } if (!AllowMarriage(stats, target, check)) { return(false); } return(AllowPartner(stats, actor, target, check)); }
protected override bool PrivateAllow(IScoringGenerator stats, SimDescription sim, SimData settings, AllowCheck check) { if (!base.PrivateAllow(stats, sim, settings, check)) { return(false); } if (sim.IsEP11Bot) { if (!sim.HasTrait(TraitNames.AbilityToLearnChip)) { stats.IncStat("Chip Denied"); return(false); } } IHasSkill option = stats as IHasSkill; if (option != null) { foreach (SkillNames skill in option.CheckSkills) { if (!AllowSkill(stats, sim, settings, skill)) { return(false); } } } return(true); }
protected override bool PrivateAllow(IScoringGenerator stats, SimDescription sim, SimData settings, AllowCheck check) { if (SimTypes.InServicePool(sim, ServiceType.GrimReaper)) { stats.IncStat("Allow: Reaper"); return(false); } if (!settings.GetValue <AllowFriendshipOption, bool>()) { stats.IncStat("Allow: Friendship Denied"); return(false); } return(true); }
public bool AllowEnemy(Common.IStatGenerator stats, SimDescription actor, SimDescription target, AllowCheck check) { if ((check & AllowCheck.UserDirected) == AllowCheck.None) { if (actor.IsEP11Bot) { if (!HasEnemyChips(actor)) { stats.IncStat("Allow: Robot"); return(false); } } if (target.IsEP11Bot) { if (!HasEnemyChips(target)) { stats.IncStat("Allow: Robot"); return(false); } } } SimData actorData = GetData(actor); SimData targetData = GetData(target); if (!actorData.Allowed <AllowCasteEnemyOption>(targetData, true)) { stats.IncStat("Caste Enemy Denied"); return(false); } else if (actorData.Disallowed <DisallowCasteEnemyOption>(targetData, true)) { stats.IncStat("Caste Enemy Denied"); return(false); } return(true); }
protected bool Allow(IScoringGenerator stats, SimDescription sim, AllowCheck check) { return(PrivateAllow(stats, sim, check)); }
protected override bool PrivateAllow(IScoringGenerator stats, SimDescription sim, SimData settings, AllowCheck check) { if (SimTypes.IsSpecial(sim)) { stats.IncStat("Allow: Special"); return(false); } if (Household.RoommateManager != null) { if (Household.RoommateManager.IsNPCRoommate(sim)) { stats.IncStat("Allow: Roomie"); return(false); } } if (((check & AllowCheck.Scoring) != AllowCheck.Scoring) && !settings.GetValue <AllowMoneyOption, bool>()) { stats.IncStat("Allow: Money Denied"); return(false); } return(true); }
protected override bool PrivateAllow(IScoringGenerator stats, SimDescription sim, AllowCheck check) { if (Household.RoommateManager.IsNPCRoommate(sim)) { IncStat("Roommate"); return(false); } check &= ~AllowCheck.Active; return(base.PrivateAllow(stats, sim, check)); }
public bool Allow(IScoringGenerator stats, SimDescription actor, SimDescription target, AllowCheck check) { if ((check & AllowCheck.UserDirected) == AllowCheck.None) { if (Personalities.IsOpposing(stats, actor, target, true)) { stats.IncStat("Opposing Clan"); return(false); } } SimData actorData = GetData(actor); SimData targetData = GetData(target); if (!actorData.Allowed <AllowCasteMoveOption>(targetData, true)) { stats.IncStat("Caste Denied"); return(false); } else if (actorData.Disallowed <DisallowCasteMoveOption>(targetData, true)) { stats.IncStat("Caste Denied"); return(false); } else if (!DualAllow(stats, actorData, targetData, check)) { return(false); } return(true); }