TrySpawnWallAt() public static method

public static TrySpawnWallAt ( IntVec3 position, OG_OutpostData &outpostData ) : void
position IntVec3
outpostData OG_OutpostData
return void
Ejemplo n.º 1
0
        private static void GenerateOneShootingLine(IntVec3 shootingPosition, Rot4 rotation, ref OG_OutpostData outpostData)
        {
            // Spawn floor.
            for (int xOffset = -1; xOffset <= 1; xOffset++)
            {
                for (int zOffset = -1; zOffset <= 9; zOffset++)
                {
                    Find.TerrainGrid.SetTerrain(shootingPosition + new IntVec3(xOffset, 0, zOffset).RotatedBy(rotation), TerrainDefOf.Concrete);
                }
            }
            Find.TerrainGrid.SetTerrain(shootingPosition + new IntVec3(0, 0, 2).RotatedBy(rotation), TerrainDef.Named("MetalTile"));
            Find.TerrainGrid.SetTerrain(shootingPosition + new IntVec3(0, 0, 3).RotatedBy(rotation), TerrainDef.Named("PavedTile"));
            Find.TerrainGrid.SetTerrain(shootingPosition + new IntVec3(0, 0, 4).RotatedBy(rotation), TerrainDef.Named("MetalTile"));
            Find.TerrainGrid.SetTerrain(shootingPosition + new IntVec3(0, 0, 5).RotatedBy(rotation), TerrainDef.Named("PavedTile"));
            Find.TerrainGrid.SetTerrain(shootingPosition + new IntVec3(0, 0, 6).RotatedBy(rotation), TerrainDef.Named("MetalTile"));
            Find.TerrainGrid.SetTerrain(shootingPosition + new IntVec3(0, 0, 7).RotatedBy(rotation), TerrainDef.Named("PavedTile"));

            // Spawn sandbags.
            OG_Common.TrySpawnThingAt(ThingDefOf.Sandbags, null, shootingPosition + new IntVec3(-1, 0, 0).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDefOf.Sandbags, null, shootingPosition + new IntVec3(-1, 0, 1).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDefOf.Sandbags, null, shootingPosition + new IntVec3(0, 0, 1).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDefOf.Sandbags, null, shootingPosition + new IntVec3(1, 0, 1).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDefOf.Sandbags, null, shootingPosition + new IntVec3(1, 0, 0).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData);

            // Spawn target.
            if (ModsConfig.IsActive("Miscellaneous_TrainingFacility"))
            {
                OG_Common.TrySpawnThingAt(ThingDef.Named("ShootingRangeTarget"), null, shootingPosition + new IntVec3(0, 0, 8).RotatedBy(rotation), true, new Rot4(Rot4.South.AsInt + rotation.AsInt), ref outpostData);
            }
            else
            {
                OG_Common.TrySpawnWallAt(shootingPosition + new IntVec3(0, 0, 8).RotatedBy(rotation), ref outpostData);
            }
        }
