public static void AddAllCustom()
 {
     foreach (PawnBio curPawnBio in from def in DefDatabase <PawnBioDef> .AllDefsListForReading
              select def.ToPawnBio())
     {
         curPawnBio.name.ResolveMissingPieces();
         if (curPawnBio.childhood == null || curPawnBio.adulthood == null)
         {
             PawnNameDatabaseSolid.AddPlayerContentName(curPawnBio.name, curPawnBio.gender);
         }
         else
         {
             SolidBioDatabase.allBios.Add(curPawnBio);
             curPawnBio.childhood.shuffleable = false;
             curPawnBio.childhood.slot        = BackstorySlot.Childhood;
             BackstoryDatabase.AddBackstory(curPawnBio.childhood);
             curPawnBio.adulthood.shuffleable = false;
             curPawnBio.adulthood.slot        = BackstorySlot.Adulthood;
             BackstoryDatabase.AddBackstory(curPawnBio.adulthood);
         }
     }
     foreach (Backstory curBackstory in from def in DefDatabase <BackstoryDef> .AllDefsListForReading
              where def.shuffleable
              select def.ToBackstory())
     {
         if (!BackstoryDatabase.allBackstories.ContainsKey(curBackstory.identifier))
         {
             BackstoryDatabase.AddBackstory(curBackstory);
         }
     }
 }
Exemple #2
0
 public static void CombineAndAddToDatabase()
 {
     foreach (CombineNameDef curDef in DefDatabase <CombineNameDef> .AllDefs)
     {
         foreach (NameTriple curName in curDef.ToNameTriples())
         {
             PawnNameDatabaseSolid.AddPlayerContentName(curName, curDef.gender);
         }
     }
 }
Exemple #3
0
        public static void Debug()
        {
            NameBank nameBank = PawnNameDatabaseShuffled.BankOf(PawnNameCategory.HumanStandard);

            Log.Message($"PawnNameDatabaseShuffled {PawnNameSlot.First} {Gender.Male} {nameBank.NamesFor(PawnNameSlot.First, Gender.Male).Count}");
            Log.Message($"PawnNameDatabaseShuffled {PawnNameSlot.First} {Gender.Female} {nameBank.NamesFor(PawnNameSlot.First, Gender.Female).Count}");
            Log.Message($"PawnNameDatabaseShuffled {PawnNameSlot.Nick} {Gender.Male} {nameBank.NamesFor(PawnNameSlot.Nick, Gender.Male).Count}");
            Log.Message($"PawnNameDatabaseShuffled {PawnNameSlot.Nick} {Gender.Female} {nameBank.NamesFor(PawnNameSlot.Nick, Gender.Female).Count}");
            Log.Message($"PawnNameDatabaseShuffled {PawnNameSlot.Nick} {Gender.None} {nameBank.NamesFor(PawnNameSlot.Nick, Gender.None).Count}");
            Log.Message($"PawnNameDatabaseShuffled {PawnNameSlot.Last} {Gender.None} {nameBank.NamesFor(PawnNameSlot.Last, Gender.None).Count}");
            Log.Message($"PawnNameDatabaseSolid {PawnNameDatabaseSolid.AllNames().Count()}");
        }
Exemple #4
0
 public static bool Prefix()
 {
     if (REB_Initializer.REB_Backstories.Count < 1)
     {
         return(true);
     }
     foreach (PawnBio pawnBio in DirectXmlLoader.LoadXmlDataInResourcesFolder <PawnBio>("Backstories/Solid"))
     {
         pawnBio.name.ResolveMissingPieces(null);
         PawnNameDatabaseSolid.AddPlayerContentName(pawnBio.name, pawnBio.gender);
     }
     return(false);
 }
Exemple #5
0
        public override void PostLoad()
        {
            base.PostLoad();

            if (first.NullOrEmpty())
            {
                CCL_Log.Error("Custom name with defName: " + defName + " has no defined first name. It will not be added.", "Backstories");
                return;
            }
            if (last.NullOrEmpty())
            {
                CCL_Log.Error("Custom name with defName: " + defName + " has no defined last name. It will not be added.", "Backstories");
                return;
            }

            PawnNameDatabaseSolid.AddPlayerContentName(Name, genderPossibility);
        }
