Пример #1
0
        public static void GenerateSmallRoomWeaponRoom(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(smallRoomWallOffset, 0, smallRoomWallOffset).RotatedBy(rotation), Genstep_GenerateOutpost.zoneSideSize - 2 * smallRoomWallOffset, Genstep_GenerateOutpost.zoneSideSize - 2 * smallRoomWallOffset, rotation, TerrainDefOf.Concrete, TerrainDef.Named("MetalTile"), ref outpostData);

            // Spawn weapon racks, weapons and lamps.
            Building_Storage rack = OG_Common.TrySpawnThingAt(ThingDefOf.EquipmentRack, ThingDefOf.Steel, rotatedOrigin + new IntVec3(smallRoomWallOffset + 1, 0, smallRoomWallOffset + 1).RotatedBy(rotation), true, new Rot4(Rot4.North.AsInt + rotation.AsInt), ref outpostData) as Building_Storage;

            TrySpawnWeaponOnRack(rack);
            rack.GetStoreSettings().filter.SetAllow(ThingCategoryDef.Named("WeaponsMelee"), false);
            rack.GetStoreSettings().Priority = StoragePriority.Critical;
            rack = OG_Common.TrySpawnThingAt(ThingDefOf.EquipmentRack, ThingDefOf.Steel, rotatedOrigin + new IntVec3(smallRoomWallOffset + 4, 0, smallRoomWallOffset + 1).RotatedBy(rotation), true, new Rot4(Rot4.North.AsInt + rotation.AsInt), ref outpostData) as Building_Storage;
            TrySpawnWeaponOnRack(rack);
            rack.GetStoreSettings().filter.SetAllow(ThingCategoryDef.Named("WeaponsMelee"), false);
            rack.GetStoreSettings().Priority = StoragePriority.Critical;
            rack = OG_Common.TrySpawnThingAt(ThingDefOf.EquipmentRack, ThingDefOf.Steel, rotatedOrigin + new IntVec3(smallRoomWallOffset + 2, 0, smallRoomWallOffset + 5).RotatedBy(rotation), true, new Rot4(Rot4.South.AsInt + rotation.AsInt), ref outpostData) as Building_Storage;
            TrySpawnWeaponOnRack(rack);
            rack.GetStoreSettings().filter.SetAllow(ThingCategoryDef.Named("WeaponsMelee"), false);
            rack.GetStoreSettings().Priority = StoragePriority.Critical;
            rack = OG_Common.TrySpawnThingAt(ThingDefOf.EquipmentRack, ThingDefOf.Steel, rotatedOrigin + new IntVec3(smallRoomWallOffset + 5, 0, smallRoomWallOffset + 5).RotatedBy(rotation), true, new Rot4(Rot4.South.AsInt + rotation.AsInt), ref outpostData) as Building_Storage;
            TrySpawnWeaponOnRack(rack);
            rack.GetStoreSettings().filter.SetAllow(ThingCategoryDef.Named("WeaponsMelee"), false);
            rack.GetStoreSettings().Priority = StoragePriority.Critical;
            OG_Common.TrySpawnLampAt(rotatedOrigin + new IntVec3(smallRoomWallOffset + 1, 0, smallRoomWallOffset + 3).RotatedBy(rotation), Color.white, ref outpostData);
            OG_Common.TrySpawnLampAt(rotatedOrigin + new IntVec3(smallRoomWallOffset + 5, 0, smallRoomWallOffset + 3).RotatedBy(rotation), Color.white, ref outpostData);
            // Spawn vertical alley and door.
            for (int zOffset = smallRoomWallOffset; zOffset <= Genstep_GenerateOutpost.zoneSideSize - smallRoomWallOffset; zOffset++)
            {
                Find.TerrainGrid.SetTerrain(rotatedOrigin + new IntVec3(Genstep_GenerateOutpost.zoneSideCenterOffset, 0, zOffset).RotatedBy(rotation), TerrainDef.Named("PavedTile"));
            }
            OG_Common.SpawnDoorAt(rotatedOrigin + new IntVec3(Genstep_GenerateOutpost.zoneSideCenterOffset, 0, Genstep_GenerateOutpost.zoneSideSize - smallRoomWallOffset - 1).RotatedBy(rotation), ref outpostData);
        }
Пример #2
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);
            }
        }
Пример #3
0
        public static void TrySpawnLampAt(IntVec3 position, Color color, ref OG_OutpostData outpostData)
        {
            if (position.GetEdifice() != null)
            {
                return;
            }
            ThingDef lampDef = null;

            if (color == Color.red)
            {
                lampDef = ThingDef.Named("StandingLamp_Red");
            }
            else if (color == Color.green)
            {
                lampDef = ThingDef.Named("StandingLamp_Green");
            }
            else if (color == Color.blue)
            {
                lampDef = ThingDef.Named("StandingLamp_Blue");
            }
            else
            {
                lampDef = ThingDef.Named("StandingLamp");
            }
            OG_Common.TrySpawnThingAt(lampDef, null, position, false, Rot4.North, ref outpostData, true, false);
            Find.TerrainGrid.SetTerrain(position, TerrainDef.Named("MetalTile"));
        }
Пример #4
0
        public static void GenerateMediumRoomWarehouse(IntVec3 areaSouthWestOrigin, int zoneAbs, int zoneOrd, Rot4 rotation, ref OG_OutpostData outpostData)
        {
            const int stockWidth  = 3;
            const int stockHeight = 3;

            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, null, ref outpostData);

            // Spawn metal stock and lamp.
            OG_Common.TrySpawnResourceStock(rotatedOrigin + new IntVec3(2, 0, 2).RotatedBy(rotation), rotation, ThingDefOf.Steel, stockWidth, stockHeight, 0.6f, 10, 55);
            OG_Common.TrySpawnLampAt(rotatedOrigin + new IntVec3(2, 0, 2).RotatedBy(rotation), Color.white, ref outpostData);
            // Spawn wood stock and lamp.
            OG_Common.TrySpawnResourceStock(rotatedOrigin + new IntVec3(6, 0, 2).RotatedBy(rotation), rotation, ThingDefOf.WoodLog, stockWidth, stockHeight, 0.8f, 20, 75);
            OG_Common.TrySpawnLampAt(rotatedOrigin + new IntVec3(8, 0, 2).RotatedBy(rotation), Color.white, ref outpostData);
            // Spawn gold stock and lamp.
            OG_Common.TrySpawnResourceStock(rotatedOrigin + new IntVec3(2, 0, 6).RotatedBy(rotation), rotation, ThingDefOf.Gold, stockWidth, stockHeight, 0.3f, 2, 25);
            OG_Common.TrySpawnLampAt(rotatedOrigin + new IntVec3(2, 0, 8).RotatedBy(rotation), Color.white, ref outpostData);
            // Spawn plasteel stock and lamp.
            OG_Common.TrySpawnResourceStock(rotatedOrigin + new IntVec3(6, 0, 6).RotatedBy(rotation), rotation, ThingDefOf.Plasteel, stockWidth, stockHeight, 0.5f, 5, 35);
            OG_Common.TrySpawnLampAt(rotatedOrigin + new IntVec3(8, 0, 8).RotatedBy(rotation), Color.white, ref outpostData);

            // Spawn vertical and horizontal alley and doors.
            for (int xOffset = 2; xOffset <= 8; xOffset++)
            {
                Find.TerrainGrid.SetTerrain(rotatedOrigin + new IntVec3(xOffset, 0, 5).RotatedBy(rotation), TerrainDef.Named("PavedTile"));
            }
            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);
        }
Пример #5
0
        public static void TrySpawnHeaterAt(IntVec3 position, ref OG_OutpostData outpostData)
        {
            ThingDef heaterDef = ThingDef.Named("Heater");

            OG_Common.TrySpawnThingAt(heaterDef, null, position, false, Rot4.North, ref outpostData);
            Find.TerrainGrid.SetTerrain(position, TerrainDef.Named("MetalTile"));
        }
Пример #6
0
        public static Building_Cooler SpawnCoolerAt(IntVec3 position, Rot4 rotation, ref OG_OutpostData outpostData)
        {
            ThingDef        coolerDef = ThingDef.Named("Cooler");
            Building_Cooler cooler    = OG_Common.TrySpawnThingAt(coolerDef, null, position, true, rotation, ref outpostData, false, true) as Building_Cooler;

            return(cooler);
        }
