Some mods may be broken due to the recent Alloyed Collective update.
Decompiled source of ScopeSensitivity v0.2.0
ScopeSensitivity.dll
Decompiled a year agousing System; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using EntityStates; using EntityStates.Railgunner.Scope; using HarmonyLib; using RoR2; using RoR2.CameraModes; using RoR2.Skills; using UnityEngine; using UnityEngine.AddressableAssets; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = ".NET Standard 2.0")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.2.0.0")] namespace Local.Scope.Sensitivity; [BepInPlugin("local.scope.sensitivity", "ScopeSensitivity", "0.2.0")] public class Plugin : BaseUnityPlugin { public const string versionNumber = "0.2.0"; private static float sensitivity; private static float multiplier = 1f; private const float none = 1f; private static SkillDef skill; public void Awake() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) skill = Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/DLC1/Railgunner/RailgunnerBodyFireSnipeHeavy.asset").WaitForCompletion(); Load(((BaseUnityPlugin)this).Config); ((BaseUnityPlugin)this).Config.SettingChanged += delegate { Load(((BaseUnityPlugin)this).Config); }; Stage.onStageStartGlobal += delegate { multiplier = 1f; }; Harmony.CreateAndPatchAll(typeof(Plugin), (string)null); } private static void Load(ConfigFile configuration) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown sensitivity = configuration.Bind<float>("General", "Scope Sensitivity", 66.666664f, new ConfigDescription("Adjust this percentage to determine the mouse sensitivity for Railgunner's secondary skill. Set it to 100% to disable.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 200f), Array.Empty<object>())).Value / 100f; skill.mustKeyPress = !configuration.Bind<bool>("Other", "Change Firing Mode", false, "Allow the default variant to fire while button is held rather than only on initial key press. Useful for quick-scoping.").Value; } [HarmonyPatch(typeof(BaseScopeState), "OnEnter")] [HarmonyPostfix] private static void ApplySensitivity(BaseScopeState __instance) { if (((EntityState)__instance).isAuthority && ((EntityState)__instance).characterBody.isPlayerControlled) { multiplier = sensitivity; } } [HarmonyPatch(typeof(BaseScopeState), "OnExit")] [HarmonyPrefix] private static void RevertMultiplier(BaseScopeState __instance) { if (((EntityState)__instance).isAuthority && ((EntityState)__instance).characterBody.isPlayerControlled) { multiplier = 1f; } } [HarmonyPatch(typeof(CameraModeBase), "CollectLookInput")] [HarmonyPostfix] private static void AdjustInput(ref CollectLookInputResult result) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) ref Vector2 lookInput = ref result.lookInput; lookInput *= multiplier; } }