Exemple #6
0
 public static bool Prefix()
 {
     PawnBioAndBacktoryUtility.duplicateCount      = new Dictionary <string, int>();
     PawnBioAndBacktoryUtility.pendingResolveNames = new Dictionary <string, NameTriple>();
     foreach (PawnBio curPawnBio in DirectXmlLoader.LoadXmlDataInResourcesFolder <PawnBio>("Backstories/Solid"))
     {
         string curDefName = curPawnBio.name.ToDefName(curPawnBio.gender);
         if (PawnBioAndBacktoryUtility.duplicateCount.ContainsKey(curDefName))
         {
             PawnBioAndBacktoryUtility.duplicateCount[curDefName]++;
             curDefName += "_" + PawnBioAndBacktoryUtility.duplicateCount[curDefName];
         }
         else
         {
             PawnBioAndBacktoryUtility.duplicateCount.Add(curDefName, 0);
         }
         PawnBioAndBacktoryUtility.pendingResolveNames.Add(curDefName, curPawnBio.name);
         if (curPawnBio.childhood == null || curPawnBio.adulthood == null)
         {
             PawnNameDatabaseSolid.AddPlayerContentName(curPawnBio.name, curPawnBio.gender);
         }
         else
         {
             curPawnBio.PostLoad();
             curPawnBio.ResolveReferences();
             foreach (string curError in curPawnBio.ConfigErrors())
             {
                 Log.Error(curError);
             }
             SolidBioDatabase.allBios.Add(curPawnBio);
             curPawnBio.childhood.shuffleable = false;
             curPawnBio.childhood.slot        = BackstorySlot.Childhood;
             BackstoryDatabase.AddBackstory(curPawnBio.childhood);
             curPawnBio.adulthood.shuffleable = false;
             curPawnBio.adulthood.slot        = BackstorySlot.Adulthood;
             BackstoryDatabase.AddBackstory(curPawnBio.adulthood);
         }
     }
     return(false);
 }
Exemple #7
0
        public static NameTriple TryGetRandomUnusedSolidName(Gender gender, string requiredLastName = null)
        {
            NameTriple nameTriple = null;

            if (Rand.Value < 0.5f)
            {
                nameTriple = Prefs.RandomPreferredName();
                if (nameTriple != null && (nameTriple.UsedThisGame || (requiredLastName != null && nameTriple.Last != requiredLastName)))
                {
                    nameTriple = null;
                }
            }
            List <NameTriple> listForGender = PawnNameDatabaseSolid.GetListForGender(GenderPossibility.Either);
            List <NameTriple> list          = (gender != Gender.Male) ? PawnNameDatabaseSolid.GetListForGender(GenderPossibility.Female) : PawnNameDatabaseSolid.GetListForGender(GenderPossibility.Male);
            float             num           = ((float)listForGender.Count + 0.1f) / ((float)(listForGender.Count + list.Count) + 0.1f);
            List <NameTriple> list2;

            if (Rand.Value < num)
            {
                list2 = listForGender;
            }
            else
            {
                list2 = list;
            }
            if (list2.Count == 0)
            {
                Log.Error("Empty solid pawn name list for gender: " + gender + ".");
                return(null);
            }
            if (nameTriple != null && list2.Contains(nameTriple))
            {
                return(nameTriple);
            }
            list2.Shuffle <NameTriple>();
            return((from name in list2
                    where (requiredLastName == null || !(name.Last != requiredLastName)) && !name.UsedThisGame
                    select name).FirstOrDefault <NameTriple>());
        }
Exemple #8
0
        static bool Prefix(Gender gender, ref NameTriple __result, string requiredLastName = null)
        {
            if (REB_Initializer.REB_Backstories.Count < 1)
            {
                return(true);
            }
            NameTriple nameTriple = null;

            if (Rand.Value < 0.5f)
            {
                nameTriple = Prefs.RandomPreferredName();
                if (nameTriple != null && (nameTriple.UsedThisGame || (requiredLastName != null && nameTriple.Last != requiredLastName)))
                {
                    nameTriple = null;
                }
            }
            List <NameTriple> listForGender;
            List <NameTriple> list;

            listForGender = PawnNameDatabaseSolid.GetListForGender(GenderPossibility.Either);
            list          = (gender != Gender.Male) ? PawnNameDatabaseSolid.GetListForGender(GenderPossibility.Female) : PawnNameDatabaseSolid.GetListForGender(GenderPossibility.Male);
            float             num = ((float)listForGender.Count + 0.1f) / ((float)(listForGender.Count + list.Count) + 0.1f);
            List <NameTriple> list2;

            if (listForGender.Count == 0)
            {
                list2 = list;
            }
            else
            {
                if (Rand.Value < num)
                {
                    list2 = listForGender;
                }
                else
                {
                    list2 = list;
                }
            }
            if (list2.Count == 0)
            {
                Log.Error("Empty solid pawn name list for gender: " + gender + ".");
                __result = null;
                return(false);
            }
            if (nameTriple != null && list2.Contains(nameTriple))
            {
                __result = nameTriple;
                return(false);
            }
            for (int i = 0; i < list2.Count; i++)
            {
                NameTriple nameTriple2 = list2[i];
                if (requiredLastName == null || !(nameTriple2.Last != requiredLastName))
                {
                    if (!nameTriple2.UsedThisGame)
                    {
                        REB_PawnBioAndNameGenerator.tempNames.Add(nameTriple2);
                    }
                }
            }
            NameTriple result;

            REB_PawnBioAndNameGenerator.tempNames.TryRandomElement(out result);
            REB_PawnBioAndNameGenerator.tempNames.Clear();
            __result = result;
            return(false);
        }