Пример #7
0
        public static void GenerateMediumRoomLaboratory(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, TerrainDef.Named("MetalTile"), ref outpostData);

            // Spawn research bench.
            OG_Common.TrySpawnThingAt(ThingDef.Named("HiTechResearchBench"), ThingDefOf.Steel, rotatedOrigin + new IntVec3(7, 0, 5).RotatedBy(rotation), true, new Rot4(Rot4.West.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("DiningChair"), ThingDefOf.Steel, rotatedOrigin + new IntVec3(8, 0, 5).RotatedBy(rotation), true, new Rot4(Rot4.West.AsInt + rotation.AsInt), ref outpostData);

            // Spawn tool cabinet and uranium.
            OG_Common.TrySpawnThingAt(ThingDef.Named("ToolCabinet"), null, rotatedOrigin + new IntVec3(2, 0, 8).RotatedBy(rotation), true, new Rot4(Rot4.North.AsInt + rotation.AsInt), ref outpostData);
            IntVec3 studyObjectPosition = rotatedOrigin + new IntVec3(3, 0, 5).RotatedBy(rotation);

            Find.TerrainGrid.SetTerrain(studyObjectPosition, TerrainDef.Named("SterileTile"));
            OG_Common.SpawnResourceAt(ThingDef.Named("Uranium"), Rand.RangeInclusive(5, 18), studyObjectPosition, true);

            // Spawn lamps, heater and coolers.
            OG_Common.TrySpawnLampAt(rotatedOrigin + new IntVec3(3, 0, 3).RotatedBy(rotation), Color.blue, ref outpostData);
            OG_Common.TrySpawnHeaterAt(rotatedOrigin + new IntVec3(4, 0, 8).RotatedBy(rotation), ref outpostData);
            OG_Common.SpawnCoolerAt(rotatedOrigin + new IntVec3(1, 0, 5).RotatedBy(rotation), new Rot4(Rot4.West.AsInt + rotation.AsInt), ref outpostData);

            // 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);
        }
Пример #8
0
        public static void GenerateMediumRoomPrison(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(0, 0, 1).RotatedBy(rotation), 5, 9, rotation, TerrainDefOf.Concrete, null, ref outpostData);
            OG_Common.GenerateEmptyRoomAt(rotatedOrigin + new IntVec3(4, 0, 1).RotatedBy(rotation), 3, 9, rotation, TerrainDefOf.Concrete, null, ref outpostData);
            OG_Common.GenerateEmptyRoomAt(rotatedOrigin + new IntVec3(6, 0, 1).RotatedBy(rotation), 5, 9, rotation, TerrainDefOf.Concrete, null, ref outpostData);

            // Spawn prisoner beds.
            OG_Common.TrySpawnThingAt(ThingDef.Named("Bed"), ThingDefOf.Steel, rotatedOrigin + new IntVec3(1, 0, 8).RotatedBy(rotation), true, new Rot4(Rot4.South.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("Stool"), ThingDefOf.Steel, rotatedOrigin + new IntVec3(2, 0, 8).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, 8).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, 2).RotatedBy(rotation), true, new Rot4(Rot4.North.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("Stool"), ThingDefOf.Steel, rotatedOrigin + new IntVec3(8, 0, 2).RotatedBy(rotation), true, new Rot4(Rot4.North.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("Bed"), ThingDefOf.Steel, rotatedOrigin + new IntVec3(9, 0, 2).RotatedBy(rotation), true, new Rot4(Rot4.North.AsInt + rotation.AsInt), ref outpostData);

            // Spawn lamps, heaters and coolers.
            OG_Common.TrySpawnLampAt(rotatedOrigin + new IntVec3(3, 0, 2).RotatedBy(rotation), Color.white, ref outpostData);
            OG_Common.TrySpawnLampAt(rotatedOrigin + new IntVec3(7, 0, 8).RotatedBy(rotation), Color.white, ref outpostData);
            OG_Common.TrySpawnHeaterAt(rotatedOrigin + new IntVec3(1, 0, 2).RotatedBy(rotation), ref outpostData);
            OG_Common.TrySpawnHeaterAt(rotatedOrigin + new IntVec3(9, 0, 8).RotatedBy(rotation), ref outpostData);
            OG_Common.SpawnCoolerAt(rotatedOrigin + new IntVec3(0, 0, 2).RotatedBy(rotation), new Rot4(Rot4.West.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.SpawnCoolerAt(rotatedOrigin + new IntVec3(10, 0, 8).RotatedBy(rotation), new Rot4(Rot4.East.AsInt + rotation.AsInt), ref outpostData);

            // Spawn vertical alley and door.
            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(4, 0, 3).RotatedBy(rotation), ref outpostData);
            OG_Common.SpawnDoorAt(rotatedOrigin + new IntVec3(6, 0, 7).RotatedBy(rotation), ref outpostData);
            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);
        }
Пример #9
0
        static void GenerateOutpostLayoutMainRoom()
        {
            ZoneType mainRoomType     = OG_Common.GetRandomZoneTypeBigRoom(outpostData);
            Rot4     mainRoomRotation = Rot4.Random;

            zoneMap[mainRoomZoneOrd, mainRoomZoneAbs] = new ZoneProperties(mainRoomType, mainRoomRotation, Rot4.North);
        }
Пример #10
0
        public static void GenerateStraightAlleyZone(IntVec3 areaSouthWestOrigin, int zoneAbs, int zoneOrd, Rot4 rotation, ref OG_OutpostData outpostData)
        {
            IntVec3 rotatedOrigin = Zone.GetZoneRotatedOrigin(areaSouthWestOrigin, zoneAbs, zoneOrd, rotation);

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

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

            // Generate concrete border and power conduit.
            for (int zOffset = 0; zOffset <= 10; zOffset++)
            {
                IntVec3 cell = rotatedOrigin + new IntVec3(4, 0, zOffset).RotatedBy(rotation);
                OG_Common.SpawnFireproofPowerConduitAt(cell, ref outpostData);
                Find.TerrainGrid.SetTerrain(cell, TerrainDefOf.Concrete);

                cell = rotatedOrigin + new IntVec3(6, 0, zOffset).RotatedBy(rotation);
                OG_Common.SpawnFireproofPowerConduitAt(cell, ref outpostData);
                Find.TerrainGrid.SetTerrain(cell, TerrainDefOf.Concrete);
            }
        }
Пример #11
0
        public static void GenerateSamSiteZone(IntVec3 areaSouthWestOrigin, int zoneAbs, int zoneOrd, ref OG_OutpostData outpostData)
        {
            IntVec3 origin = Zone.GetZoneOrigin(areaSouthWestOrigin, zoneAbs, zoneOrd);

            // Spawn SAM site surrounded by sandbags.
            IntVec3 samSitePosition = origin + new IntVec3(Genstep_GenerateOutpost.zoneSideCenterOffset, 0, Genstep_GenerateOutpost.zoneSideCenterOffset);

            OG_Common.TrySpawnThingAt(OG_Util.SamSiteDef, null, samSitePosition, false, Rot4.Invalid, ref outpostData);
            CellRect sandbagRect = new CellRect(origin.x + 3, origin.z + 3, 5, 5);

            foreach (IntVec3 cell in sandbagRect.Cells)
            {
                if ((cell.x == sandbagRect.minX) || (cell.x == sandbagRect.maxX) || (cell.z == sandbagRect.minZ) || (cell.z == sandbagRect.maxZ))
                {
                    OG_Common.TrySpawnThingAt(ThingDefOf.Sandbags, null, cell, false, Rot4.Invalid, ref outpostData);
                }
            }
            for (int rotationAsInt = Rot4.North.AsInt; rotationAsInt <= Rot4.West.AsInt; rotationAsInt++)
            {
                IntVec3 sandbagPosition = samSitePosition + new IntVec3(0, 0, 3).RotatedBy(new Rot4(rotationAsInt));
                OG_Common.TrySpawnThingAt(ThingDefOf.Sandbags, null, sandbagPosition, false, Rot4.Invalid, ref outpostData);
                foreach (IntVec3 cell in GenAdj.CellsAdjacent8Way(sandbagPosition))
                {
                    Find.TerrainGrid.SetTerrain(cell, TerrainDefOf.Concrete);
                }
            }

            // Generate concrete ground.
            CellRect concreteRect = new CellRect(origin.x + 2, origin.z + 2, 7, 7);

            foreach (IntVec3 cell in concreteRect.Cells)
            {
                Find.TerrainGrid.SetTerrain(cell, TerrainDefOf.Concrete);
            }
        }
Пример #12
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);
        }
