void AddWaterToH()
        {
            var ori = LDB.recipes.Select(23);
            //var x_icon = LDB.recipes.Select(58);

            var waterele = ori.Copy();

            waterele.ID           = 443;
            waterele.Explicit     = true;
            waterele.Name         = "催化电解";
            waterele.name         = "催化电解".Translate();
            waterele.Items        = new int[] { 1000 };
            waterele.ItemCounts   = new int[] { 1 };
            waterele.Results      = new int[] { 1120 };
            waterele.ResultCounts = new int[] { 1 };
            waterele.GridIndex    = 1110;
            waterele.SID          = "1110";
            waterele.sid          = "1110".Translate();
            Traverse.Create(waterele).Field("_iconSprite").SetValue(icon);
            waterele.TimeSpend   = 30;
            waterele.Description = "催化电解描述";
            waterele.description = "催化电解描述".Translate();
            waterele.preTech     = LDB.techs.Select(1121);

            //氢气的合成公式里加入这个公式
            var h = LDB.items.Select(1120);

            h.recipes.Add(waterele);

            LDBTool.PostAddProto(ProtoType.Recipe, waterele);
        }
Esempio n. 2
0
        private void AddAdvancedCopper()
        {
            Logger.LogInfo("AddAdvancedCopper Start");
            RecipeProto advCopper = orgRecipe.Copy();

            advCopper.ID           = 621;
            advCopper.Name         = "铜锭(高效)";
            advCopper.name         = advCopper.Name.Translate();
            advCopper.Description  = "您可以通过加水生成更多的铸锭。";
            advCopper.description  = advCopper.Description.Translate();
            advCopper.Items        = new int[] { 1002, 1000 };
            advCopper.ItemCounts   = new int[] { 6, 4 };
            advCopper.Results      = new int[] { 1104 };
            advCopper.ResultCounts = new int[] { 15 };
            advCopper.Explicit     = true;
            advCopper.TimeSpend    = (60 * 12);
            advCopper.GridIndex    = 1709;
            advCopper.SID          = advCopper.GridIndex.ToString();
            advCopper.sid          = advCopper.GridIndex.ToString().Translate();
            Traverse.Create(advCopper).Field("_iconSprite").SetValue(this.copperIcon);
            var copperIngotItem = LDB.items.Select(1104);

            copperIngotItem.recipes.Add(advCopper);
            LDBTool.PostAddProto(ProtoType.Recipe, advCopper);
            Logger.LogInfo("AddAdvancedCopper End");
        }
Esempio n. 3
0
        private void AddAdvancedIron()
        {
            Logger.LogInfo("AddAdvancedIron Start");
            RecipeProto advIron = orgRecipe.Copy();

            advIron.ID           = 620;
            advIron.Name         = "铁锭(高效)";
            advIron.name         = advIron.Name.Translate();
            advIron.Description  = "您可以通过加水生成更多的铸锭。";
            advIron.description  = advIron.Description.Translate();
            advIron.Items        = new int[] { 1001, 1000 };
            advIron.ItemCounts   = new int[] { 6, 4 };
            advIron.Results      = new int[] { 1101 };
            advIron.ResultCounts = new int[] { 15 };
            advIron.Explicit     = true;
            advIron.TimeSpend    = (60 * 12);
            advIron.GridIndex    = 1708;
            advIron.SID          = advIron.GridIndex.ToString();
            advIron.sid          = advIron.GridIndex.ToString().Translate();
            Traverse.Create(advIron).Field("_iconSprite").SetValue(this.ironIcon);
            var ironIngotItem = LDB.items.Select(1101);

            ironIngotItem.recipes.Add(advIron);
            LDBTool.PostAddProto(ProtoType.Recipe, advIron);
            Logger.LogInfo("AddAdvancedIron End");
        }
Esempio n. 4
0
        private void AddItem()
        {
            itemSapling             = LDB.items.Select(1201).Copy();
            itemSapling.ID          = 9150;
            itemSapling.GridIndex   = 1506;
            itemSapling.Type        = EItemType.Resource;
            itemSapling.Name        = "sapling";
            itemSapling.name        = itemSapling.Name.Translate();
            itemSapling.Description = "";
            itemSapling.description = "";
            Traverse.Create(itemSapling).Field("_iconSprite").SetValue(_iconSapling);
            LDBTool.PostAddProto(ProtoType.Item, itemSapling);

            itemCharcoal             = LDB.items.Select(1109).Copy();
            itemCharcoal.ID          = 9151;
            itemCharcoal.GridIndex   = 1507;
            itemCharcoal.Type        = EItemType.Resource;
            itemCharcoal.HeatValue   = 2700000;
            itemCharcoal.ReactorInc  = 0.0f;
            itemCharcoal.Name        = "charcoal";
            itemCharcoal.name        = itemCharcoal.Name.Translate();
            itemCharcoal.Description = "charcoalDesc";
            itemCharcoal.description = itemCharcoal.Description.Translate();
            Traverse.Create(itemCharcoal).Field("_iconSprite").SetValue(_iconCharcoal);
            LDBTool.PostAddProto(ProtoType.Item, itemCharcoal);
        }
Esempio n. 5
0
        public void AddSmelterMk2Data()
        {
            var smelter  = LDB.items.Select(2302);
            var smelterr = LDB.recipes.Select(56);

            // Load the required technology to access it
            var preTechSmelterMk2 = LDB.techs.Select(1202);

            // Copy the Protos to a new Smelter MK II building
            ItemProto   smelterMk2  = smelter.Copy();
            RecipeProto smelterMk2r = smelterr.Copy();

            Traverse.Create(smelterMk2).Field("_iconSprite").SetValue(smelter.iconSprite);
            Traverse.Create(smelterMk2r).Field("_iconSprite").SetValue(smelterr.iconSprite);

            smelterMk2r.ID          = 10001;
            smelterMk2r.Name        = "Smelter MK. II";
            smelterMk2r.name        = "Smelter MK. II";
            smelterMk2r.Description = "1.5x the speed of a Smelter";
            smelterMk2r.description = "1.5x the speed of a Smelter";
            smelterMk2r.Items       = new int[] { 2302, 1107, 1303, 1202 }; // The items required to craft it
            //smelterMk2r.Items = new int[] { 1001 };   // The items required to craft it
            smelterMk2r.ItemCounts = new int[] { 1, 4, 4, 8 };
            //smelterMk2r.ItemCounts = new int[] { 1 };
            smelterMk2r.Results    = new int[] { 10001 }; // The result (Smelter MK II)
            smelterMk2r.GridIndex  = 2701;                // Where the recipe is located on the replicator. Format xyzz where x is the page, y is the row, and zz is the column
            smelterMk2r.preTech    = preTechSmelterMk2;   // Set the required technology to be able to access the recipe
            smelterMk2r.SID        = smelterMk2r.GridIndex.ToString();
            smelterMk2r.sid        = smelterMk2r.GridIndex.ToString();
            smelterMk2.Name        = "Smelter MK. II";
            smelterMk2.name        = "Smelter MK. II";
            smelterMk2.Description = "1.5x the speed of a Smelter";
            smelterMk2.description = "1.5x the speed of a Smelter";
            smelterMk2.ID          = 10001;
            smelterMk2.makes       = new List <RecipeProto>();
            smelterMk2.BuildIndex  = 10001;
            smelterMk2.GridIndex   = smelterMk2r.GridIndex;
            smelterMk2.handcraft   = smelterMk2r;
            smelterMk2.maincraft   = smelterMk2r;
            smelterMk2.handcrafts  = new List <RecipeProto>()
            {
                smelterMk2r
            };
            smelterMk2.recipes = new List <RecipeProto>()
            {
                smelterMk2r
            };
            smelterMk2.prefabDesc                     = smelter.prefabDesc.Copy();
            smelterMk2.prefabDesc.modelIndex          = smelterMk2.ModelIndex;
            smelterMk2.prefabDesc.isAssembler         = true;
            smelterMk2.prefabDesc.assemblerSpeed      = 15000; // default is 10000
            smelterMk2.prefabDesc.assemblerRecipeType = ERecipeType.Smelt;
            smelterMk2.prefabDesc.idleEnergyPerTick   = 250;   // desired watts / 60
            smelterMk2.prefabDesc.workEnergyPerTick   = 10667; // desired watts / 60

            LDBTool.PostAddProto(ProtoType.Recipe, smelterMk2r);
            LDBTool.PostAddProto(ProtoType.Item, smelterMk2);
        }
