public WallMonitor1() // Feeds abstract class { this.ClassID = "WallMonitor1"; // 0782292e-d313-468a-8816-2adba65bfba3 this.ResourcePath = "WorldEntities/Doodads/Debris/Wrecks/Decoration/wall_monitor_01_01"; this.GameObject = Resources.Load <GameObject>(this.ResourcePath); this.SignObject = Resources.Load <GameObject>("Submarine/Build/Sign"); this.TechType = TechTypePatcher.AddTechType(this.ClassID, LanguageHelper.GetFriendlyWord("WallMonitor1Name"), LanguageHelper.GetFriendlyWord("WallMonitor1Description"), true); this.Recipe = new TechDataHelper() { _craftAmount = 1, _ingredients = new List <IngredientHelper>(new IngredientHelper[2] { new IngredientHelper(TechType.CopperWire, 1), new IngredientHelper(TechType.Glass, 1) }), _techType = this.TechType }; }
TechType ITechTypeHandlerInternal.AddTechType(string modName, string internalName, string displayName, string tooltip, bool unlockAtStart) { // Register the TechType. TechType techType = TechTypePatcher.AddTechType(internalName); // Remember which Assembly added it Assembly mod = ReflectionHelper.CallingAssemblyByStackTrace(); TechTypesAddedBy[techType] = mod; // Register Language lines. LanguagePatcher.AddCustomLanguageLine(modName, internalName, displayName); LanguagePatcher.AddCustomLanguageLine(modName, "Tooltip_" + internalName, tooltip); Dictionary <TechType, string> valueToString = TooltipFactory.techTypeTooltipStrings.valueToString; valueToString[techType] = "Tooltip_" + internalName; // Unlock the TechType on start if (unlockAtStart) { KnownTechPatcher.UnlockedAtStart.Add(techType); } // Return the new TechType. return(techType); }
public Marki2() { this.ClassID = "MarkiDoll2"; // ad5e149b-d35c-4b46-bb4e-b4c0a9c6e668 this.ResourcePath = "Submarine/Build/Marki_03"; this.GameObject = Resources.Load <GameObject>(this.ResourcePath); this.TechType = TechTypePatcher.AddTechType(this.ClassID, LanguageHelper.GetFriendlyWord("MarkiDollName"), LanguageHelper.GetFriendlyWord("MarkiDollDescription"), true); if (ConfigSwitcher.MarkiDoll2_asBuildable) { this.IsHabitatBuilder = true; } this.Recipe = new TechDataHelper() { _craftAmount = 1, _ingredients = new List <IngredientHelper>(new IngredientHelper[2] { new IngredientHelper(TechType.FiberMesh, 1), new IngredientHelper(TechType.Glass, 1) }), _techType = this.TechType }; }
public ForkLiftDoll() { // Feed DecortionItem interface this.ClassID = "ForkLiftDoll"; this.ResourcePath = DecorationItem.DefaultResourcePath + this.ClassID; this.GameObject = AssetsHelper.Assets.LoadAsset <GameObject>("forkliftdoll"); this.TechType = TechTypePatcher.AddTechType(this.ClassID, LanguageHelper.GetFriendlyWord("ForkLiftDollName"), LanguageHelper.GetFriendlyWord("ForkLiftDollDescription"), true); if (ConfigSwitcher.Forklift_asBuidable) { this.IsHabitatBuilder = true; } this.Recipe = new TechDataHelper() { _craftAmount = 1, _ingredients = new List <IngredientHelper>(new IngredientHelper[3] { new IngredientHelper(TechType.Titanium, 1), new IngredientHelper(TechType.Glass, 1), new IngredientHelper(TechType.Silicone, 1) }), _techType = this.TechType }; }
public SeamothDoll() // Feeds abstract class { this.ClassID = "SeamothDoll"; this.ResourcePath = DecorationItem.DefaultResourcePath + this.ClassID; this.GameObject = AssetsHelper.Assets.LoadAsset <GameObject>("seamothpuppet"); this.TechType = TechTypePatcher.AddTechType(this.ClassID, LanguageHelper.GetFriendlyWord("SeamothDollName"), LanguageHelper.GetFriendlyWord("SeamothDollDescription"), true); this.IsHabitatBuilder = true; this.Recipe = new TechDataHelper() { _craftAmount = 1, _ingredients = new List <IngredientHelper>(new IngredientHelper[3] { new IngredientHelper(TechType.Titanium, 1), new IngredientHelper(TechType.Glass, 1), new IngredientHelper(TechType.Silicone, 1) }), _techType = this.TechType }; }
public Marki1() { this.ClassID = "MarkiDoll1"; // cb89366d-eac0-4011-8665-fafde75b215c this.ResourcePath = "Submarine/Build/Marki_01"; this.GameObject = Resources.Load <GameObject>(this.ResourcePath); this.TechType = TechTypePatcher.AddTechType(this.ClassID, LanguageHelper.GetFriendlyWord("MarkiDollName"), LanguageHelper.GetFriendlyWord("MarkiDollDescription"), true); if (ConfigSwitcher.MarkiDoll1_asBuildable) { this.IsHabitatBuilder = true; } this.Recipe = new TechDataHelper() { _craftAmount = 1, _ingredients = new List <IngredientHelper>(new IngredientHelper[2] { new IngredientHelper(TechType.FiberMesh, 1), new IngredientHelper(TechType.Glass, 1) }), _techType = this.TechType }; }
public BarFood2() // Feeds abstract class { this.ClassID = "BarFood2"; this.ResourcePath = DecorationItem.DefaultResourcePath + this.ClassID; this.GameObject = AssetsHelper.Assets.LoadAsset <GameObject>("barfood02"); this.TechType = TechTypePatcher.AddTechType(this.ClassID, LanguageHelper.GetFriendlyWord("BarFood2Name"), LanguageHelper.GetFriendlyWord("BarFood2Description"), true); this.Recipe = new TechDataHelper() { _craftAmount = 1, _ingredients = new List <IngredientHelper>(new IngredientHelper[4] { new IngredientHelper(TechType.Titanium, 1), new IngredientHelper(TechType.DisinfectedWater, 1), new IngredientHelper(TechType.CuredReginald, 1), new IngredientHelper(TechType.Melon, 1) }), _techType = this.TechType }; }
public static void PostPatch() { FishPatcher.Patch(harmony); TechTypePatcher.Patch(); CraftTreeTypePatcher.Patch(); PingTypePatcher.Patch(); EnumPatcher.Patch(harmony); CraftDataPatcher.Patch(harmony); CraftTreePatcher.Patch(harmony); ConsoleCommandsPatcher.Patch(harmony); LanguagePatcher.Patch(harmony); PrefabDatabasePatcher.PostPatch(harmony); SpritePatcher.Patch(); KnownTechPatcher.Patch(harmony); BioReactorPatcher.Patch(); OptionsPanelPatcher.Patch(harmony); ItemsContainerPatcher.Patch(harmony); PDAPatcher.Patch(harmony); PDAEncyclopediaPatcher.Patch(harmony); ItemActionPatcher.Patch(harmony); LootDistributionPatcher.Patch(harmony); WorldEntityDatabasePatcher.Patch(harmony); IngameMenuPatcher.Patch(harmony); TooltipPatcher.Patch(harmony); Logger.Debug("Saving TechType Cache"); TechTypePatcher.cacheManager.SaveCache(); Logger.Debug("Saving CraftTreeType Cache"); CraftTreeTypePatcher.cacheManager.SaveCache(); }
public WallMonitor3() // Feeds abstract class { this.ClassID = "WallMonitor3"; //cb612e1b-d57a-44f5-a043-a886eb17e5a6 this.ResourcePath = "WorldEntities/Doodads/Debris/Wrecks/Decoration/wall_monitor_01_03"; this.GameObject = Resources.Load <GameObject>(this.ResourcePath); this.SignObject = Resources.Load <GameObject>("Submarine/Build/Sign"); this.TechType = TechTypePatcher.AddTechType(this.ClassID, LanguageHelper.GetFriendlyWord("WallMonitor3Name"), LanguageHelper.GetFriendlyWord("WallMonitor3Description"), true); this.Recipe = new TechDataHelper() { _craftAmount = 1, _ingredients = new List <IngredientHelper>(new IngredientHelper[2] { new IngredientHelper(TechType.ComputerChip, 1), new IngredientHelper(TechType.Glass, 1) }), _techType = this.TechType }; }
public JackSepticEye() { this.ClassID = "JackSepticEyeDoll"; // 07a05a2f-de55-4c60-bfda-cedb3ab72b88 this.ResourcePath = "Submarine/Build/jacksepticeye"; this.GameObject = Resources.Load <GameObject>(this.ResourcePath); this.TechType = TechTypePatcher.AddTechType(this.ClassID, LanguageHelper.GetFriendlyWord("JackSepticEyeName"), LanguageHelper.GetFriendlyWord("JackSepticEyeDescription"), true); if (ConfigSwitcher.JackSepticEye_asBuildable) { this.IsHabitatBuilder = true; } this.Recipe = new TechDataHelper() { _craftAmount = 1, _ingredients = new List <IngredientHelper>(new IngredientHelper[2] { new IngredientHelper(TechType.Titanium, 1), new IngredientHelper(TechType.Glass, 1) }), _techType = this.TechType }; }
public LabCart() // Feeds abstract class { this.ClassID = "LabCart"; //af165b07-a2a3-4d85-8ad7-0c801334c115 this.ResourcePath = "WorldEntities/Doodads/Debris/Wrecks/Decoration/discovery_lab_cart_01"; this.GameObject = Resources.Load <GameObject>(this.ResourcePath); this.TechType = TechTypePatcher.AddTechType(this.ClassID, LanguageHelper.GetFriendlyWord("LabCartName"), LanguageHelper.GetFriendlyWord("LabCartDescription"), true); if (ConfigSwitcher.LabCart_asBuildable) { this.IsHabitatBuilder = true; } this.Recipe = new TechDataHelper() { _craftAmount = 1, _ingredients = new List <IngredientHelper>(new IngredientHelper[1] { new IngredientHelper(TechType.Titanium, 1) }), _techType = this.TechType }; }
TechType ITechTypeHandlerInternal.AddTechType(Assembly modAssembly, string internalName, string displayName, string tooltip, bool unlockAtStart) { string modName = modAssembly.GetName().Name; // Register the TechType. var techType = TechTypePatcher.AddTechType(internalName); // Remember which Assembly added it TechTypesAddedBy[techType] = modAssembly; // register Language Lines. LanguagePatcher.AddCustomLanguageLine(modName, internalName, displayName); LanguagePatcher.AddCustomLanguageLine(modName, "Tooltip_" + internalName, tooltip); Dictionary <TechType, string> valueToString = TooltipFactory.techTypeTooltipStrings.valueToString; valueToString[techType] = "Tooltip_" + internalName; // Unlock the TechType on start if (unlockAtStart) { KnownTechPatcher.UnlockedAtStart.Add(techType); } // Return the new TechType. return(techType); }
public WallMonitor2() // Feeds abstract class { this.ClassID = "WallMonitor2"; //6a5c9533-75e5-47c6-a16e-0f5f71e14f4f this.ResourcePath = "WorldEntities/Doodads/Debris/Wrecks/Decoration/wall_monitor_01_02"; this.GameObject = Resources.Load <GameObject>(this.ResourcePath); this.SignObject = Resources.Load <GameObject>("Submarine/Build/Sign"); this.TechType = TechTypePatcher.AddTechType(this.ClassID, LanguageHelper.GetFriendlyWord("WallMonitor2Name"), LanguageHelper.GetFriendlyWord("WallMonitor2Description"), true); this.Recipe = new TechDataHelper() { _craftAmount = 1, _ingredients = new List <IngredientHelper>(new IngredientHelper[2] { new IngredientHelper(TechType.CopperWire, 1), new IngredientHelper(TechType.Glass, 1) }), _techType = this.TechType }; }
public EatMyDiction() { this.ClassID = "MarlaCat"; // c96baff4-0993-4893-8345-adb8709901a7 this.ResourcePath = "Submarine/Build/Eatmydiction"; this.GameObject = Resources.Load <GameObject>(this.ResourcePath); this.TechType = TechTypePatcher.AddTechType(this.ClassID, LanguageHelper.GetFriendlyWord("MarlaCatName"), LanguageHelper.GetFriendlyWord("MarlaCatDescription"), true); if (ConfigSwitcher.EatMyDiction_asBuidable) { this.IsHabitatBuilder = true; } this.Recipe = new TechDataHelper() { _craftAmount = 1, _ingredients = new List <IngredientHelper>(new IngredientHelper[1] { new IngredientHelper(TechType.FiberMesh, 2) }), _techType = this.TechType }; }
public static void RegisterFloraFabricator(List <IDecorationItem> decorationItems) { Logger.Log("Creating flora craft tree..."); CustomCraftTreeRoot customTreeRootNode = CreateFloraTree(out CraftTree.Type craftType, decorationItems); FloraTreeType = craftType; Logger.Log("Registering flora fabricator..."); // Create a new TechType for the fabricator FloraFabTechType = TechTypePatcher.AddTechType(FloraFabID, LanguageHelper.GetFriendlyWord("FloraFabricatorName"), LanguageHelper.GetFriendlyWord("FloraFabricatorDescription"), true); // Add new TechType to the buildables (Interior Module group) CraftDataPatcher.customBuildables.Add(FloraFabTechType); CraftDataPatcher.AddToCustomGroup(TechGroup.InteriorModules, TechCategory.InteriorModule, FloraFabTechType); // Set buildable prefab CustomPrefabHandler.customPrefabs.Add(new CustomPrefab(FloraFabID, $"Submarine/Build/{FloraFabID}", FloraFabTechType, GetFloraFabPrefab)); // Set custom sprite for the Habitat Builder Tool menu CustomSpriteHandler.customSprites.Add(new CustomSprite(FloraFabTechType, AssetsHelper.Assets.LoadAsset <Sprite>("fabricator_icon_green"))); // Create and associate recipe to the new TechType var customFabRecipe = new TechDataHelper() { _craftAmount = 1, _ingredients = new List <IngredientHelper>(new IngredientHelper[4] { new IngredientHelper(TechType.Titanium, 1), new IngredientHelper(TechType.ComputerChip, 1), new IngredientHelper(TechType.Kyanite, 1), new IngredientHelper(TechType.PrecursorIonCrystal, 1) }), _techType = FloraFabTechType }; CraftDataPatcher.customTechData[FloraFabTechType] = customFabRecipe; }
public CustomPictureFrame() { this.ClassID = "CustomPictureFrame"; this.ResourcePath = "Submarine/Build/PictureFrame"; this.GameObject = Resources.Load <GameObject>(this.ResourcePath); this.TechType = TechTypePatcher.AddTechType(this.ClassID, LanguageHelper.GetFriendlyWord("CustomPictureFrameName"), LanguageHelper.GetFriendlyWord("CustomPictureFrameDescription"), true); this.IsHabitatBuilder = true; this.Recipe = new TechDataHelper() { _craftAmount = 1, _ingredients = new List <IngredientHelper>(new IngredientHelper[2] { new IngredientHelper(TechType.CopperWire, 1), new IngredientHelper(TechType.Glass, 1) }), _techType = this.TechType }; }
public ReactorLamp() // Feeds abstract class { this.ClassID = "ReactorLamp"; this.ResourcePath = $"{DecorationItem.DefaultResourcePath}{this.ClassID}"; this.GameObject = AssetsHelper.Assets.LoadAsset <GameObject>("nuclearreactorrod_white"); this.TechType = TechTypePatcher.AddTechType(this.ClassID, LanguageHelper.GetFriendlyWord("ReactorLampName"), LanguageHelper.GetFriendlyWord("ReactorLampDescription"), true); this.IsHabitatBuilder = true; this.Recipe = new TechDataHelper() { _craftAmount = 1, _ingredients = new List <IngredientHelper>(new IngredientHelper[4] { new IngredientHelper(TechType.ComputerChip, 1), new IngredientHelper(TechType.Glass, 1), new IngredientHelper(TechType.Titanium, 1), new IngredientHelper(TechType.Diamond, 1) }), _techType = this.TechType }; }
public DecorationsSpecimenAnalyzer() // Feeds abstract class { this.ClassID = "DecorationsSpecimenAnalyzer"; // c9bdcc4d-a8c6-43c0-8f7a-f86841cd4493 this.ResourcePath = "Submarine/Build/SpecimenAnalyzer"; this.GameObject = Resources.Load <GameObject>(this.ResourcePath); this.TechType = TechTypePatcher.AddTechType(this.ClassID, LanguageHelper.GetFriendlyWord("SpecimenAnalyzerName"), LanguageHelper.GetFriendlyWord("SpecimenAnalyzerDescription"), true); if (ConfigSwitcher.SpecimenAnalyzer_asBuildable) { this.IsHabitatBuilder = true; } this.Recipe = new TechDataHelper() { _craftAmount = 1, _ingredients = new List <IngredientHelper>(new IngredientHelper[3] { new IngredientHelper(TechType.WiringKit, 1), new IngredientHelper(TechType.ComputerChip, 1), new IngredientHelper(TechType.Titanium, 2) }), _techType = this.TechType }; }
public SofaStr1() { // Feed DecortionItem interface this.ClassID = "SofaStr1"; this.ResourcePath = "Submarine/Build/Bench"; this.GameObject = Resources.Load <GameObject>(this.ResourcePath); this.TechType = TechTypePatcher.AddTechType(this.ClassID, LanguageHelper.GetFriendlyWord("SofaStr1Name"), LanguageHelper.GetFriendlyWord("SofaStr1Description"), true); this.newsofa = AssetsHelper.Assets.LoadAsset <GameObject>("descent_bar_sofa_str_01"); if (ConfigSwitcher.SofaStr1_asBuidable) { this.IsHabitatBuilder = true; } this.Recipe = new TechDataHelper() { _craftAmount = 1, _ingredients = new List <IngredientHelper>(new IngredientHelper[2] { new IngredientHelper(TechType.Titanium, 1), new IngredientHelper(TechType.FiberMesh, 1) }), _techType = this.TechType }; }
public ALongPlanter() // Feeds abstract class { this.ClassID = "ALongPlanter"; // 87f5d3e6-e00b-4cf3-be39-0a9c7e951b84 this.ResourcePath = "Submarine/Build/PlanterBox"; this.GameObject = Resources.Load <GameObject>(this.ResourcePath); this.TechType = TechTypePatcher.AddTechType(this.ClassID, LanguageHelper.GetFriendlyWord("LongPlanterName"), LanguageHelper.GetFriendlyWord("LongPlanterDescription"), true); this.IsHabitatBuilder = true; this.Recipe = new TechDataHelper() { _craftAmount = 1, _ingredients = new List <IngredientHelper>(new IngredientHelper[1] { new IngredientHelper(TechType.Titanium, 2) }), _techType = this.TechType }; }
public BenchMedium() { // Feed DecortionItem interface this.ClassID = "BenchMedium"; this.ResourcePath = "Submarine/Build/Bench"; this.GameObject = Resources.Load <GameObject>(this.ResourcePath); this.TechType = TechTypePatcher.AddTechType(this.ClassID, LanguageHelper.GetFriendlyWord("BenchMediumName"), LanguageHelper.GetFriendlyWord("BenchDescription"), true); this.IsHabitatBuilder = true; this.Recipe = new TechDataHelper() { _craftAmount = 1, _ingredients = new List <IngredientHelper>(new IngredientHelper[1] { new IngredientHelper(TechType.Titanium, 1) }), _techType = this.TechType }; }
public DecorationsEmptyDesk() // Feeds abstract class { this.ClassID = "DecorationsEmptyDesk"; // 04a07ec0-e3f4-4285-a087-688215fdb142 this.ResourcePath = "WorldEntities/Doodads/Debris/Wrecks/Decoration/Starship_work_desk_01_empty"; this.GameObject = Resources.Load <GameObject>(this.ResourcePath); this.TechType = TechTypePatcher.AddTechType(this.ClassID, LanguageHelper.GetFriendlyWord("DecorationsEmptyDeskName"), LanguageHelper.GetFriendlyWord("DecorationsEmptyDeskDescription"), true); if (ConfigSwitcher.EmptyDesk_asBuildable) { this.IsHabitatBuilder = true; } this.Recipe = new TechDataHelper() { _craftAmount = 1, _ingredients = new List <IngredientHelper>(new IngredientHelper[1] { new IngredientHelper(TechType.Titanium, 1) }), _techType = this.TechType }; }
public static void Patch() { harmony = HarmonyInstance.Create("com.ahk1221.smlhelper"); TechTypePatcher.Patch(harmony); CraftDataPatcher.Patch(harmony); CraftTreePatcher.Patch(harmony); DevConsolePatcher.Patch(harmony); LanguagePatcher.Patch(harmony); ResourcesPatcher.Patch(harmony); PrefabDatabasePatcher.Patch(harmony); SpritePatcher.Patch(harmony); }
public static void Patch() { var harmony = HarmonyInstance.Create("com.ahk1221.automation101"); harmony.PatchAll(Assembly.GetExecutingAssembly()); SceneManager.sceneLoaded += SceneManager_sceneLoaded; var assetBundle = AssetBundle.LoadFromFile("./QMods/Automation101/connectingassets.assets"); ConnectingStuff = assetBundle.LoadAsset <GameObject>("ConnectStuff"); ConnectToolTechType = TechTypePatcher.AddTechType("ConnectTool", "Connect Tool", "Connect tool."); CraftDataPatcher.customEquipmentTypes[ConnectToolTechType] = EquipmentType.Hand; CustomPrefabHandler.customPrefabs.Add(new CustomPrefab("ConnectTool", "WorldEntities/Tools/ConnectTool", ConnectToolTechType, GetConnectToolPrefab)); }
public static void PostPatch() { FishPatcher.Patch(harmony); TechTypePatcher.Patch(); CraftTreeTypePatcher.Patch(); PingTypePatcher.Patch(); TechCategoryPatcher.Patch(); TechGroupPatcher.Patch(); BackgroundTypePatcher.Patch(); EquipmentTypePatcher.Patch(); EnumPatcher.Patch(harmony); CraftDataPatcher.Patch(harmony); CraftTreePatcher.Patch(harmony); ConsoleCommandsPatcher.Patch(harmony); LanguagePatcher.Patch(harmony); PrefabDatabasePatcher.PostPatch(harmony); SpritePatcher.Patch(harmony); KnownTechPatcher.Patch(harmony); BioReactorPatcher.Patch(); OptionsPanelPatcher.Patch(harmony); ItemsContainerPatcher.Patch(harmony); PDALogPatcher.Patch(harmony); PDAPatcher.Patch(harmony); PDAEncyclopediaPatcher.Patch(harmony); ItemActionPatcher.Patch(harmony); LootDistributionPatcher.Patch(harmony); WorldEntityDatabasePatcher.Patch(harmony); LargeWorldStreamerPatcher.Patch(harmony); IngameMenuPatcher.Patch(harmony); TooltipPatcher.Patch(harmony); SurvivalPatcher.Patch(harmony); CustomSoundPatcher.Patch(harmony); Logger.Debug("Saving TechType Cache"); TechTypePatcher.cacheManager.SaveCache(); Logger.Debug("Saving CraftTreeType Cache"); CraftTreeTypePatcher.cacheManager.SaveCache(); Logger.Debug("Saving PingType Cache"); PingTypePatcher.cacheManager.SaveCache(); }
internal static void Initialize() { CustomFishPatcher.Patch(harmony); TechTypePatcher.Patch(harmony); CraftTreeTypePatcher.Patch(harmony); CraftDataPatcher.Patch(harmony); CraftTreePatcher.Patch(harmony); DevConsolePatcher.Patch(harmony); LanguagePatcher.Patch(harmony); ResourcesPatcher.Patch(harmony); PrefabDatabasePatcher.Patch(harmony); SpritePatcher.Patch(); KnownTechPatcher.Patch(harmony); BioReactorPatcher.Patch(harmony); OptionsPanelPatcher.Patch(harmony); ItemsContainerPatcher.Patch(harmony); PDAPatcher.Patch(harmony); ItemActionPatcher.Patch(harmony); }
public static void Patch() { WarpRifleTechType = TechTypePatcher.AddTechType(WARP_RIFLE_CLASSID, "Warp Rifle", "l o l"); WarpBatteryTechType = TechTypePatcher.AddTechType(WARP_BATTERY_CLASSID, "Warp Battery", "Powers Warp Rifles"); CustomPrefabHandler.customPrefabs.Add(new CustomPrefab( WARP_RIFLE_CLASSID, WARP_RIFLE_PREFABPATH, WarpRifleTechType, GetRifleResource)); CustomPrefabHandler.customPrefabs.Add(new CustomPrefab( WARP_BATTERY_CLASSID, WARP_BATTERY_PREFABPATH, WarpBatteryTechType, GetBatteryResource)); CraftDataPatcher.customEquipmentTypes.Add(WarpRifleTechType, EquipmentType.Hand); }
public static void Patch() { #region Harmony Patch HarmonyInstance harmony = HarmonyInstance.Create("com.Fuklebark.TheBestDefense"); harmony.PatchAll(Assembly.GetExecutingAssembly()); #endregion var assetBundle = AssetBundle.LoadFromFile(@"./QMods/TheBestDefense/thebestdefense.assets"); // Create a new TechType ConcussionTorpedoTechType = TechTypePatcher.AddTechType(ConcussionNameID, ConcussionFriendlyName, ConcussionDescription, unlockOnGameStart: true); NukeTorpedoTechType = TechTypePatcher.AddTechType(NukeNameID, NukeFriendlyName, NukeDescription, unlockOnGameStart: true); // Create the in-game item CustomPrefabHandler.customPrefabs.Add(new CustomPrefab(ConcussionNameID, $"WorldEntities/Tools/{ConcussionNameID}", ConcussionTorpedoTechType, GetConcussionTorpedoObject)); CustomPrefabHandler.customPrefabs.Add(new CustomPrefab(NukeNameID, $"WorldEntities/Tools/{NukeNameID}", NukeTorpedoTechType, GetNukeTorpedoObject)); // Get the custom icon from the Unity assets bundle var Sprite = assetBundle.LoadAsset <Sprite>("ConcussionTorpedo"); var NukeSprite = assetBundle.LoadAsset <Sprite>("NukeTorpedo"); CustomSpriteHandler.customSprites.Add(new CustomSprite(ConcussionTorpedoTechType, Sprite)); CustomSpriteHandler.customSprites.Add(new CustomSprite(NukeTorpedoTechType, NukeSprite)); //CustomSpriteHandler.customSprites.Add(new CustomSprite(ConcussionTorpedoTechType, assetBundle.LoadAsset<Sprite>("ConcussionTorpedo"))); //CustomSpriteHandler.customSprites.Add(new CustomSprite(NukeTorpedoTechType, assetBundle.LoadAsset<Sprite>("NukeTorpedo"))); // Add the new recipe to the Vehicle Station crafting tree //CraftTreePatcher.customNodes.Add(new CustomCraftNode(ConcussionTorpedoTechType, CraftTree.Type.SeamothUpgrades, $"TorpedoesMenu /{ConcussionNameID}")); //CraftTreePatcher.customNodes.Add(new CustomCraftNode(NukeTorpedoTechType, CraftTree.Type.SeamothUpgrades, $"TorpedoesMenu /{NukeNameID}")); // Create a new Recipie and pair the new recipie with the new TechType CraftDataPatcher.customTechData[ConcussionTorpedoTechType] = GetConcussionRecipe(); CraftDataPatcher.customTechData[NukeTorpedoTechType] = GetNukeRecipe(); CraftTreePatcher.customNodes.Add(new CustomCraftNode(ConcussionTorpedoTechType, CraftTree.Type.SeamothUpgrades, "Torpedoes/ConcussionTorpedo")); CraftTreePatcher.customNodes.Add(new CustomCraftNode(NukeTorpedoTechType, CraftTree.Type.SeamothUpgrades, "Torpedoes/NukeTorpedo")); //CraftTreePatcher.customNodes.Add(new CustomCraftNode(ConcussionTorpedoTechType, CraftScheme.SeamothUpgrades, "Torpedoes/ConcussionTorpedo")); // Define it's Equipment Type (Can't find an obvious one, There's gotta be a way it knows how to distingish a torpedo for the bay, but I dunno how) //CraftDataPatcher.customEquipmentTypes[ConcussionTorpedoTechType] = EquipmentType.SeamothTorpedo; //CraftDataPatcher.customEquipmentTypes[NukeTorpedoTechType] = EquipmentType.SeamothTorpedo; }
public static void Patch() { harmony = HarmonyInstance.Create("com.ahk1221.smlhelper"); try { TechTypePatcher.Patch(harmony); CraftDataPatcher.Patch(harmony); CraftTreePatcher.Patch(harmony); DevConsolePatcher.Patch(harmony); LanguagePatcher.Patch(harmony); ResourcesPatcher.Patch(harmony); PrefabDatabasePatcher.Patch(harmony); SpritePatcher.Patch(harmony); KnownTechPatcher.Patch(harmony); } catch (Exception e) { Console.WriteLine(e.StackTrace); } }
public GenericSkeleton2() { this.ClassID = "GenericSkeleton2"; this.ResourcePath = DecorationItem.DefaultResourcePath + this.ClassID; this.GameObject = AssetsHelper.Assets.LoadAsset <GameObject>("Lost_river_generic_skeleton_02"); this.TechType = TechTypePatcher.AddTechType(this.ClassID, LanguageHelper.GetFriendlyWord("GenericSkeletonName") + " (B)", LanguageHelper.GetFriendlyWord("GenericSkeletonDescription"), true); this.Recipe = new TechDataHelper() { _craftAmount = 1, _ingredients = new List <IngredientHelper>(new IngredientHelper[1] { new IngredientHelper(TechType.Titanium, 1) }), _techType = this.TechType }; }