Пример #1
0
        public List <DoorConfig> GetDoorGroupCongfigs(string listRight)
        {
            List <DoorConfig> lstConfigs = new List <DoorConfig>();
            DataTable         dt         = dal.GetDoorGroupFileConfig(listRight);

            if (dt.Rows.Count < 0)
            {
                return(null);
            }

            try
            {
                foreach (DataRow row in dt.Rows)
                {
                    DoorConfig config = new DoorConfig();
                    config.DoorGroupId = row["doorGrId"] == DBNull.Value ? null : row["doorGrId"].ToString();
                    config.DoorCount   = Convert.ToInt32(row["doorCount"]);
                    config.ListDoor    = row["listDoor"] == DBNull.Value ? null : row["listDoor"].ToString();

                    lstConfigs.Add(config);
                }

                return(lstConfigs);
            }
            catch
            {
                return(null);
            }
        }
        public override BuildingDef CreateBuildingDef()
        {
            string anim = "critter_proof_external_kanim";

            if (!CritterPathingPatches.config.UseCustomTextures)
            {
                anim = "door_external_kanim";
            }

            BuildingDef buildingDef = BuildingTemplates.CreateBuildingDef(ID, 1, 2,
                                                                          anim, 100, 120f, TUNING.BUILDINGS.CONSTRUCTION_MASS_KG.TIER3, MATERIALS.REFINED_METALS,
                                                                          1600f, BuildLocationRule.Tile, TUNING.BUILDINGS.DECOR.BONUS.TIER0, NOISE_POLLUTION.NONE, 1f);

            buildingDef.Overheatable                = false;
            buildingDef.RequiresPowerInput          = true;
            buildingDef.EnergyConsumptionWhenActive = 120f;
            buildingDef.Floodable          = false;
            buildingDef.Entombable         = false;
            buildingDef.IsFoundation       = true;
            buildingDef.ViewMode           = OverlayModes.Power.ID;
            buildingDef.TileLayer          = ObjectLayer.FoundationTile;
            buildingDef.AudioCategory      = "Metal";
            buildingDef.PermittedRotations = PermittedRotations.R90;
            buildingDef.SceneLayer         = Grid.SceneLayer.TileMain;
            buildingDef.ForegroundLayer    = Grid.SceneLayer.InteriorWall;
            SoundEventVolumeCache.instance.AddVolume("door_external_kanim", "Open_DoorPressure", NOISE_POLLUTION.NOISY.TIER2);
            SoundEventVolumeCache.instance.AddVolume("door_external_kanim", "Close_DoorPressure", NOISE_POLLUTION.NOISY.TIER2);
            buildingDef.LogicInputPorts = DoorConfig.CreateSingleInputPortList(new CellOffset(0, 0));
            return(buildingDef);
        }
Пример #3
0
        public override BuildingDef CreateBuildingDef()
        {
            float[] construction_mass = new float[1] {
                1000f
            };
            string[] construction_materials = new string[1]
            {
                SimHashes.Steel.ToString()
            };
            EffectorValues none1       = NOISE_POLLUTION.NONE;
            EffectorValues none2       = BUILDINGS.DECOR.NONE;
            EffectorValues noise       = none1;
            string         anim        = "door_bunker_kanim";
            BuildingDef    buildingDef = BuildingTemplates.CreateBuildingDef(ID, 7, 1, anim, 1000, 120f, construction_mass, construction_materials, 1600f, BuildLocationRule.Tile, none2, noise, 1f);

            buildingDef.RequiresPowerInput          = true;
            buildingDef.EnergyConsumptionWhenActive = 120f;
            buildingDef.OverheatTemperature         = 1273.15f;
            buildingDef.Entombable         = false;
            buildingDef.IsFoundation       = true;
            buildingDef.AudioCategory      = "Metal";
            buildingDef.PermittedRotations = PermittedRotations.R90;
            buildingDef.SceneLayer         = Grid.SceneLayer.TileMain;
            buildingDef.ForegroundLayer    = Grid.SceneLayer.InteriorWall;
            buildingDef.TileLayer          = ObjectLayer.FoundationTile;
            buildingDef.LogicInputPorts    = DoorConfig.CreateSingleInputPortList(new CellOffset(-1, 0));
            SoundEventVolumeCache.instance.AddVolume(anim, "Open_DoorInternal", NOISE_POLLUTION.NOISY.TIER2);
            SoundEventVolumeCache.instance.AddVolume(anim, "Close_DoorInternal", NOISE_POLLUTION.NOISY.TIER2);
            return(buildingDef);
        }