Esempio n. 6
0
        public void AddStorage4Data()
        {
            var storage2  = LDB.items.Select(2102);
            var storage2r = LDB.recipes.Select(91);

            // Load the required technology to access it
            var preTechStorage4 = LDB.techs.Select(1605);

            // Copy the Protos to a new Storage Mk III building
            ItemProto   storage4  = storage2.Copy();
            RecipeProto storage4r = storage2r.Copy();

            Traverse.Create(storage4).Field("_iconSprite").SetValue(storage2.iconSprite);
            Traverse.Create(storage4r).Field("_iconSprite").SetValue(storage2.iconSprite);

            storage4r.ID          = 302;
            storage4r.Name        = "Storage MK. IV";
            storage4r.name        = "Storage MK. IV";
            storage4r.Description = "Holds twice as many items as a Storage MK. III";
            storage4r.description = "Holds twice as many items as a Storage MK. III";
            //storage4r.Items = new int[] { 1107, 1108 };   // The items required to craft it
            storage4r.Items = new int[] { 1101 };   // The items required to craft it
            //storage4r.ItemCounts = new int[] { 8, 12 };
            storage4r.ItemCounts = new int[] { 1 };
            storage4r.Results    = new int[] { 2104 }; // The result (Storage Mk IV)
            storage4r.GridIndex  = 2602;               // Where the recipe is located on the replicator. Format xyzz where x is the page, y is the row, and zz is the column
            storage4r.preTech    = preTechStorage4;    // Set the required technology to be able to access the recipe
            storage4r.SID        = storage4r.GridIndex.ToString();
            storage4r.sid        = storage4r.GridIndex.ToString();
            storage4.Name        = "Storage MK. IV";
            storage4.name        = "Storage MK. IV";
            storage4.Description = "Holds twice as many items as a Storage MK. III";
            storage4.description = "Holds twice as many items as a Storage MK. III";
            storage4.ID          = 2104;
            storage4.makes       = new List <RecipeProto>();
            storage4.BuildIndex  = 354;
            storage4.GridIndex   = storage4r.GridIndex;
            storage4.handcraft   = storage4r;
            storage4.maincraft   = storage4r;
            storage4.handcrafts  = new List <RecipeProto>()
            {
                storage4r
            };
            storage4.recipes = new List <RecipeProto>()
            {
                storage4r
            };
            storage4.prefabDesc            = storage2.prefabDesc.Copy();
            storage4.prefabDesc.modelIndex = storage4.ModelIndex;
            storage4.prefabDesc.storageCol = 20;
            storage4.prefabDesc.storageRow = 12;
            storage4.prefabDesc.isStorage  = true;

            LDBTool.PostAddProto(ProtoType.Recipe, storage4r);
            LDBTool.PostAddProto(ProtoType.Item, storage4);
        }
Esempio n. 7
0
        void AddCollectors()
        {
            var oriRecipe = LDB.recipes.Select(111);
            var oriItem   = LDB.items.Select(2105);

            var CollMk2Recipe = oriRecipe.Copy();
            var CollMk2       = oriItem.Copy();


            CollMk2Recipe.ID           = 450;
            CollMk2Recipe.Name         = "轨道采集器MkII";
            CollMk2Recipe.name         = "轨道采集器MkII".Translate();
            CollMk2Recipe.Items        = new int[] { 2105, 1119, 1125 };
            CollMk2Recipe.ItemCounts   = new int[] { 1, 20, 10 };
            CollMk2Recipe.Results      = new int[] { 9445 };
            CollMk2Recipe.ResultCounts = new int[] { 1 };
            CollMk2Recipe.GridIndex    = 2509;
            //CollMk2Recipe.SID = "2509";
            //CollMk2Recipe.sid = "2509".Translate();
            Traverse.Create(CollMk2Recipe).Field("_iconSprite").SetValue(iconmk2);
            CollMk2Recipe.TimeSpend = 1200;
            CollMk2Recipe.preTech   = LDB.techs.Select(1606);

            CollMk2.ID          = 9445;
            CollMk2.Name        = "轨道采集器MkII";
            CollMk2.name        = "轨道采集器MkII".Translate();
            CollMk2.Description = "轨道采集器mk2描述";
            CollMk2.description = "轨道采集器mk2描述".Translate();
            CollMk2.BuildIndex  = 1601;
            CollMk2.GridIndex   = 2210;
            CollMk2.handcraft   = CollMk2Recipe;
            CollMk2.handcrafts  = new List <RecipeProto> {
                CollMk2Recipe
            };
            //CollMk2.maincraft = CollMk2Recipe;
            CollMk2.recipes = new List <RecipeProto> {
                CollMk2Recipe
            };
            CollMk2.makes      = new List <RecipeProto>();
            CollMk2.prefabDesc = oriItem.prefabDesc.Copy();
            CollMk2.prefabDesc.stationCollectSpeed = 20;
            CollMk2.prefabDesc.stationMaxItemCount = 20000;
            CollMk2.prefabDesc.workEnergyPerTick   = 50000;
            Traverse.Create(CollMk2).Field("_iconSprite").SetValue(iconmk2);

            LDBTool.PostAddProto(ProtoType.Recipe, CollMk2Recipe);
            LDBTool.PostAddProto(ProtoType.Item, CollMk2);



            //原本的轨道采集器添加可合成物品
            oriItem.makes = new List <RecipeProto> {
                CollMk2Recipe
            };
        }
