Пример #1
0
        protected override bool Allow(SimDescription sim)
        {
            if (!Households.Allow(this, sim))
            {
                IncStat("User Denied");
                return(false);
            }
            else if (sim.Household == null)
            {
                return(false);
            }
            else if (SimTypes.IsSpecial(sim))
            {
                IncStat("Special");
                return(false);
            }
            else if (sim.LotHome == null)
            {
                IncStat("Homeless");
                return(false);
            }
            else if (SimTypes.HeadOfFamily(sim.Household) == sim)
            {
                IncStat("Head");
                return(false);
            }
            else if (!Households.AllowSoloMove(sim))
            {
                IncStat("Too Young");
                return(false);
            }

            return(base.Allow(sim));
        }
Пример #2
0
        protected override bool Allow()
        {
            if ((mMovers == null) || (mMovers.Count == 0))
            {
                return(false);
            }

            foreach (SimDescription sim in mMovers)
            {
                if ((sim.Household != null) && (TestAllow) && (!Households.Allow(this, sim)))
                {
                    IncStat("User Denied");
                    return(false);
                }
                else if (SimTypes.IsDead(sim))
                {
                    IncStat("Dead");
                    return(false);
                }
                else if (!sim.Marryable)
                {
                    IncStat("Not Marryable");
                    return(false);
                }
                else if (SimTypes.InServicePool(sim, ServiceType.GrimReaper))
                {
                    IncStat("Reaper Denied");
                    return(false);
                }
            }

            return(base.Allow());
        }
Пример #3
0
        protected override bool Allow(Household house)
        {
            if (SimTypes.IsSpecial(house))
            {
                IncStat("Special");
                return(false);
            }
            else if (house == Household.ActiveHousehold)
            {
                IncStat("Active");
                return(false);
            }
            else if (house.LotHome == null)
            {
                IncStat("Homeless");
                return(false);
            }
            else if (!Households.Allow(this, house, GetValue <ManagerHousehold.MinTimeBetweenMovesOption, int>()))
            {
                IncStat("Cooldown");
                return(false);
            }
            else if (GetValue <IsAncestralOption, bool>(house))
            {
                IncStat("Ancestral");
                return(false);
            }
            else if (Lots.AllowCastes(this, house.LotHome, HouseholdsEx.All(house)))
            {
                IncStat("Unnecessary");
                return(false);
            }

            return(base.Allow(house));
        }
Пример #4
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));
        }
Пример #5
0
        protected override bool Allow(SimDescription sim)
        {
            if (!base.Allow(sim))
            {
                return(false);
            }

            if (!GetValue <AllowAdoptionOption, bool>(sim))
            {
                IncStat("Adoption Denied");
                return(false);
            }
            else if (!Households.Allow(this, sim, 0))
            {
                IncStat("User Denied");
                return(false);
            }
            else if (AddScoring("Adoption Cooldown", TestElapsedTime <DayOfLastPetOption, MinTimeBetweenAdoptionOption>(sim)) < 0)
            {
                AddStat("Too Soon After Adoption", GetElapsedTime <DayOfLastPetOption>(sim));
                return(false);
            }
            else if (Situation.GetSituations <SocialWorkerPetAdoptionSituation>().Count > 0)
            {
                IncStat("Adoption Situation");
                return(false);
            }
            else if ((sim.IsHorse) && (sim.Child))
            {
                IncStat("Foal");
                return(false);
            }

            return(true);
        }
Пример #6
0
        protected bool TestMoveInLot()
        {
            bool nonRoomie = false;

            bool hasAdult = false;

            foreach (SimDescription sim in mMovers)
            {
                if (!Households.Allow(this, sim, GetValue <ManagerHousehold.MinTimeBetweenMovesOption, int>()))
                {
                    IncStat("User Denied");
                    return(false);
                }
                else if ((TestDead) && (SimTypes.IsDead(sim)))
                {
                    IncStat("Dead");
                    return(false);
                }
                else if (!sim.Marryable)
                {
                    IncStat("Not Marryable");
                    return(false);
                }
                else if (SimTypes.InServicePool(sim, ServiceType.GrimReaper))
                {
                    IncStat("Reaper Denied");
                    return(false);
                }

                if (!Household.RoommateManager.IsNPCRoommate(sim))
                {
                    nonRoomie = true;
                }

                if (Households.AllowGuardian(sim))
                {
                    hasAdult = true;
                }

                Lots.PackupVehicles(sim.CreatedSim, true);
            }

            if (!nonRoomie)
            {
                IncStat("All Roomies");
                return(false);
            }

            if (!hasAdult)
            {
                IncStat("No adult");
                return(false);
            }

            return(true);
        }