Пример #4
0
        public override BuildingDef CreateBuildingDef()
        {
            float[]  construct_mass = { 400f };
            string[] construct_mat  = { "RefinedMetal" };

            BuildingDef buildingDef = BuildingTemplates.CreateBuildingDef(ID, 1, 2, "door_poi_kanim",
                                                                          100, 60f, construct_mass, construct_mat, 1800f, BuildLocationRule.Anywhere,
                                                                          BUILDINGS.DECOR.BONUS.TIER1, NOISE_POLLUTION.NONE, 0.2f);

            buildingDef.Overheatable                = false;
            buildingDef.RequiresPowerInput          = true;
            buildingDef.EnergyConsumptionWhenActive = 120f;
            buildingDef.Floodable          = false;
            buildingDef.Entombable         = false;
            buildingDef.IsFoundation       = true;
            buildingDef.ViewMode           = OverlayModes.Power.ID;
            buildingDef.TileLayer          = ObjectLayer.FoundationTile;
            buildingDef.AudioCategory      = "Metal";
            buildingDef.PermittedRotations = PermittedRotations.R90;
            buildingDef.SceneLayer         = Grid.SceneLayer.TileMain;
            buildingDef.ForegroundLayer    = Grid.SceneLayer.InteriorWall;
            buildingDef.LogicInputPorts    = DoorConfig.CreateSingleInputPortList(new CellOffset(0, 0));
            SoundEventVolumeCache.instance.AddVolume("door_external_kanim", "Open_DoorPressure", NOISE_POLLUTION.NOISY.TIER2);
            SoundEventVolumeCache.instance.AddVolume("door_external_kanim", "Close_DoorPressure", NOISE_POLLUTION.NOISY.TIER2);
            return(buildingDef);
        }
Пример #5
0
    public override BuildingDef CreateBuildingDef()
    {
        float[]        tieR4       = BUILDINGS.CONSTRUCTION_MASS_KG.TIER3;
        string[]       allMetals   = MATERIALS.ALL_METALS;
        EffectorValues none        = NOISE_POLLUTION.NONE;
        EffectorValues tieR1       = BUILDINGS.DECOR.PENALTY.TIER1;
        EffectorValues noise       = none;
        BuildingDef    buildingDef = BuildingTemplates.CreateBuildingDef("TinyPressureDoor", 1, 1, "Tiny_door_external_kanim", 30, 30f, tieR4, allMetals, 1600f, BuildLocationRule.Tile, tieR1, noise, 1f);

        buildingDef.Overheatable                = false;
        buildingDef.RequiresPowerInput          = true;
        buildingDef.EnergyConsumptionWhenActive = 60f;
        buildingDef.Floodable          = false;
        buildingDef.Entombable         = false;
        buildingDef.IsFoundation       = true;
        buildingDef.ViewMode           = OverlayModes.Power.ID;
        buildingDef.TileLayer          = ObjectLayer.FoundationTile;
        buildingDef.AudioCategory      = "Metal";
        buildingDef.PermittedRotations = PermittedRotations.R90;
        buildingDef.SceneLayer         = Grid.SceneLayer.TileMain;
        buildingDef.ForegroundLayer    = Grid.SceneLayer.InteriorWall;
        buildingDef.LogicInputPorts    = DoorConfig.CreateSingleInputPortList(new CellOffset(0, 0));
        SoundEventVolumeCache.instance.AddVolume("door_external_kanim", "Open_DoorPressure", NOISE_POLLUTION.NOISY.TIER2);
        SoundEventVolumeCache.instance.AddVolume("door_external_kanim", "Close_DoorPressure", NOISE_POLLUTION.NOISY.TIER2);
        return(buildingDef);
    }
