Ejemplo n.º 1
0
        public BreedPickerDialog(CASAgeGenderFlags speciesFlag)
        {
            if (CASLogic.sBreedOutfitDict == null)
            {
                CASLogic.LoadPetBreedsXML();
            }
            mBreeds   = CASLogic.GetBreedOutfitList(speciesFlag);
            breedInfo = new List <ObjectListPickerInfo>();

            string emptyBreed = "";

            if (speciesFlag == CASAgeGenderFlags.Dog || speciesFlag == CASAgeGenderFlags.LittleDog)
            {
                emptyBreed = StringTable.GetLocalizedString("Ui/Caption/HUD/PetAdoptionInfoTooltip:DogNoBreed");
            }
            else
            {
                emptyBreed = StringTable.GetLocalizedString("Ui/Caption/HUD/PetAdoptionInfoTooltip:CatHorseNoBreed");
            }
            breedInfo.Add(new ObjectListPickerInfo(emptyBreed, new BreedOutfit("", "")));

            foreach (BreedOutfit b in mBreeds)
            {
                // Breed names ending in "Delta" display as, "Create a [Species]".
                // I think they are used in CAP.
                if (!b.BreedOutfitName.EndsWith("Delta"))
                {
                    ObjectListPickerInfo o = new ObjectListPickerInfo(StringTable.
                                                                      GetLocalizedString(b.BreedLocKey), b);
                    breedInfo.Add(o);
                }
            }
        }
Ejemplo n.º 2
0
        protected override bool Run(SimDescription me, bool singleSelection)
        {
            if (!ApplyAll)
            {
                mGender = NRaas.MasterControllerSpace.Helpers.Baby.SelectGender();
                if (mGender == CASAgeGenderFlags.None) return false;
            }

            if (me.Pregnancy != null)
            {
                me.Pregnancy.mGender = NRaas.MasterControllerSpace.Helpers.Baby.InterpretGender(mGender);

                string str = "";
                switch(mGender)
                {
                    case CASAgeGenderFlags.GenderMask:
                        str = MasterController.Localize("Criteria.Random:MenuName");
                        break;
                    case CASAgeGenderFlags.Female:
                        str = MasterController.Localize("BabyGender:Female");
                        break;
                    case CASAgeGenderFlags.Male:
                        str = MasterController.Localize("BabyGender:Male");
                        break;
                    default:
                        break;
                }

                Common.Notify(me.FullName + " " + MasterController.Localize("BabyGender:MenuName") + ": " + str);
            }

            return true;
        }
Ejemplo n.º 3
0
        public static Sim DGSMakeRandomSimNoCheck(Vector3 point, CASAgeGenderFlags age, CASAgeGenderFlags gender, WorldName worldname)
        {
            LotLocation    lotLocation     = default(LotLocation);
            ulong          lotLocation2    = World.GetLotLocation(point, ref lotLocation);
            Lot            lot             = LotManager.GetLot(lotLocation2);
            SimDescription simDescription2 = DGSMakeSSimDescription(age, gender, worldname, uint.MaxValue);

            Genetics.AssignRandomTraits(simDescription2);
            if (lot != null)
            {
                if (lot.Household == null)
                {
                    Household household = Household.Create();
                    lot.MoveIn(household);
                }
                lot.Household.Add(simDescription2);
            }
            else
            {
                Household household2 = Household.Create();
                household2.SetName(/* "E3Lesa is Good" */ "Good Household");
                household2.Add(simDescription2);
            }
            WorldName currentWorld = worldname;

            simDescription2.FirstName = SimUtils.GetRandomGivenName(simDescription2.IsMale, currentWorld);
            simDescription2.LastName  = SimUtils.GetRandomFamilyName(currentWorld);

            return(simDescription2.Instantiate(point));
        }
Ejemplo n.º 4
0
        public bool AllowNearRelation(CASAgeGenderFlags species, bool woohoo, bool autonomous)
        {
            if (woohoo)
            {
                if (!mAllowNearRelationWoohooV2[GetSpeciesIndex(species)])
                {
                    return(false);
                }

                if (autonomous)
                {
                    if (!mAllowNearRelationWoohooAutonomousV2[GetSpeciesIndex(species)])
                    {
                        return(false);
                    }
                }
            }

            if (!mAllowNearRelationRomanceV2[GetSpeciesIndex(species)])
            {
                return(false);
            }

            if (autonomous)
            {
                if (!mAllowNearRelationRomanceAutonomousV2[GetSpeciesIndex(species)])
                {
                    return(false);
                }
            }

            return(true);
        }
Ejemplo n.º 5
0
        // For robo mom with robo dad
        private List <SimDescription> CreateNewbornsBeforePacking(SimDescription mother, SimDescription robot, SimDescription father, float bonusMoodPoints, bool addToFamily, int numSims, int numPets)
        {
            float  averageMoodForBirth = GetAverageMoodForBirth(robot, bonusMoodPoints);
            Random pregoRandom         = new Random(mRandomGenSeed);
            int    numBirth            = GetNumForBirth(mother, father, pregoRandom, numSims, numPets);
            Random gen = new Random(mRandomGenSeed);
            List <SimDescription> list = new List <SimDescription>();

            for (int i = 0; i < numBirth; i++)
            {
                DetermineGenderOfBaby(gen);
                CASAgeGenderFlags gender = mGender;
                mGender = CASAgeGenderFlags.None;
                SimDescription baby = CommonSurrogatePregnancy.MakeDescendant(father, mother, robot, mMom.SimDescription, CASAgeGenderFlags.Baby,
                                                                              gender, averageMoodForBirth, pregoRandom, false, true, true, mMom.SimDescription.HomeWorld, false);
                baby.WasCasCreated = false;

                if (addToFamily)
                {
                    mMom.Household.Add(baby);
                    Sim sim = baby.Instantiate(mMom.Position);
                    CheckForGhostBaby(sim);
                }

                list.Add(baby);
            }

            return(list);
        }
