Exemplo n.º 1
0
        private TunnelHiveLikeSpawner SpawnTunnelLikeCluster(int hiveCount, Map map)
        {
            IntVec3           loc = DropCellFinder.RandomDropSpot(map);
            ThingDef_HiveLike tD  = (ThingDef_HiveLike)this.def.shipPart;
            ThingDef_TunnelHiveLikeSpawner thingDef = (ThingDef_TunnelHiveLikeSpawner)tD.TunnelDef;
            TunnelHiveLikeSpawner          hivelike = (TunnelHiveLikeSpawner)ThingMaker.MakeThing(thingDef, null);

            GenSpawn.Spawn(ThingMaker.MakeThing(hivelike.def, null), loc, map);
            //hivelike.SetFaction(hivelike.faction, null);
            IncidentWorker_Hivelike.SpawnItemInstantly(hivelike);
            for (int i = 0; i < hiveCount - 1; i++)
            {
                TunnelHiveLikeSpawner hivelike2;
                CompSpawnerHiveLikes  c = hivelike.GetComp <CompSpawnerHiveLikes>();
                if (hivelike.Spawned && hivelike.GetComp <CompSpawnerHiveLikes>().TrySpawnChildHiveLike(true, out hivelike2))
                {
                    IncidentWorker_Hivelike.SpawnItemInstantly(hivelike2);
                    hivelike = hivelike2;
                    //Log.Message(string.Format("7 e"));
                }
                //Log.Message(string.Format("7 f"));
            }
            //Log.Message(string.Format("8"));
            return(hivelike);
        }
Exemplo n.º 2
0
        private HiveLike SpawnHiveLikeCluster(int hiveCount, Map map, bool ignoreRoofedRequirement = false, bool allowUnreachable = false, float modifier = 1)
        {
            ;
            IntVec3           loc      = intVec;
            ThingDef_HiveLike thingDef = (ThingDef_HiveLike)this.def.shipPart;
            HiveLike          hivelike = (HiveLike)ThingMaker.MakeThing(thingDef, null);

            GenSpawn.Spawn(ThingMaker.MakeThing(hivelike.Def.TunnelDef, null), loc, map);
            hivelike.SetFaction(hivelike.OfFaction, null);
            IncidentWorker_Hivelike.SpawnItemInstantly(hivelike);
            for (int i = 0; i < hiveCount - 1; i++)
            {
                CompSpawnerHiveLikes c = hivelike.GetComp <CompSpawnerHiveLikes>();
                if (hivelike.Spawned && hivelike.GetComp <CompSpawnerHiveLikes>().TrySpawnChildHiveLike(modifier, modifier, out HiveLike hivelike2, ignoreRoofedRequirement, allowUnreachable))
                {
                    IncidentWorker_Hivelike.SpawnItemInstantly(hivelike2);
                    hivelike = hivelike2;
                }
            }
            return(hivelike);
        }
Exemplo n.º 3
0
        private HiveLike SpawnHiveLikeCluster(int hiveCount, Map map)
        {
            ;
            IntVec3           loc      = DropCellFinder.RandomDropSpot(map);
            ThingDef_HiveLike thingDef = (ThingDef_HiveLike)this.def.shipPart;
            HiveLike          hivelike = (HiveLike)ThingMaker.MakeThing(thingDef, null);

            GenSpawn.Spawn(ThingMaker.MakeThing(hivelike.OfTunnel, null), loc, map);
            hivelike.SetFaction(hivelike.OfFaction, null);
            IncidentWorker_Hivelike.SpawnItemInstantly(hivelike);
            for (int i = 0; i < hiveCount - 1; i++)
            {
                HiveLike             hivelike2;
                CompSpawnerHiveLikes c = hivelike.GetComp <CompSpawnerHiveLikes>();
                if (hivelike.Spawned && hivelike.GetComp <CompSpawnerHiveLikes>().TrySpawnChildHiveLike(true, out hivelike2))
                {
                    IncidentWorker_Hivelike.SpawnItemInstantly(hivelike2);
                    hivelike = hivelike2;
                }
            }
            return(hivelike);
        }
Exemplo n.º 4
0
        private TunnelHiveLikeSpawner SpawnTunnelLikeCluster(int hiveCount, Map map, bool ignoreRoofedRequirement = false, bool allowUnreachable = false, float modifier = 1)
        {
            IntVec3           loc = intVec;
            ThingDef_HiveLike tD  = (ThingDef_HiveLike)this.def.shipPart;
            ThingDef_TunnelHiveLikeSpawner thingDef = (ThingDef_TunnelHiveLikeSpawner)tD.TunnelDef;
            TunnelHiveLikeSpawner          hivelike = (TunnelHiveLikeSpawner)ThingMaker.MakeThing(thingDef, null);

            GenSpawn.Spawn(ThingMaker.MakeThing(hivelike.def, null), loc, map);
            //hivelike.SetFaction(hivelike.faction, null);
            IncidentWorker_Hivelike.SpawnItemInstantly(hivelike);
            for (int i = 0; i < hiveCount - 1; i++)
            {
                CompSpawnerHiveLikes c = hivelike.GetComp <CompSpawnerHiveLikes>();
                if (hivelike.Spawned && hivelike.GetComp <CompSpawnerHiveLikes>().TrySpawnChildHiveLike(modifier, modifier, out TunnelHiveLikeSpawner hivelike2, ignoreRoofedRequirement, allowUnreachable))
                {
                    IncidentWorker_Hivelike.SpawnItemInstantly(hivelike2);
                    hivelike = hivelike2;
                    //Log.Message(string.Format("7 e"));
                }
                //Log.Message(string.Format("7 f"));
            }
            //Log.Message(string.Format("8"));
            return(hivelike);
        }