Esempio n. 8
0
        private void AddRecipe()
        {
            recipeSapling              = LDB.recipes.Select(5).Copy();
            recipeSapling.ID           = 220;
            recipeSapling.GridIndex    = 1610;
            recipeSapling.Type         = ERecipeType.Assemble;
            recipeSapling.Name         = "sapling";
            recipeSapling.name         = recipeSapling.Name.Translate();
            recipeSapling.Items        = new[] { 1030 };
            recipeSapling.ItemCounts   = new[] { 1 };
            recipeSapling.Results      = new[] { itemSapling.ID };
            recipeSapling.ResultCounts = new[] { 5 };
            recipeSapling.TimeSpend    = 30;
            recipeSapling.Description  = "";
            recipeSapling.description  = "";
            recipeSapling.preTech      = LDB.techs.Select(1121);
            Traverse.Create(recipeSapling).Field("_iconSprite").SetValue(_iconSapling);
            LDBTool.PostAddProto(ProtoType.Recipe, recipeSapling);

            recipePlant              = LDB.recipes.Select(23).Copy();
            recipePlant.ID           = 221;
            recipePlant.GridIndex    = 1611;
            recipePlant.Explicit     = true;
            recipePlant.Type         = ERecipeType.Chemical;
            recipePlant.Name         = "plantRecipe";
            recipePlant.name         = recipePlant.Name.Translate();
            recipePlant.Items        = new[] { itemSapling.ID, 1000 };
            recipePlant.ItemCounts   = new[] { 10, 20 };
            recipePlant.Results      = new[] { 1030, 1031 };
            recipePlant.ResultCounts = new[] { 12, 15 };
            recipePlant.TimeSpend    = 3600;
            recipePlant.Description  = "plantRecipeDesc";
            recipePlant.description  = recipePlant.Description.Translate();
            recipePlant.preTech      = LDB.techs.Select(1121);
            Traverse.Create(recipePlant).Field("_iconSprite").SetValue(_iconOriWood);
            LDBTool.PostAddProto(ProtoType.Recipe, recipePlant);

            recipeCharcoal              = LDB.recipes.Select(17).Copy();
            recipeCharcoal.ID           = 222;
            recipeCharcoal.GridIndex    = 1612;
            recipeCharcoal.Type         = ERecipeType.Smelt;
            recipeCharcoal.Name         = "";
            recipeCharcoal.name         = "";
            recipeCharcoal.Items        = new[] { 1030 };
            recipeCharcoal.ItemCounts   = new[] { 2 };
            recipeCharcoal.Results      = new[] { itemCharcoal.ID };
            recipeCharcoal.ResultCounts = new[] { 2 };
            recipeCharcoal.TimeSpend    = 120;
            recipeCharcoal.Description  = "";
            recipeCharcoal.description  = "";
            recipeCharcoal.preTech      = LDB.techs.Select(1401);
            Traverse.Create(recipeCharcoal).Field("_iconSprite").SetValue(_iconCharcoal);
            LDBTool.PostAddProto(ProtoType.Recipe, recipeCharcoal);
        }
Esempio n. 9
0
        public void AddTank2Data()
        {
            var tank  = LDB.items.Select(2106);
            var tankr = LDB.recipes.Select(114);

            // Load the required technology to access it
            var preTechTank2 = LDB.techs.Select(1123);

            // Copy the Protos to a new tank Mk III building
            ItemProto   tank2  = tank.Copy();
            RecipeProto tank2r = tankr.Copy();

            Traverse.Create(tank2).Field("_iconSprite").SetValue(tank.iconSprite);
            Traverse.Create(tank2r).Field("_iconSprite").SetValue(tank.iconSprite);

            tank2r.ID          = 10102;
            tank2r.Name        = "Storage tank MK. II";
            tank2r.name        = "Storage tank MK. II";
            tank2r.Description = "Holds 4x the fluid as a Storage tank MK. I";
            tank2r.description = "Holds 4x the fluid as a Storage tank MK. I";
            tank2r.Items       = new int[] { 1106, 1108, 1110 }; // The items required to craft it
            tank2r.ItemCounts  = new int[] { 16, 8, 8 };
            tank2r.Results     = new int[] { 10102 };            // The result (tank Mk III)
            tank2r.GridIndex   = 2602;                           // Where the recipe is located on the replicator. Format xyzz where x is the page, y is the row, and zz is the column
            tank2r.preTech     = preTechTank2;                   // Set the required technology to be able to access the recipe
            tank2r.SID         = tank2r.GridIndex.ToString();
            tank2r.sid         = tank2r.GridIndex.ToString();
            tank2.Name         = "Storage tank MK. II";
            tank2.name         = "Storage tank MK. II";
            tank2.Description  = "Holds 4x the fluid as a Storage tank MK. I";
            tank2.description  = "Holds 4x the fluid as a Storage tank MK. I";
            tank2.ID           = 10102;
            tank2.makes        = new List <RecipeProto>();
            tank2.BuildIndex   = 10102;
            tank2.GridIndex    = tank2r.GridIndex;
            tank2.handcraft    = tank2r;
            tank2.maincraft    = tank2r;
            tank2.handcrafts   = new List <RecipeProto>()
            {
                tank2r
            };
            tank2.recipes = new List <RecipeProto>()
            {
                tank2r
            };
            tank2.prefabDesc                   = tank.prefabDesc.Copy();
            tank2.prefabDesc.modelIndex        = tank2.ModelIndex;
            tank2.prefabDesc.isTank            = true;
            tank2.prefabDesc.fluidStorageCount = 40000;

            LDBTool.PostAddProto(ProtoType.Recipe, tank2r);
            LDBTool.PostAddProto(ProtoType.Item, tank2);
        }
Esempio n. 10
0
        void Addcoll2()
        {
            var oriRecipe      = LDB.recipes.Select(111);
            var oriItem        = LDB.items.Select(2105);
            var CollRefiRecipe = oriRecipe.Copy();
            var CollRefi       = oriItem.Copy();

            Console.WriteLine("2105's gridindex is" + oriItem.GridIndex);

            CollRefiRecipe.ID           = 451;
            CollRefiRecipe.Name         = "轨道精炼器";
            CollRefiRecipe.name         = "轨道精炼器".Translate();
            CollRefiRecipe.Items        = new int[] { 2105, 1125, 1305 };
            CollRefiRecipe.ItemCounts   = new int[] { 1, 20, 10 };
            CollRefiRecipe.Results      = new int[] { 9444 };
            CollRefiRecipe.ResultCounts = new int[] { 1 };
            CollRefiRecipe.GridIndex    = 2609;
            //CollRefiRecipe.SID = "2609";
            //CollRefiRecipe.sid = "2609".Translate();
            Traverse.Create(CollRefiRecipe).Field("_iconSprite").SetValue(iconrefi);
            CollRefiRecipe.TimeSpend = 1800;
            CollRefiRecipe.preTech   = LDB.techs.Select(1606);

            CollRefi.ID          = 9444;
            CollRefi.Name        = "轨道精炼器";
            CollRefi.name        = "轨道精炼器".Translate();
            CollRefi.Description = "轨道精炼器描述";
            CollRefi.description = "轨道精炼器描述".Translate();
            CollRefi.BuildIndex  = 1602;
            CollRefi.GridIndex   = 2211;
            CollRefi.handcraft   = CollRefiRecipe;
            CollRefi.handcrafts  = new List <RecipeProto> {
                CollRefiRecipe
            };
            //CollRefi.maincraft = CollRefiRecipe;
            CollRefi.recipes = new List <RecipeProto> {
                CollRefiRecipe
            };
            CollRefi.makes      = new List <RecipeProto>();
            CollRefi.prefabDesc = oriItem.prefabDesc.Copy();
            CollRefi.prefabDesc.stationCollectSpeed = 80;
            CollRefi.prefabDesc.stationMaxItemCount = 10000;
            CollRefi.prefabDesc.workEnergyPerTick   = 50000;
            Traverse.Create(CollRefi).Field("_iconSprite").SetValue(iconrefi);

            oriItem.makes.Add(CollRefiRecipe);

            LDBTool.PostAddProto(ProtoType.Recipe, CollRefiRecipe);
            LDBTool.PostAddProto(ProtoType.Item, CollRefi);
        }