Ejemplo n.º 6
0
        protected static List <CASParts.Wrapper> GetVisibleCASParts(CASLogic ths, BodyTypes bodyType, uint categories)
        {
            uint alteredCategories = categories;

            ths.AdjustAvailableCategoriesForCASMode(ref alteredCategories);

            SimBuilder builder = ths.mBuilder;

            CASAgeGenderFlags age     = builder.Age;
            CASAgeGenderFlags gender  = builder.Gender;
            CASAgeGenderFlags species = builder.Species;

            List <CASParts.Wrapper> list = new List <CASParts.Wrapper>();

            foreach (CASParts.Wrapper part in CASBase.HairParts)
            {
                InvalidPartBase.Reason reason = InvalidPartBooter.Allow(part, age, gender, species, false, (OutfitCategories)categories);
                if (reason != InvalidPartBase.Reason.None)
                {
                    continue;
                }

                if ((part.mPart.BodyType == bodyType) && OutfitUtils.PartMatchesSim(builder, alteredCategories, part.mPart))
                {
                    list.Add(part);
                }
            }
            return(list);
        }
Ejemplo n.º 7
0
            public int GetRandomAmount(bool female, CASAgeGenderFlags age)
            {
                if (!mByAge.Contains(age))
                {
                    return(0);
                }

                if (female)
                {
                    if (!RandomUtil.RandomChance(mFemaleChance))
                    {
                        return(0);
                    }

                    return(RandomUtil.GetInt(mMinFemale, mMaxFemale));
                }
                else
                {
                    if (!RandomUtil.RandomChance(mMaleChance))
                    {
                        return(0);
                    }

                    return(RandomUtil.GetInt(mMinMale, mMaxMale));
                }
            }
Ejemplo n.º 8
0
        private static ScientificSample SelectDNASample(Sim robot, CASAgeGenderFlags gender)
        {
            List <ObjectPicker.HeaderInfo> list       = new List <ObjectPicker.HeaderInfo>();
            List <ObjectPicker.TabInfo>    list2      = new List <ObjectPicker.TabInfo>();
            List <ScientificSample>        dnaSamples = GetDNASamples(robot, gender);

            int numSelectableRows = 1;

            ObjectPicker.TabInfo tabInfo = new ObjectPicker.TabInfo(string.Empty, "TabText", new List <ObjectPicker.RowInfo>());

            foreach (ScientificSample current in dnaSamples)
            {
                ObjectPicker.RowInfo rowInfo = new ObjectPicker.RowInfo(current, new List <ObjectPicker.ColumnInfo>());
                rowInfo.ColumnInfo.Add(new ObjectPicker.ThumbAndTextColumn(current.GetThumbnailKey(), current.GetLocalizedName()));
                rowInfo.ColumnInfo.Add(new ObjectPicker.TextColumn(current.Subject.GetSubjectString()));
                tabInfo.RowInfo.Add(rowInfo);
            }

            list2.Add(tabInfo);
            list.Add(new ObjectPicker.HeaderInfo("HeaderString1", "HeaderTooltip1", 250));
            list.Add(new ObjectPicker.HeaderInfo("HeaderString2", "HeaderTooltip2", 250));
            List <ObjectPicker.RowInfo> list4 = ObjectPickerDialog.Show(true, ModalDialog.PauseMode.PauseSimulator, "DialogTitle",
                                                                        "Okay", "Cancel", list2, list, numSelectableRows);
            ScientificSample result = null;

            if (list4 != null && list4.Count > 0)
            {
                result = (ScientificSample)list4[0].Item;
            }

            return(result);
        }
Ejemplo n.º 9
0
        protected bool ValidContent(UISimInfo sim, CASAgeGenderFlags species, SimDescription exclude)
        {
            if (sim == null)
            {
                return(false);
            }

            if (sim.SimName == null)
            {
                return(false);
            }

            if (sim.Species != species)
            {
                return(false);
            }

            if (exclude != null)
            {
                if (sim.SimName.Contains(exclude.LastName))
                {
                    return(false);
                }
            }

            return(true);
        }
Ejemplo n.º 10
0
        public static string FetchMotiveLocalization(CASAgeGenderFlags flag, CommodityKind motive)
        {
            string str = "";

            switch (motive)
            {
            case CommodityKind.Hygiene:
                if (flag == CASAgeGenderFlags.Cat)
                {
                    str = "Scratch";
                }
                if (flag == CASAgeGenderFlags.Dog)
                {
                    str = "Destruction";
                }
                if (flag == CASAgeGenderFlags.Horse)
                {
                    str = "Exercise";
                }
                break;

            case CommodityKind.Fun:
                if (flag == CASAgeGenderFlags.Horse)
                {
                    str = "Thirst";
                }
                break;

            default:
                break;
            }

            return(Common.LocalizeEAString("Ui/Caption/HUD/MotivesPanel:Motive" + str + (flag == CASAgeGenderFlags.Human || str == "B" ? motive.ToString() : flag.ToString())));
        }
