Beispiel #1
0
        protected override bool TargetAllow(SimDescription sim)
        {
            if (sim.CreatedSim == null)
            {
                IncStat("Hibernating");
                return(false);
            }
            else if (mInstigator == sim)
            {
                IncStat("Instigator");
                return(false);
            }
            else if (!Careers.Allow(this, sim))
            {
                IncStat("User Denied");
                return(false);
            }
            else if (ManagerFriendship.AreEnemies(sim, Sim))
            {
                IncStat("Enemy");
                return(false);
            }

            return(base.Allow(sim));
        }
        protected override bool Allow(SimDescription sim)
        {
            if ((!sim.Child) && (!sim.Teen))
            {
                IncStat("Wrong Age");
                return(false);
            }
            else if (sim.CreatedSim == null)
            {
                IncStat("Hibernating");
                return(false);
            }
            else if (sim.CareerManager == null)
            {
                IncStat("No Manager");
                return(false);
            }
            else if (!Careers.Allow(this, sim))
            {
                IncStat("Careers Denied");
                return(false);
            }
            else if (!GetValue <AllowFindJobOption, bool>(sim))
            {
                IncStat("Find Job Denied");
                return(false);
            }
            else if (HasActivity(sim))
            {
                IncStat("Has Activity");
                return(false);
            }

            return(base.Allow(sim));
        }
Beispiel #3
0
        protected override bool Allow(SimDescription sim)
        {
            if (!ManagerCareer.ValidCareer(sim.Occupation))
            {
                IncStat("No Job");
                return(false);
            }
            else if (sim.Household == null)
            {
                IncStat("Homeless");
                return(false);
            }
            else if (SimTypes.IsSpecial(sim))
            {
                IncStat("Special");
                return(false);
            }
            else if (!Careers.Allow(this, sim))
            {
                IncStat("Careers Denied");
                return(false);
            }

            return(base.Allow(sim));
        }
Beispiel #4
0
        protected override bool Allow(SimDescription sim)
        {
            if (sim.CareerManager == null)
            {
                IncStat("No Manager");
                return(false);
            }
            else if (sim.LotHome == null)
            {
                IncStat("Homeless");
                return(false);
            }
            else if (!HasMetric(sim))
            {
                IncStat("No Metric");
                return(false);
            }
            else if (!Careers.Allow(this, sim))
            {
                IncStat("Careers Denied");
                return(false);
            }

            return(base.Allow(sim));
        }
Beispiel #5
0
        protected override bool Allow(SimDescription sim)
        {
            if (sim.ChildOrBelow)
            {
                IncStat("Too Young");
                return false;
            }
            else if (sim.CreatedSim == null)
            {
                IncStat("Hibernating");
                return false;
            }
            else if (sim.LotHome == null)
            {
                IncStat("Homeless");
                return false;
            }
            else if (sim.SkillManager == null)
            {
                IncStat("No Manager");
                return false;
            }
            else if (!Skills.Allow(this, sim))
            {
                IncStat("Skill Denied");
                return false;
            }
            else if (!Careers.Allow(this, sim))
            {
                IncStat("Careers Denied");
                return false;
            }

            return base.Allow(sim);
        }
        protected override bool Allow(SimDescription sim)
        {
            if (!Careers.Allow(this, sim))
            {
                IncStat("User Denied");
                return(false);
            }
            else if (sim.Occupation == null)
            {
                IncStat("No Job");
                return(false);
            }
            else if (sim.Occupation is Retired)
            {
                IncStat("Retired");
                return(false);
            }
            else if (sim.Occupation.CareerLevel < 5)
            {
                IncStat("Too Low");
                return(false);
            }
            else if (sim.LifetimeWish != (uint)LifetimeWant.JackOfAllTrades)
            {
                IncStat("Wrong LTW");
                return(false);
            }

            return(base.Allow(sim));
        }
Beispiel #7
0
        protected override bool PrivateUpdate(ScenarioFrame frame)
        {
            AcademicCareer career = Sim.OccupationAsAcademicCareer;

            if (Careers.Allow(this, Sim))
            {
                PayProfessor(career);
            }

            return(true);
        }
Beispiel #8
0
        protected override bool Allow(SimDescription sim)
        {
            if (!Careers.Allow(this, sim))
            {
                IncStat("User Denied");
                return(false);
            }
            else if (sim.CareerManager == null)
            {
                IncStat("No Manager");
                return(false);
            }

            return(base.Allow(sim));
        }
Beispiel #9
0
        protected override bool TargetAllow(SimDescription sim)
        {
            if (!Careers.Allow(this, sim))
            {
                IncStat("Careers Denied");
                return(false);
            }
            else if (ManagerFriendship.AreEnemies(Sim, sim))
            {
                IncStat("Enemy");
                return(false);
            }

            return(base.TargetAllow(sim));
        }