Esempio n. 11
0
        public void AddSmelterMk2Data()
        {
            var smelter  = LDB.items.Select(2302);
            var smelterr = LDB.recipes.Select(56);

            // Copy the Protos to a new Storage Mk III building
            ItemProto   smelterMk2  = smelter.Copy();
            RecipeProto smelterMk2r = smelterr.Copy();

            Traverse.Create(smelterMk2).Field("_iconSprite").SetValue(smelter.iconSprite);
            Traverse.Create(smelterMk2r).Field("_iconSprite").SetValue(smelterr.iconSprite);

            smelterMk2r.ID          = 10001;
            smelterMk2r.Name        = "Smelter MK. II";
            smelterMk2r.name        = "Smelter MK. II".Translate();
            smelterMk2r.Description = "1.5x the speed of a Smelter MK. I";
            smelterMk2r.description = "1.5x the speed of a Smelter MK. I".Translate();
            smelterMk2r.Items       = new int[] { 2302, 1107, 1303, 1202 }; // The items required to craft it (Smelter, titanium alloy, processor, magnetic coil)
            //smelterMk2r.Items = new int[] { 1001 };   // The items required to craft it
            smelterMk2r.ItemCounts = new int[] { 1, 4, 4, 8 };
            //smelterMk2r.ItemCounts = new int[] { 1 };
            smelterMk2r.Results    = new int[] { 10001 }; // The result (Smelter MK 2)
            smelterMk2r.GridIndex  = 2405;                // Where the recipe is located on the replicator. Format xyzz where x is the page, y is the row, and zz is the column
            smelterMk2r.SID        = smelterMk2r.GridIndex.ToString();
            smelterMk2r.sid        = smelterMk2r.GridIndex.ToString();
            smelterMk2.Name        = "Smelter MK. II";
            smelterMk2.name        = "Smelter MK. II".Translate();
            smelterMk2.Description = "1.5x the speed of a Smelter MK. I";
            smelterMk2.description = "1.5x the speed of a Smelter MK. I".Translate();
            smelterMk2.ID          = 10001;
            smelterMk2.makes       = new List <RecipeProto>();
            smelterMk2.BuildIndex  = 508;
            smelterMk2.GridIndex   = smelterMk2r.GridIndex;
            smelterMk2.handcraft   = smelterMk2r;
            smelterMk2.maincraft   = smelterMk2r;
            smelterMk2.handcrafts  = new List <RecipeProto>()
            {
                smelterMk2r
            };
            smelterMk2.recipes = new List <RecipeProto>()
            {
                smelterMk2r
            };
            smelterMk2.prefabDesc                     = smelter.prefabDesc.Copy();
            smelterMk2.prefabDesc.modelIndex          = smelterMk2.ModelIndex;
            smelterMk2.prefabDesc.isAssembler         = true;
            smelterMk2.prefabDesc.assemblerSpeed      = 15000; // default is 10000
            smelterMk2.prefabDesc.assemblerRecipeType = ERecipeType.Smelt;
            smelterMk2.prefabDesc.idleEnergyPerTick   = 250;   // desired watts / 60
            smelterMk2.prefabDesc.workEnergyPerTick   = 10667; // desired watts / 60
            smelterMk2.Grade     = 2;
            smelterMk2.Upgrades  = new int[] { 2302, 10001, 10002 };
            smelterMk2.StackSize = 50;

            var processor  = LDB.techs.Select(1302);
            var metallugry = LDB.techs.Select(1401);

            TechProto mk2 = processor.Copy();

            Traverse.Create(mk2).Field("_iconSprite").SetValue(metallugry.iconSprite);

            mk2.name             = "Improved Metallurgy";
            mk2.Name             = "Improved Metallurgy";
            mk2.ID               = 505;
            mk2.SID              = "";
            mk2.sid              = "";
            mk2.Desc             = "Advances in computer components allow you to smelt items faster";
            mk2.description      = "Advances in computer components allow you to smelt items faster";
            mk2.Conclusion       = "";   // the message that appears when you unlock
            mk2.Published        = true; // false = accelerants
            mk2.Level            = 0;
            mk2.MaxLevel         = 0;
            mk2.Position         = new Vector2(33f, -4.75f);
            mk2.PreTechsImplicit = new int[] { 1401 };
            mk2.postTechArray    = new TechProto[] { };

            // I have no f*****g clue how exactly the amount of items is calculated, but this works so I'm sticking with it
            // What I did for now is just take the values for High-speed processing and manipulate them.
            // So the total blue for High-speed is 600, I wanted 800 for this research. 800 / 600 * 108000 (the HashNeeded for high-speed) = 144000
            // Set the items to blue and red jelly
            mk2.Items     = new int[] { 6001, 6002 };
            mk2.itemArray = new ItemProto[] { LDB.items.Select(6001), LDB.items.Select(6002) };
            // Time the labs take to use an item?
            mk2.ItemPoints = new int[] { 20, 10 };
            // Total hash
            mk2.HashNeeded = 144000;

            processor.postTechArray = new TechProto[] { LDB.techs.Select(1202), LDB.techs.Select(1312), mk2 };

            // Load the required technology to access it
            mk2.unlockRecipeArray = new RecipeProto[] { };
            mk2.UnlockRecipes     = new int[] { };
            smelterMk2r.preTech   = mk2;  // Set the required technology to be able to access the recipe

            LDBTool.PostAddProto(ProtoType.Tech, mk2);
            LDBTool.PostAddProto(ProtoType.Recipe, smelterMk2r);
            LDBTool.PostAddProto(ProtoType.Item, smelterMk2);
        }
