Ejemplo n.º 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);
            }
        }
Ejemplo n.º 3
0
        private Hive SpawnHiveCluster(int hiveCount, Map map)
        {
            IntVec3 loc = default(IntVec3);

            if (!InfestationCellFinder.TryFindCell(out loc, map))
            {
                return(null);
            }
            Hive hive = (Hive)GenSpawn.Spawn(ThingMaker.MakeThing(ThingDefOf.Hive, null), loc, map);

            hive.SetFaction(Faction.OfInsects, null);
            IncidentWorker_Infestation.SpawnInsectJellyInstantly(hive);
            for (int i = 0; i < hiveCount - 1; i++)
            {
                Hive hive2 = default(Hive);
                if (hive.GetComp <CompSpawnerHives>().TrySpawnChildHive(false, out hive2))
                {
                    IncidentWorker_Infestation.SpawnInsectJellyInstantly(hive2);
                    hive = hive2;
                }
            }
            return(hive);
        }
        protected override bool Satisfied(Pawn pawn)
        {
            Hive hive = pawn.mindState.duty.focus.Thing as Hive;

            return(hive != null && hive.GetComp <CompSpawnerHives>().canSpawnHives);
        }