private void DecompressionVehiclesEnabled(object sender, ToggleChangedEventArgs args)
 {
     if (args.Id != decompressionVehicleEnablerName)
     {
         return;
     }
     decompressionVehicles = args.Value;
     NitroDamagePatcher.SetDecomVeh(decompressionVehicles);
     SaveSettings();
 }
Example #2
0
        public static void Patch()
        {
            SeraLogger.PatchStart(modName, "1.5.1");
            try
            {
                var harmony = new Harmony("seraphimrisen.nitrogenmod.mod");

                AssetBundle ab = AssetBundle.LoadFromFile(assetBundle);
                N2HUD = ab.LoadAsset("NMHUD") as GameObject;

                NitrogenOptions savedSettings = new NitrogenOptions();
                OptionsPanelHandler.RegisterModOptions(savedSettings);

                nitrogenEnabled       = savedSettings.nitroEnabled;
                decompressionVehicles = savedSettings.decompressionVehicles;
                NitroDamagePatcher.Lethality(savedSettings.nitroLethal);
                NitroDamagePatcher.AdjustScaler(savedSettings.damageScaler);
                NitroDamagePatcher.SetDecomVeh(decompressionVehicles);
                BreathPatcher.EnableCrush(savedSettings.crushEnabled);

                harmony.PatchAll(Assembly.GetExecutingAssembly());

                DummySuitItems.PatchDummyItems();
                ReinforcedSuitsCore.PatchSuits();
                if (specialtyTanks)
                {
                    O2TanksCore.PatchTanks();
                }

                AddDiveSuit(ReinforcedSuitsCore.ReinforcedStillSuit, 1300f, 0.75f, 15f);
                AddDiveSuit(ReinforcedSuitsCore.ReinforcedSuit2ID, 1300f, 0.75f, 20f);
                AddDiveSuit(ReinforcedSuitsCore.ReinforcedSuit3ID, 8000f, 0.55f, 35f);
                Console.WriteLine(typeof(NitroDamagePatcher).AssemblyQualifiedName);
                SeraLogger.PatchComplete(modName);
            }
            catch (Exception ex)
            {
                SeraLogger.PatchFailed(modName, ex);
            }
        }
Example #3
0
        public static void Patch()
        {
            SeraLogger.PatchStart(modName, "1.5.0");
            try
            {
                var harmony = HarmonyInstance.Create("seraphimrisen.nitrogenmod.mod");

                AssetBundle ab = AssetBundle.LoadFromFile(assetBundle);
                N2HUD = ab.LoadAsset("NMHUD") as GameObject;

                NitrogenOptions savedSettings = new NitrogenOptions();
                OptionsPanelHandler.RegisterModOptions(savedSettings);

                nitrogenEnabled       = savedSettings.nitroEnabled;
                decompressionVehicles = savedSettings.decompressionVehicles;
                NitroDamagePatcher.Lethality(savedSettings.nitroLethal);
                NitroDamagePatcher.AdjustScaler(savedSettings.damageScaler);
                NitroDamagePatcher.SetDecomVeh(decompressionVehicles);
                BreathPatcher.EnableCrush(savedSettings.crushEnabled);

                harmony.PatchAll(Assembly.GetExecutingAssembly());

                DummySuitItems.PatchDummyItems();
                ReinforcedSuitsCore.PatchSuits();
                if (specialtyTanks)
                {
                    O2TanksCore.PatchTanks();
                }

                SeraLogger.PatchComplete(modName);
            }
            catch (Exception ex)
            {
                SeraLogger.PatchFailed(modName, ex);
            }
        }