Esempio n. 12
0
        /*
         * [HarmonyPrefix]
         * [HarmonyPatch(typeof(FactorySystem), "GameTick")]
         */

        void AddNewProtos()
        {
            var oriProductionRecipe = LDB.recipes.Select(75);
            var oriBuildingRecipe   = LDB.recipes.Select(39);
            var oriItem             = LDB.items.Select(2310);
            var oriMatrix           = LDB.items.Select(6006);


            //宇宙对撞机
            var UniverseColliderRecipe = oriBuildingRecipe.Copy();
            var UniverseCollider       = oriItem.Copy();

            UniverseColliderRecipe.ID           = 455;
            UniverseColliderRecipe.Name         = "宇宙对撞机";
            UniverseColliderRecipe.name         = "宇宙对撞机".Translate();
            UniverseColliderRecipe.Items        = new int[] { 1125, 1205, 1403, 1305 };
            UniverseColliderRecipe.ItemCounts   = new int[] { 300, 300, 150, 200 };
            UniverseColliderRecipe.Results      = new int[] { 9449 };
            UniverseColliderRecipe.ResultCounts = new int[] { 1 };
            UniverseColliderRecipe.GridIndex    = 2211;
            Traverse.Create(UniverseColliderRecipe).Field("_iconSprite").SetValue(iconA);
            UniverseColliderRecipe.TimeSpend = 60;
            UniverseColliderRecipe.preTech   = LDB.techs.Select(1508);

            UniverseCollider.ID          = 9449;
            UniverseCollider.Name        = "宇宙对撞机";
            UniverseCollider.name        = "宇宙对撞机".Translate();
            UniverseCollider.Description = "宇宙对撞机描述";
            UniverseCollider.description = "宇宙对撞机描述".Translate();
            UniverseCollider.BuildIndex  = 510;
            UniverseCollider.GridIndex   = 2211;
            UniverseCollider.handcraft   = UniverseColliderRecipe;
            UniverseCollider.handcrafts  = new List <RecipeProto> {
                UniverseColliderRecipe
            };
            UniverseCollider.maincraft = UniverseColliderRecipe;
            UniverseCollider.recipes   = new List <RecipeProto> {
                UniverseColliderRecipe
            };
            UniverseCollider.makes      = new List <RecipeProto>();
            UniverseCollider.prefabDesc = oriItem.prefabDesc.Copy();
            UniverseCollider.prefabDesc.assemblerRecipeType = ERecipeType.Research;
            UniverseCollider.prefabDesc.workEnergyPerTick   = 10000000;
            UniverseCollider.prefabDesc.idleEnergyPerTick   = 500000;
            Traverse.Create(UniverseCollider).Field("_iconSprite").SetValue(iconA);



            //Product
            var TruthMatrixRecipe = oriProductionRecipe.Copy();
            var TruthMatrix       = oriMatrix.Copy();

            TruthMatrixRecipe.Type         = ERecipeType.Research;
            TruthMatrixRecipe.ID           = 456;
            TruthMatrixRecipe.Name         = "真理矩阵";
            TruthMatrixRecipe.name         = "真理矩阵".Translate();
            TruthMatrixRecipe.Items        = new int[] { 6006, 1120 };
            TruthMatrixRecipe.ItemCounts   = new int[] { 1, 1 };
            TruthMatrixRecipe.Results      = new int[] { 9450 };
            TruthMatrixRecipe.ResultCounts = new int[] { 1 };
            TruthMatrixRecipe.GridIndex    = 1707;
            Traverse.Create(TruthMatrixRecipe).Field("_iconSprite").SetValue(iconB);
            TruthMatrixRecipe.TimeSpend = 900;
            TruthMatrixRecipe.preTech   = LDB.techs.Select(1508);


            TruthMatrix.ID          = 9450;
            TruthMatrix.Name        = "真理矩阵";
            TruthMatrix.name        = "真理矩阵".Translate();
            TruthMatrix.Potential   = 2147483647;
            TruthMatrix.Description = "真理矩阵描述";
            TruthMatrix.description = "真理矩阵描述".Translate();
            TruthMatrix.GridIndex   = 1707;
            TruthMatrix.maincraft   = TruthMatrixRecipe;
            TruthMatrix.recipes     = new List <RecipeProto> {
                TruthMatrixRecipe
            };
            Traverse.Create(TruthMatrix).Field("_iconSprite").SetValue(iconB);

            //真理矩阵分解公式
            var TruthSeekRecipe = TruthMatrixRecipe.Copy();

            TruthSeekRecipe.Explicit     = true;
            TruthSeekRecipe.Type         = ERecipeType.Research;
            TruthSeekRecipe.ID           = 457;
            TruthSeekRecipe.Name         = "探知真理";
            TruthSeekRecipe.name         = "探知真理".Translate();
            TruthSeekRecipe.Description  = "探知真理描述";
            TruthSeekRecipe.description  = "探知真理描述".Translate();
            TruthSeekRecipe.Items        = new int[] { 9450 };
            TruthSeekRecipe.ItemCounts   = new int[] { 1 };
            TruthSeekRecipe.Results      = new int[] { 6001, 6002, 6003, 6004, 6005 };
            TruthSeekRecipe.ResultCounts = new int[] { 2, 2, 2, 2, 2 };
            TruthSeekRecipe.GridIndex    = 1708;
            Traverse.Create(TruthSeekRecipe).Field("_iconSprite").SetValue(iconC);
            TruthSeekRecipe.TimeSpend = 900;
            TruthSeekRecipe.preTech   = LDB.techs.Select(1508);

            //宇宙矩阵增加可制作的配方
            oriMatrix.makes = new List <RecipeProto> {
                TruthMatrixRecipe
            };

            //真理矩阵增加可制作的配方
            TruthMatrix.makes = new List <RecipeProto> {
                TruthSeekRecipe
            };

            //将这些新东西加入到游戏中
            LDBTool.PostAddProto(ProtoType.Recipe, UniverseColliderRecipe);
            LDBTool.PostAddProto(ProtoType.Recipe, TruthMatrixRecipe);
            LDBTool.PostAddProto(ProtoType.Recipe, TruthSeekRecipe);
            LDBTool.PostAddProto(ProtoType.Item, UniverseCollider);
            LDBTool.PostAddProto(ProtoType.Item, TruthMatrix);

            try
            {
                LDBTool.SetBuildBar(5, 10, 9449);
            }
            catch (Exception)
            {
            }
        }