Ejemplo n.º 11
0
        public static CASAgeGenderFlags GetDaysGoneAges(float daysGone)
        {
            float childAge = AgingManager.GetAgingStageLength(CASAgeGenderFlags.Human, CASAgeGenderFlags.Child);
            float teenAge  = childAge + AgingManager.GetAgingStageLength(CASAgeGenderFlags.Human, CASAgeGenderFlags.Teen);
            float youngAge = teenAge + AgingManager.GetAgingStageLength(CASAgeGenderFlags.Human, CASAgeGenderFlags.YoungAdult);
            float adultAge = youngAge + AgingManager.GetAgingStageLength(CASAgeGenderFlags.Human, CASAgeGenderFlags.Adult);

            CASAgeGenderFlags age = CASAgeGenderFlags.None;

            if (daysGone > childAge)
            {
                age |= CASAgeGenderFlags.Teen;
            }
            if (daysGone > teenAge)
            {
                age |= CASAgeGenderFlags.YoungAdult;
            }
            if (daysGone > youngAge)
            {
                age |= CASAgeGenderFlags.Adult;
            }
            if (daysGone > adultAge)
            {
                age |= CASAgeGenderFlags.Elder;
            }

            return(age);
        }
Ejemplo n.º 12
0
        public SimDescription CreateNewSim(CASAgeGenderFlags age, CASAgeGenderFlags gender, CASAgeGenderFlags species)
        {
            SimDescription dad = GetSim(CASAgeGenderFlags.Male, species, null);

            if (dad == null)
            {
                dad = GetSim(CASAgeGenderFlags.Female, species, null);
                if (dad == null)
                {
                    return(null);
                }
            }

            SimDescription mom = GetSim(CASAgeGenderFlags.Female, species, dad);

            if (mom == null)
            {
                mom = GetSim(CASAgeGenderFlags.Male, species, dad);
                if (mom == null)
                {
                    return(null);
                }
            }

            return(CreateNewSim(mom, dad, age, gender, species, false));
        }
Ejemplo n.º 13
0
            public void AddNames(CASAgeGenderFlags species, bool isFemale, Dictionary <string, bool> names)
            {
                Genders genders;

                if (!mNames.TryGetValue(species, out genders))
                {
                    genders = new Genders();
                    mNames.Add(species, genders);

                    Genders loadedGenders;
                    if (mLoadedNames.TryGetValue(species, out loadedGenders))
                    {
                        genders.GetNames(isFemale).AddRange(loadedGenders.GetNames(isFemale));

                        foreach (string name in loadedGenders.GetExclusions(isFemale).Keys)
                        {
                            genders.GetExclusions(isFemale).Add(name, true);
                        }
                    }
                }

                foreach (string name in names.Keys)
                {
                    if (genders.GetExclusions(isFemale).ContainsKey(name))
                    {
                        continue;
                    }

                    genders.GetNames(isFemale).Add(name);
                }

                names.Clear();
            }
Ejemplo n.º 14
0
            public string GetRandomName(bool fullList, CASAgeGenderFlags species, bool isFemale)
            {
                Genders genders = null;

                if (!fullList)
                {
                    if (!mLoadedNames.TryGetValue(species, out genders))
                    {
                        genders = null;
                    }
                }

                if (genders == null)
                {
                    if (!mNames.TryGetValue(species, out genders))
                    {
                        return("");
                    }
                }

                List <string> names = genders.GetNames(isFemale);

                if (names.Count == 0)
                {
                    return("");
                }

                return(RandomUtil.GetRandomObjectFromList(names));
            }
Ejemplo n.º 15
0
        public override bool Parse(XmlDbRow row, SimPersonality personality, ref string error)
        {
            if (!base.Parse(row, personality, ref error))
            {
                return(false);
            }

            if (!row.Exists("Name"))
            {
                error = "Name missing";
                return(false);
            }
            else if (!row.Exists("Default"))
            {
                error = "Default missing";
                return(false);
            }
            else
            {
                CASAgeGenderFlags ageGender;
                if (!ParserFunctions.TryParseEnum <CASAgeGenderFlags>(row.GetString("AgeGender"), out ageGender, CASAgeGenderFlags.None))
                {
                    error = "Unknown AgeGender " + row.GetString("AgeGender");
                    return(false);
                }

                mAge = ageGender & CASAgeGenderFlags.AgeMask;

                if (mAge == CASAgeGenderFlags.None)
                {
                    mAge = CASAgeGenderFlags.AgeMask;
                }

                mGender = ageGender & CASAgeGenderFlags.GenderMask;

                if (mGender == CASAgeGenderFlags.None)
                {
                    mGender = CASAgeGenderFlags.GenderMask;
                }

                StringToSpeciesList converter = new StringToSpeciesList();
                mSpecies = converter.Convert(row.GetString("Species"));
                if (mSpecies == null)
                {
                    error = converter.mError;
                    return(false);
                }

                if (mSpecies.Count == 0)
                {
                    mSpecies.Add(CASAgeGenderFlags.Human);
                }
            }

            mName = row.GetString("Name");

            SetValue(row.GetBool("Default"));

            return(true);
        }
Ejemplo n.º 16
0
            protected string GetKey(CASAgeGenderFlags first, CASAgeGenderFlags second)
            {
                switch (first)
                {
                case CASAgeGenderFlags.Male:
                    switch (second)
                    {
                    case CASAgeGenderFlags.Male:
                        return(mMaleMale);

                    case CASAgeGenderFlags.Female:
                        return(mMaleFemale);

                    default:
                        return(mMale);
                    }

                case CASAgeGenderFlags.Female:
                    switch (second)
                    {
                    case CASAgeGenderFlags.Male:
                        return(mFemaleMale);

                    case CASAgeGenderFlags.Female:
                        return(mFemaleFemale);

                    default:
                        return(mFemale);
                    }

                default:
                    return(mMale);
                }
            }
Ejemplo n.º 17
0
 public static Route CreateRoute(SimRoutingComponent ths, CASAgeGenderFlags ageGenderFlags)
 {
     Route r = null;
     uint num = (uint)ageGenderFlags;
     r = Route.Create(ths.Owner.Proxy, num);
     ths.SetRouteOptions(r, num);
     return r;
 }