Exemple #9
0
        public override void ResolveReferences()
        {
            base.ResolveReferences();
            PawnBio bio = new PawnBio();

            bio.name   = name;
            bio.gender = gender;
            if (bio.gender != GenderPossibility.Male && bio.gender != GenderPossibility.Female)
            {
                bio.gender = GenderPossibility.Either;
            }
            bio.PostLoad();
            if (bio.name.First.NullOrEmpty() || bio.name.Last.NullOrEmpty())
            {
                if (!childhoodStory.NullOrEmpty() || !adulthoodStory.NullOrEmpty())
                {
                    Log.Error("Backstory Error (" + bio.name + "): A locked backstory can only be attached to a full name.");
                }
                if (bio.name.First.NullOrEmpty() && bio.name.Last.NullOrEmpty())
                {
                    if (!bio.name.Nick.NullOrEmpty())
                    {
                        if (bio.gender == GenderPossibility.Male)
                        {
                            REB_Initializer.NamesNicksMale.Add(bio.name.Nick);
                            REB_Initializer.nickCount++;
                        }
                        else if (bio.gender == GenderPossibility.Female)
                        {
                            REB_Initializer.NamesNicksFemale.Add(bio.name.Nick);
                            REB_Initializer.nickCount++;
                        }
                        else
                        {
                            REB_Initializer.NamesNicksUnisex.Add(bio.name.Nick);
                            REB_Initializer.nickCount++;
                        }
                    }
                }
                else if (bio.name.First.NullOrEmpty())
                {
                    if (!bio.name.Last.NullOrEmpty())
                    {
                        REB_Initializer.NamesLast.Add(bio.name.Last);
                        REB_Initializer.lastCount++;
                    }
                }
                else if (bio.name.Last.NullOrEmpty())
                {
                    if (!bio.name.First.NullOrEmpty())
                    {
                        if (bio.gender == GenderPossibility.Male)
                        {
                            REB_Initializer.NamesFirstMale.Add(bio.name.First);
                            REB_Initializer.firstCount++;
                        }
                        else if (bio.gender == GenderPossibility.Female)
                        {
                            REB_Initializer.NamesFirstFemale.Add(bio.name.First);
                            REB_Initializer.firstCount++;
                        }
                        else
                        {
                            REB_Initializer.NamesFirstMale.Add(bio.name.First);
                            REB_Initializer.NamesFirstFemale.Add(bio.name.First);
                            REB_Initializer.firstCount++;
                        }
                    }
                }
            }
            else
            {
                bio.name.ResolveMissingPieces(null);
                if ((!childhoodStory.NullOrEmpty() && adulthoodStory.NullOrEmpty()) ||
                    (childhoodStory.NullOrEmpty() && !adulthoodStory.NullOrEmpty()))
                {
                    Log.Error("Backstory Error (" + bio.name + "): A locked backstory must include both a childhood story and an adulthood story.");
                }
                if (Controller.Settings.useLiteMode.Equals(true))
                {
                    if (!childhoodStory.NullOrEmpty() && !BackstoryDatabase.allBackstories.ContainsKey("REB_" + childhoodStory))
                    {
                        Log.Error("Backstory Error (" + bio.name + "): Childhood backstory '" + childhoodStory + "' does not exist.");
                        childhoodStory = "";
                    }
                    if (!adulthoodStory.NullOrEmpty() && !BackstoryDatabase.allBackstories.ContainsKey("REB_" + adulthoodStory))
                    {
                        Log.Error("Backstory Error (" + bio.name + "): Adulthood backstory '" + adulthoodStory + "' does not exist.");
                        adulthoodStory = "";
                    }
                    if (!childhoodStory.NullOrEmpty() && !adulthoodStory.NullOrEmpty())
                    {
                        bio.childhood = BackstoryDatabase.allBackstories["REB_" + childhoodStory];
                        bio.adulthood = BackstoryDatabase.allBackstories["REB_" + adulthoodStory];
                        SolidBioDatabase.allBios.Add(bio);
                        REB_Initializer.fullBioCount++;
                    }
                    else
                    {
                        PawnNameDatabaseSolid.AddPlayerContentName(bio.name, bio.gender);
                        REB_Initializer.fullCount++;
                    }
                }
                else
                {
                    if (!childhoodStory.NullOrEmpty() && !REB_Initializer.REB_Backstories.ContainsKey("REB_" + childhoodStory))
                    {
                        Log.Error("Backstory Error (" + bio.name + "): Childhood backstory '" + childhoodStory + "' does not exist.");
                        childhoodStory = "";
                    }
                    if (!adulthoodStory.NullOrEmpty() && !REB_Initializer.REB_Backstories.ContainsKey("REB_" + adulthoodStory))
                    {
                        Log.Error("Backstory Error (" + bio.name + "): Adulthood backstory '" + adulthoodStory + "' does not exist.");
                        adulthoodStory = "";
                    }
                    if (!childhoodStory.NullOrEmpty() && !adulthoodStory.NullOrEmpty())
                    {
                        bio.childhood = REB_Initializer.REB_Backstories["REB_" + childhoodStory];
                        bio.adulthood = REB_Initializer.REB_Backstories["REB_" + adulthoodStory];
                        SolidBioDatabase.allBios.Add(bio);
                        REB_Initializer.fullBioCount++;
                    }
                    else
                    {
                        PawnNameDatabaseSolid.AddPlayerContentName(bio.name, bio.gender);
                        REB_Initializer.fullCount++;
                    }
                }
            }
        }
