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)); }
public static Sim DGSMakeRandomSim(Vector3 point, CASAgeGenderFlags age, CASAgeGenderFlags gender, WorldName worldname) { LotLocation lotLocation = default(LotLocation); ulong lotLocation2 = World.GetLotLocation(point, ref lotLocation); Lot lot = LotManager.GetLot(lotLocation2); if ((age & (CASAgeGenderFlags.Baby | CASAgeGenderFlags.Toddler | CASAgeGenderFlags.Child)) != CASAgeGenderFlags.None) { bool flag = false; if (lot != null && lot.Household != null) { foreach (SimDescription simDescription in lot.Household.SimDescriptions) { if (simDescription.TeenOrAbove) { flag = true; break; } } } if (!flag) { return(null); } } SimDescription simDescription2 = DGSMakeSSimDescription(age, gender, worldname, uint.MaxValue); Genetics.AssignRandomTraits(simDescription2); if (lot != null) { if (lot.Household == null) { Household household = Household.Create(); household.Name = simDescription2.mLastName ?? ""; 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)); }
protected SimDescription GetRandomSim(CASAgeGenderFlags gender, CASAgeGenderFlags species) { SimDescription result = null; if (species == CASAgeGenderFlags.Human) { SimUtils.SimCreationSpec sim = new SimUtils.SimCreationSpec(); Vector2 fatRange = Manager.GetValue <FatRangeOption <TManager>, Vector2>(); Vector2 fitRange = Manager.GetValue <FitRangeOption <TManager>, Vector2>(); WorldName worldName = GetGeneticWorld(); sim.Gender = gender; sim.Age = CASAgeGenderFlags.Adult; sim.Species = species; sim.Weight = RandomUtil.GetFloat(fatRange.x, fatRange.y); sim.Fitness = RandomUtil.GetFloat(fitRange.x, fitRange.y); sim.Description = ""; sim.GivenName = SimUtils.GetRandomFamilyName(worldName); result = sim.Instantiate(worldName, uint.MaxValue); result.VoiceVariation = (VoiceVariationType)RandomUtil.GetInt(0, 2); result.VoicePitchModifier = RandomUtil.GetFloat(0, 1f); Vector2 skintToneRange = Manager.GetValue <SkinToneRangeOption <TManager>, Vector2>(); result.SkinToneIndex = RandomUtil.GetFloat(skintToneRange.x, skintToneRange.y); } else { result = GeneticsPet.MakeRandomPet(CASAgeGenderFlags.Adult, gender, species, 1f); } SetBustMuscleSliders(result); FacialBlends.RandomizeBlends(mStats.AddStat, result, Manager.GetValue <MutationSetRangeOption <TManager>, Vector2>(), true, Manager.GetValue <MutationSetRangeOption <TManager>, Vector2>(), false, Manager.GetValue <AllowAlienHouseholdOption <TManager>, bool>()); mDispose.Add(result); mStats.IncStat("Immigrant: Random Sim"); return(result); }