Ejemplo n.º 18
0
        protected override bool Allow(CASAgeGenderFlags option)
        {
            if ((option & CASAgeGenderFlags.AgeMask) == CASAgeGenderFlags.None) return false;

            if (option == CASAgeGenderFlags.AgeMask) return false;

            return true;
        }
Ejemplo n.º 19
0
        private static void LoadPetFirstNames(bool isFemale, CASAgeGenderFlags species, Dictionary <string, bool> names)
        {
            for (int i = 0; i < 1000; i++)
            {
                string name = SimUtils.GetRandomPetName(!isFemale, species, true);

                names[name] = true;
            }
        }
Ejemplo n.º 20
0
        public bool IsHit(CASAgeGenderFlags ageGender)
        {
            if ((mAgeGender & ageGender) != ageGender)
            {
                return(false);
            }

            return(mSpecies.Contains(ageGender & CASAgeGenderFlags.SpeciesMask));
        }
Ejemplo n.º 21
0
 public void Set(OutfitCategories categories, List <WorldType> worldTypes, OutfitCategoriesExtended extended, CASAgeGenderFlags age, CASAgeGenderFlags gender, CASAgeGenderFlags species)
 {
     mCategories = categories;
     mExtended   = extended;
     mAge        = age;
     mGender     = gender;
     mSpecies    = species;
     mWorldTypes = worldTypes;
 }
Ejemplo n.º 22
0
        public static Route CreateRoute(SimRoutingComponent ths, CASAgeGenderFlags ageGenderFlags)
        {
            Route r   = null;
            uint  num = (uint)ageGenderFlags;

            r = Route.Create(ths.Owner.Proxy, num);
            ths.SetRouteOptions(r, num);
            return(r);
        }
Ejemplo n.º 23
0
        public override void Export(Persistence.Lookup settings)
        {
            foreach (CASAgeGenderFlags species in new CASAgeGenderFlags[] { CASAgeGenderFlags.Human, CASAgeGenderFlags.Horse, CASAgeGenderFlags.Cat, CASAgeGenderFlags.Dog })
            {
                mSpecies = species;

                base.Export(settings);
            }
        }
Ejemplo n.º 24
0
        private static void LoadPetFirstNames(bool isFemale, CASAgeGenderFlags species, Dictionary<string, bool> names)
        {
            for (int i = 0; i < 1000; i++)
            {
                string name = SimUtils.GetRandomPetName(!isFemale, species, true);

                names[name] = true;
            }
        }
Ejemplo n.º 25
0
        public override void GetNewBorns()
        {
            mNewborns = new List <Sim>();
            Sims3.Gameplay.Gameflow.Singleton.DisableSave(this, "Gameplay/ActorSystems/Pregnancy:DisableSave");
            bool keepBaby = false;

            //if (Actor.Household.NumActorMembersCountingPregnancy < 0x8)
            {
                // Custom
                if (SimTypes.IsSelectable(Actor))
                {
                    keepBaby = TwoButtonDialog.Show(AlienUtils.LocalizeString("MalePregnancyConfirmationDialog", new object[] { Actor }), AlienUtils.LocalizeString("MalePregnancyConfirmationDialogAccept", new object[0x0]), AlienUtils.LocalizeString("MalePregnancyConfirmationDialogReject", new object[0x0]));
                }
                else
                {
                    keepBaby = true;
                }
            }

            /*else
             * {
             *  Actor.ShowTNSIfSelectable(AlienUtils.LocalizeString("MalePregnancyHouseholdFullTNS", new object[] { Actor }), StyledNotification.NotificationStyle.kGameMessagePositive, ObjectGuid.InvalidObjectGuid, Actor.ObjectId);
             * }*/

            CASAgeGenderFlags gender       = RandomUtil.CoinFlip() ? CASAgeGenderFlags.Male : CASAgeGenderFlags.Female;
            SimDescription    description2 = SimDescription.Find(this.AlienParentID);
            SimDescription    newSim       = Genetics.MakeAlien(CASAgeGenderFlags.Baby, gender, GameUtils.GetCurrentWorld(), 1f, false);

            newSim.LastName = Actor.LastName;
            if ((keepBaby) && (SimTypes.IsSelectable(Actor)))
            {
                newSim.FirstName = string.Empty;
            }

            Genetics.AssignTraits(newSim, null, Actor.SimDescription, (keepBaby) && (SimTypes.IsSelectable(Actor)), (float)Actor.MoodManager.MoodValue, new Random());
            Actor.Genealogy.AddChild(newSim.Genealogy);
            if (description2 != null)
            {
                description2.Genealogy.AddChild(newSim.Genealogy);
            }

            if (keepBaby)
            {
                Actor.Household.Add(newSim);
            }
            else
            {
                Household.AlienHousehold.Add(newSim);
            }

            Sim babyToHide = newSim.Instantiate(Vector3.Empty);

            babyToHide.GreetSimOnLot(Actor.LotCurrent);
            babyToHide.SetPosition(Actor.Position);
            Pregnancy.TotallyHideBaby(babyToHide);
            mNewborns.Add(babyToHide);
        }
Ejemplo n.º 26
0
 public static SimDescription MakeDescendant(SimDescription dad, SimDescription mom, SimDescription robotDad, SimDescription robotMom,
                                             CASAgeGenderFlags age, CASAgeGenderFlags gender, float averageMood, Random pregoRandom, bool interactive, bool updateGenealogy,
                                             bool setName, WorldName homeWorld, bool plantSimBaby)
 {
     return(MakeDescendant(dad, mom, robotDad, robotMom, age, gender, averageMood, pregoRandom, interactive, updateGenealogy, setName,
                           homeWorld, plantSimBaby, new Pregnancy.BabyCustomizeData {
         IsBabyCustomized = false
     }));
 }
