using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; 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.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using EntityStates; using EntityStates.Drone.Command; using EntityStates.Drone.DroneWeapon; using EntityStates.RocketSurvivorSkills.Primary; using EntityStates.Toolbot; using HG.Reflection; using Mdh.EntityStates.Drone.Command.CommandFireMissiles; using Mdh.EntityStates.Drone.DroneWeapon.FireMissileBarrage; using Mdh.EntityStates.RocketSurvivorSkills.Primary.FireRocket; using Mdh.RiskyTweaks.Tweaks.Survivors.Toolbot.ScrapICBM; using Mdh.RoR2.BarrageOnBossBehaviour; using Mdh.RoR2.CharacterBody; using Mdh.RoR2.CharacterMaster; using Mdh.RoR2.EquipmentSlot; using Mdh.RoR2.GlobalEventManager; using Mdh.RoR2.HealthComponent; using Mdh.RoR2.Inventory; using Mdh.RoR2.Items.ExtraLifeVoidManager; using Mdh.RoR2.Items.MultiShopCardUtils; using Mdh.RoR2.MissileUtils; using Mdh.RoR2.MoneyPickup; using Mdh.RoR2.Projectile.BoomerangProjectile; using Mdh.RoR2.SetStateOnHurt; using Mdh.RoR2.UI.LogBook.LogBookController; using Microsoft.CodeAnalysis; using MiscFixes.Modules; using Mono.Cecil; using Mono.Cecil.Cil; using MonoDetour; using MonoDetour.Cil; using MonoDetour.Cil.Analysis; using MonoDetour.DetourTypes; using MonoDetour.HookGen; using MonoDetour.Reflection.Unspeakable; using MonoMod.Cil; using MonoMod.Utils; using On.EntityStates.Toolbot; using R2API; using ReheatedItems.ItemChanges; using ReheatedItems.ItemChanges.PocketICBMMissilesToDamage; using ReheatedItems.ModSupport.Starstorm2; using RiskyTweaks.Tweaks.Survivors.Toolbot; using RoR2; using RoR2.CharacterAI; using RoR2.ContentManagement; using RoR2.ExpansionManagement; using RoR2.Items; using RoR2.Orbs; using RoR2.Projectile; using RoR2.UI.LogBook; using RoR2BepInExPack.GameAssetPaths.Version_1_39_0; using RoR2BepInExPack.GameAssetPathsBetter; using RoR2BepInExPack.Utilities; using SS2; using SS2.Equipments; using TMPro; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Networking; using UnityEngine.ResourceManagement.AsyncOperations; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: OptIn] [assembly: IgnoresAccessChecksTo("RiskyTweaks")] [assembly: IgnoresAccessChecksTo("RocketSurvivor")] [assembly: IgnoresAccessChecksTo("WolfoFixes")] [assembly: IgnoresAccessChecksTo("WolfoLibrary")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("LordVGames.ReheatedItems")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("0.5.3.0")] [assembly: AssemblyInformationalVersion("0.5.3+a04e845cdf3c10cd76ef3aa2212d5e242a3461b9")] [assembly: AssemblyProduct("LordVGames.ReheatedItems")] [assembly: AssemblyTitle("ReheatedItems")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.5.3.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [CompilerGenerated] internal sealed class <>z__ReadOnlyArray : IEnumerable, ICollection, IList, IEnumerable, IReadOnlyCollection, IReadOnlyList, ICollection, IList { 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.Count => _items.Length; T IReadOnlyList.this[int index] => _items[index]; int ICollection.Count => _items.Length; bool ICollection.IsReadOnly => true; T IList.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 IEnumerable.GetEnumerator() { return ((IEnumerable)_items).GetEnumerator(); } void ICollection.Add(T item) { throw new NotSupportedException(); } void ICollection.Clear() { throw new NotSupportedException(); } bool ICollection.Contains(T item) { return ((ICollection)_items).Contains(item); } void ICollection.CopyTo(T[] array, int arrayIndex) { ((ICollection)_items).CopyTo(array, arrayIndex); } bool ICollection.Remove(T item) { throw new NotSupportedException(); } int IList.IndexOf(T item) { return ((IList)_items).IndexOf(item); } void IList.Insert(int index, T item) { throw new NotSupportedException(); } void IList.RemoveAt(int index) { throw new NotSupportedException(); } } [CompilerGenerated] internal sealed class <>z__ReadOnlySingleElementList : IEnumerable, ICollection, IList, IEnumerable, IReadOnlyCollection, IReadOnlyList, ICollection, IList { private sealed class Enumerator : IDisposable, IEnumerator, IEnumerator { object IEnumerator.Current => _item; T IEnumerator.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.Count => 1; T IReadOnlyList.this[int index] { get { if (index != 0) { throw new IndexOutOfRangeException(); } return _item; } } int ICollection.Count => 1; bool ICollection.IsReadOnly => true; T IList.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.Default.Equals(_item, (T)value); } int IList.IndexOf(object value) { if (!EqualityComparer.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 IEnumerable.GetEnumerator() { return new Enumerator(_item); } void ICollection.Add(T item) { throw new NotSupportedException(); } void ICollection.Clear() { throw new NotSupportedException(); } bool ICollection.Contains(T item) { return EqualityComparer.Default.Equals(_item, item); } void ICollection.CopyTo(T[] array, int arrayIndex) { array[arrayIndex] = _item; } bool ICollection.Remove(T item) { throw new NotSupportedException(); } int IList.IndexOf(T item) { if (!EqualityComparer.Default.Equals(_item, item)) { return -1; } return 0; } void IList.Insert(int index, T item) { throw new NotSupportedException(); } void IList.RemoveAt(int index) { throw new NotSupportedException(); } } 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.RiskyTweaks.Tweaks.Survivors.Toolbot.ScrapICBM { internal static class FireGrenadeLauncher_ModifyProjectileAimRay { public delegate void PrefixSignature(ScrapICBM self, ref orig_ModifyProjectileAimRay orig, ref FireGrenadeLauncher self1, ref Ray aimRay); public delegate ReturnFlow ControlFlowPrefixSignature(ScrapICBM self, ref orig_ModifyProjectileAimRay orig, ref FireGrenadeLauncher self1, ref Ray aimRay, ref Ray returnValue); public delegate void PostfixSignature(ScrapICBM self, ref orig_ModifyProjectileAimRay orig, ref FireGrenadeLauncher self1, ref Ray aimRay, ref Ray returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(ScrapICBM).GetMethod("FireGrenadeLauncher_ModifyProjectileAimRay", (BindingFlags)(-1), null, new Type[3] { typeof(orig_ModifyProjectileAimRay), typeof(FireGrenadeLauncher), typeof(Ray) }, null) ?? throw new MissingMethodException("RiskyTweaks.Tweaks.Survivors.Toolbot.ScrapICBM", "FireGrenadeLauncher_ModifyProjectileAimRay"); } } } namespace Mdh.EntityStates.RocketSurvivorSkills.Primary.FireRocket { internal static class FixedUpdate { public delegate void PrefixSignature(FireRocket self); public delegate void PostfixSignature(FireRocket self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(FireRocket).GetMethod("FixedUpdate", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("EntityStates.RocketSurvivorSkills.Primary.FireRocket", "FixedUpdate"); } } internal static class OnEnter { public delegate void PrefixSignature(FireRocket self); public delegate void PostfixSignature(FireRocket self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(FireRocket).GetMethod("OnEnter", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("EntityStates.RocketSurvivorSkills.Primary.FireRocket", "OnEnter"); } } } namespace Mdh.EntityStates.Drone.Command.CommandFireMissiles { internal static class FixedUpdate { public delegate void PrefixSignature(CommandFireMissiles self); public delegate void PostfixSignature(CommandFireMissiles self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(CommandFireMissiles).GetMethod("FixedUpdate", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("EntityStates.Drone.Command.CommandFireMissiles", "FixedUpdate"); } } internal static class FireMissile { public delegate void PrefixSignature(CommandFireMissiles self, ref string targetMuzzle); public delegate void PostfixSignature(CommandFireMissiles self, ref string targetMuzzle); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(CommandFireMissiles).GetMethod("FireMissile", (BindingFlags)(-1), null, new Type[1] { typeof(string) }, null) ?? throw new MissingMethodException("EntityStates.Drone.Command.CommandFireMissiles", "FireMissile"); } } internal static class OnEnter { public delegate void PrefixSignature(CommandFireMissiles self); public delegate void PostfixSignature(CommandFireMissiles self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(CommandFireMissiles).GetMethod("OnEnter", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("EntityStates.Drone.Command.CommandFireMissiles", "OnEnter"); } } } namespace Mdh.EntityStates.Drone.DroneWeapon.FireMissileBarrage { internal static class FixedUpdate { public delegate void PrefixSignature(FireMissileBarrage self); public delegate void PostfixSignature(FireMissileBarrage self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(FireMissileBarrage).GetMethod("FixedUpdate", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("EntityStates.Drone.DroneWeapon.FireMissileBarrage", "FixedUpdate"); } } internal static class FireMissile { public delegate void PrefixSignature(FireMissileBarrage self, ref string targetMuzzle); public delegate void PostfixSignature(FireMissileBarrage self, ref string targetMuzzle); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(FireMissileBarrage).GetMethod("FireMissile", (BindingFlags)(-1), null, new Type[1] { typeof(string) }, null) ?? throw new MissingMethodException("EntityStates.Drone.DroneWeapon.FireMissileBarrage", "FireMissile"); } } internal static class OnEnter { public delegate void PrefixSignature(FireMissileBarrage self); public delegate void PostfixSignature(FireMissileBarrage self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(FireMissileBarrage).GetMethod("OnEnter", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("EntityStates.Drone.DroneWeapon.FireMissileBarrage", "OnEnter"); } } } namespace Mdh.RoR2.MoneyPickup { internal static class Start { public delegate void PrefixSignature(MoneyPickup self); public delegate void PostfixSignature(MoneyPickup self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(MoneyPickup).GetMethod("Start", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("RoR2.MoneyPickup", "Start"); } } internal static class OnTriggerStay { public delegate void PrefixSignature(MoneyPickup self, ref Collider other); public delegate void PostfixSignature(MoneyPickup self, ref Collider other); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(MoneyPickup).GetMethod("OnTriggerStay", (BindingFlags)(-1), null, new Type[1] { typeof(Collider) }, null) ?? throw new MissingMethodException("RoR2.MoneyPickup", "OnTriggerStay"); } } } namespace Mdh.RoR2.SetStateOnHurt { internal static class OnTakeDamageServer { public delegate void PrefixSignature(SetStateOnHurt self, ref DamageReport damageReport); public delegate void PostfixSignature(SetStateOnHurt self, ref DamageReport damageReport); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(SetStateOnHurt).GetMethod("OnTakeDamageServer", (BindingFlags)(-1), null, new Type[1] { typeof(DamageReport) }, null) ?? throw new MissingMethodException("RoR2.SetStateOnHurt", "OnTakeDamageServer"); } } internal static class Start { public delegate void PrefixSignature(SetStateOnHurt self); public delegate void PostfixSignature(SetStateOnHurt self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(SetStateOnHurt).GetMethod("Start", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("RoR2.SetStateOnHurt", "Start"); } } } namespace Mdh.RoR2.BarrageOnBossBehaviour { internal static class FireMissile { public delegate void PrefixSignature(BarrageOnBossBehaviour self); public delegate ReturnFlow ControlFlowPrefixSignature(BarrageOnBossBehaviour self); public delegate void PostfixSignature(BarrageOnBossBehaviour self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(BarrageOnBossBehaviour).GetMethod("FireMissile", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("RoR2.BarrageOnBossBehaviour", "FireMissile"); } } internal static class Start { public delegate void PrefixSignature(BarrageOnBossBehaviour self); public delegate ReturnFlow ControlFlowPrefixSignature(BarrageOnBossBehaviour self); public delegate void PostfixSignature(BarrageOnBossBehaviour self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(BarrageOnBossBehaviour).GetMethod("Start", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("RoR2.BarrageOnBossBehaviour", "Start"); } } internal static class UpdateExtraMissileMoneyCount { public delegate void PrefixSignature(BarrageOnBossBehaviour self, ref float amount); public delegate ReturnFlow ControlFlowPrefixSignature(BarrageOnBossBehaviour self, ref float amount); public delegate void PostfixSignature(BarrageOnBossBehaviour self, ref float amount); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(BarrageOnBossBehaviour).GetMethod("UpdateExtraMissileMoneyCount", (BindingFlags)(-1), null, new Type[1] { typeof(float) }, null) ?? throw new MissingMethodException("RoR2.BarrageOnBossBehaviour", "UpdateExtraMissileMoneyCount"); } } internal static class CalculateMissileDamage { public delegate void PrefixSignature(BarrageOnBossBehaviour self, ref CharacterBody targetBody); public delegate ReturnFlow ControlFlowPrefixSignature(BarrageOnBossBehaviour self, ref CharacterBody targetBody, ref float returnValue); public delegate void PostfixSignature(BarrageOnBossBehaviour self, ref CharacterBody targetBody, ref float returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(BarrageOnBossBehaviour).GetMethod("CalculateMissileDamage", (BindingFlags)(-1), null, new Type[1] { typeof(CharacterBody) }, null) ?? throw new MissingMethodException("RoR2.BarrageOnBossBehaviour", "CalculateMissileDamage"); } } internal static class UpdateBarrage { public delegate void PrefixSignature(BarrageOnBossBehaviour self); public delegate ReturnFlow ControlFlowPrefixSignature(BarrageOnBossBehaviour self); public delegate void PostfixSignature(BarrageOnBossBehaviour self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(BarrageOnBossBehaviour).GetMethod("UpdateBarrage", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("RoR2.BarrageOnBossBehaviour", "UpdateBarrage"); } } internal static class StartMissileCountdown { public delegate void PrefixSignature(BarrageOnBossBehaviour self, ref bool skipInitBoss); public delegate ReturnFlow ControlFlowPrefixSignature(BarrageOnBossBehaviour self, ref bool skipInitBoss); public delegate void PostfixSignature(BarrageOnBossBehaviour self, ref bool skipInitBoss); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(BarrageOnBossBehaviour).GetMethod("StartMissileCountdown", (BindingFlags)(-1), null, new Type[1] { typeof(bool) }, null) ?? throw new MissingMethodException("RoR2.BarrageOnBossBehaviour", "StartMissileCountdown"); } } internal static class Init { public delegate void PrefixSignature(); public delegate ReturnFlow ControlFlowPrefixSignature(); public delegate void PostfixSignature(); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(BarrageOnBossBehaviour).GetMethod("Init", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("RoR2.BarrageOnBossBehaviour", "Init"); } } } namespace Mdh.RoR2.UI.LogBook.LogBookController { internal static class CanSelectEquipmentEntry { public delegate void PrefixSignature(ref EquipmentDef equipmentDef, ref Dictionary expansionAvailability); public delegate ReturnFlow ControlFlowPrefixSignature(ref EquipmentDef equipmentDef, ref Dictionary expansionAvailability, ref bool returnValue); public delegate void PostfixSignature(ref EquipmentDef equipmentDef, ref Dictionary expansionAvailability, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(LogBookController).GetMethod("CanSelectEquipmentEntry", (BindingFlags)(-1), null, new Type[2] { typeof(EquipmentDef), typeof(Dictionary) }, null) ?? throw new MissingMethodException("RoR2.UI.LogBook.LogBookController", "CanSelectEquipmentEntry"); } } internal static class Start { public delegate void PrefixSignature(LogBookController self); public delegate ReturnFlow ControlFlowPrefixSignature(LogBookController self); public delegate void PostfixSignature(LogBookController self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(LogBookController).GetMethod("Start", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("RoR2.UI.LogBook.LogBookController", "Start"); } } internal static class LogBookState { internal static class OnEnter { public delegate void PrefixSignature(LogBookState self); public delegate ReturnFlow ControlFlowPrefixSignature(LogBookState self); public delegate void PostfixSignature(LogBookState self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(LogBookState).GetMethod("OnEnter", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("RoR2.UI.LogBook.LogBookController+LogBookState", "OnEnter"); } } } internal static class FadeState { internal static class OnEnter { public delegate void PrefixSignature(FadeState self); public delegate ReturnFlow ControlFlowPrefixSignature(FadeState self); public delegate void PostfixSignature(FadeState self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(FadeState).GetMethod("OnEnter", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("RoR2.UI.LogBook.LogBookController+FadeState", "OnEnter"); } } } internal static class ChangeEntriesPageState { internal static class OnEnter { public delegate void PrefixSignature(ChangeEntriesPageState self); public delegate ReturnFlow ControlFlowPrefixSignature(ChangeEntriesPageState self); public delegate void PostfixSignature(ChangeEntriesPageState self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(ChangeEntriesPageState).GetMethod("OnEnter", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("RoR2.UI.LogBook.LogBookController+ChangeEntriesPageState", "OnEnter"); } } } internal static class ChangeCategoryState { internal static class OnEnter { public delegate void PrefixSignature(ChangeCategoryState self); public delegate ReturnFlow ControlFlowPrefixSignature(ChangeCategoryState self); public delegate void PostfixSignature(ChangeCategoryState self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(ChangeCategoryState).GetMethod("OnEnter", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("RoR2.UI.LogBook.LogBookController+ChangeCategoryState", "OnEnter"); } } } internal static class EnterLogViewState { internal static class OnEnter { public delegate void PrefixSignature(EnterLogViewState self); public delegate ReturnFlow ControlFlowPrefixSignature(EnterLogViewState self); public delegate void PostfixSignature(EnterLogViewState self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(EnterLogViewState).GetMethod("OnEnter", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("RoR2.UI.LogBook.LogBookController+EnterLogViewState", "OnEnter"); } } } internal static class Init { public delegate void PrefixSignature(); public delegate ReturnFlow ControlFlowPrefixSignature(ref IEnumerator returnValue); public delegate void PostfixSignature(ref IEnumerator returnValue); public delegate void PrefixMoveNextSignature(SpeakableEnumerator self); public delegate ReturnFlow ControlFlowPrefixMoveNextSignature(SpeakableEnumerator self, ref bool continueEnumeration); public delegate void PostfixMoveNextSignature(SpeakableEnumerator self, ref bool continueEnumeration); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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 MonoDetourHook PrefixMoveNext(PrefixMoveNextSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook((MethodBase)StateMachineTarget(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefixMoveNext(ControlFlowPrefixMoveNextSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook((MethodBase)StateMachineTarget(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook PostfixMoveNext(PostfixMoveNextSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook((MethodBase)StateMachineTarget(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHookMoveNext(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook((MethodBase)StateMachineTarget(), manipulator, config, applyByDefault); } public static MethodBase Target() { return typeof(LogBookController).GetMethod("Init", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("RoR2.UI.LogBook.LogBookController", "Init"); } public static MethodInfo StateMachineTarget() { return Extensions.GetStateMachineTarget((MethodInfo)Target()); } } internal static class CommonAssets { internal static class Init { public delegate void PrefixSignature(); public delegate ReturnFlow ControlFlowPrefixSignature(ref IEnumerator returnValue); public delegate void PostfixSignature(ref IEnumerator returnValue); public delegate void PrefixMoveNextSignature(SpeakableEnumerator self); public delegate ReturnFlow ControlFlowPrefixMoveNextSignature(SpeakableEnumerator self, ref bool continueEnumeration); public delegate void PostfixMoveNextSignature(SpeakableEnumerator self, ref bool continueEnumeration); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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 MonoDetourHook PrefixMoveNext(PrefixMoveNextSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook((MethodBase)StateMachineTarget(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefixMoveNext(ControlFlowPrefixMoveNextSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook((MethodBase)StateMachineTarget(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook PostfixMoveNext(PostfixMoveNextSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook((MethodBase)StateMachineTarget(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHookMoveNext(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook((MethodBase)StateMachineTarget(), manipulator, config, applyByDefault); } public static MethodBase Target() { return typeof(CommonAssets).GetMethod("Init", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("RoR2.UI.LogBook.LogBookController+CommonAssets", "Init"); } public static MethodInfo StateMachineTarget() { return Extensions.GetStateMachineTarget((MethodInfo)Target()); } } } } namespace Mdh.RoR2.Items.ExtraLifeVoidManager { internal static class GetNextBodyPrefab { public delegate void PrefixSignature(); public delegate ReturnFlow ControlFlowPrefixSignature(ref GameObject returnValue); public delegate void PostfixSignature(ref GameObject returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(ExtraLifeVoidManager).GetMethod("GetNextBodyPrefab", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("RoR2.Items.ExtraLifeVoidManager", "GetNextBodyPrefab"); } } internal static class Init { public delegate void PrefixSignature(); public delegate ReturnFlow ControlFlowPrefixSignature(); public delegate void PostfixSignature(); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(ExtraLifeVoidManager).GetMethod("Init", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("RoR2.Items.ExtraLifeVoidManager", "Init"); } } } namespace Mdh.RoR2.Items.MultiShopCardUtils { internal static class OnPurchase { public delegate void PrefixSignature(ref PayCostContext context, ref int moneyCost); public delegate void PostfixSignature(ref PayCostContext context, ref int moneyCost); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(MultiShopCardUtils).GetMethod("OnPurchase", (BindingFlags)(-1), null, new Type[2] { typeof(PayCostContext), typeof(int) }, null) ?? throw new MissingMethodException("RoR2.Items.MultiShopCardUtils", "OnPurchase"); } } } namespace Mdh.RoR2.CharacterBody { internal static class FixedUpdate { public delegate void PrefixSignature(CharacterBody self); public delegate ReturnFlow ControlFlowPrefixSignature(CharacterBody self); public delegate void PostfixSignature(CharacterBody self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(CharacterBody).GetMethod("FixedUpdate", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("RoR2.CharacterBody", "FixedUpdate"); } } internal static class AffixHauntedBehavior { internal static class FixedUpdate { public delegate void PrefixSignature(AffixHauntedBehavior self); public delegate ReturnFlow ControlFlowPrefixSignature(AffixHauntedBehavior self); public delegate void PostfixSignature(AffixHauntedBehavior self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(AffixHauntedBehavior).GetMethod("FixedUpdate", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("RoR2.CharacterBody+AffixHauntedBehavior", "FixedUpdate"); } } } internal static class ElementalRingsBehavior { internal static class FixedUpdate { public delegate void PrefixSignature(ElementalRingsBehavior self); public delegate ReturnFlow ControlFlowPrefixSignature(ElementalRingsBehavior self); public delegate void PostfixSignature(ElementalRingsBehavior self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(ElementalRingsBehavior).GetMethod("FixedUpdate", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("RoR2.CharacterBody+ElementalRingsBehavior", "FixedUpdate"); } } } internal static class AffixEchoBehavior { internal static class FixedUpdate { public delegate void PrefixSignature(AffixEchoBehavior self); public delegate ReturnFlow ControlFlowPrefixSignature(AffixEchoBehavior self); public delegate void PostfixSignature(AffixEchoBehavior self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(AffixEchoBehavior).GetMethod("FixedUpdate", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("RoR2.CharacterBody+AffixEchoBehavior", "FixedUpdate"); } } } internal static class SetBuffCount { public delegate void PrefixSignature(CharacterBody self, ref BuffIndex buffType, ref int newCount); public delegate ReturnFlow ControlFlowPrefixSignature(CharacterBody self, ref BuffIndex buffType, ref int newCount); public delegate void PostfixSignature(CharacterBody self, ref BuffIndex buffType, ref int newCount); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(CharacterBody).GetMethod("SetBuffCount", (BindingFlags)(-1), null, new Type[2] { typeof(BuffIndex), typeof(int) }, null) ?? throw new MissingMethodException("RoR2.CharacterBody", "SetBuffCount"); } } internal static class RecalculateStats { public delegate void PrefixSignature(CharacterBody self); public delegate ReturnFlow ControlFlowPrefixSignature(CharacterBody self); public delegate void PostfixSignature(CharacterBody self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(CharacterBody).GetMethod("RecalculateStats", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("RoR2.CharacterBody", "RecalculateStats"); } } internal static class OnInventoryChanged { public delegate void PrefixSignature(CharacterBody self); public delegate ReturnFlow ControlFlowPrefixSignature(CharacterBody self); public delegate void PostfixSignature(CharacterBody self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(CharacterBody).GetMethod("OnInventoryChanged", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("RoR2.CharacterBody", "OnInventoryChanged"); } } internal static class GetTimedBuffTotalDurationForIndex { public delegate void PrefixSignature(CharacterBody self, ref BuffIndex buffIndex, ref float totalDuration); public delegate ReturnFlow ControlFlowPrefixSignature(CharacterBody self, ref BuffIndex buffIndex, ref float totalDuration, ref bool returnValue); public delegate void PostfixSignature(CharacterBody self, ref BuffIndex buffIndex, ref float totalDuration, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(CharacterBody).GetMethod("GetTimedBuffTotalDurationForIndex", (BindingFlags)(-1), null, new Type[2] { typeof(BuffIndex), typeof(float).MakeByRefType() }, null) ?? throw new MissingMethodException("RoR2.CharacterBody", "GetTimedBuffTotalDurationForIndex"); } } internal static class OnTakeDamageServer { public delegate void PrefixSignature(CharacterBody self, ref DamageReport damageReport); public delegate ReturnFlow ControlFlowPrefixSignature(CharacterBody self, ref DamageReport damageReport); public delegate void PostfixSignature(CharacterBody self, ref DamageReport damageReport); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(CharacterBody).GetMethod("OnTakeDamageServer", (BindingFlags)(-1), null, new Type[1] { typeof(DamageReport) }, null) ?? throw new MissingMethodException("RoR2.CharacterBody", "OnTakeDamageServer"); } } internal static class GetBody { public delegate void PrefixSignature(CharacterBody self); public delegate ReturnFlow ControlFlowPrefixSignature(CharacterBody self, ref CharacterBody returnValue); public delegate void PostfixSignature(CharacterBody self, ref CharacterBody returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(CharacterBody).GetMethod("GetBody", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("RoR2.CharacterBody", "GetBody"); } } internal static class Start { public delegate void PrefixSignature(CharacterBody self); public delegate ReturnFlow ControlFlowPrefixSignature(CharacterBody self); public delegate void PostfixSignature(CharacterBody self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(CharacterBody).GetMethod("Start", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("RoR2.CharacterBody", "Start"); } } internal static class QuestVolatileBatteryBehaviorServer { internal static class Start { public delegate void PrefixSignature(QuestVolatileBatteryBehaviorServer self); public delegate ReturnFlow ControlFlowPrefixSignature(QuestVolatileBatteryBehaviorServer self); public delegate void PostfixSignature(QuestVolatileBatteryBehaviorServer self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(QuestVolatileBatteryBehaviorServer).GetMethod("Start", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("RoR2.CharacterBody+QuestVolatileBatteryBehaviorServer", "Start"); } } } internal static class DelayedDamageBehavior { internal static class Start { public delegate void PrefixSignature(DelayedDamageBehavior self); public delegate ReturnFlow ControlFlowPrefixSignature(DelayedDamageBehavior self); public delegate void PostfixSignature(DelayedDamageBehavior self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(DelayedDamageBehavior).GetMethod("Start", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("RoR2.CharacterBody+DelayedDamageBehavior", "Start"); } } } internal static class Init { public delegate void PrefixSignature(); public delegate ReturnFlow ControlFlowPrefixSignature(); public delegate void PostfixSignature(); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(CharacterBody).GetMethod("Init", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("RoR2.CharacterBody", "Init"); } } } namespace Mdh.RoR2.CharacterMaster { internal static class ExtraLifeServerBehavior { internal static class FixedUpdate { public delegate void PrefixSignature(ExtraLifeServerBehavior self); public delegate ReturnFlow ControlFlowPrefixSignature(ExtraLifeServerBehavior self); public delegate void PostfixSignature(ExtraLifeServerBehavior self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(ExtraLifeServerBehavior).GetMethod("FixedUpdate", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("RoR2.CharacterMaster+ExtraLifeServerBehavior", "FixedUpdate"); } } } internal static class OnInventoryChanged { public delegate void PrefixSignature(CharacterMaster self); public delegate ReturnFlow ControlFlowPrefixSignature(CharacterMaster self); public delegate void PostfixSignature(CharacterMaster self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(CharacterMaster).GetMethod("OnInventoryChanged", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("RoR2.CharacterMaster", "OnInventoryChanged"); } } internal static class RespawnExtraLifeVoid { public delegate void PrefixSignature(CharacterMaster self); public delegate ReturnFlow ControlFlowPrefixSignature(CharacterMaster self); public delegate void PostfixSignature(CharacterMaster self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(CharacterMaster).GetMethod("RespawnExtraLifeVoid", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("RoR2.CharacterMaster", "RespawnExtraLifeVoid"); } } internal static class SpawnBody { public delegate void PrefixSignature(CharacterMaster self, ref Vector3 position, ref Quaternion rotation); public delegate ReturnFlow ControlFlowPrefixSignature(CharacterMaster self, ref Vector3 position, ref Quaternion rotation, ref CharacterBody returnValue); public delegate void PostfixSignature(CharacterMaster self, ref Vector3 position, ref Quaternion rotation, ref CharacterBody returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(CharacterMaster).GetMethod("SpawnBody", (BindingFlags)(-1), null, new Type[2] { typeof(Vector3), typeof(Quaternion) }, null) ?? throw new MissingMethodException("RoR2.CharacterMaster", "SpawnBody"); } } internal static class RestoreOriginalBodyPrefab { public delegate void PrefixSignature(CharacterMaster self); public delegate ReturnFlow ControlFlowPrefixSignature(CharacterMaster self); public delegate void PostfixSignature(CharacterMaster self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(CharacterMaster).GetMethod("RestoreOriginalBodyPrefab", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("RoR2.CharacterMaster", "RestoreOriginalBodyPrefab"); } } internal static class GetBody { public delegate void PrefixSignature(CharacterMaster self); public delegate ReturnFlow ControlFlowPrefixSignature(CharacterMaster self, ref CharacterBody returnValue); public delegate void PostfixSignature(CharacterMaster self, ref CharacterBody returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(CharacterMaster).GetMethod("GetBody", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("RoR2.CharacterMaster", "GetBody"); } } internal static class Start { public delegate void PrefixSignature(CharacterMaster self); public delegate ReturnFlow ControlFlowPrefixSignature(CharacterMaster self); public delegate void PostfixSignature(CharacterMaster self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(CharacterMaster).GetMethod("Start", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("RoR2.CharacterMaster", "Start"); } } internal static class Init { public delegate void PrefixSignature(); public delegate ReturnFlow ControlFlowPrefixSignature(); public delegate void PostfixSignature(); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(CharacterMaster).GetMethod("Init", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("RoR2.CharacterMaster", "Init"); } } } namespace Mdh.RoR2.HealthComponent { internal static class FixedUpdate { public delegate void PrefixSignature(HealthComponent self); public delegate void PostfixSignature(HealthComponent self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(HealthComponent).GetMethod("FixedUpdate", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("RoR2.HealthComponent", "FixedUpdate"); } } internal static class RepeatHealComponent { internal static class FixedUpdate { public delegate void PrefixSignature(RepeatHealComponent self); public delegate void PostfixSignature(RepeatHealComponent self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(RepeatHealComponent).GetMethod("FixedUpdate", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("RoR2.HealthComponent+RepeatHealComponent", "FixedUpdate"); } } } internal static class OnInventoryChanged { public delegate void PrefixSignature(HealthComponent self); public delegate void PostfixSignature(HealthComponent self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(HealthComponent).GetMethod("OnInventoryChanged", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("RoR2.HealthComponent", "OnInventoryChanged"); } } internal static class TakeDamage { public delegate void PrefixSignature(HealthComponent self, ref DamageInfo damageInfo); public delegate void PostfixSignature(HealthComponent self, ref DamageInfo damageInfo); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(HealthComponent).GetMethod("TakeDamage", (BindingFlags)(-1), null, new Type[1] { typeof(DamageInfo) }, null) ?? throw new MissingMethodException("RoR2.HealthComponent", "TakeDamage"); } } internal static class TakeDamageProcess { public delegate void PrefixSignature(HealthComponent self, ref DamageInfo damageInfo); public delegate void PostfixSignature(HealthComponent self, ref DamageInfo damageInfo); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(HealthComponent).GetMethod("TakeDamageProcess", (BindingFlags)(-1), null, new Type[1] { typeof(DamageInfo) }, null) ?? throw new MissingMethodException("RoR2.HealthComponent", "TakeDamageProcess"); } } internal static class Init { public delegate void PrefixSignature(); public delegate void PostfixSignature(); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(HealthComponent).GetMethod("Init", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("RoR2.HealthComponent", "Init"); } } } namespace Mdh.RoR2.EquipmentSlot { internal static class FixedUpdate { public delegate void PrefixSignature(EquipmentSlot self); public delegate ReturnFlow ControlFlowPrefixSignature(EquipmentSlot self); public delegate void PostfixSignature(EquipmentSlot self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(EquipmentSlot).GetMethod("FixedUpdate", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("RoR2.EquipmentSlot", "FixedUpdate"); } } internal static class HealAndReviveLock { internal static class FixedUpdate { public delegate void PrefixSignature(HealAndReviveLock self); public delegate ReturnFlow ControlFlowPrefixSignature(HealAndReviveLock self); public delegate void PostfixSignature(HealAndReviveLock self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(HealAndReviveLock).GetMethod("FixedUpdate", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("RoR2.EquipmentSlot+HealAndReviveLock", "FixedUpdate"); } } } internal static class PerformEquipmentAction { public delegate void PrefixSignature(EquipmentSlot self, ref EquipmentDef equipmentDef); public delegate ReturnFlow ControlFlowPrefixSignature(EquipmentSlot self, ref EquipmentDef equipmentDef, ref bool returnValue); public delegate void PostfixSignature(EquipmentSlot self, ref EquipmentDef equipmentDef, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(EquipmentSlot).GetMethod("PerformEquipmentAction", (BindingFlags)(-1), null, new Type[1] { typeof(EquipmentDef) }, null) ?? throw new MissingMethodException("RoR2.EquipmentSlot", "PerformEquipmentAction"); } } internal static class UpdateTargets { public delegate void PrefixSignature(EquipmentSlot self, ref EquipmentIndex targetingEquipmentIndex, ref bool userShouldAnticipateTarget); public delegate ReturnFlow ControlFlowPrefixSignature(EquipmentSlot self, ref EquipmentIndex targetingEquipmentIndex, ref bool userShouldAnticipateTarget); public delegate void PostfixSignature(EquipmentSlot self, ref EquipmentIndex targetingEquipmentIndex, ref bool userShouldAnticipateTarget); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(EquipmentSlot).GetMethod("UpdateTargets", (BindingFlags)(-1), null, new Type[2] { typeof(EquipmentIndex), typeof(bool) }, null) ?? throw new MissingMethodException("RoR2.EquipmentSlot", "UpdateTargets"); } } internal static class ConfigureTargetFinderForEnemies { public delegate void PrefixSignature(EquipmentSlot self); public delegate ReturnFlow ControlFlowPrefixSignature(EquipmentSlot self); public delegate void PostfixSignature(EquipmentSlot self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(EquipmentSlot).GetMethod("ConfigureTargetFinderForEnemies", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("RoR2.EquipmentSlot", "ConfigureTargetFinderForEnemies"); } } internal static class InvalidateCurrentTarget { public delegate void PrefixSignature(EquipmentSlot self); public delegate ReturnFlow ControlFlowPrefixSignature(EquipmentSlot self); public delegate void PostfixSignature(EquipmentSlot self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(EquipmentSlot).GetMethod("InvalidateCurrentTarget", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("RoR2.EquipmentSlot", "InvalidateCurrentTarget"); } } internal static class FireMissile { public delegate void PrefixSignature(EquipmentSlot self); public delegate ReturnFlow ControlFlowPrefixSignature(EquipmentSlot self); public delegate void PostfixSignature(EquipmentSlot self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(EquipmentSlot).GetMethod("FireMissile", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("RoR2.EquipmentSlot", "FireMissile"); } } internal static class Start { public delegate void PrefixSignature(EquipmentSlot self); public delegate ReturnFlow ControlFlowPrefixSignature(EquipmentSlot self); public delegate void PostfixSignature(EquipmentSlot self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(EquipmentSlot).GetMethod("Start", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("RoR2.EquipmentSlot", "Start"); } } } namespace Mdh.RoR2.Projectile.ProjectileKnockOutGold { internal static class Start { public delegate void PrefixSignature(ProjectileKnockOutGold self); public delegate void PostfixSignature(ProjectileKnockOutGold self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(ProjectileKnockOutGold).GetMethod("Start", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("RoR2.Projectile.ProjectileKnockOutGold", "Start"); } } internal static class EnsureReferences { public delegate void PrefixSignature(ProjectileKnockOutGold self); public delegate void PostfixSignature(ProjectileKnockOutGold self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(ProjectileKnockOutGold).GetMethod("EnsureReferences", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("RoR2.Projectile.ProjectileKnockOutGold", "EnsureReferences"); } } } namespace Mdh.RoR2.Projectile.BoomerangProjectile { internal static class FixedUpdate { public delegate void PrefixSignature(BoomerangProjectile self); public delegate void PostfixSignature(BoomerangProjectile self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(BoomerangProjectile).GetMethod("FixedUpdate", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("RoR2.Projectile.BoomerangProjectile", "FixedUpdate"); } } internal static class Start { public delegate void PrefixSignature(BoomerangProjectile self); public delegate void PostfixSignature(BoomerangProjectile self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(BoomerangProjectile).GetMethod("Start", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("RoR2.Projectile.BoomerangProjectile", "Start"); } } } namespace Mdh.RoR2.MissileUtils { internal static class GetMoreMissileDamageMultiplier { public delegate void PrefixSignature(ref int moreMissileCount); public delegate ReturnFlow ControlFlowPrefixSignature(ref int moreMissileCount, ref float returnValue); public delegate void PostfixSignature(ref int moreMissileCount, ref float returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(MissileUtils).GetMethod("GetMoreMissileDamageMultiplier", (BindingFlags)(-1), null, new Type[1] { typeof(int) }, null) ?? throw new MissingMethodException("RoR2.MissileUtils", "GetMoreMissileDamageMultiplier"); } } internal static class FireMissile_UnityEngine_Vector3_RoR2_CharacterBody_RoR2_ProcChainMask_UnityEngine_GameObject_System_Single_System_Boolean_UnityEngine_GameObject_RoR2_DamageColorIndex_UnityEngine_Vector3_System_Single_System_Boolean { public delegate void PrefixSignature(ref Vector3 position, ref CharacterBody attackerBody, ref ProcChainMask procChainMask, ref GameObject victim, ref float missileDamage, ref bool isCrit, ref GameObject projectilePrefab, ref DamageColorIndex damageColorIndex, ref Vector3 initialDirection, ref float force, ref bool addMissileProc); public delegate ReturnFlow ControlFlowPrefixSignature(ref Vector3 position, ref CharacterBody attackerBody, ref ProcChainMask procChainMask, ref GameObject victim, ref float missileDamage, ref bool isCrit, ref GameObject projectilePrefab, ref DamageColorIndex damageColorIndex, ref Vector3 initialDirection, ref float force, ref bool addMissileProc); public delegate void PostfixSignature(ref Vector3 position, ref CharacterBody attackerBody, ref ProcChainMask procChainMask, ref GameObject victim, ref float missileDamage, ref bool isCrit, ref GameObject projectilePrefab, ref DamageColorIndex damageColorIndex, ref Vector3 initialDirection, ref float force, ref bool addMissileProc); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(MissileUtils).GetMethod("FireMissile", (BindingFlags)(-1), null, new Type[11] { typeof(Vector3), typeof(CharacterBody), typeof(ProcChainMask), typeof(GameObject), typeof(float), typeof(bool), typeof(GameObject), typeof(DamageColorIndex), typeof(Vector3), typeof(float), typeof(bool) }, null) ?? throw new MissingMethodException("RoR2.MissileUtils", "FireMissile"); } } } namespace Mdh.RoR2.Inventory { internal static class ItemStackValues { internal static class Create { public delegate void PrefixSignature(); public delegate void PostfixSignature(ref ItemStackValues returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(ItemStackValues).GetMethod("Create", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("RoR2.Inventory+ItemStackValues", "Create"); } } } internal static class ItemAndStackValues { internal static class Create { public delegate void PrefixSignature(); public delegate void PostfixSignature(ref ItemAndStackValues returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(ItemAndStackValues).GetMethod("Create", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("RoR2.Inventory+ItemAndStackValues", "Create"); } } } internal static class ItemTransformation { internal static class TryTransformResult { internal static class Create { public delegate void PrefixSignature(); public delegate void PostfixSignature(ref TryTransformResult returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(TryTransformResult).GetMethod("Create", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("RoR2.Inventory+ItemTransformation+TryTransformResult", "Create"); } } } } internal static class GiveItemPermanentImpl { internal static class Add { public delegate void PrefixSignature(GiveItemPermanentImpl self, ref ItemIndex itemIndex, ref int count); public delegate void PostfixSignature(GiveItemPermanentImpl self, ref ItemIndex itemIndex, ref int count); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(GiveItemPermanentImpl).GetMethod("Add", (BindingFlags)(-1), null, new Type[2] { typeof(ItemIndex), typeof(int) }, null) ?? throw new MissingMethodException("RoR2.Inventory+GiveItemPermanentImpl", "Add"); } } } internal static class GiveItemChanneledImpl { internal static class Add { public delegate void PrefixSignature(GiveItemChanneledImpl self, ref ItemIndex itemIndex, ref int count); public delegate void PostfixSignature(GiveItemChanneledImpl self, ref ItemIndex itemIndex, ref int count); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(GiveItemChanneledImpl).GetMethod("Add", (BindingFlags)(-1), null, new Type[2] { typeof(ItemIndex), typeof(int) }, null) ?? throw new MissingMethodException("RoR2.Inventory+GiveItemChanneledImpl", "Add"); } } } internal static class TempItemsStorage { internal static class GiveItemTempImpl { internal static class Add { public delegate void PrefixSignature(GiveItemTempImpl self, ref ItemIndex itemIndex, ref int count); public delegate void PostfixSignature(GiveItemTempImpl self, ref ItemIndex itemIndex, ref int count); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(GiveItemTempImpl).GetMethod("Add", (BindingFlags)(-1), null, new Type[2] { typeof(ItemIndex), typeof(int) }, null) ?? throw new MissingMethodException("RoR2.Inventory+TempItemsStorage+GiveItemTempImpl", "Add"); } } } } internal static class CalculateEquipmentCooldownScale { public delegate void PrefixSignature(Inventory self); public delegate void PostfixSignature(Inventory self, ref float returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(Inventory).GetMethod("CalculateEquipmentCooldownScale", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("RoR2.Inventory", "CalculateEquipmentCooldownScale"); } } internal static class FixedUpdate { public delegate void PrefixSignature(Inventory self); public delegate void PostfixSignature(Inventory self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(Inventory).GetMethod("FixedUpdate", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("RoR2.Inventory", "FixedUpdate"); } } } namespace Mdh.RoR2.GlobalEventManager { internal static class ProcessHitEnemy { public delegate void PrefixSignature(GlobalEventManager self, ref DamageInfo damageInfo, ref GameObject victim); public delegate void PostfixSignature(GlobalEventManager self, ref DamageInfo damageInfo, ref GameObject victim); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(GlobalEventManager).GetMethod("ProcessHitEnemy", (BindingFlags)(-1), null, new Type[2] { typeof(DamageInfo), typeof(GameObject) }, null) ?? throw new MissingMethodException("RoR2.GlobalEventManager", "ProcessHitEnemy"); } } internal static class OnCrit { public delegate void PrefixSignature(GlobalEventManager self, ref CharacterBody body, ref DamageInfo damageInfo, ref CharacterMaster master, ref float procCoefficient, ref ProcChainMask procChainMask); public delegate void PostfixSignature(GlobalEventManager self, ref CharacterBody body, ref DamageInfo damageInfo, ref CharacterMaster master, ref float procCoefficient, ref ProcChainMask procChainMask); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(GlobalEventManager).GetMethod("OnCrit", (BindingFlags)(-1), null, new Type[5] { typeof(CharacterBody), typeof(DamageInfo), typeof(CharacterMaster), typeof(float), typeof(ProcChainMask) }, null) ?? throw new MissingMethodException("RoR2.GlobalEventManager", "OnCrit"); } } internal static class Init { public delegate void PrefixSignature(); public delegate void PostfixSignature(); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(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(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(GlobalEventManager).GetMethod("Init", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("RoR2.GlobalEventManager", "Init"); } } } 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 ReheatedItems { public static class ConfigOptions { public static class VoidDios { private const string _sectionName = "Pluripotent Larva"; public static ConfigEntry EnableEdit; public static ConfigEntry RespawnableBodiesList; internal static void BindConfigOptions(ConfigFile config) { EnableEdit = Extensions.BindOption(config, "Pluripotent Larva", "Enable Item Change", "Enable the Pluripotent Larva change?", true, (ConfigFlags)1); RespawnableBodiesList = Extensions.BindOption(config, "Pluripotent Larva", "Possible Respawn Bodies", "Specify what bodies you should have the chance to respawn as, all having equal chance. Separate each by a comma and no spaces.", "VoidMegaCrabAllyBody", (ConfigFlags)0); } } public static class ATG { private const string _sectionName = "ATG"; public static ConfigEntry EnableEdit; internal static void BindConfigOptions(ConfigFile config) { EnableEdit = Extensions.BindOption(config, "ATG", "Enable Item Change", "Enable the ATG change?", true, (ConfigFlags)1); } } public static class PocketICBM { private const string _sectionName = "Pocket ICBM"; public static ConfigEntry EnableEdit; public static ConfigEntry ChangeATGEffect; public static ConfigEntry ChangeArmedBackpackEffect; public static ConfigEntry ChangeGenericMissileEffect; public static ConfigEntry ChangePlasmaShrimpEffect; public static ConfigEntry ChangeRocketSurvivorEffect; public static ConfigEntry ChangeRiskyTweaksScrapLauncherEffect; internal static void BindConfigOptions(ConfigFile config) { EnableEdit = Extensions.BindOption(config, "Pocket ICBM", "Enable Item Change", "Enable the Pocket I.C.B.M change? Disabling this will also disable all effect options below.", true, (ConfigFlags)1); ChangeArmedBackpackEffect = Extensions.BindOption(config, "Pocket ICBM", "Change Armed Backpack Effect", "Make Armed Backpack's ICBM effect triple missile damage instead of firing 2 extra missiles? This will help performance!", true, (ConfigFlags)1); ChangeATGEffect = Extensions.BindOption(config, "Pocket ICBM", "Change ATG Effect", "Make ATG's ICBM effect triple missile damage instead of firing 2 extra missiles? This will help performance!", true, (ConfigFlags)1); ChangeGenericMissileEffect = Extensions.BindOption(config, "Pocket ICBM", "Change Effect for generic missiles", "Make DML's and Engineer Harpoons' ICBM effect triple missile damage instead of firing 2 extra missiles? This will help performance!", true, (ConfigFlags)1); ChangePlasmaShrimpEffect = Extensions.BindOption(config, "Pocket ICBM", "Change Plasma Shrimp Effect", "Make Plasma Shrimp's ICBM effect triple missile damage instead of firing 2 extra missiles? This will help performance!", true, (ConfigFlags)1); ChangeRocketSurvivorEffect = Extensions.BindOption(config, "Pocket ICBM", "Change The Rocket Survivor Effect", "Make Rocket's ICBM effect triple missile damage instead of firing 2 extra missiles? This will help performance!", true, (ConfigFlags)1); ChangeRiskyTweaksScrapLauncherEffect = Extensions.BindOption(config, "Pocket ICBM", "Change RiskyTweaks MUL-T Scrap Launcher Effect", "Make RiskyTweaks' MUL-T scrap launcher ICBM synergy effect triple missile damage instead of firing 2 extra missiles? This will help performance!", true, (ConfigFlags)1); } } public static class BottledChaos { private const string _sectionName = "Bottled Chaos"; public static ConfigEntry EnableEdit; internal static void BindConfigOptions(ConfigFile config) { EnableEdit = Extensions.BindOption(config, "Bottled Chaos", "Enable Item Change", "Enable the Bottled Chaos change?", true, (ConfigFlags)1); } } public static class Planula { public static ConfigEntry EnableEdit; } public static class ElectricBoomerang { private const string _sectionName = "Electric Boomerang"; public static ConfigEntry EnableEdit; internal static void BindConfigOptions(ConfigFile config) { EnableEdit = Extensions.BindOption(config, "Electric Boomerang", "Enable Item Change", "Enable the Electric Boomerang change?", true, (ConfigFlags)1); } } public static class MoltenPerforator { private const string _sectionName = "Molten Perforator"; public static ConfigEntry EnableEdit; internal static void BindConfigOptions(ConfigFile config) { EnableEdit = Extensions.BindOption(config, "Molten Perforator", "Enable Item Change", "Enable the Molten Perforator change?", true, (ConfigFlags)1); } } public static class ExecutiveCard { private const string _sectionName = "Executive Card"; public static ConfigEntry EnableEdit; public static ConfigEntry AddCreditCardToBottledChaos; internal static void BindConfigOptions(ConfigFile config) { EnableEdit = Extensions.BindOption(config, "Executive Card", "Enable Item Change", "Enable the Executive Card change?", true, (ConfigFlags)1); AddCreditCardToBottledChaos = Extensions.BindOption(config, "Executive Card", "Add edited effect to the Bottled Chaos pool", "Should the new effect for Executive Card be added to the equipment effect pool for Bottled Chaos?", true, (ConfigFlags)1); } } public static class Polylute { private const string _sectionName = "Polylute"; public static ConfigEntry EnableEdit; internal static void BindConfigOptions(ConfigFile config) { EnableEdit = Extensions.BindOption(config, "Polylute", "Enable Item Change", "Enable the Polylute change?", true, (ConfigFlags)1); } } public static class WarBonds { private const string _sectionName = "War Bonds"; public static ConfigEntry EnableEdit; internal static void BindConfigOptions(ConfigFile config) { EnableEdit = Extensions.BindOption(config, "War Bonds", "Enable Item Change", "Enable the War Bonds change?", true, (ConfigFlags)1); } } public static class StunGrenade { private const string _sectionName = "Stun Grenade"; public static ConfigEntry EnableEdit; internal static void BindConfigOptions(ConfigFile config) { EnableEdit = Extensions.BindOption(config, "Stun Grenade", "Enable Item Change", "Enable the Stun Grenade change?", true, (ConfigFlags)1); } } public static class VoidCrit { private const string _sectionName = "Lost-Seers Lenses"; public static ConfigEntry EnableEdit; public static ConfigEntry UseCritMultiplier; internal static void BindConfigOptions(ConfigFile config) { EnableEdit = Extensions.BindOption(config, "Lost-Seers Lenses", "Enable Item Change", "Enable the Lost-Seers Lenses change?", true, (ConfigFlags)1); UseCritMultiplier = Extensions.BindOption(config, "Lost-Seers Lenses", "Use Crit Multiplier", "Should the damage dealt by a void crit be affected by your crit damage multiplier?", true, (ConfigFlags)0); } } public static class Guillotine { private const string _sectionName = "Guillotine"; public static ConfigEntry EnableEdit; public static ConfigEntry RemoveHealFromLostShield; internal static void BindConfigOptions(ConfigFile config) { EnableEdit = Extensions.BindOption(config, "Guillotine", "Enable Item Change", "Enable the Guillotine change?", true, (ConfigFlags)1); RemoveHealFromLostShield = Extensions.BindOption(config, "Guillotine", "Prevent heals from elite shield loss", "When an elite that has shield loses or re-gains their elite effect, their health or shield respectively will heal to accomodate the sudden change. This option will prevent the health accomodation, and make elite shields restore like normal when re-gained.", true, (ConfigFlags)0); } } internal static void BindAllConfigOptions(ConfigFile config) { ATG.BindConfigOptions(config); BottledChaos.BindConfigOptions(config); ElectricBoomerang.BindConfigOptions(config); ExecutiveCard.BindConfigOptions(config); Guillotine.BindConfigOptions(config); VoidCrit.BindConfigOptions(config); MoltenPerforator.BindConfigOptions(config); VoidDios.BindConfigOptions(config); PocketICBM.BindConfigOptions(config); Polylute.BindConfigOptions(config); StunGrenade.BindConfigOptions(config); WarBonds.BindConfigOptions(config); } } internal static class ModLanguage { internal static List LangFilesToLoad = new List(); internal static void AddNewLangTokens() { string path = Path.Combine(Path.GetDirectoryName(Plugin.PluginInfo.Location), "Language"); foreach (string item in LangFilesToLoad) { LanguageAPI.AddOverlayPath(Path.Combine(path, item + ".json")); } } } 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); } } internal static class ModUtil { internal static readonly DamageTypeCombo GenericEquipmentDamageType = new DamageTypeCombo { damageType = (DamageType)0, damageTypeExtended = (DamageTypeExtended)0, damageSource = (DamageSource)64 }; internal static void LogILInstructions(this ILWeaver w) { Log.Warning(MethodBodyExtensions.CreateInformationalSnapshotJIT(w.Method.Body).ToStringWithAnnotations()); } internal static ILWeaverResult MatchNextRelaxed(this ILWeaver w, params Predicate[] 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)delegate(ILWeaver w2) { if (w2.Current.Offset > oldWeaverOffset && !foundNextMatch) { foundNextMatch = true; instructionToStayOn = w2.Current; } }, predicates); if (!foundNextMatch) { return new ILWeaverResult(w, (Func)w.GetMatchToNextRelaxedErrorMessage); } w.SetCurrentTo(instructionToStayOn); return result; } private static string GetMatchToNextRelaxedErrorMessage(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(); } internal static void SkipNext2FireProjectiles(ILWeaver w) { //IL_0046: Unknown result type (might be due to invalid IL or missing references) ILLabel val = w.DefineLabel(); w.MatchNextRelaxed((Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "get_instance") && w.SetCurrentTo(x)); w.InsertBeforeCurrent((IEnumerable)new <>z__ReadOnlySingleElementList(w.Create(OpCodes.Br, (object)val))); w.MatchNextRelaxed((Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "get_instance") && w.SetCurrentTo(x)).ThrowIfFailure(); if (!w.MatchNextRelaxed((Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "FireProjectile") && w.SetCurrentTo(x)).IsValid) { Log.Warning("FireProjectile WAS NOT VALID????"); w.MatchNextRelaxed((Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "FireProjectileWithoutDamageType") && w.SetCurrentTo(x)).ThrowIfFailure(); } w.MarkLabelToCurrentNext(val); } internal static bool IsDamageReportNull(DamageReport damageReport) { if (!((Object)(object)damageReport.victim == (Object)null) && !((Object)(object)damageReport.victimBody == (Object)null) && !((Object)(object)damageReport.attacker == (Object)null) && !((Object)(object)damageReport.attackerBody == (Object)null) && !((Object)(object)damageReport.attackerBody.inventory == (Object)null)) { return (Object)(object)damageReport.attackerMaster == (Object)null; } return true; } internal static bool IsDamageInfoNull(DamageInfo damageInfo) { if (!((Object)(object)damageInfo.attacker == (Object)null)) { return (Object)(object)damageInfo.inflictor == (Object)null; } return true; } internal static DamageInfo CreateNewDamageInfoFromDamageReport(DamageReport damageReport) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Expected O, but got Unknown return new DamageInfo { attacker = damageReport.damageInfo.attacker, canRejectForce = damageReport.damageInfo.canRejectForce, crit = damageReport.damageInfo.crit, damageType = damageReport.damageInfo.damageType, delayedDamageSecondHalf = damageReport.damageInfo.delayedDamageSecondHalf, dotIndex = damageReport.damageInfo.dotIndex, firstHitOfDelayedDamageSecondHalf = damageReport.damageInfo.firstHitOfDelayedDamageSecondHalf, inflictedHurtbox = damageReport.damageInfo.inflictedHurtbox, inflictor = damageReport.damageInfo.inflictor, physForceFlags = damageReport.damageInfo.physForceFlags, position = damageReport.damageInfo.position, rejected = damageReport.damageInfo.rejected, force = damageReport.damageInfo.force, procCoefficient = 1f, procChainMask = damageReport.damageInfo.procChainMask, damage = damageReport.damageInfo.damage, damageColorIndex = (DamageColorIndex)3 }; } internal static void AddBuffOnServer(this CharacterBody characterBody, BuffDef buffDef) { if (NetworkServer.active) { characterBody.AddBuff(buffDef); } } internal static void AddTimedBuffOnServer(this CharacterBody characterBody, BuffDef buffDef, float duration) { if (NetworkServer.active) { characterBody.AddTimedBuff(buffDef, duration); } } internal static void RemoveBuffOnServer(this CharacterBody characterBody, BuffDef buffDef) { if (NetworkServer.active) { characterBody.RemoveBuff(buffDef); } } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("LordVGames.ReheatedItems", "ReheatedItems", "0.5.3")] public class Plugin : BaseUnityPlugin { public const string Id = "LordVGames.ReheatedItems"; public static PluginInfo PluginInfo { get; private set; } public static string Name => "ReheatedItems"; public static string Version => "0.5.3"; public void Awake() { PluginInfo = ((BaseUnityPlugin)this).Info; Log.Init(((BaseUnityPlugin)this).Logger); ConfigOptions.BindAllConfigOptions(((BaseUnityPlugin)this).Config); MonoDetourManager.InvokeHookInitializers(typeof(Plugin).Assembly, false); ModLanguage.AddNewLangTokens(); } } } namespace ReheatedItems.ModSupport.WolfFixes { internal class WolfFixesMod { internal const string ModGUID = "Early.Wolfo.WolfFixes"; private static bool? _enabled; internal static bool ModIsRunning { get { bool valueOrDefault = _enabled.GetValueOrDefault(); if (!_enabled.HasValue) { valueOrDefault = Chainloader.PluginInfos.ContainsKey("Early.Wolfo.WolfFixes"); _enabled = valueOrDefault; } return _enabled.Value; } } } } namespace ReheatedItems.ModSupport.Starstorm2 { internal static class GuillotineSupport { [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] internal static void TrySetUltraEliteEffectsState(CharacterBody characterBody, bool effectState) { if (characterBody.inventory.GetItemCountEffective(Items.AffixUltra) >= 1) { if (effectState) { characterBody.AddBuff(Buffs.bdUltra); characterBody.AddBuff(Buffs.bdUltraBuff); } else { characterBody.RemoveBuff(Buffs.bdUltra); characterBody.RemoveBuff(Buffs.bdUltraBuff); } Transform obj = characterBody.transform.Find("UltraWard(Clone)"); if (obj != null) { ((Component)obj).gameObject.SetActive(effectState); } } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] internal static void TrySetEtherealEliteEffectsState(CharacterBody characterBody, bool effectState) { BodyBehavior val = default(BodyBehavior); if (((Component)characterBody).TryGetComponent(ref val)) { ((Behaviour)val).enabled = effectState; if (effectState) { characterBody.AddTimedBuff(Guillotine.Buffs.AllowEliteBuffReAdded.bdReAddEliteBuff, 0.1f); characterBody.AddBuff(Buffs.bdEthereal); } } } } internal static class Starstorm2Mod { private static bool? _enabled; internal static bool ModIsRunning { get { bool valueOrDefault = _enabled.GetValueOrDefault(); if (!_enabled.HasValue) { valueOrDefault = Chainloader.PluginInfos.ContainsKey("com.TeamMoonstorm"); _enabled = valueOrDefault; } return _enabled.Value; } } } } namespace ReheatedItems.ModSupport.RocketSurvivorGuy { [MonoDetourTargets(typeof(FireRocket))] internal static class PrimaryICBMSupport { [CompilerGenerated] private static class <>O { public static Manipulator <0>__ChangeICBMEffect; public static Func <1>__ChangeDamageBasedOnICBM; } [MonoDetourHookInitialize] internal static void Setup() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown if (ConfigOptions.PocketICBM.ChangeRocketSurvivorEffect.Value) { object obj = <>O.<0>__ChangeICBMEffect; if (obj == null) { Manipulator val = ChangeICBMEffect; <>O.<0>__ChangeICBMEffect = val; obj = (object)val; } Mdh.EntityStates.RocketSurvivorSkills.Primary.FireRocket.OnEnter.ILHook((Manipulator)obj); } } private static void ChangeICBMEffect(ILManipulationInfo info) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) ILWeaver w = new ILWeaver(info); ILLabel val = default(ILLabel); w.MatchRelaxed(new Predicate[3] { (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 5), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 5) && w.SetCurrentTo(x), (Instruction x) => ILPatternMatchingExt.MatchBrfalse(x, ref val) }).ThrowIfFailure().InsertAfterCurrent((IEnumerable)new <>z__ReadOnlySingleElementList(w.Create(OpCodes.Pop))) .Next.OpCode = OpCodes.Br; w.MatchRelaxed(new Predicate[4] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, "damageStat"), (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "damageCoefficient"), (Instruction x) => ILPatternMatchingExt.MatchMul(x) && w.SetCurrentTo(x) }).ThrowIfFailure().InsertAfterCurrent((IEnumerable)new <>z__ReadOnlyArray((Instruction[])(object)new Instruction[2] { w.Create(OpCodes.Ldarg_0), w.CreateCall((Delegate)new Func(ChangeDamageBasedOnICBM)) })); } private static float ChangeDamageBasedOnICBM(float damage, EntityState entityState) { return damage * PocketICBM.GetICBMDamageMultForCharacterBody(entityState.characterBody); } } } namespace ReheatedItems.ModSupport.RiskyTweaksMod { [MonoDetourTargets(typeof(ScrapICBM), GenerateControlFlowVariants = true)] internal static class MulTScrapLauncherSynergyEdit { [CompilerGenerated] private static class <>O { public static Manipulator <0>__JustDoMyThing; public static Action <1>__ChangeICBMSynergy; } [MonoDetourHookInitialize] internal static void Setup() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown if (ConfigOptions.PocketICBM.ChangeRiskyTweaksScrapLauncherEffect.Value) { object obj = <>O.<0>__JustDoMyThing; if (obj == null) { Manipulator val = JustDoMyThing; <>O.<0>__JustDoMyThing = val; obj = (object)val; } FireGrenadeLauncher_ModifyProjectileAimRay.ILHook((Manipulator)obj); } } private static void JustDoMyThing(ILManipulationInfo info) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) ILWeaver w = new ILWeaver(info); ILLabel val = w.DefineLabel(); w.InsertBeforeCurrent((IEnumerable)new <>z__ReadOnlyArray((Instruction[])(object)new Instruction[3] { w.Create(OpCodes.Ldarg_2), w.CreateCall((Delegate)new Action(ChangeICBMSynergy)), w.Create(OpCodes.Br, (object)val) })); MethodReference val2 = default(MethodReference); w.MatchRelaxed(new Predicate[4] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 1) && w.SetCurrentTo(x), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 2), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 3), (Instruction x) => ILPatternMatchingExt.MatchCallvirt(x, ref val2) }).ThrowIfFailure().MarkLabelToCurrentPrevious(val); } private static void ChangeICBMSynergy(FireGrenadeLauncher fireGrenadeLauncherState) { ((GenericProjectileBaseState)fireGrenadeLauncherState).damageCoefficient = ((GenericProjectileBaseState)fireGrenadeLauncherState).damageCoefficient * PocketICBM.GetICBMDamageMultForCharacterBody(((EntityState)fireGrenadeLauncherState).characterBody); } } internal static class RiskyTweaksMod { internal const string GUID = "com.Moffein.RiskyTweaks"; private static bool? _enabled; internal static bool ModIsRunning { get { bool valueOrDefault = _enabled.GetValueOrDefault(); if (!_enabled.HasValue) { valueOrDefault = Chainloader.PluginInfos.ContainsKey("com.Moffein.RiskyTweaks"); _enabled = valueOrDefault; } return _enabled.Value; } } } } namespace ReheatedItems.ItemChanges { [MonoDetourTargets(typeof(GlobalEventManager))] internal static class ATG { [CompilerGenerated] private static class <>O { public static Manipulator <0>__ProcessHitEnemy; } [MonoDetourHookInitialize] internal static void Setup() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown if (ConfigOptions.ATG.EnableEdit.Value) { object obj = <>O.<0>__ProcessHitEnemy; if (obj == null) { Manipulator val = ProcessHitEnemy; <>O.<0>__ProcessHitEnemy = val; obj = (object)val; } Mdh.RoR2.GlobalEventManager.ProcessHitEnemy.ILHook((Manipulator)obj); } } private static void ProcessHitEnemy(ILManipulationInfo info) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) ILWeaver w = new ILWeaver(info); ILLabel val = w.DefineLabel(); int missileDamageVariableNumber = 0; FieldReference val2 = default(FieldReference); w.MatchRelaxed(new Predicate[7] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "RoR2.Util", "OnHitProcDamage"), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref missileDamageVariableNumber), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 0) && w.SetCurrentTo(x), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "get_corePosition"), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 1), (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, ref val2) }).ThrowIfFailure().InsertBeforeCurrent((IEnumerable)new <>z__ReadOnlyArray((InstructionOrEnumerable[])(object)new InstructionOrEnumerable[9] { InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldloc, 0)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldloc, missileDamageVariableNumber)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldarg_1)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldarg_2)), InstructionOrEnumerable.op_Implicit(w.CreateDelegateCall>((Func)delegate(CharacterBody attackerBody, float missileDamage, DamageInfo damageInfo, GameObject victim) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Invalid comparison between Unknown and I4 if ((int)attackerBody.teamComponent.teamIndex == 1) { FireMissileOrb(attackerBody, missileDamage, damageInfo, victim); } return damageInfo; })), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Starg, 1)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldloc, 0)), InstructionOrEnumerable.op_Implicit(w.CreateDelegateCall>((Func)((CharacterBody attackerBody) => (int)attackerBody.teamComponent.teamIndex == 1))), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Brtrue, (object)val)) })); w.MatchRelaxed(new Predicate[4] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "RoR2.GlobalEventManager/CommonAssets", "missilePrefab"), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 3), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 1), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "RoR2.MissileUtils", "FireMissile") && w.SetCurrentTo(x) }).ThrowIfFailure().MarkLabelToCurrentNext(val); } internal static void FireMissileOrb(CharacterBody attackerBody, float missileDamage, DamageInfo damageInfo, GameObject victim) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown CharacterBody val = default(CharacterBody); if (victim.TryGetComponent(ref val) && !((Object)(object)attackerBody == (Object)null) && !((Object)(object)attackerBody.inventory == (Object)null) && !((ProcChainMask)(ref damageInfo.procChainMask)).HasProc((ProcType)1) && ConfigOptions.ATG.EnableEdit.Value) { MicroMissileOrb val2 = new MicroMissileOrb { origin = attackerBody.aimOrigin, damageValue = missileDamage, isCrit = damageInfo.crit, teamIndex = attackerBody.teamComponent.teamIndex, attacker = ((Component)attackerBody).gameObject, procChainMask = damageInfo.procChainMask, procCoefficient = 1f, damageColorIndex = (DamageColorIndex)3, target = val.mainHurtBox }; ((ProcChainMask)(ref ((GenericDamageOrb)val2).procChainMask)).AddProc((ProcType)1); ((ProcChainMask)(ref damageInfo.procChainMask)).AddProc((ProcType)1); if (ConfigOptions.PocketICBM.EnableEdit.Value) { ((GenericDamageOrb)val2).damageValue = ((GenericDamageOrb)val2).damageValue * MissileUtils.GetMoreMissileDamageMultiplier(attackerBody.inventory.GetItemCountEffective(Items.MoreMissile)); } else { Util.PlaySound("Play_item_proc_missile_fire", ((Component)attackerBody).gameObject); Util.PlaySound("Play_item_proc_missile_fire", ((Component)attackerBody).gameObject); OrbManager.instance.AddOrb((Orb)(object)val2); OrbManager.instance.AddOrb((Orb)(object)val2); } Util.PlaySound("Play_item_proc_missile_fire", ((Component)attackerBody).gameObject); OrbManager.instance.AddOrb((Orb)(object)val2); } } } [MonoDetourTargets(typeof(Inventory))] internal static class BottledChaos { [CompilerGenerated] private static class <>O { public static Manipulator <0>__SetupBhaosCooldownReduction; public static Func <1>__AddBhaosCooldownReduction; } [MonoDetourHookInitialize] internal static void Setup() { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Expected O, but got Unknown if (ConfigOptions.BottledChaos.EnableEdit.Value) { ModLanguage.LangFilesToLoad.Add("BottledChaos"); object obj = <>O.<0>__SetupBhaosCooldownReduction; if (obj == null) { Manipulator val = SetupBhaosCooldownReduction; <>O.<0>__SetupBhaosCooldownReduction = val; obj = (object)val; } CalculateEquipmentCooldownScale.ILHook((Manipulator)obj); } } private static void SetupBhaosCooldownReduction(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) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) ILWeaver w = new ILWeaver(info); w.MatchRelaxed(new Predicate[2] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 3) && w.SetCurrentTo(x), (Instruction x) => ILPatternMatchingExt.MatchRet(x) }).ThrowIfFailure().InsertBeforeCurrentStealLabels((IEnumerable)new <>z__ReadOnlyArray((Instruction[])(object)new Instruction[4] { w.Create(OpCodes.Ldarg_0), w.Create(OpCodes.Ldloc_3), w.CreateCall((Delegate)new Func(AddBhaosCooldownReduction)), w.Create(OpCodes.Stloc_3) })); } private static float AddBhaosCooldownReduction(Inventory inventory, float currentCooldownReduction) { if (inventory.GetItemCountEffective(Items.RandomEquipmentTrigger) > 0) { return currentCooldownReduction *= 0.65f; } return currentCooldownReduction; } } [MonoDetourTargets(typeof(BoomerangProjectile))] internal static class ElectricBoomerang { private class RiElectricBoomerangInfo { internal int ExistingBoomerangProjectileCount; } [CompilerGenerated] private static class <>O { public static ProcessHitEnemy.PostfixSignature <0>__GlobalEventManager_ProcessHitEnemy; public static Manipulator <1>__MakeBoomerangBetter; public static Manipulator <2>__SetupRemoveOneFromExistingBoomerangCount; public static Func <3>__ShouldAllowNewElectricBoomerang; public static Action <4>__TryAddOneToExistingBoomerangProjectileCount; public static Action <5>__TryRemoveOneFromExistingBoomerangCount; } private const float _damagePerHit = 3.75f; private const float _damagePerHitStack = 2.75f; private const int _maximumBoomerangCount = 2; private static readonly AssetReferenceT _electricBoomerangProjectileAsset = new AssetReferenceT(RoR2_DLC2_Items_StunAndPierce.StunAndPierceBoomerang_prefab); private static readonly AssetReferenceT _electricBoomerangItemDef = new AssetReferenceT(RoR2_DLC2_Items_StunAndPierce.StunAndPierce_asset); private static readonly FixedConditionalWeakTable _riElectricBoomerangInfoTable = new FixedConditionalWeakTable(); [MonoDetourHookInitialize] internal static void Setup() { //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Expected O, but got Unknown if (ConfigOptions.ElectricBoomerang.EnableEdit.Value) { ModLanguage.LangFilesToLoad.Add("ElectricBoomerang"); EditBoomerangProjectile(); AIBlacklistNewBoomerang(); ProcessHitEnemy.Postfix(GlobalEventManager_ProcessHitEnemy); object obj = <>O.<1>__MakeBoomerangBetter; if (obj == null) { Manipulator val = MakeBoomerangBetter; <>O.<1>__MakeBoomerangBetter = val; obj = (object)val; } ProcessHitEnemy.ILHook((Manipulator)obj); object obj2 = <>O.<2>__SetupRemoveOneFromExistingBoomerangCount; if (obj2 == null) { Manipulator val2 = SetupRemoveOneFromExistingBoomerangCount; <>O.<2>__SetupRemoveOneFromExistingBoomerangCount = val2; obj2 = (object)val2; } Mdh.RoR2.Projectile.BoomerangProjectile.FixedUpdate.ILHook((Manipulator)obj2); } } private static void GlobalEventManager_ProcessHitEnemy(GlobalEventManager self, ref DamageInfo damageInfo, ref GameObject victim) { if ((Object)(object)victim != (Object)null && (Object)(object)damageInfo.inflictor != (Object)null && ((Object)damageInfo.inflictor).name == "StunAndPierceBoomerang(Clone)") { Util.PlaySound("Play_item_proc_chain_lightning", victim); Util.PlaySound("Play_item_proc_chain_lightning", victim); Util.PlaySound("Play_item_proc_chain_lightning", victim); Util.PlaySound("Play_item_proc_chain_lightning", victim); Util.PlaySound("Play_item_proc_chain_lightning", victim); Util.PlaySound("Play_item_proc_chain_lightning", victim); } } private static void EditBoomerangProjectile() { //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) AsyncOperationHandle val = AssetAsyncReferenceManager.LoadAsset(_electricBoomerangProjectileAsset, (AsyncReferenceHandleUnloadType)2); val.Completed += delegate(AsyncOperationHandle handle) { BoomerangProjectile component = handle.Result.GetComponent(); component.distanceMultiplier *= 0.15f; component.travelSpeed *= 3f; Extensions.TryDestroyComponent(handle.Result); }; } private static void AIBlacklistNewBoomerang() { //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) AsyncOperationHandle val = AssetAsyncReferenceManager.LoadAsset(_electricBoomerangItemDef, (AsyncReferenceHandleUnloadType)2); val.Completed += delegate(AsyncOperationHandle handle) { ItemDef result = handle.Result; ItemTag[] tags = result.tags; int num = 0; ItemTag[] array = (ItemTag[])(object)new ItemTag[1 + tags.Length]; ReadOnlySpan readOnlySpan = new ReadOnlySpan(tags); readOnlySpan.CopyTo(new Span(array).Slice(num, readOnlySpan.Length)); num += readOnlySpan.Length; array[num] = (ItemTag)4; result.tags = array; }; } private static void MakeBoomerangBetter(ILManipulationInfo info) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_034f: Unknown result type (might be due to invalid IL or missing references) //IL_036d: Unknown result type (might be due to invalid IL or missing references) ILWeaver w = new ILWeaver(info); int electricBoomerangEffectiveCountVariableNumber = 0; int num2 = default(int); w.MatchRelaxed(new Predicate[4] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num2), (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "RoR2.DLC2Content/Items", "StunAndPierce"), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "GetItemCountEffective"), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref electricBoomerangEffectiveCountVariableNumber) }).ThrowIfFailure(); ILLabel skipVanillaElectricBoomerangCode = w.DefineLabel(); MethodReference val3 = default(MethodReference); MethodReference val2 = default(MethodReference); MethodReference val = default(MethodReference); w.MatchRelaxed(new Predicate[6] { (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 512), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, ref val3), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, ref val2), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, ref val), (Instruction x) => ILPatternMatchingExt.MatchBrtrue(x, ref skipVanillaElectricBoomerangCode) && w.SetCurrentTo(x), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 15f) }).ThrowIfFailure().InsertAfterCurrent((IEnumerable)new <>z__ReadOnlyArray((Instruction[])(object)new Instruction[5] { w.Create(OpCodes.Ldarg_1), w.CreateCall((Delegate)new Func(ShouldAllowNewElectricBoomerang)), w.Create(OpCodes.Brfalse, (object)skipVanillaElectricBoomerangCode), w.Create(OpCodes.Ldloc_0), w.CreateCall((Delegate)new Action(TryAddOneToExistingBoomerangProjectileCount)) })); int setDamageVariableNumber = 0; int num = default(int); w.MatchNextRelaxed((Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 0), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "get_damage"), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 0.4f), (Instruction x) => ILPatternMatchingExt.MatchMul(x), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num), (Instruction x) => ILPatternMatchingExt.MatchConvR4(x), (Instruction x) => ILPatternMatchingExt.MatchMul(x), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref setDamageVariableNumber) && w.SetCurrentTo(x)).ThrowIfFailure().InsertBeforeCurrent((IEnumerable)new <>z__ReadOnlyArray((InstructionOrEnumerable[])(object)new InstructionOrEnumerable[3] { InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldloc, electricBoomerangEffectiveCountVariableNumber)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldarg_1)), InstructionOrEnumerable.op_Implicit(w.CreateDelegateCall>((Func)((float oldDamage, int electricBoomerangEffectiveCount, DamageInfo damageInfo) => damageInfo.damage * (3.75f + 2.75f * (float)(electricBoomerangEffectiveCount - 1))))) })); } private static bool ShouldAllowNewElectricBoomerang(DamageInfo damageInfo) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) int num = 0; RiElectricBoomerangInfo riElectricBoomerangInfo = default(RiElectricBoomerangInfo); if (_riElectricBoomerangInfoTable.TryGetValue(damageInfo.attacker.gameObject, ref riElectricBoomerangInfo)) { num = riElectricBoomerangInfo.ExistingBoomerangProjectileCount; } if (((DamageTypeCombo)(ref damageInfo.damageType)).IsDamageSourceSkillBased && ((Enum)damageInfo.damageType.damageType).HasFlag((Enum)(object)(DamageType)32)) { return num < 2; } return false; } private static void TryAddOneToExistingBoomerangProjectileCount(CharacterBody characterBody) { if (NetworkServer.active) { RiElectricBoomerangInfo riElectricBoomerangInfo = default(RiElectricBoomerangInfo); if (_riElectricBoomerangInfoTable.TryGetValue(((Component)characterBody).gameObject, ref riElectricBoomerangInfo) && riElectricBoomerangInfo.ExistingBoomerangProjectileCount < 2) { riElectricBoomerangInfo.ExistingBoomerangProjectileCount++; return; } _riElectricBoomerangInfoTable.Add(((Component)characterBody).gameObject, new RiElectricBoomerangInfo { ExistingBoomerangProjectileCount = 1 }); } } private static void SetupRemoveOneFromExistingBoomerangCount(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.MatchMultipleRelaxed((Action)delegate(ILWeaver mW) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) mW.InsertAfterCurrent((IEnumerable)new <>z__ReadOnlyArray((Instruction[])(object)new Instruction[2] { mW.Create(OpCodes.Ldarg_0), mW.CreateCall((Delegate)new Action(TryRemoveOneFromExistingBoomerangCount)) })); }, new Predicate[1] { (Instruction x) => ILPatternMatchingExt.MatchCall(x, "UnityEngine.Object", "Destroy") && w.SetCurrentTo(x) }).ThrowIfFailure(); } private static void TryRemoveOneFromExistingBoomerangCount(BoomerangProjectile boomerangProjectile) { RiElectricBoomerangInfo riElectricBoomerangInfo = default(RiElectricBoomerangInfo); if (NetworkServer.active && _riElectricBoomerangInfoTable.TryGetValue(boomerangProjectile.projectileController.owner, ref riElectricBoomerangInfo)) { riElectricBoomerangInfo.ExistingBoomerangProjectileCount--; if (riElectricBoomerangInfo.ExistingBoomerangProjectileCount < 1) { _riElectricBoomerangInfoTable.Remove(boomerangProjectile.projectileController.owner); } } } } [MonoDetourTargets(typeof(MultiShopCardUtils))] [MonoDetourTargets(typeof(EquipmentSlot), GenerateControlFlowVariants = true)] public static class ExecutiveCard { public static class CreditScoreBuff { private static readonly AssetReferenceT _creditCardIconSpriteReference = new AssetReferenceT(RoR2_DLC1_MultiShopCard.texExecutiveCardIcon_png); public static BuffDef bdCreditScore; internal static void SetupBuff() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_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) bdCreditScore = ScriptableObject.CreateInstance(); ((Object)bdCreditScore).name = "bdCreditScore"; bdCreditScore.buffColor = Color.white; bdCreditScore.canStack = true; bdCreditScore.isHidden = false; bdCreditScore.isDebuff = false; bdCreditScore.flags = (Flags)1; bdCreditScore.ignoreGrowthNectar = true; AsyncOperationHandle val = AssetAsyncReferenceManager.LoadAsset(_creditCardIconSpriteReference, (AsyncReferenceHandleUnloadType)2); val.Completed += delegate(AsyncOperationHandle handle) { bdCreditScore.iconSprite = handle.Result; }; ContentAddition.AddBuffDef(bdCreditScore); } private static NetworkSoundEventDef CreateNetworkSoundEventDef(string eventName) { NetworkSoundEventDef obj = ScriptableObject.CreateInstance(); obj.akId = AkSoundEngine.GetIDFromString(eventName); obj.eventName = eventName; ContentAddition.AddNetworkSoundEventDef(obj); return obj; } } private static class EquipmentDefEdits { private static readonly AssetReferenceT _creditCardEquipmentDefReference = new AssetReferenceT(RoR2_DLC1_MultiShopCard.MultiShopCard_asset); internal static void Setup() { MakeCreditCardAnActualEquipment(); } private static void MakeCreditCardAnActualEquipment() { //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) AsyncOperationHandle val = AssetAsyncReferenceManager.LoadAsset(_creditCardEquipmentDefReference, (AsyncReferenceHandleUnloadType)2); val.Completed += delegate(AsyncOperationHandle handle) { if (ConfigOptions.ExecutiveCard.AddCreditCardToBottledChaos.Value) { handle.Result.canBeRandomlyTriggered = true; } handle.Result.enigmaCompatible = true; handle.Result.cooldown = 80f; }; } } private static class Hooks { [CompilerGenerated] private static class <>O { public static Manipulator <0>__UseCreditScoreBuffPls; public static PerformEquipmentAction.ControlFlowPrefixSignature <1>__EquipmentSlot_PerformEquipmentAction; public static Func <2>__DoesBodyHaveCreditScore; public static Action <3>__RemoveCreditScoreBuffFromBody; } internal static void Setup() { //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 object obj = <>O.<0>__UseCreditScoreBuffPls; if (obj == null) { Manipulator val = UseCreditScoreBuffPls; <>O.<0>__UseCreditScoreBuffPls = val; obj = (object)val; } OnPurchase.ILHook((Manipulator)obj); PerformEquipmentAction.ControlFlowPrefix(EquipmentSlot_PerformEquipmentAction); } private static void UseCreditScoreBuffPls(ILManipulationInfo info) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_02d9: Unknown result type (might be due to invalid IL or missing references) ILWeaver w = new ILWeaver(info); ILLabel exitCode = w.DefineLabel(); ILLabel val = w.DefineLabel(); ILLabel val2 = w.DefineLabel(); w.MatchRelaxed(new Predicate[3] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 0), (Instruction x) => ILPatternMatchingExt.MatchCallvirt(x, "get_hasBody"), (Instruction x) => ILPatternMatchingExt.MatchBrfalse(x, ref exitCode) && w.SetCurrentTo(x) }).ThrowIfFailure().InsertAfterCurrent((IEnumerable)new <>z__ReadOnlySingleElementList(w.Create(OpCodes.Br, (object)val))); ILLabel val4 = default(ILLabel); w.MatchRelaxed(new Predicate[3] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "RoR2.DLC1Content/Equipment", "MultiShopCard"), (Instruction x) => ILPatternMatchingExt.MatchCallvirt(x, "get_equipmentIndex"), (Instruction x) => ILPatternMatchingExt.MatchBneUn(x, ref val4) && w.SetCurrentTo(x) }).ThrowIfFailure().MarkLabelToCurrentNext(val); w.MatchRelaxed(new Predicate[3] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 0), (Instruction x) => ILPatternMatchingExt.MatchCallvirt(x, "GetBody"), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 1) && w.SetCurrentTo(x) }).ThrowIfFailure().InsertAfterCurrent((IEnumerable)new <>z__ReadOnlyArray((Instruction[])(object)new Instruction[4] { w.Create(OpCodes.Ldloc_1), w.CreateCall((Delegate)new Func(DoesBodyHaveCreditScore)), w.Create(OpCodes.Brfalse, (object)exitCode), w.Create(OpCodes.Br, (object)val2) })); ILLabel val3 = default(ILLabel); w.MatchRelaxed(new Predicate[5] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 1), (Instruction x) => ILPatternMatchingExt.MatchCallvirt(x, "get_equipmentSlot"), (Instruction x) => ILPatternMatchingExt.MatchCallvirt(x, "get_stock"), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 0), (Instruction x) => ILPatternMatchingExt.MatchBle(x, ref val3) && w.SetCurrentTo(x) }).ThrowIfFailure().MarkLabelToCurrentNext(val2) .CurrentToNext() .InsertAfterCurrent((IEnumerable)new <>z__ReadOnlyArray((Instruction[])(object)new Instruction[2] { w.Create(OpCodes.Ldloc_1), w.CreateCall((Delegate)new Action(RemoveCreditScoreBuffFromBody)) })); } private static bool DoesBodyHaveCreditScore(CharacterBody characterBody) { return characterBody.HasBuff(CreditScoreBuff.bdCreditScore); } private static void RemoveCreditScoreBuffFromBody(CharacterBody characterBody) { if (characterBody.HasBuff(CreditScoreBuff.bdCreditScore)) { characterBody.RemoveBuff(CreditScoreBuff.bdCreditScore); } } private static ReturnFlow EquipmentSlot_PerformEquipmentAction(EquipmentSlot self, ref EquipmentDef equipmentDef, ref bool returnValue) { if (!((Object)(object)equipmentDef != (Object)(object)Equipment.MultiShopCard)) { if ((Object)(object)self.characterBody != (Object)null) { AddCreditScoreStacks(self.characterBody); } returnValue = true; return (ReturnFlow)1; } return (ReturnFlow)0; } private static void AddCreditScoreStacks(CharacterBody characterBody) { characterBody.AddBuff(CreditScoreBuff.bdCreditScore); characterBody.AddBuff(CreditScoreBuff.bdCreditScore); Util.PlaySound("Play_item_proc_moneyOnKill_loot", ((Component)characterBody).gameObject); } } [MonoDetourHookInitialize] internal static void Setup() { if (ConfigOptions.ExecutiveCard.EnableEdit.Value) { ModLanguage.LangFilesToLoad.Add("ExecutiveCard"); CreditScoreBuff.SetupBuff(); EquipmentDefEdits.Setup(); Hooks.Setup(); } } } [MonoDetourTargets(typeof(LogBookController), GenerateControlFlowVariants = true)] public static class Guillotine { private static class VanillaAssets { private static readonly AssetReferenceT _guillotineItemDefReference = new AssetReferenceT(RoR2_Base_ExecuteLowHealthElite.ExecuteLowHealthElite_asset); private static readonly AssetReferenceT _royalCapacitorIndicatorReference = new AssetReferenceT(RoR2_Base_Lightning.LightningIndicator_prefab); internal static GameObject RoyalCapacitorIndicator; internal static void Setup() { //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) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) AsyncOperationHandle val = AssetAsyncReferenceManager.LoadAsset(_guillotineItemDefReference, (AsyncReferenceHandleUnloadType)2); val.Completed += delegate(AsyncOperationHandle handle) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) handle.Result.tier = (ItemTier)5; handle.Result._itemTierDef = null; handle.Result.deprecatedTier = (ItemTier)5; }; AsyncOperationHandle val2 = AssetAsyncReferenceManager.LoadAsset(_royalCapacitorIndicatorReference, (AsyncReferenceHandleUnloadType)2); val2.Completed += delegate(AsyncOperationHandle handle) { RoyalCapacitorIndicator = handle.Result; ModAssets.EditedVanillaAssets.GuillotineTarget.Setup(); }; } } private static class ModAssets { internal static class AssetBundleAssets { internal static AssetBundle GuillotineAssetBundle; internal const string GuillotineAssetBundleName = "oldguillotine"; internal static Sprite GuillotineIconOrange; internal static string GuillotineAssetBundlePath => Path.Combine(Path.GetDirectoryName(Plugin.PluginInfo.Location), "oldguillotine"); internal static void LoadAssets() { GuillotineIconOrange = GuillotineAssetBundle.LoadAsset("texOldGuillotineOrangeIcon"); } } internal static class EditedVanillaAssets { internal static class GuillotineTarget { internal static GameObject GuillotineTargetingIndicator = PrefabAPI.CreateEmptyPrefab("GuillotineTargetIndicator"); internal static void Setup() { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) GuillotineTargetingIndicator = PrefabAPI.InstantiateClone(VanillaAssets.RoyalCapacitorIndicator, "GuillotineTargetIndicator", false); ((Graphic)((Component)GuillotineTargetingIndicator.transform.GetChild(1)).GetComponent()).color = Color.gray; Transform child = GuillotineTargetingIndicator.transform.GetChild(0); ((Component)child.GetChild(0)).GetComponent().color = Color.gray; ((Component)child.GetChild(1)).GetComponent().color = Color.gray; } } } internal static void Setup() { AssetBundleAssets.GuillotineAssetBundle = AssetBundle.LoadFromFile(AssetBundleAssets.GuillotineAssetBundlePath); AssetBundleAssets.LoadAssets(); } } public static class Equipment { private const string _guillotineEquipmentDefName = "edGuillotine"; public static EquipmentDef edGuillotine = new EquipmentDef { name = "edGuillotine", appearsInMultiPlayer = true, appearsInSinglePlayer = true, cooldown = 40f, pickupIconSprite = ModAssets.AssetBundleAssets.GuillotineIconOrange, pickupModelReference = new AssetReferenceT(RoR2_Base_ExecuteLowHealthElite.PickupGuillotine_prefab), nameToken = "ITEM_EXECUTELOWHEALTHELITE_NAME", pickupToken = "EQUIPMENT_GUILLOTINE_PICKUP", descriptionToken = "EQUIPMENT_GUILLOTINE_DESC", loreToken = "ITEM_EXECUTELOWHEALTHELITE_LORE", canDrop = true }; public static CustomEquipment ceGuillotine = new CustomEquipment(edGuillotine, Array.Empty()); public static EquipmentIndex eiGuillotine; internal static void SetupEquipment() { if (!ItemAPI.Add(ceGuillotine)) { Log.Error("Guillotine custom equipment could not be added by ItemAPI for some reason!"); } } [SystemInitializer(new Type[] { typeof(EquipmentCatalog) })] private static void GetGuillotineEquipmentIndex() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) eiGuillotine = EquipmentCatalog.FindEquipmentIndex("edGuillotine"); } } public static class Buffs { public static class DisableEliteBuff { public static BuffDef bdDisableElite; internal static void SetupBuff() { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) bdDisableElite = ScriptableObject.CreateInstance(); ((Object)bdDisableElite).name = "bdDisableElite"; bdDisableElite.isHidden = false; bdDisableElite.canStack = false; bdDisableElite.isDebuff = true; bdDisableElite.flags = (Flags)2; bdDisableElite.ignoreGrowthNectar = true; bdDisableElite.buffColor = Color.white; bdDisableElite.iconSprite = ModAssets.AssetBundleAssets.GuillotineIconOrange; ContentAddition.AddBuffDef(bdDisableElite); } } public static class AllowEliteBuffReAdded { public static BuffDef bdReAddEliteBuff; internal static void SetupBuff() { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) bdReAddEliteBuff = ScriptableObject.CreateInstance(); ((Object)bdReAddEliteBuff).name = "bdReAddEliteBuff"; bdReAddEliteBuff.isHidden = true; bdReAddEliteBuff.canStack = false; bdReAddEliteBuff.isDebuff = false; bdReAddEliteBuff.flags = (Flags)0; bdReAddEliteBuff.ignoreGrowthNectar = true; bdReAddEliteBuff.buffColor = Color.gray; bdReAddEliteBuff.iconSprite = ModAssets.AssetBundleAssets.GuillotineIconOrange; ContentAddition.AddBuffDef(bdReAddEliteBuff); } } public static class WasEthereal { public static BuffDef bdWasEthereal; internal static void SetupBuff() { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) bdWasEthereal = ScriptableObject.CreateInstance(); ((Object)bdWasEthereal).name = "bdWasEthereal"; bdWasEthereal.isHidden = true; bdWasEthereal.canStack = false; bdWasEthereal.isDebuff = false; bdWasEthereal.flags = (Flags)0; bdWasEthereal.ignoreGrowthNectar = true; bdWasEthereal.buffColor = Color.green; bdWasEthereal.iconSprite = ModAssets.AssetBundleAssets.GuillotineIconOrange; ContentAddition.AddBuffDef(bdWasEthereal); } } public static class PreventedInstantShieldRecharge { public static BuffDef bdPreventedInstantShieldRecharge; internal static void SetupBuff() { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) bdPreventedInstantShieldRecharge = ScriptableObject.CreateInstance(); ((Object)bdPreventedInstantShieldRecharge).name = "bdPreventedInstantShieldRecharge"; bdPreventedInstantShieldRecharge.isHidden = true; bdPreventedInstantShieldRecharge.canStack = false; bdPreventedInstantShieldRecharge.isDebuff = false; bdPreventedInstantShieldRecharge.flags = (Flags)0; bdPreventedInstantShieldRecharge.ignoreGrowthNectar = true; bdPreventedInstantShieldRecharge.buffColor = Color.blue; bdPreventedInstantShieldRecharge.iconSprite = ModAssets.AssetBundleAssets.GuillotineIconOrange; ContentAddition.AddBuffDef(bdPreventedInstantShieldRecharge); } } public static class PreventedInitialHeal { public static BuffDef bdPreventedInitialHeal; internal static void SetupBuff() { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) bdPreventedInitialHeal = ScriptableObject.CreateInstance(); ((Object)bdPreventedInitialHeal).name = "bdPreventedInitialHeal"; bdPreventedInitialHeal.isHidden = true; bdPreventedInitialHeal.canStack = false; bdPreventedInitialHeal.isDebuff = false; bdPreventedInitialHeal.flags = (Flags)0; bdPreventedInitialHeal.ignoreGrowthNectar = true; bdPreventedInitialHeal.buffColor = Color.red; bdPreventedInitialHeal.iconSprite = ModAssets.AssetBundleAssets.GuillotineIconOrange; ContentAddition.AddBuffDef(bdPreventedInitialHeal); } } internal static void SetupBuffs() { DisableEliteBuff.SetupBuff(); AllowEliteBuffReAdded.SetupBuff(); WasEthereal.SetupBuff(); PreventedInitialHeal.SetupBuff(); PreventedInstantShieldRecharge.SetupBuff(); } [SystemInitializer(new Type[] { typeof(BuffCatalog) })] private static void GetAllEliteBuffDefs() { BuffDef[] buffDefs = BuffCatalog.buffDefs; foreach (BuffDef val in buffDefs) { if (val.isElite) { _allEliteBuffDefs.Add(val); } } } } private static class Hooks { [CompilerGenerated] private static class <>O { public static PerformEquipmentAction.ControlFlowPrefixSignature <0>__EquipmentSlot_PerformEquipmentAction; public static UpdateTargets.ControlFlowPrefixSignature <1>__Targeting; public static SetBuffCount.ControlFlowPrefixSignature <2>__SetBuffCount; public static Manipulator <3>__ScaryHook; public static CanSelectEquipmentEntry.ControlFlowPrefixSignature <4>__AddToLogbook; public static Mdh.RoR2.CharacterBody.OnInventoryChanged.ControlFlowPrefixSignature <5>__AverageSeekersCodeGameplay; } internal static void Setup() { //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Expected O, but got Unknown PerformEquipmentAction.ControlFlowPrefix(EquipmentSlot_PerformEquipmentAction); UpdateTargets.ControlFlowPrefix(Targeting); Mdh.RoR2.CharacterBody.SetBuffCount.ControlFlowPrefix(SetBuffCount); object obj = <>O.<3>__ScaryHook; if (obj == null) { Manipulator val = ScaryHook; <>O.<3>__ScaryHook = val; obj = (object)val; } RecalculateStats.ILHook((Manipulator)obj); CanSelectEquipmentEntry.ControlFlowPrefix(AddToLogbook); Mdh.RoR2.CharacterBody.OnInventoryChanged.ControlFlowPrefix(AverageSeekersCodeGameplay); } private static ReturnFlow AverageSeekersCodeGameplay(CharacterBody self) { if (!((Object)(object)self == (Object)null) && !((Object)(object)self.inventory == (Object)null)) { return (ReturnFlow)0; } return (ReturnFlow)1; } private static ReturnFlow AddToLogbook(ref EquipmentDef equipmentDef, ref Dictionary expansionAvailability, ref bool returnValue) { if (!((Object)(object)equipmentDef != (Object)(object)Equipment.edGuillotine)) { returnValue = true; return (ReturnFlow)1; } return (ReturnFlow)0; } private static void ScaryHook(ILManipulationInfo info) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0294: Unknown result type (might be due to invalid IL or missing references) //IL_02de: Unknown result type (might be due to invalid IL or missing references) ILWeaver w = new ILWeaver(info); int healthDiffVarNumber = 0; int shieldDiffVarNumber = 0; ILLabel skipHeal = null; ILLabel skipShieldRecharge = null; int num4 = default(int); int num3 = default(int); w.MatchRelaxed(new Predicate[13] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "get_maxHealth"), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num4), (Instruction x) => ILPatternMatchingExt.MatchSub(x), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref healthDiffVarNumber), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "get_maxShield"), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num3), (Instruction x) => ILPatternMatchingExt.MatchSub(x), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref shieldDiffVarNumber), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, healthDiffVarNumber), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 0f), (Instruction x) => ILPatternMatchingExt.MatchBleUn(x, ref skipHeal) && w.SetCurrentTo(x) }).ThrowIfFailure().InsertAfterCurrent((IEnumerable)new <>z__ReadOnlyArray((InstructionOrEnumerable[])(object)new InstructionOrEnumerable[3] { InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldarg_0)), InstructionOrEnumerable.op_Implicit(w.CreateDelegateCall>((Func)delegate(CharacterBody characterBody) { //IL_0033: Unknown result type (might be due to invalid IL or missing references) if (characterBody.HasBuff(Buffs.DisableEliteBuff.bdDisableElite) && !characterBody.HasBuff(Buffs.PreventedInitialHeal.bdPreventedInitialHeal) && ConfigOptions.Guillotine.RemoveHealFromLostShield.Value && NetworkServer.active) { float num2 = default(float); characterBody.GetTimedBuffTotalDurationForIndex(Buffs.DisableEliteBuff.bdDisableElite.buffIndex, ref num2); characterBody.AddTimedBuff(Buffs.PreventedInitialHeal.bdPreventedInitialHeal, num2); return true; } return false; })), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Brtrue, (object)skipHeal)) })); w.MatchRelaxed(new Predicate[3] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, shieldDiffVarNumber), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 0f), (Instruction x) => ILPatternMatchingExt.MatchBleUn(x, ref skipShieldRecharge) && w.SetCurrentTo(x) }).ThrowIfFailure().InsertAfterCurrent((IEnumerable)new <>z__ReadOnlyArray((InstructionOrEnumerable[])(object)new InstructionOrEnumerable[3] { InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldarg_0)), InstructionOrEnumerable.op_Implicit(w.CreateDelegateCall>((Func)delegate(CharacterBody characterBody) { //IL_0033: Unknown result type (might be due to invalid IL or missing references) if (characterBody.HasBuff(Buffs.AllowEliteBuffReAdded.bdReAddEliteBuff) && !characterBody.HasBuff(Buffs.PreventedInstantShieldRecharge.bdPreventedInstantShieldRecharge) && ConfigOptions.Guillotine.RemoveHealFromLostShield.Value && NetworkServer.active) { float num = default(float); characterBody.GetTimedBuffTotalDurationForIndex(Buffs.AllowEliteBuffReAdded.bdReAddEliteBuff.buffIndex, ref num); characterBody.AddTimedBuff(Buffs.PreventedInstantShieldRecharge.bdPreventedInstantShieldRecharge, num); return true; } return false; })), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Brtrue, (object)skipShieldRecharge)) })); } private static ReturnFlow SetBuffCount(CharacterBody self, ref BuffIndex buffIndex, ref int newCount) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Invalid comparison between I4 and Unknown //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Invalid comparison between Unknown and I4 //IL_009f: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)self == (Object)null) && !((Object)(object)self.inventory == (Object)null) && NetworkServer.active) { if ((int)buffIndex == (int)Buffs.DisableEliteBuff.bdDisableElite.buffIndex) { if (newCount > 0) { foreach (BuffDef allEliteBuffDef in _allEliteBuffDefs) { if (self.HasBuff(allEliteBuffDef)) { self.RemoveBuff(allEliteBuffDef); } } if (Starstorm2Mod.ModIsRunning) { GuillotineSupport.TrySetEtherealEliteEffectsState(self, effectState: false); GuillotineSupport.TrySetUltraEliteEffectsState(self, effectState: false); } return (ReturnFlow)0; } if ((int)self.inventory.currentEquipmentIndex != -1) { BuffDef val = EquipmentCatalog.GetEquipmentDef(self.inventory.currentEquipmentIndex)?.passiveBuffDef; if ((Object)(object)val != (Object)null && val.isElite) { self.AddTimedBuff(Buffs.AllowEliteBuffReAdded.bdReAddEliteBuff, 0.2f); self.AddBuff(val); } } if (Starstorm2Mod.ModIsRunning) { GuillotineSupport.TrySetEtherealEliteEffectsState(self, effectState: true); GuillotineSupport.TrySetUltraEliteEffectsState(self, effectState: true); } } else if (self.HasBuff(Buffs.DisableEliteBuff.bdDisableElite) && BuffCatalog.GetBuffDef(buffIndex).isElite && !self.HasBuff(Buffs.AllowEliteBuffReAdded.bdReAddEliteBuff)) { return (ReturnFlow)1; } return (ReturnFlow)0; } return (ReturnFlow)0; } private static ReturnFlow Targeting(EquipmentSlot self, ref EquipmentIndex targetingEquipmentIndex, ref bool userShouldAnticipateTarget) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Invalid comparison between I4 and Unknown //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) if ((int)targetingEquipmentIndex == (int)Equipment.eiGuillotine) { self.ConfigureTargetFinderForEnemies(); HurtBox val = self.targetFinder.GetResults().FirstOrDefault(); self.currentTarget = new UserTargetInfo(val); if (!((Object)(object)self.currentTarget.transformToIndicateAt == (Object)null)) { self.targetIndicator.visualizerPrefab = ModAssets.EditedVanillaAssets.GuillotineTarget.GuillotineTargetingIndicator; self.targetIndicator.active = true; self.targetIndicator.visualizerPrefab.SetActive(true); self.targetIndicator.targetTransform = self.currentTarget.transformToIndicateAt; return (ReturnFlow)1; } return (ReturnFlow)0; } return (ReturnFlow)0; } private static ReturnFlow EquipmentSlot_PerformEquipmentAction(EquipmentSlot self, ref EquipmentDef equipmentDef, ref bool returnValue) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0104: 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) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Expected O, but got Unknown if ((Object)(object)equipmentDef != (Object)(object)Equipment.ceGuillotine.EquipmentDef) { returnValue = false; return (ReturnFlow)0; } if ((Object)(object)self.currentTarget.hurtBox == (Object)null) { returnValue = false; return (ReturnFlow)0; } self.UpdateTargets(Equipment.eiGuillotine, false); self.subcooldownTimer = 0.2f; Util.PlaySound("Play_merc_m1_hard_swing", ((Component)self.currentTarget.transformToIndicateAt).gameObject); Util.PlaySound("Play_halcyonite_skill1_swing", ((Component)self.currentTarget.transformToIndicateAt).gameObject); if (!self.currentTarget.hurtBox.healthComponent.body.HasBuff(Buffs.DisableEliteBuff.bdDisableElite)) { self.currentTarget.hurtBox.healthComponent.body.AddTimedBuffOnServer(Buffs.DisableEliteBuff.bdDisableElite, 12f); } DamageInfo val = new DamageInfo { attacker = ((Component)self.characterBody).gameObject, crit = Util.CheckRoll(self.characterBody.crit, self.characterBody.master), damageType = ModUtil.GenericEquipmentDamageType, inflictedHurtbox = self.currentTarget.hurtBox, inflictor = ((Component)self.characterBody).gameObject, position = self.currentTarget.transformToIndicateAt.position, procCoefficient = 1f, damage = self.characterBody.damage * 10f, damageColorIndex = (DamageColorIndex)3 }; self.currentTarget.hurtBox.healthComponent.TakeDamage(val); self.InvalidateCurrentTarget(); returnValue = true; return (ReturnFlow)1; } } private const float _cooldownTime = 40f; private const float _damageCoefficient = 10f; private const float _debuffDuration = 12f; private static List _allEliteBuffDefs = new List(); [MonoDetourHookInitialize] private static void Setup() { if (ConfigOptions.Guillotine.EnableEdit.Value) { ModLanguage.LangFilesToLoad.Add("Guillotine"); VanillaAssets.Setup(); ModAssets.Setup(); Equipment.SetupEquipment(); Buffs.SetupBuffs(); Hooks.Setup(); } } } [MonoDetourTargets(typeof(GlobalEventManager))] internal static class MoltenPerforator { private static class Assets { internal static AssetBundle MerfAssetBundle; internal const string MerfAssetBundleName = "moltenperforator"; internal static GameObject MerfExplosionPrefab; internal static string MerfAssetBundlePath => Path.Combine(Path.GetDirectoryName(Plugin.PluginInfo.Location), "moltenperforator"); internal static void Setup() { MerfAssetBundle = AssetBundle.LoadFromFile(MerfAssetBundlePath); } internal static void LoadAssets() { MerfExplosionPrefab = MerfAssetBundle.LoadAsset("MoltenPerforatorExplosionVFX"); ContentAddition.AddEffect(MerfExplosionPrefab); } } private static class ILHook { private const float _golemRadius = 1.63f; internal static void ReplaceMerfFunctionality(ILManipulationInfo info) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) ILWeaver w = new ILWeaver(info); Instruction startOfVanillaCode = null; ILLabel labelToEndOfVanillaCode = w.DefineLabel(); w.MatchRelaxed(new Predicate[3] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 23), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 0), (Instruction x) => ILPatternMatchingExt.MatchBle(x, ref labelToEndOfVanillaCode) && w.SetCurrentTo(x) }).ThrowIfFailure(); w.MatchNextRelaxed((Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 0) && w.SetCurrentTo(x) && w.SetInstructionTo(ref startOfVanillaCode, x), (Instruction x) => ILPatternMatchingExt.MatchCallvirt(x, "GetComponent")).ThrowIfFailure().InsertBeforeCurrentStealLabels((IEnumerable)new <>z__ReadOnlyArray((Instruction[])(object)new Instruction[4] { w.Create(OpCodes.Ldarg_1), w.Create(OpCodes.Ldarg_2), w.CreateCall((Delegate)new Action(DoMoltenPerforatorExplosion)), w.Create(OpCodes.Br, (object)labelToEndOfVanillaCode) })); } private static void DoMoltenPerforatorExplosion(DamageInfo damageInfo, GameObject victim) { //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: 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_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)victim == (Object)null || (Object)(object)damageInfo.attacker == (Object)null) { return; } CharacterBody component = victim.GetComponent(); if (!((Object)(object)component == (Object)null)) { CharacterBody component2 = damageInfo.attacker.GetComponent(); if (!((Object)(object)component2 == (Object)null) && !((Object)(object)component2.inventory == (Object)null) && Util.CheckRoll(10f * damageInfo.procCoefficient, component2.master)) { int itemCountEffective = component2.inventory.GetItemCountEffective(Items.FireballsOnHit); float baseDamage = Util.OnHitProcDamage(damageInfo.damage, component2.damage, 2.5f + (float)(itemCountEffective - 1) * 1.5f); float num = 1f + (component.radius - 1.63f) * 0.08f * 0.8f; EffectData val = new EffectData { origin = victim.transform.position, scale = 6.38f * num }; EffectManager.SpawnEffect(Assets.MerfExplosionPrefab, val, true); BlastAttack val2 = new BlastAttack { baseForce = 500f, radius = 16f * num, baseDamage = baseDamage, procCoefficient = 1f, crit = damageInfo.crit, damageColorIndex = (DamageColorIndex)3, attackerFiltering = (AttackerFiltering)0, falloffModel = (FalloffModel)0, attacker = damageInfo.attacker, teamIndex = component2.teamComponent.teamIndex, position = victim.transform.position, inflictor = damageInfo.inflictor, damageType = DamageTypeCombo.op_Implicit((DamageType)128), procChainMask = damageInfo.procChainMask }; ((ProcChainMask)(ref val2.procChainMask)).AddProc((ProcType)16); val2.Fire(); } } } } [CompilerGenerated] private static class <>O { public static Manipulator <0>__ReplaceMerfFunctionality; } private const float _initialDamage = 2.5f; private const float _stackDamage = 1.5f; [MonoDetourHookInitialize] internal static void Setup() { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Expected O, but got Unknown if (ConfigOptions.MoltenPerforator.EnableEdit.Value) { ModLanguage.LangFilesToLoad.Add("MoltenPerforator"); Assets.Setup(); Assets.LoadAssets(); object obj = <>O.<0>__ReplaceMerfFunctionality; if (obj == null) { Manipulator val = ILHook.ReplaceMerfFunctionality; <>O.<0>__ReplaceMerfFunctionality = val; obj = (object)val; } ProcessHitEnemy.ILHook((Manipulator)obj); } } } [MonoDetourTargets(typeof(GlobalEventManager))] internal class Polylute { [CompilerGenerated] private static class <>O { public static Manipulator <0>__SwapStackingHitsForDamage; } [MonoDetourHookInitialize] internal static void Setup() { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Expected O, but got Unknown if (ConfigOptions.Polylute.EnableEdit.Value) { ModLanguage.LangFilesToLoad.Add("Polylute"); object obj = <>O.<0>__SwapStackingHitsForDamage; if (obj == null) { Manipulator val = SwapStackingHitsForDamage; <>O.<0>__SwapStackingHitsForDamage = val; obj = (object)val; } ProcessHitEnemy.ILHook((Manipulator)obj); } } private static void SwapStackingHitsForDamage(ILManipulationInfo info) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) ILWeaver w = new ILWeaver(info); int voidLightningOrbVariableNumber = -1; int polyluteItemCountVariableNumber = -1; int num3 = default(int); w.MatchRelaxed(new Predicate[4] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num3), (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "RoR2.DLC1Content/Items", "ChainLightningVoid"), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "GetItemCountEffective"), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref polyluteItemCountVariableNumber) }).ThrowIfFailure(); int num2 = default(int); w.MatchRelaxed(new Predicate[3] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref voidLightningOrbVariableNumber), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num2), (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "damageValue") && w.SetCurrentTo(x) }).ThrowIfFailure().InsertBeforeCurrent((IEnumerable)new <>z__ReadOnlyArray((InstructionOrEnumerable[])(object)new InstructionOrEnumerable[2] { InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldloc, polyluteItemCountVariableNumber)), InstructionOrEnumerable.op_Implicit(w.CreateDelegateCall>((Func)((float damage, int polyluteCount) => damage * (float)polyluteCount))) })); int num = default(int); w.MatchRelaxed(new Predicate[5] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref voidLightningOrbVariableNumber), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 3), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num), (Instruction x) => ILPatternMatchingExt.MatchMul(x), (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "totalStrikes") && w.SetCurrentTo(x) }).ThrowIfFailure().InsertAfterCurrent((IEnumerable)new <>z__ReadOnlyArray((InstructionOrEnumerable[])(object)new InstructionOrEnumerable[2] { InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldloc, voidLightningOrbVariableNumber)), InstructionOrEnumerable.op_Implicit(w.CreateDelegateCall>((Action)delegate(VoidLightningOrb voidLightningOrb) { voidLightningOrb.totalStrikes = 3; })) })); } private static float DoDamageMult(int polyluteCount, float damage) { return damage * (float)polyluteCount; } private static void ResetVoidLightningOrbStrikeCount(VoidLightningOrb voidLightningOrb) { voidLightningOrb.totalStrikes = 3; } } [MonoDetourTargets(typeof(SetStateOnHurt))] public static class StunGrenade { private static class VanillaAssets { private static readonly AssetReferenceT _stunGrenadeItemDefReference = new AssetReferenceT(RoR2_Base_StunChanceOnHit.StunChanceOnHit_asset); private static readonly AssetReferenceT _tier2ItemTierDefReference = new AssetReferenceT(RoR2_Base_Common.Tier2Def_asset); internal static ItemTierDef _greenItemTier; private static readonly AssetReferenceT _stunGrenadeEffectReference = new AssetReferenceT(RoR2_Base_StunChanceOnHit.ImpactStunGrenade_prefab); internal static GameObject StunGrenadeEffect; internal static void Setup() { //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) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: 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_006f: Unknown result type (might be due to invalid IL or missing references) AsyncOperationHandle val = AssetAsyncReferenceManager.LoadAsset(_tier2ItemTierDefReference, (AsyncReferenceHandleUnloadType)2); val.Completed += delegate(AsyncOperationHandle handle) { _greenItemTier = handle.Result; }; AsyncOperationHandle val2 = AssetAsyncReferenceManager.LoadAsset(_stunGrenadeItemDefReference, (AsyncReferenceHandleUnloadType)2); val2.Completed += delegate(AsyncOperationHandle handle) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) handle.Result.pickupIconSprite = ModAssets.StunGrenadeIconGreen; handle.Result.tier = (ItemTier)1; handle.Result._itemTierDef = _greenItemTier; handle.Result.deprecatedTier = (ItemTier)1; }; AsyncOperationHandle val3 = AssetAsyncReferenceManager.LoadAsset(_stunGrenadeEffectReference, (AsyncReferenceHandleUnloadType)2); val3.Completed += delegate(AsyncOperationHandle handle) { StunGrenadeEffect = handle.Result; }; } } private static class ModAssets { internal static AssetBundle StunGrenadeAssetBundle; internal const string StunGrenadeAssetBundleName = "stungrenade"; internal static Sprite StunGrenadeIconGreen; internal static string StunGrenadeAssetBundlePath => Path.Combine(Path.GetDirectoryName(Plugin.PluginInfo.Location), "stungrenade"); internal static void Setup() { StunGrenadeAssetBundle = AssetBundle.LoadFromFile(StunGrenadeAssetBundlePath); LoadAssets(); } internal static void LoadAssets() { StunGrenadeIconGreen = StunGrenadeAssetBundle.LoadAsset("texStunGrenadeGreenIcon"); } } public static class DazeBuff { public static BuffDef bdStunGrenadeDaze; internal static void SetupBuff() { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) bdStunGrenadeDaze = ScriptableObject.CreateInstance(); ((Object)bdStunGrenadeDaze).name = "bdStunGrenadeDaze"; bdStunGrenadeDaze.isHidden = false; bdStunGrenadeDaze.canStack = false; bdStunGrenadeDaze.isDebuff = true; bdStunGrenadeDaze.flags = (Flags)2; bdStunGrenadeDaze.ignoreGrowthNectar = true; bdStunGrenadeDaze.buffColor = Color.white; bdStunGrenadeDaze.iconSprite = ModAssets.StunGrenadeIconGreen; ContentAddition.AddBuffDef(bdStunGrenadeDaze); } } public static class ProcType { public static ModdedProcType StunGrenadeProcced = ProcTypeAPI.ReserveProcType(); } private static class Hooks { [CompilerGenerated] private static class <>O { public static Manipulator <0>__OnTakeDamageServer; public static Action <1>__GlobalEventManager_onServerDamageDealt; public static StatHookEventHandler <2>__RecalculateStatsAPI_GetStatCoefficients; } internal static void Setup() { //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_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Expected O, but got Unknown object obj = <>O.<0>__OnTakeDamageServer; if (obj == null) { Manipulator val = OnTakeDamageServer; <>O.<0>__OnTakeDamageServer = val; obj = (object)val; } Mdh.RoR2.SetStateOnHurt.OnTakeDamageServer.ILHook((Manipulator)obj); GlobalEventManager.onServerDamageDealt += GlobalEventManager_onServerDamageDealt; object obj2 = <>O.<2>__RecalculateStatsAPI_GetStatCoefficients; if (obj2 == null) { StatHookEventHandler val2 = RecalculateStatsAPI_GetStatCoefficients; <>O.<2>__RecalculateStatsAPI_GetStatCoefficients = val2; obj2 = (object)val2; } RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)obj2; } private static void GlobalEventManager_onServerDamageDealt(DamageReport damageReport) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) if (!ModUtil.IsDamageReportNull(damageReport) && !ProcTypeAPI.HasModdedProc(damageReport.damageInfo.procChainMask, ProcType.StunGrenadeProcced)) { int itemCountEffective = damageReport.attackerBody.inventory.GetItemCountEffective(Items.StunChanceOnHit); if (itemCountEffective >= 1 && Util.CheckRoll(5f * (float)itemCountEffective * damageReport.damageInfo.procCoefficient, damageReport.attackerMaster)) { EffectManager.SimpleImpactEffect(VanillaAssets.StunGrenadeEffect, damageReport.damageInfo.position, -damageReport.damageInfo.force, true); DamageInfo val = ModUtil.CreateNewDamageInfoFromDamageReport(damageReport); val.damage *= 2f; ProcTypeAPI.AddModdedProc(ref val.procChainMask, ProcType.StunGrenadeProcced); damageReport.victimBody.healthComponent.TakeDamage(val); damageReport.victimBody.AddTimedBuff(DazeBuff.bdStunGrenadeDaze, 8f); } } } private static void OnTakeDamageServer(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); Instruction startOfSkip = null; Instruction endOfSkip = null; MethodReference val3 = default(MethodReference); ILLabel val2 = default(ILLabel); ILLabel val = default(ILLabel); w.MatchRelaxed(new Predicate[8] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 2) && w.SetInstructionTo(ref startOfSkip, x), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, ref val3), (Instruction x) => ILPatternMatchingExt.MatchBrtrue(x, ref val2), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 0), (Instruction x) => ILPatternMatchingExt.MatchBr(x, ref val), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 2), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "get_inventory"), (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "RoR2.RoR2Content/Items", "StunChanceOnHit") }).ThrowIfFailure().MatchRelaxed(new Predicate[5] { (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 1), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "RoR2.EffectManager", "SimpleImpactEffect"), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 2f), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "SetStun") && w.SetInstructionTo(ref endOfSkip, x) && w.SetCurrentTo(x) }) .ThrowIfFailure() .InsertBranchOver(startOfSkip, endOfSkip); } private static void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args) { if (!((Object)(object)sender == (Object)null) && sender.HasBuff(DazeBuff.bdStunGrenadeDaze)) { args.attackSpeedReductionMultAdd += 0.3f; args.moveSpeedReductionMultAdd += 0.2f; args.damageMultAdd -= 0.15f; } } } private const float _procChance = 5f; private const float _damageCoefficient = 2f; private const float _attackSpeedReduction = 0.3f; private const float _moveSpeedReduction = 0.2f; private const float _damageReduction = 0.15f; [MonoDetourHookInitialize] private static void Setup() { if (ConfigOptions.StunGrenade.EnableEdit.Value) { ModLanguage.LangFilesToLoad.Add("StunGrenade"); VanillaAssets.Setup(); ModAssets.Setup(); DazeBuff.SetupBuff(); Hooks.Setup(); } } } [MonoDetourTargets(typeof(HealthComponent))] internal static class VoidCrit { private static class VanillaAssets { private static readonly AssetReferenceT _voidCritEffectReference = new AssetReferenceT(RoR2_DLC1_CritGlassesVoid.CritGlassesVoidExecuteEffect_prefab); internal static void Setup() { //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) AsyncOperationHandle val = AssetAsyncReferenceManager.LoadAsset(_voidCritEffectReference, (AsyncReferenceHandleUnloadType)2); val.Completed += delegate(AsyncOperationHandle handle) { Object.Destroy((Object)(object)((Component)handle.Result.transform.Find("FakeDamageNumbers")).gameObject); }; } } private static class Hooks { [CompilerGenerated] private static class <>O { public static Manipulator <0>__RemoveVanillaFunctionality; public static Action <1>__GlobalEventManager_onServerDamageDealt; } internal static void Setup() { //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 object obj = <>O.<0>__RemoveVanillaFunctionality; if (obj == null) { Manipulator val = RemoveVanillaFunctionality; <>O.<0>__RemoveVanillaFunctionality = val; obj = (object)val; } TakeDamageProcess.ILHook((Manipulator)obj); GlobalEventManager.onServerDamageDealt += GlobalEventManager_onServerDamageDealt; } private static void GlobalEventManager_onServerDamageDealt(DamageReport damageReport) { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Expected O, but got Unknown //IL_00a1: Unknown result type (might be due to invalid IL or missing references) if (ModUtil.IsDamageReportNull(damageReport)) { return; } int itemCountEffective = damageReport.attackerBody.inventory.GetItemCountEffective(Items.CritGlassesVoid); if (itemCountEffective >= 1 && Util.CheckRoll(1f * (float)itemCountEffective * damageReport.damageInfo.procCoefficient, damageReport.attackerMaster)) { EffectManager.SpawnEffect(AssetReferences.critGlassesVoidExecuteEffectPrefab, new EffectData { origin = damageReport.damageInfo.position, scale = damageReport.victimBody.radius }, true); DamageInfo val = CreateVoidCritProcDamageInfo(damageReport); for (int i = 0; i < 3; i++) { GlobalEventManager.instance.OnCrit(damageReport.attackerBody, val, damageReport.attackerMaster, damageReport.damageInfo.procCoefficient, val.procChainMask); } damageReport.victimBody.healthComponent.TakeDamage(val); } } private static DamageInfo CreateVoidCritProcDamageInfo(DamageReport damageReportThatProcced) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) DamageInfo val = ModUtil.CreateNewDamageInfoFromDamageReport(damageReportThatProcced); val.damageColorIndex = (DamageColorIndex)9; val.procCoefficient = 0f; if (((DamageTypeCombo)(ref val.damageType)).IsDamageSourceSkillBased) { val.damageType.damageSource = (DamageSource)0; val.damage = damageReportThatProcced.damageDealt * 8f; } else { val.damage = damageReportThatProcced.attackerBody.damage * 8f; } if (ConfigOptions.VoidCrit.UseCritMultiplier.Value) { val.damage *= damageReportThatProcced.attackerBody.critMultiplier; } return val; } private static void RemoveVanillaFunctionality(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); Instruction startOfSkip = null; Instruction endOfSkip = null; FieldReference val = default(FieldReference); w.MatchRelaxed(new Predicate[5] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 0) && w.SetInstructionTo(ref startOfSkip, x), (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, ref val), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "get_inventory"), (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "RoR2.DLC1Content/Items", "CritGlassesVoid"), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "GetItemCountEffective") }).ThrowIfFailure().MatchRelaxed(new Predicate[4] { (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 65536), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "op_Implicit"), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "op_BitwiseOr"), (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "damageType") && w.SetInstructionTo(ref endOfSkip, x) }) .ThrowIfFailure() .InsertBranchOver(startOfSkip, endOfSkip); } } private const float _procChance = 1f; private const float _damageBoost = 8f; private const int _critEffectActivationCount = 3; [MonoDetourHookInitialize] private static void Setup() { if (ConfigOptions.VoidCrit.EnableEdit.Value) { ModLanguage.LangFilesToLoad.Add("VoidCrit"); VanillaAssets.Setup(); Hooks.Setup(); } } } [MonoDetourTargets(typeof(ExtraLifeVoidManager), GenerateControlFlowVariants = true)] [MonoDetourTargets(typeof(CharacterMaster), GenerateControlFlowVariants = true)] [MonoDetourTargets(typeof(CharacterBody), GenerateControlFlowVariants = true)] internal static class VoidDios { public static class VoidRespawnMarkItem { private const string _markItemDefName = "idVoidRespawnMark"; public static ItemDef idVoidRespawnMark; public static CustomItem ciVoidRespawnMark; public static ItemIndex iiVoidRespawnMark; internal static void SetupItem() { if (!ItemAPI.Add(ciVoidRespawnMark)) { Log.Error("Void respawn mark custom item could not be added by ItemAPI for some reason!"); } } [SystemInitializer(new Type[] { typeof(ItemCatalog) })] private static void GetGuillotineEquipmentIndex() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) iiVoidRespawnMark = ItemCatalog.FindItemIndex("idVoidRespawnMark"); } static VoidRespawnMarkItem() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown //IL_0049: 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_007f: Expected O, but got Unknown ItemDef val = new ItemDef(); ((Object)val).name = "idVoidRespawnMark"; val.nameToken = "Respawned via void dios"; val.pickupToken = "Your CutHP will be removed later"; val.descriptionToken = "Your CutHP will be removed later"; val.canRemove = false; val.hidden = true; val.tier = (ItemTier)5; val.deprecatedTier = (ItemTier)5; ItemTag[] array = new ItemTag[5]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); val.tags = (ItemTag[])(object)array; idVoidRespawnMark = val; ciVoidRespawnMark = new CustomItem(idVoidRespawnMark, Array.Empty()); } } [CompilerGenerated] private static class <>O { public static GetNextBodyPrefab.ControlFlowPrefixSignature <0>__ExtraLifeVoidManager_GetNextBodyPrefab; public static Manipulator <1>__CharacterMaster_RespawnExtraLifeVoid; public static SpawnBody.PrefixSignature <2>__SpawnBody; public static RestoreOriginalBodyPrefab.ControlFlowPrefixSignature <3>__TryPreventChangingBack; } private static readonly AssetReferenceT _voidDiosItemAssetReference = new AssetReferenceT(RoR2_DLC1_ExtraLifeVoid.ExtraLifeVoid_asset); private static ItemDef _voidDiosItemDef; private static readonly AssetReferenceT _cutHpItemDefAssetReference = new AssetReferenceT(RoR2_Base_CutHp.CutHp_asset); private static ItemDef _cutHpItemDef; private static readonly AssetReferenceT _reaverAllyBodyPrefabReference = new AssetReferenceT(RoR2_Base_Nullifier.NullifierAllyBody_prefab); private static readonly AssetReferenceT _jailerAllyBodyPrefabReference = new AssetReferenceT(RoR2_DLC1_VoidJailer.VoidJailerAllyBody_prefab); private static readonly AssetReferenceT _devastatorAllyBodyPrefabReference = new AssetReferenceT(RoR2_DLC1_VoidMegaCrab.VoidMegaCrabAllyBody_prefab); private const float _respawnImmunityTime = 5f; [MonoDetourHookInitialize] internal static void Setup() { //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Expected O, but got Unknown if (ConfigOptions.VoidDios.EnableEdit.Value) { EditVoidBodyPrefabs(); EditItemPrefabs(); VoidRespawnMarkItem.SetupItem(); GetNextBodyPrefab.ControlFlowPrefix(ExtraLifeVoidManager_GetNextBodyPrefab); object obj = <>O.<1>__CharacterMaster_RespawnExtraLifeVoid; if (obj == null) { Manipulator val = CharacterMaster_RespawnExtraLifeVoid; <>O.<1>__CharacterMaster_RespawnExtraLifeVoid = val; obj = (object)val; } RespawnExtraLifeVoid.ILHook((Manipulator)obj); Mdh.RoR2.CharacterMaster.SpawnBody.Prefix(SpawnBody); RestoreOriginalBodyPrefab.ControlFlowPrefix(TryPreventChangingBack); ModLanguage.LangFilesToLoad.Add("VoidDios"); } } private static void EditVoidBodyPrefabs() { //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) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: 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_006f: Unknown result type (might be due to invalid IL or missing references) AsyncOperationHandle val = AssetAsyncReferenceManager.LoadAsset(_reaverAllyBodyPrefabReference, (AsyncReferenceHandleUnloadType)2); val.Completed += delegate(AsyncOperationHandle handle) { handle.Result.GetComponent().maxInteractionDistance = 9f; }; val = AssetAsyncReferenceManager.LoadAsset(_jailerAllyBodyPrefabReference, (AsyncReferenceHandleUnloadType)2); val.Completed += delegate(AsyncOperationHandle handle) { handle.Result.GetComponent().maxInteractionDistance = 12f; }; val = AssetAsyncReferenceManager.LoadAsset(_devastatorAllyBodyPrefabReference, (AsyncReferenceHandleUnloadType)2); val.Completed += delegate(AsyncOperationHandle handle) { handle.Result.GetComponent().maxInteractionDistance = 15f; }; } private static void EditItemPrefabs() { //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) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) AsyncOperationHandle val = AssetAsyncReferenceManager.LoadAsset(_voidDiosItemAssetReference, (AsyncReferenceHandleUnloadType)2); val.Completed += delegate(AsyncOperationHandle handle) { ItemDef result = handle.Result; ItemTag[] tags = handle.Result.tags; int num = 0; ItemTag[] array = (ItemTag[])(object)new ItemTag[1 + tags.Length]; ReadOnlySpan readOnlySpan = new ReadOnlySpan(tags); readOnlySpan.CopyTo(new Span(array).Slice(num, readOnlySpan.Length)); num += readOnlySpan.Length; array[num] = (ItemTag)13; result.tags = array; _voidDiosItemDef = handle.Result; }; val = AssetAsyncReferenceManager.LoadAsset(_cutHpItemDefAssetReference, (AsyncReferenceHandleUnloadType)2); val.Completed += delegate(AsyncOperationHandle handle) { _cutHpItemDef = handle.Result; _cutHpItemDef.hidden = true; }; } private static ReturnFlow ExtraLifeVoidManager_GetNextBodyPrefab(ref GameObject returnValue) { string[] array = ConfigOptions.VoidDios.RespawnableBodiesList.Value.Split(','); Log.Info($"Void dios body list length is {array.Length}"); if (array.Length < 1) { Log.Error("No bodies specified to respawn as for void dios!"); returnValue = null; return (ReturnFlow)1; } int num = ExtraLifeVoidManager.rng.RangeInt(0, array.Length); Log.Info($"Chosen position in body list is {num}"); GameObject val = BodyCatalog.FindBodyPrefab(array[num]); if ((Object)(object)val == (Object)null) { Log.Warning($"Body named {array[num]} at position {num} is not a valid body! Picking from the first valid result instead..."); string[] array2 = array; for (int i = 0; i < array2.Length; i++) { GameObject val2 = BodyCatalog.FindBodyPrefab(array2[i]); if ((Object)(object)val2 != (Object)null) { val = val2; break; } } if ((Object)(object)val == (Object)null) { Log.Error("A valid body could not be found from the list provided for void dios!"); returnValue = null; return (ReturnFlow)1; } } returnValue = val; return (ReturnFlow)1; } private static void CharacterMaster_RespawnExtraLifeVoid(ILManipulationInfo info) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) ILWeaver w = new ILWeaver(info); w.MatchRelaxed(new Predicate[4] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0) && w.SetCurrentTo(x), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 0f), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 0f) }).ThrowIfFailure().InsertBeforeCurrentStealLabels((IEnumerable)new <>z__ReadOnlyArray((InstructionOrEnumerable[])(object)new InstructionOrEnumerable[2] { InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldarg_0)), InstructionOrEnumerable.op_Implicit(w.CreateDelegateCall>((Action)delegate(CharacterMaster characterMaster) { //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)characterMaster == (Object)null) && !((Object)(object)characterMaster.inventory == (Object)null)) { GameObject nextBodyPrefab = ExtraLifeVoidManager.GetNextBodyPrefab(); if (!((Object)(object)nextBodyPrefab == (Object)null)) { if ((Object)(object)characterMaster.GetBody() == (Object)null) { characterMaster.Respawn(((Object)nextBodyPrefab).name); } if ((Object)(object)characterMaster.originalBodyPrefab == (Object)null) { characterMaster.originalBodyPrefab = characterMaster.bodyPrefab; } characterMaster.inventory.GiveItemPermanent(VoidRespawnMarkItem.idVoidRespawnMark, 3); characterMaster.inventory.GiveItemPermanent(_cutHpItemDef, 1); characterMaster.TransformBody(((Object)nextBodyPrefab).name); BaseAI component = ((Component)characterMaster).GetComponent(); if ((Object)(object)component != (Object)null) { BodyIndex val3 = BodyCatalog.FindBodyIndex(nextBodyPrefab); Log.Debug($"bodyIndexFromPrefab is {val3}"); MasterIndex val4 = MasterCatalog.FindAiMasterIndexForBody(val3); Log.Debug($"masterIndexFromBodyIndex is {val4}"); GameObject masterPrefab = MasterCatalog.GetMasterPrefab(val4); Log.Debug($"voidAllyMasterPrefab is {masterPrefab}"); ReplaceAISkillDrivers(characterMaster, component, masterPrefab); } } } })) })); w.MatchRelaxed(new Predicate[2] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "RoR2.RoR2Content/Buffs", "Immune"), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 3f) && w.SetCurrentTo(x) }).ThrowIfFailure().InsertAfterCurrent((IEnumerable)w.CreateDelegateCall>((Func)((float oldInvulnerabilityTime) => 5f))); ILLabel val = w.DefineLabel(); MethodReference val2 = default(MethodReference); w.MatchRelaxed(new Predicate[3] { (Instruction x) => ILPatternMatchingExt.MatchLdloca(x, 4) && w.SetCurrentTo(x), (Instruction x) => ILPatternMatchingExt.MatchCall(x, ref val2), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 5) }).ThrowIfFailure().InsertBeforeCurrentStealLabels((IEnumerable)new <>z__ReadOnlySingleElementList(w.Create(OpCodes.Br, (object)val))); w.MatchRelaxed(new Predicate[2] { (Instruction x) => ILPatternMatchingExt.MatchCallvirt(x, "Dispose"), (Instruction x) => ILPatternMatchingExt.MatchEndfinally(x) && w.SetCurrentTo(x) }).ThrowIfFailure().MarkLabelToCurrentNext(val); } private static ReturnFlow TryPreventChangingBack(CharacterMaster self) { if (self.inventory.GetItemCountEffective(VoidRespawnMarkItem.idVoidRespawnMark) <= 0) { return (ReturnFlow)0; } return (ReturnFlow)1; } private static void SpawnBody(CharacterMaster self, ref Vector3 position, ref Quaternion rotation) { if (!((Object)(object)self == (Object)null) && !((Object)(object)self.inventory == (Object)null)) { switch (self.inventory.GetItemCountEffective(VoidRespawnMarkItem.idVoidRespawnMark)) { case 2: case 3: Log.Debug("Removing a void respawn mark"); self.inventory.RemoveItemPermanent(VoidRespawnMarkItem.idVoidRespawnMark, 1); break; case 1: Log.Info("Removing CutHP from last void dios respawn"); Log.Debug("AND LAST VOID RESPAWN MARK TOO"); self.inventory.RemoveItemPermanent(VoidRespawnMarkItem.idVoidRespawnMark, 1); self.inventory.RemoveItemPermanent(_cutHpItemDef, 1); break; } } } private static void ReplaceAISkillDrivers(CharacterMaster characterMaster, BaseAI baseAI, GameObject newCharacterMasterPrefab) { //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_0258: Unknown result type (might be due to invalid IL or missing references) AISkillDriver[] components = ((Component)characterMaster).GetComponents(); for (int i = 0; i < components.Length; i++) { Object.Destroy((Object)(object)components[i]); } AISkillDriver[] components2 = newCharacterMasterPrefab.GetComponents(); List list = new List(); components = components2; foreach (AISkillDriver val in components) { AISkillDriver val2 = ((Component)characterMaster).gameObject.AddComponent(); val2.activationRequiresAimConfirmation = val.activationRequiresAimConfirmation; val2.activationRequiresAimTargetLoS = val.activationRequiresAimTargetLoS; val2.activationRequiresTargetLoS = val.activationRequiresTargetLoS; val2.aimType = val.aimType; val2.buttonPressType = val.buttonPressType; val2.customName = val.customName; val2.driverUpdateTimerOverride = val.driverUpdateTimerOverride; val2.ignoreNodeGraph = val.ignoreNodeGraph; val2.maxDistance = val.maxDistance; val2.maxTargetHealthFraction = val.maxTargetHealthFraction; val2.maxUserHealthFraction = val.maxUserHealthFraction; val2.minDistance = val.minDistance; val2.minTargetHealthFraction = val.minTargetHealthFraction; val2.minUserHealthFraction = val.minUserHealthFraction; val2.moveInputScale = val.moveInputScale; val2.movementType = val.movementType; val2.moveTargetType = val.moveTargetType; val2.nextHighPriorityOverride = val.nextHighPriorityOverride; val2.noRepeat = val.noRepeat; val2.requiredSkill = val.requiredSkill; val2.requireEquipmentReady = val.requireEquipmentReady; val2.requireSkillReady = val.requireSkillReady; val2.resetCurrentEnemyOnNextDriverSelection = val.resetCurrentEnemyOnNextDriverSelection; val2.selectionRequiresAimTarget = val.selectionRequiresAimTarget; val2.selectionRequiresOnGround = val.selectionRequiresOnGround; val2.selectionRequiresTargetLoS = val.selectionRequiresTargetLoS; val2.shouldFireEquipment = val.shouldFireEquipment; val2.shouldSprint = val.shouldSprint; val2.buttonPressType = val.buttonPressType; val2.skillSlot = val.skillSlot; ((Object)val2).name = ((Object)val).name + "(Clone)"; list.Add(val2); } AISkillDriver[] skillDrivers = list.ToArray(); baseAI.skillDrivers = skillDrivers; EntityStateMachine component = ((Component)characterMaster).GetComponent(); EntityStateMachine component2 = newCharacterMasterPrefab.GetComponent(); component.customName = component2.customName; component.initialStateType = component2.initialStateType; component.mainStateType = component2.mainStateType; component.nextState = component2.nextState; } } [MonoDetourTargets(typeof(BarrageOnBossBehaviour), GenerateControlFlowVariants = true)] [MonoDetourTargets(typeof(MoneyPickup))] [MonoDetourTargets(typeof(ProjectileKnockOutGold))] [MonoDetourTargets(typeof(CharacterBody), Members = new string[] { "OnInventoryChanged" })] public static class WarBonds { private class RiWarBondsAttackerInfo { internal float DamagePerMissile; } public static class WarBondsBuildUpBuff { public static BuffDef bdWarBondsBuildUp; internal static void SetupBuff() { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //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) bdWarBondsBuildUp = ScriptableObject.CreateInstance(); ((Object)bdWarBondsBuildUp).name = "bdWarBondsBuildUp"; bdWarBondsBuildUp.isHidden = false; bdWarBondsBuildUp.canStack = true; bdWarBondsBuildUp.isDebuff = false; bdWarBondsBuildUp.flags = (Flags)1; bdWarBondsBuildUp.ignoreGrowthNectar = true; bdWarBondsBuildUp.buffColor = Color.grey; AsyncOperationHandle val = AssetAsyncReferenceManager.LoadAsset(_warbondsBuffDefAssetReference, (AsyncReferenceHandleUnloadType)2); val.Completed += delegate(AsyncOperationHandle handle) { bdWarBondsBuildUp.iconSprite = handle.Result.iconSprite; }; ContentAddition.AddBuffDef(bdWarBondsBuildUp); } } private class ChanceDropGoldOnHitBehavior : AffixAurelioniteBehavior { private void Start() { AffixAurelioniteBehavior.EnsureReferences(); } private void OnEnable() { GlobalEventManager.onServerDamageDealt += WarBondsOnServerDamageDealt; } private void OnDisable() { GlobalEventManager.onServerDamageDealt -= WarBondsOnServerDamageDealt; } private void WarBondsOnServerDamageDealt(DamageReport damageReport) { if (ModUtil.IsDamageReportNull(damageReport) || damageReport.attackerBody.inventory.GetItemCountEffective(Items.BarrageOnBoss) < 1) { return; } if (Util.CheckRoll(20f * damageReport.damageInfo.procCoefficient, damageReport.attackerMaster)) { ((AffixAurelioniteBehavior)this).OnServerDamageDealt(damageReport); } if (damageReport.attackerBody.GetBuffCount(Buffs.ExtraBossMissile) < 1) { return; } bool flag = damageReport.damageInfo.damage / damageReport.attackerBody.damage >= 4f && ((DamageTypeCombo)(ref damageReport.damageInfo.damageType)).IsDamageSourceSkillBased; if ((Object)(object)barrageOnBossBehaviourInstance.currentEnemy == (Object)null && flag) { RiWarBondsAttackerInfo riWarBondsAttackerInfo = default(RiWarBondsAttackerInfo); if (!_riWarBondsAttackerInfoTable.TryGetValue(damageReport.attackerBody, ref riWarBondsAttackerInfo)) { float damagePerMissile = Util.OnHitProcDamage(damageReport.damageInfo.damage, damageReport.attackerBody.damage, GetTotalWarBondsDamageCoeff(damageReport.attackerBody)); _riWarBondsAttackerInfoTable.Add(damageReport.attackerBody, new RiWarBondsAttackerInfo { DamagePerMissile = damagePerMissile }); } barrageOnBossBehaviourInstance.currentEnemy = damageReport.victimBody; barrageOnBossBehaviourInstance.StartMissileCountdown(true); } } } [CompilerGenerated] private static class <>O { public static Mdh.RoR2.BarrageOnBossBehaviour.Start.ControlFlowPrefixSignature <0>__RemoveVanillaBehavior; public static UpdateExtraMissileMoneyCount.ControlFlowPrefixSignature <1>__RemoveVanillaBehaviorAgain; public static Manipulator <2>__MoneyPickup_OnTriggerStay; public static Mdh.RoR2.CharacterBody.OnInventoryChanged.PostfixSignature <3>__OnInventoryChanged; public static Mdh.RoR2.BarrageOnBossBehaviour.Start.PostfixSignature <4>__BarrageOnBossBehaviour_Start; public static CalculateMissileDamage.ControlFlowPrefixSignature <5>__BarrageOnBossBehaviour_CalculateMissileDamage; public static UpdateBarrage.PostfixSignature <6>__BarrageOnBossBehaviour_UpdateBarrage; public static Action <7>__OnGoldChunkPickedUp; } public const int WarBondsGoldChunkDropChance = 20; public const int WarBondsGoldChunksNeededCount = 5; public const int WarBondsMaximumStoredMissiles = 5; public const float WarBondsNewDelayBeforeMissiles = 2f; public const float WarBondsNewDelayBetweenMissiles = 0.2f; public const float WarBondsMissileDamageCoefficientInitial = 8f; public const float WarBondsMissileDamageCoefficientStacked = 6f; private static BarrageOnBossBehaviour barrageOnBossBehaviourInstance; private static readonly AssetReferenceT _warbondsBuffDefAssetReference = new AssetReferenceT(RoR2_DLC2.bdExtraBossMissile_asset); private static readonly FixedConditionalWeakTable _riWarBondsAttackerInfoTable = new FixedConditionalWeakTable(); [MonoDetourHookInitialize] private static void Setup() { //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Expected O, but got Unknown if (ConfigOptions.WarBonds.EnableEdit.Value) { ModLanguage.LangFilesToLoad.Add("WarBonds"); WarBondsBuildUpBuff.SetupBuff(); Mdh.RoR2.BarrageOnBossBehaviour.Start.ControlFlowPrefix(RemoveVanillaBehavior); UpdateExtraMissileMoneyCount.ControlFlowPrefix(RemoveVanillaBehaviorAgain); object obj = <>O.<2>__MoneyPickup_OnTriggerStay; if (obj == null) { Manipulator val = MoneyPickup_OnTriggerStay; <>O.<2>__MoneyPickup_OnTriggerStay = val; obj = (object)val; } OnTriggerStay.ILHook((Manipulator)obj); Mdh.RoR2.CharacterBody.OnInventoryChanged.Postfix(OnInventoryChanged); Mdh.RoR2.BarrageOnBossBehaviour.Start.Postfix(BarrageOnBossBehaviour_Start); CalculateMissileDamage.ControlFlowPrefix(BarrageOnBossBehaviour_CalculateMissileDamage); UpdateBarrage.Postfix(BarrageOnBossBehaviour_UpdateBarrage); } } private static ReturnFlow RemoveVanillaBehavior(BarrageOnBossBehaviour self) { return (ReturnFlow)1; } private static ReturnFlow RemoveVanillaBehaviorAgain(BarrageOnBossBehaviour self, ref float amount) { return (ReturnFlow)1; } private static void MoneyPickup_OnTriggerStay(ILManipulationInfo info) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_0089: Unknown result type (might be due to invalid IL or missing references) ILWeaver w = new ILWeaver(info); w.MatchRelaxed(new Predicate[3] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 2), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 1), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "OnPickup") && w.SetCurrentTo(x) }).ThrowIfFailure().InsertAfterCurrent((IEnumerable)new <>z__ReadOnlyArray((InstructionOrEnumerable[])(object)new InstructionOrEnumerable[2] { InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldloc_2)), InstructionOrEnumerable.op_Implicit(w.CreateDelegateCall>((Action)OnGoldChunkPickedUp)) })); } private static void OnGoldChunkPickedUp(CharacterBody characterBody) { if ((Object)(object)characterBody == (Object)null || (Object)(object)characterBody.inventory == (Object)null || characterBody.inventory.GetItemCountEffective(Items.BarrageOnBoss) < 1 || characterBody.GetBuffCount(Buffs.ExtraBossMissile) >= 5) { return; } int buffCount = characterBody.GetBuffCount(WarBondsBuildUpBuff.bdWarBondsBuildUp); if (buffCount >= 4) { characterBody.AddBuff(Buffs.ExtraBossMissile); for (int i = 0; i < buffCount; i++) { characterBody.RemoveBuff(WarBondsBuildUpBuff.bdWarBondsBuildUp); } } else { characterBody.AddBuff(WarBondsBuildUpBuff.bdWarBondsBuildUp); } } private static void OnInventoryChanged(CharacterBody self) { if (NetworkServer.active && (Object)(object)self != (Object)null && (Object)(object)self.inventory != (Object)null) { self.AddItemBehavior(self.inventory.GetItemCountEffective(Items.BarrageOnBoss)); } } private static void BarrageOnBossBehaviour_Start(BarrageOnBossBehaviour self) { self.initialMissileDelay = 2f; self.fireDelay = 0.2f; barrageOnBossBehaviourInstance = self; } private static ReturnFlow BarrageOnBossBehaviour_CalculateMissileDamage(BarrageOnBossBehaviour self, ref CharacterBody targetBody, ref float returnValue) { RiWarBondsAttackerInfo riWarBondsAttackerInfo = default(RiWarBondsAttackerInfo); if (_riWarBondsAttackerInfoTable.TryGetValue(((ItemBehavior)self).body, ref riWarBondsAttackerInfo)) { returnValue = riWarBondsAttackerInfo.DamagePerMissile; return (ReturnFlow)1; } return (ReturnFlow)1; } private static void BarrageOnBossBehaviour_UpdateBarrage(BarrageOnBossBehaviour self) { RiWarBondsAttackerInfo riWarBondsAttackerInfo = default(RiWarBondsAttackerInfo); if (self.barrageQuantity < 1 && _riWarBondsAttackerInfoTable.TryGetValue(((ItemBehavior)self).body, ref riWarBondsAttackerInfo)) { _riWarBondsAttackerInfoTable.Remove(((ItemBehavior)self).body); barrageOnBossBehaviourInstance.currentEnemy = null; } } private static float GetTotalWarBondsDamageCoeff(CharacterBody attackerBody) { if ((Object)(object)attackerBody == (Object)null || (Object)(object)attackerBody.inventory == (Object)null) { return 0f; } int itemCountEffective = attackerBody.inventory.GetItemCountEffective(Items.BarrageOnBoss); if (itemCountEffective < 1) { return 0f; } return 8f + 6f * (float)(itemCountEffective - 1); } } } namespace ReheatedItems.ItemChanges.PocketICBMMissilesToDamage { [MonoDetourTargets(typeof(FireMissileBarrage))] internal static class MissileDroneShot { [CompilerGenerated] private static class <>O { public static Manipulator <0>__FireMissileBarrage_FireMissile; } [MonoDetourHookInitialize] private static void Setup() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown if (ConfigOptions.PocketICBM.ChangeGenericMissileEffect.Value) { object obj = <>O.<0>__FireMissileBarrage_FireMissile; if (obj == null) { Manipulator val = FireMissileBarrage_FireMissile; <>O.<0>__FireMissileBarrage_FireMissile = val; obj = (object)val; } Mdh.EntityStates.Drone.DroneWeapon.FireMissileBarrage.FireMissile.ILHook((Manipulator)obj); } } private static void FireMissileBarrage_FireMissile(ILManipulationInfo info) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown ModUtil.SkipNext2FireProjectiles(new ILWeaver(info)); } } [MonoDetourTargets(typeof(CommandFireMissiles))] internal static class OperatorMissileDroneCommand { [CompilerGenerated] private static class <>O { public static Manipulator <0>__CommandFireMissiles_FireMissile; } [MonoDetourHookInitialize] private static void Setup() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown if (ConfigOptions.PocketICBM.ChangeGenericMissileEffect.Value) { object obj = <>O.<0>__CommandFireMissiles_FireMissile; if (obj == null) { Manipulator val = CommandFireMissiles_FireMissile; <>O.<0>__CommandFireMissiles_FireMissile = val; obj = (object)val; } Mdh.EntityStates.Drone.Command.CommandFireMissiles.FireMissile.ILHook((Manipulator)obj); } } private static void CommandFireMissiles_FireMissile(ILManipulationInfo info) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown ModUtil.SkipNext2FireProjectiles(new ILWeaver(info)); } } [MonoDetourTargets(typeof(GlobalEventManager))] internal static class Plimp { [CompilerGenerated] private static class <>O { public static Manipulator <0>__ReplacePlimpICBMEffect; } [MonoDetourHookInitialize] internal static void Setup() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown if (ConfigOptions.PocketICBM.ChangePlasmaShrimpEffect.Value) { object obj = <>O.<0>__ReplacePlimpICBMEffect; if (obj == null) { Manipulator val = ReplacePlimpICBMEffect; <>O.<0>__ReplacePlimpICBMEffect = val; obj = (object)val; } ProcessHitEnemy.ILHook((Manipulator)obj); } } private static void ReplacePlimpICBMEffect(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); ILLabel val2 = default(ILLabel); ILLabel val = default(ILLabel); int num = default(int); w.MatchRelaxed(new Predicate[5] { (Instruction x) => ILPatternMatchingExt.MatchBgt(x, ref val2), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 1), (Instruction x) => ILPatternMatchingExt.MatchBr(x, ref val), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 3), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref num) && w.SetCurrentTo(x) }).ThrowIfFailure().InsertBeforeCurrent((IEnumerable)w.CreateDelegateCall>((Func)((int getOut) => 1))); } } [MonoDetourTargets(typeof(GlobalEventManager))] [MonoDetourTargets(typeof(MissileUtils), GenerateControlFlowVariants = true)] public static class PocketICBM { [CompilerGenerated] private static class <>O { public static GetMoreMissileDamageMultiplier.ControlFlowPrefixSignature <0>__EditICBMDamageMult; public static Manipulator <1>__ChangeGenericICBMEffect; } private const float _initialMult = 3f; private const float _stackMult = 1.5f; [MonoDetourHookInitialize] private static void Setup() { //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Expected O, but got Unknown if (!ConfigOptions.PocketICBM.EnableEdit.Value) { return; } ModLanguage.LangFilesToLoad.Add("PocketICBM"); if (ConfigOptions.PocketICBM.ChangeGenericMissileEffect.Value) { GetMoreMissileDamageMultiplier.ControlFlowPrefix(EditICBMDamageMult); object obj = <>O.<1>__ChangeGenericICBMEffect; if (obj == null) { Manipulator val = ChangeGenericICBMEffect; <>O.<1>__ChangeGenericICBMEffect = val; obj = (object)val; } FireMissile_UnityEngine_Vector3_RoR2_CharacterBody_RoR2_ProcChainMask_UnityEngine_GameObject_System_Single_System_Boolean_UnityEngine_GameObject_RoR2_DamageColorIndex_UnityEngine_Vector3_System_Single_System_Boolean.ILHook((Manipulator)obj); } } private static ReturnFlow EditICBMDamageMult(ref int moreMissileCount, ref float returnValue) { returnValue = GetICBMDamageMult(moreMissileCount); return (ReturnFlow)1; } private static void ChangeGenericICBMEffect(ILManipulationInfo info) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_0070: Unknown result type (might be due to invalid IL or missing references) ILWeaver w = new ILWeaver(info); ILLabel skipToEnd = w.DefineLabel(); w.MatchRelaxed(new Predicate[2] { (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 0), (Instruction x) => ILPatternMatchingExt.MatchBle(x, ref skipToEnd) && w.SetCurrentTo(x) }).ThrowIfFailure().InsertAfterCurrent((IEnumerable)new <>z__ReadOnlySingleElementList(w.Create(OpCodes.Br, (object)skipToEnd))); } public static float GetICBMDamageMultForCharacterBody(CharacterBody characterBody) { int icbmCount = 0; if ((Object)(object)characterBody != (Object)null && (Object)(object)characterBody.inventory != (Object)null) { icbmCount = characterBody.inventory.GetItemCountEffective(Items.MoreMissile); } return GetICBMDamageMult(icbmCount); } public static float GetICBMDamageMult(int icbmCount) { if (icbmCount > 0) { return 3f + 1.5f * (float)(icbmCount - 1); } return 1f; } } [MonoDetourTargets(null)] internal static class WarBonds { [CompilerGenerated] private static class <>O { public static Manipulator <0>__ReplaceMissilesWithDamageMult; } [MonoDetourHookInitialize] private static void Setup() { //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 object obj = <>O.<0>__ReplaceMissilesWithDamageMult; if (obj == null) { Manipulator val = ReplaceMissilesWithDamageMult; <>O.<0>__ReplaceMissilesWithDamageMult = val; obj = (object)val; } Mdh.RoR2.BarrageOnBossBehaviour.FireMissile.ILHook((Manipulator)obj); } private static void ReplaceMissilesWithDamageMult(ILManipulationInfo info) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) ILWeaver w = new ILWeaver(info); w.MatchRelaxed(new Predicate[3] { (Instruction x) => ILPatternMatchingExt.MatchAdd(x), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "Max"), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 3) && w.SetCurrentTo(x) }).ThrowIfFailure().InsertAfterCurrent((IEnumerable)new <>z__ReadOnlyArray((InstructionOrEnumerable[])(object)new InstructionOrEnumerable[5] { InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldloc_2)), InstructionOrEnumerable.op_Implicit(w.CreateDelegateCall>((Func)((int icbmCount) => PocketICBM.GetICBMDamageMult(icbmCount)))), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Stloc_3)), InstructionOrEnumerable.op_Implicit(w.CreateDelegateCall>((Func)(() => 0))), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Stloc_2)) })); } } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { public IgnoresAccessChecksToAttribute(string assemblyName) { } } }