Пример #6
0
        public override BuildingDef CreateBuildingDef()
        {
            string id                = ID;
            int    width             = 1;
            int    height            = 4;
            string anim              = "door_king_powered_kanim";
            int    hitpoints         = 200;
            float  construction_time = 90f;

            float[]           construct_mass      = { 400f };
            string[]          construct_mat       = TUNING.MATERIALS.REFINED_METALS;
            float             melting_point       = 1600f;
            BuildLocationRule build_location_rule = BuildLocationRule.Tile;
            EffectorValues    none        = NOISE_POLLUTION.NONE;
            BuildingDef       buildingDef = BuildingTemplates.CreateBuildingDef(id, width, height, anim, hitpoints, construction_time, construct_mass, construct_mat, melting_point, build_location_rule, BUILDINGS.DECOR.BONUS.TIER1, none, 1f);

            buildingDef.Overheatable                = false;
            buildingDef.RequiresPowerInput          = true;
            buildingDef.EnergyConsumptionWhenActive = 240f;
            buildingDef.Floodable          = false;
            buildingDef.Entombable         = false;
            buildingDef.IsFoundation       = true;
            buildingDef.ViewMode           = OverlayModes.Power.ID;
            buildingDef.TileLayer          = ObjectLayer.FoundationTile;
            buildingDef.AudioCategory      = "Metal";
            buildingDef.PermittedRotations = PermittedRotations.R90;
            buildingDef.SceneLayer         = Grid.SceneLayer.Building;
            buildingDef.ForegroundLayer    = Grid.SceneLayer.InteriorWall;
            buildingDef.TileLayer          = ObjectLayer.FoundationTile;
            SoundEventVolumeCache.instance.AddVolume("door_poi_internal_kanim", "Open_DoorInternal", NOISE_POLLUTION.NOISY.TIER2);
            SoundEventVolumeCache.instance.AddVolume("door_poi_internal_kanim", "Close_DoorInternal", NOISE_POLLUTION.NOISY.TIER2);
            buildingDef.LogicInputPorts = DoorConfig.CreateSingleInputPortList(new CellOffset(0, 0));
            return(buildingDef);
        }
        public override BuildingDef CreateBuildingDef()
        {
            float[]  construct_mass = { 300f, 100f };
            string[] construct_mat  = { "RefinedMetal", "Plastic" };

            BuildingDef buildingDef = BuildingTemplates.CreateBuildingDef(ID, 2, 3, "door_facility_kanim",
                                                                          100, 60f, construct_mass, construct_mat, 1800f, BuildLocationRule.Anywhere,
                                                                          BUILDINGS.DECOR.BONUS.TIER1, NOISE_POLLUTION.NONE, 0.2f);

            buildingDef.Overheatable       = false;
            buildingDef.Repairable         = false;
            buildingDef.Floodable          = false;
            buildingDef.Invincible         = false;
            buildingDef.IsFoundation       = true;
            buildingDef.TileLayer          = ObjectLayer.FoundationTile;
            buildingDef.AudioCategory      = "Metal";
            buildingDef.PermittedRotations = PermittedRotations.R90;
            buildingDef.SceneLayer         = Grid.SceneLayer.TileMain;
            buildingDef.ForegroundLayer    = Grid.SceneLayer.InteriorWall;
            SoundEventVolumeCache.instance.AddVolume("door_manual_kanim", "ManualPressureDoor_gear_LP", NOISE_POLLUTION.NOISY.TIER1);
            SoundEventVolumeCache.instance.AddVolume("door_manual_kanim", "ManualPressureDoor_open", NOISE_POLLUTION.NOISY.TIER2);
            SoundEventVolumeCache.instance.AddVolume("door_manual_kanim", "ManualPressureDoor_close", NOISE_POLLUTION.NOISY.TIER2);
            buildingDef.LogicInputPorts = DoorConfig.CreateSingleInputPortList(new CellOffset(0, 0));
            return(buildingDef);
        }