Ejemplo n.º 27
0
        public override bool Parse(XmlDbRow row, SimPersonality personality, ref string error)
        {
            if (!base.Parse(row, personality, ref error)) return false;

            if (!row.Exists("Name"))
            {
                error = "Name missing";
                return false;
            }
            else if (!row.Exists("Default"))
            {
                error = "Default missing";
                return false;
            }
            else
            {
                CASAgeGenderFlags ageGender;
                if (!ParserFunctions.TryParseEnum<CASAgeGenderFlags>(row.GetString("AgeGender"), out ageGender, CASAgeGenderFlags.None))
                {
                    error = "Unknown AgeGender " + row.GetString("AgeGender");
                    return false;
                }

                mAge = ageGender & CASAgeGenderFlags.AgeMask;

                if (mAge == CASAgeGenderFlags.None)
                {
                    mAge = CASAgeGenderFlags.AgeMask;
                }

                mGender = ageGender & CASAgeGenderFlags.GenderMask;

                if (mGender == CASAgeGenderFlags.None)
                {
                    mGender = CASAgeGenderFlags.GenderMask;
                }

                StringToSpeciesList converter = new StringToSpeciesList();
                mSpecies = converter.Convert(row.GetString("Species"));
                if (mSpecies == null)
                {
                    error = converter.mError;
                    return false;
                }

                if (mSpecies.Count == 0)
                {
                    mSpecies.Add(CASAgeGenderFlags.Human);
                }
            }

            mName = row.GetString("Name");

            SetValue (row.GetBool("Default"));

            return true;
        }
Ejemplo n.º 28
0
        public new List <SimDescription> CreateNewbornsBeforePacking(float bonusMoodPoints, bool bAddToFamily, int householdSimMembers, int householdPetMembers)
        {
            MiniSimDescription miniDescription = null;
            SimDescription     description;

            if (mDad == null || mDad.HasBeenDestroyed)
            {
                description = SimDescription.Find(DadDescriptionId);

                if (description == null)
                {
                    miniDescription = MiniSimDescription.Find(DadDescriptionId);

                    if (miniDescription != null)
                    {
                        description = miniDescription.UnpackSim();
                        description.Genealogy.SetSimDescription(description);
                    }
                }
            }
            else
            {
                description = mDad.SimDescription;
            }

            float  averageMoodForBirth = GetAverageMoodForBirth(description, bonusMoodPoints);
            Random pregoRandom         = new Random(mRandomGenSeed);
            int    numForBirth         = GetNumForBirth(description, pregoRandom, householdSimMembers, householdPetMembers);
            Random gen = new Random(mRandomGenSeed);
            List <SimDescription> list = new List <SimDescription>();

            for (int i = 0; i < numForBirth; i++)
            {
                DetermineGenderOfBaby(gen);
                CASAgeGenderFlags gender = mGender;
                mGender = CASAgeGenderFlags.None;
                SimDescription description2 = AlienUtilsEx.MakeAlienBaby(description, mMom.SimDescription, gender, averageMoodForBirth, pregoRandom, false);
                description2.WasCasCreated = false;

                if (bAddToFamily)
                {
                    mMom.Household.Add(description2);
                    Sim sim = description2.Instantiate(mMom.Position);
                    CheckForGhostBaby(sim);
                }

                list.Add(description2);
            }

            if (miniDescription != null)
            {
                description.Dispose(true, true);
            }

            return(list);
        }
Ejemplo n.º 29
0
 // Token: 0x06006FB8 RID: 28600 RVA: 0x0026CC7C File Offset: 0x0026BC7C
 private void CleanupAndDestroyDeadSim(bool forceCleanup)
 {
     if (this.mDeathEffect != null)
     {
         this.mDeathEffect.Stop();
         this.mDeathEffect = null;
     }
     this.Target.ClearReferenceList();
     if (this.mSituation.LastSimOfHousehold == null || this.mSituation.LastSimOfHousehold != this.Target || forceCleanup)
     {
         if (this.Target.Household == null || this.Target.Household.IsPetHousehold)
         {
             SimDescription    simDescription = this.Target.SimDescription;
             PetPoolType       petPoolType    = PetPoolType.None;
             CASAgeGenderFlags species        = simDescription.Species;
             if (species <= CASAgeGenderFlags.Cat)
             {
                 if (species != CASAgeGenderFlags.Horse)
                 {
                     if (species == CASAgeGenderFlags.Cat)
                     {
                         petPoolType = PetPoolType.StrayCat;
                     }
                 }
                 else if (simDescription.IsUnicorn)
                 {
                     petPoolType = PetPoolType.Unicorn;
                 }
                 else
                 {
                     petPoolType = PetPoolType.WildHorse;
                 }
             }
             else if (species == CASAgeGenderFlags.Dog || species == CASAgeGenderFlags.LittleDog)
             {
                 petPoolType = PetPoolType.StrayDog;
             }
             if (PetPoolManager.IsPetInPoolType(simDescription, petPoolType))
             {
                 PetPoolManager.RemovePet(petPoolType, simDescription);
             }
         }
         this.mGrave.GhostCleanup(this.Target, true);
         if (this.Target.Autonomy != null)
         {
             this.Target.Autonomy.DecrementAutonomyDisabled();
         }
         this.Target.SimDescription.ShowSocialsOnSim = true;
         if (!this.mWasMemberOfActiveHousehold && Household.ActiveHousehold != null && this.Actor.LotCurrent != Household.ActiveHousehold.LotHome)
         {
             this.mGrave.FadeOut(false, 5f, new AlarmTimerCallback(this.HandleNPCGrave));
         }
         this.Target.Destroy();
     }
 }