Пример #7
0
        protected override bool PrivateUpdate(ScenarioFrame frame)
        {
            if (GetValue <SplitOpposingClanOption, bool>())
            {
                mOpposing = !Households.Allow(this, Sim, Target, Managers.Manager.AllowCheck.None);
            }

            Add(frame, new BrokenHomeMoveOutScenario(Sim, Target), ScenarioResult.Start);
            return(false);
        }
Пример #8
0
        protected override bool Allow(SimDescription sim)
        {
            if (!Households.Allow(this, sim))
            {
                IncStat("User Denied");
                return(false);
            }

            return(base.Allow(sim));
        }
Пример #9
0
        protected override bool TargetAllow(SimDescription sim)
        {
            if ((!Households.AllowSoloMove(Sim)) && (!Households.AllowSoloMove(Target)))
            {
                IncStat("Teen Denied");
                return(false);
            }
            else if (!Households.Allow(this, Sim, Target, Managers.Manager.AllowCheck.None))
            {
                return(false);
            }

            return(base.TargetAllow(sim));
        }
Пример #10
0
        protected override bool Allow(Household house)
        {
            if (!Households.Allow(this, house, 0))
            {
                IncStat("User Denied");
                return(false);
            }
            else if (SimTypes.HeadOfFamily(House) == null)
            {
                IncStat("No Head");
                return(false);
            }

            return(base.Allow(house));
        }
Пример #11
0
        protected override bool Allow(SimDescription sim)
        {
            if (!Households.Allow(this, sim))
            {
                IncStat("User Denied");
                return(false);
            }
            else if ((mStay != null) && (sim.Household != mStay.Household))
            {
                IncStat("Diff Home");
                return(false);
            }

            return(base.Allow(sim));
        }
Пример #12
0
 protected override bool Allow(Household house)
 {
     if (SimTypes.IsSpecial(house))
     {
         IncStat("Special");
         return(false);
     }
     else if (house == Household.ActiveHousehold)
     {
         IncStat("Active");
         return(false);
     }
     else if (house.LotHome == null)
     {
         IncStat("Homeless");
         return(false);
     }
     else if (!Households.Allow(this, house, GetValue <ManagerHousehold.MinTimeBetweenMovesOption, int>()))
     {
         IncStat("Cooldown");
         return(false);
     }
     else if (GetValue <IsAncestralOption, bool>(house))
     {
         IncStat("Ancestral");
         return(false);
     }
     else if (house.FamilyFunds < (GetValue <NetWorthOption, int>(house) * (MoveRatio / 100f)))
     {
         IncStat("Poor");
         return(false);
     }
     else
     {
         SimDescription head = SimTypes.HeadOfFamily(house);
         if (head == null)
         {
             IncStat("No Head");
             return(false);
         }
         else if (AddScoring("WealthMove", head) <= 0)
         {
             IncStat("Score Fail");
             return(false);
         }
     }
     return(base.Allow(house));
 }
Пример #13
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));
        }
Пример #14
0
        protected override bool TargetAllow(SimDescription target)
        {
            if (target.ChildOrBelow)
            {
                IncStat("Too Young");
                return(false);
            }
            else if (Sim.Partner == target)
            {
                IncStat("Partner");
                return(false);
            }


            bool check = true;

            if (GetValue <SplitOpposingClanOption, bool>())
            {
                if (!Households.Allow(this, Sim, target, Managers.Manager.AllowCheck.None))
                {
                    check = false;
                }
            }

            if (check)
            {
                Relationship relation = ManagerSim.GetRelationship(Sim, target);
                if (relation == null)
                {
                    IncStat("Bad Relation");
                    return(false);
                }

                if (AddScoring("MoveAwayFrom", target, Sim) < 20)
                {
                    IncStat("Score Fail");
                    return(false);
                }
            }

            return(base.TargetAllow(target));
        }
