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 EnemyAttackSpeedFixes v1.5.0
plugins/EnemyAttackSpeedFixes.dll
Decompiled 4 months 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 System.Text; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using EntityStates; using EntityStates.BrotherMonster; using EntityStates.ClayBruiser.Weapon; using EntityStates.GolemMonster; using EntityStates.LunarWisp; using EntityStates.ParentMonster; using EntityStates.TitanMonster; using Mdh.EntityStates.BrotherMonster.WeaponSlam; using Mdh.EntityStates.ClayBruiser.Weapon.MinigunFire; using Mdh.EntityStates.ClayBruiser.Weapon.MinigunSpinDown; using Mdh.EntityStates.ClayBruiser.Weapon.MinigunSpinUp; using Mdh.EntityStates.GolemMonster.ClapState; using Mdh.EntityStates.LunarWisp.FireLunarGuns; using Mdh.EntityStates.ParentMonster.GroundSlam; using Mdh.EntityStates.TitanMonster.FireFist; using Mdh.EntityStates.TitanMonster.FireMegaLaser; using Mdh.RoR2.TitanRockController; using Microsoft.CodeAnalysis; using MiscFixes.Modules; using Mono.Cecil; using Mono.Cecil.Cil; using Mono.Collections.Generic; using MonoDetour; using MonoDetour.Cil; using MonoDetour.Cil.Analysis; using MonoDetour.DetourTypes; using MonoDetour.HookGen; using MonoMod.Cil; using RoR2; using RoR2.Projectile; using UnityEngine; [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.EnemyAttackSpeedFixes")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.5.0.0")] [assembly: AssemblyInformationalVersion("1.5.0+53ecf637137b491fc1882b4554dbf87ef63e4442")] [assembly: AssemblyProduct("LordVGames.EnemyAttackSpeedFixes")] [assembly: AssemblyTitle("EnemyAttackSpeedFixes")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.5.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.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] [Microsoft.CodeAnalysis.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] [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 Mdh.RoR2.TitanRockController { internal static class FixedUpdate { public delegate void PrefixSignature(TitanRockController self); public delegate void PostfixSignature(TitanRockController 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() { return typeof(TitanRockController).GetMethod("FixedUpdate", (BindingFlags)(-1), null, Array.Empty<Type>(), null) ?? throw new MissingMethodException("RoR2.TitanRockController", "FixedUpdate"); } } internal static class Start { public delegate void PrefixSignature(TitanRockController self); public delegate void PostfixSignature(TitanRockController 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() { return typeof(TitanRockController).GetMethod("Start", (BindingFlags)(-1), null, Array.Empty<Type>(), null) ?? throw new MissingMethodException("RoR2.TitanRockController", "Start"); } } internal static class FixedUpdateServer { public delegate void PrefixSignature(TitanRockController self); public delegate void PostfixSignature(TitanRockController 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() { return typeof(TitanRockController).GetMethod("FixedUpdateServer", (BindingFlags)(-1), null, Array.Empty<Type>(), null) ?? throw new MissingMethodException("RoR2.TitanRockController", "FixedUpdateServer"); } } } namespace Mdh.EntityStates.LunarWisp.FireLunarGuns { internal static class OnEnter { public delegate void PrefixSignature(FireLunarGuns self); public delegate void PostfixSignature(FireLunarGuns 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() { return typeof(FireLunarGuns).GetMethod("OnEnter", (BindingFlags)(-1), null, Array.Empty<Type>(), null) ?? throw new MissingMethodException("EntityStates.LunarWisp.FireLunarGuns", "OnEnter"); } } internal static class FixedUpdate { public delegate void PrefixSignature(FireLunarGuns self); public delegate void PostfixSignature(FireLunarGuns 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() { return typeof(FireLunarGuns).GetMethod("FixedUpdate", (BindingFlags)(-1), null, Array.Empty<Type>(), null) ?? throw new MissingMethodException("EntityStates.LunarWisp.FireLunarGuns", "FixedUpdate"); } } internal static class OnExit { public delegate void PrefixSignature(FireLunarGuns self); public delegate void PostfixSignature(FireLunarGuns 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() { return typeof(FireLunarGuns).GetMethod("OnExit", (BindingFlags)(-1), null, Array.Empty<Type>(), null) ?? throw new MissingMethodException("EntityStates.LunarWisp.FireLunarGuns", "OnExit"); } } } namespace Mdh.EntityStates.ClayBruiser.Weapon.MinigunFire { internal static class OnEnter { public delegate void PrefixSignature(MinigunFire self); public delegate void PostfixSignature(MinigunFire 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() { return typeof(MinigunFire).GetMethod("OnEnter", (BindingFlags)(-1), null, Array.Empty<Type>(), null) ?? throw new MissingMethodException("EntityStates.ClayBruiser.Weapon.MinigunFire", "OnEnter"); } } internal static class FixedUpdate { public delegate void PrefixSignature(MinigunFire self); public delegate void PostfixSignature(MinigunFire 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() { return typeof(MinigunFire).GetMethod("FixedUpdate", (BindingFlags)(-1), null, Array.Empty<Type>(), null) ?? throw new MissingMethodException("EntityStates.ClayBruiser.Weapon.MinigunFire", "FixedUpdate"); } } internal static class OnExit { public delegate void PrefixSignature(MinigunFire self); public delegate void PostfixSignature(MinigunFire 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() { return typeof(MinigunFire).GetMethod("OnExit", (BindingFlags)(-1), null, Array.Empty<Type>(), null) ?? throw new MissingMethodException("EntityStates.ClayBruiser.Weapon.MinigunFire", "OnExit"); } } } namespace Mdh.EntityStates.ClayBruiser.Weapon.MinigunSpinDown { internal static class OnEnter { public delegate void PrefixSignature(MinigunSpinDown self); public delegate void PostfixSignature(MinigunSpinDown 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() { return typeof(MinigunSpinDown).GetMethod("OnEnter", (BindingFlags)(-1), null, Array.Empty<Type>(), null) ?? throw new MissingMethodException("EntityStates.ClayBruiser.Weapon.MinigunSpinDown", "OnEnter"); } } internal static class FixedUpdate { public delegate void PrefixSignature(MinigunSpinDown self); public delegate void PostfixSignature(MinigunSpinDown 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() { return typeof(MinigunSpinDown).GetMethod("FixedUpdate", (BindingFlags)(-1), null, Array.Empty<Type>(), null) ?? throw new MissingMethodException("EntityStates.ClayBruiser.Weapon.MinigunSpinDown", "FixedUpdate"); } } } namespace Mdh.EntityStates.ClayBruiser.Weapon.MinigunSpinUp { internal static class OnEnter { public delegate void PrefixSignature(MinigunSpinUp self); public delegate void PostfixSignature(MinigunSpinUp 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() { return typeof(MinigunSpinUp).GetMethod("OnEnter", (BindingFlags)(-1), null, Array.Empty<Type>(), null) ?? throw new MissingMethodException("EntityStates.ClayBruiser.Weapon.MinigunSpinUp", "OnEnter"); } } internal static class FixedUpdate { public delegate void PrefixSignature(MinigunSpinUp self); public delegate void PostfixSignature(MinigunSpinUp 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() { return typeof(MinigunSpinUp).GetMethod("FixedUpdate", (BindingFlags)(-1), null, Array.Empty<Type>(), null) ?? throw new MissingMethodException("EntityStates.ClayBruiser.Weapon.MinigunSpinUp", "FixedUpdate"); } } internal static class OnExit { public delegate void PrefixSignature(MinigunSpinUp self); public delegate void PostfixSignature(MinigunSpinUp 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() { return typeof(MinigunSpinUp).GetMethod("OnExit", (BindingFlags)(-1), null, Array.Empty<Type>(), null) ?? throw new MissingMethodException("EntityStates.ClayBruiser.Weapon.MinigunSpinUp", "OnExit"); } } } namespace Mdh.EntityStates.TitanMonster.FireMegaLaser { internal static class OnEnter { public delegate void PrefixSignature(FireMegaLaser self); public delegate void PostfixSignature(FireMegaLaser 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() { return typeof(FireMegaLaser).GetMethod("OnEnter", (BindingFlags)(-1), null, Array.Empty<Type>(), null) ?? throw new MissingMethodException("EntityStates.TitanMonster.FireMegaLaser", "OnEnter"); } } internal static class FixedUpdate { public delegate void PrefixSignature(FireMegaLaser self); public delegate void PostfixSignature(FireMegaLaser 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() { return typeof(FireMegaLaser).GetMethod("FixedUpdate", (BindingFlags)(-1), null, Array.Empty<Type>(), null) ?? throw new MissingMethodException("EntityStates.TitanMonster.FireMegaLaser", "FixedUpdate"); } } internal static class OnExit { public delegate void PrefixSignature(FireMegaLaser self); public delegate void PostfixSignature(FireMegaLaser 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() { return typeof(FireMegaLaser).GetMethod("OnExit", (BindingFlags)(-1), null, Array.Empty<Type>(), null) ?? throw new MissingMethodException("EntityStates.TitanMonster.FireMegaLaser", "OnExit"); } } internal static class FireBullet { public delegate void PrefixSignature(FireMegaLaser self, ref Transform modelTransform, ref Ray aimRay, ref string targetMuzzle, ref float maxDistance); public delegate void PostfixSignature(FireMegaLaser self, ref Transform modelTransform, ref Ray aimRay, ref string targetMuzzle, ref float maxDistance); 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() { return typeof(FireMegaLaser).GetMethod("FireBullet", (BindingFlags)(-1), null, new Type[4] { typeof(Transform), typeof(Ray), typeof(string), typeof(float) }, null) ?? throw new MissingMethodException("EntityStates.TitanMonster.FireMegaLaser", "FireBullet"); } } } namespace Mdh.EntityStates.TitanMonster.FireFist { internal static class OnEnter { public delegate void PrefixSignature(FireFist self); public delegate void PostfixSignature(FireFist 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() { return typeof(FireFist).GetMethod("OnEnter", (BindingFlags)(-1), null, Array.Empty<Type>(), null) ?? throw new MissingMethodException("EntityStates.TitanMonster.FireFist", "OnEnter"); } } internal static class FixedUpdate { public delegate void PrefixSignature(FireFist self); public delegate void PostfixSignature(FireFist 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() { return typeof(FireFist).GetMethod("FixedUpdate", (BindingFlags)(-1), null, Array.Empty<Type>(), null) ?? throw new MissingMethodException("EntityStates.TitanMonster.FireFist", "FixedUpdate"); } } internal static class OnExit { public delegate void PrefixSignature(FireFist self); public delegate void PostfixSignature(FireFist 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() { return typeof(FireFist).GetMethod("OnExit", (BindingFlags)(-1), null, Array.Empty<Type>(), null) ?? throw new MissingMethodException("EntityStates.TitanMonster.FireFist", "OnExit"); } } internal static class PlaceSingleDelayBlast { public delegate void PrefixSignature(FireFist self, ref Vector3 position, ref float delay); public delegate void PostfixSignature(FireFist self, ref Vector3 position, ref float delay); 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() { return typeof(FireFist).GetMethod("PlaceSingleDelayBlast", (BindingFlags)(-1), null, new Type[2] { typeof(Vector3), typeof(float) }, null) ?? throw new MissingMethodException("EntityStates.TitanMonster.FireFist", "PlaceSingleDelayBlast"); } } } namespace Mdh.EntityStates.GolemMonster.ClapState { internal static class OnEnter { public delegate void PrefixSignature(ClapState self); public delegate void PostfixSignature(ClapState 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() { return typeof(ClapState).GetMethod("OnEnter", (BindingFlags)(-1), null, Array.Empty<Type>(), null) ?? throw new MissingMethodException("EntityStates.GolemMonster.ClapState", "OnEnter"); } } internal static class FixedUpdate { public delegate void PrefixSignature(ClapState self); public delegate void PostfixSignature(ClapState 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() { return typeof(ClapState).GetMethod("FixedUpdate", (BindingFlags)(-1), null, Array.Empty<Type>(), null) ?? throw new MissingMethodException("EntityStates.GolemMonster.ClapState", "FixedUpdate"); } } internal static class OnExit { public delegate void PrefixSignature(ClapState self); public delegate void PostfixSignature(ClapState 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() { return typeof(ClapState).GetMethod("OnExit", (BindingFlags)(-1), null, Array.Empty<Type>(), null) ?? throw new MissingMethodException("EntityStates.GolemMonster.ClapState", "OnExit"); } } } namespace Mdh.EntityStates.ParentMonster.GroundSlam { internal static class OnEnter { public delegate void PrefixSignature(GroundSlam self); public delegate void PostfixSignature(GroundSlam 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() { return typeof(GroundSlam).GetMethod("OnEnter", (BindingFlags)(-1), null, Array.Empty<Type>(), null) ?? throw new MissingMethodException("EntityStates.ParentMonster.GroundSlam", "OnEnter"); } } internal static class FixedUpdate { public delegate void PrefixSignature(GroundSlam self); public delegate void PostfixSignature(GroundSlam 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() { return typeof(GroundSlam).GetMethod("FixedUpdate", (BindingFlags)(-1), null, Array.Empty<Type>(), null) ?? throw new MissingMethodException("EntityStates.ParentMonster.GroundSlam", "FixedUpdate"); } } internal static class OnExit { public delegate void PrefixSignature(GroundSlam self); public delegate void PostfixSignature(GroundSlam 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() { return typeof(GroundSlam).GetMethod("OnExit", (BindingFlags)(-1), null, Array.Empty<Type>(), null) ?? throw new MissingMethodException("EntityStates.ParentMonster.GroundSlam", "OnExit"); } } } namespace Mdh.EntityStates.BrotherMonster.WeaponSlam { internal static class OnEnter { public delegate void PrefixSignature(WeaponSlam self); public delegate void PostfixSignature(WeaponSlam 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() { return typeof(WeaponSlam).GetMethod("OnEnter", (BindingFlags)(-1), null, Array.Empty<Type>(), null) ?? throw new MissingMethodException("EntityStates.BrotherMonster.WeaponSlam", "OnEnter"); } } internal static class FixedUpdate { public delegate void PrefixSignature(WeaponSlam self); public delegate void PostfixSignature(WeaponSlam 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() { return typeof(WeaponSlam).GetMethod("FixedUpdate", (BindingFlags)(-1), null, Array.Empty<Type>(), null) ?? throw new MissingMethodException("EntityStates.BrotherMonster.WeaponSlam", "FixedUpdate"); } } internal static class OnExit { public delegate void PrefixSignature(WeaponSlam self); public delegate void PostfixSignature(WeaponSlam 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() { return typeof(WeaponSlam).GetMethod("OnExit", (BindingFlags)(-1), null, Array.Empty<Type>(), null) ?? throw new MissingMethodException("EntityStates.BrotherMonster.WeaponSlam", "OnExit"); } } } 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 : Attribute, IMonoDetourTargets { public Type? TargetType { get; } public bool IncludeNestedTypes { get; set; } public string[]? Members { get; set; } public string[]? MemberNamePrefixes { get; set; } public string[]? MemberNameSuffixes { get; set; } public bool GenerateControlFlowVariants { get; set; } public MonoDetourTargetsAttribute(Type? targetType = null) { TargetType = targetType; IncludeNestedTypes = true; base..ctor(); } } } namespace BepInEx { [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)] [Conditional("CodeGeneration")] [Microsoft.CodeAnalysis.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")] [Microsoft.CodeAnalysis.Embedded] internal sealed class PatcherAutoPluginAttribute : Attribute { public PatcherAutoPluginAttribute(string? id = null, string? name = null, string? version = null) { } } } namespace Microsoft.CodeAnalysis { [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace EnemyAttackSpeedFixes { public static class ConfigOptions { public static class ClayTemplar { private const string _sectionName = "Clay Templar"; public static ConfigEntry<bool> HalveAttackSpeedBuff; internal static void BindConfigOptions(ConfigFile config) { HalveAttackSpeedBuff = Extensions.BindOption<bool>(config, "Clay Templar", "Clay Templar Minigun Attack Speed Nerf", "Makes the clay templar minigun attack get half the value of whatever attack speed boosts they have.", false, (ConfigFlags)0); } } public static class StoneTitan { private const string _sectionName = "Stone Titan"; public static ConfigEntry<bool> RemoveLaserDamageScaling; internal static void BindConfigOptions(ConfigFile config) { RemoveLaserDamageScaling = Extensions.BindOption<bool>(config, "Stone Titan", "Remove Stone Titan laser damage scaling", "Makes the stone titan laser attack damage not scale down with attack speed.", false, (ConfigFlags)0); } } public static class LunarWisp { private const string _sectionName = "Lunar Wisp"; public static ConfigEntry<bool> RemoveAttackDurationScaling; public static ConfigEntry<bool> HalveAttackSpeedBuff; internal static void BindConfigOptions(ConfigFile config) { RemoveAttackDurationScaling = Extensions.BindOption<bool>(config, "Lunar Wisp", "Remove Lunar Wisp Minigun Duration Scaling", "Makes the lunar wisp shard minigun attack duration no longer decrease with attack speed.", false, (ConfigFlags)0); HalveAttackSpeedBuff = Extensions.BindOption<bool>(config, "Lunar Wisp", "Lunar Wisp Minigun Attack Speed Nerf", "Makes the lunar wisp shard minigun attack get half the value of whatever attack speed boosts it has.", false, (ConfigFlags)0); } } internal static void BindAllConfigOptions(ConfigFile config) { ClayTemplar.BindConfigOptions(config); StoneTitan.BindConfigOptions(config); LunarWisp.BindConfigOptions(config); } } internal static class Log { private static ManualLogSource _logSource; internal static void Init(ManualLogSource logSource) { _logSource = logSource; } internal static void Debug(object 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); } } public static class ModAssets { public static AssetBundle AssetBundle; public const string BundleName = "animgolemdiff"; public static string AssetBundlePath => Path.Combine(Path.GetDirectoryName(Plugin.PluginInfo.Location), "animgolemdiff"); public static void Init() { AssetBundle = AssetBundle.LoadFromFile(AssetBundlePath); } } internal static class ModUtil { internal static void LogILInstructions(this ILWeaver w) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) Enumerator<Instruction> enumerator = w.Instructions.GetEnumerator(); try { while (enumerator.MoveNext()) { Log.Warning(enumerator.Current); } } finally { ((IDisposable)enumerator).Dispose(); } } internal static ILWeaverResult MatchNextRelaxed(this ILWeaver w, params Predicate<Instruction>[] predicates) { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown bool foundNextMatch = false; int oldWeaverOffset = w.Current.Offset; Instruction instructionToStayOn = null; ILWeaverResult result = w.MatchMultipleRelaxed((Action<ILWeaver>)delegate(ILWeaver w2) { if (w2.Current.Offset > oldWeaverOffset && !foundNextMatch) { foundNextMatch = true; instructionToStayOn = w2.Current; } }, predicates); if (!foundNextMatch) { return new ILWeaverResult(w, (Func<string>)w.GetMatchNextRelaxedErrorMessage); } w.SetCurrentTo(instructionToStayOn); return result; } private static string GetMatchNextRelaxedErrorMessage(this ILWeaver w) { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append(MethodBodyExtensions.CreateInformationalSnapshotJIT(w.Method.Body).ToStringWithAnnotations()); stringBuilder.AppendFormat($"\nLast Weaver Position: {w.Current}"); stringBuilder.AppendFormat($"\nPrevious: {w.Previous}"); stringBuilder.AppendFormat($"\nNext: {w.Next}"); stringBuilder.AppendLine("\n\n! MatchNextRelaxed FAILED !\nA match was found, but it was not further ahead than the weaver's position!"); return stringBuilder.ToString(); } } [BepInPlugin("LordVGames.EnemyAttackSpeedFixes", "EnemyAttackSpeedFixes", "1.5.0")] public class Plugin : BaseUnityPlugin { public const string Id = "LordVGames.EnemyAttackSpeedFixes"; public static PluginInfo PluginInfo { get; private set; } public static string Name => "EnemyAttackSpeedFixes"; public static string Version => "1.5.0"; public void Awake() { PluginInfo = ((BaseUnityPlugin)this).Info; Log.Init(((BaseUnityPlugin)this).Logger); ConfigOptions.BindAllConfigOptions(((BaseUnityPlugin)this).Config); Extensions.WipeConfig(((BaseUnityPlugin)this).Config); MonoDetourManager.InvokeHookInitializers(typeof(Plugin).Assembly, false); } } } namespace EnemyAttackSpeedFixes.NotReallyFixes { [MonoDetourTargets(typeof(MinigunSpinUp))] [MonoDetourTargets(typeof(MinigunSpinDown))] [MonoDetourTargets(typeof(MinigunFire))] internal static class ClayTemplar { [CompilerGenerated] private static class <>O { public static Manipulator <0>__HalveAttackSpeedStat; } internal static void SetupILHooks() { //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_0028: Expected O, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Expected O, but got Unknown //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown if (ConfigOptions.ClayTemplar.HalveAttackSpeedBuff.Value) { object obj = <>O.<0>__HalveAttackSpeedStat; if (obj == null) { Manipulator val = HalveAttackSpeedStat; <>O.<0>__HalveAttackSpeedStat = val; obj = (object)val; } Mdh.EntityStates.ClayBruiser.Weapon.MinigunSpinUp.OnEnter.ILHook((Manipulator)obj); object obj2 = <>O.<0>__HalveAttackSpeedStat; if (obj2 == null) { Manipulator val2 = HalveAttackSpeedStat; <>O.<0>__HalveAttackSpeedStat = val2; obj2 = (object)val2; } Mdh.EntityStates.ClayBruiser.Weapon.MinigunSpinDown.OnEnter.ILHook((Manipulator)obj2); object obj3 = <>O.<0>__HalveAttackSpeedStat; if (obj3 == null) { Manipulator val3 = HalveAttackSpeedStat; <>O.<0>__HalveAttackSpeedStat = val3; obj3 = (object)val3; } Mdh.EntityStates.ClayBruiser.Weapon.MinigunFire.FixedUpdate.ILHook((Manipulator)obj3); } } private static void HalveAttackSpeedStat(ILManipulationInfo info) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown HalveNextAttackSpeedStat(new ILWeaver(info)); } private static ILWeaver HalveNextAttackSpeedStat(this ILWeaver w) { w.MatchNextRelaxed((Instruction x) => ILPatternMatchingExt.MatchLdfld<BaseState>(x, "attackSpeedStat") && w.SetCurrentTo(x)).ThrowIfFailure(); return w.InsertAfterCurrent((IEnumerable<InstructionOrEnumerable>)new <>z__ReadOnlySingleElementList<InstructionOrEnumerable>(InstructionOrEnumerable.op_Implicit(w.CreateDelegateCall<Func<float, float>>((Func<float, float>)((float attackSpeedStat) => ConfigOptions.ClayTemplar.HalveAttackSpeedBuff.Value ? (1f + (attackSpeedStat - 1f) / 2f) : attackSpeedStat))))); } } [MonoDetourTargets(typeof(FireLunarGuns))] internal static class LunarWisp { [CompilerGenerated] private static class <>O { public static Manipulator <0>__RemoveDurationScaling; public static Manipulator <1>__OnEnter_HalveAttackSpeed; public static Manipulator <2>__FixedUpdate_HalveAttackSpeed; } [MonoDetourHookInitialize] internal static void SetupILHooks() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown //IL_004c: 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_0057: Expected O, but got Unknown //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Expected O, but got Unknown if (ConfigOptions.LunarWisp.RemoveAttackDurationScaling.Value) { object obj = <>O.<0>__RemoveDurationScaling; if (obj == null) { Manipulator val = RemoveDurationScaling; <>O.<0>__RemoveDurationScaling = val; obj = (object)val; } Mdh.EntityStates.LunarWisp.FireLunarGuns.OnEnter.ILHook((Manipulator)obj); } if (ConfigOptions.LunarWisp.HalveAttackSpeedBuff.Value) { object obj2 = <>O.<1>__OnEnter_HalveAttackSpeed; if (obj2 == null) { Manipulator val2 = OnEnter_HalveAttackSpeed; <>O.<1>__OnEnter_HalveAttackSpeed = val2; obj2 = (object)val2; } Mdh.EntityStates.LunarWisp.FireLunarGuns.OnEnter.ILHook((Manipulator)obj2); object obj3 = <>O.<2>__FixedUpdate_HalveAttackSpeed; if (obj3 == null) { Manipulator val3 = FixedUpdate_HalveAttackSpeed; <>O.<2>__FixedUpdate_HalveAttackSpeed = val3; obj3 = (object)val3; } Mdh.EntityStates.LunarWisp.FireLunarGuns.FixedUpdate.ILHook((Manipulator)obj3); } } private static void RemoveDurationScaling(ILManipulationInfo info) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) Instruction startOfSkip = null; Instruction endOfSkip = null; ILWeaver w = new ILWeaver(info); w.MatchRelaxed(new Predicate<Instruction>[6] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0) && w.SetCurrentTo(x) && w.SetInstructionTo(ref startOfSkip, x), (Instruction x) => ILPatternMatchingExt.MatchLdsfld<FireLunarGuns>(x, "baseDuration"), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdfld<BaseState>(x, "attackSpeedStat"), (Instruction x) => ILPatternMatchingExt.MatchDiv(x), (Instruction x) => ILPatternMatchingExt.MatchStfld<FireLunarGuns>(x, "duration") && w.SetInstructionTo(ref endOfSkip, x) }).ThrowIfFailure().InsertBeforeCurrent((IEnumerable<Instruction>)new <>z__ReadOnlyArray<Instruction>((Instruction[])(object)new Instruction[3] { w.Create(OpCodes.Ldarg_0), w.Create<FireLunarGuns>(OpCodes.Ldsfld, "baseDuration"), w.Create<FireLunarGuns>(OpCodes.Stfld, "duration") })) .InsertBranchOverIfTrue(startOfSkip, endOfSkip, (IEnumerable<InstructionOrEnumerable>)new <>z__ReadOnlySingleElementList<InstructionOrEnumerable>(InstructionOrEnumerable.op_Implicit(w.CreateDelegateCall<Func<bool>>((Func<bool>)(() => ConfigOptions.LunarWisp.RemoveAttackDurationScaling.Value))))); } private static void OnEnter_HalveAttackSpeed(ILManipulationInfo info) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown HalveNextAttackSpeedStat(new ILWeaver(info)); } private static void FixedUpdate_HalveAttackSpeed(ILManipulationInfo info) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown HalveNextAttackSpeedStat(new ILWeaver(info)); } private static ILWeaver HalveNextAttackSpeedStat(this ILWeaver w) { w.MatchNextRelaxed((Instruction x) => ILPatternMatchingExt.MatchLdfld<BaseState>(x, "attackSpeedStat") && w.SetCurrentTo(x)).ThrowIfFailure(); return w.InsertAfterCurrent((IEnumerable<InstructionOrEnumerable>)new <>z__ReadOnlySingleElementList<InstructionOrEnumerable>(InstructionOrEnumerable.op_Implicit(w.CreateDelegateCall<Func<float, float>>((Func<float, float>)((float attackSpeedStat) => ConfigOptions.LunarWisp.HalveAttackSpeedBuff.Value ? (1f + (attackSpeedStat - 1f) / 2f) : attackSpeedStat))))); } } } namespace EnemyAttackSpeedFixes.Fixes { [MonoDetourTargets(typeof(WeaponSlam))] internal static class Mithrix { [CompilerGenerated] private static class <>O { public static Manipulator <0>__WeaponSlam_OnEnter; public static Manipulator <1>__WeaponSlam_FixedUpdate; public static Mdh.EntityStates.BrotherMonster.WeaponSlam.OnExit.PrefixSignature <2>__WeaponSlam_OnExit; } [MonoDetourHookInitialize] internal static void SetupILHooks() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Expected O, but got Unknown object obj = <>O.<0>__WeaponSlam_OnEnter; if (obj == null) { Manipulator val = WeaponSlam_OnEnter; <>O.<0>__WeaponSlam_OnEnter = val; obj = (object)val; } Mdh.EntityStates.BrotherMonster.WeaponSlam.OnEnter.ILHook((Manipulator)obj); object obj2 = <>O.<1>__WeaponSlam_FixedUpdate; if (obj2 == null) { Manipulator val2 = WeaponSlam_FixedUpdate; <>O.<1>__WeaponSlam_FixedUpdate = val2; obj2 = (object)val2; } Mdh.EntityStates.BrotherMonster.WeaponSlam.FixedUpdate.ILHook((Manipulator)obj2); Mdh.EntityStates.BrotherMonster.WeaponSlam.OnExit.Prefix(WeaponSlam_OnExit); } private static void WeaponSlam_OnEnter(ILManipulationInfo info) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown ILWeaver w = new ILWeaver(info); w.MatchRelaxed(new Predicate<Instruction>[3] { (Instruction x) => ILPatternMatchingExt.MatchLdstr(x, "WeaponSlam"), (Instruction x) => ILPatternMatchingExt.MatchLdstr(x, "WeaponSlam.playbackRate"), (Instruction x) => ILPatternMatchingExt.MatchLdsfld<WeaponSlam>(x, "duration") && w.SetCurrentTo(x) }).ThrowIfFailure().MakeDurationUseAttackSpeed() .CurrentToNext() .ReplaceCurrentOperand((object)0.05f); } private static void WeaponSlam_FixedUpdate(ILManipulationInfo info) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown ILWeaver w = new ILWeaver(info); MethodReference val2 = default(MethodReference); w.MatchRelaxed(new Predicate<Instruction>[3] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, ref val2), (Instruction x) => ILPatternMatchingExt.MatchLdsfld<WeaponSlam>(x, "duration") && w.SetCurrentTo(x) }).ThrowIfFailure().MakeDurationUseAttackSpeed(); MethodReference val = default(MethodReference); w.MatchRelaxed(new Predicate<Instruction>[3] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0) && w.SetCurrentTo(x), (Instruction x) => ILPatternMatchingExt.MatchLdfld<EntityState>(x, "outer"), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, ref val) }).ThrowIfFailure().ResetEntityStateAnimatorSpeed(); } private static void WeaponSlam_OnExit(WeaponSlam self) { if (self != null) { Animator modelAnimator = self.modelAnimator; if (modelAnimator != null) { modelAnimator.speed = 1f; } } } private static ILWeaver MakeDurationUseAttackSpeed(this ILWeaver w) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) return w.InsertAfterCurrent((IEnumerable<InstructionOrEnumerable>)new <>z__ReadOnlyArray<InstructionOrEnumerable>((InstructionOrEnumerable[])(object)new InstructionOrEnumerable[2] { InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldarg_0)), InstructionOrEnumerable.op_Implicit(w.CreateDelegateCall<Func<float, WeaponSlam, float>>((Func<float, WeaponSlam, float>)((float slamStateDuration, WeaponSlam currentSlamState) => (currentSlamState == null) ? slamStateDuration : (slamStateDuration / ((BaseState)currentSlamState).attackSpeedStat)))) })); } private static ILWeaver ResetEntityStateAnimatorSpeed(this ILWeaver w) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) return w.InsertBeforeCurrentStealLabels((IEnumerable<InstructionOrEnumerable>)new <>z__ReadOnlyArray<InstructionOrEnumerable>((InstructionOrEnumerable[])(object)new InstructionOrEnumerable[2] { InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldarg_0)), InstructionOrEnumerable.op_Implicit(w.CreateDelegateCall<Action<WeaponSlam>>((Action<WeaponSlam>)delegate(WeaponSlam slamState) { if (slamState != null) { Animator modelAnimator = slamState.modelAnimator; if (modelAnimator != null) { modelAnimator.speed = 1f; } } })) })); } } [MonoDetourTargets(typeof(GroundSlam))] internal static class Parent { [CompilerGenerated] private static class <>O { public static Manipulator <0>__GroundSlam_OnEnter; public static Manipulator <1>__GroundSlam_FixedUpdate; public static Mdh.EntityStates.ParentMonster.GroundSlam.OnExit.PrefixSignature <2>__GroundSlam_OnExit; } [MonoDetourHookInitialize] internal static void SetupILHooks() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Expected O, but got Unknown object obj = <>O.<0>__GroundSlam_OnEnter; if (obj == null) { Manipulator val = GroundSlam_OnEnter; <>O.<0>__GroundSlam_OnEnter = val; obj = (object)val; } Mdh.EntityStates.ParentMonster.GroundSlam.OnEnter.ILHook((Manipulator)obj); object obj2 = <>O.<1>__GroundSlam_FixedUpdate; if (obj2 == null) { Manipulator val2 = GroundSlam_FixedUpdate; <>O.<1>__GroundSlam_FixedUpdate = val2; obj2 = (object)val2; } Mdh.EntityStates.ParentMonster.GroundSlam.FixedUpdate.ILHook((Manipulator)obj2); Mdh.EntityStates.ParentMonster.GroundSlam.OnExit.Prefix(GroundSlam_OnExit); } private static void GroundSlam_OnEnter(ILManipulationInfo info) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown ILWeaver w = new ILWeaver(info); w.MatchRelaxed(new Predicate<Instruction>[3] { (Instruction x) => ILPatternMatchingExt.MatchLdstr(x, "Slam"), (Instruction x) => ILPatternMatchingExt.MatchLdstr(x, "Slam.playbackRate"), (Instruction x) => ILPatternMatchingExt.MatchLdsfld<GroundSlam>(x, "duration") && w.SetCurrentTo(x) }).ThrowIfFailure().MakeDurationAndAnimatorUseAttackSpeed(); } private static void GroundSlam_FixedUpdate(ILManipulationInfo info) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown ILWeaver w = new ILWeaver(info); MethodReference val = default(MethodReference); w.MatchRelaxed(new Predicate<Instruction>[3] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, ref val), (Instruction x) => ILPatternMatchingExt.MatchLdsfld<GroundSlam>(x, "duration") && w.SetCurrentTo(x) }).ThrowIfFailure().MakeDurationUseAttackSpeed(); w.MatchRelaxed(new Predicate<Instruction>[2] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0) && w.SetCurrentTo(x), (Instruction x) => ILPatternMatchingExt.MatchLdfld<EntityState>(x, "outer") }).ThrowIfFailure().ResetAnimatorSpeed(); } private static void GroundSlam_OnExit(GroundSlam self) { if (self != null) { Animator modelAnimator = self.modelAnimator; if (modelAnimator != null) { modelAnimator.speed = 1f; } } } private static ILWeaver MakeDurationAndAnimatorUseAttackSpeed(this ILWeaver w) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) return w.InsertAfterCurrent((IEnumerable<InstructionOrEnumerable>)new <>z__ReadOnlyArray<InstructionOrEnumerable>((InstructionOrEnumerable[])(object)new InstructionOrEnumerable[2] { InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldarg_0)), InstructionOrEnumerable.op_Implicit(w.CreateDelegateCall<Func<float, GroundSlam, float>>((Func<float, GroundSlam, float>)delegate(float slamStateDuration, GroundSlam currentSlamState) { if (currentSlamState == null || (Object)(object)currentSlamState.modelAnimator == (Object)null) { return slamStateDuration; } currentSlamState.modelAnimator.speed = 1f * ((BaseState)currentSlamState).attackSpeedStat; return slamStateDuration / ((BaseState)currentSlamState).attackSpeedStat; })) })); } private static ILWeaver MakeDurationUseAttackSpeed(this ILWeaver w) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) return w.InsertAfterCurrent((IEnumerable<InstructionOrEnumerable>)new <>z__ReadOnlyArray<InstructionOrEnumerable>((InstructionOrEnumerable[])(object)new InstructionOrEnumerable[2] { InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldarg_0)), InstructionOrEnumerable.op_Implicit(w.CreateDelegateCall<Func<float, GroundSlam, float>>((Func<float, GroundSlam, float>)((float slamStateDuration, GroundSlam currentSlamState) => (currentSlamState == null) ? slamStateDuration : (slamStateDuration / ((BaseState)currentSlamState).attackSpeedStat)))) })); } private static ILWeaver ResetAnimatorSpeed(this ILWeaver w) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) return w.InsertBeforeCurrent((IEnumerable<InstructionOrEnumerable>)new <>z__ReadOnlyArray<InstructionOrEnumerable>((InstructionOrEnumerable[])(object)new InstructionOrEnumerable[2] { InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldarg_0)), InstructionOrEnumerable.op_Implicit(w.CreateDelegateCall<Action<GroundSlam>>((Action<GroundSlam>)delegate(GroundSlam slamState) { if (slamState != null) { Animator modelAnimator = slamState.modelAnimator; if (modelAnimator != null) { modelAnimator.speed = 1f; } } })) })); } } [MonoDetourTargets(typeof(ClapState))] internal static class StoneGolem { [CompilerGenerated] private static class <>O { public static Manipulator <0>__ClapState_OnEnter; public static Manipulator <1>__ClapState_FixedUpdate; public static Mdh.EntityStates.GolemMonster.ClapState.OnExit.PrefixSignature <2>__ClapState_OnExit; } [MonoDetourHookInitialize] internal static void SetupILHooks() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Expected O, but got Unknown object obj = <>O.<0>__ClapState_OnEnter; if (obj == null) { Manipulator val = ClapState_OnEnter; <>O.<0>__ClapState_OnEnter = val; obj = (object)val; } Mdh.EntityStates.GolemMonster.ClapState.OnEnter.ILHook((Manipulator)obj); object obj2 = <>O.<1>__ClapState_FixedUpdate; if (obj2 == null) { Manipulator val2 = ClapState_FixedUpdate; <>O.<1>__ClapState_FixedUpdate = val2; obj2 = (object)val2; } Mdh.EntityStates.GolemMonster.ClapState.FixedUpdate.ILHook((Manipulator)obj2); Mdh.EntityStates.GolemMonster.ClapState.OnExit.Prefix(ClapState_OnExit); } private static void ClapState_OnEnter(ILManipulationInfo info) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown ILWeaver w = new ILWeaver(info); w.MatchRelaxed(new Predicate<Instruction>[3] { (Instruction x) => ILPatternMatchingExt.MatchLdstr(x, "Clap"), (Instruction x) => ILPatternMatchingExt.MatchLdstr(x, "Clap.playbackRate"), (Instruction x) => ILPatternMatchingExt.MatchLdsfld<ClapState>(x, "duration") && w.SetCurrentTo(x) }).ThrowIfFailure().MakeDurationAndAnimatorUseAttackSpeed(); } private static void ClapState_FixedUpdate(ILManipulationInfo info) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown ILWeaver w = new ILWeaver(info); w.MatchRelaxed(new Predicate<Instruction>[3] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<EntityState>(x, "get_fixedAge"), (Instruction x) => ILPatternMatchingExt.MatchLdsfld<ClapState>(x, "duration") && w.SetCurrentTo(x) }).ThrowIfFailure().MakeDurationAndAnimatorUseAttackSpeed(); w.MatchRelaxed(new Predicate<Instruction>[2] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0) && w.SetCurrentTo(x), (Instruction x) => ILPatternMatchingExt.MatchLdfld<EntityState>(x, "outer") }).ThrowIfFailure().ResetAnimatorSpeed(); } private static void ClapState_OnExit(ClapState self) { if (self != null) { Animator modelAnimator = self.modelAnimator; if (modelAnimator != null) { modelAnimator.speed = 1f; } } } private static void MakeDurationAndAnimatorUseAttackSpeed(this ILWeaver w) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) w.InsertAfterCurrent((IEnumerable<InstructionOrEnumerable>)new <>z__ReadOnlyArray<InstructionOrEnumerable>((InstructionOrEnumerable[])(object)new InstructionOrEnumerable[2] { InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldarg_0)), InstructionOrEnumerable.op_Implicit(w.CreateDelegateCall<Func<float, ClapState, float>>((Func<float, ClapState, float>)delegate(float clapStateDuration, ClapState currentClapState) { if (currentClapState == null || (Object)(object)currentClapState.modelAnimator == (Object)null) { return 1f; } currentClapState.modelAnimator.speed = 1f * ((BaseState)currentClapState).attackSpeedStat; return clapStateDuration / ((BaseState)currentClapState).attackSpeedStat; })) })); } private static void ResetAnimatorSpeed(this ILWeaver w) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) w.InsertBeforeCurrent((IEnumerable<InstructionOrEnumerable>)new <>z__ReadOnlyArray<InstructionOrEnumerable>((InstructionOrEnumerable[])(object)new InstructionOrEnumerable[2] { InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldarg_0)), InstructionOrEnumerable.op_Implicit(w.CreateDelegateCall<Action<ClapState>>((Action<ClapState>)delegate(ClapState clapState) { if (clapState != null) { Animator modelAnimator = clapState.modelAnimator; if (modelAnimator != null) { modelAnimator.speed = 1f; } } })) })); } } } namespace EnemyAttackSpeedFixes.Fixes.StoneTitan { [MonoDetourTargets(typeof(FireFist))] internal static class FireFistState { [CompilerGenerated] private static class <>O { public static Manipulator <0>__OnEnter; public static Manipulator <1>__FixedUpdate; public static Manipulator <2>__PlaceSingleDelayBlast; public static Mdh.EntityStates.TitanMonster.FireFist.OnExit.PrefixSignature <3>__OnExit; } private const float _stateExitSpeedBooster = 1.4f; [MonoDetourHookInitialize] internal static void SetupILHooks() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Expected O, but got Unknown //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Expected O, but got Unknown object obj = <>O.<0>__OnEnter; if (obj == null) { Manipulator val = OnEnter; <>O.<0>__OnEnter = val; obj = (object)val; } Mdh.EntityStates.TitanMonster.FireFist.OnEnter.ILHook((Manipulator)obj); object obj2 = <>O.<1>__FixedUpdate; if (obj2 == null) { Manipulator val2 = FixedUpdate; <>O.<1>__FixedUpdate = val2; obj2 = (object)val2; } Mdh.EntityStates.TitanMonster.FireFist.FixedUpdate.ILHook((Manipulator)obj2); object obj3 = <>O.<2>__PlaceSingleDelayBlast; if (obj3 == null) { Manipulator val3 = PlaceSingleDelayBlast; <>O.<2>__PlaceSingleDelayBlast = val3; obj3 = (object)val3; } Mdh.EntityStates.TitanMonster.FireFist.PlaceSingleDelayBlast.ILHook((Manipulator)obj3); Mdh.EntityStates.TitanMonster.FireFist.OnExit.Prefix(OnExit); } internal static void OnEnter(ILManipulationInfo info) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown ILWeaver w = new ILWeaver(info); w.MatchRelaxed(new Predicate<Instruction>[3] { (Instruction x) => ILPatternMatchingExt.MatchLdstr(x, "PrepFist"), (Instruction x) => ILPatternMatchingExt.MatchLdstr(x, "PrepFist.playbackRate"), (Instruction x) => ILPatternMatchingExt.MatchLdsfld<FireFist>(x, "entryDuration") && w.SetCurrentTo(x) }).ThrowIfFailure().InsertDurationUseAttackSpeedAfter(); } internal static void FixedUpdate(ILManipulationInfo info) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown ILWeaver w = new ILWeaver(info); w.MatchNextRelaxed((Instruction x) => ILPatternMatchingExt.MatchLdfld<FireFist>(x, "stopwatch"), (Instruction x) => ILPatternMatchingExt.MatchLdsfld<FireFist>(x, "trackingDuration") && w.SetCurrentTo(x)).ThrowIfFailure().InsertDurationUseAttackSpeedAfter(); w.MatchNextRelaxed((Instruction x) => ILPatternMatchingExt.MatchLdfld<FireFist>(x, "stopwatch"), (Instruction x) => ILPatternMatchingExt.MatchLdsfld<FireFist>(x, "entryDuration") && w.SetCurrentTo(x)).ThrowIfFailure().InsertDurationUseAttackSpeedAfter(); w.MatchNextRelaxed((Instruction x) => ILPatternMatchingExt.MatchLdfld<FireFist>(x, "stopwatch"), (Instruction x) => ILPatternMatchingExt.MatchLdsfld<FireFist>(x, "fireDuration") && w.SetCurrentTo(x)).ThrowIfFailure().InsertDurationUseAttackSpeedAfter(); w.MatchRelaxed(new Predicate<Instruction>[3] { (Instruction x) => ILPatternMatchingExt.MatchLdstr(x, "ExitFist"), (Instruction x) => ILPatternMatchingExt.MatchLdstr(x, "ExitFist.playbackRate"), (Instruction x) => ILPatternMatchingExt.MatchLdsfld<FireFist>(x, "exitDuration") && w.SetCurrentTo(x) }).ThrowIfFailure().ResetSpeedReturnDuration(); w.MatchNextRelaxed((Instruction x) => ILPatternMatchingExt.MatchLdfld<FireFist>(x, "stopwatch"), (Instruction x) => ILPatternMatchingExt.MatchLdsfld<FireFist>(x, "exitDuration") && w.SetCurrentTo(x)).ThrowIfFailure().ResetSpeedReturnDuration(); w.MatchRelaxed(new Predicate<Instruction>[2] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0) && w.SetCurrentTo(x), (Instruction x) => ILPatternMatchingExt.MatchLdfld<EntityState>(x, "outer") }).ThrowIfFailure().ResetAnimatorSpeed(); } private static void PlaceSingleDelayBlast(ILManipulationInfo info) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) ILWeaver w = new ILWeaver(info); w.MatchRelaxed(new Predicate<Instruction>[1] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<ProjectileManager>(x, "get_instance") && w.SetCurrentTo(x) }).ThrowIfFailure().InsertAfterCurrent((IEnumerable<InstructionOrEnumerable>)new <>z__ReadOnlyArray<InstructionOrEnumerable>((InstructionOrEnumerable[])(object)new InstructionOrEnumerable[3] { InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldloc_0)), InstructionOrEnumerable.op_Implicit(w.CreateDelegateCall<Func<FireProjectileInfo, FireProjectileInfo>>((Func<FireProjectileInfo, FireProjectileInfo>)delegate(FireProjectileInfo fireProjectileInfo) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) fireProjectileInfo.useFuseOverride = true; return fireProjectileInfo; })), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Stloc_0)) })); w.MatchRelaxed(new Predicate<Instruction>[1] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<FireProjectileInfo>(x, "set_fuseOverride") && w.SetCurrentTo(x) }).ThrowIfFailure().InsertDurationUseAttackSpeedBefore(); } private static void OnExit(FireFist self) { if (self != null) { Animator modelAnimator = ((EntityState)self).GetModelAnimator(); if (modelAnimator != null) { modelAnimator.speed = 1f; } } } private static ILWeaver InsertDurationUseAttackSpeedAfter(this ILWeaver w) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) return w.InsertAfterCurrent((IEnumerable<InstructionOrEnumerable>)new <>z__ReadOnlyArray<InstructionOrEnumerable>((InstructionOrEnumerable[])(object)new InstructionOrEnumerable[2] { InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldarg_0)), InstructionOrEnumerable.op_Implicit(w.CreateDelegateCall<Func<float, FireFist, float>>((Func<float, FireFist, float>)delegate(float fireFirstDuration, FireFist currentFireFistState) { if (currentFireFistState == null) { return fireFirstDuration; } Animator modelAnimator = ((EntityState)currentFireFistState).GetModelAnimator(); if ((Object)(object)modelAnimator == (Object)null) { return fireFirstDuration; } modelAnimator.speed = 1f * ((BaseState)currentFireFistState).attackSpeedStat; return fireFirstDuration / ((BaseState)currentFireFistState).attackSpeedStat; })) })); } private static ILWeaver InsertDurationUseAttackSpeedBefore(this ILWeaver w) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) return w.InsertBeforeCurrent((IEnumerable<InstructionOrEnumerable>)new <>z__ReadOnlyArray<InstructionOrEnumerable>((InstructionOrEnumerable[])(object)new InstructionOrEnumerable[2] { InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldarg_0)), InstructionOrEnumerable.op_Implicit(w.CreateDelegateCall<Func<float, FireFist, float>>((Func<float, FireFist, float>)delegate(float fireFirstDuration, FireFist currentFireFistState) { if (currentFireFistState == null) { return fireFirstDuration; } Animator modelAnimator = ((EntityState)currentFireFistState).GetModelAnimator(); if ((Object)(object)modelAnimator == (Object)null) { return fireFirstDuration; } modelAnimator.speed = 1f * ((BaseState)currentFireFistState).attackSpeedStat; return fireFirstDuration / ((BaseState)currentFireFistState).attackSpeedStat; })) })); } private static ILWeaver ResetSpeedReturnDuration(this ILWeaver w) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) return w.InsertAfterCurrent((IEnumerable<InstructionOrEnumerable>)new <>z__ReadOnlyArray<InstructionOrEnumerable>((InstructionOrEnumerable[])(object)new InstructionOrEnumerable[2] { InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldarg_0)), InstructionOrEnumerable.op_Implicit(w.CreateDelegateCall<Func<float, FireFist, float>>((Func<float, FireFist, float>)delegate(float fireFirstDuration, FireFist currentFireFistState) { if (currentFireFistState == null) { return fireFirstDuration; } Animator modelAnimator = ((EntityState)currentFireFistState).GetModelAnimator(); if ((Object)(object)modelAnimator == (Object)null) { return fireFirstDuration; } modelAnimator.speed = 1f; return fireFirstDuration / ((BaseState)currentFireFistState).attackSpeedStat * 1.4f; })) })); } private static ILWeaver ResetAnimatorSpeed(this ILWeaver w) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) return w.InsertBeforeCurrent((IEnumerable<InstructionOrEnumerable>)new <>z__ReadOnlyArray<InstructionOrEnumerable>((InstructionOrEnumerable[])(object)new InstructionOrEnumerable[2] { InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldarg_0)), InstructionOrEnumerable.op_Implicit(w.CreateDelegateCall<Action<FireFist>>((Action<FireFist>)delegate(FireFist fireFistState) { if (fireFistState != null) { Animator modelAnimator = ((EntityState)fireFistState).GetModelAnimator(); if (modelAnimator != null) { modelAnimator.speed = 1f; } } })) })); } } [MonoDetourTargets(typeof(FireMegaLaser))] internal static class FireMegaLaserState { [CompilerGenerated] private static class <>O { public static Manipulator <0>__FireMegaLaser_FixedUpdate; public static Manipulator <1>__FireMegaLaser_FireBullet; } [MonoDetourHookInitialize] internal static void SetupILHooks() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Expected O, but got Unknown object obj = <>O.<0>__FireMegaLaser_FixedUpdate; if (obj == null) { Manipulator val = FireMegaLaser_FixedUpdate; <>O.<0>__FireMegaLaser_FixedUpdate = val; obj = (object)val; } Mdh.EntityStates.TitanMonster.FireMegaLaser.FixedUpdate.ILHook((Manipulator)obj); object obj2 = <>O.<1>__FireMegaLaser_FireBullet; if (obj2 == null) { Manipulator val2 = FireMegaLaser_FireBullet; <>O.<1>__FireMegaLaser_FireBullet = val2; obj2 = (object)val2; } FireBullet.ILHook((Manipulator)obj2); } private static void FireMegaLaser_FixedUpdate(ILManipulationInfo info) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0012: Expected O, but got Unknown ILWeaver val = new ILWeaver(info); MakeNextMegaLaserFireFrequencyUseAttackSpeed(val); MakeNextMegaLaserFireFrequencyUseAttackSpeed(val); } private static void FireMegaLaser_FireBullet(ILManipulationInfo info) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown MakeFireBulletFrequencyUseAttackSpeed(new ILWeaver(info)); } private static ILWeaver MakeNextMegaLaserFireFrequencyUseAttackSpeed(this ILWeaver w) { //IL_0047: Unknown result type (might be due to invalid IL or missing references) w.MatchNextRelaxed((Instruction x) => ILPatternMatchingExt.MatchLdsfld<FireMegaLaser>(x, "fireFrequency") && w.SetCurrentTo(x)).ThrowIfFailure(); return w.InsertAfterCurrent((IEnumerable<InstructionOrEnumerable>)new <>z__ReadOnlyArray<InstructionOrEnumerable>((InstructionOrEnumerable[])(object)new InstructionOrEnumerable[2] { InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldarg_0)), InstructionOrEnumerable.op_Implicit(w.CreateDelegateCall<Func<float, FireMegaLaser, float>>((Func<float, FireMegaLaser, float>)((float fireFrequency, FireMegaLaser megaLaserState) => (megaLaserState == null) ? fireFrequency : (fireFrequency * ((BaseState)megaLaserState).attackSpeedStat)))) })); } private static ILWeaver MakeFireBulletFrequencyUseAttackSpeed(this ILWeaver w) { //IL_0047: Unknown result type (might be due to invalid IL or missing references) w.MatchRelaxed(new Predicate<Instruction>[1] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld<FireMegaLaser>(x, "fireFrequency") && w.SetCurrentTo(x) }).ThrowIfFailure(); return w.InsertAfterCurrent((IEnumerable<InstructionOrEnumerable>)new <>z__ReadOnlyArray<InstructionOrEnumerable>((InstructionOrEnumerable[])(object)new InstructionOrEnumerable[2] { InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldarg_0)), InstructionOrEnumerable.op_Implicit(w.CreateDelegateCall<Func<float, FireMegaLaser, float>>((Func<float, FireMegaLaser, float>)((float fireFrequency, FireMegaLaser megaLaserState) => (megaLaserState == null || ConfigOptions.StoneTitan.RemoveLaserDamageScaling.Value) ? fireFrequency : (fireFrequency * ((BaseState)megaLaserState).attackSpeedStat)))) })); } } [MonoDetourTargets(typeof(TitanRockController))] internal static class TitanRockControllerStuff { [CompilerGenerated] private static class <>O { public static Manipulator <0>__TitanRockController_Start; public static Manipulator <1>__TitanRockController_FixedUpdate; public static Manipulator <2>__TitanRockController_FixedUpdateServer; } [MonoDetourHookInitialize] internal static void SetupILHooks() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Expected O, but got Unknown //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Expected O, but got Unknown object obj = <>O.<0>__TitanRockController_Start; if (obj == null) { Manipulator val = TitanRockController_Start; <>O.<0>__TitanRockController_Start = val; obj = (object)val; } Start.ILHook((Manipulator)obj); object obj2 = <>O.<1>__TitanRockController_FixedUpdate; if (obj2 == null) { Manipulator val2 = TitanRockController_FixedUpdate; <>O.<1>__TitanRockController_FixedUpdate = val2; obj2 = (object)val2; } Mdh.RoR2.TitanRockController.FixedUpdate.ILHook((Manipulator)obj2); object obj3 = <>O.<2>__TitanRockController_FixedUpdateServer; if (obj3 == null) { Manipulator val3 = TitanRockController_FixedUpdateServer; <>O.<2>__TitanRockController_FixedUpdateServer = val3; obj3 = (object)val3; } FixedUpdateServer.ILHook((Manipulator)obj3); } private static void TitanRockController_Start(ILManipulationInfo info) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) ILWeaver w = new ILWeaver(info); w.MatchRelaxed(new Predicate<Instruction>[1] { (Instruction x) => ILPatternMatchingExt.MatchLdfld<TitanRockController>(x, "startDelay") && w.SetCurrentTo(x) }).ThrowIfFailure().InsertAfterCurrent((IEnumerable<InstructionOrEnumerable>)new <>z__ReadOnlyArray<InstructionOrEnumerable>((InstructionOrEnumerable[])(object)new InstructionOrEnumerable[2] { InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldarg_0)), InstructionOrEnumerable.op_Implicit(w.CreateDelegateCall<Func<float, TitanRockController, float>>((Func<float, TitanRockController, float>)((float startDelay, TitanRockController titanRockController) => ((Object)(object)titanRockController.ownerCharacterBody == (Object)null) ? startDelay : (startDelay / titanRockController.ownerCharacterBody.attackSpeed)))) })); } private static void TitanRockController_FixedUpdate(ILManipulationInfo info) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_0067: Unknown result type (might be due to invalid IL or missing references) ILWeaver w = new ILWeaver(info); w.MatchRelaxed(new Predicate<Instruction>[2] { (Instruction x) => ILPatternMatchingExt.MatchLdflda<TitanRockController>(x, "velocity"), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 1f) && w.SetCurrentTo(x) }).ThrowIfFailure().InsertAfterCurrent((IEnumerable<InstructionOrEnumerable>)new <>z__ReadOnlyArray<InstructionOrEnumerable>((InstructionOrEnumerable[])(object)new InstructionOrEnumerable[2] { InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldarg_0)), InstructionOrEnumerable.op_Implicit(w.CreateDelegateCall<Func<float, TitanRockController, float>>((Func<float, TitanRockController, float>)((float moveTime, TitanRockController titanRockController) => ((Object)(object)titanRockController.ownerCharacterBody == (Object)null) ? moveTime : (moveTime / (1f + (titanRockController.ownerCharacterBody.attackSpeed - 1f) / 2f))))) })); } private static void TitanRockController_FixedUpdateServer(ILManipulationInfo info) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) ILWeaver w = new ILWeaver(info); w.MatchRelaxed(new Predicate<Instruction>[1] { (Instruction x) => ILPatternMatchingExt.MatchLdfld<TitanRockController>(x, "fireInterval") && w.SetCurrentTo(x) }).ThrowIfFailure().InsertAfterCurrent((IEnumerable<InstructionOrEnumerable>)new <>z__ReadOnlyArray<InstructionOrEnumerable>((InstructionOrEnumerable[])(object)new InstructionOrEnumerable[2] { InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldarg_0)), InstructionOrEnumerable.op_Implicit(w.CreateDelegateCall<Func<float, TitanRockController, float>>((Func<float, TitanRockController, float>)((float fireInterval, TitanRockController titanRockController) => ((Object)(object)titanRockController.ownerCharacterBody == (Object)null) ? fireInterval : (fireInterval / titanRockController.ownerCharacterBody.attackSpeed)))) })); } } } [CompilerGenerated] internal sealed class <>z__ReadOnlyArray<T> : IEnumerable, ICollection, IList, IEnumerable<T>, IReadOnlyCollection<T>, IReadOnlyList<T>, ICollection<T>, IList<T> { int ICollection.Count => _items.Length; bool ICollection.IsSynchronized => false; object ICollection.SyncRoot => this; object IList.this[int index] { get { return _items[index]; } set { throw new NotSupportedException(); } } bool IList.IsFixedSize => true; bool IList.IsReadOnly => true; int IReadOnlyCollection<T>.Count => _items.Length; T IReadOnlyList<T>.this[int index] => _items[index]; int ICollection<T>.Count => _items.Length; bool ICollection<T>.IsReadOnly => true; T IList<T>.this[int index] { get { return _items[index]; } set { throw new NotSupportedException(); } } public <>z__ReadOnlyArray(T[] items) { _items = items; } IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable)_items).GetEnumerator(); } void ICollection.CopyTo(Array array, int index) { ((ICollection)_items).CopyTo(array, index); } int IList.Add(object value) { throw new NotSupportedException(); } void IList.Clear() { throw new NotSupportedException(); } bool IList.Contains(object value) { return ((IList)_items).Contains(value); } int IList.IndexOf(object value) { return ((IList)_items).IndexOf(value); } 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 ((IEnumerable<T>)_items).GetEnumerator(); } void ICollection<T>.Add(T item) { throw new NotSupportedException(); } void ICollection<T>.Clear() { throw new NotSupportedException(); } bool ICollection<T>.Contains(T item) { return ((ICollection<T>)_items).Contains(item); } void ICollection<T>.CopyTo(T[] array, int arrayIndex) { ((ICollection<T>)_items).CopyTo(array, arrayIndex); } bool ICollection<T>.Remove(T item) { throw new NotSupportedException(); } int IList<T>.IndexOf(T item) { return ((IList<T>)_items).IndexOf(item); } void IList<T>.Insert(int index, T item) { throw new NotSupportedException(); } void IList<T>.RemoveAt(int index) { throw new NotSupportedException(); } } [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(); } }