Пример #13
0
        public static void GenerateLandingPadBottom(IntVec3 areaSouthWestOrigin, int zoneAbs, int zoneOrd, Rot4 rotation, ref OG_OutpostData outpostData)
        {
            TerrainDef c  = TerrainDefOf.Concrete;
            TerrainDef mt = TerrainDef.Named("MetalTile");
            TerrainDef pt = TerrainDef.Named("PavedTile");

            TerrainDef[,] landingPadBottomPattern = new TerrainDef[11, 11]
            {
                { null, null, null, null, null, null, null, null, null, null, null },
                { null, null, c, c, c, c, c, c, c, null, null },
                { null, null, c, mt, mt, mt, mt, mt, c, null, null },
                { null, c, c, mt, c, c, c, mt, c, c, null },
                { null, c, mt, mt, c, c, c, mt, mt, c, null },
                { pt, pt, mt, c, c, c, c, c, mt, pt, pt },
                { null, c, mt, mt, c, c, c, mt, mt, c, null },
                { c, c, mt, c, c, c, c, c, mt, c, c },
                { c, mt, mt, c, c, c, c, c, mt, mt, c },
                { c, mt, c, c, c, c, c, c, c, mt, c },
                { c, mt, c, c, c, c, c, c, c, mt, c }
            };

            IntVec3 rotatedOrigin = Zone.GetZoneRotatedOrigin(areaSouthWestOrigin, zoneAbs, zoneOrd, rotation);

            // Spawn floor.
            for (int xOffset = 0; xOffset <= 10; xOffset++)
            {
                for (int zOffset = 0; zOffset <= 10; zOffset++)
                {
                    TerrainDef terrain = landingPadBottomPattern[zOffset, xOffset];
                    if (terrain != null)
                    {
                        Find.TerrainGrid.SetTerrain(rotatedOrigin + new IntVec3(xOffset, 0, zOffset).RotatedBy(rotation), terrain);
                    }
                }
            }

            // Spawn landing pad beacons.
            Building_LandingPadBeacon beacon = OG_Common.TrySpawnThingAt(OG_Util.LandingPadBeaconDef, null, rotatedOrigin + new IntVec3(2, 0, 1).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData) as Building_LandingPadBeacon;

            beacon = OG_Common.TrySpawnThingAt(OG_Util.LandingPadBeaconDef, null, rotatedOrigin + new IntVec3(8, 0, 1).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData) as Building_LandingPadBeacon;
            beacon = OG_Common.TrySpawnThingAt(OG_Util.LandingPadBeaconDef, null, rotatedOrigin + new IntVec3(1, 0, 4).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData) as Building_LandingPadBeacon;
            beacon.SetFlashStartOffset(Building_LandingPadBeacon.flashDurationInTicks);
            beacon = OG_Common.TrySpawnThingAt(OG_Util.LandingPadBeaconDef, null, rotatedOrigin + new IntVec3(9, 0, 4).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData) as Building_LandingPadBeacon;
            beacon.SetFlashStartOffset(Building_LandingPadBeacon.flashDurationInTicks);
            beacon = OG_Common.TrySpawnThingAt(OG_Util.LandingPadBeaconDef, null, rotatedOrigin + new IntVec3(1, 0, 7).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData) as Building_LandingPadBeacon;
            beacon.SetFlashStartOffset(2 * Building_LandingPadBeacon.flashDurationInTicks);
            beacon = OG_Common.TrySpawnThingAt(OG_Util.LandingPadBeaconDef, null, rotatedOrigin + new IntVec3(9, 0, 7).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData) as Building_LandingPadBeacon;
            beacon.SetFlashStartOffset(2 * Building_LandingPadBeacon.flashDurationInTicks);
            beacon = OG_Common.TrySpawnThingAt(OG_Util.LandingPadBeaconDef, null, rotatedOrigin + new IntVec3(1, 0, 10).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData) as Building_LandingPadBeacon;
            beacon.SetFlashStartOffset(3 * Building_LandingPadBeacon.flashDurationInTicks);
            beacon = OG_Common.TrySpawnThingAt(OG_Util.LandingPadBeaconDef, null, rotatedOrigin + new IntVec3(9, 0, 10).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData) as Building_LandingPadBeacon;
            beacon.SetFlashStartOffset(3 * Building_LandingPadBeacon.flashDurationInTicks);

            outpostData.landingPadCenter   = rotatedOrigin + new IntVec3(5, 0, 10).RotatedBy(rotation);
            outpostData.landingPadRotation = rotation;
        }
