Ejemplo n.º 1
0
            protected static void OnInitialize()
            {
                bool         created;
                CasteOptions options = StoryProgression.Main.Options.GetNewCasteOptions("ActiveRentable", Common.Localize("Caste:ActiveRentable"), out created);

                if (created)
                {
                    options.SetValue <CasteAutoOption, bool>(true);
                    options.AddValue <CasteTypeOption, SimType>(SimType.ActiveFamily);

                    options.SetValue <RentableOption, bool>(false);
                }
            }
Ejemplo n.º 2
0
            protected static void OnInitialize()
            {
                bool         created;
                CasteOptions options = StoryProgression.Main.Options.GetNewCasteOptions("DisgraceByAge", Common.Localize("Caste:DisgraceByAge"), out created);

                if (created)
                {
                    options.SetValue <CasteAutoOption, bool>(true);
                    options.SetValue <CasteAgeOption, List <CASAgeGenderFlags> >(null);
                    options.AddValue <CasteAgeOption, CASAgeGenderFlags>(CASAgeGenderFlags.Teen);
                    options.AddValue <CasteAgeOption, CASAgeGenderFlags>(CASAgeGenderFlags.YoungAdult);
                    options.AddValue <CasteAgeOption, CASAgeGenderFlags>(CASAgeGenderFlags.Adult);
                    options.AddValue <CasteAgeOption, CASAgeGenderFlags>(CASAgeGenderFlags.Elder);

                    options.SetValue <CelebrityDisgraceOption, bool>(true);
                }
            }
Ejemplo n.º 3
0
        protected override OptionResult Run(GameHitParameters <GameObject> parameters)
        {
            string text = StringInputDialog.Show(Name, Common.Localize("CasteName:Prompt"), "");

            if (string.IsNullOrEmpty(text))
            {
                return(OptionResult.Failure);
            }

            bool         created;
            CasteOptions options = StoryProgression.Main.Options.GetNewCasteOptions(null, text, out created);

            if (options == null)
            {
                return(OptionResult.Failure);
            }

            List <SimDescription> sims = new List <SimDescription>();

            Sim sim = parameters.mTarget as Sim;

            if (sim != null)
            {
                StoryProgression.Main.AddValue <ManualCasteOption, CasteOptions>(sim.SimDescription, options);
            }
            else
            {
                Lot lot = parameters.mTarget as Lot;
                if (lot != null)
                {
                    foreach (SimDescription member in Households.All(lot.Household))
                    {
                        StoryProgression.Main.AddValue <ManualCasteOption, CasteOptions>(member, options);
                    }
                }
            }

            return(OptionResult.SuccessRetain);
        }
Ejemplo n.º 4
0
            protected static void OnInitialize()
            {
                bool         created;
                CasteOptions options = StoryProgression.Main.Options.GetNewCasteOptions("PublicSchool", Common.Localize("Caste:PublicSchool"), out created);

                if (created)
                {
                    options.SetValue <CasteAutoOption, bool>(true);
                    options.SetValue <CasteAgeOption, List <CASAgeGenderFlags> >(null);
                    options.AddValue <CasteAgeOption, CASAgeGenderFlags>(CASAgeGenderFlags.Toddler);
                    options.AddValue <CasteAgeOption, CASAgeGenderFlags>(CASAgeGenderFlags.Child);
                    options.AddValue <CasteAgeOption, CASAgeGenderFlags>(CASAgeGenderFlags.Teen);

                    options.AddValue <CasteTypeOption, SimType>(SimType.NonActiveFamily);

                    options.SetValue <CasteFundsMaxOption, int>(100000);

                    options.SetValue <AssignPublicSchoolOption, bool>(true);
                }

                options = StoryProgression.Main.Options.GetNewCasteOptions("PrivateSchool", Common.Localize("Caste:PrivateSchool"), out created);
                if (created)
                {
                    options.SetValue <CasteAutoOption, bool>(true);
                    options.SetValue <CasteAgeOption, List <CASAgeGenderFlags> >(null);
                    options.AddValue <CasteAgeOption, CASAgeGenderFlags>(CASAgeGenderFlags.Toddler);
                    options.AddValue <CasteAgeOption, CASAgeGenderFlags>(CASAgeGenderFlags.Child);
                    options.AddValue <CasteAgeOption, CASAgeGenderFlags>(CASAgeGenderFlags.Teen);

                    options.AddValue <CasteTypeOption, SimType>(SimType.NonActiveFamily);

                    options.SetValue <CasteFundsMinOption, int>(100000);

                    options.SetValue <AssignPrivateSchoolOption, bool>(true);
                }
            }
