Example #1
0
            public Parameters(Scenario scenario, bool defaultAll)
            {
                mDefaultAll = defaultAll;

                mStats = scenario;

                mManager = scenario.Manager;

                mName = mManager.UnlocalizedName + " " + scenario.UnlocalizedName;

                IFriendlyScenario friendly = scenario as IFriendlyScenario;

                if (friendly != null)
                {
                    mIsFriendly = friendly.IsFriendly;
                }

                IRomanticScenario romantic = scenario as IRomanticScenario;

                if (romantic != null)
                {
                    mIsRomantic = romantic.IsRomantic;
                }

                mAbsoluteScoring = false;
            }
Example #2
0
        public override void Init(ManagerProgressionBase manager, SimDescription sim)
        {
            if (sim == null) return;

            base.Init(manager, sim);

            mSim = sim;

            Reset();
        }
Example #3
0
        public override void Init(ManagerProgressionBase manager, SimDescription sim)
        {
            if (sim == null)
            {
                return;
            }

            base.Init(manager, sim);

            mSim = sim;

            Reset();
        }
Example #4
0
            public Parameters(ManagerProgressionBase manager, bool absolute, int scoreDelta, AllowFunc testAllow)
            {
                mTestAllow = testAllow;

                mStats = manager.Scoring;

                mScoreDelta = scoreDelta;

                mManager = manager;

                mIsFriendly = true;

                mIsRomantic = false;

                mDefaultAll = false;

                mAbsoluteScoring = absolute;

                mName = manager.UnlocalizedName;
            }
Example #5
0
            public Parameters(ManagerProgressionBase manager, bool absolute, int scoreDelta, AllowFunc testAllow)
            {
                mTestAllow = testAllow;

                mStats = manager.Scoring;

                mScoreDelta = scoreDelta;

                mManager = manager;

                mIsFriendly = true;

                mIsRomantic = false;

                mDefaultAll = false;

                mAbsoluteScoring = absolute;

                mName = manager.UnlocalizedName;
            }
Example #6
0
 public Parameters(ManagerProgressionBase manager, bool absolute, int scoreDelta)
     : this(manager, absolute, scoreDelta, null)
 { }
Example #7
0
 public Parameters(ManagerProgressionBase manager, bool absolute, AllowFunc testAllow)
     : this(manager, absolute, 0, testAllow)
 { }
Example #8
0
 public Parameters(ManagerProgressionBase manager)
     : this(manager, false, 0, null)
 { }
Example #9
0
            public Parameters(Scenario scenario, bool defaultAll)
            {
                mDefaultAll = defaultAll;

                mStats = scenario;

                mManager = scenario.Manager;

                mName = mManager.UnlocalizedName + " " + scenario.UnlocalizedName;

                IFriendlyScenario friendly = scenario as IFriendlyScenario;
                if (friendly != null)
                {
                    mIsFriendly = friendly.IsFriendly;
                }

                IRomanticScenario romantic = scenario as IRomanticScenario;
                if (romantic != null)
                {
                    mIsRomantic = romantic.IsRomantic;
                }

                mAbsoluteScoring = false;
            }
Example #10
0
 public Parameters(ManagerProgressionBase manager, bool absolute, AllowFunc testAllow)
     : this(manager, absolute, 0, testAllow)
 {
 }
