예제 #1
0
        protected override bool Allow(Household house)
        {
            if (SimTypes.IsService(house))
            {
                IncStat("Service");
                return(false);
            }

            bool bAdult = false, bChild = false;

            foreach (SimDescription sim in house.AllSimDescriptions)
            {
                if (Deaths.IsDying(sim))
                {
                    continue;
                }

                if (Households.AllowGuardian(sim))
                {
                    bAdult = true;
                }
                else
                {
                    bChild = true;
                }
            }

            if ((bAdult) || (!bChild))
            {
                IncStat("Unnecessary");
                return(false);
            }

            return(base.Allow(house));
        }
예제 #2
0
        protected override bool Allow(SimDescription sim)
        {
            if (Deaths.IsDying(sim))
            {
                IncStat("Dying");
                return(false);
            }
            else if (sim.Household == null)
            {
                IncStat("No Home");
                return(false);
            }
            else if (!Households.AllowGuardian(sim))
            {
                IncStat("Too Young");
                return(false);
            }
            else if (sim.Genealogy == null)
            {
                IncStat("No Gene");
                return(false);
            }
            else if (!Money.Allow(this, sim))
            {
                IncStat("User Denied");
                return(false);
            }
            else if (sim.TraitManager.HasElement(TraitNames.NoBillsEver))
            {
                IncStat("No Bills");
                return(false);
            }

            return(base.Allow(sim));
        }
예제 #3
0
        protected override bool Allow(SimDescription sim)
        {
            if (sim.LotHome == null)
            {
                IncStat("Homeless");
                return(false);
            }
            else if (!Households.AllowGuardian(sim))
            {
                IncStat("Too Young");
                return(false);
            }
            else if (AddScoring("Popularity", sim) <= 0)
            {
                IncStat("Unpopular");
                return(false);
            }
            else if (AddScoring("Friendly", sim) <= 0)
            {
                IncStat("Score Fail");
                return(false);
            }

            return(base.Allow(sim));
        }
예제 #4
0
        public List <SimDescription> GetDeedOwner(RabbitHole hole)
        {
            List <SimDescription> owners = new List <SimDescription>();

            if (hole != null)
            {
                foreach (Household house in Household.GetHouseholdsLivingInWorld())
                {
                    if (house.RealEstateManager == null)
                    {
                        continue;
                    }

                    PropertyData data = house.RealEstateManager.FindProperty(hole);
                    if (data == null)
                    {
                        continue;
                    }

                    foreach (SimDescription sim in HouseholdsEx.Humans(house))
                    {
                        if (Households.AllowGuardian(sim))
                        {
                            owners.Add(sim);
                        }
                    }
                }
            }

            return(owners);
        }
예제 #5
0
        protected override bool Allow(SimDescription sim)
        {
            if ((sim.Household == null) || (sim.LotHome == null))
            {
                IncStat("Homeless");
                return(false);
            }

            int count = 0;

            foreach (SimDescription member in sim.Household.AllSimDescriptions)
            {
                if (!Households.AllowGuardian(member))
                {
                    continue;
                }

                if (Deaths.IsDying(member))
                {
                    continue;
                }

                count++;
            }

            if (count > 0)
            {
                IncStat("Remaining");
                return(false);
            }

            return(base.Allow(sim));
        }
예제 #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 Allow(SimDescription sim)
        {
            if (Households.AllowGuardian(sim))
            {
                IncStat("Too Old");
                return(false);
            }

            return(base.Allow(sim));
        }
예제 #8
0
        protected override bool CommonAllow(SimDescription sim)
        {
            if (!Households.AllowGuardian(sim))
            {
                IncStat("Too Young");
                return(false);
            }

            return(base.CommonAllow(sim));
        }
예제 #9
0
        protected override bool Allow(SimDescription sim)
        {
            if (sim.CreatedSim == null)
            {
                IncStat("Hibernating");
                return(false);
            }
            else if (Deaths.IsDying(sim))
            {
                IncStat("Dying");
                return(false);
            }
            else if (sim.Household == null)
            {
                IncStat("No Home");
                return(false);
            }
            else if ((sim.FamilyFunds - MinimumWealth) < 0)
            {
                IncStat("No Money");
                return(false);
            }
            else if (!Households.AllowGuardian(sim))
            {
                IncStat("Too Young");
                return(false);
            }
            else if (SimTypes.IsSpecial(sim))
            {
                IncStat("Special");
                return(false);
            }
            else if (!GetValue <AllowPurchaseDeedsOption, bool>(sim))
            {
                IncStat("Purchase Denied");
                return(false);
            }
            else if (!Money.Allow(this, sim))
            {
                IncStat("Money Denied");
                return(false);
            }
            else if (!TestScoring(sim))
            {
                IncStat("Score Fail");
                return(false);
            }
            else if (sim.Household.RealEstateManager == null)
            {
                IncStat("No Manager");
                return(false);
            }

            return(base.Allow(sim));
        }
예제 #10
0
        protected override bool PrivateUpdate(ScenarioFrame frame)
        {
            SimDescription head = SimTypes.HeadOfFamily(House);

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

            if ((Households.AllowGuardian(head)) && (House.Name != head.LastName))
            {
                House.Name = head.LastName;
                return(true);
            }

            return(false);
        }
