Exemplo n.º 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));
        }
Exemplo n.º 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));
        }
Exemplo n.º 3
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));
        }
Exemplo n.º 4
0
            protected override bool Allow(SimDescription sim)
            {
                if (sim.CreatedSim == null)
                {
                    IncStat("Hibernating");
                    return(false);
                }
                else if (sim.CreatedSim.InteractionQueue == null)
                {
                    IncStat("No Queue");
                }
                else if (!Deaths.Allow(this, sim))
                {
                    IncStat("User Denied");
                    return(false);
                }
                else if (Sim.CreatedSim.LotCurrent.IsWorldLot)
                {
                    IncStat("In Transit");
                    return(false);
                }
                else if (sim.CreatedSim.InteractionQueue.HasInteractionOfType(Urnstone.KillSim.Singleton))
                {
                    IncStat("Dying");
                    return(false);
                }
                else if (!Deaths.IsDying(sim))
                {
                    IncStat("Saved");
                    return(false);
                }

                return(base.Allow(sim));
            }
Exemplo n.º 5
0
        protected override bool Allow(SimDescription sim)
        {
            if (sim.AgingState == null)
            {
                IncStat("No AgingState");
                return(false);
            }
            else if (sim.Age != CASAgeGenderFlags.Elder)
            {
                IncStat("Not Elder");
                return(false);
            }
            else if (Deaths.IsDying(sim))
            {
                IncStat("Already Dying");
                return(false);
            }
            else if (GetValue <MaximumAgeOption, int>(sim) < 0)
            {
                IncStat("Disabled");
                return(false);
            }

            return(base.Allow(sim));
        }
Exemplo n.º 6
0
            protected override bool Allow(SimDescription sim)
            {
                if (!Deaths.IsDying(sim))
                {
                    IncStat("Saved");
                    return(false);
                }

                return(base.Allow(sim));
            }
Exemplo n.º 7
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));
        }
Exemplo n.º 8
0
        protected override bool Allow(SimDescription sim)
        {
            if (sim.CreatedSim == null)
            {
                IncStat("Hibernating");
                return(false);
            }
            else if (sim.LotHome == null)
            {
                IncStat("Not Resident");
                return(false);
            }
            else if (sim.ToddlerOrBelow)
            {
                IncStat("Too Young");
                return(false);
            }
            else if (Deaths.IsDying(sim))
            {
                IncStat("Dying");
                return(false);
            }
            else if (!Sims.AllowInventory(this, sim, AllowActive ? Managers.Manager.AllowCheck.None : Managers.Manager.AllowCheck.Active))
            {
                IncStat("Inventory Denied");
                return(false);
            }
            else if (!Money.Allow(this, sim))
            {
                IncStat("Money Denied");
                return(false);
            }
            else if (SimTypes.IsSpecial(sim))
            {
                IncStat("Special");
                return(false);
            }
            else if ((Funds - Minimum) < 0)
            {
                AddStat("No Money Funds", Funds);
                AddStat("No Money Minimum", Minimum);
                return(false);
            }
            else if (GetValue <DebtOption, int>(sim.Household) > 0)
            {
                IncStat("Debt");
                return(false);
            }

            return(base.Allow(sim));
        }
Exemplo n.º 9
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));
        }
Exemplo n.º 10
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));
            }
Exemplo n.º 11
0
        protected override bool Allow(SimDescription sim)
        {
            if (sim.LotHome == null)
            {
                IncStat("No Home");
                return(false);
            }
            else if (!GetValue <IsAncestralOption, bool>(sim.Household))
            {
                IncStat("Not Ancestral");
                return(false);
            }
            else if (sim.Genealogy == null)
            {
                IncStat("No Genealogy");
                return(false);
            }

            foreach (SimDescription other in HouseholdsEx.Humans(sim.Household))
            {
                if (other == sim)
                {
                    continue;
                }

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

                if (other.YoungAdultOrAbove)
                {
                    return(false);
                }
            }

            return(base.Allow(sim));
        }
Exemplo n.º 12
0
        protected override bool Sort(List <Household> houses)
        {
            Dictionary <Household, int> candidates = new Dictionary <Household, int>();

            AddStat("Potentials", houses.Count);

            SimDescription oldestSim = Sim;

            foreach (SimDescription sim in Movers)
            {
                if ((oldestSim == null) || (SimTypes.IsOlderThan(sim, oldestSim)))
                {
                    oldestSim = sim;
                }
            }

            foreach (Household house in houses)
            {
                bool olderFound = false;

                foreach (SimDescription other in HouseholdsEx.All(house))
                {
                    if (Deaths.IsDying(other))
                    {
                        continue;
                    }

                    if (SimTypes.IsOlderThan(other, oldestSim))
                    {
                        olderFound = true;
                    }

                    int count = 0;

                    if (Flirts.IsCloselyRelated(Sim, other))
                    {
                        if (Sim.Genealogy.Parents.Contains(other.Genealogy))
                        {
                            count += 10;
                        }
                        else
                        {
                            count++;
                        }
                    }
                    else if (OnlyFamilyMoveIn)
                    {
                        continue;
                    }

                    bool checkRel = false;
                    if (other.YoungAdultOrAbove)
                    {
                        checkRel = true;
                    }
                    else if ((Households.AllowSoloMove(Sim)) && (other.TeenOrAbove))
                    {
                        checkRel = true;
                    }

                    if (checkRel)
                    {
                        int rel = 0;

                        Relationship relation = Relationship.Get(Sim, other, false);
                        if (relation != null)
                        {
                            rel = (int)(relation.LTR.Liking / 25);

                            if ((relation.AreRomantic()) && (rel > 0))
                            {
                                rel += 5;
                            }

                            count += rel;
                        }

                        if (Households.AllowSoloMove(Sim))
                        {
                            if (rel < 3)
                            {
                                continue;
                            }
                        }
                    }

                    if (Sim.Partner == other)
                    {
                        count += 10;
                    }

                    if (!candidates.ContainsKey(house))
                    {
                        candidates.Add(house, count);
                    }
                    else
                    {
                        candidates[house] += count;
                    }
                }

                if (!olderFound)
                {
                    candidates.Remove(house);
                }
            }

            houses.Clear();
            if (candidates.Count > 0)
            {
                ScoringList <Household> scoring = new ScoringList <Household>();
                foreach (KeyValuePair <Household, int> candidate in candidates)
                {
                    AddScoring("", candidate.Value);

                    scoring.Add(candidate.Key, candidate.Value);
                }

                houses.AddRange(scoring.GetBestByMinScore(1));
            }
            else
            {
                IncStat("No Candidates");
            }

            return(true);
        }