Пример #15
0
        protected override bool Allow(Household house)
        {
            if (!base.Allow(house))
            {
                return(false);
            }

            if (!Households.Allow(this, house, GetValue <ManagerHousehold.MinTimeBetweenMovesOption, int>()))
            {
                IncStat("Cooldown Denied");
                return(false);
            }
            else if (GetValue <IsAncestralOption, bool>(House))
            {
                IncStat("Ancestral");
                return(false);
            }
            else
            {
                bool checkRelation = GetValue <CheckActiveRelationshipOption, bool>();

                foreach (SimDescription member in HouseholdsEx.All(House))
                {
                    if (!GetValue <EmigrationOption, bool>(member))
                    {
                        IncStat("Emigrate Denied");
                        return(false);
                    }
                    else if (IsInvolvedInPregnancy(member))
                    {
                        IncStat("Pregnancy Denied");
                        return(false);
                    }
                    else if ((checkRelation) && (Sims3.Gameplay.StoryProgression.Notifications.HasSignificantRelationship(Household.ActiveHousehold, member)))
                    {
                        IncStat("Active Denied");
                        return(false);
                    }
                }
            }
            return(true);
        }
Пример #16
0
        protected override bool Allow(SimDescription sim)
        {
            if (sim.LotHome != null)
            {
                IncStat("Resident");
                return(false);
            }
            else if (!Households.Allow(this, sim, 0))
            {
                IncStat("User Denied");
                return(false);
            }
            else if (Sims.HasEnough(this, sim))
            {
                IncStat("Maximum Reached");
                return(false);
            }

            return(base.Allow(sim));
        }
Пример #17
0
        protected override bool Allow(SimDescription sim)
        {
            if (!Households.Allow(this, sim))
            {
                IncStat("User Denied");
                return(false);
            }
            else if ((OnlyChildren) && (Households.AllowGuardian(sim)))
            {
                IncStat("Too Old");
                return(false);
            }
            else if (Deaths.IsDying(sim))
            {
                IncStat("Dying");
                return(false);
            }

            return(base.Allow(sim));
        }
Пример #18
0
        protected override bool Allow(Household house)
        {
            if (!base.Allow(house))
            {
                return(false);
            }

            if (!Households.Allow(this, house, GetValue <ManagerHousehold.MinTimeBetweenMovesOption, int>()))
            {
                IncStat("User Denied");
                return(false);
            }
            else if (GetValue <IsAncestralOption, bool>(House))
            {
                IncStat("Ancestral");
                return(false);
            }

            return(AddStat("Ratio", GetValue <NetRatioOption, int>(House)) > DangerRatio);
        }
Пример #19
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));
        }
Пример #20
0
        protected override bool Allow(SimDescription sim)
        {
            if (!sim.Elder)
            {
                IncStat("Too Young");
                return(false);
            }
            else if (sim.Household == null)
            {
                IncStat("No Home");
                return(false);
            }
            else if (!Households.Allow(this, sim))
            {
                IncStat("Move Denied");
                return(false);
            }
            else if ((sim.Partner != null) && (!SimTypes.IsDead(sim.Partner)) && (Pregnancies.Allow(this, sim, sim.Partner, Managers.Manager.AllowCheck.Active)))
            {
                IncStat("Fertile Partnered");
                return(false);
            }
            else if (!GetValue <EmigrationOption, bool>(sim))
            {
                IncStat("Emigrate Denied");
                return(false);
            }
            else if (HouseholdsEx.NumHumansIncludingPregnancy(sim.Household) < GetValue <MaximumSizeOption, int>(sim.Household))
            {
                IncStat("House Empty");
                return(false);
            }
            else
            {
                bool found = false;
                foreach (SimDescription other in HouseholdsEx.Humans(sim.Household))
                {
                    if (other == sim)
                    {
                        continue;
                    }

                    if (other == sim.Partner)
                    {
                        continue;
                    }

                    if (other.Partner == null)
                    {
                        continue;
                    }

                    if (!Pregnancies.Allow(this, other))
                    {
                        continue;
                    }

                    if (ExpectedPregnancyBaseScenario.GetNumLiveChildren(other) > 0)
                    {
                        continue;
                    }

                    if (AddScoring("PreferredBabyCount", other) <= 0)
                    {
                        continue;
                    }

                    if ((!Relationships.IsCloselyRelated(other, sim, false)) ||
                        (!Relationships.IsCloselyRelated(other, sim.Partner, false)))
                    {
                        continue;
                    }

                    found = true;
                }

                if (!found)
                {
                    IncStat("Not Necessary");
                    return(false);
                }
            }

            return(base.Allow(sim));
        }
Пример #21
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));
        }