Esempio n. 13
0
        /*
         * [HarmonyPrefix]
         * [HarmonyPatch(typeof(FactorySystem), "GameTick")]
         * public static bool GameTickPatch(FactorySystem __instance)
         * {
         *  //var _this = __instance;
         *  //if (tickcount % 100 == 0)
         *  //{
         *  //    int i = 1;
         *  //    if (i < _this.minerCursor)
         *  //    {
         *  //        int ettid = _this.minerPool[i].entityId;
         *  //        int idid2 = _this.factory.entityPool[ettid].id;
         *  //        int prtid = _this.factory.entityPool[ettid].protoId;
         *  //        Console.WriteLine("prtid:" + prtid.ToString());
         *  //    }
         *  //}
         *  //tickcount += 1;
         *  return true;
         * }
         */

        void AddSmelterMiners()
        {
            var oriRecipe = LDB.recipes.Select(48);
            var oriItem   = LDB.items.Select(2301);
            //var smelterOri = LDB.items.Select(2302);
            //var chemiOri = LDB.items.Select(2309);
            var item1107 = LDB.items.Select(1107);
            var item1119 = LDB.items.Select(1119);
            var item1305 = LDB.items.Select(1305);


            //A
            var SMinerARecipe = oriRecipe.Copy();
            var SMinerA       = oriItem.Copy();

            SMinerARecipe.ID           = 452;
            SMinerARecipe.Name         = "熔炉采矿机A型";
            SMinerARecipe.name         = "熔炉采矿机A型".Translate();
            SMinerARecipe.Items        = new int[] { 2301, 1107, 1119 };
            SMinerARecipe.ItemCounts   = new int[] { 1, 10, 10 };
            SMinerARecipe.Results      = new int[] { 9446 };
            SMinerARecipe.ResultCounts = new int[] { 1 };
            SMinerARecipe.GridIndex    = 2311;
            //SMinerARecipe.SID = "2509";
            //SMinerARecipe.sid = "2509".Translate();
            Traverse.Create(SMinerARecipe).Field("_iconSprite").SetValue(iconA);
            SMinerARecipe.TimeSpend = 60;
            SMinerARecipe.preTech   = LDB.techs.Select(1126);

            SMinerA.ID          = 9446;
            SMinerA.Name        = "熔炉采矿机A型";
            SMinerA.name        = "熔炉采矿机A型".Translate();
            SMinerA.Description = "熔炉采矿机A型描述";
            SMinerA.description = "熔炉采矿机A型描述".Translate();
            SMinerA.BuildIndex  = 205;
            SMinerA.GridIndex   = 2311;
            SMinerA.handcraft   = SMinerARecipe;
            SMinerA.handcrafts  = new List <RecipeProto> {
                SMinerARecipe
            };
            SMinerA.maincraft = SMinerARecipe;
            SMinerA.recipes   = new List <RecipeProto> {
                SMinerARecipe
            };
            SMinerA.makes      = new List <RecipeProto>();
            SMinerA.prefabDesc = oriItem.prefabDesc.Copy();
            SMinerA.prefabDesc.workEnergyPerTick = 40000;
            SMinerA.prefabDesc.idleEnergyPerTick = 1000;
            Traverse.Create(SMinerA).Field("_iconSprite").SetValue(iconA);

            LDBTool.PostAddProto(ProtoType.Recipe, SMinerARecipe);
            LDBTool.PostAddProto(ProtoType.Item, SMinerA);


            //B
            var SMinerBRecipe = oriRecipe.Copy();
            var SMinerB       = oriItem.Copy();

            SMinerBRecipe.ID           = 453;
            SMinerBRecipe.Name         = "熔炉采矿机B型";
            SMinerBRecipe.name         = "熔炉采矿机B型".Translate();
            SMinerBRecipe.Items        = new int[] { 2301, 1107, 1119 };
            SMinerBRecipe.ItemCounts   = new int[] { 1, 10, 10 };
            SMinerBRecipe.Results      = new int[] { 9447 };
            SMinerBRecipe.ResultCounts = new int[] { 1 };
            SMinerBRecipe.GridIndex    = 2312;
            //SMinerBRecipe.SID = "2509";
            //SMinerBRecipe.sid = "2509".Translate();
            Traverse.Create(SMinerBRecipe).Field("_iconSprite").SetValue(iconB);
            SMinerBRecipe.TimeSpend = 60;
            SMinerBRecipe.preTech   = LDB.techs.Select(1126);

            SMinerB.ID          = 9447;
            SMinerB.Name        = "熔炉采矿机B型";
            SMinerB.name        = "熔炉采矿机B型".Translate();
            SMinerB.Description = "熔炉采矿机B型描述";
            SMinerB.description = "熔炉采矿机B型描述".Translate();
            SMinerB.BuildIndex  = 206;
            SMinerB.GridIndex   = 2312;
            SMinerB.handcraft   = SMinerBRecipe;
            SMinerB.handcrafts  = new List <RecipeProto> {
                SMinerBRecipe
            };
            SMinerB.maincraft = SMinerBRecipe;
            SMinerB.recipes   = new List <RecipeProto> {
                SMinerBRecipe
            };
            SMinerB.makes      = new List <RecipeProto>();
            SMinerB.prefabDesc = oriItem.prefabDesc.Copy();
            SMinerB.prefabDesc.workEnergyPerTick = 40000;
            SMinerB.prefabDesc.idleEnergyPerTick = 1000;
            Traverse.Create(SMinerB).Field("_iconSprite").SetValue(iconB);

            LDBTool.PostAddProto(ProtoType.Recipe, SMinerBRecipe);
            LDBTool.PostAddProto(ProtoType.Item, SMinerB);


            //C
            var SMinerCRecipe = oriRecipe.Copy();
            var SMinerC       = oriItem.Copy();

            SMinerCRecipe.ID           = 454;
            SMinerCRecipe.Name         = "化工采矿机C型";
            SMinerCRecipe.name         = "化工采矿机C型".Translate();
            SMinerCRecipe.Items        = new int[] { 2301, 1107, 1305 };
            SMinerCRecipe.ItemCounts   = new int[] { 1, 20, 5 };
            SMinerCRecipe.Results      = new int[] { 9448 };
            SMinerCRecipe.ResultCounts = new int[] { 1 };
            SMinerCRecipe.GridIndex    = 2412;
            //SMinerCRecipe.SID = "2509";
            //SMinerCRecipe.sid = "2509".Translate();
            Traverse.Create(SMinerCRecipe).Field("_iconSprite").SetValue(iconC);
            SMinerCRecipe.TimeSpend = 60;
            SMinerCRecipe.preTech   = LDB.techs.Select(1303);

            SMinerC.ID          = 9448;
            SMinerC.Name        = "化工采矿机C型";
            SMinerC.name        = "化工采矿机C型".Translate();
            SMinerC.Description = "化工采矿机C型描述";
            SMinerC.description = "化工采矿机C型描述".Translate();
            SMinerC.BuildIndex  = 207;
            SMinerC.GridIndex   = 2412;
            SMinerC.handcraft   = SMinerCRecipe;
            SMinerC.handcrafts  = new List <RecipeProto> {
                SMinerCRecipe
            };
            SMinerC.maincraft = SMinerCRecipe;
            SMinerC.recipes   = new List <RecipeProto> {
                SMinerCRecipe
            };
            SMinerC.makes      = new List <RecipeProto>();
            SMinerC.prefabDesc = oriItem.prefabDesc.Copy();
            SMinerC.prefabDesc.workEnergyPerTick = 80000;
            SMinerC.prefabDesc.idleEnergyPerTick = 2000;
            Traverse.Create(SMinerC).Field("_iconSprite").SetValue(iconC);

            LDBTool.PostAddProto(ProtoType.Recipe, SMinerCRecipe);
            LDBTool.PostAddProto(ProtoType.Item, SMinerC);


            //快速建造栏
            try
            {
                LDBTool.SetBuildBar(2, 5, 9446);
                LDBTool.SetBuildBar(2, 6, 9447);
                LDBTool.SetBuildBar(2, 7, 9448);
            }
            catch (Exception)
            {
            }


            //原本的轨道采集器添加可合成物品
            oriItem.makes = new List <RecipeProto> {
                SMinerARecipe, SMinerBRecipe, SMinerCRecipe
            };
            //smelterOri.makes = new List<RecipeProto> { SMinerARecipe, SMinerBRecipe };
            //chemiOri.makes = new List<RecipeProto> { SMinerCRecipe };
            item1107.makes.Add(SMinerARecipe);
            item1107.makes.Add(SMinerBRecipe);
            item1107.makes.Add(SMinerCRecipe);
            item1119.makes.Add(SMinerARecipe);
            item1119.makes.Add(SMinerBRecipe);
            item1305.makes.Add(SMinerCRecipe);
        }