Ejemplo n.º 30
0
 public static IEnumerable<CASAgeGenderFlags> GetAges(CASAgeGenderFlags species)
 {
     if (species == CASAgeGenderFlags.Human)
     {
         return sAges;
     }
     else
     {
         return sPetAges;
     }
 }
Ejemplo n.º 31
0
        public bool AllowNearRelationWoohooAutonomousV2(CASAgeGenderFlags species)
        {
            int speciesIndex = GetSpeciesIndex(species);

            if (!mAllowNearRelationRomanceAutonomousV2[speciesIndex])
            {
                return(false);
            }

            return(mAllowNearRelationWoohooAutonomousV2[speciesIndex]);
        }
Ejemplo n.º 32
0
        public static bool HasDNASample(Sim robot, CASAgeGenderFlags gender)
        {
            if (robot.Inventory == null)
            {
                return(false);
            }

            List <ScientificSample> samples = GetDNASamples(robot, gender);

            return(samples != null && samples.Count > 0);
        }
Ejemplo n.º 33
0
        public static SimDescription GenerateOffspring(List <SimDescription> potentialParents, out bool noParents)
        {
            SimDescription choiceMom;
            SimDescription choiceDad;

            SimUtils.SimCreationSpec.ChooseParents(potentialParents, out choiceDad, out choiceMom);

            noParents = ((choiceMom == null) || (choiceDad == null) || (choiceMom == choiceDad));

            if (noParents)
            {
                return(null);
            }

            CASAgeGenderFlags age = CASAgeGenderFlags.Teen | CASAgeGenderFlags.Child;

            if ((choiceMom.AdultOrAbove) && (choiceDad.AdultOrAbove))
            {
                age |= CASAgeGenderFlags.YoungAdult;
            }

            float weight, fitness;

            WeightAndFitness(choiceMom, choiceDad, out weight, out fitness);

            SimUtils.SimCreationSpec spec3 = new SimUtils.SimCreationSpec();
            spec3.Age = age;

            spec3.Weight  = weight;
            spec3.Fitness = fitness;

            spec3.Normalize();

            SimDescription child = spec3.Instantiate(choiceDad, choiceMom, true);

            if (child != null)
            {
                child.TraitManager.AddHiddenElement(TraitNames.DescendantHiddenTrait);
                if ((choiceMom != null) && (choiceDad != null))
                {
                    SimUtils.HouseholdCreationSpec.InitializeRomance(choiceMom, choiceDad, child, choiceMom.LastName);
                }
                else if (choiceMom != null)
                {
                    child.LastName = choiceMom.LastName;
                }
                else if (choiceDad != null)
                {
                    child.LastName = choiceDad.LastName;
                }
            }

            return(child);
        }
Ejemplo n.º 34
0
        public TBaseType GetValue(CASAgeGenderFlags species)
        {
            TOption option = GetSubOption(species);

            if (option == null)
            {
                return(default(TBaseType));
            }

            return(option.Value);
        }
Ejemplo n.º 35
0
 protected FamiliarScenario(FamiliarScenario scenario)
     : base(scenario)
 {
     mName          = scenario.mName;
     mCheckAny      = scenario.mCheckAny;
     mCheckExisting = scenario.mCheckExisting;
     mSpecies       = scenario.mSpecies;
     mDelta         = scenario.mDelta;
     mAges          = scenario.mAges;
     mSuccess       = scenario.mSuccess;
 }
Ejemplo n.º 36
0
        public ServiceSettingKey(Sims3.Gameplay.Services.Service service, CASAgeGenderFlags flags, int poolSetting, int serviceCost, bool reoccur, bool bots)
        {
            type        = service.ServiceType;
            validAges  |= flags;
            poolSetting = numInPool;
            cost        = serviceCost;
            reoccuring  = reoccur;
            useBots     = bots;

            tuningDefault = new ServiceSettingKey(service);
        }
Ejemplo n.º 37
0
        protected override bool Allow(CASAgeGenderFlags option)
        {
            switch (option)
            {
                case CASAgeGenderFlags.Female:
                case CASAgeGenderFlags.Male:
                    return true;
            }

            return false;
        }
Ejemplo n.º 38
0
 // Externalized to Dresser
 public static bool Allow(CASPart part, CASAgeGenderFlags age, CASAgeGenderFlags gender, CASAgeGenderFlags species, bool maternity, OutfitCategories category)
 {
     try
     {
         return (InvalidPartBooter.Allow(new CASParts.Wrapper(part), age, gender, species, maternity, category) == InvalidPartBase.Reason.None);
     }
     catch (Exception e)
     {
         Common.Exception("Allow", e);
         return true;
     }
 }
Ejemplo n.º 39
0
        public ClothingInfo()
        {
            Price = 250;
            Name = "Pedestal#";
            SelectedPose = 1;
            IsVisible = true;
            PoseRotation = false;
            //AllowAutonomous = false;
            Gender = CASAgeGenderFlags.Female;
            Age = CASAgeGenderFlags.YoungAdult;
            OutfitCategory = OutfitCategories.Everyday;

        }
Ejemplo n.º 40
0
        protected override bool Allow(CASAgeGenderFlags option)
        {
            switch (option)
            {
                case CASAgeGenderFlags.Human:
                case CASAgeGenderFlags.Horse:
                case CASAgeGenderFlags.Cat:
                case CASAgeGenderFlags.Dog:
                case CASAgeGenderFlags.LittleDog:
                    return true;
            }

            return false;
        }
Ejemplo n.º 41
0
        public bool AllowNearRelationWoohooAutonomousV2(CASAgeGenderFlags species)
        {
            int speciesIndex = GetSpeciesIndex(species);

            if (!mAllowNearRelationRomanceAutonomousV2[speciesIndex]) return false;

            return mAllowNearRelationWoohooAutonomousV2[speciesIndex];
        }