Example #11
0
        protected static bool IsUnderCurfew(ManagerProgressionBase manager, Common.IStatGenerator stats, SimDescription sim, out bool forceCurfew)
        {
            forceCurfew = false;

            if (!sim.IsHuman)
            {
                stats.IncStat("Not Human");
                return(false);
            }
            else if (sim.CreatedSim == null)
            {
                stats.IncStat("Hibernating");
                return(false);
            }
            else if (sim.CreatedSim.RoutingComponent == null)
            {
                stats.IncStat("No Routing Manager");
                return(false);
            }
            else if (sim.CreatedSim.RoutingComponent.RoutingParent != null)
            {
                stats.IncStat("Routing Parent");
                return(false);
            }
            else if (sim.CreatedSim.GetSituationOfType <TrickOrTreatSituation>() != null)
            {
                stats.IncStat("Trick Or Treat");
                return(false);
            }

            Lot currentLot = sim.CreatedSim.LotCurrent;

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

            if (currentLot.CanSimTreatAsHome(sim.CreatedSim))
            {
                stats.IncStat("At Home");
                return(false);
            }

            int startCurfew = manager.GetValue <CurfewStartOption, int>(sim);
            int endCurfew   = manager.GetValue <CurfewEndOption, int>(sim);

            if ((startCurfew < 0) || (endCurfew < 0))
            {
                stats.IncStat("User Curfew Fail");
                return(false);
            }
            else if (startCurfew != endCurfew)
            {
                if (SimClock.IsTimeBetweenTimes(SimClock.HoursPassedOfDay, startCurfew, endCurfew))
                {
                    if (manager.GetValue <ForceCurfewOption, bool>(sim))
                    {
                        forceCurfew = true;

                        stats.IncStat("User Defined Curfew");
                        return(true);
                    }
                }
                else
                {
                    stats.IncStat("Not Curfew Time");
                    return(false);
                }
            }

            if (!sim.TeenOrBelow)
            {
                stats.IncStat("Adult Curfew");
                return(false);
            }

            if (startCurfew == endCurfew)
            {
                if (sim.ChildOrBelow)
                {
                    if (!EACurfewRetention.ChildCurfewIsInEffect())
                    {
                        stats.IncStat("Not Child EA Curfew");
                        return(false);
                    }
                }
                else
                {
                    if (!EACurfewRetention.TeenCurfewIsInEffect())
                    {
                        stats.IncStat("Not Teen EA Curfew");
                        return(false);
                    }
                }
            }

            if (IsSupervised(stats, sim.CreatedSim))
            {
                stats.IncStat("Supervised");
                return(false);
            }

            DaysOfTheWeek dayToCheck = SimClock.Yesterday;

            if (SimClock.Hours24 > 12)
            {
                dayToCheck = SimClock.CurrentDayOfWeek;
            }

            if (!manager.HasValue <ValidDaysOption, DaysOfTheWeek>(dayToCheck))
            {
                stats.IncStat("Not Valid Day");
                return(false);
            }

            if (!manager.GetValue <EnforceCurfewForJobOption, bool>())
            {
                stats.IncStat("For Job Disabled");
                return(true);
            }
            else
            {
                Occupation career = sim.Occupation;
                if ((career != null) && (!career.HasOpenHours) && (career.IsFollowingDayInTheWorkDayList(dayToCheck)))
                {
                    stats.IncStat("Work Day");
                    return(true);
                }

                School school = sim.CareerManager.School;
                if ((school != null) && (school.IsFollowingDayInTheWorkDayList(dayToCheck)))
                {
                    stats.IncStat("School Day");
                    return(true);
                }

                stats.IncStat("For Job Allowed");
                return(false);
            }
        }
Example #12
0
 public virtual void Init(ManagerProgressionBase manager, SimDescription sim)
 {
 }
Example #13
0
 public virtual void Init(ManagerProgressionBase manager, SimDescription sim)
 { }
Example #14
0
 public Parameters(ManagerProgressionBase manager, bool absolute, int scoreDelta)
     : this(manager, absolute, scoreDelta, null)
 {
 }
Example #15
0
        protected static bool IsWitnessed(ManagerProgressionBase manager, IScoringGenerator stats, SimDescription sim, int baseChance)
        {
            if (sim.CreatedSim == null)
            {
                stats.IncStat("Hibernating");
                return(false);
            }

            Lot lot = sim.CreatedSim.LotCurrent;

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

            if (lot.IsWorldLot)
            {
                return(false);
            }

            if (lot.CanSimTreatAsHome(sim.CreatedSim))
            {
                stats.IncStat("At Home");
                return(false);
            }

            /*
             * if (lot.IsResidentialLot)
             * {
             *  stats.IncStat("Residential");
             *  return false;
             * }
             */

            foreach (Sim witness in lot.GetAllActors())
            {
                if (!witness.IsHuman)
                {
                    continue;
                }

                if (witness.SimDescription.ChildOrBelow)
                {
                    continue;
                }

                if (stats.AddScoring("IgnoreCurfew", witness.SimDescription) > 0)
                {
                    continue;
                }

                if (!RandomUtil.RandomChance(stats.AddScoring("CurfewWitness", witness.SimDescription) + baseChance))
                {
                    continue;
                }

                bool forceCurfew;
                if (IsUnderCurfew(manager, stats, witness.SimDescription, out forceCurfew))
                {
                    continue;
                }

                stats.IncStat("Witnessed");
                return(true);
            }

            return(false);
        }
        public override string GetTitlePrefix(ManagerProgressionBase.PrefixType type)
        {
            if (type != PrefixType.Pure) return null;

            return "ManualCashTransfer";
        }
Example #17
0
 public Parameters(ManagerProgressionBase manager)
     : this(manager, false, 0, null)
 {
 }