Ejemplo n.º 5
0
 public ChangeCasteOptions(CasteOptions option)
 {
     mOption = option;
 }
Ejemplo n.º 6
0
        protected void InitializeCastes()
        {
            bool teenCreated;

            int currentVersion = GetValue <Version, int>();

            sCheckedCastes.Clear();

            CasteOptions teenOptions = Options.GetNewCasteOptions("Teenagers", Common.Localize("Caste:Teen"), out teenCreated);

            if (teenCreated)
            {
                teenOptions.SetValue <CasteAutoOption, bool>(true);
                teenOptions.SetValue <CasteAgeOption, List <CASAgeGenderFlags> >(null);
                teenOptions.AddValue <CasteAgeOption, CASAgeGenderFlags>(CASAgeGenderFlags.Teen);

                teenOptions.SetValue <DisallowCareerOption, List <OccupationNames> >(null);
            }

            if (teenOptions != null)
            {
                if (currentVersion < 1)
                {
                    teenOptions.AddValue <DisallowCareerOption, OccupationNames>(OccupationNames.Firefighter);
                    teenOptions.AddValue <DisallowCareerOption, OccupationNames>(OccupationNames.GhostHunter);
                    teenOptions.AddValue <DisallowCareerOption, OccupationNames>(OccupationNames.InteriorDesigner);
                    teenOptions.AddValue <DisallowCareerOption, OccupationNames>(OccupationNames.Stylist);
                    teenOptions.AddValue <DisallowCareerOption, OccupationNames>(OccupationNames.AcademicCareer);
                }

                if (currentVersion < 2)
                {
                    teenOptions.SetValue <AllowAdoptionOption, bool>(false);
                }

                if (currentVersion < 6)
                {
                    teenOptions.SetValue <AllowBeProfessorOption, bool>(false);
                }
            }

            bool         youngAdultCreated;
            CasteOptions youngAdultOptions = Options.GetNewCasteOptions("YoungAdults", Common.Localize("Caste:YoungAdult"), out youngAdultCreated);

            if (youngAdultCreated)
            {
                youngAdultOptions.SetValue <CasteAutoOption, bool>(true);
                youngAdultOptions.SetValue <CasteAgeOption, List <CASAgeGenderFlags> >(null);
                youngAdultOptions.AddValue <CasteAgeOption, CASAgeGenderFlags>(CASAgeGenderFlags.YoungAdult);
                youngAdultOptions.SetValue <AllowMoveSoloOption, bool>(true);
            }

            if (youngAdultOptions != null)
            {
                if (currentVersion < 1)
                {
                    if (!GameUtils.IsUniversityWorld())
                    {
                        youngAdultOptions.AddValue <DisallowCareerOption, OccupationNames>(OccupationNames.AcademicCareer);
                    }
                }

                if (currentVersion < 6)
                {
                    youngAdultOptions.SetValue <AllowBeProfessorOption, bool>(true);
                }
            }

            bool         adultCreated;
            CasteOptions adultOptions = Options.GetNewCasteOptions("Adults", Common.Localize("Caste:Adult"), out adultCreated);

            if (adultCreated)
            {
                adultOptions.SetValue <CasteAutoOption, bool>(true);
                adultOptions.SetValue <CasteAgeOption, List <CASAgeGenderFlags> >(null);
                adultOptions.AddValue <CasteAgeOption, CASAgeGenderFlags>(CASAgeGenderFlags.Adult);
                adultOptions.SetValue <AllowMoveSoloOption, bool>(true);
            }

            if (adultOptions != null)
            {
                if (currentVersion < 1)
                {
                    if (!GameUtils.IsUniversityWorld())
                    {
                        adultOptions.AddValue <DisallowCareerOption, OccupationNames>(OccupationNames.AcademicCareer);
                    }
                }

                if (currentVersion < 6)
                {
                    adultOptions.SetValue <AllowBeProfessorOption, bool>(true);
                }
            }

            bool         elderCreated;
            CasteOptions elderOptions = Options.GetNewCasteOptions("Elders", Common.Localize("Caste:Elder"), out elderCreated);

            if (elderCreated)
            {
                elderOptions.SetValue <CasteAutoOption, bool>(true);
                elderOptions.SetValue <CasteAgeOption, List <CASAgeGenderFlags> >(null);
                elderOptions.AddValue <CasteAgeOption, CASAgeGenderFlags>(CASAgeGenderFlags.Elder);
                elderOptions.SetValue <AllowMoveSoloOption, bool>(true);
            }

            if (elderOptions != null)
            {
                if (currentVersion < 1)
                {
                    if (!GameUtils.IsUniversityWorld())
                    {
                        elderOptions.AddValue <DisallowCareerOption, OccupationNames>(OccupationNames.AcademicCareer);
                    }
                }

                if (currentVersion < 6)
                {
                    elderOptions.SetValue <AllowBeProfessorOption, bool>(true);
                }
            }

            bool         maleCreated;
            CasteOptions maleOptions = Options.GetNewCasteOptions("Males", Common.Localize("Caste:Male"), out maleCreated);

            if (maleCreated)
            {
                maleOptions.SetValue <CasteAutoOption, bool>(true);
                maleOptions.SetValue <CasteGenderOption, List <CASAgeGenderFlags> >(null);
                maleOptions.AddValue <CasteGenderOption, CASAgeGenderFlags>(CASAgeGenderFlags.Male);

                maleOptions.AddValue <DisallowCastePregnancyOption, CasteOptions>(maleOptions);
                maleOptions.SetValue <AllowCanBePregnantOption, bool>(false);
            }

            bool         femaleCreated;
            CasteOptions femaleOptions = Options.GetNewCasteOptions("Females", Common.Localize("Caste:Female"), out femaleCreated);

            if (femaleCreated)
            {
                femaleOptions.SetValue <CasteAutoOption, bool>(true);
                femaleOptions.SetValue <CasteGenderOption, List <CASAgeGenderFlags> >(null);
                femaleOptions.AddValue <CasteGenderOption, CASAgeGenderFlags>(CASAgeGenderFlags.Female);

                femaleOptions.AddValue <DisallowCastePregnancyOption, CasteOptions>(femaleOptions);
            }

            if (maleCreated)
            {
                maleOptions.AddValue <DisallowCasteCanBePregnantOption, CasteOptions>(femaleOptions);
            }

            // No Service Flirt, Friends, Personality, Pregnancies
            bool         created;
            CasteOptions options = Options.GetNewCasteOptions("ServicePopulation", Common.Localize("Caste:Service"), out created);

            if (created)
            {
                options.SetValue <CasteAutoOption, bool>(true);
                options.SetValue <CasteTypeOption, List <SimType> >(null);
                options.AddValue <CasteTypeOption, SimType>(SimType.Service);

                options.SetValue <AllowRomanceOption, bool>(false);
                options.SetValue <AllowFriendshipOption, bool>(false);
                options.SetValue <AllowMarriageOption, bool>(false);
                options.SetValue <AllowPersonalityOption, bool>(false);
                options.SetValue <AllowPregnancyParticipationOption, bool>(false);
                options.SetValue <AllowPushAtDayOption, bool>(false);
                options.SetValue <AllowPushAtNightOption, bool>(false);
                options.SetValue <AllowStoryOption, bool>(false);
                options.SetValue <AllowPushWorkOption, bool>(false);
            }

            if (options != null)
            {
                if (currentVersion < 6)
                {
                    options.SetValue <AllowBeProfessorOption, bool>(false);
                }
            }

            // No Role Flirt, Friends, Personality, Pregnancies
            options = Options.GetNewCasteOptions("RoleSims", Common.Localize("Caste:Role"), out created);
            if (created)
            {
                options.SetValue <CasteAutoOption, bool>(true);
                options.SetValue <CasteTypeOption, List <SimType> >(null);
                options.AddValue <CasteTypeOption, SimType>(SimType.Role);

                options.SetValue <AllowRomanceOption, bool>(false);
                options.SetValue <AllowFriendshipOption, bool>(false);
                options.SetValue <AllowMarriageOption, bool>(false);
                options.SetValue <AllowPersonalityOption, bool>(false);
                options.SetValue <AllowPregnancyParticipationOption, bool>(false);
                options.SetValue <AllowPushAtDayOption, bool>(false);
                options.SetValue <AllowPushAtNightOption, bool>(false);
                options.SetValue <AllowStoryOption, bool>(false);
                options.SetValue <AllowPushWorkOption, bool>(false);
            }

            if (options != null)
            {
                if (currentVersion < 6)
                {
                    options.SetValue <AllowBeProfessorOption, bool>(false);
                }
            }

            // No Homeless Pregnancies
            options = Options.GetNewCasteOptions("Homeless", Common.Localize("Caste:Homeless"), out created);
            if (created)
            {
                options.SetValue <CasteAutoOption, bool>(true);
                options.SetValue <CasteTypeOption, List <SimType> >(null);
                options.AddValue <CasteTypeOption, SimType>(SimType.Townie);

                options.SetValue <AllowPregnancyParticipationOption, bool>(false);
            }

            // No Tourist Flirt, Friends, Pregnancies
            options = Options.GetNewCasteOptions("Tourists", Common.Localize("Caste:Tourist"), out created);
            if (created)
            {
                options.SetValue <CasteAutoOption, bool>(true);
                options.SetValue <CasteTypeOption, List <SimType> >(null);
                options.AddValue <CasteTypeOption, SimType>(SimType.Tourist);

                options.SetValue <AllowRomanceOption, bool>(false);
                options.SetValue <AllowFriendshipOption, bool>(false);
                options.SetValue <AllowPregnancyParticipationOption, bool>(false);
                options.SetValue <AllowPushWorkOption, bool>(false);
            }

            if (options != null)
            {
                if (currentVersion < 6)
                {
                    options.SetValue <AllowBeProfessorOption, bool>(false);
                }
            }

            if (teenCreated)
            {
                // No Teen-Adult Flirting, No Teen Pregnancy
                teenOptions.SetValue <AllowPregnancyParticipationOption, bool>(false);
                teenOptions.SetValue <AllowMarriageOption, bool>(false);
                teenOptions.AddValue <DisallowCastePregnancyOption, CasteOptions>(youngAdultOptions);
                teenOptions.AddValue <DisallowCastePregnancyOption, CasteOptions>(adultOptions);
                teenOptions.AddValue <DisallowCastePregnancyOption, CasteOptions>(elderOptions);
                teenOptions.AddValue <DisallowCasteFlirtOption, CasteOptions>(youngAdultOptions);
                teenOptions.AddValue <DisallowCasteFlirtOption, CasteOptions>(adultOptions);
                teenOptions.AddValue <DisallowCasteFlirtOption, CasteOptions>(elderOptions);
            }

            if (youngAdultCreated)
            {
                if (currentVersion < 3)
                {
                    // Handled by Teen Caste
                    youngAdultOptions.RemoveValue <DisallowCastePregnancyOption, CasteOptions>(teenOptions);
                    youngAdultOptions.RemoveValue <DisallowCasteFlirtOption, CasteOptions>(teenOptions);
                }
            }

            if (adultCreated)
            {
                if (currentVersion < 3)
                {
                    // Handled by Teen Caste
                    adultOptions.RemoveValue <DisallowCastePregnancyOption, CasteOptions>(teenOptions);
                    adultOptions.RemoveValue <DisallowCasteFlirtOption, CasteOptions>(teenOptions);
                }
            }

            if (elderCreated)
            {
                if (currentVersion < 3)
                {
                    // Handled by Teen Caste
                    elderOptions.RemoveValue <DisallowCastePregnancyOption, CasteOptions>(teenOptions);
                    elderOptions.RemoveValue <DisallowCasteFlirtOption, CasteOptions>(teenOptions);
                }
            }

            // No Elder-Female Pregnancies
            options = Options.GetNewCasteOptions("ElderFemales", Common.Localize("Caste:ElderFemale"), out created);
            if (created)
            {
                options.SetValue <CasteAutoOption, bool>(true);
                options.SetValue <CasteAgeOption, List <CASAgeGenderFlags> >(null);
                options.AddValue <CasteAgeOption, CASAgeGenderFlags>(CASAgeGenderFlags.Elder);
                options.SetValue <CasteGenderOption, List <CASAgeGenderFlags> >(null);
                options.AddValue <CasteGenderOption, CASAgeGenderFlags>(CASAgeGenderFlags.Female);

                options.SetValue <AllowPregnancyParticipationOption, bool>(false);
            }

            // No Simbot Pregnancies
            options = Options.GetNewCasteOptions("Simbots", Common.Localize("Caste:Simbot"), out created);
            if (created)
            {
                options.SetValue <CasteAutoOption, bool>(true);
                options.SetValue <CasteTypeOption, List <SimType> >(null);
                options.AddValue <CasteTypeOption, SimType>(SimType.SimBot);

                options.SetValue <AllowPregnancyParticipationOption, bool>(false);
                options.SetValue <AllowAgingOption, bool>(false);
            }

            // No Robot Pregnancies
            options = Options.GetNewCasteOptions("Plumbots", SimTypes.GetLocalizedName(SimType.Plumbot), out created);
            if (created)
            {
                options.SetValue <CasteAutoOption, bool>(true);
                options.SetValue <CasteTypeOption, List <SimType> >(null);
                options.AddValue <CasteTypeOption, SimType>(SimType.Plumbot);
                options.AddValue <AllowCastePregnancyOption, CasteOptions>(options);
                options.SetValue <AllowAgingOption, bool>(false);
            }
            else if (options != null)
            {
                if (currentVersion < 4)
                {
                    options.RemoveValue <AllowCasteFlirtOption, CasteOptions>(options);
                }
            }

            // No Vampire Aging
            options = Options.GetNewCasteOptions("Vampires", Common.Localize("Caste:Vampire"), out created);
            if (created)
            {
                options.SetValue <CasteAutoOption, bool>(true);
                options.SetValue <CasteTypeOption, List <SimType> >(null);
                options.AddValue <CasteTypeOption, SimType>(SimType.Vampire);
                options.SetValue <CasteAgeOption, List <CASAgeGenderFlags> >(null);
                options.AddValue <CasteAgeOption, CASAgeGenderFlags>(CASAgeGenderFlags.YoungAdult);
                options.AddValue <CasteAgeOption, CASAgeGenderFlags>(CASAgeGenderFlags.Adult);
                options.AddValue <CasteAgeOption, CASAgeGenderFlags>(CASAgeGenderFlags.Elder);

                options.SetValue <AllowAgingOption, bool>(false);
            }

            // No Mummy Aging
            options = Options.GetNewCasteOptions("Mummies", Common.Localize("Caste:Mummy"), out created);
            if (created)
            {
                options.SetValue <CasteAutoOption, bool>(true);
                options.SetValue <CasteTypeOption, List <SimType> >(null);
                options.AddValue <CasteTypeOption, SimType>(SimType.Mummy);
                options.SetValue <CasteAgeOption, List <CASAgeGenderFlags> >(null);
                options.AddValue <CasteAgeOption, CASAgeGenderFlags>(CASAgeGenderFlags.YoungAdult);
                options.AddValue <CasteAgeOption, CASAgeGenderFlags>(CASAgeGenderFlags.Adult);
                options.AddValue <CasteAgeOption, CASAgeGenderFlags>(CASAgeGenderFlags.Elder);

                options.SetValue <AllowAgingOption, bool>(false);
            }

            // No Ghost Aging
            options = Options.GetNewCasteOptions("Ghosts", Common.Localize("Caste:Ghost"), out created);
            if (created)
            {
                options.SetValue <CasteAutoOption, bool>(true);
                options.SetValue <CasteTypeOption, List <SimType> >(null);
                options.AddValue <CasteTypeOption, SimType>(SimType.PlayableGhost);
                options.SetValue <CasteAgeOption, List <CASAgeGenderFlags> >(null);
                options.AddValue <CasteAgeOption, CASAgeGenderFlags>(CASAgeGenderFlags.YoungAdult);
                options.AddValue <CasteAgeOption, CASAgeGenderFlags>(CASAgeGenderFlags.Adult);
                options.AddValue <CasteAgeOption, CASAgeGenderFlags>(CASAgeGenderFlags.Elder);

                options.SetValue <AllowAgingOption, bool>(false);
            }

            // No Horse Pushes
            options = Options.GetNewCasteOptions("Horses", Common.Localize("Caste:Horse"), out created);
            if (created)
            {
                options.SetValue <CasteAutoOption, bool>(true);
                options.SetValue <CasteSpeciesOption, List <CASAgeGenderFlags> >(null);
                options.AddValue <CasteSpeciesOption, CASAgeGenderFlags>(CASAgeGenderFlags.Horse);

                options.SetValue <AllowPushAtDayOption, bool>(false);
                options.SetValue <AllowPushAtNightOption, bool>(false);
            }

            if (options != null)
            {
                if (currentVersion < 6)
                {
                    options.SetValue <AllowBeProfessorOption, bool>(false);
                }
            }

            // Don't Push Actives
            options = Options.GetNewCasteOptions("ActiveFamily", Common.Localize("Caste:ActiveFamily"), out created);
            if (created)
            {
                options.SetValue <CasteAutoOption, bool>(true);
                options.SetValue <CasteTypeOption, List <SimType> >(null);
                options.AddValue <CasteTypeOption, SimType>(SimType.ActiveFamily);

                options.SetValue <AllowPushAtDayOption, bool>(false);
                options.SetValue <AllowPushAtNightOption, bool>(false);
                options.SetValue <AllowPushWorkOption, bool>(false);
                options.SetValue <AllowSummaryOption, bool>(false);
                options.SetValue <AllowPushPartyOption, bool>(false);
                options.SetValue <AllowAdoptionOption, bool>(false);
            }

            // Setting this just to be safe
            if (options != null)
            {
                if (currentVersion < 5)
                {
                    options.SetValue <AllowMoveFamilyOption, bool>(false);
                    options.SetValue <AllowMoveSoloOption, bool>(false);
                }

                if (currentVersion < 6)
                {
                    options.SetValue <AllowBeProfessorOption, bool>(false);
                }
            }

            // For simplicity
            options = Options.GetNewCasteOptions("NonActiveFamily", Common.Localize("Caste:NonActiveFamily"), out created);
            if (created)
            {
                options.SetValue <CasteAutoOption, bool>(true);
                options.SetValue <CasteTypeOption, List <SimType> >(null);
                options.AddValue <CasteTypeOption, SimType>(SimType.NonActiveFamily);

                if (GameUtils.IsUniversityWorld())
                {
                    options.SetValue <AllowMarriageOption, bool>(false);
                    options.SetValue <AllowPregnancyParticipationOption, bool>(false);
                }
            }
            else if (options != null)
            {
                if (currentVersion < 1)
                {
                    if (GameUtils.IsUniversityWorld())
                    {
                        options.SetValue <AllowMarriageOption, bool>(false);
                        options.SetValue <AllowPregnancyParticipationOption, bool>(false);
                    }
                }
            }

            if (OnInitializeCastes != null)
            {
                OnInitializeCastes();
            }

            foreach (CasteOptions option in new List <CasteOptions>(Options.AllCastes))
            {
                string defaultName = option.DefaultName;
                if (string.IsNullOrEmpty(defaultName))
                {
                    continue;
                }

                if (!sCheckedCastes.ContainsKey(defaultName))
                {
                    Options.RemoveCaste(option);
                }
            }

            GetOption <CreatedCastesOption>().RemoveMissing(sCheckedCastes);

            Options.InvalidateCache();

            SetValue <Version, int>(6);
        }