Beispiel #1
0
 private void TrySpawnHive(Map map)
 {
     if (TryFindHiveSpawnCell(map, out IntVec3 spawnCell))
     {
         possibleSpawnCells.Remove(spawnCell);
         Hive hive = (Hive)GenSpawn.Spawn(ThingMaker.MakeThing(ThingDefOf.Hive), spawnCell, map);
         hive.SetFaction(Faction.OfInsects);
         hive.caveColony = true;
         (from x in hive.GetComps <CompSpawner>()
          where x.PropsSpawner.thingToSpawn == ThingDefOf.GlowPod
          select x).First().TryDoSpawn();
         hive.SpawnPawnsUntilPoints(Rand.Range(200f, 500f));
         hive.canSpawnPawns = false;
         hive.GetComp <CompSpawnerHives>().canSpawnHives = false;
         spawnedHives.Add(hive);
     }
 }
        private void TrySpawnHive(Map map)
        {
            IntVec3 intVec = default(IntVec3);

            if (this.TryFindHiveSpawnCell(map, out intVec))
            {
                this.possibleSpawnCells.Remove(intVec);
                Hive hive = (Hive)GenSpawn.Spawn(ThingMaker.MakeThing(ThingDefOf.Hive, null), intVec, map);
                hive.SetFaction(Faction.OfInsects, null);
                (from x in hive.GetComps <CompSpawner>()
                 where x.PropsSpawner.thingToSpawn == ThingDefOf.GlowPod
                 select x).First().TryDoSpawn();
                hive.SpawnPawnsUntilPoints(Rand.Range(200f, 500f));
                hive.canSpawnPawns = false;
                hive.GetComp <CompSpawnerHives>().canSpawnHives = false;
                this.spawnedHives.Add(hive);
            }
        }