Ejemplo n.º 42
0
        public static string ConvertToString(CASAgeGenderFlags flags)
        {
            string results = null;

            foreach (CASAgeGenderFlags flag in Enum.GetValues(typeof(CASAgeGenderFlags)))
            {
                switch (flag)
                {
                    case CASAgeGenderFlags.None:
                    case CASAgeGenderFlags.AgeMask:
                    case CASAgeGenderFlags.GenderMask:
                        continue;
                }

                if ((flags & flag) == flag)
                {
                    results += ", " + flag.ToString();
                }
            }

            return results;
        }
Ejemplo n.º 43
0
        protected static CASParts.PartPreset GetRandomPreset(BodyTypes location, OutfitCategories category, CASAgeGenderFlags age, CASAgeGenderFlags gender, CASAgeGenderFlags species, bool maternity, StringBuilder log)
        {
            try
            {
                log.Append(Common.NewLine + "  Location: " + location);
                log.Append(Common.NewLine + "  Category: " + category);
                log.Append(Common.NewLine + "  Age: " + age);
                log.Append(Common.NewLine + "  Gender: " + gender);
                log.Append(Common.NewLine + "  Species: " + species);
                log.Append(Common.NewLine + "  Maternity: " + maternity);

                Dictionary<ResourceKey, CASParts.Wrapper> parts;
                if (AllParts.TryGetValue(location, out parts))
                {
                    log.Append(Common.NewLine + "  Parts Found: " + parts.Count);

                    List<CASParts.Wrapper> choices = new List<CASParts.Wrapper>();

                    Dictionary<string,int> reasons = new Dictionary<string,int>();

                    foreach (CASParts.Wrapper test in parts.Values)
                    {
                        ProcessOptions type = GetType(test.mPart.BodyType);

                        if ((type != ProcessOptions.BodyHair) || (!Dresser.Settings.mIgnoreBodyHairGender))
                        {
                            if ((test.Gender & gender) != gender)
                            {
                                Add(reasons, "Gender Fail");
                                continue;
                            }
                        }

                        if ((test.Age & age) != age)
                        {
                            Add(reasons, "Age Fail");
                            continue;
                        }

                        if (test.Species != species)
                        {
                            Add(reasons, "Species Fail");
                            continue;
                        }

                        if ((test.Category & category) != category)
                        {
                            Add(reasons, "Category Fail");
                            continue;
                        }

                        string reason = null;
                        if (!Allow(test, age, gender, species, maternity, category, out reason))
                        {
                            Add(reasons, reason);
                            continue;
                        }

                        if ((test.ExtendedCategory & OutfitCategoriesExtended.IsHiddenInCAS) != 0x0)
                        {
                            Add(reasons, "HiddenInCAS Fail");
                            continue;
                        }

                        bool testIgnore = false;
                        switch(type)
                        {
                            case ProcessOptions.Beard:
                            case ProcessOptions.BodyHair:
                                testIgnore = !Dresser.Settings.mIgnoreValidForRandomBodyHair;
                                break;
                            case ProcessOptions.Hair:
                                testIgnore = !Dresser.Settings.mIgnoreValidForRandomHair;
                                break;
                            case ProcessOptions.Accessories:
                                testIgnore = !Dresser.Settings.mIgnoreValidForRandomAccessories;
                                break;
                            case ProcessOptions.Makeup:
                                testIgnore = !Dresser.Settings.mSameMakeupForAllCategories;
                                break;
                            default:
                                testIgnore = !Dresser.Settings.mIgnoreValidForRandomClothing;
                                break;
                        }

                        if ((testIgnore) && (test.ExtendedCategory & OutfitCategoriesExtended.ValidForRandom) == 0)
                        {
                            Add(reasons, "ValidForRandom Fail");
                            continue;
                        }

                        if (maternity)
                        {
                            if ((test.ExtendedCategory & OutfitCategoriesExtended.ValidForMaternity) == 0)
                            {
                                Add(reasons, "ValidForMaternity Fail");
                                continue;
                            }
                        }

                        choices.Add(test);
                    }

                    foreach (KeyValuePair<string, int> reason in reasons)
                    {
                        log.Append(Common.NewLine + "   " + reason.Key + ": " + reason.Value);
                    }

                    log.Append(Common.NewLine + "  Final Count: " + choices.Count + Common.NewLine);

                    if (choices.Count > 0)
                    {
                        int tries = 0;
                        while (tries < 10)
                        {
                            tries++;

                            CASParts.PartPreset preset = RandomUtil.GetRandomObjectFromList(choices).GetRandomPreset();
                            if (preset != null)
                            {
                                return preset;
                            }
                        }
                    }
                }
                else
                {
                    log.Append(Common.NewLine + "  No Parts Found" + Common.NewLine);
                }
            }
            catch (Exception e)
            {
                Common.Exception(location.ToString(), e);
            }

            return null;
        }
