예제 #1
0
        internal static void PatchBatteries()
        {
            if (!TechTypeHandler.ModdedTechTypeExists("DeepPowerCell"))
            {
                var tabIcon = ImageUtils.LoadSpriteFromFile(@"./Qmods/" + Assets + @"/TabIcon.png");
                CraftTreeHandler.AddTabNode(CraftTree.Type.Fabricator, BatCraftTab, "Batteries and Power Cells", tabIcon, ResCraftTab, ElecCraftTab);
                SeraLogger.Message(Main.modName, "MidGameBatteries not installed, creating new crafting tab");

                CraftTreeHandler.RemoveNode(CraftTree.Type.Fabricator, ResCraftTab, ElecCraftTab, TechType.Battery.ToString());
                CraftTreeHandler.RemoveNode(CraftTree.Type.Fabricator, ResCraftTab, ElecCraftTab, TechType.PrecursorIonBattery.ToString());
                CraftTreeHandler.RemoveNode(CraftTree.Type.Fabricator, ResCraftTab, ElecCraftTab, TechType.PowerCell.ToString());
                CraftTreeHandler.RemoveNode(CraftTree.Type.Fabricator, ResCraftTab, ElecCraftTab, TechType.PrecursorIonPowerCell.ToString());

                CraftTreeHandler.AddCraftingNode(CraftTree.Type.Fabricator, TechType.Battery, CraftPath);
                CraftTreeHandler.AddCraftingNode(CraftTree.Type.Fabricator, TechType.PowerCell, CraftPath);
                CraftTreeHandler.AddCraftingNode(CraftTree.Type.Fabricator, TechType.PrecursorIonBattery, CraftPath);
                CraftTreeHandler.AddCraftingNode(CraftTree.Type.Fabricator, TechType.PrecursorIonPowerCell, CraftPath);
            }
            else
            {
                SeraLogger.Message(Main.modName, "MidGameBatteries installed, adding to crafting tab");
            }
            var enzBatt = new EnzymeBattery();

            enzBatt.Patch();
            var enzPC = new EnzymePowerCell(enzBatt);

            enzPC.Patch();
            var enzBatt2 = new KharaaBattery();

            enzBatt2.Patch();
            var enzPC2 = new KharaaPowerCell(enzBatt2);

            enzPC2.Patch();
        }
        public KharaaPowerCell(KharaaBattery khaBatt)
            : base(classID: "BiochemPowerCell", friendlyName: "Biochemical Power Cell", description: "Based on the power units that supply nearly perpetual power to the Warpers. Does not receive power from their power source, however.")
        {
            if (!khaBatt.IsPatched)
            {
                khaBatt.Patch();
            }

            OnFinishedPatching += SetStaticTechType;
        }