예제 #11
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));
        }
예제 #12
0
        protected override bool TargetAllow(SimDescription sim)
        {
            if (!Households.AllowGuardian(sim))
            {
                IncStat("Age Denied");
                return(false);
            }
            else if (!Deaths.Allow(this, sim))
            {
                IncStat("Deaths Denied");
                return(false);
            }
            else if (!Situations.Allow(this, sim))
            {
                IncStat("Situations Denied");
                return(false);
            }

            return(base.TargetAllow(sim));
        }
예제 #13
0
        protected override bool TargetAllow(SimDescription sim)
        {
            if (Sim.Child != Target.Child)
            {
                IncStat("Age Diff");
                return(false);
            }
            else if (Households.AllowGuardian(Sim) != Households.AllowGuardian(Target))
            {
                IncStat("Age Diff");
                return(false);
            }
            else if (ManagerSim.GetLTR(Sim, Target) < 0)
            {
                IncStat("Low LTR");
                return(false);
            }

            return(base.TargetAllow(sim));
        }
예제 #14
0
        protected override bool Allow(SimDescription sim)
        {
            if (!base.Allow(sim))
            {
                return(false);
            }

            if (!AllowMultiple)
            {
                int count = 0;
                foreach (PropertyData data in sim.Household.RealEstateManager.AllProperties)
                {
                    if (data.PropertyType != RealEstatePropertyType.VacationHome)
                    {
                        count++;
                    }
                }

                if (count > 0)
                {
                    int sims = 0;
                    foreach (SimDescription member in HouseholdsEx.All(sim.Household))
                    {
                        if (!Households.AllowGuardian(member))
                        {
                            continue;
                        }

                        sims++;
                    }

                    if (count >= sims)
                    {
                        IncStat("Enough");
                        return(false);
                    }
                }
            }

            return(true);
        }
