Ejemplo n.º 1
0
        protected override bool Allow(Household house)
        {
            if (!Households.Allow(this, house, 0))
            {
                IncStat("User Denied");
                return(false);
            }
            else if (!GetValue <AllowAdoptionOption, bool>(SimTypes.HeadOfFamily(house)))
            {
                IncStat("Adoption Denied");
                return(false);
            }
            else
            {
                SimDescription head = SimTypes.HeadOfFamily(house);
                if (AddScoring("Cooldown: Between Adoptions", TestElapsedTime <DayOfLastPetOption, PetAdoptionScenario.MinTimeBetweenAdoptionOption>(head)) < 0)
                {
                    AddStat("Too Soon After Adoption", GetElapsedTime <DayOfLastPetOption>(head));
                    return(false);
                }
            }

            mPassedInspection = Lots.PassesHomeInspection(this, House.LotHome, HouseholdsEx.Pets(House), ManagerLot.FindLotFlags.InspectPets);

            if ((mPassedInspection) && (!HouseholdsEx.IsFull(this, House, CASAgeGenderFlags.Dog, GetValue <RoomToLeaveOption, int>(), false)))
            {
                IncStat("Score Fail");
                return(false);
            }

            return(base.Allow(house));
        }
Ejemplo n.º 2
0
        protected override bool Allow(Household house)
        {
            if (!Households.Allow(this, house, 0))
            {
                IncStat("User Denied");
                return(false);
            }

            mPassedInspection = Lots.PassesHomeInspection(this, House.LotHome, HouseholdsEx.Humans(House), ManagerLot.FindLotFlags.Inspect);

            if ((mPassedInspection) && ((HouseholdsEx.NumHumansIncludingPregnancy(House) + GetValue <RoomToLeaveOption, int>()) < GetValue <MaximumSizeOption, int>(House)))
            {
                IncStat("Score Fail");
                return(false);
            }

            return(base.Allow(house));
        }
Ejemplo n.º 3
0
        protected override bool Allow(Household house)
        {
            if (house == Household.ActiveHousehold)
            {
                IncStat("Active");
                return(false);
            }
            else if (house.LotHome == null)
            {
                IncStat("Homeless");
                return(false);
            }

            if (!Households.Allow(this, house, GetValue <ManagerHousehold.MinTimeBetweenMovesOption, int>()))
            {
                IncStat("User Denied");
                return(false);
            }
            else if (GetValue <IsAncestralOption, bool>(house))
            {
                IncStat("Ancestral Denied");
                return(false);
            }
            else if (Lots.PassesHomeInspection(this, house.LotHome, HouseholdsEx.All(house), ManagerLot.FindLotFlags.Inspect | ManagerLot.FindLotFlags.InspectPets))
            {
                IncStat("Pass");
                return(false);
            }
            else if (GetValue <DebtOption, int>(house) > 0)
            {
                IncStat("Debt");
                return(false);
            }

            return(base.Allow(house));
        }
Ejemplo n.º 4
0
        protected override bool Allow(Household house)
        {
            if (house.LotHome == null)
            {
                IncStat("No Home");
                return(false);
            }
            else if (SimTypes.IsSpecial(house))
            {
                IncStat("Special");
                return(false);
            }
            else if (HouseholdsEx.NumSims(house) == 0)
            {
                IncStat("No Members");
                return(false);
            }
            else
            {
                List <SimDescription> movers = GetMovers(house, false);
                if (movers.Count == 0)
                {
                    IncStat("No Movers");
                    return(false);
                }

                int humanMovers = 0, petMovers = 0;
                HouseholdsEx.NumSimsIncludingPregnancy(movers, ref humanMovers, ref petMovers);

                int humanCount = 0, petCount = 0;
                HouseholdsEx.NumSimsIncludingPregnancy(house, ref humanCount, ref petCount);

                int maximumHumans = GetValue <MaximumSizeOption, int>(house);
                int maximumPets   = GetValue <MaximumPetSizeOption, int>(house);

                if (((humanCount + humanMovers) > maximumHumans) && (humanCount <= maximumHumans) && (humanMovers <= maximumHumans))
                {
                    AddStat("Too Many Human Movers", humanMovers);
                    AddStat("Too Many Human Existing", humanCount);
                    AddStat("Too Many Human Total", humanCount + humanMovers);
                    return(false);
                }
                else if (((petCount + petMovers) > maximumPets) && (petCount <= maximumPets) && (petMovers <= maximumPets))
                {
                    AddStat("Too Many Pet Movers", petMovers);
                    AddStat("Too Many Pet Existing", petCount);
                    AddStat("Too Many Pet Total", petCount + petMovers);
                    return(false);
                }
                else if ((TestAllow) && (!Households.Allow(this, house, 0)))
                {
                    IncStat("User Denied");
                    return(false);
                }
                else if (!Lots.PassesHomeInspection(this, house.LotHome, movers, HouseholdsEx.All(house), Inspect | ManagerLot.FindLotFlags.InspectCareerItems))
                {
                    IncStat("Inspection Fail");
                    return(false);
                }
                else if (GetValue <IsAncestralOption, bool>(house))
                {
                    SimDescription head = SimTypes.HeadOfFamily(house);

                    // Ensure that none of the sims moving into the home are older than the current Head of the Family
                    foreach (SimDescription newSim in movers)
                    {
                        if (SimTypes.IsOlderThan(newSim, head))
                        {
                            IncStat("Ancestral Age Denied");
                            return(false);
                        }
                    }
                }

                foreach (SimDescription mover in movers)
                {
                    foreach (SimDescription member in HouseholdsEx.All(house))
                    {
                        if (!Households.Allow(this, mover, member, Managers.Manager.AllowCheck.None))
                        {
                            return(false);
                        }
                    }
                }
            }

            return(base.Allow(house));
        }