Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of RefriedSkills v1.0.0
plugins/RefriedSkills.dll
Decompiled a day agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using EntityStates; using EntityStates.Bandit2.Weapon; using HarmonyLib; using Mdh.EntityStates.Bandit2.Weapon.Bandit2FirePrimaryBase; using Mdh.EntityStates.Bandit2.Weapon.Reload; using Mdh.EntityStates.GenericBulletBaseState; using Mdh.RoR2.GlobalEventManager; using Microsoft.CodeAnalysis; using MiscFixes.Modules; using Mono.Cecil; using Mono.Cecil.Cil; using MonoDetour; using MonoDetour.Cil; using MonoDetour.DetourTypes; using MonoDetour.HookGen; using MonoMod.Cil; using R2API; using R2API.Networking; using R2API.Networking.Interfaces; using RefriedSkills.Bandit.LightsOut; using RefriedSkills.ModSupport; using RoR2; using RoR2.ContentManagement; using RoR2.Skills; using RoR2BepInExPack.GameAssetPaths.Version_1_39_0; using RoR2BepInExPack.Utilities; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Networking; using UnityEngine.ResourceManagement.AsyncOperations; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("LordVGames.RefriedSkills")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+2d8eb7ff59172572821fda4c08ffe0872e924585")] [assembly: AssemblyProduct("LordVGames.RefriedSkills")] [assembly: AssemblyTitle("RefriedSkills")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [CompilerGenerated] internal sealed class <>z__ReadOnlySingleElementList<T> : IEnumerable, ICollection, IList, IEnumerable<T>, IReadOnlyCollection<T>, IReadOnlyList<T>, ICollection<T>, IList<T> { private sealed class Enumerator : IDisposable, IEnumerator, IEnumerator<T> { object IEnumerator.Current => _item; T IEnumerator<T>.Current => _item; public Enumerator(T item) { _item = item; } bool IEnumerator.MoveNext() { if (!_moveNextCalled) { return _moveNextCalled = true; } return false; } void IEnumerator.Reset() { _moveNextCalled = false; } void IDisposable.Dispose() { } } int ICollection.Count => 1; bool ICollection.IsSynchronized => false; object ICollection.SyncRoot => this; object IList.this[int index] { get { if (index != 0) { throw new IndexOutOfRangeException(); } return _item; } set { throw new NotSupportedException(); } } bool IList.IsFixedSize => true; bool IList.IsReadOnly => true; int IReadOnlyCollection<T>.Count => 1; T IReadOnlyList<T>.this[int index] { get { if (index != 0) { throw new IndexOutOfRangeException(); } return _item; } } int ICollection<T>.Count => 1; bool ICollection<T>.IsReadOnly => true; T IList<T>.this[int index] { get { if (index != 0) { throw new IndexOutOfRangeException(); } return _item; } set { throw new NotSupportedException(); } } public <>z__ReadOnlySingleElementList(T item) { _item = item; } IEnumerator IEnumerable.GetEnumerator() { return new Enumerator(_item); } void ICollection.CopyTo(Array array, int index) { array.SetValue(_item, index); } int IList.Add(object value) { throw new NotSupportedException(); } void IList.Clear() { throw new NotSupportedException(); } bool IList.Contains(object value) { return EqualityComparer<T>.Default.Equals(_item, (T)value); } int IList.IndexOf(object value) { if (!EqualityComparer<T>.Default.Equals(_item, (T)value)) { return -1; } return 0; } void IList.Insert(int index, object value) { throw new NotSupportedException(); } void IList.Remove(object value) { throw new NotSupportedException(); } void IList.RemoveAt(int index) { throw new NotSupportedException(); } IEnumerator<T> IEnumerable<T>.GetEnumerator() { return new Enumerator(_item); } void ICollection<T>.Add(T item) { throw new NotSupportedException(); } void ICollection<T>.Clear() { throw new NotSupportedException(); } bool ICollection<T>.Contains(T item) { return EqualityComparer<T>.Default.Equals(_item, item); } void ICollection<T>.CopyTo(T[] array, int arrayIndex) { array[arrayIndex] = _item; } bool ICollection<T>.Remove(T item) { throw new NotSupportedException(); } int IList<T>.IndexOf(T item) { if (!EqualityComparer<T>.Default.Equals(_item, item)) { return -1; } return 0; } void IList<T>.Insert(int index, T item) { throw new NotSupportedException(); } void IList<T>.RemoveAt(int index) { throw new NotSupportedException(); } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [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 Mdh.EntityStates.GenericBulletBaseState { internal static class FixedUpdate { public delegate void PrefixSignature(GenericBulletBaseState self); public delegate void PostfixSignature(GenericBulletBaseState self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PrefixDetour>(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PostfixDetour>(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { Type typeFromHandle = typeof(GenericBulletBaseState); MethodInfo method = typeFromHandle.GetMethod("FixedUpdate", (BindingFlags)(-1), null, Array.Empty<Type>(), null); if ((object)method == null) { throw new MissingMethodException("EntityStates.GenericBulletBaseState", "FixedUpdate"); } return method; } } internal static class GetMinimumInterruptPriority { public delegate void PrefixSignature(GenericBulletBaseState self); public delegate void PostfixSignature(GenericBulletBaseState self, ref InterruptPriority returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PrefixDetour>(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PostfixDetour>(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { Type typeFromHandle = typeof(GenericBulletBaseState); MethodInfo method = typeFromHandle.GetMethod("GetMinimumInterruptPriority", (BindingFlags)(-1), null, Array.Empty<Type>(), null); if ((object)method == null) { throw new MissingMethodException("EntityStates.GenericBulletBaseState", "GetMinimumInterruptPriority"); } return method; } } internal static class OnEnter { public delegate void PrefixSignature(GenericBulletBaseState self); public delegate void PostfixSignature(GenericBulletBaseState self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PrefixDetour>(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PostfixDetour>(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { Type typeFromHandle = typeof(GenericBulletBaseState); MethodInfo method = typeFromHandle.GetMethod("OnEnter", (BindingFlags)(-1), null, Array.Empty<Type>(), null); if ((object)method == null) { throw new MissingMethodException("EntityStates.GenericBulletBaseState", "OnEnter"); } return method; } } internal static class FireBullet { public delegate void PrefixSignature(GenericBulletBaseState self, ref Ray aimRay); public delegate void PostfixSignature(GenericBulletBaseState self, ref Ray aimRay); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PrefixDetour>(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PostfixDetour>(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { Type typeFromHandle = typeof(GenericBulletBaseState); MethodInfo method = typeFromHandle.GetMethod("FireBullet", (BindingFlags)(-1), null, new Type[1] { typeof(Ray) }, null); if ((object)method == null) { throw new MissingMethodException("EntityStates.GenericBulletBaseState", "FireBullet"); } return method; } } } namespace Mdh.EntityStates.Bandit2.Weapon.Bandit2FirePrimaryBase { internal static class GetMinimumInterruptPriority { public delegate void PrefixSignature(Bandit2FirePrimaryBase self); public delegate ReturnFlow ControlFlowPrefixSignature(Bandit2FirePrimaryBase self, ref InterruptPriority returnValue); public delegate void PostfixSignature(Bandit2FirePrimaryBase self, ref InterruptPriority returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PrefixDetour>(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PrefixDetour>(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PostfixDetour>(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { Type typeFromHandle = typeof(Bandit2FirePrimaryBase); MethodInfo method = typeFromHandle.GetMethod("GetMinimumInterruptPriority", (BindingFlags)(-1), null, Array.Empty<Type>(), null); if ((object)method == null) { throw new MissingMethodException("EntityStates.Bandit2.Weapon.Bandit2FirePrimaryBase", "GetMinimumInterruptPriority"); } return method; } } internal static class OnEnter { public delegate void PrefixSignature(Bandit2FirePrimaryBase self); public delegate ReturnFlow ControlFlowPrefixSignature(Bandit2FirePrimaryBase self); public delegate void PostfixSignature(Bandit2FirePrimaryBase self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PrefixDetour>(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PrefixDetour>(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PostfixDetour>(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { Type typeFromHandle = typeof(Bandit2FirePrimaryBase); MethodInfo method = typeFromHandle.GetMethod("OnEnter", (BindingFlags)(-1), null, Array.Empty<Type>(), null); if ((object)method == null) { throw new MissingMethodException("EntityStates.Bandit2.Weapon.Bandit2FirePrimaryBase", "OnEnter"); } return method; } } } namespace Mdh.EntityStates.Bandit2.Weapon.SlashBlade { internal static class GetMinimumInterruptPriority { public delegate void PrefixSignature(SlashBlade self); public delegate void PostfixSignature(SlashBlade self, ref InterruptPriority returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PrefixDetour>(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PostfixDetour>(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { Type typeFromHandle = typeof(SlashBlade); MethodInfo method = typeFromHandle.GetMethod("GetMinimumInterruptPriority", (BindingFlags)(-1), null, Array.Empty<Type>(), null); if ((object)method == null) { throw new MissingMethodException("EntityStates.Bandit2.Weapon.SlashBlade", "GetMinimumInterruptPriority"); } return method; } } internal static class OnEnter { public delegate void PrefixSignature(SlashBlade self); public delegate void PostfixSignature(SlashBlade self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PrefixDetour>(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PostfixDetour>(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { Type typeFromHandle = typeof(SlashBlade); MethodInfo method = typeFromHandle.GetMethod("OnEnter", (BindingFlags)(-1), null, Array.Empty<Type>(), null); if ((object)method == null) { throw new MissingMethodException("EntityStates.Bandit2.Weapon.SlashBlade", "OnEnter"); } return method; } } } namespace Mdh.EntityStates.Bandit2.Weapon.Reload { internal static class FixedUpdate { public delegate void PrefixSignature(Reload self); public delegate ReturnFlow ControlFlowPrefixSignature(Reload self); public delegate void PostfixSignature(Reload self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PrefixDetour>(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PrefixDetour>(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PostfixDetour>(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { Type typeFromHandle = typeof(Reload); MethodInfo method = typeFromHandle.GetMethod("FixedUpdate", (BindingFlags)(-1), null, Array.Empty<Type>(), null); if ((object)method == null) { throw new MissingMethodException("EntityStates.Bandit2.Weapon.Reload", "FixedUpdate"); } return method; } } internal static class GetMinimumInterruptPriority { public delegate void PrefixSignature(Reload self); public delegate ReturnFlow ControlFlowPrefixSignature(Reload self, ref InterruptPriority returnValue); public delegate void PostfixSignature(Reload self, ref InterruptPriority returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PrefixDetour>(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PrefixDetour>(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PostfixDetour>(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { Type typeFromHandle = typeof(Reload); MethodInfo method = typeFromHandle.GetMethod("GetMinimumInterruptPriority", (BindingFlags)(-1), null, Array.Empty<Type>(), null); if ((object)method == null) { throw new MissingMethodException("EntityStates.Bandit2.Weapon.Reload", "GetMinimumInterruptPriority"); } return method; } } internal static class OnEnter { public delegate void PrefixSignature(Reload self); public delegate ReturnFlow ControlFlowPrefixSignature(Reload self); public delegate void PostfixSignature(Reload self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PrefixDetour>(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PrefixDetour>(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PostfixDetour>(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { Type typeFromHandle = typeof(Reload); MethodInfo method = typeFromHandle.GetMethod("OnEnter", (BindingFlags)(-1), null, Array.Empty<Type>(), null); if ((object)method == null) { throw new MissingMethodException("EntityStates.Bandit2.Weapon.Reload", "OnEnter"); } return method; } } } namespace Mdh.RoR2.GlobalEventManager { internal static class ProcessHitEnemy { public delegate void PrefixSignature(GlobalEventManager self, ref DamageInfo damageInfo, ref GameObject victim); public delegate void PostfixSignature(GlobalEventManager self, ref DamageInfo damageInfo, ref GameObject victim); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PrefixDetour>(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PostfixDetour>(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { Type typeFromHandle = typeof(GlobalEventManager); MethodInfo method = typeFromHandle.GetMethod("ProcessHitEnemy", (BindingFlags)(-1), null, new Type[2] { typeof(DamageInfo), typeof(GameObject) }, null); if ((object)method == null) { throw new MissingMethodException("RoR2.GlobalEventManager", "ProcessHitEnemy"); } return method; } } internal static class OnCharacterDeath { public delegate void PrefixSignature(GlobalEventManager self, ref DamageReport damageReport); public delegate void PostfixSignature(GlobalEventManager self, ref DamageReport damageReport); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PrefixDetour>(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PostfixDetour>(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { Type typeFromHandle = typeof(GlobalEventManager); MethodInfo method = typeFromHandle.GetMethod("OnCharacterDeath", (BindingFlags)(-1), null, new Type[1] { typeof(DamageReport) }, null); if ((object)method == null) { throw new MissingMethodException("RoR2.GlobalEventManager", "OnCharacterDeath"); } return method; } } internal static class Init { public delegate void PrefixSignature(); public delegate void PostfixSignature(); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PrefixDetour>(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PostfixDetour>(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { Type typeFromHandle = typeof(GlobalEventManager); MethodInfo method = typeFromHandle.GetMethod("Init", (BindingFlags)(-1), null, Array.Empty<Type>(), null); if ((object)method == null) { throw new MissingMethodException("RoR2.GlobalEventManager", "Init"); } return method; } } } namespace MonoDetour.HookGen { internal static class DefaultMonoDetourManager { internal static MonoDetourManager Instance { get; } = New(); internal static MonoDetourManager New() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown return new MonoDetourManager(typeof(DefaultMonoDetourManager).Assembly.GetName().Name); } } [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class, AllowMultiple = true, Inherited = false)] internal class MonoDetourTargetsAttribute(Type? targetType = null) : Attribute(), IMonoDetourTargets { public Type? TargetType { get; } = targetType; public bool IncludeNestedTypes { get; set; } = true; public string[]? Members { get; set; } public string[]? MemberNamePrefixes { get; set; } public string[]? MemberNameSuffixes { get; set; } public bool GenerateControlFlowVariants { get; set; } } } namespace BepInEx { [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)] [Conditional("CodeGeneration")] [Embedded] internal sealed class BepInAutoPluginAttribute : Attribute { public BepInAutoPluginAttribute(string? id = null, string? name = null, string? version = null) { } } } namespace BepInEx.Preloader.Core.Patching { [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)] [Conditional("CodeGeneration")] [Embedded] internal sealed class PatcherAutoPluginAttribute : Attribute { public PatcherAutoPluginAttribute(string? id = null, string? name = null, string? version = null) { } } } namespace Microsoft.CodeAnalysis { [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace RefriedSkills { public static class ConfigOptions { public static class Bandit { private const string _sectionName = "Bandit"; public static ConfigEntry<bool> EnableNewRiflePrimary; public static ConfigEntry<bool> EnableNewSecondaries; public static ConfigEntry<bool> EnableNewLightsOut; public static ConfigEntry<bool> EnableNewDesperado; internal static void BindConfigOptions(ConfigFile config) { EnableNewRiflePrimary = Extensions.BindOption<bool>(config, "Bandit", "Enable change(s) for Blast", "", true, (ConfigFlags)1); EnableNewSecondaries = Extensions.BindOption<bool>(config, "Bandit", "Enable change(s) for Serrated Dagger and Serrated Shiv", "", true, (ConfigFlags)1); EnableNewLightsOut = Extensions.BindOption<bool>(config, "Bandit", "Enable change(s) for Lights Out", "", true, (ConfigFlags)1); EnableNewDesperado = Extensions.BindOption<bool>(config, "Bandit", "Enable change(s) for Desperado", "", true, (ConfigFlags)1); } } internal static ConfigEntry<bool> ShowDebugLogging; internal static void BindAllConfigOptions(ConfigFile config) { ShowDebugLogging = Extensions.BindOption<bool>(config, "General stuff", "Show debug logging", "does what it says", false, (ConfigFlags)0); Bandit.BindConfigOptions(config); } } internal static class ILHelpers { internal static void LogILAroundCurrent(this ILWeaver w, int range) { for (int i = range * -1; i < range + 1; i++) { if (i == 0) { Log.Warning(""); Log.Warning($"{w.Current} CURRENT"); Log.Warning(""); } else { Log.Warning(w.Instructions[w.Index + i]); } } } } internal static class ModLanguage { private static readonly string _rootlangFolderLocation = Path.Combine(Path.GetDirectoryName(Plugin.PluginInfo.Location), "Language"); internal static void AddNewLangTokens(string languageFileName) { string text = Path.Combine(_rootlangFolderLocation, languageFileName + ".json"); LanguageAPI.AddOverlayPath(text); } } internal static class Log { private static ManualLogSource _logSource; internal static void Init(ManualLogSource logSource) { _logSource = logSource; } internal static void Debug(object data) { if (ConfigOptions.ShowDebugLogging.Value) { _logSource.LogDebug(data); } } internal static void Error(object data) { _logSource.LogError(data); } internal static void Fatal(object data) { _logSource.LogFatal(data); } internal static void Info(object data) { _logSource.LogInfo(data); } internal static void Message(object data) { _logSource.LogMessage(data); } internal static void Warning(object data) { _logSource.LogWarning(data); } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("LordVGames.RefriedSkills", "RefriedSkills", "1.0.0")] public class Plugin : BaseUnityPlugin { public const string Id = "LordVGames.RefriedSkills"; public static PluginInfo PluginInfo { get; private set; } public static string Name => "RefriedSkills"; public static string Version => "1.0.0"; public void Awake() { PluginInfo = ((BaseUnityPlugin)this).Info; ConfigOptions.BindAllConfigOptions(((BaseUnityPlugin)this).Config); Log.Init(((BaseUnityPlugin)this).Logger); NetworkingAPI.RegisterMessageType<SyncRechargesFromNewLightsOut>(); MonoDetourManager.InvokeHookInitializers(typeof(Plugin).Assembly); } } } namespace RefriedSkills.ModSupport { internal static class RiskyTweaksMod { internal const string GUID = "com.Moffein.RiskyTweaks"; private static bool? _enabled; internal static bool ModIsRunning { get { bool valueOrDefault = _enabled == true; if (!_enabled.HasValue) { valueOrDefault = Chainloader.PluginInfos.ContainsKey("com.Moffein.RiskyTweaks"); _enabled = valueOrDefault; } return _enabled.Value; } } } } namespace RefriedSkills.Bandit { [MonoDetourTargets(typeof(SlashBlade))] internal static class BothSecondaries { [CompilerGenerated] private static class <>O { public static Manipulator <0>__RemoveVanillaEffects; public static Action<DamageReport> <1>__GlobalEventManager_onServerDamageDealt; } private static readonly AssetReferenceT<SkillDef> _meleeSecondarySkillReference = new AssetReferenceT<SkillDef>(RoR2_Base_Bandit2.SlashBlade_asset); private static SkillDef _meleeSecondarySkill; private static readonly AssetReferenceT<SkillDef> _rangedSecondarySkillReference = new AssetReferenceT<SkillDef>(RoR2_Base_Bandit2.Bandit2SerratedShivs_asset); private static SkillDef _rangedSecondarySkill; [MonoDetourHookInitialize] private static void Setup() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Expected O, but got Unknown if (ConfigOptions.Bandit.EnableNewSecondaries.Value) { ModLanguage.AddNewLangTokens("BothSecondaries"); AsyncOperationHandle<SkillDef> val = AssetAsyncReferenceManager<SkillDef>.LoadAsset(_meleeSecondarySkillReference, (AsyncReferenceHandleUnloadType)2); val.Completed += delegate(AsyncOperationHandle<SkillDef> handle) { _meleeSecondarySkill = handle.Result; }; val = AssetAsyncReferenceManager<SkillDef>.LoadAsset(_rangedSecondarySkillReference, (AsyncReferenceHandleUnloadType)2); val.Completed += delegate(AsyncOperationHandle<SkillDef> handle) { _rangedSecondarySkill = handle.Result; }; object obj = <>O.<0>__RemoveVanillaEffects; if (obj == null) { Manipulator val2 = RemoveVanillaEffects; <>O.<0>__RemoveVanillaEffects = val2; obj = (object)val2; } ProcessHitEnemy.ILHook((Manipulator)obj); GlobalEventManager.onServerDamageDealt += GlobalEventManager_onServerDamageDealt; } } private static void RemoveVanillaEffects(ILManipulationInfo info) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_00e5: Unknown result type (might be due to invalid IL or missing references) ILWeaver w = new ILWeaver(info); ILLabel skipEffectLabel = w.DefineLabel(); w.MatchRelaxed(new Predicate<Instruction>[6] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 1) && w.SetCurrentTo(x), (Instruction x) => ILPatternMatchingExt.MatchLdfld<DamageInfo>(x, "crit"), (Instruction x) => ILPatternMatchingExt.MatchBrfalse(x, ref skipEffectLabel), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 1), (Instruction x) => ILPatternMatchingExt.MatchLdfld<DamageInfo>(x, "damageType"), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 134217728) }).ThrowIfFailure().InsertBeforeCurrentStealLabels((IEnumerable<Instruction>)new <>z__ReadOnlySingleElementList<Instruction>(w.Create(OpCodes.Br, (object)skipEffectLabel))); } private static void GlobalEventManager_onServerDamageDealt(DamageReport damageReport) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Invalid comparison between Unknown and I4 //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Invalid comparison between Unknown and I4 //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)damageReport.attackerBody == (Object)null || damageReport.attackerBody.bodyIndex != BodyPrefabs.Bandit2Body.bodyIndex || (Object)(object)damageReport.victimBody == (Object)null || !damageReport.damageInfo.crit || (int)damageReport.damageInfo.damageType.damageSource != 2 || (int)DamageTypeCombo.op_Implicit(damageReport.damageInfo.damageType & DamageTypeCombo.op_Implicit((DamageType)134217728)) != 134217728 || (Object)(object)damageReport.attackerBody.skillLocator == (Object)null) { return; } Vector3 val = (Object.op_Implicit((Object)(object)damageReport.attackerBody) ? damageReport.attackerBody.corePosition : damageReport.damageInfo.attacker.transform.position); Vector3 val2 = damageReport.damageInfo.position - val; if (BackstabManager.IsBackstab(val2, damageReport.victimBody)) { if (damageReport.attackerBody.skillLocator.secondary.skillNameToken == _meleeSecondarySkill.skillNameToken) { DotController.InflictDot(((Component)damageReport.victimBody).gameObject, damageReport.damageInfo.attacker, damageReport.damageInfo.inflictedHurtbox, (DotIndex)6, 15f * damageReport.damageInfo.procCoefficient, 1f, (uint?)null); DotController.InflictDot(((Component)damageReport.victimBody).gameObject, damageReport.damageInfo.attacker, damageReport.damageInfo.inflictedHurtbox, (DotIndex)6, 15f * damageReport.damageInfo.procCoefficient, 1f, (uint?)null); } else if (damageReport.attackerBody.skillLocator.secondary.skillNameToken == _rangedSecondarySkill.skillNameToken) { DotController.InflictDot(((Component)damageReport.victimBody).gameObject, damageReport.damageInfo.attacker, damageReport.damageInfo.inflictedHurtbox, (DotIndex)6, 15f * damageReport.damageInfo.procCoefficient, 1f, (uint?)null); } } } } [MonoDetourTargets(null)] internal static class DefaultSecondary { private static readonly AssetReferenceT<GameObject> _banditBodyReference = new AssetReferenceT<GameObject>(RoR2_Base_Bandit2.Bandit2Body_prefab); [MonoDetourHookInitialize] private static void Setup() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) if (RiskyTweaksMod.ModIsRunning || !ConfigOptions.Bandit.EnableNewSecondaries.Value) { return; } AsyncOperationHandle<GameObject> val = AssetAsyncReferenceManager<GameObject>.LoadAsset(_banditBodyReference, (AsyncReferenceHandleUnloadType)2); val.Completed += delegate(AsyncOperationHandle<GameObject> handle) { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) CharacterBody component = handle.Result.GetComponent<CharacterBody>(); HitBoxGroup componentInChildren = ((Component)component).GetComponentInChildren<HitBoxGroup>(); if (componentInChildren.groupName == "SlashBlade") { Transform transform = ((Component)componentInChildren.hitBoxes[0]).transform; transform.localScale = new Vector3(10.35f, 6f, 7.5f); transform.localPosition += new Vector3(0f, 0f, 1f); } }; } } [MonoDetourTargets(null)] internal static class Desperado { [CompilerGenerated] private static class <>O { public static Action<DamageReport> <0>__GlobalEventManager_onServerDamageDealt; public static Manipulator <1>__RemoveVanillaEffect; } private const float _desperadoStackDuration = 12f; private const int _desperadoStacksOnBackstab = 2; private const int _desperadoStacksPerHemorrhage = 1; private const float _desperadoSkillRecharge = 6f; private static readonly AssetReferenceT<GameObject> _desperadoKillEffectReference = new AssetReferenceT<GameObject>(RoR2_Base_Bandit2.Bandit2KillEffect_prefab); private static GameObject _desperadoKillEffect; private static readonly AssetReferenceT<SkillDef> _desperadoSkillReference = new AssetReferenceT<SkillDef>(RoR2_Base_Bandit2.SkullRevolver_asset); [MonoDetourHookInitialize] private static void Setup() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Expected O, but got Unknown if (ConfigOptions.Bandit.EnableNewDesperado.Value) { ModLanguage.AddNewLangTokens("Desperado"); AsyncOperationHandle<GameObject> val = AssetAsyncReferenceManager<GameObject>.LoadAsset(_desperadoKillEffectReference, (AsyncReferenceHandleUnloadType)2); val.Completed += delegate(AsyncOperationHandle<GameObject> handle) { _desperadoKillEffect = handle.Result; }; AsyncOperationHandle<SkillDef> val2 = AssetAsyncReferenceManager<SkillDef>.LoadAsset(_desperadoSkillReference, (AsyncReferenceHandleUnloadType)2); val2.Completed += delegate(AsyncOperationHandle<SkillDef> handle) { handle.Result.baseRechargeInterval = 6f; handle.Result.keywordTokens = CollectionExtensions.AddToArray<string>(handle.Result.keywordTokens, "RFS_BANDIT2_DESPERADO_TOKENS_KEYWORD"); }; GlobalEventManager.onServerDamageDealt += GlobalEventManager_onServerDamageDealt; object obj = <>O.<1>__RemoveVanillaEffect; if (obj == null) { Manipulator val3 = RemoveVanillaEffect; <>O.<1>__RemoveVanillaEffect = val3; obj = (object)val3; } OnCharacterDeath.ILHook((Manipulator)obj); } } private static void GlobalEventManager_onServerDamageDealt(DamageReport damageReport) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_004c: 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_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Expected O, but got Unknown if ((Object)(object)damageReport.attackerBody == (Object)null || damageReport.attackerBody.bodyIndex != BodyPrefabs.Bandit2Body.bodyIndex || (Object)(object)damageReport.attackerBody.skillLocator == (Object)null || (Object)(object)damageReport.victimBody == (Object)null || (int)DamageTypeCombo.op_Implicit(damageReport.damageInfo.damageType & DamageTypeCombo.op_Implicit((DamageType)268435456)) != 268435456) { return; } int num = 0; Vector3 val = (Object.op_Implicit((Object)(object)damageReport.attackerBody) ? damageReport.attackerBody.corePosition : damageReport.damageInfo.attacker.transform.position); Vector3 val2 = damageReport.damageInfo.position - val; if (BackstabManager.IsBackstab(val2, damageReport.victimBody)) { num += 2; } int buffCount = damageReport.victimBody.GetBuffCount(Buffs.SuperBleed); if (buffCount > 0) { for (int i = 0; i < buffCount; i++) { num++; } } if (num > 0) { for (int j = 0; j < num; j++) { damageReport.attackerBody.AddTimedBuff(Buffs.BanditSkull, 12f); damageReport.attackerBody.SetTimedBuffDurationIfPresent(Buffs.BanditSkull, 12f, true); } EffectManager.SpawnEffect(_desperadoKillEffect, new EffectData { origin = damageReport.damageInfo.position }, true); } } private static void RemoveVanillaEffect(ILManipulationInfo info) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_011f: Unknown result type (might be due to invalid IL or missing references) ILWeaver w = new ILWeaver(info); ILLabel skipEffectLabel = null; MethodReference val = default(MethodReference); w.MatchRelaxed(new Predicate<Instruction>[8] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 1) && w.SetCurrentTo(x), (Instruction x) => ILPatternMatchingExt.MatchLdfld<DamageInfo>(x, "damageType"), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 268435456), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, ref val), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, ref val), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, ref val), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 268435456), (Instruction x) => ILPatternMatchingExt.MatchBneUn(x, ref skipEffectLabel) }).ThrowIfFailure().InsertBeforeCurrentStealLabels((IEnumerable<Instruction>)new <>z__ReadOnlySingleElementList<Instruction>(w.Create(OpCodes.Br, (object)skipEffectLabel))); } } [MonoDetourTargets(typeof(Reload), GenerateControlFlowVariants = true)] internal static class NoReloadingPastMax { [MonoDetourHookInitialize] private static void Setup() { Mdh.EntityStates.Bandit2.Weapon.Reload.FixedUpdate.ControlFlowPrefix(StopReloadingDude); } private static ReturnFlow StopReloadingDude(Reload self) { if (((EntityState)self).skillLocator.primary.stock <= 3) { return (ReturnFlow)0; } return (ReturnFlow)1; } } [MonoDetourTargets(typeof(GenericBulletBaseState))] [MonoDetourTargets(typeof(Bandit2FirePrimaryBase), GenerateControlFlowVariants = true)] internal static class RiflePrimary { private class ShotsFiredInfo { internal int shotsFired; } private static FixedConditionalWeakTable<Bandit2FirePrimaryBase, ShotsFiredInfo> _banditsFiringRiflesTable = new FixedConditionalWeakTable<Bandit2FirePrimaryBase, ShotsFiredInfo>(); private const int _shotsToFire = 2; private const float _timeBetweenShots = 0.1f; private const float _damageCoefficient = 1.5f; private const float _procCoefficient = 1f; [MonoDetourHookInitialize] private static void Setup() { if (ConfigOptions.Bandit.EnableNewRiflePrimary.Value) { ModLanguage.AddNewLangTokens("RiflePrimary"); Mdh.EntityStates.GenericBulletBaseState.FixedUpdate.Prefix(BeforeFixedUpdate); Mdh.EntityStates.Bandit2.Weapon.Bandit2FirePrimaryBase.GetMinimumInterruptPriority.ControlFlowPrefix(Change); Mdh.EntityStates.Bandit2.Weapon.Bandit2FirePrimaryBase.OnEnter.Prefix(OnEnter); } } private static void OnEnter(Bandit2FirePrimaryBase self) { if (self is Bandit2FireRifle) { ((GenericBulletBaseState)self).damageCoefficient = 1.5f; ((GenericBulletBaseState)self).procCoefficient = 1f; ((GenericBulletBaseState)self).duration = ((GenericBulletBaseState)self).baseDuration / ((BaseState)self).attackSpeedStat; if (_banditsFiringRiflesTable.ContainsKey(self)) { _banditsFiringRiflesTable.Remove(self); } ((IDictionary<Bandit2FirePrimaryBase, ShotsFiredInfo>)_banditsFiringRiflesTable).TryAdd(self, new ShotsFiredInfo { shotsFired = 0 }); } } private static ReturnFlow Change(Bandit2FirePrimaryBase self, ref InterruptPriority returnValue) { if (self is Bandit2FireRifle) { returnValue = (InterruptPriority)9; return (ReturnFlow)1; } return (ReturnFlow)0; } private static void BeforeFixedUpdate(GenericBulletBaseState self) { //IL_0075: Unknown result type (might be due to invalid IL or missing references) if (!(self is Bandit2FireRifle)) { return; } ShotsFiredInfo shotsFiredInfo = default(ShotsFiredInfo); if (!_banditsFiringRiflesTable.TryGetValue((Bandit2FirePrimaryBase)(object)((self is Bandit2FirePrimaryBase) ? self : null), ref shotsFiredInfo)) { Log.Error("Couldn't get entity state in table of rifle fires?"); return; } float num = 0.1f / ((BaseState)self).attackSpeedStat; if (shotsFiredInfo.shotsFired == 2 && ((EntityState)self).fixedAge > num * 3f) { shotsFiredInfo.shotsFired = 0; ((EntityState)self).outer.SetNextStateToMain(); } else if (((EntityState)self).fixedAge > num * (float)(shotsFiredInfo.shotsFired + 1)) { self.FireBullet(((BaseState)self).GetAimRay()); ((EntityState)self).PlayAnimation("Gesture, Additive", Bandit2FirePrimaryBase.FireMainWeaponStateHash, Bandit2FirePrimaryBase.FireMainWeaponParamHash, self.duration); if (shotsFiredInfo.shotsFired == 1 && ((BaseState)self).attackSpeedStat < 2f) { ((EntityState)self).characterBody.AddSpreadBloom(self.spreadBloomValue * 0.5f); } shotsFiredInfo.shotsFired++; } } } } namespace RefriedSkills.Bandit.LightsOut { [MonoDetourTargets(typeof(GlobalEventManager))] internal static class LightsOutSkill { [CompilerGenerated] private static class <>O { public static Action<DamageReport> <0>__GlobalEventManager_onServerDamageDealt; public static Manipulator <1>__RemoveVanillaEffect; } private const float _lightsOutSkillRecharge = 6f; private static readonly AssetReferenceT<GameObject> _lightsOutKillEffectReference = new AssetReferenceT<GameObject>(RoR2_Base_Bandit2.Bandit2ResetEffect_prefab); private static GameObject _lightsOutKillEffect; private static readonly AssetReferenceT<SkillDef> _lightsOutSkillReference = new AssetReferenceT<SkillDef>(RoR2_Base_Bandit2.ResetRevolver_asset); [MonoDetourHookInitialize] private static void Setup() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Expected O, but got Unknown if (ConfigOptions.Bandit.EnableNewLightsOut.Value) { ModLanguage.AddNewLangTokens("LightsOut"); AsyncOperationHandle<GameObject> val = AssetAsyncReferenceManager<GameObject>.LoadAsset(_lightsOutKillEffectReference, (AsyncReferenceHandleUnloadType)2); val.Completed += delegate(AsyncOperationHandle<GameObject> handle) { _lightsOutKillEffect = handle.Result; }; AsyncOperationHandle<SkillDef> val2 = AssetAsyncReferenceManager<SkillDef>.LoadAsset(_lightsOutSkillReference, (AsyncReferenceHandleUnloadType)2); val2.Completed += delegate(AsyncOperationHandle<SkillDef> handle) { handle.Result.baseRechargeInterval = 6f; }; GlobalEventManager.onServerDamageDealt += GlobalEventManager_onServerDamageDealt; object obj = <>O.<1>__RemoveVanillaEffect; if (obj == null) { Manipulator val3 = RemoveVanillaEffect; <>O.<1>__RemoveVanillaEffect = val3; obj = (object)val3; } OnCharacterDeath.ILHook((Manipulator)obj); } } private static void GlobalEventManager_onServerDamageDealt(DamageReport damageReport) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Invalid comparison between Unknown and I4 //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Expected O, but got Unknown //IL_016c: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)damageReport.attackerBody == (Object)null) && damageReport.attackerBody.bodyIndex == BodyPrefabs.Bandit2Body.bodyIndex && !((Object)(object)damageReport.attackerBody.skillLocator == (Object)null) && !((Object)(object)damageReport.victimBody == (Object)null) && (int)DamageTypeCombo.op_Implicit(damageReport.damageInfo.damageType & DamageTypeCombo.op_Implicit((DamageType)4)) == 4) { Vector3 val = (Object.op_Implicit((Object)(object)damageReport.attackerBody) ? damageReport.attackerBody.corePosition : damageReport.damageInfo.attacker.transform.position); Vector3 val2 = damageReport.damageInfo.position - val; bool flag = false; bool flag2 = false; bool flag3 = false; if (damageReport.victimBody.GetBuffCount(Buffs.SuperBleed) > 0) { flag = true; flag2 = true; damageReport.attackerBody.skillLocator.primary.ResetStock(); damageReport.attackerBody.skillLocator.secondary.RechargeBaseSkill(99f); } if (BackstabManager.IsBackstab(val2, damageReport.victimBody)) { flag = true; flag3 = true; damageReport.attackerBody.skillLocator.special.RechargeBaseSkill(99f); } if (flag) { EffectManager.SpawnEffect(_lightsOutKillEffect, new EffectData { origin = damageReport.damageInfo.position }, true); } NetworkIdentity val3 = default(NetworkIdentity); if (!((Component)damageReport.attackerBody).gameObject.TryGetComponent<NetworkIdentity>(ref val3)) { Log.Error("Couldn't get net ID from a bandit body?"); } else if (flag3 || flag2) { NetMessageExtensions.Send((INetMessage)(object)new SyncRechargesFromNewLightsOut(val3.netId, flag2, flag3), (NetworkDestination)1); } } } private static void RemoveVanillaEffect(ILManipulationInfo info) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_011f: Unknown result type (might be due to invalid IL or missing references) ILWeaver w = new ILWeaver(info); ILLabel skipEffectLabel = null; MethodReference val = default(MethodReference); w.MatchRelaxed(new Predicate<Instruction>[8] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 1) && w.SetCurrentTo(x), (Instruction x) => ILPatternMatchingExt.MatchLdfld<DamageInfo>(x, "damageType"), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 4), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, ref val), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, ref val), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, ref val), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 4), (Instruction x) => ILPatternMatchingExt.MatchBneUn(x, ref skipEffectLabel) }).ThrowIfFailure().InsertBeforeCurrentStealLabels((IEnumerable<Instruction>)new <>z__ReadOnlySingleElementList<Instruction>(w.Create(OpCodes.Br, (object)skipEffectLabel))); } } internal class SyncRechargesFromNewLightsOut : INetMessage, ISerializableObject { private NetworkInstanceId attackerBodyNetID; private bool syncPrimaryAndSecondaryRecharge; private bool syncSpecialRecharge; public SyncRechargesFromNewLightsOut() { } public SyncRechargesFromNewLightsOut(NetworkInstanceId netId, bool syncPrimaryAndSecondaryRecharge, bool syncSpecialRecharge) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) attackerBodyNetID = netId; this.syncPrimaryAndSecondaryRecharge = syncPrimaryAndSecondaryRecharge; this.syncSpecialRecharge = syncSpecialRecharge; } public void Serialize(NetworkWriter writer) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) writer.Write(attackerBodyNetID); writer.Write(syncPrimaryAndSecondaryRecharge); writer.Write(syncSpecialRecharge); } public void Deserialize(NetworkReader reader) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) attackerBodyNetID = reader.ReadNetworkId(); syncPrimaryAndSecondaryRecharge = reader.ReadBoolean(); syncSpecialRecharge = reader.ReadBoolean(); } public void OnReceived() { //IL_0009: Unknown result type (might be due to invalid IL or missing references) if (NetworkServer.active) { return; } GameObject val = Util.FindNetworkObject(attackerBodyNetID); CharacterBody val2 = default(CharacterBody); if (!val.TryGetComponent<CharacterBody>(ref val2)) { Log.Error("SYNC MESSAGE Couldn't get attacker CharacterBody from their GameObject!"); return; } if (syncPrimaryAndSecondaryRecharge) { val2.skillLocator.primary.ResetStock(); val2.skillLocator.secondary.RechargeBaseSkill(99f); } if (syncSpecialRecharge) { val2.skillLocator.special.RechargeBaseSkill(99f); } } } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { public IgnoresAccessChecksToAttribute(string assemblyName) { } } }