예제 #15
0
        protected override bool Allow(SimDescription sim)
        {
            if (!Households.AllowGuardian(sim))
            {
                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 (!Situations.Allow(this, sim))
            {
                IncStat("Situations Denied");
                return(false);
            }
            else if (!Skills.Allow(this, sim))
            {
                IncStat("Skill Denied");
                return(false);
            }
            else if (!Sims.AllowInventory(this, sim, Managers.Manager.AllowCheck.None))
            {
                IncStat("Inventory Denied");
                return(false);
            }
            else if (AddScoring("Nectar", sim) < 0)
            {
                IncStat("Score Fail");
                return(false);
            }

            return(base.Allow(sim));
        }
예제 #16
0
        protected override ManagerStory.Story PrintStory(StoryProgressionObject manager, string name, object[] parameters, string[] extended, ManagerStory.StoryLogging logging)
        {
            if (manager == null)
            {
                manager = Deaths;
            }

            bool child = false;

            foreach (SimDescription sim in HouseholdsEx.All(House))
            {
                if (!Households.AllowGuardian(sim))
                {
                    child = true;
                    break;
                }
            }

            if (child)
            {
                name = "AbandonedChild";
            }
            else
            {
                name = "ChildMoved";
            }

            if (parameters == null)
            {
                SimDescription head = SimTypes.HeadOfFamily(House);
                if (head == null)
                {
                    return(null);
                }

                parameters = new object[] { head };
            }

            return(base.PrintStory(manager, name, parameters, extended, logging));
        }
예제 #17
0
            protected override bool Allow(SimDescription sim)
            {
                if (Households.AllowGuardian(sim))
                {
                    IncStat("Too Old");
                    return(false);
                }

                /*
                 * else if (!Households.Allow(this, sim))
                 * {
                 *  IncStat("User Denied");
                 *  return false;
                 * }*/
                else if (Deaths.IsDying(sim))
                {
                    IncStat("Dying");
                    return(false);
                }

                return(base.Allow(sim));
            }
예제 #18
0
        protected override bool Allow(SimDescription sim)
        {
            if (sim.Household == null)
            {
                IncStat("Homeless");
                return(false);
            }
            else if (sim.LotHome == null)
            {
                IncStat("Not Resident");
                return(false);
            }
            else if ((mNewSim != null) && (mNewSim.Household == sim.Household))
            {
                IncStat("Same House");
                return(false);
            }
            else if (!Households.AllowGuardian(sim))
            {
                IncStat("Too Young");
                return(false);
            }
            else if (!GetValue <AllowAdoptionOption, bool>(sim))
            {
                IncStat("Adoption Denied");
                return(false);
            }
            else
            {
                mSpecies = GetSpecies(sim);
                if (mSpecies == CASAgeGenderFlags.None)
                {
                    return(false);
                }
            }

            return(base.Allow(sim));
        }
예제 #19
0
        public void AddWoohooerNotches(SimDescription a, SimDescription b, bool risky, bool tryForBaby)
        {
            if (sWoohooAddNotch.Valid)
            {
                bool allow = false;

                if ((Households.AllowGuardian(a)) || (Pregnancies.Allow(this, a)))
                {
                    allow = true;
                }
                else if ((Households.AllowGuardian(b)) || (Pregnancies.Allow(this, b)))
                {
                    allow = true;
                }

                if (!allow)
                {
                    return;
                }

                sWoohooAddNotch.Invoke <object>(new object[] { a, b, risky, tryForBaby });
            }
        }
예제 #20
0
        protected override bool Allow(SimDescription sim)
        {
            if (!base.Allow(sim))
            {
                return(false);
            }

            if ((sim.CreatedSim.LotCurrent == null) || (sim.CreatedSim.LotCurrent.IsWorldLot))
            {
                IncStat("In Transit");
                return(false);
            }
            else if (!Households.AllowGuardian(sim))
            {
                IncStat("Too Young");
                return(false);
            }
            else if (sim.GetPreferredVehicle() != null)
            {
                IncStat("Preferred");
                return(false);
            }
            else
            {
                bool found = false;
                List <IOwnableVehicle> vehicles = Inventories.InventoryDuoFindAll <IOwnableVehicle, Vehicle>(sim);

                IOwnableVehicle choice = sim.CreatedSim.GetOwnedAndUsableVehicle(sim.CreatedSim.LotCurrent) as IOwnableVehicle;
                if (choice != null)
                {
                    vehicles.Add(choice);
                }

                IOwnableVehicle reserved = sim.CreatedSim.GetReservedVehicle() as IOwnableVehicle;
                if (reserved != null)
                {
                    if (!vehicles.Contains(reserved))
                    {
                        vehicles.Add(reserved);
                    }
                }

                IOwnableVehicle preferred = sim.CreatedSim.GetPreferredVehicle();
                if (preferred != null)
                {
                    if (!vehicles.Contains(preferred))
                    {
                        vehicles.Add(preferred);
                    }
                }

                AddStat("Vehicles", vehicles.Count);

                foreach (IOwnableVehicle existing in vehicles)
                {
                    CarOwnable car = existing as CarOwnable;
                    if ((car != null) && (car.GeneratedOwnableForNpc))
                    {
                        continue;
                    }

                    T vehicle = existing as T;
                    if ((vehicle != null) && (!Test(vehicle)))
                    {
                        IncStat("Has Other Type");
                        return(false);
                    }

                    found = true;
                }

                if (found)
                {
                    if (AddScoring("ReplaceVehicle", sim) <= 0)
                    {
                        IncStat("Replace Score Fail");
                        return(false);
                    }
                }
            }

            return(true);
        }
예제 #21
0
        public void HandleMarriageName(SimDescription a, SimDescription b, bool actorOnEither)
        {
            string lastName = null;

            bool wasEither = false;

            SimDescription left  = a;
            SimDescription right = b;

            if (a.Gender == b.Gender)
            {
                if (actorOnEither)
                {
                    switch (GetValue <SameSexMarriageNameOption, NameTakeType>(right))
                    {
                    case NameTakeType.User:
                    case NameTakeType.Either:
                        left  = b;
                        right = a;
                        break;
                    }
                }
                else
                {
                    if (GetValue <SameSexMarriageNameOption, NameTakeType>(right) == NameTakeType.User)
                    {
                        left  = b;
                        right = a;
                    }
                }

                lastName = GetData(left).HandleName <SameSexMarriageNameOption>(Sims, right, out wasEither);
            }
            else
            {
                if (actorOnEither)
                {
                    switch (GetValue <MarriageNameOption, NameTakeType>(right))
                    {
                    case NameTakeType.User:
                    case NameTakeType.Either:
                        left  = b;
                        right = a;
                        break;
                    }
                }
                else
                {
                    if (GetValue <MarriageNameOption, NameTakeType>(right) == NameTakeType.User)
                    {
                        left  = b;
                        right = a;
                    }
                }

                lastName = GetData(left).HandleName <MarriageNameOption>(Sims, right, out wasEither);
            }

            if ((actorOnEither) && (wasEither))
            {
                lastName = a.LastName;
            }

            if (!string.IsNullOrEmpty(lastName))
            {
                a.LastName = lastName;
                b.LastName = lastName;

                if (GetValue <MarriageScenario.RenameChildrenOption, bool>())
                {
                    bool onlyMutual = GetValue <MarriageScenario.RenameOnlyMutualOption, bool>();

                    foreach (SimDescription child in Relationships.GetChildren(a))
                    {
                        if (a.Household != child.Household)
                        {
                            continue;
                        }

                        if (Households.AllowGuardian(child))
                        {
                            continue;
                        }

                        if (onlyMutual)
                        {
                            if (!Relationships.GetParents(child).Contains(b))
                            {
                                continue;
                            }
                        }

                        child.LastName = a.LastName;
                    }

                    foreach (SimDescription child in Relationships.GetChildren(b))
                    {
                        if (b.Household != child.Household)
                        {
                            continue;
                        }

                        if (Households.AllowGuardian(child))
                        {
                            continue;
                        }

                        if (onlyMutual)
                        {
                            if (!Relationships.GetParents(child).Contains(a))
                            {
                                continue;
                            }
                        }

                        child.LastName = b.LastName;
                    }
                }
            }
        }