using System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using PluginConfig.API; using PluginConfig.API.Decorators; using PluginConfig.API.Fields; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("CEHammerCooldownCustomizer")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("CEHammerCooldownCustomizer")] [assembly: AssemblyTitle("CEHammerCooldownCustomizer")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace CEHammerCooldownCustomizer { [BepInPlugin("CEHammerCooldownCustomizer", "CEHammerCooldownCustomizer", "1.0.0")] [Harmony] public class Plugin : BaseUnityPlugin { internal static ManualLogSource Logger; private static PluginConfigurator config; private void Awake() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown Logger = ((BaseUnityPlugin)this).Logger; Harmony val = new Harmony("CEHammerCooldownCustomizer"); val.PatchAll(); config = PluginConfig.CreateConfig(); Logger.LogInfo((object)"Plugin CEHammerCooldownCustomizer is loaded!"); } [HarmonyPatch(/*Could not decode attribute arguments.*/)] [HarmonyPostfix] private static void BlockLeaderboardScores(ref bool __result) { __result = false; } [HarmonyPatch(typeof(WeaponCharges), "Charge")] [HarmonyTranspiler] private static IEnumerable ReplaceChargeFactor(IEnumerable instructions) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Expected O, but got Unknown //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Expected O, but got Unknown //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Expected O, but got Unknown //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Expected O, but got Unknown //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Expected O, but got Unknown //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Expected O, but got Unknown //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Expected O, but got Unknown //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Expected O, but got Unknown CodeMatcher val = new CodeMatcher(instructions, (ILGenerator)null); val.Start(); FieldInfo fieldInfo = AccessTools.Field(typeof(WeaponCharges), "shoAltNadeCharge"); val.MatchForward(false, (CodeMatch[])(object)new CodeMatch[6] { new CodeMatch((OpCode?)OpCodes.Ldarg_0, (object)null, (string)null), new CodeMatch((OpCode?)OpCodes.Ldarg_0, (object)null, (string)null), new CodeMatch((OpCode?)OpCodes.Ldfld, (object)fieldInfo, (string)null), new CodeMatch((OpCode?)OpCodes.Ldc_R4, (object)1f, (string)null), new CodeMatch((OpCode?)OpCodes.Ldarg_1, (object)null, (string)null), new CodeMatch((OpCode?)OpCodes.Ldc_R4, (object)0.5f, (string)null) }); val.Advance(5); val.RemoveInstruction(); val.Insert((CodeInstruction[])(object)new CodeInstruction[1] { new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(Plugin), "GetChargeFactor", (Type[])null, (Type[])null)) }); return val.Instructions(); } private static float GetChargeFactor() { if (PluginConfig.Cooldown <= 0f) { return 0f; } return 1f / PluginConfig.Cooldown; } [HarmonyPatch(typeof(WeaponCharges), "Charge")] [HarmonyPostfix] private static void AccountForNoCooldown(WeaponCharges __instance) { if (PluginConfig.Cooldown <= 0f) { MonoSingleton.Instance.shoAltNadeCharge = 1f; } } } public static class PluginConfig { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static FloatValueChangeEventDelegate <>9__1_0; internal void b__1_0(FloatValueChangeEvent e) { Cooldown = e.value; } } public static float Cooldown = 2f; public static PluginConfigurator CreateConfig() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Expected O, but got Unknown PluginConfigurator val = PluginConfigurator.Create("CE Hammer Core Cooldown", "CEHammerCooldownCustomizer"); new ConfigSpace(val.rootPanel, 5f); FloatField obj = FloatSetting(val, val.rootPanel, "Core Cooldown (seconds)", "Cooldown", ref Cooldown); object obj2 = <>c.<>9__1_0; if (obj2 == null) { FloatValueChangeEventDelegate val2 = delegate(FloatValueChangeEvent e) { Cooldown = e.value; }; <>c.<>9__1_0 = val2; obj2 = (object)val2; } obj.onValueChange += (FloatValueChangeEventDelegate)obj2; return val; } public static FloatField FloatSetting(PluginConfigurator config, ConfigPanel panel, string name, string guid, ref float value) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Expected O, but got Unknown FloatField val = new FloatField(panel, name, guid, value); value = val.value; return val; } } public static class MyPluginInfo { public const string PLUGIN_GUID = "CEHammerCooldownCustomizer"; public const string PLUGIN_NAME = "CEHammerCooldownCustomizer"; public const string PLUGIN_VERSION = "1.0.0"; } }