Exemple #10
0
        public static Zombie GeneratePawn()
        {
            var zombie = (Zombie)ThingMaker.MakeThing(ZombieDefOf.Zombie.race, null);

            zombie.gender  = Rand.Bool ? Gender.Male : Gender.Female;
            zombie.kindDef = ZombieDefOf.Zombie;
            zombie.SetFactionDirect(FactionUtility.DefaultFactionFrom(ZombieDefOf.Zombies));

            PawnComponentsUtility.CreateInitialComponents(zombie);
            zombie.health.hediffSet.Clear();

            zombie.ageTracker.AgeBiologicalTicks    = ((long)(Rand.Range(0, 0x9c4 + 1) * 3600000f)) + Rand.Range(0, 0x36ee80);
            zombie.ageTracker.AgeChronologicalTicks = zombie.ageTracker.AgeBiologicalTicks;
            zombie.ageTracker.BirthAbsTicks         = GenTicks.TicksAbs - zombie.ageTracker.AgeBiologicalTicks;
            var idx = zombie.ageTracker.CurLifeStageIndex;             // trigger calculations

            zombie.needs.SetInitialLevels();
            zombie.needs.mood = new Need_Mood(zombie);

            var name = PawnNameDatabaseSolid.GetListForGender((zombie.gender == Gender.Female) ? GenderPossibility.Female : GenderPossibility.Male).RandomElement();
            var n1   = name.First.Replace('s', 'z').Replace('S', 'Z');
            var n2   = name.Last.Replace('s', 'z').Replace('S', 'Z');
            var n3   = name.Nick.Replace('s', 'z').Replace('S', 'Z');

            zombie.Name = new NameTriple(n1, n3, n2);

            // faster: use MinimalBackstory()
            zombie.story.childhood = BackstoryDatabase.allBackstories
                                     .Where(kvp => kvp.Value.slot == BackstorySlot.Childhood)
                                     .RandomElement().Value;
            if (zombie.ageTracker.AgeBiologicalYearsFloat >= 20f)
            {
                zombie.story.adulthood = BackstoryDatabase.allBackstories
                                         .Where(kvp => kvp.Value.slot == BackstorySlot.Adulthood)
                                         .RandomElement().Value;
            }

            zombie.story.melanin   = 0.01f * Rand.Range(10, 91);
            zombie.story.crownType = Rand.Bool ? CrownType.Average : CrownType.Narrow;

            zombie.story.hairColor = HairColor();
            zombie.story.hairDef   = PawnHairChooser.RandomHairDefFor(zombie, ZombieDefOf.Zombies);
            zombie.story.bodyType  = (zombie.gender == Gender.Female) ? BodyType.Female : BodyType.Male;
            if (zombie.story.bodyType == BodyType.Male)
            {
                switch (Rand.Range(1, 6))
                {
                case 1:
                    zombie.story.bodyType = BodyType.Thin;
                    break;

                case 2:
                    zombie.story.bodyType = BodyType.Fat;
                    break;

                case 3:
                    zombie.story.bodyType = BodyType.Hulk;
                    break;
                }
            }

            if (ZombieSettings.Values.useCustomTextures)
            {
                AssignNewCustomGraphics(zombie);
            }

            zombie.Drawer.leaner = new ZombieLeaner(zombie);
            Traverse.Create(zombie.pather).Field("destination").SetValue(IntVec3.Invalid);

            return(zombie);
        }