Beispiel #10
0
        protected override bool Allow(SimDescription sim)
        {
            if (!Careers.Allow(this, sim))
            {
                IncStat("User Denied");
                return(false);
            }
            else if (!ManagerCareer.ValidCareer(sim.Occupation))
            {
                IncStat("No Career");
                return(false);
            }

            return(base.Allow(sim));
        }
Beispiel #11
0
        protected override bool Allow(SimDescription sim)
        {
            if (sim.Household == null)
            {
                IncStat("Homeless");
                return(false);
            }
            else if (SimTypes.IsService(sim))
            {
                IncStat("Service");
                return(false);
            }
            else if (SimTypes.IsDead(sim))
            {
                IncStat("Dead");
                return(false);
            }
            else if ((!sim.Child) && (!sim.Teen))
            {
                IncStat("Not Child");
                return(false);
            }
            else if (sim.CareerManager == null)
            {
                IncStat("No Manager");
                return(false);
            }
            else if (GetValue <ManualSchoolOption, bool>(sim))
            {
                IncStat("Manual");
                return(false);
            }
            else if (!Careers.AllowFindJob(this, sim))
            {
                IncStat("Find Job Denied");
                return(false);
            }
            else if (!Careers.Allow(this, sim, Managers.Manager.AllowCheck.None))
            {
                IncStat("Careers Denied");
                return(false);
            }

            return(base.Allow(sim));
        }
Beispiel #12
0
        protected override bool Allow(SimDescription sim)
        {
            if (!(sim.Occupation is Career))
            {
                IncStat("No Job");
                return(false);
            }
            else if (sim.Occupation is Retired)
            {
                IncStat("Retired");
                return(false);
            }
            else if (!Careers.Allow(this, sim))
            {
                IncStat("User Denied");
                return(false);
            }

            return(base.Allow(sim));
        }
Beispiel #13
0
        protected override bool Allow(SimDescription sim)
        {
            if (sim.Household == null)
            {
                IncStat("Homeless");
                return(false);
            }
            else if (SimTypes.IsSpecial(sim))
            {
                IncStat("Special");
                return(false);
            }
            else if (!Careers.Allow(this, sim))
            {
                IncStat("User Denied");
                return(false);
            }

            return(base.Allow(sim));
        }
        protected override bool Allow(SimDescription sim)
        {
            if (!Careers.Allow(this, sim))
            {
                IncStat("User Denied");
                return(false);
            }
            else if (sim.Occupation == null)
            {
                IncStat("No Job");
                return(false);
            }
            else if (!IsTopLevel(sim.Occupation as Career))
            {
                IncStat("Too Low");
                return(false);
            }

            return(base.Allow(sim));
        }
        protected override bool Allow(SimDescription sim)
        {
            if (sim.CreatedSim == null)
            {
                IncStat("Hibernating");
                return(false);
            }
            else if (!Careers.Allow(this, sim))
            {
                IncStat("Careers Denied");
                return(false);
            }
            else if (AddScoring("ActiveAmbition", sim) <= 0)
            {
                IncStat("Score Fail");
                return(false);
            }

            return(base.Allow(sim));
        }
Beispiel #16
0
        protected override bool Allow(SimDescription sim)
        {
            if (!sim.Elder)
            {
                IncStat("Not Elder");
                return(false);
            }
            else if (!Careers.Allow(this, sim))
            {
                IncStat("User Denied");
                return(false);
            }
            else if (sim.Occupation == null)
            {
                IncStat("No Job");
                return(false);
            }
            else if (sim.Occupation is Retired)
            {
                IncStat("Retired");
                return(false);
            }
            else if (sim.Occupation is SkillBasedCareer)
            {
                IncStat("Skill Based");
                return(false);
            }
            else if (!GetValue <AllowFindJobOption, bool>(sim))
            {
                IncStat("Find Job Denied");
                return(false);
            }
            else if (sim.OccupationAsAcademicCareer != null)
            {
                IncStat("Academic Career");
                return(false);
            }

            return(base.Allow(sim));
        }
Beispiel #17
0
        protected override bool Allow(SimDescription sim)
        {
            if (!sim.Elder)
            {
                IncStat("Not Elder");
                return(false);
            }
            else if (!Careers.Allow(this, sim))
            {
                IncStat("Careers Denied");
                return(false);
            }
            else if (sim.Occupation == null)
            {
                IncStat("No Job");
                return(false);
            }
            else if (sim.Occupation is Retired)
            {
                IncStat("Retired");
                return(false);
            }
            else if (sim.Occupation is SkillBasedCareer)
            {
                IncStat("Skill Based");
                return(false);
            }
            else if (!GetValue <AllowFindJobOption, bool>(sim))
            {
                IncStat("Find Job Denied");
                return(false);
            }
            else if (sim.Occupation.CareerLevel != sim.Occupation.HighestLevel)
            {
                IncStat("Not Max");
                return(false);
            }

            return(base.Allow(sim));
        }