Пример #14
0
        public static void GenerateMediumRoomKitchen(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, null, ref outpostData);

            // Spawn table and stools.
            OG_Common.TrySpawnThingAt(ThingDef.Named("Stool"), ThingDefOf.Steel, rotatedOrigin + new IntVec3(3, 0, 2).RotatedBy(rotation), true, new Rot4(Rot4.North.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("Stool"), ThingDefOf.Steel, rotatedOrigin + new IntVec3(2, 0, 4).RotatedBy(rotation), true, new Rot4(Rot4.East.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("TableShort"), ThingDefOf.Steel, rotatedOrigin + new IntVec3(3, 0, 3).RotatedBy(rotation), true, new Rot4(Rot4.North.AsInt + rotation.AsInt), ref outpostData);
            for (int xOffset = 2; xOffset <= 4; xOffset++)
            {
                for (int zOffset = 2; zOffset <= 5; zOffset++)
                {
                    Find.TerrainGrid.SetTerrain(rotatedOrigin + new IntVec3(xOffset, 0, zOffset).RotatedBy(rotation), TerrainDef.Named("WoodPlankFloor"));
                }
            }

            // Spawn cook stoves and brewery.
            OG_Common.TrySpawnThingAt(ThingDef.Named("ElectricStove"), null, rotatedOrigin + new IntVec3(8, 0, 3).RotatedBy(rotation), true, new Rot4(Rot4.East.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("ElectricStove"), null, rotatedOrigin + new IntVec3(8, 0, 7).RotatedBy(rotation), true, new Rot4(Rot4.East.AsInt + rotation.AsInt), ref outpostData);
            for (int xOffset = 7; xOffset <= 8; xOffset++)
            {
                for (int zOffset = 2; zOffset <= 8; zOffset++)
                {
                    Find.TerrainGrid.SetTerrain(rotatedOrigin + new IntVec3(xOffset, 0, zOffset).RotatedBy(rotation), TerrainDef.Named("SterileTile"));
                    Find.TerrainGrid.SetTerrain(rotatedOrigin + new IntVec3(xOffset, 0, zOffset + 4).RotatedBy(rotation), TerrainDef.Named("SterileTile"));
                }
            }
            OG_Common.TrySpawnThingAt(ThingDef.Named("Brewery"), null, rotatedOrigin + new IntVec3(3, 0, 8).RotatedBy(rotation), true, new Rot4(Rot4.North.AsInt + rotation.AsInt), ref outpostData);
            for (int xOffset = 2; xOffset <= 4; xOffset++)
            {
                for (int zOffset = 7; zOffset <= 8; zOffset++)
                {
                    Find.TerrainGrid.SetTerrain(rotatedOrigin + new IntVec3(xOffset, 0, zOffset).RotatedBy(rotation), TerrainDef.Named("SterileTile"));
                }
            }

            // Spawn lamps, heater and coolers.
            OG_Common.TrySpawnLampAt(rotatedOrigin + new IntVec3(2, 0, 5).RotatedBy(rotation), Color.white, ref outpostData);
            OG_Common.TrySpawnLampAt(rotatedOrigin + new IntVec3(8, 0, 5).RotatedBy(rotation), Color.white, ref outpostData);
            OG_Common.TrySpawnHeaterAt(rotatedOrigin + new IntVec3(2, 0, 2).RotatedBy(rotation), ref outpostData);
            OG_Common.SpawnCoolerAt(rotatedOrigin + new IntVec3(9, 0, 4).RotatedBy(rotation), new Rot4(Rot4.East.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.SpawnCoolerAt(rotatedOrigin + new IntVec3(9, 0, 6).RotatedBy(rotation), new Rot4(Rot4.East.AsInt + rotation.AsInt), ref outpostData);

            // 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);
        }
Пример #15
0
        private static void SpawnLaserFenceTwoPylons(IntVec3 laserFenceLeftOrigin, Rot4 rotation, int distanceBetweenPylons, ref OG_OutpostData outpostData)
        {
            OG_Common.TrySpawnLaserFencePylonAt(laserFenceLeftOrigin, ref outpostData);
            OG_Common.TrySpawnLaserFencePylonAt(laserFenceLeftOrigin + new IntVec3(0, 0, distanceBetweenPylons + 1).RotatedBy(rotation), ref outpostData);

            for (int zOffset = 0; zOffset <= 5; zOffset++)
            {
                IntVec3 position = laserFenceLeftOrigin + new IntVec3(0, 0, zOffset).RotatedBy(rotation);
                OG_Common.SpawnFireproofPowerConduitAt(position, ref outpostData);
                Find.TerrainGrid.SetTerrain(position, TerrainDefOf.Concrete);
            }
        }
Пример #16
0
        public static void GenerateMediumRoomRecRoom(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, TerrainDef.Named("WoodPlankFloor"), ref outpostData);

            // Spawn billiard table, chess table and chairs.
            OG_Common.TrySpawnThingAt(ThingDef.Named("BilliardsTable"), ThingDefOf.WoodLog, rotatedOrigin + new IntVec3(3, 0, 6).RotatedBy(rotation), true, new Rot4(Rot4.North.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("ChessTable"), ThingDefOf.WoodLog, rotatedOrigin + new IntVec3(3, 0, 2).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("DiningChair"), ThingDefOf.Steel, rotatedOrigin + new IntVec3(2, 0, 2).RotatedBy(rotation), true, new Rot4(Rot4.East.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("DiningChair"), ThingDefOf.Steel, rotatedOrigin + new IntVec3(4, 0, 2).RotatedBy(rotation), true, new Rot4(Rot4.West.AsInt + rotation.AsInt), ref outpostData);
            for (int xOffset = 2; xOffset <= 4; xOffset++)
            {
                for (int zOffset = 4; zOffset <= 8; zOffset++)
                {
                    Find.TerrainGrid.SetTerrain(rotatedOrigin + new IntVec3(xOffset, 0, zOffset).RotatedBy(rotation), TerrainDef.Named("CarpetGreen"));
                }
            }

            // Spawn television and armchairs.
            OG_Common.TrySpawnThingAt(ThingDef.Named("MegascreenTelevision"), null, rotatedOrigin + new IntVec3(7, 0, 8).RotatedBy(rotation), true, new Rot4(Rot4.South.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("Armchair"), ThingDef.Named("Cloth"), rotatedOrigin + new IntVec3(6, 0, 4).RotatedBy(rotation), true, new Rot4(Rot4.North.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("Armchair"), ThingDef.Named("Cloth"), rotatedOrigin + new IntVec3(7, 0, 4).RotatedBy(rotation), true, new Rot4(Rot4.North.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("Armchair"), ThingDef.Named("Cloth"), rotatedOrigin + new IntVec3(8, 0, 4).RotatedBy(rotation), true, new Rot4(Rot4.North.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("Armchair"), ThingDef.Named("Cloth"), rotatedOrigin + new IntVec3(6, 0, 6).RotatedBy(rotation), true, new Rot4(Rot4.North.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("Armchair"), ThingDef.Named("Cloth"), rotatedOrigin + new IntVec3(7, 0, 6).RotatedBy(rotation), true, new Rot4(Rot4.North.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("Armchair"), ThingDef.Named("Cloth"), rotatedOrigin + new IntVec3(8, 0, 6).RotatedBy(rotation), true, new Rot4(Rot4.North.AsInt + rotation.AsInt), ref outpostData);
            for (int xOffset = 6; xOffset <= 8; xOffset++)
            {
                for (int zOffset = 4; zOffset <= 8; zOffset++)
                {
                    Find.TerrainGrid.SetTerrain(rotatedOrigin + new IntVec3(xOffset, 0, zOffset).RotatedBy(rotation), TerrainDef.Named("CarpetDark"));
                }
            }

            // Spawn lamps, heater and coolers.
            OG_Common.TrySpawnLampAt(rotatedOrigin + new IntVec3(2, 0, 8).RotatedBy(rotation), Color.white, ref outpostData);
            OG_Common.TrySpawnLampAt(rotatedOrigin + new IntVec3(8, 0, 2).RotatedBy(rotation), Color.white, ref outpostData);
            OG_Common.TrySpawnHeaterAt(rotatedOrigin + new IntVec3(7, 0, 2).RotatedBy(rotation), ref outpostData);
            OG_Common.TrySpawnHeaterAt(rotatedOrigin + new IntVec3(8, 0, 3).RotatedBy(rotation), ref outpostData);
            OG_Common.SpawnCoolerAt(rotatedOrigin + new IntVec3(7, 0, 1).RotatedBy(rotation), new Rot4(Rot4.South.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.SpawnCoolerAt(rotatedOrigin + new IntVec3(3, 0, 9).RotatedBy(rotation), new Rot4(Rot4.North.AsInt + rotation.AsInt), ref outpostData);

            // 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);
        }
Пример #17
0
        public static void GenerateMediumRoomWeaponRoom(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, null, ref outpostData);

            // Spawn weapon racks, weapons and lamps.
            Building_Storage rack = OG_Common.TrySpawnThingAt(ThingDefOf.EquipmentRack, ThingDefOf.Steel, rotatedOrigin + new IntVec3(3, 0, 2).RotatedBy(rotation), true, new Rot4(Rot4.North.AsInt + rotation.AsInt), ref outpostData) as Building_Storage;

            OG_Common.TrySpawnWeaponOnRack(rack);
            rack.GetStoreSettings().filter.SetAllow(ThingCategoryDef.Named("WeaponsMelee"), false);
            rack.GetStoreSettings().Priority = StoragePriority.Critical;
            rack = OG_Common.TrySpawnThingAt(ThingDefOf.EquipmentRack, ThingDefOf.Steel, rotatedOrigin + new IntVec3(6, 0, 2).RotatedBy(rotation), true, new Rot4(Rot4.North.AsInt + rotation.AsInt), ref outpostData) as Building_Storage;
            OG_Common.TrySpawnWeaponOnRack(rack);
            rack.GetStoreSettings().filter.SetAllow(ThingCategoryDef.Named("WeaponsMelee"), false);
            rack.GetStoreSettings().Priority = StoragePriority.Critical;
            rack = OG_Common.TrySpawnThingAt(ThingDefOf.EquipmentRack, ThingDefOf.Steel, rotatedOrigin + new IntVec3(2, 0, 7).RotatedBy(rotation), true, new Rot4(Rot4.East.AsInt + rotation.AsInt), ref outpostData) as Building_Storage;
            OG_Common.TrySpawnWeaponOnRack(rack);
            rack.GetStoreSettings().filter.SetAllow(ThingCategoryDef.Named("WeaponsMelee"), false);
            rack.GetStoreSettings().Priority = StoragePriority.Critical;
            rack = OG_Common.TrySpawnThingAt(ThingDefOf.EquipmentRack, ThingDefOf.Steel, rotatedOrigin + new IntVec3(2, 0, 4).RotatedBy(rotation), true, new Rot4(Rot4.East.AsInt + rotation.AsInt), ref outpostData) as Building_Storage;
            OG_Common.TrySpawnWeaponOnRack(rack);
            rack.GetStoreSettings().filter.SetAllow(ThingCategoryDef.Named("WeaponsMelee"), false);
            rack.GetStoreSettings().Priority = StoragePriority.Critical;
            rack = OG_Common.TrySpawnThingAt(ThingDefOf.EquipmentRack, ThingDefOf.Steel, rotatedOrigin + new IntVec3(4, 0, 8).RotatedBy(rotation), true, new Rot4(Rot4.South.AsInt + rotation.AsInt), ref outpostData) as Building_Storage;
            OG_Common.TrySpawnWeaponOnRack(rack);
            rack.GetStoreSettings().filter.SetAllow(ThingCategoryDef.Named("WeaponsMelee"), false);
            rack.GetStoreSettings().Priority = StoragePriority.Critical;
            rack = OG_Common.TrySpawnThingAt(ThingDefOf.EquipmentRack, ThingDefOf.Steel, rotatedOrigin + new IntVec3(7, 0, 8).RotatedBy(rotation), true, new Rot4(Rot4.South.AsInt + rotation.AsInt), ref outpostData) as Building_Storage;
            OG_Common.TrySpawnWeaponOnRack(rack);
            rack.GetStoreSettings().filter.SetAllow(ThingCategoryDef.Named("WeaponsMelee"), false);
            rack.GetStoreSettings().Priority = StoragePriority.Critical;
            rack = OG_Common.TrySpawnThingAt(ThingDefOf.EquipmentRack, ThingDefOf.Steel, rotatedOrigin + new IntVec3(8, 0, 3).RotatedBy(rotation), true, new Rot4(Rot4.West.AsInt + rotation.AsInt), ref outpostData) as Building_Storage;
            OG_Common.TrySpawnWeaponOnRack(rack);
            rack.GetStoreSettings().filter.SetAllow(ThingCategoryDef.Named("WeaponsMelee"), false);
            rack.GetStoreSettings().Priority = StoragePriority.Critical;
            rack = OG_Common.TrySpawnThingAt(ThingDefOf.EquipmentRack, ThingDefOf.Steel, rotatedOrigin + new IntVec3(8, 0, 6).RotatedBy(rotation), true, new Rot4(Rot4.West.AsInt + rotation.AsInt), ref outpostData) as Building_Storage;
            OG_Common.TrySpawnWeaponOnRack(rack);
            rack.GetStoreSettings().filter.SetAllow(ThingCategoryDef.Named("WeaponsMelee"), false);
            rack.GetStoreSettings().Priority = StoragePriority.Critical;
            OG_Common.TrySpawnLampAt(rotatedOrigin + new IntVec3(2, 0, 5).RotatedBy(rotation), Color.red, ref outpostData);
            OG_Common.TrySpawnLampAt(rotatedOrigin + new IntVec3(8, 0, 5).RotatedBy(rotation), Color.red, ref outpostData);

            // 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);
        }
Пример #18
0
        public static void GenerateBigSasZone(IntVec3 areaSouthWestOrigin, int zoneAbs, int zoneOrd, Rot4 rotation, bool generateSecondarySas, ref OG_OutpostData outpostData)
        {
            IntVec3 rotatedOrigin = Zone.GetZoneRotatedOrigin(areaSouthWestOrigin, zoneAbs, zoneOrd, rotation);
            IntVec3 cell          = rotatedOrigin;

            OG_Common.GenerateEmptyRoomAt(rotatedOrigin + new IntVec3(3, 0, -1).RotatedBy(rotation), 5, 13, rotation, null, null, ref outpostData);

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

            // Spawn floor and roof.
            for (int xOffset = 2; xOffset <= 8; xOffset++)
            {
                for (int zOffset = 0; zOffset < 11; zOffset++)
                {
                    Find.TerrainGrid.SetTerrain(rotatedOrigin + new IntVec3(xOffset, 0, zOffset).RotatedBy(rotation), TerrainDefOf.Concrete);
                }
            }
            for (int zOffset = 0; zOffset < 11; zOffset++)
            {
                Find.TerrainGrid.SetTerrain(rotatedOrigin + new IntVec3(5, 0, zOffset).RotatedBy(rotation), TerrainDef.Named("PavedTile"));
            }

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

            // Spawn secondary sas.
            if (generateSecondarySas)
            {
                OG_Common.GenerateEmptyRoomAt(rotatedOrigin + new IntVec3(3, 0, 4).RotatedBy(rotation), 3, 6, new Rot4(rotation.AsInt + Rot4.West.AsInt), null, null, ref outpostData);

                // Spawn concrete and paved alley (don't use standard default floor as it may overlap existing medium room floor).
                for (int xOffset = -2; xOffset <= 4; xOffset++)
                {
                    for (int zOffset = 3; zOffset <= 7; zOffset++)
                    {
                        Find.TerrainGrid.SetTerrain(rotatedOrigin + new IntVec3(xOffset, 0, zOffset).RotatedBy(rotation), TerrainDefOf.Concrete);
                    }
                }
                for (int xOffset = -2; xOffset <= 4; xOffset++)
                {
                    Find.TerrainGrid.SetTerrain(rotatedOrigin + new IntVec3(xOffset, 0, 5).RotatedBy(rotation), TerrainDef.Named("PavedTile"));
                }
                // Spawn doors.
                OG_Common.SpawnDoorAt(rotatedOrigin + new IntVec3(-2, 0, 5).RotatedBy(rotation), ref outpostData);
                OG_Common.SpawnDoorAt(rotatedOrigin + new IntVec3(3, 0, 5).RotatedBy(rotation), ref outpostData);
            }
        }
Пример #19
0
        public static void GenerateBigRoomHydroponics(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("SterileTile"), 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 sun lamp.
            OG_Common.TrySpawnThingAt(ThingDef.Named("SunLamp"), null, rotatedOrigin + new IntVec3(5, 0, 5).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData);

            // Spawn hydroponics basins.
            Building_PlantGrower hydroponics = OG_Common.TrySpawnThingAt(ThingDef.Named("HydroponicsBasin"), null, rotatedOrigin + new IntVec3(1, 0, 2).RotatedBy(rotation), true, rotation, ref outpostData) as Building_PlantGrower;

            hydroponics.SetPlantDefToGrow(ThingDef.Named("PlantStrawberry"));
            hydroponics = OG_Common.TrySpawnThingAt(ThingDef.Named("HydroponicsBasin"), null, rotatedOrigin + new IntVec3(3, 0, 2).RotatedBy(rotation), true, rotation, ref outpostData) as Building_PlantGrower;
            hydroponics.SetPlantDefToGrow(ThingDef.Named("PlantCorn"));
            hydroponics = OG_Common.TrySpawnThingAt(ThingDef.Named("HydroponicsBasin"), null, rotatedOrigin + new IntVec3(4, 0, 2).RotatedBy(rotation), true, rotation, ref outpostData) as Building_PlantGrower;
            hydroponics.SetPlantDefToGrow(ThingDef.Named("PlantCorn"));
            hydroponics = OG_Common.TrySpawnThingAt(ThingDef.Named("HydroponicsBasin"), null, rotatedOrigin + new IntVec3(6, 0, 2).RotatedBy(rotation), true, rotation, ref outpostData) as Building_PlantGrower;
            hydroponics.SetPlantDefToGrow(ThingDef.Named("PlantCorn"));
            hydroponics = OG_Common.TrySpawnThingAt(ThingDef.Named("HydroponicsBasin"), null, rotatedOrigin + new IntVec3(7, 0, 2).RotatedBy(rotation), true, rotation, ref outpostData) as Building_PlantGrower;
            hydroponics.SetPlantDefToGrow(ThingDef.Named("PlantCorn"));
            hydroponics = OG_Common.TrySpawnThingAt(ThingDef.Named("HydroponicsBasin"), null, rotatedOrigin + new IntVec3(9, 0, 2).RotatedBy(rotation), true, rotation, ref outpostData) as Building_PlantGrower;
            hydroponics.SetPlantDefToGrow(ThingDef.Named("PlantStrawberry"));

            OG_Common.TrySpawnThingAt(ThingDef.Named("HydroponicsBasin"), null, rotatedOrigin + new IntVec3(1, 0, 7).RotatedBy(rotation), true, rotation, ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("HydroponicsBasin"), null, rotatedOrigin + new IntVec3(3, 0, 7).RotatedBy(rotation), true, rotation, ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("HydroponicsBasin"), null, rotatedOrigin + new IntVec3(4, 0, 7).RotatedBy(rotation), true, rotation, ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("HydroponicsBasin"), null, rotatedOrigin + new IntVec3(6, 0, 7).RotatedBy(rotation), true, rotation, ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("HydroponicsBasin"), null, rotatedOrigin + new IntVec3(7, 0, 7).RotatedBy(rotation), true, rotation, ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("HydroponicsBasin"), null, rotatedOrigin + new IntVec3(9, 0, 7).RotatedBy(rotation), true, rotation, ref outpostData);

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

            OG_Common.GenerateHorizontalAndVerticalPavedAlleys(origin);
        }
Пример #20
0
        public static void GenerateBatteryRoomZone(IntVec3 areaSouthWestOrigin, int zoneAbs, int zoneOrd, Rot4 rotation, Rot4 linkedZoneRelativeRotation, 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(smallRoomWallOffset, 0, smallRoomWallOffset).RotatedBy(rotation), Genstep_GenerateOutpost.zoneSideSize - 2 * smallRoomWallOffset, Genstep_GenerateOutpost.zoneSideSize - 2 * smallRoomWallOffset, rotation, TerrainDefOf.Concrete, null, ref outpostData);

            // Generate batteries.
            OG_Common.TrySpawnThingAt(OG_Util.CompactAutonomousGeneratorDef, null, rotatedOrigin + new IntVec3(smallRoomWallOffset + 1, 0, smallRoomWallOffset + 1).RotatedBy(rotation), true, new Rot4(Rot4.North.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDefOf.Battery, null, rotatedOrigin + new IntVec3(smallRoomWallOffset + 4, 0, smallRoomWallOffset + 1).RotatedBy(rotation), true, new Rot4(Rot4.North.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDefOf.Battery, null, rotatedOrigin + new IntVec3(smallRoomWallOffset + 5, 0, smallRoomWallOffset + 1).RotatedBy(rotation), true, new Rot4(Rot4.North.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDefOf.Battery, null, rotatedOrigin + new IntVec3(smallRoomWallOffset + 1, 0, smallRoomWallOffset + 5).RotatedBy(rotation), true, new Rot4(Rot4.South.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDefOf.Battery, null, rotatedOrigin + new IntVec3(smallRoomWallOffset + 2, 0, smallRoomWallOffset + 5).RotatedBy(rotation), true, new Rot4(Rot4.South.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDefOf.Battery, null, rotatedOrigin + new IntVec3(smallRoomWallOffset + 4, 0, smallRoomWallOffset + 5).RotatedBy(rotation), true, new Rot4(Rot4.South.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDefOf.Battery, null, rotatedOrigin + new IntVec3(smallRoomWallOffset + 5, 0, smallRoomWallOffset + 5).RotatedBy(rotation), true, new Rot4(Rot4.South.AsInt + rotation.AsInt), ref outpostData);
            // Generate vertical alley and door.
            for (int zOffset = smallRoomWallOffset; zOffset <= Genstep_GenerateOutpost.zoneSideSize - smallRoomWallOffset; zOffset++)
            {
                Find.TerrainGrid.SetTerrain(rotatedOrigin + new IntVec3(Genstep_GenerateOutpost.zoneSideCenterOffset, 0, zOffset).RotatedBy(rotation), TerrainDef.Named("PavedTile"));
            }
            OG_Common.SpawnDoorAt(rotatedOrigin + new IntVec3(Genstep_GenerateOutpost.zoneSideCenterOffset, 0, Genstep_GenerateOutpost.zoneSideSize - smallRoomWallOffset - 1).RotatedBy(rotation), ref outpostData);
            // Generate horizontal alley, door, lamp and power conduits.
            if (linkedZoneRelativeRotation == Rot4.West)
            {
                for (int xOffset = smallRoomWallOffset - 1; xOffset <= Genstep_GenerateOutpost.zoneSideCenterOffset; xOffset++)
                {
                    Find.TerrainGrid.SetTerrain(rotatedOrigin + new IntVec3(xOffset, 0, Genstep_GenerateOutpost.zoneSideCenterOffset).RotatedBy(rotation), TerrainDef.Named("PavedTile"));
                }
                OG_Common.SpawnDoorAt(rotatedOrigin + new IntVec3(smallRoomWallOffset, 0, Genstep_GenerateOutpost.zoneSideCenterOffset).RotatedBy(rotation), ref outpostData);
                OG_Common.TrySpawnLampAt(rotatedOrigin + new IntVec3(smallRoomWallOffset + 5, 0, smallRoomWallOffset + 3).RotatedBy(rotation), Color.red, ref outpostData);
                for (int xOffset = 0; xOffset <= 1; xOffset++)
                {
                    OG_Common.SpawnFireproofPowerConduitAt(rotatedOrigin + new IntVec3(xOffset, 0, Genstep_GenerateOutpost.zoneSideCenterOffset).RotatedBy(rotation), ref outpostData);
                }
            }
            else if (linkedZoneRelativeRotation == Rot4.East)
            {
                for (int xOffset = Genstep_GenerateOutpost.zoneSideCenterOffset; xOffset <= Genstep_GenerateOutpost.zoneSideSize - smallRoomWallOffset; xOffset++)
                {
                    Find.TerrainGrid.SetTerrain(rotatedOrigin + new IntVec3(xOffset, 0, Genstep_GenerateOutpost.zoneSideCenterOffset).RotatedBy(rotation), TerrainDef.Named("PavedTile"));
                }
                OG_Common.SpawnDoorAt(rotatedOrigin + new IntVec3(Genstep_GenerateOutpost.zoneSideSize - smallRoomWallOffset - 1, 0, Genstep_GenerateOutpost.zoneSideCenterOffset).RotatedBy(rotation), ref outpostData);
                OG_Common.TrySpawnLampAt(rotatedOrigin + new IntVec3(smallRoomWallOffset + 1, 0, smallRoomWallOffset + 3).RotatedBy(rotation), Color.red, ref outpostData);
                for (int xOffset = Genstep_GenerateOutpost.zoneSideSize - 2; xOffset <= Genstep_GenerateOutpost.zoneSideSize - 1; xOffset++)
                {
                    OG_Common.SpawnFireproofPowerConduitAt(rotatedOrigin + new IntVec3(xOffset, 0, Genstep_GenerateOutpost.zoneSideCenterOffset).RotatedBy(rotation), ref outpostData);
                }
            }
        }
Пример #21
0
 static void GenerateOutpostLayoutSecondaryRooms()
 {
     for (int rotationAsInt = 0; rotationAsInt < 4; rotationAsInt++)
     {
         int  zoneAbs  = 0;
         int  zoneOrd  = 0;
         Rot4 rotation = new Rot4(rotationAsInt);
         Zone.GetAdjacentZone(mainRoomZoneAbs, mainRoomZoneOrd, rotation, out zoneAbs, out zoneOrd);
         if (zoneMap[zoneOrd, zoneAbs].zoneType == ZoneType.NotYetGenerated)
         {
             ZoneType secondaryRoomType = OG_Common.GetRandomZoneTypeSmallRoom(outpostData);
             zoneMap[zoneOrd, zoneAbs] = new ZoneProperties(secondaryRoomType, rotation, Rot4.North);
         }
     }
 }
Пример #22
0
 private static void SpawnLaserFenceWithoutEntrance(IntVec3 laserFenceLeftOrigin, Rot4 rotation, ref OG_OutpostData outpostData)
 {
     // Note: the fence is orthogonal to the parameter rotation.
     for (int xOffset = 0; xOffset < Genstep_GenerateOutpost.zoneSideSize; xOffset++)
     {
         IntVec3 position = laserFenceLeftOrigin + new IntVec3(xOffset, 0, 0).RotatedBy(new Rot4(rotation.AsInt));
         if ((xOffset == 0) ||
             (xOffset == Genstep_GenerateOutpost.zoneSideCenterOffset) ||
             (xOffset == Genstep_GenerateOutpost.zoneSideSize - 1))
         {
             OG_Common.TrySpawnLaserFencePylonAt(position, ref outpostData);
         }
         OG_Common.SpawnFireproofPowerConduitAt(position, ref outpostData);
         Find.TerrainGrid.SetTerrain(position, TerrainDefOf.Concrete);
     }
 }
Пример #23
0
        public static void GenerateSolarPanelZone(IntVec3 areaSouthWestOrigin, int zoneAbs, int zoneOrd, ref OG_OutpostData outpostData)
        {
            IntVec3 solarPanelZoneOrigin = Zone.GetZoneOrigin(areaSouthWestOrigin, zoneAbs, zoneOrd);

            OG_Common.TrySpawnThingAt(ThingDefOf.SolarGenerator, null, solarPanelZoneOrigin + new IntVec3(2, 0, 2), false, Rot4.North, ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDefOf.SolarGenerator, null, solarPanelZoneOrigin + new IntVec3(7, 0, 2), false, Rot4.North, ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDefOf.SolarGenerator, null, solarPanelZoneOrigin + new IntVec3(2, 0, 7), false, Rot4.North, ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDefOf.SolarGenerator, null, solarPanelZoneOrigin + new IntVec3(7, 0, 7), false, Rot4.North, ref outpostData);
            OG_Common.SpawnFireproofPowerConduitAt(solarPanelZoneOrigin + new IntVec3(5, 0, 1), ref outpostData);
            OG_Common.SpawnFireproofPowerConduitAt(solarPanelZoneOrigin + new IntVec3(5, 0, 0), ref outpostData);
            OG_Common.SpawnFireproofPowerConduitAt(solarPanelZoneOrigin + new IntVec3(1, 0, 5), ref outpostData);
            OG_Common.SpawnFireproofPowerConduitAt(solarPanelZoneOrigin + new IntVec3(0, 0, 5), ref outpostData);
            OG_Common.SpawnFireproofPowerConduitAt(solarPanelZoneOrigin + new IntVec3(9, 0, 5), ref outpostData);
            OG_Common.SpawnFireproofPowerConduitAt(solarPanelZoneOrigin + new IntVec3(10, 0, 5), ref outpostData);
            OG_Common.SpawnFireproofPowerConduitAt(solarPanelZoneOrigin + new IntVec3(5, 0, 9), ref outpostData);
            OG_Common.SpawnFireproofPowerConduitAt(solarPanelZoneOrigin + new IntVec3(5, 0, 10), ref outpostData);
        }
Пример #24
0
        public static void GenerateExteriorRecZone(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 = 2; xOffset <= 8; xOffset++)
            {
                for (int zOffset = 1; zOffset <= 9; zOffset++)
                {
                    Find.TerrainGrid.SetTerrain(rotatedOrigin + new IntVec3(xOffset, 0, zOffset).RotatedBy(rotation), TerrainDef.Named("WoodPlankFloor"));
                }
            }
            for (int xOffset = 1; xOffset <= 9; xOffset++)
            {
                for (int zOffset = 2; zOffset <= 8; zOffset++)
                {
                    Find.TerrainGrid.SetTerrain(rotatedOrigin + new IntVec3(xOffset, 0, zOffset).RotatedBy(rotation), TerrainDef.Named("WoodPlankFloor"));
                }
            }

            // Spawn table and chairs.
            OG_Common.TrySpawnThingAt(ThingDef.Named("TableShort"), ThingDefOf.WoodLog, rotatedOrigin + new IntVec3(3, 0, 6).RotatedBy(rotation), true, rotation, ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("DiningChair"), ThingDefOf.WoodLog, rotatedOrigin + new IntVec3(4, 0, 5).RotatedBy(rotation), true, new Rot4(Rot4.North.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("DiningChair"), ThingDefOf.WoodLog, rotatedOrigin + new IntVec3(3, 0, 5).RotatedBy(rotation), true, new Rot4(Rot4.North.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("DiningChair"), ThingDefOf.WoodLog, rotatedOrigin + new IntVec3(2, 0, 7).RotatedBy(rotation), true, new Rot4(Rot4.East.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("DiningChair"), ThingDefOf.WoodLog, rotatedOrigin + new IntVec3(3, 0, 8).RotatedBy(rotation), true, new Rot4(Rot4.South.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("DiningChair"), ThingDefOf.WoodLog, rotatedOrigin + new IntVec3(5, 0, 7).RotatedBy(rotation), true, new Rot4(Rot4.West.AsInt + rotation.AsInt), ref outpostData);

            OG_Common.TrySpawnThingAt(ThingDef.Named("DiningChair"), ThingDefOf.WoodLog, rotatedOrigin + new IntVec3(6, 0, 4).RotatedBy(rotation), true, new Rot4(Rot4.East.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("ChessTable"), ThingDefOf.WoodLog, rotatedOrigin + new IntVec3(7, 0, 4).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("DiningChair"), ThingDefOf.WoodLog, rotatedOrigin + new IntVec3(8, 0, 4).RotatedBy(rotation), true, new Rot4(Rot4.West.AsInt + rotation.AsInt), ref outpostData);

            OG_Common.TrySpawnThingAt(ThingDef.Named("HorseshoesPin"), ThingDefOf.Steel, rotatedOrigin + new IntVec3(2, 0, 2).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData);
            Find.TerrainGrid.SetTerrain(rotatedOrigin + new IntVec3(2, 0, 2).RotatedBy(rotation), TerrainDef.Named("PavedTile"));
            Find.TerrainGrid.SetTerrain(rotatedOrigin + new IntVec3(7, 0, 2).RotatedBy(rotation), TerrainDef.Named("PavedTile"));

            // Spawn flower pots.
            OG_Common.TrySpawnThingAt(ThingDef.Named("PlantPot"), ThingDef.Named("BlocksGranite"), rotatedOrigin + new IntVec3(1, 0, 2).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("PlantPot"), ThingDef.Named("BlocksGranite"), rotatedOrigin + new IntVec3(1, 0, 8).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("PlantPot"), ThingDef.Named("BlocksGranite"), rotatedOrigin + new IntVec3(2, 0, 1).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("PlantPot"), ThingDef.Named("BlocksGranite"), rotatedOrigin + new IntVec3(2, 0, 9).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("PlantPot"), ThingDef.Named("BlocksGranite"), rotatedOrigin + new IntVec3(8, 0, 1).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("PlantPot"), ThingDef.Named("BlocksGranite"), rotatedOrigin + new IntVec3(8, 0, 9).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("PlantPot"), ThingDef.Named("BlocksGranite"), rotatedOrigin + new IntVec3(9, 0, 2).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("PlantPot"), ThingDef.Named("BlocksGranite"), rotatedOrigin + new IntVec3(9, 0, 8).RotatedBy(rotation), false, Rot4.Invalid, ref outpostData);
        }
Пример #25
0
        public static void GenerateWaterPoolZone(IntVec3 areaSouthWestOrigin, int zoneAbs, int zoneOrd, Rot4 rotation, ref OG_OutpostData outpostData)
        {
            IntVec3 rotatedOrigin     = Zone.GetZoneRotatedOrigin(areaSouthWestOrigin, zoneAbs, zoneOrd, rotation);
            IntVec3 firstPatchCenter  = rotatedOrigin + new IntVec3(4, 0, 4).RotatedBy(rotation);
            IntVec3 secondPatchCenter = rotatedOrigin + new IntVec3(7, 0, 7).RotatedBy(rotation);
            IntVec3 thirdPatchCenter  = rotatedOrigin + new IntVec3(6, 0, 6).RotatedBy(rotation);

            // Generate water patches.
            foreach (IntVec3 cell in GenRadial.RadialCellsAround(firstPatchCenter, 4.2f, true))
            {
                Find.TerrainGrid.SetTerrain(cell, TerrainDefOf.Soil);
            }
            foreach (IntVec3 cell in GenRadial.RadialCellsAround(secondPatchCenter, 3.2f, true))
            {
                Find.TerrainGrid.SetTerrain(cell, TerrainDefOf.Soil);
            }
            foreach (IntVec3 cell in GenRadial.RadialCellsAround(firstPatchCenter, 3.2f, true))
            {
                Find.TerrainGrid.SetTerrain(cell, TerrainDef.Named("WaterShallow"));
            }
            foreach (IntVec3 cell in GenRadial.RadialCellsAround(secondPatchCenter, 2f, true))
            {
                Find.TerrainGrid.SetTerrain(cell, TerrainDef.Named("WaterShallow"));
            }
            foreach (IntVec3 cell in GenRadial.RadialCellsAround(firstPatchCenter, 2f, true))
            {
                Find.TerrainGrid.SetTerrain(cell, TerrainDef.Named("WaterDeep"));
            }
            foreach (IntVec3 cell in GenRadial.RadialCellsAround(secondPatchCenter, 1f, true))
            {
                Find.TerrainGrid.SetTerrain(cell, TerrainDef.Named("WaterDeep"));
            }
            foreach (IntVec3 cell in GenRadial.RadialCellsAround(thirdPatchCenter, 1f, true))
            {
                Find.TerrainGrid.SetTerrain(cell, TerrainDef.Named("WaterDeep"));
            }

            // Spawn fishing pier.
            if (ModsConfig.IsActive("FishIndustry"))
            {
                OG_Common.TrySpawnThingAt(ThingDef.Named("FishingPier"), null, rotatedOrigin + new IntVec3(4, 0, 1).RotatedBy(rotation), true, rotation, ref outpostData);
            }
        }
Пример #26
0
        public static void SpawnDoorAt(IntVec3 position, ref OG_OutpostData outpostData)
        {
            ThingDef autodoorDef = OG_Util.FireproofAutodoorDef;
            Building edifice     = position.GetEdifice();

            if ((edifice != null) &&
                (edifice.def == autodoorDef))
            {
                // Avoid spawning another door on the same spot. This creates troubles with region links...
                return;
            }
            Thing           door            = OG_Common.TrySpawnThingAt(autodoorDef, ThingDefOf.Steel, position, false, Rot4.North, ref outpostData, false, true);
            CompForbiddable compForbiddable = door.TryGetComp <CompForbiddable>();

            if (compForbiddable != null)
            {
                compForbiddable.Forbidden = true; // Avoid colonists going into outpost at start-up.
            }
        }
Пример #27
0
        public static void GenerateSas(IntVec3 origin, Rot4 rotation, int width, int height, ref OG_OutpostData outpostData)
        {
            int sideWidth = (width - 1) / 2; // Distance of the wall from the central alley.

            OG_Common.GenerateEmptyRoomAt(origin + new IntVec3(-sideWidth, 0, 0).RotatedBy(rotation), 1 + 2 * sideWidth, height, rotation, null, null, ref outpostData);
            OG_Common.SpawnDoorAt(origin, ref outpostData);
            OG_Common.SpawnDoorAt(origin + new IntVec3(0, 0, height - 1).RotatedBy(rotation), ref outpostData);
            // Generate floor.
            for (int xOffset = -sideWidth - 1; xOffset <= sideWidth + 1; xOffset++)
            {
                for (int zOffset = 0; zOffset < height; zOffset++)
                {
                    Find.TerrainGrid.SetTerrain(origin + new IntVec3(xOffset, 0, zOffset).RotatedBy(rotation), TerrainDefOf.Concrete);
                }
            }
            for (int zOffset = 0; zOffset < height; zOffset++)
            {
                Find.TerrainGrid.SetTerrain(origin + new IntVec3(0, 0, zOffset).RotatedBy(rotation), TerrainDef.Named("PavedTile"));
            }
        }
Пример #28
0
        public static void GenerateDropZone(IntVec3 areaSouthWestOrigin, int zoneAbs, int zoneOrd, ref OG_OutpostData outpostData)
        {
            IntVec3 dropZoneOrigin = Zone.GetZoneOrigin(areaSouthWestOrigin, zoneAbs, zoneOrd);
            IntVec3 sandbagsOrigin = dropZoneOrigin + new IntVec3(1, 0, 1);

            CellRect rect = new CellRect(sandbagsOrigin.x, sandbagsOrigin.z, 9, 9);

            foreach (IntVec3 cell in rect.Cells)
            {
                if (((cell.x == rect.minX) || (cell.x == rect.maxX) || (cell.z == rect.minZ) || (cell.z == rect.maxZ)) &&
                    ((cell.x != rect.CenterCell.x) && (cell.z != rect.CenterCell.z)))
                {
                    OG_Common.TrySpawnThingAt(ThingDefOf.Sandbags, null, cell, false, Rot4.North, ref outpostData);
                }
                Find.TerrainGrid.SetTerrain(cell, TerrainDefOf.Concrete);
            }
            OG_Common.GenerateHorizontalAndVerticalPavedAlleys(dropZoneOrigin);
            OG_Common.TrySpawnThingAt(ThingDef.Named("OrbitalTradeBeacon"), null, rect.CenterCell, false, Rot4.North, ref outpostData);
            Find.TerrainGrid.SetTerrain(rect.CenterCell, TerrainDef.Named("MetalTile"));

            outpostData.dropZoneCenter = rect.CenterCell;
        }
Пример #29
0
        public static void GenerateBigRoomLivingRoom(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, null, ref outpostData);

            // Spawn table and stools.
            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("Stool"), 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("Stool"), ThingDefOf.Steel, rotatedOrigin + new IntVec3(2, 0, 4).RotatedBy(rotation), true, new Rot4(Rot4.South.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("Stool"), ThingDefOf.Steel, rotatedOrigin + new IntVec3(3, 0, 4).RotatedBy(rotation), true, new Rot4(Rot4.South.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("TableShort"), ThingDefOf.Steel, rotatedOrigin + new IntVec3(2, 0, 2).RotatedBy(rotation), true, new Rot4(Rot4.North.AsInt + rotation.AsInt), ref outpostData);
            // Spawn NPD, hoppers and lamp.
            OG_Common.TrySpawnThingAt(ThingDefOf.NutrientPasteDispenser, null, rotatedOrigin + new IntVec3(2, 0, 8).RotatedBy(rotation), true, new Rot4(Rot4.South.AsInt + rotation.AsInt), ref outpostData);
            Find.TerrainGrid.SetTerrain(rotatedOrigin + new IntVec3(2, 0, 6).RotatedBy(rotation), TerrainDef.Named("PavedTile"));
            Building_Storage hopper = OG_Common.TrySpawnThingAt(ThingDefOf.Hopper, null, rotatedOrigin + new IntVec3(4, 0, 9).RotatedBy(rotation), true, new Rot4(Rot4.West.AsInt + rotation.AsInt), ref outpostData) as Building_Storage;

            hopper.GetStoreSettings().Priority = StoragePriority.Critical;
            hopper = OG_Common.TrySpawnThingAt(ThingDefOf.Hopper, null, rotatedOrigin + new IntVec3(4, 0, 8).RotatedBy(rotation), true, new Rot4(Rot4.West.AsInt + rotation.AsInt), ref outpostData) as Building_Storage;
            hopper.GetStoreSettings().Priority = StoragePriority.Critical;
            hopper = OG_Common.TrySpawnThingAt(ThingDefOf.Hopper, null, rotatedOrigin + new IntVec3(4, 0, 7).RotatedBy(rotation), true, new Rot4(Rot4.West.AsInt + rotation.AsInt), ref outpostData) as Building_Storage;
            hopper.GetStoreSettings().Priority = StoragePriority.Critical;
            OG_Common.TrySpawnLampAt(rotatedOrigin + new IntVec3(4, 0, 7).RotatedBy(rotation), Color.white, ref outpostData);
            // Spawn TV and dining chairs.
            OG_Common.TrySpawnThingAt(ThingDef.Named("TubeTelevision"), null, rotatedOrigin + new IntVec3(8, 0, 9).RotatedBy(rotation), true, new Rot4(Rot4.South.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("DiningChair"), ThingDefOf.Steel, rotatedOrigin + new IntVec3(7, 0, 6).RotatedBy(rotation), true, new Rot4(Rot4.North.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("DiningChair"), ThingDefOf.Steel, rotatedOrigin + new IntVec3(9, 0, 6).RotatedBy(rotation), true, new Rot4(Rot4.North.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("DiningChair"), ThingDefOf.Steel, rotatedOrigin + new IntVec3(7, 0, 7).RotatedBy(rotation), true, new Rot4(Rot4.North.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("DiningChair"), ThingDefOf.Steel, rotatedOrigin + new IntVec3(9, 0, 7).RotatedBy(rotation), true, new Rot4(Rot4.North.AsInt + rotation.AsInt), ref outpostData);
            // Spawn lamp and temperature control.
            OG_Common.TrySpawnLampAt(rotatedOrigin + new IntVec3(6, 0, 4).RotatedBy(rotation), Color.white, ref outpostData);
            OG_Common.TrySpawnHeaterAt(rotatedOrigin + new IntVec3(9, 0, 3).RotatedBy(rotation), ref outpostData);
            OG_Common.TrySpawnHeaterAt(rotatedOrigin + new IntVec3(9, 0, 1).RotatedBy(rotation), ref outpostData);
            OG_Common.SpawnCoolerAt(rotatedOrigin + new IntVec3(10, 0, 3).RotatedBy(rotation), new Rot4(Rot4.East.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.SpawnCoolerAt(rotatedOrigin + new IntVec3(10, 0, 1).RotatedBy(rotation), new Rot4(Rot4.East.AsInt + rotation.AsInt), ref outpostData);

            OG_Common.GenerateHorizontalAndVerticalPavedAlleys(origin);
        }
Пример #30
0
        public static void GenerateSmallRoomBarracks(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(smallRoomWallOffset, 0, smallRoomWallOffset).RotatedBy(rotation), Genstep_GenerateOutpost.zoneSideSize - 2 * smallRoomWallOffset, Genstep_GenerateOutpost.zoneSideSize - 2 * smallRoomWallOffset, rotation, TerrainDefOf.Concrete, TerrainDef.Named("WoodPlankFloor"), ref outpostData);

            // Spawn beds, lamp and temperature control.
            OG_Common.TrySpawnThingAt(ThingDef.Named("Bed"), ThingDefOf.WoodLog, rotatedOrigin + new IntVec3(smallRoomWallOffset + 1, 0, smallRoomWallOffset + 1).RotatedBy(rotation), true, new Rot4(Rot4.East.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("Bed"), ThingDefOf.WoodLog, rotatedOrigin + new IntVec3(smallRoomWallOffset + 1, 0, smallRoomWallOffset + 3).RotatedBy(rotation), true, new Rot4(Rot4.East.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("Bed"), ThingDefOf.WoodLog, rotatedOrigin + new IntVec3(smallRoomWallOffset + 1, 0, smallRoomWallOffset + 5).RotatedBy(rotation), true, new Rot4(Rot4.East.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("Bed"), ThingDefOf.WoodLog, rotatedOrigin + new IntVec3(smallRoomWallOffset + 5, 0, smallRoomWallOffset + 1).RotatedBy(rotation), true, new Rot4(Rot4.West.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("Bed"), ThingDefOf.WoodLog, rotatedOrigin + new IntVec3(smallRoomWallOffset + 5, 0, smallRoomWallOffset + 5).RotatedBy(rotation), true, new Rot4(Rot4.West.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnLampAt(rotatedOrigin + new IntVec3(smallRoomWallOffset + 4, 0, smallRoomWallOffset + 3).RotatedBy(rotation), Color.white, ref outpostData);
            OG_Common.TrySpawnHeaterAt(rotatedOrigin + new IntVec3(smallRoomWallOffset + 5, 0, smallRoomWallOffset + 3).RotatedBy(rotation), ref outpostData);
            OG_Common.SpawnCoolerAt(rotatedOrigin + new IntVec3(smallRoomWallOffset + 6, 0, smallRoomWallOffset + 3).RotatedBy(rotation), new Rot4(Rot4.East.AsInt + rotation.AsInt), ref outpostData);
            // Spawn vertical alley and door.
            for (int zOffset = smallRoomWallOffset; zOffset <= Genstep_GenerateOutpost.zoneSideSize - smallRoomWallOffset; zOffset++)
            {
                Find.TerrainGrid.SetTerrain(rotatedOrigin + new IntVec3(Genstep_GenerateOutpost.zoneSideCenterOffset, 0, zOffset).RotatedBy(rotation), TerrainDef.Named("PavedTile"));
            }
            OG_Common.SpawnDoorAt(rotatedOrigin + new IntVec3(Genstep_GenerateOutpost.zoneSideCenterOffset, 0, Genstep_GenerateOutpost.zoneSideSize - smallRoomWallOffset - 1).RotatedBy(rotation), ref outpostData);
        }