Exemple #11
0
        public static Zombie GeneratePawn(ZombieType overwriteType)
        {
            var thing  = ThingMaker.MakeThing(ZombieDefOf.Zombie.race, null);
            var zombie = thing as Zombie;

            if (zombie == null)
            {
                Log.Error("ThingMaker.MakeThing(ZombieDefOf.Zombie.race, null) unexpectedly returned " + thing);
                return(null);
            }

            var bodyType = PrepareZombieType(zombie, overwriteType);

            zombie.kindDef = ZombieDefOf.Zombie;
            zombie.SetFactionDirect(FactionUtility.DefaultFactionFrom(ZombieDefOf.Zombies));

            PawnComponentsUtility.CreateInitialComponents(zombie);
            zombie.health.hediffSet.Clear();

            var ageInYears = (long)Rand.Range(14, 130);

            zombie.ageTracker.AgeBiologicalTicks    = (ageInYears * 3600000);
            zombie.ageTracker.AgeChronologicalTicks = zombie.ageTracker.AgeBiologicalTicks;
            zombie.ageTracker.BirthAbsTicks         = GenTicks.TicksAbs - zombie.ageTracker.AgeBiologicalTicks;
            var idx = zombie.ageTracker.CurLifeStageIndex;             // trigger calculations

            zombie.needs.SetInitialLevels();
            zombie.needs.mood = new Need_Mood(zombie);

            var name = PawnNameDatabaseSolid.GetListForGender((zombie.gender == Gender.Female) ? GenderPossibility.Female : GenderPossibility.Male).RandomElement();
            var n1   = name.First.Replace('s', 'z').Replace('S', 'Z');
            var n2   = name.Last.Replace('s', 'z').Replace('S', 'Z');
            var n3   = name.Nick.Replace('s', 'z').Replace('S', 'Z');

            zombie.Name = new NameTriple(n1, n3, n2);

            zombie.story.childhood = BackstoryDatabase.allBackstories
                                     .Where(kvp => kvp.Value.slot == BackstorySlot.Childhood)
                                     .RandomElement().Value;
            if (zombie.ageTracker.AgeBiologicalYearsFloat >= 20f)
            {
                zombie.story.adulthood = BackstoryDatabase.allBackstories
                                         .Where(kvp => kvp.Value.slot == BackstorySlot.Adulthood)
                                         .RandomElement().Value;
            }

            zombie.story.melanin   = 0.01f * Rand.Range(10, 91);
            zombie.story.bodyType  = bodyType;
            zombie.story.crownType = Rand.Bool ? CrownType.Average : CrownType.Narrow;

            zombie.story.hairColor = HairColor();
            zombie.story.hairDef   = PawnHairChooser.RandomHairDefFor(zombie, ZombieDefOf.Zombies);

            if (ZombieSettings.Values.useCustomTextures)
            {
                var it = AssignNewGraphics(zombie);
                while (it.MoveNext())
                {
                    ;
                }
            }

            zombie.Drawer.leaner = new ZombieLeaner(zombie);

            if (zombie.pather == null)
            {
                zombie.pather = new Pawn_PathFollower(zombie);
            }
            GetterSetters.destinationByRef(zombie.pather) = IntVec3.Invalid;

            return(zombie);
        }