Beispiel #18
0
        protected override bool Allow(SimDescription sim)
        {
            Career career = sim.Occupation as Career;

            if (career == null)
            {
                IncStat("No Job");
                return(false);
            }
            else if ((!GiveRaise) && (IsHighestLevel(career)))
            {
                IncStat("Maximum Level");
                return(false);
            }
            else if (!Careers.Allow(this, sim))
            {
                IncStat("Careers Denied");
                return(false);
            }

            return(base.Allow(sim));
        }
Beispiel #19
0
        protected override bool Allow(SimDescription sim)
        {
            Career career = sim.Occupation as Career;

            if (career == null)
            {
                IncStat("No Job");
                return(false);
            }
            else if ((!ShouldFire) && (career.Level <= 1))
            {
                IncStat("Level One");
                return(false);
            }
            else if (!Careers.Allow(this, sim))
            {
                IncStat("Careers Denied");
                return(false);
            }

            return(base.Allow(sim));
        }
Beispiel #20
0
        protected override bool PrivateUpdate(ScenarioFrame frame)
        {
            Career career = Sim.Occupation as Career;

            if (Careers.Allow(this, Sim))
            {
                UpdatePerformance(career);
            }
            else if (career != null)
            {
                career.LastPerfChange = 0;

                career.ShouldDemote  = false;
                career.ShouldPromote = false;
            }

            if (Sim.CareerManager != null)
            {
                UpdatePerformance(Sim.CareerManager.School);
            }

            return(true);
        }
        protected override bool PrivateUpdate(ScenarioFrame frame)
        {
            Career career = null;

            if (Sim.CreatedSim.CurrentInteraction is WorkInRabbitHole)
            {
                career = Sim.Occupation as Career;
            }
            else if (Sim.CreatedSim.CurrentInteraction is GoToSchoolInRabbitHole)
            {
                career = Sim.CareerManager.School;
            }

            if (career == null)
            {
                IncStat("No Career");
                return(false);
            }

            if (!(career is School))
            {
                if (career.Performance >= 100)
                {
                    if (GetValue <PromoteOnTheJobOption, bool>())
                    {
                        IncStat("On The Job Promote");

                        // Don't call PromoteSim() it does not work for raises
                        career.PromoteIfShould();

                        career.ResetPerformance();
                        return(true);
                    }
                }
                else if (career.Performance <= -100)
                {
                    if (GetValue <PromoteOnTheJobOption, bool>())
                    {
                        IncStat("On The Job Demote");

                        career.DemoteSim();

                        career.ResetPerformance();
                        return(true);
                    }
                }
            }

            float adjustment = Event.Increment;

            if ((adjustment > 0) || ((adjustment < 0) && (GetValue <AlterDecreaseRateOption, bool>())))
            {
                string active = null;
                if (SimTypes.IsSelectable(Sim))
                {
                    if (!GetValue <HandleActiveOption, bool>())
                    {
                        IncStat("Active Denied");
                        return(false);
                    }

                    active = "Active ";
                }

                if (!Careers.Allow(this, Sim))
                {
                    // Adjust the full value of the performance
                }
                else if ((!career.IsFinalLevel) || (!GetValue <SuspendRaisesAtMaxOption, bool>()))
                {
                    float scaling = GetValue <ScaledPerformanceOption, int>();
                    if (scaling <= 0)
                    {
                        scaling = 1;
                    }

                    if (GetValue <AdjustToAgeSpanOption, bool>())
                    {
                        scaling *= (LifeSpan.GetHumanAgeSpanLength() / 90f);
                    }

                    float stepped = GetValue <SteppedScaledPerformanceOption, int>() / 100f;
                    if (stepped > 0)
                    {
                        for (int i = 1; i < career.Level; i++)
                        {
                            scaling *= (1 + stepped);
                        }
                    }

                    AddScoring(active + "Scaling 100s", (int)(scaling * 100));

                    if (scaling == 0)
                    {
                        adjustment = 0;
                    }
                    else
                    {
                        adjustment -= (adjustment / scaling);
                    }

                    if ((Math.Abs(Event.Increment) >= 0.1) && (Math.Abs(Event.Increment - adjustment) < 0.1))
                    {
                        if (Event.Increment > 0)
                        {
                            adjustment = Event.Increment - 0.1f;
                        }
                        else
                        {
                            adjustment = Event.Increment + 0.1f;
                        }

                        IncStat("Performance Floor");
                    }
                }

                AddScoring(active + "Actual 100s", (int)(Event.Increment * 100));
                AddScoring(active + "Adjustment 100s", (int)(adjustment * 100));

                AddScoring(active + "Difference 100s", (int)((Event.Increment - adjustment) * 100));

                career.mPerformance -= adjustment;
            }

            return(true);
        }