Esempio n. 14
0
        public void AddSmelterMk3Data()
        {
            var smelter  = LDB.items.Select(2302);
            var smelterr = LDB.recipes.Select(56);

            // Copy the Protos to a new Storage Mk III building
            ItemProto   smelterMk3  = smelter.Copy();
            RecipeProto smelterMk3r = smelterr.Copy();

            Traverse.Create(smelterMk3).Field("_iconSprite").SetValue(smelter.iconSprite);
            Traverse.Create(smelterMk3r).Field("_iconSprite").SetValue(smelterr.iconSprite);

            smelterMk3r.ID          = 10002;
            smelterMk3r.Name        = "Smelter MK. III";
            smelterMk3r.name        = "Smelter MK. III".Translate();
            smelterMk3r.Description = "2x the speed of a Smelter MK. I";
            smelterMk3r.description = "2x the speed of a Smelter MK. I".Translate();
            smelterMk3r.Items       = new int[] { 10001, 1206, 1305, 1202 }; // The items required to craft it
            //smelterMk3r.Items = new int[] { 1001 };
            smelterMk3r.ItemCounts = new int[] { 1, 8, 2, 20 };
            //smelterMk3r.ItemCounts = new int[] { 1 };
            smelterMk3r.Results    = new int[] { 10002 };
            smelterMk3r.GridIndex  = 2406;    // Where the recipe is located on the replicator. Format xyzz where x is the page, y is the row, and zz is the column
            smelterMk3r.SID        = smelterMk3r.GridIndex.ToString();
            smelterMk3r.sid        = smelterMk3r.GridIndex.ToString();
            smelterMk3.Name        = "Smelter MK. III";
            smelterMk3.name        = "Smelter MK. III".Translate();
            smelterMk3.Description = "2x the speed of a Smelter MK. I";
            smelterMk3.description = "2x the speed of a Smelter MK. I".Translate();
            smelterMk3.ID          = 10002;
            smelterMk3.makes       = new List <RecipeProto>();
            smelterMk3.BuildIndex  = 10002;
            smelterMk3.GridIndex   = smelterMk3r.GridIndex;
            smelterMk3.handcraft   = smelterMk3r;
            smelterMk3.maincraft   = smelterMk3r;
            smelterMk3.handcrafts  = new List <RecipeProto>()
            {
                smelterMk3r
            };
            smelterMk3.recipes = new List <RecipeProto>()
            {
                smelterMk3r
            };
            smelterMk3.prefabDesc                     = smelter.prefabDesc.Copy();
            smelterMk3.prefabDesc.modelIndex          = smelterMk3.ModelIndex;
            smelterMk3.prefabDesc.isAssembler         = true;
            smelterMk3.prefabDesc.assemblerSpeed      = 20000;
            smelterMk3.prefabDesc.assemblerRecipeType = ERecipeType.Smelt;
            smelterMk3.prefabDesc.idleEnergyPerTick   = 300;   // desired watts / 60
            smelterMk3.prefabDesc.workEnergyPerTick   = 15000; // desired watts / 60
            smelterMk3.Grade     = 3;
            smelterMk3.Upgrades  = new int[] { 2302, 10001, 10002 };
            smelterMk3.StackSize = 50;

            var quantum    = LDB.techs.Select(1303);
            var metallurgy = LDB.techs.Select(1401);

            TechProto mk3 = quantum.Copy();

            Traverse.Create(mk3).Field("_iconSprite").SetValue(metallurgy.iconSprite);

            mk3.name             = "Quantum Metallurgy";
            mk3.Name             = "Quantum Metallurgy";
            mk3.ID               = 506;
            mk3.SID              = "";
            mk3.sid              = "";
            mk3.Desc             = "Quantum mechanics can be utilised to smelt at super speeds";
            mk3.description      = "Quantum mechanics can be utilised to smelt at super speeds";
            mk3.Conclusion       = "";
            mk3.Published        = true;
            mk3.Level            = 0;
            mk3.MaxLevel         = 0;
            mk3.Position         = new Vector2(49f, -15f);
            mk3.PreTechsImplicit = new int[] { };
            mk3.postTechArray    = new TechProto[] { };
            mk3.PreTechsImplicit = new int[] { 505 };
            mk3.PreTechs         = new int[] { 1303 };
            mk3.Items            = new int[] { 6001, 6002, 6003, 6004 };
            mk3.itemArray        = new ItemProto[] { LDB.items.Select(6001), LDB.items.Select(6002), LDB.items.Select(6003), LDB.items.Select(6004) };
            mk3.ItemPoints       = new int[] { 10, 10, 10, 10 };
            mk3.HashNeeded       = 432000;

            quantum.postTechArray = new TechProto[] { LDB.techs.Select(1705), LDB.techs.Select(1203), mk3 };

            // Load the required technology to access it
            mk3.unlockRecipeArray = new RecipeProto[] { };
            mk3.UnlockRecipes     = new int[] { };
            smelterMk3r.preTech   = mk3;  // Set the required technology to be able to access the recipe

            LDBTool.PostAddProto(ProtoType.Tech, mk3);
            LDBTool.PostAddProto(ProtoType.Recipe, smelterMk3r);
            LDBTool.PostAddProto(ProtoType.Item, smelterMk3);
        }