Exemple #12
0
        public static IEnumerator SpawnZombieIterativ(IntVec3 cell, Map map, ZombieType zombieType, Action <Zombie> callback)
        {
            ZombiesSpawning++;
            var thing = ThingMaker.MakeThing(ZombieDefOf.Zombie.race, null);

            yield return(null);

            var zombie   = thing as Zombie;
            var bodyType = PrepareZombieType(zombie, zombieType);

            zombie.kindDef = ZombieDefOf.Zombie;
            zombie.SetFactionDirect(FactionUtility.DefaultFactionFrom(ZombieDefOf.Zombies));
            yield return(null);

            PawnComponentsUtility.CreateInitialComponents(zombie);
            yield return(null);

            zombie.health.hediffSet.Clear();
            var ageInYears = (long)Rand.Range(14, 130);

            zombie.ageTracker.AgeBiologicalTicks    = (ageInYears * 3600000);
            zombie.ageTracker.AgeChronologicalTicks = zombie.ageTracker.AgeBiologicalTicks;
            zombie.ageTracker.BirthAbsTicks         = GenTicks.TicksAbs - zombie.ageTracker.AgeBiologicalTicks;
            var idx = zombie.ageTracker.CurLifeStageIndex;             // trigger calculations

            yield return(null);

            zombie.needs.SetInitialLevels();
            yield return(null);

            zombie.needs.mood = new Need_Mood(zombie);
            yield return(null);

            var name = PawnNameDatabaseSolid.GetListForGender((zombie.gender == Gender.Female) ? GenderPossibility.Female : GenderPossibility.Male).RandomElement();

            yield return(null);

            var n1 = name.First.Replace('s', 'z').Replace('S', 'Z');
            var n2 = name.Last.Replace('s', 'z').Replace('S', 'Z');
            var n3 = name.Nick.Replace('s', 'z').Replace('S', 'Z');

            zombie.Name = new NameTriple(n1, n3, n2);
            yield return(null);

            zombie.story.childhood = BackstoryDatabase.allBackstories
                                     .Where(kvp => kvp.Value.slot == BackstorySlot.Childhood)
                                     .RandomElement().Value;
            yield return(null);

            if (zombie.ageTracker.AgeBiologicalYearsFloat >= 20f)
            {
                zombie.story.adulthood = BackstoryDatabase.allBackstories
                                         .Where(kvp => kvp.Value.slot == BackstorySlot.Adulthood)
                                         .RandomElement().Value;
            }
            yield return(null);

            zombie.story.melanin   = 0.01f * Rand.Range(10, 91);
            zombie.story.bodyType  = bodyType;
            zombie.story.crownType = Rand.Bool ? CrownType.Average : CrownType.Narrow;
            zombie.story.hairColor = HairColor();
            zombie.story.hairDef   = PawnHairChooser.RandomHairDefFor(zombie, ZombieDefOf.Zombies);
            yield return(null);

            var it = AssignNewGraphics(zombie);

            while (it.MoveNext())
            {
                yield return(null);
            }
            zombie.Drawer.leaner = new ZombieLeaner(zombie);
            if (zombie.pather == null)
            {
                zombie.pather = new Pawn_PathFollower(zombie);
            }
            GetterSetters.destinationByRef(zombie.pather) = IntVec3.Invalid;
            yield return(null);

            if (zombie.IsTanky == false)
            {
                var it2 = GenerateStartingApparelFor(zombie);
                while (it2.MoveNext())
                {
                    yield return(null);
                }
            }
            if (zombie.IsSuicideBomber)
            {
                zombie.lastBombTick = Find.TickManager.TicksAbs + Rand.Range(0, (int)zombie.bombTickingInterval);
            }
            GenPlace.TryPlaceThing(zombie, cell, map, ThingPlaceMode.Direct);
            yield return(null);

            if (callback != null)
            {
                callback(zombie);
            }
            ZombiesSpawning--;
            switch (Find.TickManager.CurTimeSpeed)
            {
            case TimeSpeed.Paused:
                break;

            case TimeSpeed.Normal:
                yield return(new WaitForSeconds(0.1f));

                break;

            case TimeSpeed.Fast:
                yield return(new WaitForSeconds(0.25f));

                break;

            case TimeSpeed.Superfast:
                yield return(new WaitForSeconds(0.5f));

                break;

            case TimeSpeed.Ultrafast:
                yield return(new WaitForSeconds(1f));

                break;
            }
        }