SpawnVentAt() public static method

public static SpawnVentAt ( IntVec3 position, Rot4 rotation, OG_OutpostData &outpostData ) : void
position IntVec3
rotation Rot4
outpostData OG_OutpostData
return void
Esempio n. 1
0
        public static void GenerateBigRoomPrison(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(4, 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(3, 0, 9).RotatedBy(rotation), true, new Rot4(Rot4.North.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDef.Named("TableShort"), ThingDefOf.Steel, rotatedOrigin + new IntVec3(2, 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, 6).RotatedBy(rotation), Color.white, ref outpostData);
            OG_Common.TrySpawnHeaterAt(rotatedOrigin + new IntVec3(7, 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(7, 0, 10).RotatedBy(rotation), new Rot4(Rot4.North.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.SpawnCoolerAt(rotatedOrigin + new IntVec3(9, 0, 10).RotatedBy(rotation), new Rot4(Rot4.North.AsInt + rotation.AsInt), ref outpostData);
            // Spawn prison cells' walls, door, bed, lamp and vent.
            // Cell 1.
            OG_Common.GenerateEmptyRoomAt(rotatedOrigin, 5, 5, rotation, TerrainDefOf.Concrete, null, ref outpostData);
            OG_Common.SpawnDoorAt(rotatedOrigin + new IntVec3(2, 0, 4).RotatedBy(rotation), ref outpostData);
            Find.TerrainGrid.SetTerrain(rotatedOrigin + new IntVec3(2, 0, 5).RotatedBy(rotation), TerrainDef.Named("PavedTile"));
            Thing bed = OG_Common.TrySpawnThingAt(ThingDef.Named("Bed"), ThingDefOf.WoodLog, rotatedOrigin + new IntVec3(2, 0, 1).RotatedBy(rotation), true, new Rot4(Rot4.North.AsInt + rotation.AsInt), ref outpostData);

            //(bed as Building_Bed).ForPrisoners = true; // TODO: can't do it while generating map...
            OG_Common.TrySpawnLampAt(rotatedOrigin + new IntVec3(1, 0, 1).RotatedBy(rotation), Color.white, ref outpostData);
            OG_Common.SpawnVentAt(rotatedOrigin + new IntVec3(1, 0, 4).RotatedBy(rotation), new Rot4(Rot4.North.AsInt + rotation.AsInt), ref outpostData);
            // Cell 2.
            OG_Common.GenerateEmptyRoomAt(rotatedOrigin + new IntVec3(6, 0, 0).RotatedBy(rotation), 5, 5, rotation, TerrainDefOf.Concrete, null, ref outpostData);
            OG_Common.SpawnDoorAt(rotatedOrigin + new IntVec3(8, 0, 4).RotatedBy(rotation), ref outpostData);
            Find.TerrainGrid.SetTerrain(rotatedOrigin + new IntVec3(7, 0, 5).RotatedBy(rotation), TerrainDef.Named("PavedTile"));
            bed = OG_Common.TrySpawnThingAt(ThingDef.Named("Bed"), ThingDefOf.WoodLog, rotatedOrigin + new IntVec3(8, 0, 1).RotatedBy(rotation), true, new Rot4(Rot4.North.AsInt + rotation.AsInt), ref outpostData);
            //(bed as Building_Bed).ForPrisoners = true; // TODO: can't do it while generating map...
            OG_Common.TrySpawnLampAt(rotatedOrigin + new IntVec3(9, 0, 1).RotatedBy(rotation), Color.white, ref outpostData);
            OG_Common.SpawnVentAt(rotatedOrigin + new IntVec3(9, 0, 4).RotatedBy(rotation), new Rot4(Rot4.North.AsInt + rotation.AsInt), ref outpostData);

            OG_Common.GenerateHorizontalAndVerticalPavedAlleys(origin);
        }
Esempio n. 2
0
        public static void GenerateBigRoomBatteryRoom(IntVec3 areaSouthWestOrigin, int zoneAbs, int zoneOrd, Rot4 rotation, ZoneProperties[,] zoneMap, 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("MetalTile"), 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 generators.
            OG_Common.TrySpawnThingAt(OG_Util.CompactAutonomousGeneratorDef, null, rotatedOrigin + new IntVec3(1, 0, 1).RotatedBy(rotation), true, new Rot4(Rot4.North.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnThingAt(OG_Util.CompactAutonomousGeneratorDef, null, rotatedOrigin + new IntVec3(1, 0, 8).RotatedBy(rotation), true, new Rot4(Rot4.North.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnThingAt(OG_Util.CompactAutonomousGeneratorDef, null, rotatedOrigin + new IntVec3(8, 0, 8).RotatedBy(rotation), true, new Rot4(Rot4.North.AsInt + rotation.AsInt), ref outpostData);

            // Spawn batteries.
            OG_Common.TrySpawnThingAt(ThingDefOf.Battery, null, rotatedOrigin + new IntVec3(1, 0, 3).RotatedBy(rotation), true, new Rot4(Rot4.North.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDefOf.Battery, null, rotatedOrigin + new IntVec3(3, 0, 1).RotatedBy(rotation), true, new Rot4(Rot4.East.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDefOf.Battery, null, rotatedOrigin + new IntVec3(1, 0, 7).RotatedBy(rotation), true, new Rot4(Rot4.South.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDefOf.Battery, null, rotatedOrigin + new IntVec3(3, 0, 9).RotatedBy(rotation), true, new Rot4(Rot4.East.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDefOf.Battery, null, rotatedOrigin + new IntVec3(9, 0, 7).RotatedBy(rotation), true, new Rot4(Rot4.South.AsInt + rotation.AsInt), ref outpostData);
            OG_Common.TrySpawnThingAt(ThingDefOf.Battery, null, rotatedOrigin + new IntVec3(7, 0, 9).RotatedBy(rotation), true, new Rot4(Rot4.West.AsInt + rotation.AsInt), ref outpostData);

            // Spawn power controller.
            OG_Common.TrySpawnThingAt(ThingDef.Named("MultiAnalyzer"), null, rotatedOrigin + new IntVec3(7, 0, 2).RotatedBy(rotation), true, new Rot4(Rot4.North.AsInt + rotation.AsInt), ref outpostData);

            // Spawn lamp and vents.
            OG_Common.TrySpawnLampAt(rotatedOrigin + new IntVec3(3, 0, 7).RotatedBy(rotation), Color.blue, ref outpostData);
            for (int cardinalAsInt = 0; cardinalAsInt < 4; cardinalAsInt++)
            {
                Rot4 cardinal        = new Rot4(cardinalAsInt);
                int  adjacentZoneAbs = 0;
                int  adjacentZoneOrd = 0;
                Zone.GetAdjacentZone(zoneAbs, zoneOrd, cardinal, out adjacentZoneAbs, out adjacentZoneOrd);
                if (zoneMap[adjacentZoneOrd, adjacentZoneAbs].zoneType == ZoneType.SolarPanelZone)
                {
                    if (cardinal == Rot4.North)
                    {
                        OG_Common.SpawnVentAt(origin + new IntVec3(4, 0, 10), Rot4.North, ref outpostData);
                        OG_Common.SpawnVentAt(origin + new IntVec3(6, 0, 10), Rot4.North, ref outpostData);
                    }
                    else if (cardinal == Rot4.East)
                    {
                        OG_Common.SpawnVentAt(origin + new IntVec3(10, 0, 4), Rot4.East, ref outpostData);
                        OG_Common.SpawnVentAt(origin + new IntVec3(10, 0, 6), Rot4.East, ref outpostData);
                    }
                    else if (cardinal == Rot4.South)
                    {
                        OG_Common.SpawnVentAt(origin + new IntVec3(4, 0, 0), Rot4.South, ref outpostData);
                        OG_Common.SpawnVentAt(origin + new IntVec3(6, 0, 0), Rot4.West, ref outpostData);
                    }
                    else if (cardinal == Rot4.West)
                    {
                        OG_Common.SpawnVentAt(origin + new IntVec3(0, 0, 4), Rot4.West, ref outpostData);
                        OG_Common.SpawnVentAt(origin + new IntVec3(0, 0, 6), Rot4.West, ref outpostData);
                    }
                }
            }

            OG_Common.GenerateHorizontalAndVerticalPavedAlleys(origin);
        }