Esempio n. 15
0
        /// <summary>
        /// 添加传送带数据
        /// </summary>
        void AddBeltData()
        {
            // 因为部分数据可以复用,所以直接从现有库中读取
            var belt3   = LDB.items.Select(2003);
            var belt3r  = LDB.recipes.Select(92);
            var preTech = LDB.techs.Select(1605);

            ItemProto   belt4  = belt3.Copy();
            RecipeProto belt4r = belt3r.Copy();
            ItemProto   belt5  = belt3.Copy();
            RecipeProto belt5r = belt3r.Copy();

            // MK.I
            Traverse.Create(belt4).Field("_iconSprite").SetValue(belt4Icon);
            Traverse.Create(belt4r).Field("_iconSprite").SetValue(belt4Icon);
            belt4r.ID          = 201;
            belt4r.Name        = "超级传送带MKI";
            belt4r.name        = "超级传送带MKI".Translate();
            belt4r.Description = "超级传送带MKI描述";
            belt4r.description = "超级传送带MKI描述".Translate();
            belt4r.Items       = new int[] { 2003, 1205, 1406 }; // 合成材料
            belt4r.Results     = new int[] { 2004 };             // 合成结果
            belt4r.GridIndex   = 2501;                           // 在合成表中的位置,第2页,第5排,第1个
            belt4r.preTech     = preTech;
            belt4r.SID         = belt4r.GridIndex.ToString();
            belt4r.sid         = belt4r.GridIndex.ToString();
            belt4.Name         = "超级传送带MKI";
            belt4.name         = "超级传送带MKI".Translate();
            belt4.Description  = "超级传送带MKI描述";
            belt4.description  = "超级传送带MKI描述".Translate();
            belt4.ID           = 2004;
            belt4.makes        = new List <RecipeProto>();
            belt4.BuildIndex   = 304; // 不要和现有序号重复
            belt4.GridIndex    = belt4r.GridIndex;
            belt4.handcraft    = belt4r;
            belt4.maincraft    = belt4r;
            belt4.handcrafts   = new List <RecipeProto>()
            {
                belt4r
            };
            belt4.recipes = new List <RecipeProto>()
            {
                belt4r
            };                                                  // 设置有哪些配方可以合成此物品(用于UI显示)
            belt4.prefabDesc               = belt3.prefabDesc.Copy();
            belt4.prefabDesc.modelIndex    = belt4.ModelIndex;
            belt4.prefabDesc.beltSpeed     = 10;
            belt4.prefabDesc.beltPrototype = 2004;
            belt4.prefabDesc.isBelt        = true;
            belt4.Grade = 4;

            // MK.II
            Traverse.Create(belt5).Field("_iconSprite").SetValue(belt5Icon);
            Traverse.Create(belt5r).Field("_iconSprite").SetValue(belt5Icon);
            belt5r.ID          = 202;
            belt5r.Name        = "超级传送带MKII";
            belt5r.name        = "超级传送带MKII".Translate();
            belt5r.Description = "超级传送带MKII描述";
            belt5r.description = "超级传送带MKII描述".Translate();
            belt5r.Items       = new int[] { 2004, 1205, 1210 }; // 合成材料
            belt5r.Results     = new int[] { 2005 };             // 合成结果
            belt5r.GridIndex   = 2502;                           // 在合成表中的位置,第2页,第5排,第2个
            belt5r.preTech     = preTech;
            belt5r.SID         = belt5r.GridIndex.ToString();
            belt5r.sid         = belt5r.GridIndex.ToString();
            belt5.Name         = "超级传送带MKII";
            belt5.name         = "超级传送带MKII".Translate();
            belt5.Description  = "超级传送带MKII描述";
            belt5.description  = "超级传送带MKII描述".Translate();
            belt5.ID           = 2005;
            belt5.makes        = new List <RecipeProto>();
            belt5.BuildIndex   = 305; // 不要和现有序号重复
            belt5.GridIndex    = belt5r.GridIndex;
            belt5.handcraft    = belt5r;
            belt5.maincraft    = belt5r;
            belt5.handcrafts   = new List <RecipeProto>()
            {
                belt5r
            };
            belt5.recipes = new List <RecipeProto>()
            {
                belt5r
            };                                                  // 设置有哪些配方可以合成此物品(用于UI显示)
            belt5.prefabDesc               = belt3.prefabDesc.Copy();
            belt5.prefabDesc.modelIndex    = belt5.ModelIndex;
            belt5.prefabDesc.beltSpeed     = 20;
            belt5.prefabDesc.beltPrototype = 2005;
            belt5.prefabDesc.isBelt        = true;
            belt5.Grade = 5;

            LDBTool.PostAddProto(ProtoType.Recipe, belt4r);
            LDBTool.PostAddProto(ProtoType.Item, belt4);
            LDBTool.PostAddProto(ProtoType.Recipe, belt5r);
            LDBTool.PostAddProto(ProtoType.Item, belt5);
            AddMatAndMesh();
        }
Esempio n. 16
0
        void AddBall()
        {
            ItemProto   oldBall           = LDB.items.Select(2210);
            ItemProto   PenroseBall       = oldBall.Copy();
            RecipeProto PenroseBallRecipe = LDB.recipes.Select(43).Copy();

            PenroseBallRecipe.ID          = 311;
            PenroseBallRecipe.Name        = "人造黑洞";
            PenroseBallRecipe.name        = "人造黑洞".Translate();
            PenroseBallRecipe.Description = "人造黑洞描述";
            PenroseBallRecipe.description = "人造黑洞描述".Translate();

            PenroseBallRecipe.Items      = new int[] { 2210, 1125, 1127, 1501, 6006 };
            PenroseBallRecipe.ItemCounts = new int[] { 1, 50, 50, 50, 50 };
            PenroseBallRecipe.Results    = new int[] { 9011 };

            PenroseBallRecipe.GridIndex = 2605;
            PenroseBallRecipe.preTech   = LDB.techs.Select(1508);
            PenroseBallRecipe.SID       = PenroseBallRecipe.GridIndex.ToString();
            PenroseBallRecipe.sid       = PenroseBallRecipe.GridIndex.ToString();

            PenroseBall.ID          = 9011;
            PenroseBall.Name        = "人造黑洞";
            PenroseBall.name        = "人造黑洞".Translate();
            PenroseBall.Description = "人造黑洞描述";
            PenroseBall.description = "人造黑洞描述".Translate();
            PenroseBall.BuildIndex  = 1011;
            PenroseBall.GridIndex   = PenroseBallRecipe.GridIndex;

            PenroseBall.handcraft  = PenroseBallRecipe;
            PenroseBall.maincraft  = PenroseBallRecipe;
            PenroseBall.handcrafts = new List <RecipeProto>()
            {
                PenroseBallRecipe
            };
            PenroseBall.recipes = new List <RecipeProto>()
            {
                PenroseBallRecipe
            };
            PenroseBall.makes = new List <RecipeProto>()
            {
            };

            PenroseBall.prefabDesc            = oldBall.prefabDesc.Copy();
            PenroseBall.prefabDesc.modelIndex = PenroseBall.ModelIndex;


            PenroseBall.prefabDesc.isCollectStation    = false;
            PenroseBall.prefabDesc.stationCollectSpeed = 0;

            Traverse.Create(PenroseBall).Field("_iconSprite").SetValue(icon);
            Traverse.Create(PenroseBallRecipe).Field("_iconSprite").SetValue(icon);



            //改燃料类型
            List <int[]> fuelNeedCopy = new List <int[]>();

            foreach (int[] line in ItemProto.fuelNeeds)
            {
                fuelNeedCopy.Add(line);
            }

            List <int> addFuel = new List <int>();

            foreach (int id in ItemProto.itemIds)
            {
                addFuel.Add(id);
            }
            fuelNeedCopy.Add(addFuel.ToArray());
            ItemProto.fuelNeeds             = fuelNeedCopy.ToArray();
            PenroseBall.prefabDesc.fuelMask = ItemProto.fuelNeeds.Length - 1;

            //改为用电设备
            PenroseBall.prefabDesc.isPowerCharger    = true;
            PenroseBall.prefabDesc.workEnergyPerTick = 350000 * 5000;
            PenroseBall.prefabDesc.idleEnergyPerTick = 350000 * 5000;
            PenroseBall.prefabDesc.genEnergyPerTick  = (long)350000 * (long)10000;
            PenroseBall.prefabDesc.useFuelPerTick   *= 1000;

            foreach (var mat in PenroseBall.prefabDesc.materials)
            {
                mat.color = new Color(34f / 255f, 217f / 255f, 188f / 255f);
            }

            LDBTool.PostAddProto(ProtoType.Item, PenroseBall);
            LDBTool.PostAddProto(ProtoType.Recipe, PenroseBallRecipe);

            try
            {
                LDBTool.SetBuildBar(8, 5, PenroseBall.ID);
            }
            catch
            {
            }
        }