Пример #8
0
    public override BuildingDef CreateBuildingDef()
    {
        float[]        tieR2       = TUNING.BUILDINGS.CONSTRUCTION_MASS_KG.TIER1;
        string[]       allMetals   = MATERIALS.ALL_METALS;
        EffectorValues none1       = TUNING.NOISE_POLLUTION.NONE;
        EffectorValues none2       = TUNING.BUILDINGS.DECOR.NONE;
        EffectorValues noise       = none1;
        BuildingDef    buildingDef = BuildingTemplates.CreateBuildingDef("TinyDoor", 1, 1, "Tiny_door_internal_kanim", 30, 5f, tieR2, allMetals, 1600f, BuildLocationRule.Tile, none2, noise, 1f);

        buildingDef.Entombable         = true;
        buildingDef.Floodable          = false;
        buildingDef.IsFoundation       = false;
        buildingDef.AudioCategory      = "Metal";
        buildingDef.PermittedRotations = PermittedRotations.R90;
        buildingDef.ForegroundLayer    = Grid.SceneLayer.TileMain;
        buildingDef.LogicInputPorts    = DoorConfig.CreateSingleInputPortList(new CellOffset(0, 0));
        SoundEventVolumeCache.instance.AddVolume("door_internal_kanim", "Open_DoorInternal", TUNING.NOISE_POLLUTION.NOISY.TIER2);
        SoundEventVolumeCache.instance.AddVolume("door_internal_kanim", "Close_DoorInternal", TUNING.NOISE_POLLUTION.NOISY.TIER2);
        return(buildingDef);
    }
Пример #9
0
        public override BuildingDef CreateBuildingDef()
        {
            float[]  construct_mass = { 400f };
            string[] construct_mat  = TUNING.MATERIALS.ALL_METALS;

            BuildingDef buildingDef = BuildingTemplates.CreateBuildingDef(ID, 1, 4, "door_king_kanim",
                                                                          100, 60f, construct_mass, construct_mat, 1800f, BuildLocationRule.Anywhere,
                                                                          BUILDINGS.DECOR.BONUS.TIER1, NOISE_POLLUTION.NONE, 0.2f);

            buildingDef.Overheatable       = false;
            buildingDef.Repairable         = false;
            buildingDef.Floodable          = false;
            buildingDef.Invincible         = false;
            buildingDef.IsFoundation       = true;
            buildingDef.TileLayer          = ObjectLayer.FoundationTile;
            buildingDef.AudioCategory      = "Metal";
            buildingDef.PermittedRotations = PermittedRotations.R90;
            buildingDef.ForegroundLayer    = Grid.SceneLayer.InteriorWall;
            SoundEventVolumeCache.instance.AddVolume("door_poi_internal_kanim", "Open_DoorInternal", NOISE_POLLUTION.NOISY.TIER2);
            SoundEventVolumeCache.instance.AddVolume("door_poi_internal_kanim", "Close_DoorInternal", NOISE_POLLUTION.NOISY.TIER2);
            buildingDef.LogicInputPorts = DoorConfig.CreateSingleInputPortList(new CellOffset(0, 0));
            return(buildingDef);
        }
    public override BuildingDef CreateBuildingDef()
    {
        string[] strArray = new string[2]
        {
            "BuildableRaw",
            "RefinedMetal"
        };
        float[] construction_mass = new float[2]
        {
            BUILDINGS.CONSTRUCTION_MASS_KG.TIER5[0],
            BUILDINGS.CONSTRUCTION_MASS_KG.TIER3[0]
        };
        string[]       construction_materials = strArray;
        EffectorValues none        = NOISE_POLLUTION.NONE;
        EffectorValues tieR1       = BUILDINGS.DECOR.PENALTY.TIER1;
        EffectorValues noise       = none;
        BuildingDef    buildingDef = BuildingTemplates.CreateBuildingDef("InsulatedPressureDoor", 1, 2, "Insulated_door_external_kanim", 30, 60f, construction_mass, construction_materials, 1600f, BuildLocationRule.Tile, tieR1, noise, 1f);

        buildingDef.ThermalConductivity         = 0.01f;
        buildingDef.Overheatable                = false;
        buildingDef.RequiresPowerInput          = true;
        buildingDef.EnergyConsumptionWhenActive = 180f;
        buildingDef.Floodable          = false;
        buildingDef.Entombable         = false;
        buildingDef.IsFoundation       = true;
        buildingDef.ViewMode           = OverlayModes.Power.ID;
        buildingDef.TileLayer          = ObjectLayer.FoundationTile;
        buildingDef.AudioCategory      = "Metal";
        buildingDef.PermittedRotations = PermittedRotations.R90;
        buildingDef.SceneLayer         = Grid.SceneLayer.TileMain;
        buildingDef.ForegroundLayer    = Grid.SceneLayer.InteriorWall;
        buildingDef.LogicInputPorts    = DoorConfig.CreateSingleInputPortList(new CellOffset(0, 0));
        SoundEventVolumeCache.instance.AddVolume("door_external_kanim", "Open_DoorPressure", NOISE_POLLUTION.NOISY.TIER2);
        SoundEventVolumeCache.instance.AddVolume("door_external_kanim", "Close_DoorPressure", NOISE_POLLUTION.NOISY.TIER2);
        return(buildingDef);
    }