Ejemplo n.º 2
0
        public static void GenerateCemeteryZone(IntVec3 areaSouthWestOrigin, int zoneAbs, int zoneOrd, Rot4 rotation, ref OG_OutpostData outpostData)
        {
            IntVec3 rotatedOrigin = Zone.GetZoneRotatedOrigin(areaSouthWestOrigin, zoneAbs, zoneOrd, rotation);

            // Spawn floor (excepted in zone corners).
            for (int xOffset = 1; xOffset <= 9; xOffset++)
            {
                for (int zOffset = 0; zOffset <= 10; zOffset++)
                {
                    Find.TerrainGrid.SetTerrain(rotatedOrigin + new IntVec3(xOffset, 0, zOffset).RotatedBy(rotation), TerrainDefOf.Soil);
                }
            }
            for (int xOffset = 0; xOffset <= 10; xOffset++)
            {
                for (int zOffset = 1; zOffset <= 9; zOffset++)
                {
                    Find.TerrainGrid.SetTerrain(rotatedOrigin + new IntVec3(xOffset, 0, zOffset).RotatedBy(rotation), TerrainDefOf.Soil);
                }
            }
            for (int xOffset = 4; xOffset <= 6; xOffset++)
            {
                for (int zOffset = 1; zOffset <= 9; zOffset++)
                {
                    Find.TerrainGrid.SetTerrain(rotatedOrigin + new IntVec3(xOffset, 0, zOffset).RotatedBy(rotation), TerrainDef.Named("TileGranite"));
                }
            }
            for (int zOffset = 1; zOffset <= 9; zOffset++)
            {
                Find.TerrainGrid.SetTerrain(rotatedOrigin + new IntVec3(5, 0, zOffset).RotatedBy(rotation), TerrainDef.Named("PavedTile"));
            }
            for (int xOffset = 4; xOffset <= 6; xOffset++)
            {
                Find.TerrainGrid.SetTerrain(rotatedOrigin + new IntVec3(xOffset, 0, 2).RotatedBy(rotation), TerrainDef.Named("PavedTile"));
                Find.TerrainGrid.SetTerrain(rotatedOrigin + new IntVec3(xOffset, 0, 5).RotatedBy(rotation), TerrainDef.Named("PavedTile"));
                Find.TerrainGrid.SetTerrain(rotatedOrigin + new IntVec3(xOffset, 0, 8).RotatedBy(rotation), TerrainDef.Named("PavedTile"));
            }

            // Spawn graves and tombstones.
            OG_Common.TrySpawnWallAt(rotatedOrigin + new IntVec3(1, 0, 2).RotatedBy(rotation), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDefOf.Grave, null, rotatedOrigin + new IntVec3(2, 0, 2).RotatedBy(rotation), true, new Rot4(Rot4.East.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnWallAt(rotatedOrigin + new IntVec3(1, 0, 5).RotatedBy(rotation), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDefOf.Grave, null, rotatedOrigin + new IntVec3(2, 0, 5).RotatedBy(rotation), true, new Rot4(Rot4.East.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnWallAt(rotatedOrigin + new IntVec3(1, 0, 8).RotatedBy(rotation), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDefOf.Grave, null, rotatedOrigin + new IntVec3(2, 0, 8).RotatedBy(rotation), true, new Rot4(Rot4.East.AsInt + rotation.AsInt), ref outpostData);

            OG_Common.TrySpawnWallAt(rotatedOrigin + new IntVec3(9, 0, 2).RotatedBy(rotation), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDefOf.Grave, null, rotatedOrigin + new IntVec3(8, 0, 2).RotatedBy(rotation), true, new Rot4(Rot4.West.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnWallAt(rotatedOrigin + new IntVec3(9, 0, 5).RotatedBy(rotation), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDefOf.Grave, null, rotatedOrigin + new IntVec3(8, 0, 5).RotatedBy(rotation), true, new Rot4(Rot4.West.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnWallAt(rotatedOrigin + new IntVec3(9, 0, 8).RotatedBy(rotation), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDefOf.Grave, null, rotatedOrigin + new IntVec3(8, 0, 8).RotatedBy(rotation), true, new Rot4(Rot4.West.AsInt + rotation.AsInt), ref outpostData);

            // Spawn flower pots.
            OG_Common.TrySpawnThingAt(ThingDef.Named("PlantPot"), ThingDef.Named("BlocksGranite"), rotatedOrigin + new IntVec3(2, 0, 3).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("PlantPot"), ThingDef.Named("BlocksGranite"), rotatedOrigin + new IntVec3(3, 0, 7).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("PlantPot"), ThingDef.Named("BlocksGranite"), rotatedOrigin + new IntVec3(8, 0, 4).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("PlantPot"), ThingDef.Named("BlocksGranite"), rotatedOrigin + new IntVec3(8, 0, 6).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData);
        }
Ejemplo n.º 3
0
        public static void GenerateEmptyRoomAt(IntVec3 rotatedOrigin,
                                               int width,
                                               int height,
                                               Rot4 rotation,
                                               TerrainDef defaultFloorDef,
                                               TerrainDef interiorFloorDef,
                                               ref OG_OutpostData outpostData)
        {
            CellRect rect = new CellRect(rotatedOrigin.x, rotatedOrigin.z, width, height);

            if (rotation == Rot4.North)
            {
                rect = new CellRect(rotatedOrigin.x, rotatedOrigin.z, width, height);
            }
            else if (rotation == Rot4.East)
            {
                rect = new CellRect(rotatedOrigin.x, rotatedOrigin.z - width + 1, height, width);
            }
            else if (rotation == Rot4.South)
            {
                rect = new CellRect(rotatedOrigin.x - width + 1, rotatedOrigin.z - height + 1, width, height);
            }
            else
            {
                rect = new CellRect(rotatedOrigin.x - height + 1, rotatedOrigin.z, height, width);
            }
            // Generate 4 walls and power conduits.
            foreach (IntVec3 cell in rect.Cells)
            {
                if ((cell.x == rect.minX) || (cell.x == rect.maxX) || (cell.z == rect.minZ) || (cell.z == rect.maxZ))
                {
                    OG_Common.TrySpawnWallAt(cell, ref outpostData);
                    OG_Common.SpawnFireproofPowerConduitAt(cell, ref outpostData);
                }
            }
            // Trigger to unfog area when a pawn enters the room.
            SpawnRectTriggerUnfogArea(rect, ref outpostData.triggerIntrusion);
            // Generate roof.
            foreach (IntVec3 cell in rect.Cells)
            {
                Find.RoofGrid.SetRoof(cell, OG_Util.IronedRoofDef);
            }
            // Generate room default floor.
            if (defaultFloorDef != null)
            {
                foreach (IntVec3 cell in rect.ExpandedBy(1).Cells)
                {
                    TerrainDef terrain = Find.TerrainGrid.TerrainAt(cell);
                    if (terrain != TerrainDef.Named("PavedTile")) // Don't recover already spawned paved tile.
                    {
                        Find.TerrainGrid.SetTerrain(cell, defaultFloorDef);
                    }
                }
            }
            // Generate room interior floor.
            if (interiorFloorDef != null)
            {
                foreach (IntVec3 cell in rect.ContractedBy(1).Cells)
                {
                    Find.TerrainGrid.SetTerrain(cell, interiorFloorDef);
                }
            }
        }
Ejemplo n.º 4
0
        public static void GenerateBigRoomBarracks(IntVec3 areaSouthWestOrigin, int zoneAbs, int zoneOrd, Rot4 rotation, ref OG_OutpostData outpostData)
        {
            IntVec3 origin        = Zone.GetZoneOrigin(areaSouthWestOrigin, zoneAbs, zoneOrd);
            IntVec3 rotatedOrigin = Zone.GetZoneRotatedOrigin(areaSouthWestOrigin, zoneAbs, zoneOrd, rotation);

            OG_Common.GenerateEmptyRoomAt(rotatedOrigin, Genstep_GenerateOutpost.zoneSideSize, Genstep_GenerateOutpost.zoneSideSize, rotation, TerrainDefOf.Concrete, TerrainDef.Named("CarpetGreen"), ref outpostData);

            // Spawn doors.
            OG_Common.SpawnDoorAt(rotatedOrigin + new IntVec3(5, 0, 10).RotatedBy(rotation), ref outpostData);
            OG_Common.SpawnDoorAt(rotatedOrigin + new IntVec3(10, 0, 5).RotatedBy(rotation), ref outpostData);
            OG_Common.SpawnDoorAt(rotatedOrigin + new IntVec3(5, 0, 0).RotatedBy(rotation), ref outpostData);
            OG_Common.SpawnDoorAt(rotatedOrigin + new IntVec3(0, 0, 5).RotatedBy(rotation), ref outpostData);

            // Spawn beds.
            OG_Common.TrySpawnThingAt(ThingDef.Named("Stool"), ThingDefOf.Steel, rotatedOrigin + new IntVec3(2, 0, 9).RotatedBy(rotation), true, new Rot4(Rot4.South.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("Bed"), ThingDefOf.Steel, rotatedOrigin + new IntVec3(3, 0, 9).RotatedBy(rotation), true, new Rot4(Rot4.South.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("Bed"), ThingDefOf.Steel, rotatedOrigin + new IntVec3(4, 0, 9).RotatedBy(rotation), true, new Rot4(Rot4.South.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("Bed"), ThingDefOf.Steel, rotatedOrigin + new IntVec3(6, 0, 9).RotatedBy(rotation), true, new Rot4(Rot4.South.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("Bed"), ThingDefOf.Steel, rotatedOrigin + new IntVec3(7, 0, 9).RotatedBy(rotation), true, new Rot4(Rot4.South.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("Stool"), ThingDefOf.Steel, rotatedOrigin + new IntVec3(8, 0, 9).RotatedBy(rotation), true, new Rot4(Rot4.South.AsInt + rotation.AsInt), ref outpostData);

            OG_Common.TrySpawnThingAt(ThingDef.Named("Bed"), ThingDefOf.Steel, rotatedOrigin + new IntVec3(9, 0, 6).RotatedBy(rotation), true, new Rot4(Rot4.West.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("Bed"), ThingDefOf.Steel, rotatedOrigin + new IntVec3(9, 0, 7).RotatedBy(rotation), true, new Rot4(Rot4.West.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("Stool"), ThingDefOf.Steel, rotatedOrigin + new IntVec3(9, 0, 8).RotatedBy(rotation), true, new Rot4(Rot4.West.AsInt + rotation.AsInt), ref outpostData);

            OG_Common.TrySpawnThingAt(ThingDef.Named("Stool"), ThingDefOf.Steel, rotatedOrigin + new IntVec3(2, 0, 1).RotatedBy(rotation), true, new Rot4(Rot4.North.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("Bed"), ThingDefOf.Steel, rotatedOrigin + new IntVec3(3, 0, 1).RotatedBy(rotation), true, new Rot4(Rot4.North.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("Bed"), ThingDefOf.Steel, rotatedOrigin + new IntVec3(4, 0, 1).RotatedBy(rotation), true, new Rot4(Rot4.North.AsInt + rotation.AsInt), ref outpostData);

            OG_Common.TrySpawnThingAt(ThingDef.Named("Stool"), ThingDefOf.Steel, rotatedOrigin + new IntVec3(1, 0, 2).RotatedBy(rotation), true, new Rot4(Rot4.East.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("Bed"), ThingDefOf.Steel, rotatedOrigin + new IntVec3(1, 0, 3).RotatedBy(rotation), true, new Rot4(Rot4.East.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("Bed"), ThingDefOf.Steel, rotatedOrigin + new IntVec3(1, 0, 4).RotatedBy(rotation), true, new Rot4(Rot4.East.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("Bed"), ThingDefOf.Steel, rotatedOrigin + new IntVec3(1, 0, 6).RotatedBy(rotation), true, new Rot4(Rot4.East.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("Bed"), ThingDefOf.Steel, rotatedOrigin + new IntVec3(1, 0, 7).RotatedBy(rotation), true, new Rot4(Rot4.East.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("Stool"), ThingDefOf.Steel, rotatedOrigin + new IntVec3(1, 0, 8).RotatedBy(rotation), true, new Rot4(Rot4.East.AsInt + rotation.AsInt), ref outpostData);

            // Generate shower room.
            for (int xOffset = 6; xOffset <= 9; xOffset++)
            {
                OG_Common.TrySpawnWallAt(rotatedOrigin + new IntVec3(xOffset, 0, 4).RotatedBy(rotation), ref outpostData);
            }
            for (int zOffset = 1; zOffset <= 4; zOffset++)
            {
                OG_Common.TrySpawnWallAt(rotatedOrigin + new IntVec3(6, 0, zOffset).RotatedBy(rotation), ref outpostData);
            }
            OG_Common.SpawnDoorAt(rotatedOrigin + new IntVec3(6, 0, 2).RotatedBy(rotation), ref outpostData);
            for (int xOffset = 7; xOffset <= 9; xOffset++)
            {
                for (int zOffset = 1; zOffset <= 3; zOffset++)
                {
                    Find.TerrainGrid.SetTerrain(rotatedOrigin + new IntVec3(xOffset, 0, zOffset).RotatedBy(rotation), TerrainDef.Named("SterileTile"));
                }
            }
            for (int xOffset = 6; xOffset <= 8; xOffset++)
            {
                Find.TerrainGrid.SetTerrain(rotatedOrigin + new IntVec3(xOffset, 0, 2).RotatedBy(rotation), TerrainDef.Named("PavedTile"));
            }

            // Spawn lamps.
            OG_Common.TrySpawnLampAt(rotatedOrigin + new IntVec3(4, 0, 6).RotatedBy(rotation), Color.white, ref outpostData);
            OG_Common.TrySpawnLampAt(rotatedOrigin + new IntVec3(9, 0, 2).RotatedBy(rotation), Color.white, ref outpostData);

            // Spawn heaters and coolers.
            OG_Common.TrySpawnHeaterAt(rotatedOrigin + new IntVec3(1, 0, 1).RotatedBy(rotation), ref outpostData);
            OG_Common.TrySpawnHeaterAt(rotatedOrigin + new IntVec3(1, 0, 9).RotatedBy(rotation), ref outpostData);
            OG_Common.TrySpawnHeaterAt(rotatedOrigin + new IntVec3(9, 0, 9).RotatedBy(rotation), ref outpostData);
            OG_Common.SpawnCoolerAt(rotatedOrigin + new IntVec3(0, 0, 1).RotatedBy(rotation), new Rot4(Rot4.West.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.SpawnCoolerAt(rotatedOrigin + new IntVec3(0, 0, 9).RotatedBy(rotation), new Rot4(Rot4.West.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.SpawnCoolerAt(rotatedOrigin + new IntVec3(10, 0, 9).RotatedBy(rotation), new Rot4(Rot4.East.AsInt + rotation.AsInt), ref outpostData);

            OG_Common.GenerateHorizontalAndVerticalPavedAlleys(origin);
        }
Ejemplo n.º 5
0
        public static void GenerateMediumRoomBarn(IntVec3 areaSouthWestOrigin, int zoneAbs, int zoneOrd, Rot4 rotation, ref OG_OutpostData outpostData)
        {
            IntVec3 origin        = Zone.GetZoneOrigin(areaSouthWestOrigin, zoneAbs, zoneOrd);
            IntVec3 rotatedOrigin = Zone.GetZoneRotatedOrigin(areaSouthWestOrigin, zoneAbs, zoneOrd, rotation);

            OG_Common.GenerateEmptyRoomAt(rotatedOrigin + new IntVec3(1, 0, 1).RotatedBy(rotation), 9, 9, rotation, TerrainDefOf.Concrete, TerrainDefOf.Soil, ref outpostData);

            // Generate animal feed room.
            for (int xOffset = 2; xOffset <= 4; xOffset++)
            {
                OG_Common.TrySpawnWallAt(rotatedOrigin + new IntVec3(xOffset, 0, 5).RotatedBy(rotation), ref outpostData);
            }
            for (int zOffset = 2; zOffset <= 5; zOffset++)
            {
                OG_Common.TrySpawnWallAt(rotatedOrigin + new IntVec3(4, 0, zOffset).RotatedBy(rotation), ref outpostData);
            }
            IntVec3 doorPosition = rotatedOrigin + new IntVec3(4, 0, 3).RotatedBy(rotation);

            OG_Common.SpawnDoorAt(doorPosition, ref outpostData);
            Find.TerrainGrid.SetTerrain(doorPosition, TerrainDef.Named("PavedTile"));
            for (int xOffset = 2; xOffset <= 3; xOffset++)
            {
                for (int zOffset = 2; zOffset <= 4; zOffset++)
                {
                    IntVec3 fridgeCell = rotatedOrigin + new IntVec3(xOffset, 0, zOffset).RotatedBy(rotation);
                    Find.TerrainGrid.SetTerrain(fridgeCell, TerrainDef.Named("SterileTile"));
                    if ((zOffset == 2) || (zOffset == 4))
                    {
                        Thing hayStack = ThingMaker.MakeThing(ThingDef.Named("Hay"));
                        hayStack.stackCount = ThingDef.Named("Hay").stackLimit;
                        GenSpawn.Spawn(hayStack, fridgeCell);
                    }
                }
            }
            // Spawn animal beds.
            OG_Common.TrySpawnThingAt(ThingDef.Named("AnimalBed"), ThingDef.Named("Cloth"), rotatedOrigin + new IntVec3(2, 0, 6).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("AnimalBed"), ThingDef.Named("Cloth"), rotatedOrigin + new IntVec3(2, 0, 8).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("AnimalBed"), ThingDef.Named("Cloth"), rotatedOrigin + new IntVec3(4, 0, 8).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData);

            OG_Common.TrySpawnThingAt(ThingDef.Named("AnimalBed"), ThingDef.Named("Cloth"), rotatedOrigin + new IntVec3(6, 0, 8).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("AnimalBed"), ThingDef.Named("Cloth"), rotatedOrigin + new IntVec3(8, 0, 8).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("AnimalBed"), ThingDef.Named("Cloth"), rotatedOrigin + new IntVec3(8, 0, 6).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData);

            OG_Common.TrySpawnThingAt(ThingDef.Named("AnimalBed"), ThingDef.Named("Cloth"), rotatedOrigin + new IntVec3(8, 0, 4).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("AnimalBed"), ThingDef.Named("Cloth"), rotatedOrigin + new IntVec3(8, 0, 2).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("AnimalBed"), ThingDef.Named("Cloth"), rotatedOrigin + new IntVec3(6, 0, 2).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData);

            // Spawn lamp, heater and coolers.
            OG_Common.TrySpawnLampAt(rotatedOrigin + new IntVec3(6, 0, 5).RotatedBy(rotation), Color.white, ref outpostData);
            OG_Common.TrySpawnHeaterAt(rotatedOrigin + new IntVec3(8, 0, 5).RotatedBy(rotation), ref outpostData);
            Building_Cooler cooler = OG_Common.SpawnCoolerAt(rotatedOrigin + new IntVec3(1, 0, 3).RotatedBy(rotation), new Rot4(Rot4.West.AsInt + rotation.AsInt), ref outpostData);

            cooler.compTempControl.targetTemperature = 5f;

            // Spawn vertical alley and doors.
            for (int zOffset = 0; zOffset <= 10; zOffset++)
            {
                Find.TerrainGrid.SetTerrain(rotatedOrigin + new IntVec3(5, 0, zOffset).RotatedBy(rotation), TerrainDef.Named("PavedTile"));
            }
            OG_Common.SpawnDoorAt(rotatedOrigin + new IntVec3(5, 0, 1).RotatedBy(rotation), ref outpostData);
            OG_Common.SpawnDoorAt(rotatedOrigin + new IntVec3(5, 0, 9).RotatedBy(rotation), ref outpostData);
        }
Ejemplo n.º 6
0
        public static void GeneratePlazaZone(IntVec3 areaSouthWestOrigin, int zoneAbs, int zoneOrd, Rot4 rotation, ref OG_OutpostData outpostData)
        {
            IntVec3 rotatedOrigin = Zone.GetZoneRotatedOrigin(areaSouthWestOrigin, zoneAbs, zoneOrd, rotation);

            // Generate paved floor.
            for (int xOffset = 3; xOffset <= 7; xOffset++)
            {
                for (int zOffset = 0; zOffset <= 10; zOffset++)
                {
                    Find.TerrainGrid.SetTerrain(rotatedOrigin + new IntVec3(xOffset, 0, zOffset), TerrainDef.Named("TileGranite"));
                }
            }
            for (int xOffset = 2; xOffset <= 8; xOffset++)
            {
                for (int zOffset = 1; zOffset <= 9; zOffset++)
                {
                    Find.TerrainGrid.SetTerrain(rotatedOrigin + new IntVec3(xOffset, 0, zOffset), TerrainDef.Named("TileGranite"));
                }
            }
            for (int xOffset = 1; xOffset <= 9; xOffset++)
            {
                for (int zOffset = 2; zOffset <= 8; zOffset++)
                {
                    Find.TerrainGrid.SetTerrain(rotatedOrigin + new IntVec3(xOffset, 0, zOffset), TerrainDef.Named("TileGranite"));
                }
            }
            for (int xOffset = 0; xOffset <= 10; xOffset++)
            {
                for (int zOffset = 3; zOffset <= 7; zOffset++)
                {
                    Find.TerrainGrid.SetTerrain(rotatedOrigin + new IntVec3(xOffset, 0, zOffset), TerrainDef.Named("TileGranite"));
                }
            }

            // Generate central paved alley.
            IntVec3 centralPylonPosition = rotatedOrigin + new IntVec3(Genstep_GenerateOutpost.zoneSideCenterOffset, 0, Genstep_GenerateOutpost.zoneSideCenterOffset);

            for (int zOffset = 0; zOffset < Genstep_GenerateOutpost.zoneSideSize; zOffset++)
            {
                Find.TerrainGrid.SetTerrain(rotatedOrigin + new IntVec3(Genstep_GenerateOutpost.zoneSideCenterOffset, 0, zOffset), TerrainDef.Named("PavedTile"));
            }
            for (int xOffset = 0; xOffset < Genstep_GenerateOutpost.zoneSideSize; xOffset++)
            {
                Find.TerrainGrid.SetTerrain(rotatedOrigin + new IntVec3(xOffset, 0, Genstep_GenerateOutpost.zoneSideCenterOffset), TerrainDef.Named("PavedTile"));
            }
            foreach (IntVec3 cell in GenAdj.CellsAdjacent8Way(centralPylonPosition))
            {
                Find.TerrainGrid.SetTerrain(cell, TerrainDef.Named("PavedTile"));
            }

            // Generate pylon.
            OG_Common.TrySpawnWallAt(centralPylonPosition, ref outpostData);

            // Generate sandbags and power conduit.
            for (int rotationAsInt = 0; rotationAsInt < 4; rotationAsInt++)
            {
                Rot4    quarterRotation        = new Rot4(rotationAsInt);
                IntVec3 quarterSouthWestOrigin = Zone.GetZoneRotatedOrigin(areaSouthWestOrigin, zoneAbs, zoneOrd, quarterRotation);

                IntVec3 cell = quarterSouthWestOrigin + new IntVec3(0, 0, 4).RotatedBy(quarterRotation);
                OG_Common.TrySpawnThingAt(ThingDefOf.Sandbags, null, cell, false, Rot4.Invalid, ref outpostData);
                OG_Common.SpawnFireproofPowerConduitAt(cell, ref outpostData);
                cell = quarterSouthWestOrigin + new IntVec3(0, 0, 3).RotatedBy(quarterRotation);
                OG_Common.TrySpawnThingAt(ThingDefOf.Sandbags, null, cell, false, Rot4.Invalid, ref outpostData);
                OG_Common.SpawnFireproofPowerConduitAt(cell, ref outpostData);
                cell = quarterSouthWestOrigin + new IntVec3(1, 0, 3).RotatedBy(quarterRotation);
                OG_Common.TrySpawnThingAt(ThingDefOf.Sandbags, null, cell, false, Rot4.Invalid, ref outpostData);
                OG_Common.SpawnFireproofPowerConduitAt(cell, ref outpostData);
                cell = quarterSouthWestOrigin + new IntVec3(1, 0, 2).RotatedBy(quarterRotation);
                OG_Common.TrySpawnThingAt(ThingDefOf.Sandbags, null, cell, false, Rot4.Invalid, ref outpostData);
                OG_Common.SpawnFireproofPowerConduitAt(cell, ref outpostData);
                cell = quarterSouthWestOrigin + new IntVec3(2, 0, 2).RotatedBy(quarterRotation);
                OG_Common.TrySpawnThingAt(ThingDefOf.Sandbags, null, cell, false, Rot4.Invalid, ref outpostData);
                OG_Common.SpawnFireproofPowerConduitAt(cell, ref outpostData);
                cell = quarterSouthWestOrigin + new IntVec3(2, 0, 1).RotatedBy(quarterRotation);
                OG_Common.TrySpawnThingAt(ThingDefOf.Sandbags, null, cell, false, Rot4.Invalid, ref outpostData);
                OG_Common.SpawnFireproofPowerConduitAt(cell, ref outpostData);
                cell = quarterSouthWestOrigin + new IntVec3(3, 0, 1).RotatedBy(quarterRotation);
                OG_Common.TrySpawnThingAt(ThingDefOf.Sandbags, null, cell, false, Rot4.Invalid, ref outpostData);
                OG_Common.SpawnFireproofPowerConduitAt(cell, ref outpostData);
                cell = quarterSouthWestOrigin + new IntVec3(3, 0, 0).RotatedBy(quarterRotation);
                OG_Common.TrySpawnThingAt(ThingDefOf.Sandbags, null, cell, false, Rot4.Invalid, ref outpostData);
                OG_Common.SpawnFireproofPowerConduitAt(cell, ref outpostData);
                cell = quarterSouthWestOrigin + new IntVec3(4, 0, 0).RotatedBy(quarterRotation);
                OG_Common.TrySpawnThingAt(ThingDefOf.Sandbags, null, cell, false, Rot4.Invalid, ref outpostData);
                OG_Common.SpawnFireproofPowerConduitAt(cell, ref outpostData);
                cell = quarterSouthWestOrigin + new IntVec3(5, 0, 0).RotatedBy(quarterRotation);
                OG_Common.SpawnFireproofPowerConduitAt(cell, ref outpostData);
            }
        }
Ejemplo n.º 7
0
        public static void GenerateMainEntranceZone(IntVec3 areaSouthWestOrigin, int zoneAbs, int zoneOrd, Rot4 rotation, ref OG_OutpostData outpostData)
        {
            IntVec3 rotatedOrigin = Zone.GetZoneRotatedOrigin(areaSouthWestOrigin, zoneAbs, zoneOrd, rotation);
            IntVec3 cell          = rotatedOrigin;

            // Spawn concrete floor.
            for (int xOffset = -1; xOffset <= 11; xOffset++)
            {
                for (int zOffset = -1; zOffset <= 5; zOffset++)
                {
                    cell = rotatedOrigin + new IntVec3(xOffset, 0, zOffset).RotatedBy(rotation);
                    Find.TerrainGrid.SetTerrain(cell, TerrainDefOf.Concrete);
                }
            }

            // Generate central paved alley.
            for (int xOffset = 4; xOffset <= 6; xOffset++)
            {
                for (int zOffset = 0; zOffset <= 10; zOffset++)
                {
                    Find.TerrainGrid.SetTerrain(rotatedOrigin + new IntVec3(xOffset, 0, zOffset).RotatedBy(rotation), TerrainDefOf.Concrete);
                }
            }
            for (int zOffset = -1; zOffset <= 10; zOffset++)
            {
                Find.TerrainGrid.SetTerrain(rotatedOrigin + new IntVec3(5, 0, zOffset).RotatedBy(rotation), TerrainDef.Named("PavedTile"));
            }

            // Generate south west turret.
            IntVec3 southWestOrigin = rotatedOrigin;

            for (int xOffset = 0; xOffset < 5; xOffset++)
            {
                for (int zOffset = 0; zOffset < 5; zOffset++)
                {
                    cell = southWestOrigin + new IntVec3(xOffset, 0, zOffset).RotatedBy(rotation);
                    if ((xOffset == 0) ||
                        (zOffset == 0))
                    {
                        OG_Common.TrySpawnWallAt(cell, ref outpostData);
                        OG_Common.SpawnFireproofPowerConduitAt(cell, ref outpostData);
                    }
                }
            }
            OG_Common.TrySpawnThingAt(ThingDefOf.Sandbags, null, southWestOrigin + new IntVec3(1, 0, 4).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDefOf.Sandbags, null, southWestOrigin + new IntVec3(2, 0, 4).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDefOf.Sandbags, null, southWestOrigin + new IntVec3(3, 0, 4).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDefOf.Sandbags, null, southWestOrigin + new IntVec3(4, 0, 4).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDefOf.Sandbags, null, southWestOrigin + new IntVec3(4, 0, 3).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData);
            OG_Common.TrySpawnThingAt(OG_Util.VulcanTurretDef, ThingDefOf.Steel, southWestOrigin + new IntVec3(2, 0, 2).RotatedBy(rotation), true, new Rot4(Rot4.North.AsInt + rotation.AsInt), ref outpostData);

            // Generate south east turret.
            IntVec3 southEastOrigin = rotatedOrigin;

            for (int xOffset = 6; xOffset < 11; xOffset++)
            {
                for (int zOffset = 0; zOffset < 5; zOffset++)
                {
                    cell = southEastOrigin + new IntVec3(xOffset, 0, zOffset).RotatedBy(rotation);
                    if ((xOffset == 10) ||
                        (zOffset == 0))
                    {
                        OG_Common.TrySpawnWallAt(cell, ref outpostData);
                        OG_Common.SpawnFireproofPowerConduitAt(cell, ref outpostData);
                    }
                }
            }
            OG_Common.TrySpawnThingAt(ThingDefOf.Sandbags, null, southEastOrigin + new IntVec3(6, 0, 3).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDefOf.Sandbags, null, southEastOrigin + new IntVec3(6, 0, 4).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDefOf.Sandbags, null, southEastOrigin + new IntVec3(7, 0, 4).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDefOf.Sandbags, null, southEastOrigin + new IntVec3(8, 0, 4).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDefOf.Sandbags, null, southEastOrigin + new IntVec3(9, 0, 4).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData);
            OG_Common.TrySpawnThingAt(OG_Util.VulcanTurretDef, ThingDefOf.Steel, southEastOrigin + new IntVec3(7, 0, 2).RotatedBy(rotation), true, new Rot4(Rot4.North.AsInt + rotation.AsInt), ref outpostData);

            // Generate central door and power conduit.
            OG_Common.SpawnDoorAt(rotatedOrigin + new IntVec3(5, 0, 0).RotatedBy(rotation), ref outpostData);
            OG_Common.SpawnFireproofPowerConduitAt(rotatedOrigin + new IntVec3(5, 0, 0).RotatedBy(rotation), ref outpostData);

            // Generate ironed roof.
            for (int xOffset = 0; xOffset <= 10; xOffset++)
            {
                for (int zOffset = 0; zOffset <= 4; zOffset++)
                {
                    Find.RoofGrid.SetRoof(rotatedOrigin + new IntVec3(xOffset, 0, zOffset).RotatedBy(rotation), OG_Util.IronedRoofDef);
                }
            }
        }
Ejemplo n.º 8
0
        public static void GenerateEntranchedZone(IntVec3 areaSouthWestOrigin, int zoneAbs, int zoneOrd, Rot4 rotation, ref OG_OutpostData outpostData)
        {
            IntVec3 rotatedOrigin = Zone.GetZoneRotatedOrigin(areaSouthWestOrigin, zoneAbs, zoneOrd, rotation);
            IntVec3 cell          = rotatedOrigin;

            // Generate south west battery shelter.
            OG_Common.TrySpawnWallAt(rotatedOrigin + new IntVec3(0, 0, 0).RotatedBy(rotation), ref outpostData);
            OG_Common.TrySpawnWallAt(rotatedOrigin + new IntVec3(3, 0, 0).RotatedBy(rotation), ref outpostData);
            OG_Common.TrySpawnWallAt(rotatedOrigin + new IntVec3(0, 0, 3).RotatedBy(rotation), ref outpostData);
            OG_Common.TrySpawnWallAt(rotatedOrigin + new IntVec3(3, 0, 3).RotatedBy(rotation), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDefOf.Battery, null, rotatedOrigin + new IntVec3(1, 0, 1).RotatedBy(rotation), true, new Rot4(Rot4.North.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDefOf.Battery, null, rotatedOrigin + new IntVec3(2, 0, 1).RotatedBy(rotation), true, new Rot4(Rot4.North.AsInt + rotation.AsInt), ref outpostData);
            for (int xOffset = 0; xOffset < 4; xOffset++)
            {
                for (int zOffset = 0; zOffset < 4; zOffset++)
                {
                    cell = rotatedOrigin + new IntVec3(xOffset, 0, zOffset).RotatedBy(rotation);
                    Find.TerrainGrid.SetTerrain(cell, TerrainDefOf.Concrete);
                    Find.RoofGrid.SetRoof(cell, OG_Util.IronedRoofDef);
                }
            }

            // Generate south east battery shelter.
            OG_Common.TrySpawnWallAt(rotatedOrigin + new IntVec3(7, 0, 0).RotatedBy(rotation), ref outpostData);
            OG_Common.TrySpawnWallAt(rotatedOrigin + new IntVec3(10, 0, 0).RotatedBy(rotation), ref outpostData);
            OG_Common.TrySpawnWallAt(rotatedOrigin + new IntVec3(7, 0, 3).RotatedBy(rotation), ref outpostData);
            OG_Common.TrySpawnWallAt(rotatedOrigin + new IntVec3(10, 0, 3).RotatedBy(rotation), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDefOf.Battery, null, rotatedOrigin + new IntVec3(8, 0, 1).RotatedBy(rotation), true, new Rot4(Rot4.North.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDefOf.Battery, null, rotatedOrigin + new IntVec3(9, 0, 1).RotatedBy(rotation), true, new Rot4(Rot4.North.AsInt + rotation.AsInt), ref outpostData);
            for (int xOffset = 7; xOffset < 11; xOffset++)
            {
                for (int zOffset = 0; zOffset < 4; zOffset++)
                {
                    cell = rotatedOrigin + new IntVec3(xOffset, 0, zOffset).RotatedBy(rotation);
                    Find.TerrainGrid.SetTerrain(cell, TerrainDefOf.Concrete);
                    Find.RoofGrid.SetRoof(cell, OG_Util.IronedRoofDef);
                }
            }

            // Generate central paved alley.
            for (int xOffset = 4; xOffset <= 6; xOffset++)
            {
                for (int zOffset = 0; zOffset < 7; zOffset++)
                {
                    Find.TerrainGrid.SetTerrain(rotatedOrigin + new IntVec3(xOffset, 0, zOffset).RotatedBy(rotation), TerrainDefOf.Concrete);
                }
            }
            for (int zOffset = 0; zOffset < 7; zOffset++)
            {
                Find.TerrainGrid.SetTerrain(rotatedOrigin + new IntVec3(5, 0, zOffset).RotatedBy(rotation), TerrainDef.Named("PavedTile"));
            }

            // Generate north west force field.
            IntVec3 northWestOrigin = rotatedOrigin + new IntVec3(0, 0, 6).RotatedBy(rotation);

            for (int xOffset = 0; xOffset < 5; xOffset++)
            {
                for (int zOffset = 0; zOffset < 2; zOffset++)
                {
                    Find.TerrainGrid.SetTerrain(northWestOrigin + new IntVec3(xOffset, 0, zOffset).RotatedBy(rotation), TerrainDefOf.Concrete);
                }
            }
            for (int xOffset = 1; xOffset <= 3; xOffset++)
            {
                Find.TerrainGrid.SetTerrain(northWestOrigin + new IntVec3(xOffset, 0, 2).RotatedBy(rotation), TerrainDefOf.Concrete);
            }
            OG_Common.TrySpawnThingAt(ThingDefOf.Sandbags, null, northWestOrigin + new IntVec3(0, 0, 1).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDefOf.Sandbags, null, northWestOrigin + new IntVec3(1, 0, 1).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDefOf.Sandbags, null, northWestOrigin + new IntVec3(1, 0, 2).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDefOf.Sandbags, null, northWestOrigin + new IntVec3(2, 0, 2).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDefOf.Sandbags, null, northWestOrigin + new IntVec3(3, 0, 2).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDefOf.Sandbags, null, northWestOrigin + new IntVec3(3, 0, 1).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDefOf.Sandbags, null, northWestOrigin + new IntVec3(4, 0, 1).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData);
            for (int zOffset = -3; zOffset <= 3; zOffset++)
            {
                if ((zOffset == 1) &&
                    OG_Util.IsModActive("MiningCo. ForceField"))
                {
                    // Do not spawn power conduit under force field as it generates a warning message.
                    continue;
                }
                OG_Common.SpawnFireproofPowerConduitAt(northWestOrigin + new IntVec3(2, 0, zOffset).RotatedBy(rotation), ref outpostData);
            }
            if (OG_Util.IsModActive("MiningCo. ForceField"))
            {
                OG_Common.TrySpawnThingAt(OG_Util.ForceFieldGeneratorDef, null, northWestOrigin + new IntVec3(2, 0, 1).RotatedBy(rotation), true, new Rot4(Rot4.North.AsInt + rotation.AsInt), ref outpostData);
            }

            // Generate central sandbag.
            cell = rotatedOrigin + new IntVec3(5, 0, 7).RotatedBy(rotation);
            Find.TerrainGrid.SetTerrain(cell, TerrainDefOf.Concrete);
            OG_Common.TrySpawnThingAt(ThingDefOf.Sandbags, null, cell, false, Rot4.Invalid, ref outpostData);

            // Generate north east force field.
            IntVec3 northEastOrigin = rotatedOrigin + new IntVec3(6, 0, 6).RotatedBy(rotation);

            for (int xOffset = 0; xOffset < 5; xOffset++)
            {
                for (int zOffset = 0; zOffset < 2; zOffset++)
                {
                    Find.TerrainGrid.SetTerrain(northEastOrigin + new IntVec3(xOffset, 0, zOffset).RotatedBy(rotation), TerrainDefOf.Concrete);
                }
            }
            for (int xOffset = 1; xOffset <= 3; xOffset++)
            {
                Find.TerrainGrid.SetTerrain(northEastOrigin + new IntVec3(xOffset, 0, 2).RotatedBy(rotation), TerrainDefOf.Concrete);
            }
            OG_Common.TrySpawnThingAt(ThingDefOf.Sandbags, null, northEastOrigin + new IntVec3(0, 0, 1).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDefOf.Sandbags, null, northEastOrigin + new IntVec3(1, 0, 1).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDefOf.Sandbags, null, northEastOrigin + new IntVec3(1, 0, 2).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDefOf.Sandbags, null, northEastOrigin + new IntVec3(2, 0, 2).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDefOf.Sandbags, null, northEastOrigin + new IntVec3(3, 0, 2).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDefOf.Sandbags, null, northEastOrigin + new IntVec3(3, 0, 1).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDefOf.Sandbags, null, northEastOrigin + new IntVec3(4, 0, 1).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData);
            for (int zOffset = -3; zOffset <= 3; zOffset++)
            {
                if ((zOffset == 1) &&
                    OG_Util.IsModActive("MiningCo. ForceField"))
                {
                    // Do not spawn power conduit under force field as it generates a warning message.
                    continue;
                }
                OG_Common.SpawnFireproofPowerConduitAt(northEastOrigin + new IntVec3(2, 0, zOffset).RotatedBy(rotation), ref outpostData);
            }
            if (OG_Util.IsModActive("MiningCo. ForceField"))
            {
                OG_Common.TrySpawnThingAt(OG_Util.ForceFieldGeneratorDef, null, northEastOrigin + new IntVec3(2, 0, 1).RotatedBy(rotation), true, new Rot4(Rot4.North.AsInt + rotation.AsInt), ref outpostData);
            }
        }
Ejemplo n.º 9
0
        public static void GenerateMortarZone(IntVec3 areaSouthWestOrigin, int zoneAbs, int zoneOrd, Rot4 rotation, ref OG_OutpostData outpostData)
        {
            IntVec3 origin        = Zone.GetZoneOrigin(areaSouthWestOrigin, zoneAbs, zoneOrd);
            IntVec3 rotatedOrigin = Zone.GetZoneRotatedOrigin(areaSouthWestOrigin, zoneAbs, zoneOrd, rotation);

            // Spawn floor.
            for (int xOffset = 0; xOffset <= 10; xOffset++)
            {
                for (int zOffset = 0; zOffset <= 10; zOffset++)
                {
                    Find.TerrainGrid.SetTerrain(rotatedOrigin + new IntVec3(xOffset, 0, zOffset).RotatedBy(rotation), TerrainDefOf.Concrete);
                }
            }
            OG_Common.GenerateHorizontalAndVerticalPavedAlleys(origin);
            for (int xOffset = 7; xOffset <= 9; xOffset++)
            {
                for (int zOffset = 1; zOffset <= 3; zOffset++)
                {
                    Find.TerrainGrid.SetTerrain(rotatedOrigin + new IntVec3(xOffset, 0, zOffset).RotatedBy(rotation), TerrainDef.Named("MetalTile"));
                }
            }
            for (int xOffset = 6; xOffset <= 9; xOffset++)
            {
                Find.TerrainGrid.SetTerrain(rotatedOrigin + new IntVec3(xOffset, 0, 2).RotatedBy(rotation), TerrainDef.Named("PavedTile"));
            }

            // Spawn sandbags.
            for (int xOffset = 0; xOffset <= 4; xOffset++)
            {
                OG_Common.TrySpawnThingAt(ThingDefOf.Sandbags, null, rotatedOrigin + new IntVec3(xOffset, 0, 0).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData);
                OG_Common.TrySpawnThingAt(ThingDefOf.Sandbags, null, rotatedOrigin + new IntVec3(xOffset, 0, 10).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData);
            }
            for (int xOffset = 6; xOffset <= 10; xOffset++)
            {
                OG_Common.TrySpawnThingAt(ThingDefOf.Sandbags, null, rotatedOrigin + new IntVec3(xOffset, 0, 10).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData);
            }
            for (int zOffset = 0; zOffset <= 4; zOffset++)
            {
                OG_Common.TrySpawnThingAt(ThingDefOf.Sandbags, null, rotatedOrigin + new IntVec3(0, 0, zOffset).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData);
            }
            for (int zOffset = 6; zOffset <= 10; zOffset++)
            {
                OG_Common.TrySpawnThingAt(ThingDefOf.Sandbags, null, rotatedOrigin + new IntVec3(0, 0, zOffset).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData);
                OG_Common.TrySpawnThingAt(ThingDefOf.Sandbags, null, rotatedOrigin + new IntVec3(10, 0, zOffset).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData);
            }

            // Spawn mortars.
            OG_Common.TrySpawnThingAt(ThingDef.Named("Turret_MortarBomb"), ThingDefOf.Steel, rotatedOrigin + new IntVec3(3, 0, 3).RotatedBy(rotation), true, new Rot4(Rot4.South.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("Turret_MortarBomb"), ThingDefOf.Steel, rotatedOrigin + new IntVec3(2, 0, 7).RotatedBy(rotation), true, new Rot4(Rot4.North.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("Turret_MortarBomb"), ThingDefOf.Steel, rotatedOrigin + new IntVec3(7, 0, 7).RotatedBy(rotation), true, new Rot4(Rot4.North.AsInt + rotation.AsInt), ref outpostData);

            // Generate ammunition stockpile.
            for (int xOffset = 6; xOffset <= 10; xOffset++)
            {
                OG_Common.TrySpawnWallAt(rotatedOrigin + new IntVec3(xOffset, 0, 0).RotatedBy(rotation), ref outpostData);
                OG_Common.TrySpawnWallAt(rotatedOrigin + new IntVec3(xOffset, 0, 4).RotatedBy(rotation), ref outpostData);
            }
            for (int zOffset = 0; zOffset <= 4; zOffset++)
            {
                OG_Common.TrySpawnWallAt(rotatedOrigin + new IntVec3(6, 0, zOffset).RotatedBy(rotation), ref outpostData);
                OG_Common.TrySpawnWallAt(rotatedOrigin + new IntVec3(10, 0, zOffset).RotatedBy(rotation), ref outpostData);
            }
            for (int xOffset = 6; xOffset <= 10; xOffset++)
            {
                for (int zOffset = 0; zOffset <= 4; zOffset++)
                {
                    Find.RoofGrid.SetRoof(rotatedOrigin + new IntVec3(10, 0, zOffset).RotatedBy(rotation), OG_Util.IronedRoofDef);
                }
            }
            OG_Common.SpawnDoorAt(rotatedOrigin + new IntVec3(6, 0, 2).RotatedBy(rotation), ref outpostData);
            Building_Storage rack = OG_Common.TrySpawnThingAt(ThingDefOf.EquipmentRack, ThingDefOf.Steel, rotatedOrigin + new IntVec3(9, 0, 3).RotatedBy(rotation), true, new Rot4(Rot4.South.AsInt + rotation.AsInt), ref outpostData) as Building_Storage;

            foreach (IntVec3 cell in rack.OccupiedRect().Cells)
            {
                OG_Common.SpawnResourceAt(ThingDefOf.ArtilleryShell, ThingDefOf.ArtilleryShell.stackLimit, cell, true);
            }
            rack.GetStoreSettings().filter.SetDisallowAll();
            rack.GetStoreSettings().filter.SetAllow(ThingDefOf.ArtilleryShell, true);
            rack.GetStoreSettings().Priority = StoragePriority.Critical;
            rack = OG_Common.TrySpawnThingAt(ThingDefOf.EquipmentRack, ThingDefOf.Steel, rotatedOrigin + new IntVec3(8, 0, 1).RotatedBy(rotation), true, new Rot4(Rot4.North.AsInt + rotation.AsInt), ref outpostData) as Building_Storage;
            foreach (IntVec3 cell in rack.OccupiedRect().Cells)
            {
                OG_Common.SpawnResourceAt(ThingDefOf.ArtilleryShell, ThingDefOf.ArtilleryShell.stackLimit, cell, true);
            }
            rack.GetStoreSettings().filter.SetDisallowAll();
            rack.GetStoreSettings().filter.SetAllow(ThingDefOf.ArtilleryShell, true);
            rack.GetStoreSettings().Priority = StoragePriority.Critical;

            OG_Common.GenerateHorizontalAndVerticalPavedAlleys(origin);
        }