Ejemplo n.º 44
0
        protected static bool Allow(CASParts.Wrapper part, CASAgeGenderFlags age, CASAgeGenderFlags gender, CASAgeGenderFlags species, bool maternity, OutfitCategories category, out string reason)
        {
            if (!IsValidProductVersion(part))
            {
                reason = "ProductVersion Fail";
                return false;
            }

            if (Dresser.Settings.mUseMasterControllerBlackList)
            {
                if (sMasterControllerAllow.Valid)
                {
                    if (!sMasterControllerAllow.Invoke<bool>(new object[] { part.mPart, age, gender, species, maternity, category }))
                    {
                        reason = "MasterController Blacklist Fail";
                        return false;
                    }
                }
                else
                {
                    Common.Notify("sMasterControllerAllow.Valid = False");
                }
            }

            InvalidPartBase.Reason result = InvalidPartBooter.Allow(part, age, gender, species, maternity, category);
            if (result != InvalidPartBase.Reason.None)
            {
                reason = "Dresser Blacklist Fail: " + result;
                return false;
            }

            if ((part.ExtendedCategory & OutfitCategoriesExtended.IsHat) == OutfitCategoriesExtended.IsHat)
            {
                if ((!Dresser.Settings.mAllowHats) || (Dresser.Settings.mInvalidHatCategories.Contains(category)))
                {
                    reason = "Hat Category Fail";
                    return false;
                }
            }

            reason = null;
            return true;
        }
 public override ISpeciesItem Clone(CASAgeGenderFlags species)
 {
     return new TryForBabyTeenBabyMadeChanceSetting();
 }
Ejemplo n.º 46
0
 public ForcePetMateSetting(CASAgeGenderFlags species)
     : base(species)
 { }
Ejemplo n.º 47
0
 public void RequestCreateNewPet(CASAgeGenderFlags ageGenderSpecies)
 {
     mCASModel.RequestCreateNewPet(ageGenderSpecies);
 }
Ejemplo n.º 48
0
        public static string FetchMotiveLocalization(CASAgeGenderFlags flag, CommodityKind motive)
        {
            string str = "";
            switch (motive)
            {
                case CommodityKind.Hygiene:
                    if (flag == CASAgeGenderFlags.Cat) str = "Scratch";
                    if (flag == CASAgeGenderFlags.Dog) str = "Destruction";
                    if (flag == CASAgeGenderFlags.Horse) str = "Exercise";
                break;
                case CommodityKind.Fun:
                    if (flag == CASAgeGenderFlags.Horse) str = "Thirst";
                break;
                case CommodityKind.Temperature:
                    return Common.Localize("TagData:Temperature");                
                default:
                break;
            }

            return Common.LocalizeEAString("Ui/Caption/HUD/MotivesPanel:Motive" + str + (flag == CASAgeGenderFlags.Human ? motive.ToString() : flag.ToString()));
        }
Ejemplo n.º 49
0
 public RiskyAutonomousSetting(CASAgeGenderFlags species)
     : base (species)
 { }
Ejemplo n.º 50
0
 public MotiveKey(CASAgeGenderFlags ageSpecies, OccultTypes occult, CommodityKind kind)
 {
     mAgeSpecies = ageSpecies;
     mOccult = occult;
     mKind = kind;
 }
Ejemplo n.º 51
0
 public TryForBabyAutonomousSetting(CASAgeGenderFlags species)
     : base(species)
 { }
Ejemplo n.º 52
0
 public void RequestSpeciesAndBreed(CASAgeGenderFlags newSpecies, SimOutfit newOutfit)
 {
     mCASModel.RequestSpeciesAndBreed(newSpecies, newOutfit);
 }
Ejemplo n.º 53
0
        public bool Satisfies(CASAgeGenderFlags age, CASAgeGenderFlags gender, CASAgeGenderFlags species)
        {
            if (!Value)
            {
                if (((age & mAge) == age) && ((gender & mGender) == gender) && ((mSpecies.Contains(species))))
                {
                    return false;
                }
            }

            return true;
        }
Ejemplo n.º 54
0
 public void OnSimAgeGenderChangedProxy(CASAgeGenderFlags age, CASAgeGenderFlags gender)
 {
     try
     {
         if (OnSimAgeGenderChanged != null)
         {
             OnSimAgeGenderChanged(age, gender);
         }
     }
     catch (Exception e)
     {
         Common.Exception("OnSimAgeGenderChangedProxy", e);
     }
 }
Ejemplo n.º 55
0
 public void SetAllowNearRelationWoohooAutonomousV2(CASAgeGenderFlags species, bool value)
 {
     mAllowNearRelationWoohooAutonomousV2[GetSpeciesIndex(species)] = value;
 }
Ejemplo n.º 56
0
 public static int GetSpeciesIndex(CASAgeGenderFlags species)
 {
     switch (species)
     {
         case CASAgeGenderFlags.Human:
             return 0;
         case CASAgeGenderFlags.Horse:
             return 1;
         case CASAgeGenderFlags.Dog:
         case CASAgeGenderFlags.LittleDog:
             return 2;
         case CASAgeGenderFlags.Cat:
             return 3;
         default:
             return 0;
     }           
 }
Ejemplo n.º 57
0
 public override ISpeciesItem Clone(CASAgeGenderFlags species)
 {
     return new RiskyAutonomousSetting(species);
 }
Ejemplo n.º 58
0
        public bool AllowNearRelation(CASAgeGenderFlags species, bool woohoo, bool autonomous)
        {
            if (woohoo)
            {
                if (!mAllowNearRelationWoohooV2[GetSpeciesIndex(species)]) return false;

                if (autonomous)
                {
                    if (!mAllowNearRelationWoohooAutonomousV2[GetSpeciesIndex(species)]) return false;
                }
            }

            if (!mAllowNearRelationRomanceV2[GetSpeciesIndex(species)]) return false;

            if (autonomous)
            {
                if (!mAllowNearRelationRomanceAutonomousV2[GetSpeciesIndex(species)]) return false;
            }

            return true;
        }
Ejemplo n.º 59
0
 public override ISpeciesItem Clone(CASAgeGenderFlags species)
 {
     return new ForcePetMateSetting(species);
 }
Ejemplo n.º 60
0
 public List<CASController.BreedOutfit> GetPetBreeds(CASAgeGenderFlags species)
 {
     return mCASModel.GetPetBreeds(species);
 }