Пример #11
0
        /*
         * private static bool Prefix(DoorConfig __instance, ref BuildingDef __result)
         * {
         *  string id = "Door";
         *  int width = 1;
         *  int height = 2;
         *  string anim = "door_internal_kanim";
         *  int hitpoints = 30;
         *  float construction_time = 10f;
         *  float[] tIER = TUNING.BUILDINGS.CONSTRUCTION_MASS_KG.TIER2;
         *  string[] aLL_METALS = TUNING.MATERIALS.ALL_METALS;
         *  float melting_point = 1600f;
         *  BuildLocationRule build_location_rule = BuildLocationRule.Tile;
         *  EffectorValues nONE = TUNING.NOISE_POLLUTION.NONE;
         *  __result = BuildingTemplates.CreateBuildingDef(id, width, height, anim, hitpoints, construction_time, tIER, aLL_METALS, melting_point, build_location_rule, TUNING.BUILDINGS.DECOR.NONE, nONE, 1f);
         *  __result.Entombable = false;
         *  __result.IsFoundation = true;
         *  __result.MaterialCategory = TUNING.MATERIALS.ANY_BUILDABLE;
         *  __result.AudioCategory = "Metal";
         *  __result.PermittedRotations = PermittedRotations.R90;
         *  __result.SceneLayer = Grid.SceneLayer.TileMain;
         *  __result.DefaultAnimState = "off";
         *  __result.TileLayer = ObjectLayer.FoundationTile;
         *  SoundEventVolumeCache.instance.AddVolume("door_internal_kanim", "Open_DoorInternal", TUNING.NOISE_POLLUTION.NOISY.TIER2);
         *  SoundEventVolumeCache.instance.AddVolume("door_internal_kanim", "Close_DoorInternal", TUNING.NOISE_POLLUTION.NOISY.TIER2);
         *  return false;
         * }
         */

        private static void Postfix(DoorConfig __instance, ref BuildingDef __result)
        {
            //__result.AnimFiles = new KAnimFile[0] { };
            __result.MaterialCategory = TUNING.MATERIALS.ANY_BUILDABLE;
        }