using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using EntityStates; using EntityStates.Cyborg2; using EntityStates.DUT; using EntityStates.Events; using EntityStates.VoidCamp; using HG.Reflection; using HarmonyLib; using IL.RoR2; using LordsItemEdits.ItemEdits.PocketICBMEdit; using MSU; using MSU.Config; using Mdh.EntityStates.DUT.ChargeDamage; using Mdh.EntityStates.Events.Storm; using Mdh.RoR2.HealthComponent; using Mdh.SS2.Components.ChirrFriendController; using Mdh.SS2.Components.ChirrFriendOrb; using Mdh.SS2.Components.ChirrFriendTracker; using Mdh.SS2.Components.CustomEliteDirector; using Mdh.SS2.Components.Empyrean; using Mdh.SS2.EliteEventMissionController; using Mdh.SS2.Equipments.AffixEmpyrean; using Mdh.SS2.Equipments.AffixPurple; using Mdh.SS2.Equipments.AffixSuperEarth; using Mdh.SS2.Equipments.AffixSuperFire; using Mdh.SS2.Equipments.AffixSuperIce; using Mdh.SS2.Equipments.AffixSuperLightning; using Mdh.SS2.EtherealBehavior; using Mdh.SS2.Items.AffixUltra; using Mdh.SS2.Items.ArmedBackpack; using Mdh.SS2.Items.ErraticGadget; using Mdh.SS2.Items.PortableReactor; using Mdh.SS2.Items.ShardGold; using Mdh.SS2.Items.ShardVoid; using Mdh.SS2.TradeController; using Microsoft.CodeAnalysis; using MiscFixes.Modules; using Mono.Cecil; using Mono.Cecil.Cil; using MonoDetour; using MonoDetour.Cil; using MonoDetour.DetourTypes; using MonoDetour.HookGen; using MonoMod.Cil; using On.EntityStates.VoidCamp; using On.RoR2; using On.RoR2.Orbs; using R2API; using R2API.Utils; using RoR2; using RoR2.ContentManagement; using RoR2.ExpansionManagement; using RoR2.Items; using RoR2.Orbs; using RoR2.Skills; using RoR2.UI; using RoR2BepInExPack.GameAssetPaths.Version_1_39_0; using SS2; using SS2.Components; using SS2.Equipments; using SS2.Items; using SS2.Orbs; using SS2.Survivors; using StarstormSquared.Changes.Survivors; using StarstormSquared.Changes.Survivors.DUT; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Networking; using UnityEngine.ResourceManagement.AsyncOperations; using UnityEngine.SceneManagement; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: OptIn] [assembly: IgnoresAccessChecksTo("EnemiesReturns")] [assembly: IgnoresAccessChecksTo("Starstorm2")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("LordVGames.StarstormSquared")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.5.2.0")] [assembly: AssemblyInformationalVersion("1.5.2+dad0a543eb0eaf7a4706d83273a32df0ff21a93e")] [assembly: AssemblyProduct("LordVGames.StarstormSquared")] [assembly: AssemblyTitle("StarstormSquared")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.5.2.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.EntityStates.DUT.ChargeDamage { internal static class FixedUpdate { public delegate void PrefixSignature(ChargeDamage self); public delegate void PostfixSignature(ChargeDamage 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(ChargeDamage).GetMethod("FixedUpdate", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("EntityStates.DUT.ChargeDamage", "FixedUpdate"); } } internal static class OnEnter { public delegate void PrefixSignature(ChargeDamage self); public delegate void PostfixSignature(ChargeDamage 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(ChargeDamage).GetMethod("OnEnter", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("EntityStates.DUT.ChargeDamage", "OnEnter"); } } internal static class SiphonEnemies { public delegate void PrefixSignature(ChargeDamage self); public delegate void PostfixSignature(ChargeDamage 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(ChargeDamage).GetMethod("SiphonEnemies", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("EntityStates.DUT.ChargeDamage", "SiphonEnemies"); } } internal static class SiphonSelf { public delegate void PrefixSignature(ChargeDamage self); public delegate void PostfixSignature(ChargeDamage 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(ChargeDamage).GetMethod("SiphonSelf", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("EntityStates.DUT.ChargeDamage", "SiphonSelf"); } } internal static class Discharge { public delegate void PrefixSignature(ChargeDamage self); public delegate void PostfixSignature(ChargeDamage 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(ChargeDamage).GetMethod("Discharge", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("EntityStates.DUT.ChargeDamage", "Discharge"); } } } namespace Mdh.EntityStates.Cyborg2.Unmaker { internal static class FixedUpdate { public delegate void PrefixSignature(Unmaker self); public delegate void PostfixSignature(Unmaker 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(Unmaker).GetMethod("FixedUpdate", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("EntityStates.Cyborg2.Unmaker", "FixedUpdate"); } } internal static class OnEnter { public delegate void PrefixSignature(Unmaker self); public delegate void PostfixSignature(Unmaker 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(Unmaker).GetMethod("OnEnter", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("EntityStates.Cyborg2.Unmaker", "OnEnter"); } } } namespace Mdh.EntityStates.Events.Storm { internal static class OnBossKilled { internal static class OnKilledServer { public delegate void PrefixSignature(OnBossKilled self, ref DamageReport damageReport); public delegate void PostfixSignature(OnBossKilled 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(OnBossKilled).GetMethod("OnKilledServer", (BindingFlags)(-1), null, new Type[1] { typeof(DamageReport) }, null) ?? throw new MissingMethodException("EntityStates.Events.Storm+OnBossKilled", "OnKilledServer"); } } } internal static class FixedUpdate { public delegate void PrefixSignature(Storm self); public delegate void PostfixSignature(Storm 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(Storm).GetMethod("FixedUpdate", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("EntityStates.Events.Storm", "FixedUpdate"); } } internal static class OnEnter { public delegate void PrefixSignature(Storm self); public delegate void PostfixSignature(Storm 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(Storm).GetMethod("OnEnter", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("EntityStates.Events.Storm", "OnEnter"); } } } 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 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.CharacterBody { internal static class RecalculateStats { public delegate void PrefixSignature(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 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"); } } } namespace Mdh.SS2.TradeController { internal static class Start { public delegate void PrefixSignature(TradeController self); public delegate ReturnFlow ControlFlowPrefixSignature(TradeController self); public delegate void PostfixSignature(TradeController 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(TradeController).GetMethod("Start", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("SS2.TradeController", "Start"); } } internal static class InitPrefabTEMP { 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(TradeController).GetMethod("InitPrefabTEMP", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("SS2.TradeController", "InitPrefabTEMP"); } } } namespace Mdh.SS2.EtherealBehavior { internal static class Start { public delegate void PrefixSignature(EtherealBehavior self); public delegate void PostfixSignature(EtherealBehavior 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(EtherealBehavior).GetMethod("Start", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("SS2.EtherealBehavior", "Start"); } } internal static class SpawnShrine { public delegate void PrefixSignature(EtherealBehavior self); public delegate void PostfixSignature(EtherealBehavior 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(EtherealBehavior).GetMethod("SpawnShrine", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("SS2.EtherealBehavior", "SpawnShrine"); } } 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(EtherealBehavior).GetMethod("Init", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("SS2.EtherealBehavior", "Init"); } } } namespace Mdh.SS2.EliteEventMissionController { internal static class OnEnable { public delegate void PrefixSignature(EliteEventMissionController self); public delegate ReturnFlow ControlFlowPrefixSignature(EliteEventMissionController self); public delegate void PostfixSignature(EliteEventMissionController 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(EliteEventMissionController).GetMethod("OnEnable", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("SS2.EliteEventMissionController", "OnEnable"); } } internal static class OnBossKilledServer { internal static class OnKilledServer { public delegate void PrefixSignature(OnBossKilledServer self, ref DamageReport damageReport); public delegate ReturnFlow ControlFlowPrefixSignature(OnBossKilledServer self, ref DamageReport damageReport); public delegate void PostfixSignature(OnBossKilledServer 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(OnBossKilledServer).GetMethod("OnKilledServer", (BindingFlags)(-1), null, new Type[1] { typeof(DamageReport) }, null) ?? throw new MissingMethodException("SS2.EliteEventMissionController+OnBossKilledServer", "OnKilledServer"); } } } internal static class Start { public delegate void PrefixSignature(EliteEventMissionController self); public delegate ReturnFlow ControlFlowPrefixSignature(EliteEventMissionController self); public delegate void PostfixSignature(EliteEventMissionController 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(EliteEventMissionController).GetMethod("Start", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("SS2.EliteEventMissionController", "Start"); } } internal static class EliteObjectiveTracker { internal static class GenerateString { public delegate void PrefixSignature(EliteObjectiveTracker self); public delegate ReturnFlow ControlFlowPrefixSignature(EliteObjectiveTracker self, ref string returnValue); public delegate void PostfixSignature(EliteObjectiveTracker self, ref string 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(EliteObjectiveTracker).GetMethod("GenerateString", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("SS2.EliteEventMissionController+EliteObjectiveTracker", "GenerateString"); } } } internal static class FixedUpdate { public delegate void PrefixSignature(EliteEventMissionController self); public delegate ReturnFlow ControlFlowPrefixSignature(EliteEventMissionController self); public delegate void PostfixSignature(EliteEventMissionController 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(EliteEventMissionController).GetMethod("FixedUpdate", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("SS2.EliteEventMissionController", "FixedUpdate"); } } internal static class SpawnBoss { public delegate void PrefixSignature(EliteEventMissionController self); public delegate ReturnFlow ControlFlowPrefixSignature(EliteEventMissionController self); public delegate void PostfixSignature(EliteEventMissionController 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(EliteEventMissionController).GetMethod("SpawnBoss", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("SS2.EliteEventMissionController", "SpawnBoss"); } } 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(EliteEventMissionController).GetMethod("Init", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("SS2.EliteEventMissionController", "Init"); } } internal static class StartEvent { public delegate void PrefixSignature(EliteEventMissionController self); public delegate ReturnFlow ControlFlowPrefixSignature(EliteEventMissionController self); public delegate void PostfixSignature(EliteEventMissionController 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(EliteEventMissionController).GetMethod("StartEvent", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("SS2.EliteEventMissionController", "StartEvent"); } } } namespace Mdh.SS2.TeleporterUpgradeController { internal static class OnEnable { public delegate void PrefixSignature(TeleporterUpgradeController self); public delegate void PostfixSignature(TeleporterUpgradeController 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(TeleporterUpgradeController).GetMethod("OnEnable", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("SS2.TeleporterUpgradeController", "OnEnable"); } } internal static class FixedUpdate { public delegate void PrefixSignature(TeleporterUpgradeController self); public delegate void PostfixSignature(TeleporterUpgradeController 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(TeleporterUpgradeController).GetMethod("FixedUpdate", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("SS2.TeleporterUpgradeController", "FixedUpdate"); } } internal static class UpgradeStorm { public delegate void PrefixSignature(TeleporterUpgradeController self, ref bool upgrade); public delegate void PostfixSignature(TeleporterUpgradeController self, ref bool upgrade); 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(TeleporterUpgradeController).GetMethod("UpgradeStorm", (BindingFlags)(-1), null, new Type[1] { typeof(bool) }, null) ?? throw new MissingMethodException("SS2.TeleporterUpgradeController", "UpgradeStorm"); } } 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(TeleporterUpgradeController).GetMethod("Init", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("SS2.TeleporterUpgradeController", "Init"); } } } namespace Mdh.SS2.Items.ErraticGadget { internal static class LightningOrb_OnArrival { public delegate void PrefixSignature(ErraticGadget self, ref orig_OnArrival orig, ref LightningOrb self1); public delegate ReturnFlow ControlFlowPrefixSignature(ErraticGadget self, ref orig_OnArrival orig, ref LightningOrb self1); public delegate void PostfixSignature(ErraticGadget self, ref orig_OnArrival orig, ref LightningOrb self1); 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(ErraticGadget).GetMethod("LightningOrb_OnArrival", (BindingFlags)(-1), null, new Type[2] { typeof(orig_OnArrival), typeof(LightningOrb) }, null) ?? throw new MissingMethodException("SS2.Items.ErraticGadget", "LightningOrb_OnArrival"); } } internal static class LightningStrikeOrb_OnArrival { public delegate void PrefixSignature(ErraticGadget self, ref orig_OnArrival orig, ref LightningStrikeOrb self1); public delegate ReturnFlow ControlFlowPrefixSignature(ErraticGadget self, ref orig_OnArrival orig, ref LightningStrikeOrb self1); public delegate void PostfixSignature(ErraticGadget self, ref orig_OnArrival orig, ref LightningStrikeOrb self1); 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(ErraticGadget).GetMethod("LightningStrikeOrb_OnArrival", (BindingFlags)(-1), null, new Type[2] { typeof(orig_OnArrival), typeof(LightningStrikeOrb) }, null) ?? throw new MissingMethodException("SS2.Items.ErraticGadget", "LightningStrikeOrb_OnArrival"); } } internal static class SimpleLightningStrikeOrb_OnArrival { public delegate void PrefixSignature(ErraticGadget self, ref orig_OnArrival orig, ref SimpleLightningStrikeOrb self1); public delegate ReturnFlow ControlFlowPrefixSignature(ErraticGadget self, ref orig_OnArrival orig, ref SimpleLightningStrikeOrb self1); public delegate void PostfixSignature(ErraticGadget self, ref orig_OnArrival orig, ref SimpleLightningStrikeOrb self1); 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(ErraticGadget).GetMethod("SimpleLightningStrikeOrb_OnArrival", (BindingFlags)(-1), null, new Type[2] { typeof(orig_OnArrival), typeof(SimpleLightningStrikeOrb) }, null) ?? throw new MissingMethodException("SS2.Items.ErraticGadget", "SimpleLightningStrikeOrb_OnArrival"); } } internal static class Behavior { internal static class OnDamageDealtServer { public delegate void PrefixSignature(Behavior self, ref DamageReport report); public delegate ReturnFlow ControlFlowPrefixSignature(Behavior self, ref DamageReport report); public delegate void PostfixSignature(Behavior self, ref DamageReport report); 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(Behavior).GetMethod("OnDamageDealtServer", (BindingFlags)(-1), null, new Type[1] { typeof(DamageReport) }, null) ?? throw new MissingMethodException("SS2.Items.ErraticGadget+Behavior", "OnDamageDealtServer"); } } } internal static class Initialize { public delegate void PrefixSignature(ErraticGadget self); public delegate ReturnFlow ControlFlowPrefixSignature(ErraticGadget self); public delegate void PostfixSignature(ErraticGadget 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(ErraticGadget).GetMethod("Initialize", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("SS2.Items.ErraticGadget", "Initialize"); } } } namespace Mdh.SS2.Items.ArmedBackpack { internal static class Behavior { internal static class OnTakeDamageServer { public delegate void PrefixSignature(Behavior self, ref DamageReport damageReport); public delegate void PostfixSignature(Behavior 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(Behavior).GetMethod("OnTakeDamageServer", (BindingFlags)(-1), null, new Type[1] { typeof(DamageReport) }, null) ?? throw new MissingMethodException("SS2.Items.ArmedBackpack+Behavior", "OnTakeDamageServer"); } } } } namespace Mdh.SS2.Items.PortableReactor { internal static class Behavior { internal static class OnEnable { public delegate void PrefixSignature(Behavior self); public delegate void PostfixSignature(Behavior 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(Behavior).GetMethod("OnEnable", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("SS2.Items.PortableReactor+Behavior", "OnEnable"); } } internal static class OnIncomingDamageServer { public delegate void PrefixSignature(Behavior self, ref DamageInfo damageInfo); public delegate void PostfixSignature(Behavior 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(Behavior).GetMethod("OnIncomingDamageServer", (BindingFlags)(-1), null, new Type[1] { typeof(DamageInfo) }, null) ?? throw new MissingMethodException("SS2.Items.PortableReactor+Behavior", "OnIncomingDamageServer"); } } } internal static class GetStatCoefficients { public delegate void PrefixSignature(PortableReactor self, ref CharacterBody sender, ref StatHookEventArgs args); public delegate void PostfixSignature(PortableReactor self, ref CharacterBody sender, ref StatHookEventArgs args); 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(PortableReactor).GetMethod("GetStatCoefficients", (BindingFlags)(-1), null, new Type[2] { typeof(CharacterBody), typeof(StatHookEventArgs) }, null) ?? throw new MissingMethodException("SS2.Items.PortableReactor", "GetStatCoefficients"); } } internal static class Initialize { public delegate void PrefixSignature(PortableReactor self); public delegate void PostfixSignature(PortableReactor 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(PortableReactor).GetMethod("Initialize", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("SS2.Items.PortableReactor", "Initialize"); } } } namespace Mdh.SS2.Items.ShardVoid { internal static class IsAvailable { public delegate void PrefixSignature(ShardVoid self, ref ContentPack contentPack); public delegate void PostfixSignature(ShardVoid self, ref ContentPack contentPack, 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 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(ShardVoid).GetMethod("IsAvailable", (BindingFlags)(-1), null, new Type[1] { typeof(ContentPack) }, null) ?? throw new MissingMethodException("SS2.Items.ShardVoid", "IsAvailable"); } } internal static class Initialize { public delegate void PrefixSignature(ShardVoid self); public delegate void PostfixSignature(ShardVoid 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(ShardVoid).GetMethod("Initialize", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("SS2.Items.ShardVoid", "Initialize"); } } internal static class SpawnVoidShard { public delegate void PrefixSignature(ShardVoid self, ref orig_OnEnter orig, ref Deactivate self1); public delegate void PostfixSignature(ShardVoid self, ref orig_OnEnter orig, ref Deactivate self1); 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(ShardVoid).GetMethod("SpawnVoidShard", (BindingFlags)(-1), null, new Type[2] { typeof(orig_OnEnter), typeof(Deactivate) }, null) ?? throw new MissingMethodException("SS2.Items.ShardVoid", "SpawnVoidShard"); } } } namespace Mdh.SS2.Items.ShardGold { internal static class IsAvailable { public delegate void PrefixSignature(ShardGold self, ref ContentPack contentPack); public delegate void PostfixSignature(ShardGold self, ref ContentPack contentPack, 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 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(ShardGold).GetMethod("IsAvailable", (BindingFlags)(-1), null, new Type[1] { typeof(ContentPack) }, null) ?? throw new MissingMethodException("SS2.Items.ShardGold", "IsAvailable"); } } internal static class Initialize { public delegate void PrefixSignature(ShardGold self); public delegate void PostfixSignature(ShardGold 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(ShardGold).GetMethod("Initialize", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("SS2.Items.ShardGold", "Initialize"); } } internal static class SpawnGoldShard { public delegate void PrefixSignature(ShardGold self, ref orig_DropRewards orig, ref HalcyoniteShrineInteractable self1); public delegate void PostfixSignature(ShardGold self, ref orig_DropRewards orig, ref HalcyoniteShrineInteractable self1); 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(ShardGold).GetMethod("SpawnGoldShard", (BindingFlags)(-1), null, new Type[2] { typeof(orig_DropRewards), typeof(HalcyoniteShrineInteractable) }, null) ?? throw new MissingMethodException("SS2.Items.ShardGold", "SpawnGoldShard"); } } } namespace Mdh.SS2.Items.AffixUltra { internal static class IsAvailable { public delegate void PrefixSignature(AffixUltra self, ref ContentPack contentPack); public delegate ReturnFlow ControlFlowPrefixSignature(AffixUltra self, ref ContentPack contentPack, ref bool returnValue); public delegate void PostfixSignature(AffixUltra self, ref ContentPack contentPack, 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(AffixUltra).GetMethod("IsAvailable", (BindingFlags)(-1), null, new Type[1] { typeof(ContentPack) }, null) ?? throw new MissingMethodException("SS2.Items.AffixUltra", "IsAvailable"); } } internal static class BodyBehavior { internal static class Start { public delegate void PrefixSignature(BodyBehavior self); public delegate ReturnFlow ControlFlowPrefixSignature(BodyBehavior self); public delegate void PostfixSignature(BodyBehavior 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(BodyBehavior).GetMethod("Start", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("SS2.Items.AffixUltra+BodyBehavior", "Start"); } } } internal static class RecalculateStatsAPI_GetStatCoefficients { public delegate void PrefixSignature(AffixUltra self, ref CharacterBody body, ref StatHookEventArgs args); public delegate ReturnFlow ControlFlowPrefixSignature(AffixUltra self, ref CharacterBody body, ref StatHookEventArgs args); public delegate void PostfixSignature(AffixUltra self, ref CharacterBody body, ref StatHookEventArgs args); 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(AffixUltra).GetMethod("RecalculateStatsAPI_GetStatCoefficients", (BindingFlags)(-1), null, new Type[2] { typeof(CharacterBody), typeof(StatHookEventArgs) }, null) ?? throw new MissingMethodException("SS2.Items.AffixUltra", "RecalculateStatsAPI_GetStatCoefficients"); } } internal static class Initialize { public delegate void PrefixSignature(AffixUltra self); public delegate ReturnFlow ControlFlowPrefixSignature(AffixUltra self); public delegate void PostfixSignature(AffixUltra 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(AffixUltra).GetMethod("Initialize", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("SS2.Items.AffixUltra", "Initialize"); } } } namespace Mdh.SS2.Equipments.AffixSuperEarth { internal static class Behavior { internal static class OnEnable { public delegate void PrefixSignature(Behavior self); public delegate void PostfixSignature(Behavior 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(Behavior).GetMethod("OnEnable", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("SS2.Equipments.AffixSuperEarth+Behavior", "OnEnable"); } } internal static class FixedUpdate { public delegate void PrefixSignature(Behavior self); public delegate void PostfixSignature(Behavior 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(Behavior).GetMethod("FixedUpdate", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("SS2.Equipments.AffixSuperEarth+Behavior", "FixedUpdate"); } } } } namespace Mdh.SS2.Equipments.AffixSuperLightning { internal static class Behavior { internal static class OnEnable { public delegate void PrefixSignature(Behavior self); public delegate void PostfixSignature(Behavior 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(Behavior).GetMethod("OnEnable", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("SS2.Equipments.AffixSuperLightning+Behavior", "OnEnable"); } } internal static class FixedUpdate { public delegate void PrefixSignature(Behavior self); public delegate void PostfixSignature(Behavior 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(Behavior).GetMethod("FixedUpdate", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("SS2.Equipments.AffixSuperLightning+Behavior", "FixedUpdate"); } } } } namespace Mdh.SS2.Equipments.AffixSuperIce { internal static class Behavior { internal static class OnEnable { public delegate void PrefixSignature(Behavior self); public delegate void PostfixSignature(Behavior 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(Behavior).GetMethod("OnEnable", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("SS2.Equipments.AffixSuperIce+Behavior", "OnEnable"); } } internal static class FixedUpdate { public delegate void PrefixSignature(Behavior self); public delegate void PostfixSignature(Behavior 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(Behavior).GetMethod("FixedUpdate", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("SS2.Equipments.AffixSuperIce+Behavior", "FixedUpdate"); } } } } namespace Mdh.SS2.Equipments.AffixSuperFire { internal static class Behavior { internal static class OnEnable { public delegate void PrefixSignature(Behavior self); public delegate void PostfixSignature(Behavior 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(Behavior).GetMethod("OnEnable", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("SS2.Equipments.AffixSuperFire+Behavior", "OnEnable"); } } internal static class FixedUpdate { public delegate void PrefixSignature(Behavior self); public delegate void PostfixSignature(Behavior 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(Behavior).GetMethod("FixedUpdate", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("SS2.Equipments.AffixSuperFire+Behavior", "FixedUpdate"); } } internal static class OnTakeDamageServer { public delegate void PrefixSignature(Behavior self, ref DamageReport damageReport); public delegate void PostfixSignature(Behavior 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(Behavior).GetMethod("OnTakeDamageServer", (BindingFlags)(-1), null, new Type[1] { typeof(DamageReport) }, null) ?? throw new MissingMethodException("SS2.Equipments.AffixSuperFire+Behavior", "OnTakeDamageServer"); } } } } namespace Mdh.SS2.Equipments.AffixPurple { internal static class IsAvailable { public delegate void PrefixSignature(AffixPurple self, ref ContentPack contentPack); public delegate ReturnFlow ControlFlowPrefixSignature(AffixPurple self, ref ContentPack contentPack, ref bool returnValue); public delegate void PostfixSignature(AffixPurple self, ref ContentPack contentPack, 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(AffixPurple).GetMethod("IsAvailable", (BindingFlags)(-1), null, new Type[1] { typeof(ContentPack) }, null) ?? throw new MissingMethodException("SS2.Equipments.AffixPurple", "IsAvailable"); } } internal static class PurplePoisonDebuff { internal static class OnEnable { public delegate void PrefixSignature(PurplePoisonDebuff self); public delegate ReturnFlow ControlFlowPrefixSignature(PurplePoisonDebuff self); public delegate void PostfixSignature(PurplePoisonDebuff 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(PurplePoisonDebuff).GetMethod("OnEnable", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("SS2.Equipments.AffixPurple+PurplePoisonDebuff", "OnEnable"); } } } internal static class AffixPurpleBehavior { internal static class OnEnable { public delegate void PrefixSignature(AffixPurpleBehavior self); public delegate ReturnFlow ControlFlowPrefixSignature(AffixPurpleBehavior self); public delegate void PostfixSignature(AffixPurpleBehavior 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(AffixPurpleBehavior).GetMethod("OnEnable", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("SS2.Equipments.AffixPurple+AffixPurpleBehavior", "OnEnable"); } } internal static class FixedUpdate { public delegate void PrefixSignature(AffixPurpleBehavior self); public delegate ReturnFlow ControlFlowPrefixSignature(AffixPurpleBehavior self); public delegate void PostfixSignature(AffixPurpleBehavior 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(AffixPurpleBehavior).GetMethod("FixedUpdate", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("SS2.Equipments.AffixPurple+AffixPurpleBehavior", "FixedUpdate"); } } } internal static class Initialize { public delegate void PrefixSignature(AffixPurple self); public delegate ReturnFlow ControlFlowPrefixSignature(AffixPurple self); public delegate void PostfixSignature(AffixPurple 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(AffixPurple).GetMethod("Initialize", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("SS2.Equipments.AffixPurple", "Initialize"); } } } namespace Mdh.SS2.Equipments.AffixEmpyrean { internal static class IsAvailable { public delegate void PrefixSignature(AffixEmpyrean self, ref ContentPack contentPack); public delegate ReturnFlow ControlFlowPrefixSignature(AffixEmpyrean self, ref ContentPack contentPack, ref bool returnValue); public delegate void PostfixSignature(AffixEmpyrean self, ref ContentPack contentPack, 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(AffixEmpyrean).GetMethod("IsAvailable", (BindingFlags)(-1), null, new Type[1] { typeof(ContentPack) }, null) ?? throw new MissingMethodException("SS2.Equipments.AffixEmpyrean", "IsAvailable"); } } internal static class RecalculateStatsEmpyreanIL { public delegate void PrefixSignature(AffixEmpyrean self, ref ILContext il); public delegate ReturnFlow ControlFlowPrefixSignature(AffixEmpyrean self, ref ILContext il); public delegate void PostfixSignature(AffixEmpyrean self, ref ILContext il); 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(AffixEmpyrean).GetMethod("RecalculateStatsEmpyreanIL", (BindingFlags)(-1), null, new Type[1] { typeof(ILContext) }, null) ?? throw new MissingMethodException("SS2.Equipments.AffixEmpyrean", "RecalculateStatsEmpyreanIL"); } } internal static class Initialize { public delegate void PrefixSignature(AffixEmpyrean self); public delegate ReturnFlow ControlFlowPrefixSignature(AffixEmpyrean self); public delegate void PostfixSignature(AffixEmpyrean 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(AffixEmpyrean).GetMethod("Initialize", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("SS2.Equipments.AffixEmpyrean", "Initialize"); } } } namespace Mdh.SS2.Components.ChirrFriendOrb { internal static class ConvertBehavior { internal static class OnEnable { public delegate void PrefixSignature(ConvertBehavior self); public delegate void PostfixSignature(ConvertBehavior 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(ConvertBehavior).GetMethod("OnEnable", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("SS2.Components.ChirrFriendOrb+ConvertBehavior", "OnEnable"); } } internal static class FixedUpdate { public delegate void PrefixSignature(ConvertBehavior self); public delegate void PostfixSignature(ConvertBehavior 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(ConvertBehavior).GetMethod("FixedUpdate", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("SS2.Components.ChirrFriendOrb+ConvertBehavior", "FixedUpdate"); } } internal static class OnTakeDamageServer { public delegate void PrefixSignature(ConvertBehavior self, ref DamageReport damageReport); public delegate void PostfixSignature(ConvertBehavior 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(ConvertBehavior).GetMethod("OnTakeDamageServer", (BindingFlags)(-1), null, new Type[1] { typeof(DamageReport) }, null) ?? throw new MissingMethodException("SS2.Components.ChirrFriendOrb+ConvertBehavior", "OnTakeDamageServer"); } } } } namespace Mdh.SS2.Components.ChirrFriendTracker { internal static class OnEnable { public delegate void PrefixSignature(ChirrFriendTracker self); public delegate ReturnFlow ControlFlowPrefixSignature(ChirrFriendTracker self); public delegate void PostfixSignature(ChirrFriendTracker 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(ChirrFriendTracker).GetMethod("OnEnable", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("SS2.Components.ChirrFriendTracker", "OnEnable"); } } internal static class Start { public delegate void PrefixSignature(ChirrFriendTracker self); public delegate ReturnFlow ControlFlowPrefixSignature(ChirrFriendTracker self); public delegate void PostfixSignature(ChirrFriendTracker 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(ChirrFriendTracker).GetMethod("Start", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("SS2.Components.ChirrFriendTracker", "Start"); } } internal static class FixedUpdate { public delegate void PrefixSignature(ChirrFriendTracker self); public delegate ReturnFlow ControlFlowPrefixSignature(ChirrFriendTracker self); public delegate void PostfixSignature(ChirrFriendTracker 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(ChirrFriendTracker).GetMethod("FixedUpdate", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("SS2.Components.ChirrFriendTracker", "FixedUpdate"); } } internal static class CheckBody { public delegate void PrefixSignature(ChirrFriendTracker self, ref CharacterBody body); public delegate ReturnFlow ControlFlowPrefixSignature(ChirrFriendTracker self, ref CharacterBody body, ref bool returnValue); public delegate void PostfixSignature(ChirrFriendTracker self, ref CharacterBody body, 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(ChirrFriendTracker).GetMethod("CheckBody", (BindingFlags)(-1), null, new Type[1] { typeof(CharacterBody) }, null) ?? throw new MissingMethodException("SS2.Components.ChirrFriendTracker", "CheckBody"); } } } namespace Mdh.SS2.Components.ChirrFriendController { internal static class OnEnable { public delegate void PrefixSignature(ChirrFriendController self); public delegate void PostfixSignature(ChirrFriendController 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(ChirrFriendController).GetMethod("OnEnable", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("SS2.Components.ChirrFriendController", "OnEnable"); } } internal static class FixedUpdate { public delegate void PrefixSignature(ChirrFriendController self); public delegate void PostfixSignature(ChirrFriendController 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(ChirrFriendController).GetMethod("FixedUpdate", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("SS2.Components.ChirrFriendController", "FixedUpdate"); } } internal static class ItemFilter { public delegate void PrefixSignature(ChirrFriendController self, ref ItemIndex itemIndex); public delegate void PostfixSignature(ChirrFriendController self, ref ItemIndex itemIndex, 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 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(ChirrFriendController).GetMethod("ItemFilter", (BindingFlags)(-1), null, new Type[1] { typeof(ItemIndex) }, null) ?? throw new MissingMethodException("SS2.Components.ChirrFriendController", "ItemFilter"); } } } namespace Mdh.SS2.Components.Empyrean { internal static class MakeElite { public delegate void PrefixSignature(Empyrean self, ref CharacterBody body); public delegate ReturnFlow ControlFlowPrefixSignature(Empyrean self, ref CharacterBody body); public delegate void PostfixSignature(Empyrean self, ref CharacterBody body); 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(Empyrean).GetMethod("MakeElite", (BindingFlags)(-1), null, new Type[1] { typeof(CharacterBody) }, null) ?? throw new MissingMethodException("SS2.Components.Empyrean", "MakeElite"); } } internal static class IsAvailable { public delegate void PrefixSignature(Empyrean self); public delegate ReturnFlow ControlFlowPrefixSignature(Empyrean self, ref bool returnValue); public delegate void PostfixSignature(Empyrean self, 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(Empyrean).GetMethod("IsAvailable", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("SS2.Components.Empyrean", "IsAvailable"); } } } namespace Mdh.SS2.Components.CustomEliteDirector { internal static class ModifySpawn { public delegate void PrefixSignature(CustomEliteDirector self, ref CombatDirector director, ref SpawnResult spawnResult); public delegate ReturnFlow ControlFlowPrefixSignature(CustomEliteDirector self, ref CombatDirector director, ref SpawnResult spawnResult); public delegate void PostfixSignature(CustomEliteDirector self, ref CombatDirector director, ref SpawnResult spawnResult); 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(CustomEliteDirector).GetMethod("ModifySpawn", (BindingFlags)(-1), null, new Type[2] { typeof(CombatDirector), typeof(SpawnResult) }, null) ?? throw new MissingMethodException("SS2.Components.CustomEliteDirector", "ModifySpawn"); } } internal static class FixedUpdate { public delegate void PrefixSignature(CustomEliteDirector self); public delegate ReturnFlow ControlFlowPrefixSignature(CustomEliteDirector self); public delegate void PostfixSignature(CustomEliteDirector 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(CustomEliteDirector).GetMethod("FixedUpdate", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("SS2.Components.CustomEliteDirector", "FixedUpdate"); } } 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(CustomEliteDirector).GetMethod("Init", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("SS2.Components.CustomEliteDirector", "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 StarstormSquared { public static class ConfigOptions { public static class Chirr { public static ConfigEntry ChirrMinionsNoHealingItems; public static ConfigEntry ChirrNoTamingTerminals; public static ConfigEntry ChirrTameLingerFix; internal static void BindConfigOptions(ConfigFile config) { ChirrMinionsNoHealingItems = Extensions.BindOption(config, "Chirr", "Make tamed enemies not get Chirrs healing items.", "This is so her gameplay of keeping her tamed enemy healthy isn't removed once a few good healing items are required.", true, (ConfigFlags)1); ChirrNoTamingTerminals = Extensions.BindOption(config, "Chirr", "Make enemies from Relic of Termination untamable", "Termination eneimes are insanely strong when tamed by Chirr, this makes them untamable so they're not an almost free win", true, (ConfigFlags)1); ChirrTameLingerFix = Extensions.BindOption(config, "Chirr", "Fix enemies being tamable after debuff expiration", "Enemies can be tamed even after the taming debuff expires, this fixes that.", true, (ConfigFlags)1); } } public static class Knight { public static ConfigEntry AddKnightPassive; internal static void BindConfigOptions(ConfigFile config) { AddKnightPassive = Extensions.BindOption(config, "Knight", "Add his unused passive", "Knight has a (currently) unused passive buff ward for allies that gives some attack speed and movement speed. This implements that.", true, (ConfigFlags)1); } } public static class Events { public static ConfigEntry NewStormEventText; public static ConfigEntry NewSuperEliteSpawnEventText; internal static void BindConfigOptions(ConfigFile config) { NewStormEventText = Extensions.BindOption(config, "Storms", "New storm text", "Replaces the silly placeholder storm event text with new text.", true, (ConfigFlags)1); NewSuperEliteSpawnEventText = Extensions.BindOption(config, "Elite Events", "New super elite spawn text", "Replaces the silly placeholder super elite spawn event text with new text.", true, (ConfigFlags)1); } } public static class Elites { public static class Empyrean { private const string _sectionName = "Empyrean Elites"; public static ConfigEntry RemoveEmpyreanShardDrop; public static ConfigEntry AllowEmpyreanSpawn; public static ConfigEntry AllowEmpyreansInJudgement; public static ConfigEntry CustomEmpyreanLevelUpInterval; internal static void BindConfigOptions(ConfigFile config) { RemoveEmpyreanShardDrop = Extensions.BindOption(config, "Empyrean Elites", "Remove shard drop", "Prevents empyrean elites from dropping a random shard on death.", true, (ConfigFlags)1); AllowEmpyreanSpawn = Extensions.BindOption(config, "Empyrean Elites", "Allow spawning at all", "If they are broken or if you just don't want them to spawn then disable this.", false, (ConfigFlags)0); AllowEmpyreansInJudgement = Extensions.BindOption(config, "Empyrean Elites", "Allow spawning during EnemiesReturns Judgement", "Empyreans can replace the normal aeonian spawns during the 1st Arraign phase, enable this if you still want that.", false, (ConfigFlags)0); CustomEmpyreanLevelUpInterval = Extensions.BindOptionSlider(config, "Empyrean Elites", "Custom Empyrean Level Up Interval", "Empyreans level up and gain doubled stats + a lot of HP every number of stages after the first stage they can appear on, that being stage 9. Change this number to change how many stages it takes for empyreans to level up.", 5, (ConfigFlags)0); } } public static class Ultra { public static ConfigEntry TweakUltraWardBuff; public static ConfigEntry AddHealingToUltraWardBuff; internal static void BindConfigOptions(ConfigFile config) { TweakUltraWardBuff = Extensions.BindOption(config, "Ethereal Related", "Tweak the passive buff from ultra elites", "Makes the passive buff ultra elites give off also apply to the ultra elite itself, along with the passive buff giving a tiny amount of % hp regen to everyone but ultra elites. This basically makes it like more of a super duper mending elite.", true, (ConfigFlags)1); AddHealingToUltraWardBuff = Extensions.BindOption(config, "Ethereal Related", "Add slight healing to passive buff from ultra elites", "The healing added is currently jank and heals way more than it should, if you still want it then enable this setting.", false, (ConfigFlags)1); } } public static class Toxic { private const string _sectionName = "Toxic Elites"; public static ConfigEntry EnableToxicElite; internal static void BindConfigOptions(ConfigFile config) { EnableToxicElite = Extensions.BindOption(config, "Toxic Elites", "Enable elite", "Toxic elites can't be disabled for some reason, so use this if you want to remove them.", true, (ConfigFlags)1); } } private const string _sectionName = "Lategame Elites Overall"; public static ConfigEntry DisallowSelfDamagingEnemies; public static ConfigEntry RemoveEtherealAndUltraRestriction; private static void BindConfigOptions(ConfigFile config) { DisallowSelfDamagingEnemies = Extensions.BindOption(config, "Lategame Elites Overall", "Disallow self-damaging enemies", "Prevents self damaging enemies (namely jellyfish and acid larva) from becoming empyrean, ethereal, or ultra.", true, (ConfigFlags)0); RemoveEtherealAndUltraRestriction = Extensions.BindOption(config, "Lategame Elites Overall", "Remove restriction on ethereal and ultra spawns", "Lets any naturally spawning enemy become ethereal or ultra, even ones that can't become elites normally.", true, (ConfigFlags)1); } internal static void BindAllConfigOptions(ConfigFile config) { BindConfigOptions(config); Empyrean.BindConfigOptions(config); Ultra.BindConfigOptions(config); Toxic.BindConfigOptions(config); } } public static class Ethereal { public static ConfigEntry AddCraftingChefToZanzanStage; public static ConfigEntry SpawnSaplingInSpecialSpots; internal static void BindConfigOptions(ConfigFile config) { AddCraftingChefToZanzanStage = Extensions.BindOption(config, "Ethereal Related", "Add a crafting chef to the strangers hideout", "It is put on top of the roof that Zanzan the faded sits under.", true, (ConfigFlags)0); SpawnSaplingInSpecialSpots = Extensions.BindOption(config, "Ethereal Related", "Make ethereal sapling spawn in stage-specific spots instead of newt altar spots.", "In stages without a pre-determined spot they will still spawn in a newt atltar spot.", false, (ConfigFlags)0); } } public static class Shards { public static ConfigEntry RestoreGoldShardDrop; public static ConfigEntry RestoreVoidShardDrop; public static ConfigEntry RestoreSuperEliteShardDrops; internal static void BindConfigOptions(ConfigFile config) { string text = "Restore Shard Drops"; RestoreGoldShardDrop = Extensions.BindOption(config, text, "Restore gold shard drop", "Gold shards drop from completed halcyon shrines.", true, (ConfigFlags)1); RestoreVoidShardDrop = Extensions.BindOption(config, text, "Restore void shard drop", "Void shards drop from completed void seeds.", true, (ConfigFlags)1); RestoreSuperEliteShardDrops = Extensions.BindOption(config, text, "Restore shard drops from super elites", "Super elites drop shards on death based on the type of super elite they were.", true, (ConfigFlags)1); } } public static class ItemChanges { public enum ErraticGadgetEditType { None, DamageMultAndOnHitProc, OnlyDamageMult } private const string _sectionName = "Item Changes"; public static ConfigEntry ArmedBackpack; public static ConfigEntry ErraticGadget; public static ConfigEntry PortableReactor; internal static void BindConfigOptions(ConfigFile config) { ArmedBackpack = Extensions.BindOption(config, "Item Changes", "Armed Backpack", "Replaces the missile projectile with a missile orb, similar to the ones plasma shrimp uses.", true, (ConfigFlags)0); ErraticGadget = Extensions.BindOption(config, "Item Changes", "Erratic Gadget", "2 Different edits:\n\nDamageMultAndOnHitProc: Doubled lightning damage and chance to do chain lightning on hit. Stacks increase chance and targets hit.\n\nOnlyDamageMult: 3x lightning damage, stacks add to the damage multiplier.\n\nAnd of course a None option for if you don't want either.", ErraticGadgetEditType.DamageMultAndOnHitProc, (ConfigFlags)1); PortableReactor = Extensions.BindOption(config, "Item Changes", "Portable Reactor", "Makes portable reactor give 100 armor instead of invulnerability while active.", true, (ConfigFlags)1); } } public static class Stages { public static class SlateMines { public static ConfigEntry FixPinkWater; internal static void BindConfigOptions(ConfigFile config) { string text = "Slate Mines"; FixPinkWater = Extensions.BindOption(config, text, "Fix Pink Water", "If the water texture in slate mines is pink, enable this to replace it with a water texture from the game.", false, (ConfigFlags)1); } } } internal static void BindAllConfigOptions(ConfigFile config) { Chirr.BindConfigOptions(config); Knight.BindConfigOptions(config); Events.BindConfigOptions(config); Elites.BindAllConfigOptions(config); Ethereal.BindConfigOptions(config); Shards.BindConfigOptions(config); ItemChanges.BindConfigOptions(config); Stages.SlateMines.BindConfigOptions(config); } } internal static class LoadedAssets { private static readonly AssetReferenceT _dlc1AssetReference = new AssetReferenceT(RoR2_DLC1_Common.DLC1_asset); internal static ExpansionDef Dlc1; private static readonly AssetReferenceT _dlc3AssetReference = new AssetReferenceT(RoR2_DLC3.DLC3_asset); internal static ExpansionDef Dlc3; private static readonly AssetReferenceT _craftingChefAssetReference = new AssetReferenceT(RoR2_DLC3_MealPrep.MealPrep_prefab); internal static GameObject CraftingChef; private static readonly AssetReferenceT _stage5TeleWaterMatReference = new AssetReferenceT(RoR2_Base_Teleporters.matLunarTeleporterWater_mat); internal static Material Stage5TeleWaterMat; private static readonly AssetReferenceT _voidGauntletWaterMatReference = new AssetReferenceT(RoR2_DLC1_gauntlets.matVoidGauntletWater_mat); internal static Material VoidGauntletWaterMat; private static readonly AssetReferenceT _awuFeathersMatReference = new AssetReferenceT(RoR2_Base_RoboBallBoss.matSuperRoboBallBossBodyFeathers_mat); internal static Material AwuFeathersMat; private static readonly AssetReferenceT _smLampMatReference = new AssetReferenceT(RoR2_Base_RoboBallBuddy.texTrimSheetAlien1RustyGreenDiffuse_png); internal static Material SmLampMat; private static readonly AssetReferenceT _toolbotDashReference = new AssetReferenceT(RoR2_Base_Toolbot.ToolbotBodyToolbotDash_asset); internal static Sprite ToolbotDashIcon; private static readonly AssetReferenceT _toolbotSwapReference = new AssetReferenceT(RoR2_Base_Toolbot.ToolbotBodySwap_asset); internal static Sprite ToolbotSwapIcon; private static readonly AssetReferenceT _healingDroneSkillDefReference = new AssetReferenceT(RoR2_Base_Drones.Drone2BodyHealingBeam_asset); internal static Sprite HealingDroneSkillIcon; private static readonly AssetReferenceT _bombardmentDroneSkillDefReference = new AssetReferenceT(RoR2_DLC3_Drones.BombardmentDroneRemoteOpSkillDef_asset); internal static Sprite BombardmentDroneSkillIcon; private static readonly AssetReferenceT _voidFiendHealOrbIconReference = new AssetReferenceT(RoR2_DLC1_VoidSurvivor.texVoidSurvivorSkillIcons_png_texVoidSurvivorSkillIcons_3_); internal static Sprite VoidFiendHealOrbIcon; private static readonly AssetReferenceT _voidFiendCorruptSecondaryIconReference = new AssetReferenceT(RoR2_DLC1_VoidSurvivor.texVoidSurvivorSkillIcons_png_texVoidSurvivorSkillIcons_5_); internal static Sprite VoidFiendCorruptSecondaryIcon; private static readonly AssetReferenceT _railgunnerShotIconReference = new AssetReferenceT(RoR2_DLC1_Railgunner.texRailgunnerSkillIcons_png_texRailgunnerSkillIcons_10_); internal static Sprite RailgunnerShotIcon; internal static void LoadAssets() { //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) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: 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_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: 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_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_025f: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_0297: Unknown result type (might be due to invalid IL or missing references) AsyncOperationHandle val = AssetAsyncReferenceManager.LoadAsset(_dlc1AssetReference, (AsyncReferenceHandleUnloadType)2); val.Completed += delegate(AsyncOperationHandle handle) { Dlc1 = handle.Result; }; val = AssetAsyncReferenceManager.LoadAsset(_dlc3AssetReference, (AsyncReferenceHandleUnloadType)2); val.Completed += delegate(AsyncOperationHandle handle) { Dlc3 = handle.Result; }; AsyncOperationHandle val2 = AssetAsyncReferenceManager.LoadAsset(_craftingChefAssetReference, (AsyncReferenceHandleUnloadType)2); val2.Completed += delegate(AsyncOperationHandle handle) { CraftingChef = handle.Result; }; AsyncOperationHandle val3 = AssetAsyncReferenceManager.LoadAsset(_stage5TeleWaterMatReference, (AsyncReferenceHandleUnloadType)2); val3.Completed += delegate(AsyncOperationHandle handle) { Stage5TeleWaterMat = handle.Result; }; val3 = AssetAsyncReferenceManager.LoadAsset(_voidGauntletWaterMatReference, (AsyncReferenceHandleUnloadType)2); val3.Completed += delegate(AsyncOperationHandle handle) { VoidGauntletWaterMat = handle.Result; }; val3 = AssetAsyncReferenceManager.LoadAsset(_awuFeathersMatReference, (AsyncReferenceHandleUnloadType)2); val3.Completed += delegate(AsyncOperationHandle handle) { AwuFeathersMat = handle.Result; }; val3 = AssetAsyncReferenceManager.LoadAsset(_smLampMatReference, (AsyncReferenceHandleUnloadType)2); val3.Completed += delegate(AsyncOperationHandle handle) { SmLampMat = handle.Result; }; AsyncOperationHandle val4 = AssetAsyncReferenceManager.LoadAsset(_toolbotDashReference, (AsyncReferenceHandleUnloadType)2); val4.Completed += delegate(AsyncOperationHandle handle) { ToolbotDashIcon = handle.Result.icon; }; val4 = AssetAsyncReferenceManager.LoadAsset(_toolbotSwapReference, (AsyncReferenceHandleUnloadType)2); val4.Completed += delegate(AsyncOperationHandle handle) { ToolbotSwapIcon = handle.Result.icon; }; val4 = AssetAsyncReferenceManager.LoadAsset(_healingDroneSkillDefReference, (AsyncReferenceHandleUnloadType)2); val4.Completed += delegate(AsyncOperationHandle handle) { HealingDroneSkillIcon = handle.Result.icon; }; val4 = AssetAsyncReferenceManager.LoadAsset(_bombardmentDroneSkillDefReference, (AsyncReferenceHandleUnloadType)2); val4.Completed += delegate(AsyncOperationHandle handle) { BombardmentDroneSkillIcon = handle.Result.icon; }; AsyncOperationHandle val5 = AssetAsyncReferenceManager.LoadAsset(_voidFiendHealOrbIconReference, (AsyncReferenceHandleUnloadType)2); val5.Completed += delegate(AsyncOperationHandle handle) { VoidFiendHealOrbIcon = handle.Result; }; val5 = AssetAsyncReferenceManager.LoadAsset(_voidFiendCorruptSecondaryIconReference, (AsyncReferenceHandleUnloadType)2); val5.Completed += delegate(AsyncOperationHandle handle) { VoidFiendCorruptSecondaryIcon = handle.Result; }; val5 = AssetAsyncReferenceManager.LoadAsset(_railgunnerShotIconReference, (AsyncReferenceHandleUnloadType)2); val5.Completed += delegate(AsyncOperationHandle handle) { RailgunnerShotIcon = handle.Result; }; } } 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 ModSoftDependencies { internal static class LordsItemEditsMod { private static bool? _enabled; internal static bool ModIsRunning { get { bool valueOrDefault = _enabled.GetValueOrDefault(); if (!_enabled.HasValue) { valueOrDefault = Chainloader.PluginInfos.ContainsKey("LordVGames.LordsItemEdits"); _enabled = valueOrDefault; } return _enabled.Value; } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] internal static float GetEditedICBMDamageMult(CharacterBody victimBody) { return PocketICBM.GetICBMDamageMultForCharacterBody(victimBody); } } } internal static class MyAssets { internal static class ShardIcons { public static AssetBundle AssetBundle; public const string BundleName = "ss22_shard_icons"; public static string AssetBundlePath => Path.Combine(Path.GetDirectoryName(Plugin.PluginInfo.Location), "ss22_shard_icons"); internal static void Init() { AssetBundle = AssetBundle.LoadFromFile(AssetBundlePath); } } internal static class SurvivorIcons { public static AssetBundle AssetBundle; public const string BundleName = "ss22_survivor_icons"; public static string AssetBundlePath => Path.Combine(Path.GetDirectoryName(Plugin.PluginInfo.Location), "ss22_survivor_icons"); internal static void Init() { AssetBundle = AssetBundle.LoadFromFile(AssetBundlePath); } } internal static bool Initialized; internal static void Init() { ShardIcons.Init(); SurvivorIcons.Init(); Initialized = true; } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("LordVGames.StarstormSquared", "StarstormSquared", "1.5.2")] public class Plugin : BaseUnityPlugin { public const string Id = "LordVGames.StarstormSquared"; public static PluginInfo PluginInfo { get; private set; } public static string Name => "StarstormSquared"; public static string Version => "1.5.2"; public void Awake() { PluginInfo = ((BaseUnityPlugin)this).Info; Log.Init(((BaseUnityPlugin)this).Logger); ConfigOptions.BindAllConfigOptions(((BaseUnityPlugin)this).Config); MyAssets.Init(); LoadedAssets.LoadAssets(); MonoDetourManager.InvokeHookInitializers(typeof(Plugin).Assembly); RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(SurvivorIcons.ChangeSurvivorIcons)); RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(GiveSkillIcons.GiveDUTSkillIcons)); RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(MakeDriftBuffNotHidden.EditDriftBuff)); } } } namespace StarstormSquared.ConsoleCommands { internal static class Commands { [ConCommand(/*Could not decode attribute arguments.*/)] private static void StartEliteEvent(ConCommandArgs args) { if ((Object)(object)EventDirector.instance == (Object)null) { Log.Error("SS2 event director is null, cannot use command at this time."); return; } string argString = ((ConCommandArgs)(ref args)).GetArgString(0); GameObject val = null; switch (argString) { case "blazing": val = SS2Assets.LoadAsset("BlazingEliteEventController", (SS2Bundle)1); if ((Object)(object)val == (Object)null) { Log.Error("Can't start blazing elite event because the event is null!"); return; } break; case "overloading": val = SS2Assets.LoadAsset("OverloadingEliteEventController", (SS2Bundle)1); if ((Object)(object)val == (Object)null) { Log.Error("Can't start overloading elite event because the event is null!"); return; } break; case "glacial": val = SS2Assets.LoadAsset("GlacialEliteEventController", (SS2Bundle)1); if ((Object)(object)val == (Object)null) { Log.Error("Can't start glacial elite event because the event is null!"); return; } break; case "mending": val = SS2Assets.LoadAsset("MendingEliteEventController", (SS2Bundle)1); if ((Object)(object)Run.instance != (Object)null && !Run.instance.IsExpansionEnabled(LoadedAssets.Dlc1)) { Log.Error("Can't start mending elite event because the Survivors of the Void expansion is not enabled!"); return; } if ((Object)(object)val == (Object)null) { Log.Error("Can't start mending elite event because the event is null!"); return; } break; default: Log.Error("Can't start elite event, an invalid elite type was provided!"); break; } EventDirector.instance.StartEvent(val); } } } namespace StarstormSquared.Changes.Survivors { internal static class SurvivorIcons { internal static bool SetIcons; internal static void ChangeSurvivorIcons() { if (!((ConfiguredVariable)(object)SS2Config.enableBeta).value) { return; } if (!MyAssets.Initialized || (Object)(object)MyAssets.SurvivorIcons.AssetBundle == (Object)null) { Log.Warning("Assets are somehow not initialized yet when trying to apply new survivor icons. Trying to initialize again..."); MyAssets.Init(); ChangeSurvivorIcons(); return; } CharacterBody val = default(CharacterBody); if ((Object)(object)Survivors.survivorKnight == (Object)null || (Object)(object)Survivors.survivorKnight.bodyPrefab == (Object)null || !Survivors.survivorKnight.bodyPrefab.TryGetComponent(ref val) || (Object)(object)val == (Object)null) { Log.Warning("KNIGHT SURVIVOR COULD NOT BE FOUND TO GIVE NEW ICON TO"); } else { val.portraitIcon = MyAssets.SurvivorIcons.AssetBundle.LoadAsset("texIconKnight"); } SurvivorDef val2 = SurvivorCatalog.FindSurvivorDef("survivorCyborg2"); CharacterBody val3 = default(CharacterBody); if ((Object)(object)val2 == (Object)null || (Object)(object)val2.bodyPrefab == (Object)null || !val2.bodyPrefab.TryGetComponent(ref val3) || (Object)(object)val3 == (Object)null) { Log.Warning("CYBORG SURVIVOR COULD NOT BE FOUND TO GIVE NEW ICON TO"); } else { val3.portraitIcon = MyAssets.SurvivorIcons.AssetBundle.LoadAsset("texIconCyborg"); } SetIcons = true; } } } namespace StarstormSquared.Changes.Survivors.DUT { [MonoDetourTargets(typeof(HealthComponent))] internal static class FixDamageModeCharging { [MonoDetourHookInitialize] private static void Setup() { if (((ConfiguredVariable)(object)SS2Config.enableBeta).value) { TakeDamageProcess.Postfix(OnTakeDamage); } } private static void OnTakeDamage(HealthComponent self, ref DamageInfo damageInfo) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: 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_0052: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Expected O, but got Unknown if (DamageAPI.HasModdedDamageType(ref damageInfo.damageType, DUT.DUTDamageType) && !((Object)(object)damageInfo.attacker == (Object)null) && damageInfo.procCoefficient != 0f && ((DamageTypeCombo)(ref damageInfo.damageType)).IsDamageSourceSkillBased) { DUTRedOrb val = new DUTRedOrb { origin = damageInfo.position, target = damageInfo.attacker.gameObject.GetComponent().mainHurtBox }; OrbManager.instance.AddOrb((Orb)(object)val); } } } [MonoDetourTargets(typeof(ChargeDamage))] internal static class GiveAttacksDamageSources { [CompilerGenerated] private static class <>O { public static Manipulator <0>__AddSiphonEnemiesDamageSource; public static Manipulator <1>__AddSiphonSelfDamageSource; public static Manipulator <2>__AddShootDamageSource; } [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 //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Expected O, but got Unknown //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown if (((ConfiguredVariable)(object)SS2Config.enableBeta).value) { object obj = <>O.<0>__AddSiphonEnemiesDamageSource; if (obj == null) { Manipulator val = AddSiphonEnemiesDamageSource; <>O.<0>__AddSiphonEnemiesDamageSource = val; obj = (object)val; } SiphonEnemies.ILHook((Manipulator)obj); object obj2 = <>O.<1>__AddSiphonSelfDamageSource; if (obj2 == null) { Manipulator val2 = AddSiphonSelfDamageSource; <>O.<1>__AddSiphonSelfDamageSource = val2; obj2 = (object)val2; } SiphonSelf.ILHook((Manipulator)obj2); object obj3 = <>O.<2>__AddShootDamageSource; if (obj3 == null) { Manipulator val3 = AddShootDamageSource; <>O.<2>__AddShootDamageSource = val3; obj3 = (object)val3; } Discharge.ILHook((Manipulator)obj3); } } private static void AddSiphonEnemiesDamageSource(ILManipulationInfo info) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_0067: Unknown result type (might be due to invalid IL or missing references) ILWeaver w = new ILWeaver(info); MethodReference val = default(MethodReference); w.MatchRelaxed(new Predicate[2] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, ref val), (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "damageType") && w.SetCurrentTo(x) }).ThrowIfFailure().InsertAfterCurrent((IEnumerable)new <>z__ReadOnlyArray((InstructionOrEnumerable[])(object)new InstructionOrEnumerable[2] { InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Dup)), InstructionOrEnumerable.op_Implicit(w.CreateDelegateCall>((Action)delegate(BlastAttack blastAttack) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) blastAttack.damageType.damageSource = (DamageSource)1; })) })); } private static void AddSiphonSelfDamageSource(ILManipulationInfo info) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) ILWeaver w = new ILWeaver(info); w.MatchRelaxed(new Predicate[1] { (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "damageType") && w.SetCurrentTo(x) }).ThrowIfFailure().InsertAfterCurrent((IEnumerable)new <>z__ReadOnlyArray((InstructionOrEnumerable[])(object)new InstructionOrEnumerable[2] { InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldloc_0)), InstructionOrEnumerable.op_Implicit(w.CreateDelegateCall>((Action)delegate(DamageInfo damageInfo) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) damageInfo.damageType.damageSource = (DamageSource)1; })) })); } private static void AddShootDamageSource(ILManipulationInfo info) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) ILWeaver w = new ILWeaver(info); w.MatchRelaxed(new Predicate[1] { (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "damageType") && w.SetCurrentTo(x) }).ThrowIfFailure().InsertAfterCurrent((IEnumerable)new <>z__ReadOnlyArray((InstructionOrEnumerable[])(object)new InstructionOrEnumerable[2] { InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Dup)), InstructionOrEnumerable.op_Implicit(w.CreateDelegateCall>((Action)delegate(BulletAttack bulletAttack) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) bulletAttack.damageType.damageSource = (DamageSource)1; })) })); } } internal static class GiveSkillIcons { internal static void GiveDUTSkillIcons() { if (((ConfiguredVariable)(object)SS2Config.enableBeta).value) { SurvivorDef val = SurvivorCatalog.FindSurvivorDef("survivorDUT"); CharacterBody val2 = default(CharacterBody); if ((Object)(object)val == (Object)null || (Object)(object)val.bodyPrefab == (Object)null || !val.bodyPrefab.TryGetComponent(ref val2) || (Object)(object)val2 == (Object)null) { Log.Warning("DUT SURVIVOR COULD NOT BE FOUND TO GIVE SKILL ICONS TO"); return; } SkillLocator component = val.bodyPrefab.GetComponent(); component.primary.skillFamily.defaultSkillDef.icon = LoadedAssets.RailgunnerShotIcon; component.utility.skillFamily.defaultSkillDef.icon = LoadedAssets.ToolbotDashIcon; component.special.skillFamily.defaultSkillDef.icon = LoadedAssets.ToolbotSwapIcon; } } } internal static class MakeDriftBuffNotHidden { internal static void EditDriftBuff() { if (((ConfiguredVariable)(object)SS2Config.enableBeta).value && !((Object)(object)Buffs.bdDUTDrift == (Object)null)) { Buffs.bdDUTDrift.iconSprite = LoadedAssets.ToolbotDashIcon; Buffs.bdDUTDrift.isHidden = false; } } } [MonoDetourTargets(null)] internal static class MakePrimaryScaleWithAttackSpeed { [CompilerGenerated] private static class <>O { public static Manipulator <0>__AddAttackSpeedScaling; } [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 (((ConfiguredVariable)(object)SS2Config.enableBeta).value) { object obj = <>O.<0>__AddAttackSpeedScaling; if (obj == null) { Manipulator val = AddAttackSpeedScaling; <>O.<0>__AddAttackSpeedScaling = val; obj = (object)val; } Mdh.EntityStates.DUT.ChargeDamage.FixedUpdate.ILHook((Manipulator)obj); } } private static void AddAttackSpeedScaling(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_000f: Unknown result type (might be due to invalid IL or missing references) mW.InsertAfterCurrent((IEnumerable)new <>z__ReadOnlyArray((InstructionOrEnumerable[])(object)new InstructionOrEnumerable[2] { InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldarg_0)), InstructionOrEnumerable.op_Implicit(w.CreateDelegateCall>((Func)((float baseDuration, ChargeDamage chargeDamage) => baseDuration / chargeDamage.controller.characterBody.attackSpeed))) })); }, new Predicate[1] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "baseDuration") && w.SetCurrentTo(x) }).ThrowIfFailure(); } } } namespace StarstormSquared.Changes.Survivors.Cyborg { [MonoDetourTargets(typeof(Unmaker))] internal static class DefaultPrimaryDamageBuff { [MonoDetourHookInitialize] private static void Setup() { if (((ConfiguredVariable)(object)SS2Config.enableBeta).value) { Unmaker.damageCoefficient = 3.2f; } } } } namespace StarstormSquared.Changes.Survivors.Chirr { [MonoDetourTargets(typeof(ChirrFriendController))] internal static class ChirrMinionNoHealingItems { [CompilerGenerated] private static class <>O { public static Manipulator <0>__FilterHealingItems; } [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.Chirr.ChirrMinionsNoHealingItems.Value) { object obj = <>O.<0>__FilterHealingItems; if (obj == null) { Manipulator val = FilterHealingItems; <>O.<0>__FilterHealingItems = val; obj = (object)val; } ItemFilter.ILHook((Manipulator)obj); } } private static void FilterHealingItems(ILManipulationInfo info) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_00a9: 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_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) ILWeaver w = new ILWeaver(info); ILLabel endIfFalse = w.DefineLabel(); w.MatchRelaxed(new Predicate[4] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 0) && w.SetCurrentTo(x), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 20), (Instruction x) => ILPatternMatchingExt.MatchCallvirt(x, "DoesNotContainTag"), (Instruction x) => ILPatternMatchingExt.MatchBrfalse(x, ref endIfFalse) }).ThrowIfFailure().InsertBeforeCurrent((IEnumerable)new <>z__ReadOnlyArray((Instruction[])(object)new Instruction[4] { w.Create(OpCodes.Ldloc_0), w.Create(OpCodes.Ldc_I4_2), w.Create(OpCodes.Callvirt, (MethodBase)typeof(ItemDef).GetMethod("DoesNotContainTag")), w.Create(OpCodes.Brfalse, (object)endIfFalse) })); } } [MonoDetourTargets(typeof(ChirrFriendTracker), GenerateControlFlowVariants = true)] internal static class ChirrNoTamingTerminals { [MonoDetourHookInitialize] internal static void Setup() { if (ConfigOptions.Chirr.ChirrNoTamingTerminals.Value) { CheckBody.ControlFlowPrefix(DontLetTerminalsBeTamed); } } private static ReturnFlow DontLetTerminalsBeTamed(ChirrFriendTracker self, ref CharacterBody body, ref bool returnValue) { if ((Object)(object)body == (Object)null || (Object)(object)body.inventory == (Object)null) { returnValue = false; return (ReturnFlow)1; } bool flag = body.inventory.GetItemCountPermanent(Items.TerminationHelper) > 0; returnValue = !body.isBoss && !flag; return (ReturnFlow)1; } } [MonoDetourTargets(typeof(ConvertBehavior))] internal static class ChirrTameLingerFixAgain { [CompilerGenerated] private static class <>O { public static Manipulator <0>__DoChirrTameLingerBandaidFix; } [MonoDetourHookInitialize] 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>__DoChirrTameLingerBandaidFix; if (obj == null) { Manipulator val = DoChirrTameLingerBandaidFix; <>O.<0>__DoChirrTameLingerBandaidFix = val; obj = (object)val; } ConvertBehavior.OnTakeDamageServer.ILHook((Manipulator)obj); } private static void DoChirrTameLingerBandaidFix(ILManipulationInfo info) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_00b4: 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) ILWeaver w = new ILWeaver(info); ILLabel returnLabel = w.DefineLabel(); w.MatchRelaxed(new Predicate[4] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 1), (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, "victimBody"), (Instruction x) => ILPatternMatchingExt.MatchCallvirt(x, "get_isPlayerControlled"), (Instruction x) => ILPatternMatchingExt.MatchBrtrue(x, ref returnLabel) && w.SetCurrentTo(x) }).ThrowIfFailure().InsertAfterCurrent((IEnumerable)new <>z__ReadOnlySingleElementList(w.Create(OpCodes.Ldarg_1))) .InsertAfterCurrent((IEnumerable)w.CreateDelegateCall>((Func)((DamageReport damageReport) => (Object)(object)damageReport.victimBody != (Object)null && damageReport.victimBody.HasBuff(Buffs.BuffChirrConvert)))) .InsertAfterCurrent((IEnumerable)new <>z__ReadOnlySingleElementList(w.Create(OpCodes.Brfalse, (object)returnLabel))); } } } namespace StarstormSquared.Changes.Stages.SlateMines { internal static class FixPinkWater { internal static void FixWaterTexture(Transform gameplayObjectsHolder) { if (ConfigOptions.Stages.SlateMines.FixPinkWater.Value) { Transform val = gameplayObjectsHolder.Find("slatemines4.1/slateminesWaterNew"); Renderer val2 = default(Renderer); if (!((Object)(object)val == (Object)null) && ((Component)val).TryGetComponent(ref val2) && (Object)(object)Run.instance != (Object)null) { val2.material = LoadedAssets.VoidGauntletWaterMat; } } } } internal static class RemoveCommandosForScale { internal static void DeleteCommandos(Transform gameplayObjectsHolder) { Transform val = gameplayObjectsHolder.Find("slatemines4"); if ((Object)(object)val == (Object)null) { return; } for (int i = 0; i < val.childCount; i++) { Transform child = val.GetChild(i); if (!((Object)(object)child == (Object)null) && ((Object)child).name.Contains("CommandoMesh")) { Object.Destroy((Object)(object)((Component)child).gameObject); } } } } [MonoDetourTargets(null)] internal static class SlateMinesMain { [MonoDetourHookInitialize] private static void Setup() { SceneManager.sceneLoaded += SceneManager_sceneLoaded; } private static void SceneManager_sceneLoaded(Scene scene, LoadSceneMode loadSceneMode) { //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) Scene activeScene = SceneManager.GetActiveScene(); if (((Scene)(ref activeScene)).name != "ss2_slatemines") { return; } GameObject[] rootGameObjects = ((Scene)(ref scene)).GetRootGameObjects(); foreach (GameObject val in rootGameObjects) { if (((Object)val).name.Contains("GAMEPLAY")) { FixPinkWater.FixWaterTexture(val.transform); RemoveCommandosForScale.DeleteCommandos(val.transform); } } } } } namespace StarstormSquared.Changes.Items { [MonoDetourTargets(typeof(Behavior))] internal static class ArmedBackpack { [CompilerGenerated] private static class <>O { public static Manipulator <0>__ReplaceMissileWithOrb; public static Func <1>__FireMissileOrbIfApplicable; } [MonoDetourHookInitialize] 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>__ReplaceMissileWithOrb; if (obj == null) { Manipulator val = ReplaceMissileWithOrb; <>O.<0>__ReplaceMissileWithOrb = val; obj = (object)val; } Mdh.SS2.Items.ArmedBackpack.Behavior.OnTakeDamageServer.ILHook((Manipulator)obj); } private static void ReplaceMissileWithOrb(ILManipulationInfo info) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) ILWeaver w = new ILWeaver(info); ILLabel val = w.DefineLabel(); w.MatchRelaxed(new Predicate[3] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 2), (Instruction x) => ILPatternMatchingExt.MatchMul(x), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 3) && w.SetCurrentTo(x) }).ThrowIfFailure().InsertAfterCurrent((IEnumerable)new <>z__ReadOnlyArray((Instruction[])(object)new Instruction[4] { w.Create(OpCodes.Ldloc_3), w.Create(OpCodes.Ldarg_1), w.CreateCall((Delegate)new Func(FireMissileOrbIfApplicable)), w.Create(OpCodes.Brtrue, (object)val) })); w.MatchRelaxed(new Predicate[2] { (Instruction x) => ILPatternMatchingExt.MatchCall(x, "RoR2.MissileUtils", "FireMissile") && w.SetCurrentTo(x), (Instruction x) => ILPatternMatchingExt.MatchRet(x) }).ThrowIfFailure().MarkLabelToCurrentNext(val); } private static bool FireMissileOrbIfApplicable(float missileDamage, DamageReport damageReport) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Invalid comparison between Unknown and I4 //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006f: 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_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0091: 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_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Expected O, but got Unknown if (!ConfigOptions.ItemChanges.ArmedBackpack.Value) { return false; } if ((Object)(object)damageReport.victimBody == (Object)null || (Object)(object)damageReport.attackerBody == (Object)null || (int)damageReport.victimTeamIndex != 1) { return false; } MicroMissileOrb val = new MicroMissileOrb { origin = damageReport.victimBody.aimOrigin, damageValue = missileDamage, isCrit = damageReport.damageInfo.crit, teamIndex = damageReport.victimBody.teamComponent.teamIndex, attacker = ((Component)damageReport.victimBody).gameObject, procChainMask = damageReport.damageInfo.procChainMask, procCoefficient = 1f, damageColorIndex = (DamageColorIndex)3, target = damageReport.attackerBody.mainHurtBox }; Inventory inventory = damageReport.victimBody.inventory; if (inventory != null && inventory.GetItemCountEffective(Items.MoreMissile) > 0) { if (ModSoftDependencies.LordsItemEditsMod.ModIsRunning) { ((GenericDamageOrb)val).damageValue = ((GenericDamageOrb)val).damageValue * ModSoftDependencies.LordsItemEditsMod.GetEditedICBMDamageMult(damageReport.victimBody); } else { OrbManager.instance.AddOrb((Orb)(object)val); OrbManager.instance.AddOrb((Orb)(object)val); Util.PlaySound("Play_item_proc_missile_fire", ((Component)damageReport.attackerBody).gameObject); Util.PlaySound("Play_item_proc_missile_fire", ((Component)damageReport.attackerBody).gameObject); } } OrbManager.instance.AddOrb((Orb)(object)val); Util.PlaySound("Play_item_proc_missile_fire", ((Component)damageReport.attackerBody).gameObject); return true; } } [MonoDetourTargets(typeof(ErraticGadget), GenerateControlFlowVariants = true)] internal static class ErraticGadget { [CompilerGenerated] private static class <>O { public static Manipulator <0>__SkipDoublingProc; public static LightningStrikeOrb_OnArrival.ControlFlowPrefixSignature <1>__LightningStrikeOrb_JustMoreDamage; public static SimpleLightningStrikeOrb_OnArrival.ControlFlowPrefixSignature <2>__SimpleLightningStrikeOrb_JustMoreDamage; public static Mdh.SS2.Items.ErraticGadget.Behavior.OnDamageDealtServer.ControlFlowPrefixSignature <3>__ErraticGadget_OnDamageDealtServer; public static Action <4>__JustDealMoreDamage; } [MonoDetourHookInitialize] private static void Setup() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Expected O, but got Unknown switch (ConfigOptions.ItemChanges.ErraticGadget.Value) { case ConfigOptions.ItemChanges.ErraticGadgetEditType.None: break; case ConfigOptions.ItemChanges.ErraticGadgetEditType.DamageMultAndOnHitProc: { object obj2 = <>O.<0>__SkipDoublingProc; if (obj2 == null) { Manipulator val2 = SkipDoublingProc; <>O.<0>__SkipDoublingProc = val2; obj2 = (object)val2; } LightningOrb_OnArrival.ILHook((Manipulator)obj2); LightningStrikeOrb_OnArrival.ControlFlowPrefix(LightningStrikeOrb_JustMoreDamage); SimpleLightningStrikeOrb_OnArrival.ControlFlowPrefix(SimpleLightningStrikeOrb_JustMoreDamage); break; } case ConfigOptions.ItemChanges.ErraticGadgetEditType.OnlyDamageMult: { object obj = <>O.<0>__SkipDoublingProc; if (obj == null) { Manipulator val = SkipDoublingProc; <>O.<0>__SkipDoublingProc = val; obj = (object)val; } LightningOrb_OnArrival.ILHook((Manipulator)obj); LightningStrikeOrb_OnArrival.ControlFlowPrefix(LightningStrikeOrb_JustMoreDamage); SimpleLightningStrikeOrb_OnArrival.ControlFlowPrefix(SimpleLightningStrikeOrb_JustMoreDamage); Mdh.SS2.Items.ErraticGadget.Behavior.OnDamageDealtServer.ControlFlowPrefix(ErraticGadget_OnDamageDealtServer); break; } } } [SystemInitializer(new Type[] { typeof(ItemCatalog) })] private static void ChangeTokens() { if (!((Object)(object)Items.PortableReactor == (Object)null)) { switch (ConfigOptions.ItemChanges.ErraticGadget.Value) { case ConfigOptions.ItemChanges.ErraticGadgetEditType.None: break; case ConfigOptions.ItemChanges.ErraticGadgetEditType.DamageMultAndOnHitProc: Items.ErraticGadget.pickupToken = "SS22_ITEM_ERRATICGADGET_EDIT1_PICKUP"; Items.ErraticGadget.descriptionToken = "SS22_ITEM_ERRATICGADGET_EDIT1_DESC"; break; case ConfigOptions.ItemChanges.ErraticGadgetEditType.OnlyDamageMult: Items.ErraticGadget.pickupToken = "SS22_ITEM_ERRATICGADGET_EDIT2_PICKUP"; Items.ErraticGadget.descriptionToken = "SS22_ITEM_ERRATICGADGET_EDIT2_DESC"; break; } } } private static void SkipDoublingProc(ILManipulationInfo info) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) ILWeaver w = new ILWeaver(info); ILLabel val = w.DefineLabel(); w.MatchRelaxed(new Predicate[2] { (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 0) && w.SetCurrentTo(x), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 0) }).ThrowIfFailure().InsertBeforeCurrentStealLabels((IEnumerable)new <>z__ReadOnlySingleElementList(w.Create(OpCodes.Br, (object)val))); MethodReference val2 = default(MethodReference); w.MatchRelaxed(new Predicate[5] { (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 1), (Instruction x) => ILPatternMatchingExt.MatchSub(x), (Instruction x) => ILPatternMatchingExt.MatchCallvirt(x, ref val2) && w.SetCurrentTo(x), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 1), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 2) }).ThrowIfFailure().InsertAfterCurrent((IEnumerable)new <>z__ReadOnlySingleElementList(w.Create(OpCodes.Ldarg_2))) .MarkLabelToCurrent(val) .InsertAfterCurrent((IEnumerable)new <>z__ReadOnlySingleElementList(w.CreateCall((Delegate)new Action(JustDealMoreDamage)))); } private static void JustDealMoreDamage(LightningOrb lightningOrb) { if (AllowErraticGadgetDamageBuff(lightningOrb.attacker)) { lightningOrb.damageValue *= GetErraticGadgetDamageMult(lightningOrb.attacker); } } private static ReturnFlow SimpleLightningStrikeOrb_JustMoreDamage(ErraticGadget self, ref orig_OnArrival orig, ref SimpleLightningStrikeOrb simpleLightningStrikeOrb) { if (!AllowErraticGadgetDamageBuff(((GenericDamageOrb)simpleLightningStrikeOrb).attacker)) { orig.Invoke(simpleLightningStrikeOrb); return (ReturnFlow)1; } SimpleLightningStrikeOrb obj = simpleLightningStrikeOrb; ((GenericDamageOrb)obj).damageValue = ((GenericDamageOrb)obj).damageValue * GetErraticGadgetDamageMult(((GenericDamageOrb)simpleLightningStrikeOrb).attacker); orig.Invoke(simpleLightningStrikeOrb); return (ReturnFlow)1; } private static ReturnFlow LightningStrikeOrb_JustMoreDamage(ErraticGadget self, ref orig_OnArrival orig, ref LightningStrikeOrb lightningStrikeOrb) { if (!AllowErraticGadgetDamageBuff(((GenericDamageOrb)lightningStrikeOrb).attacker)) { orig.Invoke(lightningStrikeOrb); return (ReturnFlow)1; } LightningStrikeOrb obj = lightningStrikeOrb; ((GenericDamageOrb)obj).damageValue = ((GenericDamageOrb)obj).damageValue * GetErraticGadgetDamageMult(((GenericDamageOrb)lightningStrikeOrb).attacker); orig.Invoke(lightningStrikeOrb); return (ReturnFlow)1; } private static bool AllowErraticGadgetDamageBuff(GameObject attacker) { CharacterBody val = default(CharacterBody); if ((Object)(object)attacker == (Object)null || !attacker.TryGetComponent(ref val) || (Object)(object)val.inventory == (Object)null || val.inventory.GetItemCountEffective(Items.ErraticGadget) < 1) { return false; } return true; } private static float GetErraticGadgetDamageMult(GameObject attacker) { CharacterBody val = default(CharacterBody); if ((Object)(object)attacker == (Object)null || !attacker.TryGetComponent(ref val) || (Object)(object)val.inventory == (Object)null) { return 1f; } int itemCountEffective = val.inventory.GetItemCountEffective(Items.ErraticGadget); if (itemCountEffective < 1) { return 1f; } if (ConfigOptions.ItemChanges.ErraticGadget.Value == ConfigOptions.ItemChanges.ErraticGadgetEditType.DamageMultAndOnHitProc) { return 2f; } if (ConfigOptions.ItemChanges.ErraticGadget.Value == ConfigOptions.ItemChanges.ErraticGadgetEditType.OnlyDamageMult) { return 3f + 1.5f * (float)(itemCountEffective - 1); } return 1f; } private static ReturnFlow ErraticGadget_OnDamageDealtServer(Behavior self, ref DamageReport report) { return (ReturnFlow)1; } } [MonoDetourTargets(typeof(PortableReactor))] internal static class PortableReactor { [CompilerGenerated] private static class <>O { public static GetStatCoefficients.PostfixSignature <0>__AlsoGiveArmorWhenActive; public static Manipulator <1>__RemoveInvulnerability; } [MonoDetourHookInitialize] private static void Setup() { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Expected O, but got Unknown if (ConfigOptions.ItemChanges.PortableReactor.Value) { GetStatCoefficients.Postfix(AlsoGiveArmorWhenActive); object obj = <>O.<1>__RemoveInvulnerability; if (obj == null) { Manipulator val = RemoveInvulnerability; <>O.<1>__RemoveInvulnerability = val; obj = (object)val; } Mdh.SS2.Items.PortableReactor.Behavior.OnIncomingDamageServer.ILHook((Manipulator)obj); } } private static void AlsoGiveArmorWhenActive(PortableReactor self, ref CharacterBody sender, ref StatHookEventArgs args) { if (sender.HasBuff(Buffs.BuffReactor)) { StatHookEventArgs obj = args; obj.armorAdd += 100f; } } private static void RemoveInvulnerability(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 startOfBadLine = null; Instruction endOfBadLine = null; w.MatchRelaxed(new Predicate[3] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 1) && w.SetInstructionTo(ref startOfBadLine, x), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 1), (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "rejected") && w.SetInstructionTo(ref endOfBadLine, x) }).ThrowIfFailure().InsertBranchOver(startOfBadLine, endOfBadLine); } [SystemInitializer(new Type[] { typeof(ItemCatalog) })] private static void ChangeTokens() { if (ConfigOptions.ItemChanges.PortableReactor.Value && !((Object)(object)Items.PortableReactor == (Object)null)) { Items.PortableReactor.pickupToken = "SS22_ITEM_PORTABLEREACTOR_EDIT_PICKUP"; Items.PortableReactor.descriptionToken = "SS22_ITEM_PORTABLEREACTOR_EDIT_DESC"; } } } } namespace StarstormSquared.Changes.Items.Shards { internal static class RestoreShardSpawns { [MonoDetourTargets(typeof(ShardGold))] internal static class RestoreGoldShardDrop { [CompilerGenerated] private static class <>O { public static Mdh.SS2.Items.ShardGold.Initialize.PostfixSignature <0>__AddCommentedOutHook; public static hook_DropRewards <1>__YouWillDropGoldShards; } internal static ShardGold shardGoldInstance; [MonoDetourHookInitialize] internal static void Setup() { if (ConfigOptions.Shards.RestoreGoldShardDrop.Value) { Mdh.SS2.Items.ShardGold.Initialize.Postfix(AddCommentedOutHook); } } private static void AddCommentedOutHook(ShardGold self) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown shardGoldInstance = self; object obj = <>O.<1>__YouWillDropGoldShards; if (obj == null) { hook_DropRewards val = YouWillDropGoldShards; <>O.<1>__YouWillDropGoldShards = val; obj = (object)val; } HalcyoniteShrineInteractable.DropRewards += (hook_DropRewards)obj; } private static void YouWillDropGoldShards(orig_DropRewards orig, HalcyoniteShrineInteractable self) { SpawnGoldShard.Target().Invoke(shardGoldInstance, new object[2] { orig, self }); } } [MonoDetourTargets(typeof(ShardVoid))] internal static class RestoreVoidShardDrop { [CompilerGenerated] private static class <>O { public static Mdh.SS2.Items.ShardVoid.Initialize.PostfixSignature <0>__AddCommentedOutHook; public static hook_OnEnter <1>__YouWillDropVoidShards; } internal static ShardVoid shardVoidInstance; [MonoDetourHookInitialize] internal static void Setup() { if (ConfigOptions.Shards.RestoreVoidShardDrop.Value) { Mdh.SS2.Items.ShardVoid.Initialize.Postfix(AddCommentedOutHook); } } private static void AddCommentedOutHook(ShardVoid self) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown shardVoidInstance = self; object obj = <>O.<1>__YouWillDropVoidShards; if (obj == null) { hook_OnEnter val = YouWillDropVoidShards; <>O.<1>__YouWillDropVoidShards = val; obj = (object)val; } Deactivate.OnEnter += (hook_OnEnter)obj; } private static void YouWillDropVoidShards(orig_OnEnter orig, Deactivate self) { SpawnVoidShard.Target().Invoke(shardVoidInstance, new object[2] { orig, self }); } } } internal static class ShardsIcons { [SystemInitializer(new Type[] { typeof(ItemCatalog) })] internal static void ChangeIcons() { //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: 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_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0173: 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_017d: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: 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_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) if (((ConfiguredVariable)(object)SS2Config.enableBeta).value) { Sprite val = MyAssets.ShardIcons.AssetBundle.LoadAsset("texIconShardScav"); Sprite val2 = MyAssets.ShardIcons.AssetBundle.LoadAsset("texIconShardGold"); Sprite val3 = MyAssets.ShardIcons.AssetBundle.LoadAsset("texIconShardVoid"); Sprite val4 = MyAssets.ShardIcons.AssetBundle.LoadAsset("texIconShardIce"); Sprite val5 = MyAssets.ShardIcons.AssetBundle.LoadAsset("texIconShardFire"); Sprite val6 = MyAssets.ShardIcons.AssetBundle.LoadAsset("texIconShardStorm"); Sprite val7 = MyAssets.ShardIcons.AssetBundle.LoadAsset("texIconShardEarth"); Sprite val8 = MyAssets.ShardIcons.AssetBundle.LoadAsset("texIconShardLightning"); Items.ShardScav.pickupIconSprite = val; PickupIndex val9 = PickupCatalog.FindPickupIndex(Items.ShardScav.itemIndex); ((PickupIndex)(ref val9)).pickupDef.iconSprite = val; Items.ShardGold.pickupIconSprite = val2; val9 = PickupCatalog.FindPickupIndex(Items.ShardGold.itemIndex); ((PickupIndex)(ref val9)).pickupDef.iconSprite = val2; Items.ShardVoid.pickupIconSprite = val3; val9 = PickupCatalog.FindPickupIndex(Items.ShardVoid.itemIndex); ((PickupIndex)(ref val9)).pickupDef.iconSprite = val3; Items.ShardFire.pickupIconSprite = val5; val9 = PickupCatalog.FindPickupIndex(Items.ShardFire.itemIndex); ((PickupIndex)(ref val9)).pickupDef.iconSprite = val5; Items.ShardEarth.pickupIconSprite = val7; val9 = PickupCatalog.FindPickupIndex(Items.ShardEarth.itemIndex); ((PickupIndex)(ref val9)).pickupDef.iconSprite = val7; Items.ShardLightning.pickupIconSprite = val8; val9 = PickupCatalog.FindPickupIndex(Items.ShardLightning.itemIndex); ((PickupIndex)(ref val9)).pickupDef.iconSprite = val8; Items.ShardIce.pickupIconSprite = val4; val9 = PickupCatalog.FindPickupIndex(Items.ShardIce.itemIndex); ((PickupIndex)(ref val9)).pickupDef.iconSprite = val4; if ((Object)(object)Items.ShardStorm != (Object)null) { Items.ShardStorm.pickupIconSprite = val6; val9 = PickupCatalog.FindPickupIndex(Items.ShardStorm.itemIndex); ((PickupIndex)(ref val9)).pickupDef.iconSprite = val6; } } } } } namespace StarstormSquared.Changes.Events { [MonoDetourTargets(null)] internal static class ChangeEliteEventObjectiveText { [MonoDetourHookInitialize] private static void Setup() { EliteObjectiveTracker.GenerateString.ControlFlowPrefix(ReturnNewString); } private static ReturnFlow ReturnNewString(EliteObjectiveTracker self, ref string returnValue) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown EliteEventMissionController val = (EliteEventMissionController)((ObjectiveTracker)self).sourceDescriptor.source; returnValue = Language.GetStringFormatted("SS22_ELITE_EVENT_OBJECTIVE", new object[1] { (float)val.currentEliteKills / (float)val.requiredEliteKills * 100f }); return (ReturnFlow)1; } } [MonoDetourTargets(typeof(Storm))] internal static class FixStormTPEffectsNotGoingAway { [CompilerGenerated] private static class <>O { public static Manipulator <0>__RemoveStormEffects; } [MonoDetourHookInitialize] 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>__RemoveStormEffects; if (obj == null) { Manipulator val = RemoveStormEffects; <>O.<0>__RemoveStormEffects = val; obj = (object)val; } Mdh.EntityStates.Events.Storm.FixedUpdate.ILHook((Manipulator)obj); } private static void RemoveStormEffects(ILManipulationInfo info) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_00af: Unknown result type (might be due to invalid IL or missing references) ILWeaver w = new ILWeaver(info); w.DefineLabel(); MethodReference val = default(MethodReference); w.MatchRelaxed(new Predicate[4] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, "outer"), (Instruction x) => ILPatternMatchingExt.MatchNewobj(x, ref val), (Instruction x) => ILPatternMatchingExt.MatchCallvirt(x, "SetNextState") && w.SetCurrentTo(x) }).ThrowIfFailure().InsertAfterCurrent((IEnumerable)new <>z__ReadOnlySingleElementList(w.Create(OpCodes.Ldsfld, AccessTools.DeclaredField(typeof(TeleporterUpgradeController), "instance")))) .InsertAfterCurrent((IEnumerable)w.CreateDelegateCall>((Action)delegate(TeleporterUpgradeController teleporterUpgradeController) { if (Object.op_Implicit((Object)(object)teleporterUpgradeController)) { teleporterUpgradeController.UpgradeStorm(false); } })); } } [MonoDetourTargets(typeof(Storm))] internal static class NewStormEventText { [CompilerGenerated] private static class <>O { public static Manipulator <0>__ChangeStormEventText; public static Manipulator <1>__ChangeStormEventEndText; public static Func <2>__GetCorrectStormTextToken; } [MonoDetourHookInitialize] internal static void Setup() { //IL_0029: 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) //IL_0034: Expected O, but got Unknown //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Expected O, but got Unknown if (ConfigOptions.Events.NewStormEventText.Value && ((ConfiguredVariable)(object)Storm.ReworkedStorm).value) { object obj = <>O.<0>__ChangeStormEventText; if (obj == null) { Manipulator val = ChangeStormEventText; <>O.<0>__ChangeStormEventText = val; obj = (object)val; } Mdh.EntityStates.Events.Storm.OnEnter.ILHook((Manipulator)obj); object obj2 = <>O.<1>__ChangeStormEventEndText; if (obj2 == null) { Manipulator val2 = ChangeStormEventEndText; <>O.<1>__ChangeStormEventEndText = val2; obj2 = (object)val2; } Mdh.EntityStates.Events.Storm.FixedUpdate.ILHook((Manipulator)obj2); } } private static void ChangeStormEventText(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, 1), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 2) && w.SetCurrentTo(x) }).ThrowIfFailure().InsertAfterCurrent((IEnumerable)new <>z__ReadOnlyArray((Instruction[])(object)new Instruction[4] { w.Create(OpCodes.Ldarg_0), w.Create(OpCodes.Ldloc_2), w.CreateCall((Delegate)new Func(GetCorrectStormTextToken)), w.Create(OpCodes.Stloc_2) })); } private static EventTextRequest GetCorrectStormTextToken(Storm storm, EventTextRequest eventTextRequest) { //IL_0068: Unknown result type (might be due to invalid IL or missing references) eventTextRequest.eventToken = storm.stormLevel switch { 1 => "SS2_EVENT_THUNDERSTORM_START", 2 => "SS22_STORM_LEVEL_2", 3 => "SS22_STORM_LEVEL_3", 4 => "SS22_STORM_LEVEL_4", _ => Language.GetStringFormatted("SS22_STORM_LEVEL_OTHER", new object[1] { storm.stormLevel }), }; return eventTextRequest; } private static void ChangeStormEventEndText(ILManipulationInfo info) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown ILWeaver w = new ILWeaver(info); w.MatchRelaxed(new Predicate[1] { (Instruction x) => ILPatternMatchingExt.MatchLdstr(x, "ermmmm..... bye storm") && w.SetCurrentTo(x) }).ThrowIfFailure().ReplaceCurrentOperand((object)"SS2_EVENT_THUNDERSTORM_END"); } } [MonoDetourTargets(typeof(EliteEventMissionController), GenerateControlFlowVariants = true)] internal static class NewSuperEliteSpawnEventText { [CompilerGenerated] private static class <>O { public static Manipulator <0>__ChangeSuperEliteSpawnText; } [MonoDetourHookInitialize] internal static void Setup() { //IL_0029: 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) //IL_0034: Expected O, but got Unknown if (ConfigOptions.Events.NewSuperEliteSpawnEventText.Value && ((ConfiguredVariable)(object)SS2Config.enableBeta).value) { object obj = <>O.<0>__ChangeSuperEliteSpawnText; if (obj == null) { Manipulator val = ChangeSuperEliteSpawnText; <>O.<0>__ChangeSuperEliteSpawnText = val; obj = (object)val; } SpawnBoss.ILHook((Manipulator)obj); } } private static void ChangeSuperEliteSpawnText(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) ILWeaver w = new ILWeaver(info); w.MatchRelaxed(new Predicate[2] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 2), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 1) && w.SetCurrentTo(x) }).ThrowIfFailure().InsertAfterCurrent((IEnumerable)new <>z__ReadOnlyArray((Instruction[])(object)new Instruction[2] { w.Create(OpCodes.Ldloc_1), w.Create(OpCodes.Stloc_1) })) .InsertBeforeCurrent((IEnumerable)w.CreateDelegateCall>((Func)delegate(EventTextRequest eventTextRequest) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) eventTextRequest.eventToken = "SS22_SUPER_ELITE_SPAWN"; return eventTextRequest; })); } } } namespace StarstormSquared.Changes.EtherealStuff { [MonoDetourTargets(typeof(TeleporterUpgradeController))] internal static class AddCraftingChefToStrangersHideout { [MonoDetourHookInitialize] private static void Setup() { SceneDirector.onPostPopulateSceneServer += OnPostPopulateSceneServer; } private static void OnPostPopulateSceneServer(SceneDirector sceneDirector) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0058: 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) if (Run.instance.IsExpansionEnabled(LoadedAssets.Dlc3) && ConfigOptions.Ethereal.AddCraftingChefToZanzanStage.Value && !((Object)(object)LoadedAssets.CraftingChef == (Object)null)) { Scene activeScene = SceneManager.GetActiveScene(); if (!(((Scene)(ref activeScene)).name != "ss2_voidshop")) { NetworkServer.Spawn(Object.Instantiate(LoadedAssets.CraftingChef, new Vector3(-22.3698f, -0.453f, 70.9284f), Quaternion.Euler(353.67f, 80f, 0f))); } } } } [MonoDetourTargets(typeof(EtherealBehavior))] internal static class ConfigSaplingReplacingNewtAltars { [MonoDetourHookInitialize] private static void Setup() { if (((ConfiguredVariable)(object)SS2Config.enableBeta).value) { SpawnShrine.Prefix(ChangeBasedOnConfig); } } private static void ChangeBasedOnConfig(EtherealBehavior self) { EtherealBehavior.alwaysReplaceNewts = !ConfigOptions.Ethereal.SpawnSaplingInSpecialSpots.Value; } } [MonoDetourTargets(typeof(TradeController), GenerateControlFlowVariants = true)] internal static class ShardTradeDropFix { [MonoDetourHookInitialize] internal static void Setup() { if (((ConfiguredVariable)(object)SS2Config.enableBeta).value) { InitPrefabTEMP.ControlFlowPrefix(JustUseTheNormalPotential); } } private static ReturnFlow JustUseTheNormalPotential() { //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) TradeController.pickupPrefablol = Addressables.LoadAssetAsync((object)"RoR2/DLC1/OptionPickup/OptionPickup.prefab").WaitForCompletion(); return (ReturnFlow)1; } } } namespace StarstormSquared.Changes.Elites { [MonoDetourTargets(typeof(CustomEliteDirector), GenerateControlFlowVariants = true)] internal static class AllowAndDisallowCertainEnemiesLategame { [CompilerGenerated] private static class <>O { public static Manipulator <0>__CustomEliteDirector_ModifySpawn; } [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>__CustomEliteDirector_ModifySpawn; if (obj == null) { Manipulator val = CustomEliteDirector_ModifySpawn; <>O.<0>__CustomEliteDirector_ModifySpawn = val; obj = (object)val; } ModifySpawn.ILHook((Manipulator)obj); } private static void CustomEliteDirector_ModifySpawn(ILManipulationInfo info) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Unknown result type (might be due to invalid IL or missing references) ILWeaver w = new ILWeaver(info); ILLabel continueCodeLocation = null; Instruction startOfSkip = null; Instruction endOfSkip = null; FieldReference val2 = default(FieldReference); FieldReference val = default(FieldReference); w.MatchRelaxed(new Predicate[6] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 2) && w.SetInstructionTo(ref startOfSkip, x), (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, ref val2), (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, ref val), (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, "eliteRules"), (Instruction x) => ILPatternMatchingExt.MatchBrfalse(x, ref continueCodeLocation), (Instruction x) => ILPatternMatchingExt.MatchRet(x) && w.SetInstructionTo(ref endOfSkip, x) && w.SetCurrentTo(x) }).ThrowIfFailure(); if (ConfigOptions.Elites.RemoveEtherealAndUltraRestriction.Value) { w.InsertBranchOver(startOfSkip, endOfSkip); } w.InsertAfterCurrent((IEnumerable)new <>z__ReadOnlyArray((InstructionOrEnumerable[])(object)new InstructionOrEnumerable[4] { InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldloc_1)), InstructionOrEnumerable.op_Implicit(w.CreateDelegateCall>((Func)((CharacterBody body) => ((!((Object)(object)body == (Object)(object)BodyPrefabs.JellyfishBody) && !((Object)(object)body == (Object)(object)BodyPrefabs.AcidLarvaBody)) || !ConfigOptions.Elites.DisallowSelfDamagingEnemies.Value) ? true : false))), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Brtrue, (object)continueCodeLocation)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ret)) })); ILLabel goToNextAffix = null; w.MatchRelaxed(new Predicate[3] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 8), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "IsAvailable"), (Instruction x) => ILPatternMatchingExt.MatchBrfalse(x, ref goToNextAffix) && w.SetCurrentTo(x) }).ThrowIfFailure().InsertAfterCurrent((IEnumerable)new <>z__ReadOnlyArray((InstructionOrEnumerable[])(object)new InstructionOrEnumerable[4] { InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldloc, 8)), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Ldarg_2)), InstructionOrEnumerable.op_Implicit(w.CreateDelegateCall>((Func)((StackableAffix stackableAffix, SpawnResult spawnResult) => (!(((object)stackableAffix).GetType().Name == "Empyrean") || (int)spawnResult.spawnRequest.spawnCard.eliteRules == 0) ? true : false))), InstructionOrEnumerable.op_Implicit(w.Create(OpCodes.Brfalse, (object)goToNextAffix)) })); } } } namespace StarstormSquared.Changes.Elites.Ultra { [MonoDetourTargets(typeof(AffixUltra), GenerateControlFlowVariants = true)] internal static class AddUltraEliteSubtitle { [MonoDetourHookInitialize] internal static void Setup() { if (((ConfiguredVariable)(object)SS2Config.enableBeta).value) { BodyBehavior.Start.Postfix(AddSS1Subtitle); } } private static void AddSS1Subtitle(BodyBehavior self) { CharacterBody body = ((BaseItemBodyBehavior)self).body; if (body != null) { body.subtitleNameToken = "SS22_ULTRA_SUBTITLE_SS1"; } } } [MonoDetourTargets(typeof(AffixUltra), GenerateControlFlowVariants = true)] internal static class UltraWardBuffTweak { [MonoDetourHookInitialize] internal static void Setup() { if (ConfigOptions.Elites.Ultra.TweakUltraWardBuff.Value && ((ConfiguredVariable)(object)SS2Config.enableBeta).value) { RecalculateStatsAPI_GetStatCoefficients.ControlFlowPrefix(DoTweakedUltraWardEffect); } } private static ReturnFlow DoTweakedUltraWardEffect(AffixUltra self, ref CharacterBody body, ref StatHookEventArgs args) { if (body.HasBuff(Buffs.bdUltra)) { StatHookEventArgs obj = args; obj.attackSpeedReductionMultAdd += 0.25f; } if (body.HasBuff(Buffs.bdUltraBuff)) { StatHookEventArgs obj2 = args; obj2.moveSpeedMultAdd += 0.2f; StatHookEventArgs obj3 = args; obj3.damageMultAdd += 0.1f; if (!body.HasBuff(Buffs.bdUltra) && ConfigOptions.Elites.Ultra.AddHealingToUltraWardBuff.Value) { StatHookEventArgs obj4 = args; float baseRegenAdd = obj4.baseRegenAdd; CharacterBody obj5 = body; float num2 = (obj5.maxHealth *= 0.025f); obj4.baseRegenAdd = baseRegenAdd + num2; } } return (ReturnFlow)1; } } } namespace StarstormSquared.Changes.Elites.Toxic { [MonoDetourTargets(typeof(AffixPurple), GenerateControlFlowVariants = true)] internal static class ToxicEliteToggle { [MonoDetourHookInitialize] internal static void Setup() { Mdh.SS2.Equipments.AffixPurple.IsAvailable.ControlFlowPrefix(ShouldWeOrNot); } private static ReturnFlow ShouldWeOrNot(AffixPurple self, ref ContentPack contentPack, ref bool returnValue) { returnValue = ((ConfiguredVariable)(object)SS2Config.enableBeta).value && ConfigOptions.Elites.Toxic.EnableToxicElite.Value; return (ReturnFlow)1; } } } namespace StarstormSquared.Changes.Elites.SuperElites { internal static class AddSuperEliteSubtitles { [MonoDetourTargets(typeof(Behavior))] private static class SuperFireSubtitle { [MonoDetourHookInitialize] internal static void Setup() { if (((ConfiguredVariable)(object)SS2Config.enableBeta).value) { Mdh.SS2.Equipments.AffixSuperFire.Behavior.OnEnable.Postfix(AddSubtitle); } } private static void AddSubtitle(Behavior self) { ((BaseBuffBehaviour)self).characterBody.subtitleNameToken = "SS2_EQUIP_AFFIXSUPERFIRE_SUBTITLE"; } } [MonoDetourTargets(typeof(Behavior))] private static class SuperIceSubtitle { [MonoDetourHookInitialize] internal static void Setup() { if (((ConfiguredVariable)(object)SS2Config.enableBeta).value) { Mdh.SS2.Equipments.AffixSuperIce.Behavior.OnEnable.Postfix(AddSubtitle); } } private static void AddSubtitle(Behavior self) { ((BaseBuffBehaviour)self).characterBody.subtitleNameToken = "SS2_EQUIP_AFFIXSUPERICE_SUBTITLE"; } } [MonoDetourTargets(typeof(Behavior))] private static class SuperLightningSubtitle { [MonoDetourHookInitialize] internal static void Setup() { if (((ConfiguredVariable)(object)SS2Config.enableBeta).value) { Mdh.SS2.Equipments.AffixSuperLightning.Behavior.OnEnable.Postfix(AddSubtitle); } } private static void AddSubtitle(Behavior self) { ((BaseBuffBehaviour)self).characterBody.subtitleNameToken = "SS2_EQUIP_AFFIXSUPERLIGHTNING_SUBTITLE"; } } [MonoDetourTargets(typeof(Behavior))] private static class SuperEarthSubtitle { [MonoDetourHookInitialize] internal static void Setup() { if (((ConfiguredVariable)(object)SS2Config.enableBeta).value) { Mdh.SS2.Equipments.AffixSuperEarth.Behavior.OnEnable.Postfix(AddSubtitle); } } private static void AddSubtitle(Behavior self) { ((BaseBuffBehaviour)self).characterBody.subtitleNameToken = "SS2_EQUIP_AFFIXSUPEREARTH_SUBTITLE"; } } } [MonoDetourTargets(null)] internal static class DropShardBasedOnEliteType { [CompilerGenerated] private static class <>O { public static Manipulator <0>__SkipOverShardDrop; } [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>__SkipOverShardDrop; if (obj == null) { Manipulator val = SkipOverShardDrop; <>O.<0>__SkipOverShardDrop = val; obj = (object)val; } OnBossKilledServer.OnKilledServer.ILHook((Manipulator)obj); } private static void SkipOverShardDrop(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 val2 = default(MethodReference); MethodReference val = default(MethodReference); w.MatchRelaxed(new Predicate[4] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "SS2.SS2Content/Items", "ShardStorm") && w.SetInstructionTo(ref startOfSkip, x) && w.SetCurrentTo(x), (Instruction x) => ILPatternMatchingExt.MatchCallvirt(x, ref val2), (Instruction x) => ILPatternMatchingExt.MatchCall(x, ref val), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 3) && w.SetInstructionTo(ref endOfSkip, x) }).ThrowIfFailure().InsertBranchOver(startOfSkip, endOfSkip); } } } namespace StarstormSquared.Changes.Elites.Empyrean { [MonoDetourTargets(typeof(Empyrean), GenerateControlFlowVariants = true)] internal static class CustomEmpyreanLevelUpInterval { [CompilerGenerated] private static class <>O { public static Manipulator <0>__MakeLevelUpIntervalConfigurable; } [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>__MakeLevelUpIntervalConfigurable; if (obj == null) { Manipulator val = MakeLevelUpIntervalConfigurable; <>O.<0>__MakeLevelUpIntervalConfigurable = val; obj = (object)val; } MakeElite.ILHook((Manipulator)obj); } private static void MakeLevelUpIntervalConfigurable(ILManipulationInfo info) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown ILWeaver w = new ILWeaver(info); MethodReference val = default(MethodReference); w.MatchRelaxed(new Predicate[6] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 1), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 5) && w.SetCurrentTo(x), (Instruction x) => ILPatternMatchingExt.MatchDiv(x), (Instruction x) => ILPatternMatchingExt.MatchConvR4(x), (Instruction x) => ILPatternMatchingExt.MatchCall(x, ref val), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 2) }).ThrowIfFailure().InsertAfterCurrent((IEnumerable)w.CreateDelegateCall>((Func)((int oldValue) => ConfigOptions.Elites.Empyrean.CustomEmpyreanLevelUpInterval.Value))); } } [MonoDetourTargets(null)] internal static class EmpyreanSpawnRestrictions { [MonoDetourHookInitialize] internal static void Setup() { Mdh.SS2.Components.Empyrean.IsAvailable.ControlFlowPrefix(ActuallyAvailableOrNo); } private static ReturnFlow ActuallyAvailableOrNo(Empyrean self, ref bool returnValue) { //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) if (!ConfigOptions.Elites.Empyrean.AllowEmpyreanSpawn.Value) { returnValue = false; } else { if (ConfigOptions.Elites.Empyrean.AllowEmpyreansInJudgement.Value) { return (ReturnFlow)0; } Scene activeScene = SceneManager.GetActiveScene(); string name = ((Scene)(ref activeScene)).name; returnValue = Run.instance.stageClearCount > 7 && name != "enemiesreturns_outoftime"; } return (ReturnFlow)1; } } [MonoDetourTargets(typeof(AffixEmpyrean), GenerateControlFlowVariants = true)] [MonoDetourTargets(typeof(CharacterBody), Members = new string[] { "RecalculateStats" })] internal static class FixHPHook { [CompilerGenerated] private static class <>O { public static Manipulator <0>__RecalcStats; public static RecalculateStatsEmpyreanIL.ControlFlowPrefixSignature <1>__DoingItALilDifferent; } private const int _overloadingHpILNumber = 95; [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>__RecalcStats; if (obj == null) { Manipulator val = RecalcStats; <>O.<0>__RecalcStats = val; obj = (object)val; } CharacterBody.RecalculateStats += (Manipulator)obj; RecalculateStatsEmpyreanIL.ControlFlowPrefix(DoingItALilDifferent); } internal static void RecalcStats(ILContext il) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); float num2 = default(float); int num = default(int); if (val.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, typeof(Buffs), "AffixBlue"), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "HasBuff") }) && val.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, (MethodBase)Reflection.GetPropertyGetter(typeof(CharacterBody), "maxHealth")), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, ref num2) }) && val.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref num) })) { val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)((float defaultPercentage, CharacterBody body) => body.HasBuff(Buffs.bdEmpyrean) ? (body.maxHealth * 0.1f) : defaultPercentage)); } else { Log.Error("Failed to find IL match for Empyrean hook 1!"); } if (val.TryGotoNext((MoveType)2, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "set_maxHealth") }) && val.TryGotoNext((MoveType)2, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "get_maxHealth") })) { val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)((float defaultAmount, CharacterBody body) => body.HasBuff(Buffs.bdEmpyrean) ? (defaultAmount * 0.111f) : defaultAmount)); } else { Log.Error("Failed to find IL match for Empyrean hook 2!"); } } private static ReturnFlow DoingItALilDifferent(AffixEmpyrean self, ref ILContext il) { return (ReturnFlow)1; } } [MonoDetourTargets(typeof(Empyrean), GenerateControlFlowVariants = true)] internal static class RemoveEmpyreanShardDrop { [CompilerGenerated] private static class <>O { public static Manipulator <0>__SkipEmpyreanShardDrop; } [MonoDetourHookInitialize] internal static void Setup() { //IL_0029: 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) //IL_0034: Expected O, but got Unknown if (ConfigOptions.Elites.Empyrean.RemoveEmpyreanShardDrop.Value && ((ConfiguredVariable)(object)SS2Config.enableBeta).value) { object obj = <>O.<0>__SkipEmpyreanShardDrop; if (obj == null) { Manipulator val = SkipEmpyreanShardDrop; <>O.<0>__SkipEmpyreanShardDrop = val; obj = (object)val; } MakeElite.ILHook((Manipulator)obj); } } private static void SkipEmpyreanShardDrop(ILManipulationInfo info) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_008d: Unknown result type (might be due to invalid IL or missing references) ILWeaver w = new ILWeaver(info); ILLabel val = w.DefineLabel(); w.MatchRelaxed(new Predicate[3] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 1) && w.SetCurrentTo(x), (Instruction x) => ILPatternMatchingExt.MatchCallvirt(x, "get_gameObject"), (Instruction x) => ILPatternMatchingExt.MatchCallvirt(x, "AddComponent") }).ThrowIfFailure().InsertBeforeCurrent((IEnumerable)new <>z__ReadOnlySingleElementList(w.Create(OpCodes.Br, (object)val))); w.MatchRelaxed(new Predicate[3] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 1) && w.SetCurrentTo(x), (Instruction x) => ILPatternMatchingExt.MatchLdloca(x, 4), (Instruction x) => ILPatternMatchingExt.MatchCallvirt(x, "TryGetComponent") }).ThrowIfFailure().MarkLabelToCurrent(val); } } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { public IgnoresAccessChecksToAttribute(string assemblyName) { } } }