using System; using System.CodeDom.Compiler; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Cryptography; using System.Security.Permissions; using System.Text; using System.Threading; using Architect.Api; using Architect.Editor; using Architect.Events.Blocks; using Architect.Placements; using Architect.Storage; using BepInEx; using GlobalEnums; using HutongGames.PlayMaker; using HutongGames.PlayMaker.Actions; using Md.GameManager; using Md.HeroController; using Md.HutongGames.PlayMaker.Fsm; using Md.Lever; using Md.Lever_tk2d; using Md.PlayMakerFSM; using Md.PlayerData; using Md.ShopItem; using Md.SilkSpool; using Microsoft.CodeAnalysis; using Mono.Cecil.Cil; using MonoDetour; using MonoDetour.Cil; using MonoDetour.DetourTypes; using MonoDetour.HookGen; using MonoDetour.Reflection.Unspeakable; using MonoMod.Cil; using MonoMod.Utils; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using PrepatcherPlugin; using SSMP.Api.Client; using SSMP.Api.Client.Networking; using SSMP.Api.Command; using SSMP.Api.Command.Server; using SSMP.Api.Server; using SSMP.Api.Server.Networking; using SSMP.Networking.Packet; using SSMP.Networking.Packet.Data; using Silksong.DataManager; using Silksong.FsmUtil; using Silksong.FsmUtil.Actions; using Silksong.ModMenu.Elements; using Silksong.ModMenu.Generator; using Silksong.ModMenu.Models; using Silksong.ModMenu.Plugin; using Silksong.ModMenu.Screens; using Silksong.ModMenu.Util; using Silksong.PurenailUtil.Collections; using Silksong.TheHuntIsOn.Menu; using Silksong.TheHuntIsOn.Modules; using Silksong.TheHuntIsOn.Modules.ArchitectModule; using Silksong.TheHuntIsOn.Modules.EventsModule; using Silksong.TheHuntIsOn.Modules.Lib; using Silksong.TheHuntIsOn.Modules.PauseTimerModule; using Silksong.TheHuntIsOn.SsmpAddon; using Silksong.TheHuntIsOn.SsmpAddon.PacketUtil; using Silksong.TheHuntIsOn.Util; using Silksong.UnityHelper.Extensions; using TMProOld; using TeamCherry.SharedUtils; using UnityEngine; using UnityEngine.Events; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("Silksong.TheHuntIsOn")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyDescription("SSMP add-on mod for speedrunners vs. hunters.")] [assembly: AssemblyFileVersion("1.0.3.0")] [assembly: AssemblyInformationalVersion("1.0.3+bd3ac68e0a7e8fd45e1d41476916e552d8892560")] [assembly: AssemblyProduct("Silksong.TheHuntIsOn")] [assembly: AssemblyTitle("TheHuntIsOn")] [assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/dplochcoder/Silksong.TheHuntIsOn")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.3.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [CompilerGenerated] internal sealed class <>z__ReadOnlyArray : IEnumerable, ICollection, IList, IEnumerable, IReadOnlyCollection, IReadOnlyList, ICollection, IList { int ICollection.Count => _items.Length; bool ICollection.IsSynchronized => false; object ICollection.SyncRoot => this; object IList.this[int index] { get { return _items[index]; } set { throw new NotSupportedException(); } } bool IList.IsFixedSize => true; bool IList.IsReadOnly => true; int IReadOnlyCollection.Count => _items.Length; T IReadOnlyList.this[int index] => _items[index]; int ICollection.Count => _items.Length; bool ICollection.IsReadOnly => true; T IList.this[int index] { get { return _items[index]; } set { throw new NotSupportedException(); } } public <>z__ReadOnlyArray(T[] items) { _items = items; } IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable)_items).GetEnumerator(); } void ICollection.CopyTo(Array array, int index) { ((ICollection)_items).CopyTo(array, index); } int IList.Add(object value) { throw new NotSupportedException(); } void IList.Clear() { throw new NotSupportedException(); } bool IList.Contains(object value) { return ((IList)_items).Contains(value); } int IList.IndexOf(object value) { return ((IList)_items).IndexOf(value); } void IList.Insert(int index, object value) { throw new NotSupportedException(); } void IList.Remove(object value) { throw new NotSupportedException(); } void IList.RemoveAt(int index) { throw new NotSupportedException(); } IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable)_items).GetEnumerator(); } void ICollection.Add(T item) { throw new NotSupportedException(); } void ICollection.Clear() { throw new NotSupportedException(); } bool ICollection.Contains(T item) { return ((ICollection)_items).Contains(item); } void ICollection.CopyTo(T[] array, int arrayIndex) { ((ICollection)_items).CopyTo(array, arrayIndex); } bool ICollection.Remove(T item) { throw new NotSupportedException(); } int IList.IndexOf(T item) { return ((IList)_items).IndexOf(item); } void IList.Insert(int index, T item) { throw new NotSupportedException(); } void IList.RemoveAt(int index) { throw new NotSupportedException(); } } [CompilerGenerated] internal sealed class <>z__ReadOnlyList : IEnumerable, ICollection, IList, IEnumerable, IReadOnlyCollection, IReadOnlyList, ICollection, IList { int ICollection.Count => _items.Count; 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.Count; T IReadOnlyList.this[int index] => _items[index]; int ICollection.Count => _items.Count; bool ICollection.IsReadOnly => true; T IList.this[int index] { get { return _items[index]; } set { throw new NotSupportedException(); } } public <>z__ReadOnlyList(List 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 _items.Contains(item); } void ICollection.CopyTo(T[] array, int arrayIndex) { _items.CopyTo(array, arrayIndex); } bool ICollection.Remove(T item) { throw new NotSupportedException(); } int IList.IndexOf(T item) { return _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 Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } 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 System.Runtime.Versioning { [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Module | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface | AttributeTargets.Delegate, Inherited = false)] [ExcludeFromCodeCoverage] internal sealed class RequiresPreviewFeaturesAttribute : Attribute { public string? Message { get; } public string? Url { get; set; } public RequiresPreviewFeaturesAttribute() { } public RequiresPreviewFeaturesAttribute(string? message) { Message = message; } } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)] [ExcludeFromCodeCoverage] internal sealed class CallerArgumentExpressionAttribute : Attribute { public string ParameterName { get; } public CallerArgumentExpressionAttribute(string parameterName) { ParameterName = parameterName; } } [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Interface, Inherited = false)] [ExcludeFromCodeCoverage] internal sealed class CollectionBuilderAttribute : Attribute { public Type BuilderType { get; } public string MethodName { get; } public CollectionBuilderAttribute(Type builderType, string methodName) { BuilderType = builderType; MethodName = methodName; } } [AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = false)] [ExcludeFromCodeCoverage] internal sealed class CompilerFeatureRequiredAttribute : Attribute { public const string RefStructs = "RefStructs"; public const string RequiredMembers = "RequiredMembers"; public string FeatureName { get; } public bool IsOptional { get; set; } public CompilerFeatureRequiredAttribute(string featureName) { FeatureName = featureName; } } [AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)] [ExcludeFromCodeCoverage] internal sealed class InterpolatedStringHandlerArgumentAttribute : Attribute { public string[] Arguments { get; } public InterpolatedStringHandlerArgumentAttribute(string argument) { Arguments = new string[1] { argument }; } public InterpolatedStringHandlerArgumentAttribute(params string[] arguments) { Arguments = arguments; } } [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, AllowMultiple = false, Inherited = false)] [ExcludeFromCodeCoverage] internal sealed class InterpolatedStringHandlerAttribute : Attribute { } [EditorBrowsable(EditorBrowsableState.Never)] [ExcludeFromCodeCoverage] internal static class IsExternalInit { } [AttributeUsage(AttributeTargets.Method, Inherited = false)] [ExcludeFromCodeCoverage] internal sealed class ModuleInitializerAttribute : Attribute { } [AttributeUsage(AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property, AllowMultiple = false, Inherited = false)] [ExcludeFromCodeCoverage] internal sealed class OverloadResolutionPriorityAttribute : Attribute { public int Priority { get; } public OverloadResolutionPriorityAttribute(int priority) { Priority = priority; } } [AttributeUsage(AttributeTargets.Parameter, Inherited = true, AllowMultiple = false)] [ExcludeFromCodeCoverage] internal sealed class ParamCollectionAttribute : Attribute { } [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false, Inherited = false)] [ExcludeFromCodeCoverage] internal sealed class RequiredMemberAttribute : Attribute { } [AttributeUsage(AttributeTargets.Parameter, Inherited = false)] [EditorBrowsable(EditorBrowsableState.Never)] [ExcludeFromCodeCoverage] internal sealed class RequiresLocationAttribute : Attribute { } [AttributeUsage(AttributeTargets.Module | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Event | AttributeTargets.Interface, Inherited = false)] [ExcludeFromCodeCoverage] internal sealed class SkipLocalsInitAttribute : Attribute { } } namespace System.Diagnostics.CodeAnalysis { [AttributeUsage(AttributeTargets.Parameter, Inherited = false)] [ExcludeFromCodeCoverage] internal sealed class ConstantExpectedAttribute : Attribute { public object? Min { get; set; } public object? Max { get; set; } } [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Module | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface | AttributeTargets.Delegate, Inherited = false)] [ExcludeFromCodeCoverage] internal sealed class ExperimentalAttribute : Attribute { public string DiagnosticId { get; } public string? UrlFormat { get; set; } public ExperimentalAttribute(string diagnosticId) { DiagnosticId = diagnosticId; } } [AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)] [ExcludeFromCodeCoverage] internal sealed class MemberNotNullAttribute : Attribute { public string[] Members { get; } public MemberNotNullAttribute(string member) { Members = new string[1] { member }; } public MemberNotNullAttribute(params string[] members) { Members = members; } } [AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)] [ExcludeFromCodeCoverage] internal sealed class MemberNotNullWhenAttribute : Attribute { public bool ReturnValue { get; } public string[] Members { get; } public MemberNotNullWhenAttribute(bool returnValue, string member) { ReturnValue = returnValue; Members = new string[1] { member }; } public MemberNotNullWhenAttribute(bool returnValue, params string[] members) { ReturnValue = returnValue; Members = members; } } [AttributeUsage(AttributeTargets.Constructor, AllowMultiple = false, Inherited = false)] [ExcludeFromCodeCoverage] internal sealed class SetsRequiredMembersAttribute : Attribute { } [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)] [ExcludeFromCodeCoverage] internal sealed class StringSyntaxAttribute : Attribute { public const string CompositeFormat = "CompositeFormat"; public const string DateOnlyFormat = "DateOnlyFormat"; public const string DateTimeFormat = "DateTimeFormat"; public const string EnumFormat = "EnumFormat"; public const string GuidFormat = "GuidFormat"; public const string Json = "Json"; public const string NumericFormat = "NumericFormat"; public const string Regex = "Regex"; public const string TimeOnlyFormat = "TimeOnlyFormat"; public const string TimeSpanFormat = "TimeSpanFormat"; public const string Uri = "Uri"; public const string Xml = "Xml"; public string Syntax { get; } public object?[] Arguments { get; } public StringSyntaxAttribute(string syntax) { Syntax = syntax; Arguments = new object[0]; } public StringSyntaxAttribute(string syntax, params object?[] arguments) { Syntax = syntax; Arguments = arguments; } } [AttributeUsage(AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)] [ExcludeFromCodeCoverage] internal sealed class UnscopedRefAttribute : Attribute { } } namespace Md.ShopItem { internal static class Awake { public delegate void PrefixSignature(ShopItem self); public delegate void PostfixSignature(ShopItem 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(ShopItem).GetMethod("Awake", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("ShopItem", "Awake"); } } internal static class SetPurchased { public delegate void PrefixSignature(ShopItem self, ref Action onComplete, ref int subItemIndex); public delegate void PostfixSignature(ShopItem self, ref Action onComplete, ref int subItemIndex); 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(ShopItem).GetMethod("SetPurchased", (BindingFlags)(-1), null, new Type[2] { typeof(Action), typeof(int) }, null) ?? throw new MissingMethodException("ShopItem", "SetPurchased"); } } internal static class get_OverrideCostDelegate { } internal static class set_OverrideCostDelegate { } internal static class get_DisplayName { } internal static class get_Description { } internal static class get_ItemSprite { } internal static class get_ItemSpriteScale { } internal static class get_CurrencyType { } internal static class get_Cost { } internal static class get_RequiredItem { } internal static class get_RequiredItemAmount { } internal static class get_RequiredTools { } internal static class get_RequiredToolsAmount { } internal static class get_UpgradeFromItem { } internal static class get_IsAvailable { } internal static class get_IsPurchased { } internal static class get_IsAvailableNotInfinite { } internal static class get_Item { } internal static class get_EventAfterPurchase { } internal static class get_SubItemsCount { } internal static class get_HasSubItems { } internal static class get_SubItemSelectPrompt { } internal static class IsUsingCostReference { } internal static class IsUsingRequiredTools { } internal static class ItemSpriteValidation { } internal static class OnValidate { } internal static class IsToolItem { } internal static class IsAtMax { } internal static class GetToolType { } internal static class GetPurchaseType { } internal static class GetTypeFlags { } internal static class EnsurePool { } internal static class GetSubItem { } internal static class CreateTemp { } internal static class _ctor { } internal static class ConditionalSpawn { internal static class EnsurePool { } internal static class TryInstantiate { } internal static class _ctor { } } internal static class LocalisedStringPlural { internal static class _ctor { } } internal static class TypeFlags { internal static class _ctor { } } internal static class PurchaseTypes { internal static class _ctor { } } internal static class SubItem { internal static class _ctor { } } } namespace Md.PlayerData { internal static class GetBool { public delegate void PrefixSignature(PlayerData self, ref string boolName); public delegate ReturnFlow ControlFlowPrefixSignature(PlayerData self, ref string boolName, ref bool returnValue); public delegate void PostfixSignature(PlayerData self, ref string boolName, 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(PlayerData).GetMethod("GetBool", (BindingFlags)(-1), null, new Type[1] { typeof(string) }, null) ?? throw new MissingMethodException("PlayerData", "GetBool"); } } internal static class GetInt { public delegate void PrefixSignature(PlayerData self, ref string intName); public delegate ReturnFlow ControlFlowPrefixSignature(PlayerData self, ref string intName, ref int returnValue); public delegate void PostfixSignature(PlayerData self, ref string intName, ref int 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(PlayerData).GetMethod("GetInt", (BindingFlags)(-1), null, new Type[1] { typeof(string) }, null) ?? throw new MissingMethodException("PlayerData", "GetInt"); } } internal static class MaxHealth { public delegate void PrefixSignature(PlayerData self); public delegate ReturnFlow ControlFlowPrefixSignature(PlayerData self); public delegate void PostfixSignature(PlayerData 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(PlayerData).GetMethod("MaxHealth", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("PlayerData", "MaxHealth"); } } internal static class AddToMaxHealth { public delegate void PrefixSignature(PlayerData self, ref int amount); public delegate ReturnFlow ControlFlowPrefixSignature(PlayerData self, ref int amount); public delegate void PostfixSignature(PlayerData self, ref int amount); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return typeof(PlayerData).GetMethod("AddToMaxHealth", (BindingFlags)(-1), null, new Type[1] { typeof(int) }, null) ?? throw new MissingMethodException("PlayerData", "AddToMaxHealth"); } } internal static class AddSilk { public delegate void PrefixSignature(PlayerData self, ref int amount); public delegate ReturnFlow ControlFlowPrefixSignature(PlayerData self, ref int amount, ref bool returnValue); public delegate void PostfixSignature(PlayerData self, ref int amount, 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(PlayerData).GetMethod("AddSilk", (BindingFlags)(-1), null, new Type[1] { typeof(int) }, null) ?? throw new MissingMethodException("PlayerData", "AddSilk"); } } internal static class get_IsDemoMode { } internal static class get_IsExhibitionMode { } internal static class get_IsHornetStrengthRegained { } internal static class get_nailDamage { } internal static class get_MapBools { } internal static class get_HasAnyMap { } internal static class get_HasAllMaps { } internal static class get_MapCount { } internal static class get_CanUpdateMap { } internal static class get_IsWildsWideMapFull { } internal static class get_HasAnyFleaPin { } internal static class get_IsFleaPinMapKeyVisible { } internal static class get_SavedFleasCount { } internal static class CacheSavedFleas { } internal static class get_HasAnyPin { } internal static class get_VampireGnatBossInAltLoc { } internal static class get_CaravanInGreymoor { } internal static class get_HasLifebloodSyringeGland { } internal static class get_GourmandQuestAccepted { } internal static class get_SlaveDeliveryQuestCompleted { } internal static class get_BelltownHouseVisited { } internal static class get_CrawbellHasSomething { } internal static class get_HasAnyMemento { } internal static class get_CloakFlySmell { } internal static class get_IsAnyRelicsDeposited { } internal static class get_WillLoadWardBoss { } internal static class get_CollectedCloverMemoryOrbs { } internal static class get_CloverMemoryOrbsCollectedAll { } internal static class get_CloverMemoryOrbsCollectedTarget { } internal static class get_IsAct3IntroQueued { } internal static class get_HasWhiteFlower { } internal static class get_FleaGamesIsJugglingChampion { } internal static class get_FleaGamesIsJugglingSethChampion { } internal static class get_FleaGamesIsBouncingChampion { } internal static class get_FleaGamesIsBouncingSethChampion { } internal static class get_FleaGamesIsDodgingChampion { } internal static class get_FleaGamesIsDodgingSethChampion { } internal static class get_FleaGamesOutroReady { } internal static class get_FleaGamesBestedSeth { } internal static class get_BellCentipedeWaiting { } internal static class get_BellCentipedeLocked { } internal static class get_UnlockedAnyTube { } internal static class get_CurrentMaxHealth { } internal static class get_CurrentSilkMax { } internal static class get_CurrentSilkMaxBasic { } internal static class get_SilkSkillCost { } internal static class get_IsAnyCursed { } internal static class get_CurrentSilkRegenMax { } internal static class get_JournalIsCompleted { } internal static class get_JournalCompletedCount { } internal static class get_MushroomQuestCompleted { } internal static class get_instance { } internal static class set_instance { } internal static class get_HasInstance { } internal static class _ctor { } internal static class CreateNewSingleton { } internal static class OnDeserialized { } internal static class ClearOptimisers { } internal static class SetBool { } internal static class SetInt { } internal static class IncrementInt { } internal static class IntAdd { } internal static class SetFloat { } internal static class DecrementInt { } internal static class GetFloat { } internal static class GetString { } internal static class SetString { } internal static class SetVector3 { } internal static class GetVector3 { } internal static class GetNextMossberryValue { } internal static class GetNextSilkGrubValue { } internal static class CaptureToolAmountsOverride { } internal static class ClearToolAmountsOverride { } internal static class GetToolData { } internal static class SetToolData { } internal static class AddHealth { } internal static class TakeHealth { } internal static class ActivateTestingCheats { } internal static class GetAllPowerups { } internal static class AddGeo { } internal static class TakeGeo { } internal static class AddShards { } internal static class TakeShards { } internal static class WouldDie { } internal static class TakeSilk { } internal static class ReduceOdours { } internal static class EquipCharm { } internal static class UnequipCharm { } internal static class CalculateNotchesUsed { } internal static class SetBenchRespawn_RespawnMarker_System_String_System_Int32 { } internal static class SetBenchRespawn_System_String_System_String_System_Boolean { } internal static class SetBenchRespawn_System_String_System_String_System_Int32_System_Boolean { } internal static class SetHazardRespawn_HazardRespawnMarker { } internal static class SetHazardRespawn_UnityEngine_Vector3_System_Boolean { } internal static class MapperLeaveAll { } internal static class CountGameCompletion { } internal static class SetupNewPlayerData { } internal static class SetupExistingPlayerData { } internal static class ResetNonSerializableFields { } internal static class ResetTempRespawn { } internal static class ResetCutsceneBools { } internal static class AddGGPlayerDataOverrides { } internal static class OnUpdatedVariable { } internal static class GetDateString { } internal static class OnBeforeSave { } internal static class UpdateDate { } internal static class AddEditorOverrides { } internal static class _cctor { } internal static class MapBoolList { internal static class get_HasAnyMap { } internal static class get_HasAllMaps { } internal static class get_HasCount { } internal static class _ctor { } internal static class BuildTargetList { } internal static class __c { internal static class _ctor { } } internal static class __c__DisplayClass8_0 { internal static class _ctor { } } internal static class __c__DisplayClass8_1 { internal static class _ctor { } } internal static class __c__DisplayClass8_2 { internal static class _ctor { } } } internal static class __c { internal static class _ctor { } } } namespace Md.Lever_tk2d { internal static class _Execute_d__32 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate void PostfixSignature(object 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 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 (Type.GetType("Lever_tk2d+d__32, Assembly-CSharp") ?? throw new Exception("Missing Type: 'Lever_tk2d+d__32'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("Lever_tk2d+d__32", "MoveNext"); } } internal static class _ctor { } internal static class System_IDisposable_Dispose { } internal static class System_Collections_Generic_IEnumerator_System_Object__get_Current { } internal static class System_Collections_IEnumerator_Reset { } internal static class System_Collections_IEnumerator_get_Current { } } internal static class Awake { public delegate void PrefixSignature(Lever_tk2d self); public delegate void PostfixSignature(Lever_tk2d 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(Lever_tk2d).GetMethod("Awake", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("Lever_tk2d", "Awake"); } } internal static class Execute { public delegate void PrefixSignature(Lever_tk2d self); public delegate void PostfixSignature(Lever_tk2d self, ref IEnumerator returnValue); public delegate void PrefixMoveNextSignature(SpeakableEnumerator self); public delegate void PostfixMoveNextSignature(SpeakableEnumerator self, ref bool continueEnumeration); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MonoDetourHook PrefixMoveNext(PrefixMoveNextSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook((MethodBase)StateMachineTarget(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook PostfixMoveNext(PostfixMoveNextSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook((MethodBase)StateMachineTarget(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHookMoveNext(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook((MethodBase)StateMachineTarget(), manipulator, config, applyByDefault); } public static MethodBase Target() { return typeof(Lever_tk2d).GetMethod("Execute", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("Lever_tk2d", "Execute"); } public static MethodInfo StateMachineTarget() { return Extensions.GetStateMachineTarget((MethodInfo)Target()); } } internal static class Start { } internal static class IsFsmEventValidRequiredFSM { } internal static class IsFsmEventValidRequired { } internal static class Hit { } internal static class PlaySound { } internal static class PlaySoundOneShot { } internal static class _ctor { } } namespace Md.Lever { internal static class _Execute_d__35 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate void PostfixSignature(object 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 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 (Type.GetType("Lever+d__35, Assembly-CSharp") ?? throw new Exception("Missing Type: 'Lever+d__35'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("Lever+d__35", "MoveNext"); } } internal static class _ctor { } internal static class System_IDisposable_Dispose { } internal static class System_Collections_Generic_IEnumerator_System_Object__get_Current { } internal static class System_Collections_IEnumerator_Reset { } internal static class System_Collections_IEnumerator_get_Current { } } internal static class Awake { public delegate void PrefixSignature(Lever self); public delegate void PostfixSignature(Lever 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(Lever).GetMethod("Awake", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("Lever", "Awake"); } } internal static class Execute { public delegate void PrefixSignature(Lever self); public delegate void PostfixSignature(Lever self, ref IEnumerator returnValue); public delegate void PrefixMoveNextSignature(SpeakableEnumerator self); public delegate void PostfixMoveNextSignature(SpeakableEnumerator self, ref bool continueEnumeration); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MonoDetourHook PrefixMoveNext(PrefixMoveNextSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook((MethodBase)StateMachineTarget(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook PostfixMoveNext(PostfixMoveNextSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook((MethodBase)StateMachineTarget(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHookMoveNext(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook((MethodBase)StateMachineTarget(), manipulator, config, applyByDefault); } public static MethodBase Target() { return typeof(Lever).GetMethod("Execute", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("Lever", "Execute"); } public static MethodInfo StateMachineTarget() { return Extensions.GetStateMachineTarget((MethodInfo)Target()); } } internal static class get_HitBlocked { } internal static class set_HitBlocked { } internal static class Start { } internal static class Hit { } internal static class SetActivated { } internal static class SetActivated_System_Boolean { } internal static class SetActivatedInert { } internal static class SetActivatedInertWithAnim { } internal static class SetActivatedAnim { } internal static class _ctor { } } namespace Md.SilkSpool { internal static class get_BindCost { public delegate void PrefixSignature(); public delegate void PostfixSignature(ref float returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return typeof(SilkSpool).GetMethod("get_BindCost", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("SilkSpool", "get_BindCost"); } } internal static class RefreshSilk { public delegate void PrefixSignature(SilkSpool self); public delegate void PostfixSignature(SilkSpool 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(SilkSpool).GetMethod("RefreshSilk", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("SilkSpool", "RefreshSilk"); } } internal static class Awake { public delegate void PrefixSignature(SilkSpool self); public delegate void PostfixSignature(SilkSpool 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(SilkSpool).GetMethod("Awake", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("SilkSpool", "Awake"); } } internal static class get_Instance { } internal static class set_Instance { } internal static class OnDestroy { } internal static class Start { } internal static class DrawSpool { } internal static class DrawSpool_System_Int32 { } internal static class ChangeSilk { } internal static class IsGlowing { } internal static class RefreshSilk_SilkSpool_SilkAddSource_SilkSpool_SilkTakeSource { } internal static class RefreshBindNotch { } internal static class SpawnNewChunk { } internal static class AddUsing { } internal static class RemoveUsing { } internal static class SetRegen { } internal static class ResumeSilkAudio { } internal static class EndSilkAudio { } internal static class EvaluatePositions { } internal static class SetMossState { } internal static class CancelMossChunk { } internal static class _ctor { } internal static class SilkAddSource { internal static class _ctor { } } internal static class SilkTakeSource { internal static class _ctor { } } internal static class SilkUsingFlags { internal static class _ctor { } } } namespace Md.HutongGames.PlayMaker.Actions.CallMethodProper { internal static class Awake { public delegate void PrefixSignature(CallMethodProper self); public delegate void PostfixSignature(CallMethodProper 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(CallMethodProper).GetMethod("Awake", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("HutongGames.PlayMaker.Actions.CallMethodProper", "Awake"); } } internal static class OnEnter { } internal static class OnUpdate { } internal static class DoMethodCall { } internal static class DoCache { } internal static class PreCache { } internal static class _ctor { } internal static class __c { internal static class _ctor { } } } namespace Md.HutongGames.PlayMaker.Fsm { internal static class Clear { public delegate void PrefixSignature(Fsm self, ref MonoBehaviour component); public delegate void PostfixSignature(Fsm self, ref MonoBehaviour component); 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(Fsm).GetMethod("Clear", (BindingFlags)(-1), null, new Type[1] { typeof(MonoBehaviour) }, null) ?? throw new MissingMethodException("HutongGames.PlayMaker.Fsm", "Clear"); } } internal static class CompareTo { public delegate void PrefixSignature(Fsm self, ref object obj); public delegate void PostfixSignature(Fsm self, ref object obj, ref int 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(Fsm).GetMethod("CompareTo", (BindingFlags)(-1), null, new Type[1] { typeof(object) }, null) ?? throw new MissingMethodException("HutongGames.PlayMaker.Fsm", "CompareTo"); } } internal static class GetState { public delegate void PrefixSignature(Fsm self, ref string stateName); public delegate void PostfixSignature(Fsm self, ref string stateName, ref FsmState 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(Fsm).GetMethod("GetState", (BindingFlags)(-1), null, new Type[1] { typeof(string) }, null) ?? throw new MissingMethodException("HutongGames.PlayMaker.Fsm", "GetState"); } } internal static class GetFsmInt { public delegate void PrefixSignature(Fsm self, ref string varName); public delegate void PostfixSignature(Fsm self, ref string varName, ref FsmInt 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(Fsm).GetMethod("GetFsmInt", (BindingFlags)(-1), null, new Type[1] { typeof(string) }, null) ?? throw new MissingMethodException("HutongGames.PlayMaker.Fsm", "GetFsmInt"); } } internal static class GetFsmFloat { public delegate void PrefixSignature(Fsm self, ref string varName); public delegate void PostfixSignature(Fsm self, ref string varName, ref FsmFloat 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(Fsm).GetMethod("GetFsmFloat", (BindingFlags)(-1), null, new Type[1] { typeof(string) }, null) ?? throw new MissingMethodException("HutongGames.PlayMaker.Fsm", "GetFsmFloat"); } } internal static class Update { public delegate void PrefixSignature(Fsm self); public delegate void PostfixSignature(Fsm 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(Fsm).GetMethod("Update", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("HutongGames.PlayMaker.Fsm", "Update"); } } internal static class Reset { public delegate void PrefixSignature(Fsm self, ref MonoBehaviour component); public delegate void PostfixSignature(Fsm self, ref MonoBehaviour component); 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(Fsm).GetMethod("Reset", (BindingFlags)(-1), null, new Type[1] { typeof(MonoBehaviour) }, null) ?? throw new MissingMethodException("HutongGames.PlayMaker.Fsm", "Reset"); } } internal static class GetFsmEnum { public delegate void PrefixSignature(Fsm self, ref string varName); public delegate void PostfixSignature(Fsm self, ref string varName, ref FsmEnum 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(Fsm).GetMethod("GetFsmEnum", (BindingFlags)(-1), null, new Type[1] { typeof(string) }, null) ?? throw new MissingMethodException("HutongGames.PlayMaker.Fsm", "GetFsmEnum"); } } internal static class Awake { public delegate void PrefixSignature(Fsm self); public delegate void PostfixSignature(Fsm 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(Fsm).GetMethod("Awake", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("HutongGames.PlayMaker.Fsm", "Awake"); } } internal static class OnEnable { public delegate void PrefixSignature(Fsm self); public delegate void PostfixSignature(Fsm 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(Fsm).GetMethod("OnEnable", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("HutongGames.PlayMaker.Fsm", "OnEnable"); } } internal static class get_FsmList { } internal static class get_SortedFsmList { } internal static class get_UpdateHelperSetDirty { } internal static class ClearOutputFlags { } internal static class GetOutputVariables { } internal static class GetOutputVariableNames { } internal static class SetOutputVariables { } internal static class SanityCheckOutputIndices { } internal static class OutVariableIndicesNeedFixing { } internal static class get_ManualUpdate { } internal static class set_ManualUpdate { } internal static class get_KeepDelayedEventsOnStateExit { } internal static class set_KeepDelayedEventsOnStateExit { } internal static class get_Preprocessed { } internal static class set_Preprocessed { } internal static class get_Host { } internal static class set_Host { } internal static class get_Password { } internal static class get_Locked { } internal static class Lock { } internal static class Unlock { } internal static class get_Template { } internal static class get_IsSubFsm { } internal static class get_RootFsm { } internal static class get_SubFsmList { } internal static class get_DefaultVariableValues { } internal static class set_DefaultVariableValues { } internal static class get_HasErrors { } internal static class set_HasErrors { } internal static class get_Started { } internal static class set_Started { } internal static class get_DelayedEvents { } internal static class KillDelayedEvents { } internal static class get_DataVersion { } internal static class set_DataVersion { } internal static class get_Owner { } internal static class set_Owner { } internal static class get_NameIsExpanded { } internal static class set_NameIsExpanded { } internal static class get_ControlsIsExpanded { } internal static class set_ControlsIsExpanded { } internal static class get_DebugIsExpanded { } internal static class set_DebugIsExpanded { } internal static class get_ExperimentalIsExpanded { } internal static class set_ExperimentalIsExpanded { } internal static class get_InfoIsExpanded { } internal static class set_InfoIsExpanded { } internal static class get_InputsIsExpanded { } internal static class set_InputsIsExpanded { } internal static class get_OutputsIsExpanded { } internal static class set_OutputsIsExpanded { } internal static class get_EventsIsExpanded { } internal static class set_EventsIsExpanded { } internal static class get_SettingsIsExpanded { } internal static class set_SettingsIsExpanded { } internal static class get_Name { } internal static class set_Name { } internal static class get_UsedInTemplate { } internal static class set_UsedInTemplate { } internal static class get_StartState { } internal static class set_StartState { } internal static class get_States { } internal static class set_States { } internal static class get_Events { } internal static class set_Events { } internal static class get_GlobalTransitions { } internal static class set_GlobalTransitions { } internal static class get_Variables { } internal static class set_Variables { } internal static class get_EventTarget { } internal static class set_EventTarget { } internal static class get_Initialized { } internal static class get_Active { } internal static class get_Finished { } internal static class set_Finished { } internal static class get_IsSwitchingState { } internal static class get_ActiveState { } internal static class set_ActiveState { } internal static class get_ActiveStateName { } internal static class get_PreviousActiveState { } internal static class set_PreviousActiveState { } internal static class get_LastTransition { } internal static class set_LastTransition { } internal static class get_MaxLoopCount { } internal static class get_MaxLoopCountOverride { } internal static class set_MaxLoopCountOverride { } internal static class get_OwnerName { } internal static class get_OwnerDebugName { } internal static class get_GameObject { } internal static class get_GameObjectName { } internal static class get_OwnerObject { } internal static class get_FsmComponent { } internal static class get_MyLog { } internal static class get_IsModifiedPrefabInstance { } internal static class set_IsModifiedPrefabInstance { } internal static class get_Description { } internal static class set_Description { } internal static class get_Watermark { } internal static class set_Watermark { } internal static class get_ShowStateLabel { } internal static class set_ShowStateLabel { } internal static class get_GuiLabel { } internal static class get_DocUrl { } internal static class set_DocUrl { } internal static class get_EditState { } internal static class set_EditState { } internal static class get_LastClickedObject { } internal static class set_LastClickedObject { } internal static class get_BreakpointsEnabled { } internal static class set_BreakpointsEnabled { } internal static class get_HitBreakpoint { } internal static class set_HitBreakpoint { } internal static class get_BreakAtFsm { } internal static class set_BreakAtFsm { } internal static class get_BreakAtState { } internal static class set_BreakAtState { } internal static class get_IsBreak { } internal static class set_IsBreak { } internal static class get_IsErrorBreak { } internal static class set_IsErrorBreak { } internal static class get_LastError { } internal static class set_LastError { } internal static class get_StepToStateChange { } internal static class set_StepToStateChange { } internal static class get_StepFsm { } internal static class set_StepFsm { } internal static class get_SwitchedState { } internal static class set_SwitchedState { } internal static class get_MouseEvents { } internal static class set_MouseEvents { } internal static class get_HandleLevelLoaded { } internal static class set_HandleLevelLoaded { } internal static class get_HandleTriggerEnter2D { } internal static class set_HandleTriggerEnter2D { } internal static class get_HandleTriggerExit2D { } internal static class set_HandleTriggerExit2D { } internal static class get_HandleTriggerStay2D { } internal static class set_HandleTriggerStay2D { } internal static class get_HandleCollisionEnter2D { } internal static class set_HandleCollisionEnter2D { } internal static class get_HandleCollisionExit2D { } internal static class set_HandleCollisionExit2D { } internal static class get_HandleCollisionStay2D { } internal static class set_HandleCollisionStay2D { } internal static class get_HandleTriggerEnter { } internal static class set_HandleTriggerEnter { } internal static class get_HandleTriggerExit { } internal static class set_HandleTriggerExit { } internal static class get_HandleTriggerStay { } internal static class set_HandleTriggerStay { } internal static class get_HandleCollisionEnter { } internal static class set_HandleCollisionEnter { } internal static class get_HandleCollisionExit { } internal static class set_HandleCollisionExit { } internal static class get_HandleCollisionStay { } internal static class set_HandleCollisionStay { } internal static class get_HandleParticleCollision { } internal static class set_HandleParticleCollision { } internal static class get_HandleControllerColliderHit { } internal static class set_HandleControllerColliderHit { } internal static class get_HandleJointBreak { } internal static class set_HandleJointBreak { } internal static class get_HandleJointBreak2D { } internal static class set_HandleJointBreak2D { } internal static class get_HandleOnGUI { } internal static class set_HandleOnGUI { } internal static class get_HandleFixedUpdate { } internal static class set_HandleFixedUpdate { } internal static class get_HandleLateUpdate { } internal static class set_HandleLateUpdate { } internal static class get_HandleApplicationEvents { } internal static class set_HandleApplicationEvents { } internal static class get_HandleUiEvents { } internal static class set_HandleUiEvents { } internal static class get_HandleLegacyNetworking { } internal static class set_HandleLegacyNetworking { } internal static class ForcePreprocess { } internal static class ResetEventHandlerFlags { } internal static class get_CollisionInfo { } internal static class set_CollisionInfo { } internal static class get_TriggerCollider { } internal static class set_TriggerCollider { } internal static class get_Collision2DInfo { } internal static class set_Collision2DInfo { } internal static class get_TriggerCollider2D { } internal static class set_TriggerCollider2D { } internal static class get_JointBreakForce { } internal static class set_JointBreakForce { } internal static class get_BrokenJoint2D { } internal static class set_BrokenJoint2D { } internal static class get_ParticleCollisionGO { } internal static class set_ParticleCollisionGO { } internal static class get_CollisionGO { } internal static class get_Collision2dGO { } internal static class get_TriggerGO { } internal static class get_Trigger2dGO { } internal static class get_TriggerName { } internal static class set_TriggerName { } internal static class get_CollisionName { } internal static class set_CollisionName { } internal static class get_Trigger2dName { } internal static class set_Trigger2dName { } internal static class get_Collision2dName { } internal static class set_Collision2dName { } internal static class get_ControllerCollider { } internal static class set_ControllerCollider { } internal static class get_RaycastHitInfo { } internal static class set_RaycastHitInfo { } internal static class RecordLastRaycastHit2DInfo { } internal static class GetLastRaycastHit2DInfo { } internal static class get_HandleAnimatorMove { } internal static class set_HandleAnimatorMove { } internal static class get_HandleAnimatorIK { } internal static class set_HandleAnimatorIK { } internal static class NewTempFsm { } internal static class _ctor { } internal static class _ctor_HutongGames_PlayMaker_Fsm_HutongGames_PlayMaker_FsmVariables { } internal static class CreateSubFsm { } internal static class GetRootFsm { } internal static class CheckIfDirty { } internal static class UpdateDataVersion { } internal static class SaveActions { } internal static class FixDataVersion { } internal static class DeduceDataVersion { } internal static class Preprocess_UnityEngine_MonoBehaviour { } internal static class Preprocess { } internal static class Init { } internal static class Reinitialize { } internal static class InitStates { } internal static class InitData { } internal static class InitEvents { } internal static class CheckFsmEventsForEventHandlers { } internal static class InitInEditor { } internal static class SaveDefaultVariableValues { } internal static class ResetVariableValues { } internal static class OnSceneLoaded { } internal static class Start { } internal static class UpdateDelayedEvents { } internal static class ClearDelayedEvents { } internal static class FixedUpdate { } internal static class LateUpdate { } internal static class OnDisable { } internal static class SendDisableEvent { } internal static class Stop { } internal static class StopAndReset { } internal static class HasEvent { } internal static class ProcessEvent { } internal static class SetEventDataSentByInfo { } internal static class SetEventDataSentByInfo_HutongGames_PlayMaker_FsmEventData { } internal static class GetEventDataSentByInfo { } internal static class Event_HutongGames_PlayMaker_FsmEventTarget_System_String { } internal static class Event_UnityEngine_GameObject_HutongGames_PlayMaker_FsmEventTarget_HutongGames_PlayMaker_FsmEvent { } internal static class Event_UnityEngine_GameObject_HutongGames_PlayMaker_FsmEvent { } internal static class Event_HutongGames_PlayMaker_FsmEventTarget_HutongGames_PlayMaker_FsmEvent { } internal static class Event_System_String { } internal static class Event_HutongGames_PlayMaker_FsmEvent { } internal static class DelayedEvent_HutongGames_PlayMaker_FsmEvent_System_Single { } internal static class DelayedEvent_HutongGames_PlayMaker_FsmEventTarget_HutongGames_PlayMaker_FsmEvent_System_Single { } internal static class BroadcastEvent_System_String_System_Boolean { } internal static class BroadcastEvent_HutongGames_PlayMaker_FsmEvent_System_Boolean { } internal static class BroadcastEventToGameObject_UnityEngine_GameObject_System_String_System_Boolean_System_Boolean { } internal static class BroadcastEventToGameObject_UnityEngine_GameObject_HutongGames_PlayMaker_FsmEvent_HutongGames_PlayMaker_FsmEventData_System_Boolean_System_Boolean { } internal static class IsFsmChildOfGameObject { } internal static class SendEventToFsmOnGameObject_UnityEngine_GameObject_System_String_System_String { } internal static class SendEventToFsmOnGameObject_UnityEngine_GameObject_System_String_HutongGames_PlayMaker_FsmEvent { } internal static class HasState { } internal static class SetState { } internal static class UpdateStateChanges { } internal static class DoTransition { } internal static class SwitchState { } internal static class GotoPreviousState { } internal static class ReEnterState { } internal static class EnterState { } internal static class FixedUpdateState { } internal static class UpdateState { } internal static class LateUpdateState { } internal static class ExitState { } internal static class GetSubFsm { } internal static class GetFullFsmLabel { } internal static class GetOwnerDefaultTarget { } internal static class GetStateIndex { } internal static class GetEvent { } internal static class FindEvent { } internal static class GetGlobalTransitionsToState { } internal static class GetFsmObject { } internal static class GetFsmMaterial { } internal static class GetFsmTexture { } internal static class GetFsmBool { } internal static class GetFsmString { } internal static class GetFsmVector2 { } internal static class GetFsmVector3 { } internal static class GetFsmRect { } internal static class GetFsmQuaternion { } internal static class GetFsmColor { } internal static class GetFsmGameObject { } internal static class GetFsmArray { } internal static class OnDrawGizmos { } internal static class OnDrawGizmosSelected { } internal static class OnCollisionEnter { } internal static class OnCollisionStay { } internal static class OnCollisionExit { } internal static class OnTriggerEnter { } internal static class OnTriggerStay { } internal static class OnTriggerExit { } internal static class OnParticleCollision { } internal static class OnCollisionEnter2D { } internal static class OnCollisionStay2D { } internal static class OnCollisionExit2D { } internal static class OnTriggerEnter2D { } internal static class OnTriggerStay2D { } internal static class OnTriggerExit2D { } internal static class OnControllerColliderHit { } internal static class OnJointBreak { } internal static class OnJointBreak2D { } internal static class OnAnimatorMove { } internal static class OnAnimatorIK { } internal static class OnGUI { } internal static class DoBreakpoint { } internal static class DoBreakError { } internal static class DoBreak { } internal static class Continue { } internal static class OnDestroy { } internal static class DebugLog { } internal static class DebugEvent { } internal static class DebugLifetime { } internal static class DebugDebugger { } internal static class get_DebugLookAtColor { } internal static class set_DebugLookAtColor { } internal static class get_DebugRaycastColor { } internal static class set_DebugRaycastColor { } internal static class _cctor { } internal static class EditorFlags { internal static class _ctor { } } } namespace Md.PlayMakerFSM { internal static class AddEventHandlerDelegate { internal static class Invoke { public delegate void PrefixSignature(AddEventHandlerDelegate self, ref PlayMakerFSM fsm); public delegate void PostfixSignature(AddEventHandlerDelegate self, ref PlayMakerFSM fsm); 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(AddEventHandlerDelegate).GetMethod("Invoke", (BindingFlags)(-1), null, new Type[1] { typeof(PlayMakerFSM) }, null) ?? throw new MissingMethodException("PlayMakerFSM+AddEventHandlerDelegate", "Invoke"); } } internal static class _ctor { } internal static class BeginInvoke { } internal static class EndInvoke { } } internal static class SendEvent { public delegate void PrefixSignature(PlayMakerFSM self, ref string eventName); public delegate void PostfixSignature(PlayMakerFSM self, ref string eventName); 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(PlayMakerFSM).GetMethod("SendEvent", (BindingFlags)(-1), null, new Type[1] { typeof(string) }, null) ?? throw new MissingMethodException("PlayMakerFSM", "SendEvent"); } } internal static class _DoCoroutine_d__46 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate void PostfixSignature(object 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 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 (Type.GetType("PlayMakerFSM+d__46, PlayMaker") ?? throw new Exception("Missing Type: 'PlayMakerFSM+d__46'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("PlayMakerFSM+d__46", "MoveNext"); } } internal static class _ctor { } internal static class System_IDisposable_Dispose { } internal static class System_Collections_Generic_IEnumerator_System_Object__get_Current { } internal static class System_Collections_IEnumerator_Reset { } internal static class System_Collections_IEnumerator_get_Current { } } internal static class Update { public delegate void PrefixSignature(PlayMakerFSM self); public delegate void PostfixSignature(PlayMakerFSM 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(PlayMakerFSM).GetMethod("Update", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("PlayMakerFSM", "Update"); } } internal static class Reset { public delegate void PrefixSignature(PlayMakerFSM self); public delegate void PostfixSignature(PlayMakerFSM 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(PlayMakerFSM).GetMethod("Reset", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("PlayMakerFSM", "Reset"); } } internal static class Awake { public delegate void PrefixSignature(PlayMakerFSM self); public delegate void PostfixSignature(PlayMakerFSM 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(PlayMakerFSM).GetMethod("Awake", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("PlayMakerFSM", "Awake"); } } internal static class OnEnable { public delegate void PrefixSignature(PlayMakerFSM self); public delegate void PostfixSignature(PlayMakerFSM 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(PlayMakerFSM).GetMethod("OnEnable", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("PlayMakerFSM", "OnEnable"); } } internal static class ShowFullFsmInspector { } internal static class get_VersionNotes { } internal static class get_VersionLabel { } internal static class get_FsmList { } internal static class FindFsmOnGameObject { } internal static class get_IsMainThread { } internal static class get_NotMainThread { } internal static class InitInEditor { } internal static class get_FsmTemplate { } internal static class get_DrawGizmos { } internal static class set_DrawGizmos { } internal static class OnValidate { } internal static class Preprocess { } internal static class Init { } internal static class InitTemplate { } internal static class InitFsm { } internal static class AddEventHandlerComponents { } internal static class get_AddEventHandlers { } internal static class SetFsmTemplate { } internal static class Start { } internal static class DoCoroutine { } internal static class OnDisable { } internal static class OnDestroy { } internal static class OnApplicationQuit { } internal static class OnDrawGizmos { } internal static class SetState { } internal static class ChangeState_HutongGames_PlayMaker_FsmEvent { } internal static class ChangeState_System_String { } internal static class SendRemoteFsmEvent { } internal static class SendRemoteFsmEventWithData { } internal static class BroadcastEvent_System_String { } internal static class BroadcastEvent_HutongGames_PlayMaker_FsmEvent { } internal static class OnBecameVisible { } internal static class OnBecameInvisible { } internal static class get_Fsm { } internal static class set_Fsm { } internal static class get_FsmName { } internal static class set_FsmName { } internal static class get_FsmDescription { } internal static class set_FsmDescription { } internal static class get_Active { } internal static class get_ActiveStateName { } internal static class get_FsmStates { } internal static class get_FsmEvents { } internal static class get_FsmGlobalTransitions { } internal static class get_FsmVariables { } internal static class get_UsesTemplate { } internal static class OnBeforeSerialize { } internal static class OnAfterDeserialize { } internal static class DebugLog { } internal static class _ctor { } internal static class _cctor { } } namespace Md.HealthManager { internal static class DeathEvent { internal static class Invoke { public delegate void PrefixSignature(DeathEvent self); public delegate void PostfixSignature(DeathEvent 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(DeathEvent).GetMethod("Invoke", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("HealthManager+DeathEvent", "Invoke"); } } internal static class _ctor { } internal static class BeginInvoke { } internal static class EndInvoke { } } internal static class _CheckPersistence_d__180 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate void PostfixSignature(object 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 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 (Type.GetType("HealthManager+d__180, Assembly-CSharp") ?? throw new Exception("Missing Type: 'HealthManager+d__180'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("HealthManager+d__180", "MoveNext"); } } internal static class _ctor { } internal static class System_IDisposable_Dispose { } internal static class System_Collections_Generic_IEnumerator_System_Object__get_Current { } internal static class System_Collections_IEnumerator_Reset { } internal static class System_Collections_IEnumerator_get_Current { } } internal static class _EnumerateItemDrops_d__214 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate void PostfixSignature(object 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 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 (Type.GetType("HealthManager+d__214, Assembly-CSharp") ?? throw new Exception("Missing Type: 'HealthManager+d__214'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("HealthManager+d__214", "MoveNext"); } } internal static class _ctor { } internal static class System_IDisposable_Dispose { } internal static class System_Collections_Generic_IEnumerator_SavedItem__get_Current { } internal static class System_Collections_IEnumerator_Reset { } internal static class System_Collections_IEnumerator_get_Current { } internal static class System_Collections_Generic_IEnumerable_SavedItem__GetEnumerator { } internal static class System_Collections_IEnumerable_GetEnumerator { } } internal static class _LagHits_d__232 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate void PostfixSignature(object 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 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 (Type.GetType("HealthManager+d__232, Assembly-CSharp") ?? throw new Exception("Missing Type: 'HealthManager+d__232'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("HealthManager+d__232", "MoveNext"); } } internal static class _ctor { } internal static class System_IDisposable_Dispose { } internal static class System_Collections_Generic_IEnumerator_System_Object__get_Current { } internal static class System_Collections_IEnumerator_Reset { } internal static class System_Collections_IEnumerator_get_Current { } } internal static class Update { public delegate void PrefixSignature(HealthManager self); public delegate void PostfixSignature(HealthManager 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(HealthManager).GetMethod("Update", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("HealthManager", "Update"); } } internal static class QueuedDropItem { internal static class Reset { public delegate void PrefixSignature(QueuedDropItem self); public delegate void PostfixSignature(QueuedDropItem 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(QueuedDropItem).GetMethod("Reset", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("HealthManager+QueuedDropItem", "Reset"); } } internal static class _ctor { } internal static class _ctor_CollectableItemToolDamage_System_Int32 { } } internal static class Awake { public delegate void PrefixSignature(HealthManager self); public delegate void PostfixSignature(HealthManager 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(HealthManager).GetMethod("Awake", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("HealthManager", "Awake"); } } internal static class OnEnable { public delegate void PrefixSignature(HealthManager self); public delegate void PostfixSignature(HealthManager 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(HealthManager).GetMethod("OnEnable", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("HealthManager", "OnEnable"); } } internal static class get_SendDamageTo { } internal static class get_IsPartOfSendToTarget { } internal static class get_EffectOrigin { } internal static class get_EnemyType { } internal static class set_EnemyType { } internal static class get_DoNotGiveSilk { } internal static class get_TargetPoint { } internal static class get_MegaFlingGeo { } internal static class get_PreventInvincibleEffect { } internal static class add_OnDeath { } internal static class remove_OnDeath { } internal static class add_StartedDead { } internal static class remove_StartedDead { } internal static class get_IsInvincible { } internal static class set_IsInvincible { } internal static class get_InvincibleFromDirection { } internal static class set_InvincibleFromDirection { } internal static class get_ImmuneToCoal { } internal static class get_HasClearedItemDrops { } internal static class set_HasClearedItemDrops { } internal static class get_WillAwardJournalKill { } internal static class set_WillAwardJournalKill { } internal static class add_TookDamage { } internal static class remove_TookDamage { } internal static class get_SpriteFlash { } internal static class get_TagDamageEffectPos { } internal static class OnValidate { } internal static class OnAwake { } internal static class OnStart { } internal static class OnDisable { } internal static class EnumerateActiveEnemies { } internal static class Start { } internal static class CheckPersistence { } internal static class Hit { } internal static class Invincible { } internal static class ApplyDamageScaling { } internal static class TakeDamage { } internal static class IsImmuneTo { } internal static class NonFatalHit { } internal static class ApplyStunDamage { } internal static class ApplyExtraDamage_System_Int32 { } internal static class ApplyExtraDamage_HitInstance { } internal static class CheckNailImbuementHit { } internal static class AddDamageTagToStack { } internal static class ApplyTagDamage { } internal static class DieDropFling { } internal static class Die_System_Nullable_1_AttackTypes_System_Boolean { } internal static class Die_System_Nullable_1_AttackTypes_System_Boolean_System_Single { } internal static class Die_System_Nullable_1_AttackTypes_NailElements_UnityEngine_GameObject_System_Boolean_System_Single_System_Boolean_System_Boolean { } internal static class SpawnCurrency { } internal static class SpawnQueuedItemDrop { } internal static class SpawnItemDrop { } internal static class SendDeathEvent { } internal static class SetDead { } internal static class SetCurrencyFlashing { } internal static class IsBlockingByDirection { } internal static class SetBattleScene { } internal static class GetAttackDirection { } internal static class GetLastAttackType { } internal static class SetPreventInvincibleEffect { } internal static class SetGeoSmall { } internal static class SetGeoMedium { } internal static class SetGeoLarge { } internal static class SetShellShards { } internal static class ClearItemDropsBattleScene { } internal static class EnumerateItemDrops { } internal static class GetIsDead { } internal static class SetIsDead { } internal static class SetDamageOverride { } internal static class SetSendKilledToObject { } internal static class CheckInvincible { } internal static class HealToMax { } internal static class HasTakenDamage { } internal static class AddHP { } internal static class RefillHP { } internal static class SetImmuneToNailAttacks { } internal static class SetImmuneToTraps { } internal static class SetImmuneToSpikes { } internal static class ShouldIgnore { } internal static class DoLagHits { } internal static class CancelAllLagHitsForSource { } internal static class CancelLagHitsForSource { } internal static class CancelAllLagHits { } internal static class LagHits { } internal static class AddPhysicalPusher { } internal static class GetPhysicalPusher { } internal static class DoStealHit { } internal static class StealCurrency { } internal static class FlingStealCurrency { } internal static class SetFlingSilkOrbsDown { } internal static class SetEffectOrigin { } internal static class _ctor { } internal static class _cctor { } internal static class ITagDamageTakerOwner_get_transform { } internal static class IInitialisable_get_gameObject { } internal static class ItemDropProbability { internal static class get_Item { } internal static class _ctor { } } internal static class ItemDropGroup { internal static class _ctor { } } internal static class DamageScalingConfig { internal static class GetMultFromLevel { } internal static class _ctor { } } internal static class EnemyTypes { internal static class _ctor { } } internal static class ReaperBundleTiers { internal static class _ctor { } } internal static class EnemySize { internal static class _ctor { } } internal static class IgnoreFlags { internal static class _ctor { } } internal static class LagHitsTracker { internal static class _ctor { } } internal static class StealLagHit { internal static class _ctor { } internal static class OnEnd { } } internal static class __c__DisplayClass185_0 { internal static class _ctor { } } internal static class __c__DisplayClass197_0 { internal static class _ctor { } } internal static class __c__DisplayClass197_1 { internal static class _ctor { } } internal static class __c__DisplayClass228_0 { internal static class _ctor { } } } namespace Md.GameManager { internal static class PausedEvent { internal static class Invoke { public delegate void PrefixSignature(PausedEvent self, ref bool isPaused); public delegate void PostfixSignature(PausedEvent self, ref bool isPaused); 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(PausedEvent).GetMethod("Invoke", (BindingFlags)(-1), null, new Type[1] { typeof(bool) }, null) ?? throw new MissingMethodException("GameManager+PausedEvent", "Invoke"); } } internal static class _ctor { } internal static class BeginInvoke { } internal static class EndInvoke { } } internal static class GameStateEvent { internal static class Invoke { public delegate void PrefixSignature(GameStateEvent self, ref GameState gameState); public delegate void PostfixSignature(GameStateEvent self, ref GameState gameState); 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(GameStateEvent).GetMethod("Invoke", (BindingFlags)(-1), null, new Type[1] { typeof(GameState) }, null) ?? throw new MissingMethodException("GameManager+GameStateEvent", "Invoke"); } } internal static class _ctor { } internal static class BeginInvoke { } internal static class EndInvoke { } } internal static class BossLoad { internal static class Invoke { public delegate void PrefixSignature(BossLoad self); public delegate void PostfixSignature(BossLoad 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(BossLoad).GetMethod("Invoke", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("GameManager+BossLoad", "Invoke"); } } internal static class _ctor { } internal static class BeginInvoke { } internal static class EndInvoke { } } internal static class EnterSceneEvent { internal static class Invoke { public delegate void PrefixSignature(EnterSceneEvent self); public delegate void PostfixSignature(EnterSceneEvent 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(EnterSceneEvent).GetMethod("Invoke", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("GameManager+EnterSceneEvent", "Invoke"); } } internal static class _ctor { } internal static class BeginInvoke { } internal static class EndInvoke { } } internal static class SceneTransitionFinishEvent { internal static class Invoke { public delegate void PrefixSignature(SceneTransitionFinishEvent self); public delegate void PostfixSignature(SceneTransitionFinishEvent 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(SceneTransitionFinishEvent).GetMethod("Invoke", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("GameManager+SceneTransitionFinishEvent", "Invoke"); } } internal static class _ctor { } internal static class BeginInvoke { } internal static class EndInvoke { } } internal static class SceneTransitionBeganDelegate { internal static class Invoke { public delegate void PrefixSignature(SceneTransitionBeganDelegate self, ref SceneLoad sceneLoad); public delegate void PostfixSignature(SceneTransitionBeganDelegate self, ref SceneLoad sceneLoad); 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(SceneTransitionBeganDelegate).GetMethod("Invoke", (BindingFlags)(-1), null, new Type[1] { typeof(SceneLoad) }, null) ?? throw new MissingMethodException("GameManager+SceneTransitionBeganDelegate", "Invoke"); } } internal static class _ctor { } internal static class BeginInvoke { } internal static class EndInvoke { } } internal static class _BeginSceneTransitionRoutine_d__239 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate void PostfixSignature(object 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 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 (Type.GetType("GameManager+d__239, Assembly-CSharp") ?? throw new Exception("Missing Type: 'GameManager+d__239'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("GameManager+d__239", "MoveNext"); } } internal static class _ctor { } internal static class System_IDisposable_Dispose { } internal static class System_Collections_Generic_IEnumerator_System_Object__get_Current { } internal static class System_Collections_IEnumerator_Reset { } internal static class System_Collections_IEnumerator_get_Current { } } internal static class _FadeSceneInWithDelay_d__266 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate void PostfixSignature(object 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 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 (Type.GetType("GameManager+d__266, Assembly-CSharp") ?? throw new Exception("Missing Type: 'GameManager+d__266'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("GameManager+d__266", "MoveNext"); } } internal static class _ctor { } internal static class System_IDisposable_Dispose { } internal static class System_Collections_Generic_IEnumerator_System_Object__get_Current { } internal static class System_Collections_IEnumerator_Reset { } internal static class System_Collections_IEnumerator_get_Current { } } internal static class _FreezeMoment_d__468 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate void PostfixSignature(object 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 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 (Type.GetType("GameManager+d__468, Assembly-CSharp") ?? throw new Exception("Missing Type: 'GameManager+d__468'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("GameManager+d__468", "MoveNext"); } } internal static class _ctor { } internal static class System_IDisposable_Dispose { } internal static class System_Collections_Generic_IEnumerator_System_Object__get_Current { } internal static class System_Collections_IEnumerator_Reset { } internal static class System_Collections_IEnumerator_get_Current { } } internal static class _FreezeMomentGC_d__469 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate void PostfixSignature(object 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 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 (Type.GetType("GameManager+d__469, Assembly-CSharp") ?? throw new Exception("Missing Type: 'GameManager+d__469'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("GameManager+d__469", "MoveNext"); } } internal static class _ctor { } internal static class System_IDisposable_Dispose { } internal static class System_Collections_Generic_IEnumerator_System_Object__get_Current { } internal static class System_Collections_IEnumerator_Reset { } internal static class System_Collections_IEnumerator_get_Current { } } internal static class _LoadFirstScene_d__356 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate void PostfixSignature(object 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 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 (Type.GetType("GameManager+d__356, Assembly-CSharp") ?? throw new Exception("Missing Type: 'GameManager+d__356'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("GameManager+d__356", "MoveNext"); } } internal static class _ctor { } internal static class System_IDisposable_Dispose { } internal static class System_Collections_Generic_IEnumerator_System_Object__get_Current { } internal static class System_Collections_IEnumerator_Reset { } internal static class System_Collections_IEnumerator_get_Current { } } internal static class _LoadGameFromUIRoutine_d__442 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate void PostfixSignature(object 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 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 (Type.GetType("GameManager+d__442, Assembly-CSharp") ?? throw new Exception("Missing Type: 'GameManager+d__442'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("GameManager+d__442", "MoveNext"); } } internal static class _ctor { } internal static class System_IDisposable_Dispose { } internal static class System_Collections_Generic_IEnumerator_System_Object__get_Current { } internal static class System_Collections_IEnumerator_Reset { } internal static class System_Collections_IEnumerator_get_Current { } } internal static class _LoadGameFromUIRoutine_d__443 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate void PostfixSignature(object 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 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 (Type.GetType("GameManager+d__443, Assembly-CSharp") ?? throw new Exception("Missing Type: 'GameManager+d__443'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("GameManager+d__443", "MoveNext"); } } internal static class _ctor { } internal static class System_IDisposable_Dispose { } internal static class System_Collections_Generic_IEnumerator_System_Object__get_Current { } internal static class System_Collections_IEnumerator_Reset { } internal static class System_Collections_IEnumerator_get_Current { } } internal static class _LoadSceneAdditive_d__348 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate void PostfixSignature(object 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 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 (Type.GetType("GameManager+d__348, Assembly-CSharp") ?? throw new Exception("Missing Type: 'GameManager+d__348'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("GameManager+d__348", "MoveNext"); } } internal static class _ctor { } internal static class System_IDisposable_Dispose { } internal static class System_Collections_Generic_IEnumerator_System_Object__get_Current { } internal static class System_Collections_IEnumerator_Reset { } internal static class System_Collections_IEnumerator_get_Current { } } internal static class _PauseGameToggle_d__461 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate void PostfixSignature(object 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 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 (Type.GetType("GameManager+d__461, Assembly-CSharp") ?? throw new Exception("Missing Type: 'GameManager+d__461'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("GameManager+d__461", "MoveNext"); } } internal static class _ctor { } internal static class System_IDisposable_Dispose { } internal static class System_Collections_Generic_IEnumerator_System_Object__get_Current { } internal static class System_Collections_IEnumerator_Reset { } internal static class System_Collections_IEnumerator_get_Current { } } internal static class _PauseGameToggleByMenu_d__460 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate void PostfixSignature(object 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 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 (Type.GetType("GameManager+d__460, Assembly-CSharp") ?? throw new Exception("Missing Type: 'GameManager+d__460'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("GameManager+d__460", "MoveNext"); } } internal static class _ctor { } internal static class System_IDisposable_Dispose { } internal static class System_Collections_Generic_IEnumerator_System_Object__get_Current { } internal static class System_Collections_IEnumerator_Reset { } internal static class System_Collections_IEnumerator_get_Current { } } internal static class _PlayerDead_d__245 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate void PostfixSignature(object 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 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 (Type.GetType("GameManager+d__245, Assembly-CSharp") ?? throw new Exception("Missing Type: 'GameManager+d__245'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("GameManager+d__245", "MoveNext"); } } internal static class _ctor { } internal static class System_IDisposable_Dispose { } internal static class System_Collections_Generic_IEnumerator_System_Object__get_Current { } internal static class System_Collections_IEnumerator_Reset { } internal static class System_Collections_IEnumerator_get_Current { } } internal static class _PlayerDeadFromHazard_d__246 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate void PostfixSignature(object 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 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 (Type.GetType("GameManager+d__246, Assembly-CSharp") ?? throw new Exception("Missing Type: 'GameManager+d__246'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("GameManager+d__246", "MoveNext"); } } internal static class _ctor { } internal static class System_IDisposable_Dispose { } internal static class System_Collections_Generic_IEnumerator_System_Object__get_Current { } internal static class System_Collections_IEnumerator_Reset { } internal static class System_Collections_IEnumerator_get_Current { } } internal static class _QuitGame_d__483 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate void PostfixSignature(object 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 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 (Type.GetType("GameManager+d__483, Assembly-CSharp") ?? throw new Exception("Missing Type: 'GameManager+d__483'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("GameManager+d__483", "MoveNext"); } } internal static class _ctor { } internal static class System_IDisposable_Dispose { } internal static class System_Collections_Generic_IEnumerator_System_Object__get_Current { } internal static class System_Collections_IEnumerator_Reset { } internal static class System_Collections_IEnumerator_get_Current { } } internal static class _ReturnToMainMenu_d__479 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate void PostfixSignature(object 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 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 (Type.GetType("GameManager+d__479, Assembly-CSharp") ?? throw new Exception("Missing Type: 'GameManager+d__479'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("GameManager+d__479", "MoveNext"); } } internal static class _ctor { } internal static class System_IDisposable_Dispose { } internal static class System_Collections_Generic_IEnumerator_System_Object__get_Current { } internal static class System_Collections_IEnumerator_Reset { } internal static class System_Collections_IEnumerator_get_Current { } } internal static class _RunContinueGame_d__474 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate void PostfixSignature(object 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 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 (Type.GetType("GameManager+d__474, Assembly-CSharp") ?? throw new Exception("Missing Type: 'GameManager+d__474'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("GameManager+d__474", "MoveNext"); } } internal static class _ctor { } internal static class System_IDisposable_Dispose { } internal static class System_Collections_Generic_IEnumerator_System_Object__get_Current { } internal static class System_Collections_IEnumerator_Reset { } internal static class System_Collections_IEnumerator_get_Current { } } internal static class _RunStartNewGame_d__472 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate void PostfixSignature(object 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 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 (Type.GetType("GameManager+d__472, Assembly-CSharp") ?? throw new Exception("Missing Type: 'GameManager+d__472'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("GameManager+d__472", "MoveNext"); } } internal static class _ctor { } internal static class System_IDisposable_Dispose { } internal static class System_Collections_Generic_IEnumerator_System_Object__get_Current { } internal static class System_Collections_IEnumerator_Reset { } internal static class System_Collections_IEnumerator_get_Current { } } internal static class _SetTimeScale_d__463 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate void PostfixSignature(object 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 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 (Type.GetType("GameManager+d__463, Assembly-CSharp") ?? throw new Exception("Missing Type: 'GameManager+d__463'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("GameManager+d__463", "MoveNext"); } } internal static class _ctor { } internal static class System_IDisposable_Dispose { } internal static class System_Collections_Generic_IEnumerator_System_Object__get_Current { } internal static class System_Collections_IEnumerator_Reset { } internal static class System_Collections_IEnumerator_get_Current { } } internal static class _SetTimeScale_d__465 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate void PostfixSignature(object 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 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 (Type.GetType("GameManager+d__465, Assembly-CSharp") ?? throw new Exception("Missing Type: 'GameManager+d__465'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("GameManager+d__465", "MoveNext"); } } internal static class _ctor { } internal static class System_IDisposable_Dispose { } internal static class System_Collections_Generic_IEnumerator_System_Object__get_Current { } internal static class System_Collections_IEnumerator_Reset { } internal static class System_Collections_IEnumerator_get_Current { } } internal static class _SkipCutsceneNoMash_d__381 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate void PostfixSignature(object 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 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 (Type.GetType("GameManager+d__381, Assembly-CSharp") ?? throw new Exception("Missing Type: 'GameManager+d__381'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("GameManager+d__381", "MoveNext"); } } internal static class _ctor { } internal static class System_IDisposable_Dispose { } internal static class System_Collections_Generic_IEnumerator_System_Object__get_Current { } internal static class System_Collections_IEnumerator_Reset { } internal static class System_Collections_IEnumerator_get_Current { } } internal static class _TransitionScene_d__242 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate void PostfixSignature(object 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 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 (Type.GetType("GameManager+d__242, Assembly-CSharp") ?? throw new Exception("Missing Type: 'GameManager+d__242'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("GameManager+d__242", "MoveNext"); } } internal static class _ctor { } internal static class System_IDisposable_Dispose { } internal static class System_Collections_Generic_IEnumerator_System_Object__get_Current { } internal static class System_Collections_IEnumerator_Reset { } internal static class System_Collections_IEnumerator_get_Current { } } internal static class Update { public delegate void PrefixSignature(GameManager self); public delegate void PostfixSignature(GameManager 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(GameManager).GetMethod("Update", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("GameManager", "Update"); } } internal static class SaveGameData { public delegate void PrefixSignature(GameManager self, ref int saveSlot, ref SaveGameData saveData, ref bool showSaveIcon, ref Action ogCallback); public delegate void PostfixSignature(GameManager self, ref int saveSlot, ref SaveGameData saveData, ref bool showSaveIcon, ref Action ogCallback); 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(GameManager).GetMethod("SaveGameData", (BindingFlags)(-1), null, new Type[4] { typeof(int), typeof(SaveGameData), typeof(bool), typeof(Action) }, null) ?? throw new MissingMethodException("GameManager", "SaveGameData"); } } internal static class SetLoadedGameData_SaveGameData_System_Int32 { public delegate void PrefixSignature(GameManager self, ref SaveGameData saveGameData, ref int saveSlot); public delegate void PostfixSignature(GameManager self, ref SaveGameData saveGameData, ref int saveSlot); 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(GameManager).GetMethod("SetLoadedGameData", (BindingFlags)(-1), null, new Type[2] { typeof(SaveGameData), typeof(int) }, null) ?? throw new MissingMethodException("GameManager", "SetLoadedGameData"); } } internal static class Awake { public delegate void PrefixSignature(GameManager self); public delegate void PostfixSignature(GameManager 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(GameManager).GetMethod("Awake", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("GameManager", "Awake"); } } internal static class BeginSceneTransitionRoutine { public delegate void PrefixSignature(GameManager self, ref SceneLoadInfo info); public delegate void PostfixSignature(GameManager self, ref SceneLoadInfo info, ref IEnumerator returnValue); public delegate void PrefixMoveNextSignature(SpeakableEnumerator self); public delegate void PostfixMoveNextSignature(SpeakableEnumerator self, ref bool continueEnumeration); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MonoDetourHook PrefixMoveNext(PrefixMoveNextSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook((MethodBase)StateMachineTarget(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook PostfixMoveNext(PostfixMoveNextSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook((MethodBase)StateMachineTarget(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHookMoveNext(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook((MethodBase)StateMachineTarget(), manipulator, config, applyByDefault); } public static MethodBase Target() { return typeof(GameManager).GetMethod("BeginSceneTransitionRoutine", (BindingFlags)(-1), null, new Type[1] { typeof(SceneLoadInfo) }, null) ?? throw new MissingMethodException("GameManager", "BeginSceneTransitionRoutine"); } public static MethodInfo StateMachineTarget() { return Extensions.GetStateMachineTarget((MethodInfo)Target()); } } internal static class PlayerDead { public delegate void PrefixSignature(GameManager self, ref float waitTime); public delegate void PostfixSignature(GameManager self, ref float waitTime, ref IEnumerator returnValue); public delegate void PrefixMoveNextSignature(SpeakableEnumerator self); public delegate void PostfixMoveNextSignature(SpeakableEnumerator self, ref bool continueEnumeration); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MonoDetourHook PrefixMoveNext(PrefixMoveNextSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook((MethodBase)StateMachineTarget(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook PostfixMoveNext(PostfixMoveNextSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook((MethodBase)StateMachineTarget(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHookMoveNext(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook((MethodBase)StateMachineTarget(), manipulator, config, applyByDefault); } public static MethodBase Target() { return typeof(GameManager).GetMethod("PlayerDead", (BindingFlags)(-1), null, new Type[1] { typeof(float) }, null) ?? throw new MissingMethodException("GameManager", "PlayerDead"); } public static MethodInfo StateMachineTarget() { return Extensions.GetStateMachineTarget((MethodInfo)Target()); } } internal static class BeginSceneTransition { public delegate void PrefixSignature(GameManager self, ref SceneLoadInfo info); public delegate void PostfixSignature(GameManager self, ref SceneLoadInfo info); 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(GameManager).GetMethod("BeginSceneTransition", (BindingFlags)(-1), null, new Type[1] { typeof(SceneLoadInfo) }, null) ?? throw new MissingMethodException("GameManager", "BeginSceneTransition"); } } internal static class ReadyForRespawn { public delegate void PrefixSignature(GameManager self, ref bool isFirstLevelForPlayer); public delegate void PostfixSignature(GameManager self, ref bool isFirstLevelForPlayer); 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(GameManager).GetMethod("ReadyForRespawn", (BindingFlags)(-1), null, new Type[1] { typeof(bool) }, null) ?? throw new MissingMethodException("GameManager", "ReadyForRespawn"); } } internal static class LevelActivated { public delegate void PrefixSignature(GameManager self, ref Scene sceneFrom, ref Scene sceneTo); public delegate void PostfixSignature(GameManager self, ref Scene sceneFrom, ref Scene sceneTo); 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(GameManager).GetMethod("LevelActivated", (BindingFlags)(-1), null, new Type[2] { typeof(Scene), typeof(Scene) }, null) ?? throw new MissingMethodException("GameManager", "LevelActivated"); } } internal static class get_GameState { } internal static class set_GameState { } internal static class add_GamePausedChange { } internal static class remove_GamePausedChange { } internal static class add_GameStateChange { } internal static class remove_GameStateChange { } internal static class add_SceneInit { } internal static class remove_SceneInit { } internal static class get_TimeSlowed { } internal static class get_SceneSeededRandom { } internal static class set_SceneSeededRandom { } internal static class get_inputHandler { } internal static class set_inputHandler { } internal static class get_achievementHandler { } internal static class set_achievementHandler { } internal static class get_AudioManager { } internal static class get_IsCollectingGarbage { } internal static class set_IsCollectingGarbage { } internal static class SpawnInControlManager { } internal static class get_cameraCtrl { } internal static class set_cameraCtrl { } internal static class get_hero_ctrl { } internal static class set_hero_ctrl { } internal static class get_heroLight { } internal static class set_heroLight { } internal static class get_sm { } internal static class set_sm { } internal static class get_ui { } internal static class set_ui { } internal static class get_tilemap { } internal static class set_tilemap { } internal static class get_soulOrb_fsm { } internal static class set_soulOrb_fsm { } internal static class get_soulVessel_fsm { } internal static class set_soulVessel_fsm { } internal static class get_inventoryFSM { } internal static class set_inventoryFSM { } internal static class get_screenFader_fsm { } internal static class set_screenFader_fsm { } internal static class get_PlayTime { } internal static class get_RespawningHero { } internal static class set_RespawningHero { } internal static class add_SavePersistentObjects { } internal static class remove_SavePersistentObjects { } internal static class add_ResetSemiPersistentObjects { } internal static class remove_ResetSemiPersistentObjects { } internal static class add_NextSceneWillActivate { } internal static class remove_NextSceneWillActivate { } internal static class add_UnloadingLevel { } internal static class remove_UnloadingLevel { } internal static class add_RefreshLanguageText { } internal static class remove_RefreshLanguageText { } internal static class add_RefreshParticleLevel { } internal static class remove_RefreshParticleLevel { } internal static class add_OnLoadedBoss { } internal static class remove_OnLoadedBoss { } internal static class add_OnFinishedEnteringScene { } internal static class remove_OnFinishedEnteringScene { } internal static class add_OnBeforeFinishedSceneTransition { } internal static class remove_OnBeforeFinishedSceneTransition { } internal static class add_OnFinishedSceneTransition { } internal static class remove_OnFinishedSceneTransition { } internal static class get_IsInSceneTransition { } internal static class set_IsInSceneTransition { } internal static class get_SuppressRegainControl { } internal static class set_SuppressRegainControl { } internal static class get_HasFinishedEnteringScene { } internal static class get_IsLoadingSceneTransition { } internal static class get_LoadVisualization { } internal static class get_CurrentLoadDuration { } internal static class get_QueuedBlueHealth { } internal static class set_QueuedBlueHealth { } internal static class get_IsFirstLevelForPlayer { } internal static class set_IsFirstLevelForPlayer { } internal static class get_IsWaitingForSceneReady { } internal static class set_IsWaitingForSceneReady { } internal static class get_instance { } internal static class get_SilentInstance { } internal static class get_UnsafeInstance { } internal static class Start { } internal static class OnDestroy { } internal static class UpdateEngagement { } internal static class OnDisable { } internal static class OnApplicationQuit { } internal static class get_LastSceneLoad { } internal static class set_LastSceneLoad { } internal static class add_SceneTransitionBegan { } internal static class remove_SceneTransitionBegan { } internal static class ReportUnload { } internal static class UnloadScene { } internal static class TransitionScene { } internal static class ChangeToScene { } internal static class LeftScene { } internal static class PlayerDeadFromHazard { } internal static class GetRespawnInfo { } internal static class HazardRespawn { } internal static class TimePasses { } internal static class TimePassesElsewhere { } internal static class TimePassesLoadedIn { } internal static class MuchTimePasses { } internal static class StartBlackThreadWorld { } internal static class StartAct3 { } internal static class RemoveIncompleteActiveQuest { } internal static class SethTravelCheck { } internal static class EnteredNewMapZone { } internal static class LoadedFromMenu { } internal static class FixUpSaveState { } internal static class get_BlockNextVibrationFadeIn { } internal static class set_BlockNextVibrationFadeIn { } internal static class FadeSceneIn { } internal static class FadeSceneInWithDelay { } internal static class IsGamePaused { } internal static class SetGameMap { } internal static class CalculateNotchesUsed { } internal static class GetLanguageAsString { } internal static class GetEntryGateName { } internal static class SetDeathRespawnSimple { } internal static class SetNonlethalDeathRespawn { } internal static class SetPlayerDataBool { } internal static class SetPlayerDataInt { } internal static class SetPlayerDataFloat { } internal static class SetPlayerDataString { } internal static class IncrementPlayerDataInt { } internal static class DecrementPlayerDataInt { } internal static class IntAdd { } internal static class GetPlayerDataBool { } internal static class GetPlayerDataInt { } internal static class GetPlayerDataFloat { } internal static class GetPlayerDataString { } internal static class SetPlayerDataVector3 { } internal static class GetPlayerDataVector3 { } internal static class GetNextMossberryValue { } internal static class GetNextSilkGrubValue { } internal static class EquipCharm { } internal static class UnequipCharm { } internal static class RefreshOvercharm { } internal static class UpdateBlueHealth { } internal static class AddBlueHealthQueued { } internal static class SetCurrentMapZoneAsRespawn { } internal static class SetOverrideMapZoneAsRespawn { } internal static class SetMapZoneToSpecific { } internal static class UpdateGameMapWithPopup { } internal static class UpdateGameMap { } internal static class UpdateGameMapPins { } internal static class get_DidPurchasePin { } internal static class set_DidPurchasePin { } internal static class get_DidPurchaseMap { } internal static class set_DidPurchaseMap { } internal static class DoShopCloseGameMapUpdate { } internal static class AddToScenesVisited { } internal static class AddToBenchList { } internal static class AddToGrubList { } internal static class AddToFlameList { } internal static class AddToCocoonList { } internal static class AddToDreamPlantList { } internal static class AddToDreamPlantCList { } internal static class CountGameCompletion { } internal static class CountJournalEntries { } internal static class ActivateTestingCheats { } internal static class GetAllPowerups { } internal static class MapperLeavePreviousLocations { } internal static class AwardAchievement { } internal static class QueueAchievementProgress { } internal static class UpdateAchievementProgress { } internal static class QueueAchievement { } internal static class AwardQueuedAchievements_System_Single { } internal static class AwardQueuedAchievements { } internal static class QueuedMenuStyleUnlock { } internal static class CanUnlockMenuStyle { } internal static class IsAchievementAwarded { } internal static class ClearAllAchievements { } internal static class CheckAllAchievements { } internal static class CheckBellwayAchievements { } internal static class CheckTubeAchievements { } internal static class CheckMapAchievements { } internal static class CheckSubQuestAchievements { } internal static class CheckHeartAchievements { } internal static class CheckSilkSpoolAchievements { } internal static class CheckCompletionAchievements { } internal static class RecordGameComplete { } internal static class SetStatusRecordInt { } internal static class GetStatusRecordInt { } internal static class ResetStatusRecords { } internal static class SaveStatusRecords { } internal static class SetState { } internal static class LoadScene { } internal static class LoadSceneAdditive { } internal static class OnNextLevelReady { } internal static class SkipNormalActorFadeIn { } internal static class SetSkipNextLevelReadyActorFadeIn { } internal static class SimulateSceneStartPhysics { } internal static class OnWillActivateFirstLevel { } internal static class LoadFirstScene { } internal static class LoadPermadeathUnlockScene { } internal static class LoadOpeningCinematic { } internal static class PositionHeroAtSceneEntrance { } internal static class FindEntryPoint { } internal static class FindTransitionPoint { } internal static class EnterHero { } internal static class FinishedEnteringScene { } internal static class SetupGameRefs { } internal static class RegisterEvents { } internal static class UnregisterEvents { } internal static class FindSceneManager { } internal static class EnsureGlobalPool { } internal static class SetupSceneRefs { } internal static class SetupHeroRefs { } internal static class BeginScene { } internal static class UpdateUIStateFromGameState { } internal static class SkipCutscene { } internal static class RegisterSkippable { } internal static class DeregisterSkippable { } internal static class SkipCutsceneNoMash { } internal static class NoLongerFirstGame { } internal static class SetupStatusModifiers { } internal static class RefreshLocalization { } internal static class RefreshParticleSystems { } internal static class ApplyNativeInput { } internal static class EnablePermadeathMode { } internal static class GetCurrentMapZone { } internal static class GetCurrentMapZoneEnum { } internal static class GetSceneWidth { } internal static class GetSceneHeight { } internal static class GetSceneManager { } internal static class GetSceneManagerComponent { } internal static class GetFormattedMapZoneString { } internal static class GetFormattedMapZoneStringV2 { } internal static class GetFormattedAutoSaveNameString { } internal static class UpdateSceneName { } internal static class GetBaseSceneName { } internal static class InternalBaseSceneName { } internal static class GetSceneNameString { } internal static class GetTileMap { } internal static class RefreshTilemapInfo { } internal static class SaveLevelState { } internal static class ResetSemiPersistentItems { } internal static class IsMenuScene { } internal static class IsTitleScreenScene { } internal static class IsGameplayScene { } internal static class IsNonGameplayScene { } internal static class IsCinematicScene { } internal static class IsStagTravelScene { } internal static class IsBossDoorScene { } internal static class ShouldKeepHUDCameraActive { } internal static class HasSaveFile { } internal static class SaveGame_System_Action_1 { } internal static class SaveGameWithAutoSave { } internal static class QueueSaveGame { } internal static class QueueAutoSave { } internal static class DoQueuedSaveGame { } internal static class CancelDoQueuedSaveGame { } internal static class CreateRestorePoint_AutoSaveName_System_Action_1 { } internal static class CreateSaveGameData { } internal static class CreateRestorePoint_System_Int32_AutoSaveName_System_Action_1 { } internal static class ShowSaveIcon { } internal static class HideSaveIcon { } internal static class ResetGameTimer { } internal static class IncreaseGameTimer { } internal static class GetSaveGameData { } internal static class SaveGame_System_Int32_System_Action_1_System_Boolean_AutoSaveName { } internal static class DoSaveRestorePoint { } internal static class PreparePlayerDataForSave { } internal static class LoadGameFromUI_System_Int32 { } internal static class LoadGameFromUI_System_Int32_SaveGameData { } internal static class LoadGameFromUIRoutine_System_Int32 { } internal static class LoadGameFromUIRoutine_System_Int32_SaveGameData { } internal static class LoadGame { } internal static class SetLoadedGameData_System_String_System_Int32 { } internal static class ClearSaveFile { } internal static class GetSaveStatsForSlot { } internal static class GetJsonForSaveBytes { } internal static class GetJsonForSaveBytesStatic { } internal static class GetBytesForSaveJson { } internal static class GetBytesForSaveJsonAsync { } internal static class GetBytesForSaveJsonStatic { } internal static class GetBytesForSaveData { } internal static class GetLoadedSaveSlotData { } internal static class GetSaveStatsFromData { } internal static class PauseGameToggleByMenu { } internal static class PauseGameToggle { } internal static class SetPausedState { } internal static class SetTimeScale_System_Single_System_Single { } internal static class SetTimeScale_System_Single { } internal static class SetTimeScale_TimeManager_TimeControlInstance_System_Single_System_Single { } internal static class FreezeMoment_System_Int32 { } internal static class FreezeMoment_GlobalEnums_FreezeMomentTypes_System_Action { } internal static class FreezeMoment_System_Single_System_Single_System_Single_System_Single_System_Action { } internal static class FreezeMomentGC { } internal static class EnsureSaveSlotSpace { } internal static class StartNewGame { } internal static class RunStartNewGame { } internal static class ContinueGame { } internal static class RunContinueGame { } internal static class LoadGlobalPoolPrefab { } internal static class UnloadGlobalPoolPrefab { } internal static class LoadHeroPrefab { } internal static class UnloadHeroPrefab { } internal static class ReturnToMainMenu { } internal static class ReturnToMainMenuNoSave { } internal static class EmergencyReturnToMenu { } internal static class DoEmergencyQuit { } internal static class QuitGame { } internal static class LoadedBoss { } internal static class DoDestroyPersonalPools { } internal static class GetImplicitCinematicVolume { } internal static class SetIsInventoryOpen { } internal static class CanPickupsExist { } internal static class IsMemoryScene { } internal static class IsMemoryScene_GlobalEnums_MapZone { } internal static class ForceCurrentSceneIsMemory { } internal static class _ctor { } internal static class _cctor { } internal static class SceneSeedTracker { internal static class _ctor { } } internal static class SceneLoadVisualizations { internal static class _ctor { } } internal static class SceneLoadInfo { internal static class _ctor { } internal new static class ToString { } internal static class NotifyFadedOut { } internal static class NotifyFetchComplete { } internal static class IsReadyToActivate { } internal static class NotifyFinished { } } internal static class Rb2dState { internal static class _ctor { } } internal static class __c { internal static class _ctor { } } internal static class __c__DisplayClass239_0 { internal static class _ctor { } } internal static class __c__DisplayClass245_0 { internal static class _ctor { } } internal static class __c__DisplayClass247_0 { internal static class _ctor { } } internal static class __c__DisplayClass362_0 { internal static class _ctor { } } internal static class __c__DisplayClass429_0 { internal static class _ctor { } } internal static class __c__DisplayClass429_1 { internal static class _ctor { } } internal static class __c__DisplayClass436_0 { internal static class _ctor { } } internal static class __c__DisplayClass436_1 { internal static class _ctor { } } internal static class __c__DisplayClass436_2 { internal static class _ctor { } } internal static class __c__DisplayClass436_3 { internal static class _ctor { } } internal static class __c__DisplayClass437_0 { internal static class _ctor { } } internal static class __c__DisplayClass437_1 { internal static class _ctor { } } internal static class __c__DisplayClass437_2 { internal static class _ctor { } } internal static class __c__DisplayClass442_0 { internal static class _ctor { } } internal static class __c__DisplayClass443_0 { internal static class _ctor { } } internal static class __c__DisplayClass444_0 { internal static class _ctor { } } internal static class __c__DisplayClass444_1 { internal static class _ctor { } } internal static class __c__DisplayClass444_2 { internal static class _ctor { } } internal static class __c__DisplayClass447_0 { internal static class _ctor { } } internal static class __c__DisplayClass448_0 { internal static class _ctor { } } internal static class __c__DisplayClass448_1 { internal static class _ctor { } } internal static class __c__DisplayClass448_2 { internal static class _ctor { } } internal static class __c__DisplayClass448_3 { internal static class _ctor { } } internal static class __c__DisplayClass448_4 { internal static class _ctor { } } internal static class __c__DisplayClass448_5 { internal static class _ctor { } } internal static class __c__DisplayClass448_6 { internal static class _ctor { } } internal static class __c__DisplayClass448_7 { internal static class _ctor { } } internal static class __c__DisplayClass448_8 { internal static class _ctor { } } internal static class __c__DisplayClass448_9 { internal static class _ctor { } } internal static class __c__DisplayClass452_0 { internal static class _ctor { } } internal static class __c__DisplayClass452_1 { internal static class _ctor { } } internal static class __c__DisplayClass479_0 { internal static class _ctor { } } internal static class __c__DisplayClass479_1 { internal static class _ctor { } } } namespace Md.HeroController { internal static class HeroSetDelegate { internal static class Invoke { public delegate void PrefixSignature(HeroSetDelegate self, ref HeroController heroController); public delegate ReturnFlow ControlFlowPrefixSignature(HeroSetDelegate self, ref HeroController heroController); public delegate void PostfixSignature(HeroSetDelegate self, ref HeroController heroController); 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(HeroSetDelegate).GetMethod("Invoke", (BindingFlags)(-1), null, new Type[1] { typeof(HeroController) }, null) ?? throw new MissingMethodException("HeroController+HeroSetDelegate", "Invoke"); } } internal static class _ctor { } internal static class BeginInvoke { } internal static class EndInvoke { } } internal static class HeroInPosition { internal static class Invoke { public delegate void PrefixSignature(HeroInPosition self, ref bool forceDirect); public delegate ReturnFlow ControlFlowPrefixSignature(HeroInPosition self, ref bool forceDirect); public delegate void PostfixSignature(HeroInPosition self, ref bool forceDirect); 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(HeroInPosition).GetMethod("Invoke", (BindingFlags)(-1), null, new Type[1] { typeof(bool) }, null) ?? throw new MissingMethodException("HeroController+HeroInPosition", "Invoke"); } } internal static class _ctor { } internal static class BeginInvoke { } internal static class EndInvoke { } } internal static class DamageTakenDelegate { internal static class Invoke { public delegate void PrefixSignature(DamageTakenDelegate self, ref DamageInfo damageInfo); public delegate ReturnFlow ControlFlowPrefixSignature(DamageTakenDelegate self, ref DamageInfo damageInfo); public delegate void PostfixSignature(DamageTakenDelegate 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 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(DamageTakenDelegate).GetMethod("Invoke", (BindingFlags)(-1), null, new Type[1] { typeof(DamageInfo) }, null) ?? throw new MissingMethodException("HeroController+DamageTakenDelegate", "Invoke"); } } internal static class _ctor { } internal static class BeginInvoke { } internal static class EndInvoke { } } internal static class GetState { public delegate void PrefixSignature(HeroController self, ref string stateName); public delegate ReturnFlow ControlFlowPrefixSignature(HeroController self, ref string stateName, ref bool returnValue); public delegate void PostfixSignature(HeroController self, ref string stateName, 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(HeroController).GetMethod("GetState", (BindingFlags)(-1), null, new Type[1] { typeof(string) }, null) ?? throw new MissingMethodException("HeroController", "GetState"); } } internal static class _BetaLeave_d__981 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate ReturnFlow ControlFlowPrefixSignature(object self, ref bool returnValue); public delegate void PostfixSignature(object 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 (Type.GetType("HeroController+d__981, Assembly-CSharp") ?? throw new Exception("Missing Type: 'HeroController+d__981'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("HeroController+d__981", "MoveNext"); } } internal static class _ctor { } internal static class System_IDisposable_Dispose { } internal static class System_Collections_Generic_IEnumerator_System_Object__get_Current { } internal static class System_Collections_IEnumerator_Reset { } internal static class System_Collections_IEnumerator_get_Current { } } internal static class _BetaReturn_d__982 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate ReturnFlow ControlFlowPrefixSignature(object self, ref bool returnValue); public delegate void PostfixSignature(object 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 (Type.GetType("HeroController+d__982, Assembly-CSharp") ?? throw new Exception("Missing Type: 'HeroController+d__982'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("HeroController+d__982", "MoveNext"); } } internal static class _ctor { } internal static class System_IDisposable_Dispose { } internal static class System_Collections_Generic_IEnumerator_System_Object__get_Current { } internal static class System_Collections_IEnumerator_Reset { } internal static class System_Collections_IEnumerator_get_Current { } } internal static class _CocoonFloatRoutine_d__1253 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate ReturnFlow ControlFlowPrefixSignature(object self, ref bool returnValue); public delegate void PostfixSignature(object 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 (Type.GetType("HeroController+d__1253, Assembly-CSharp") ?? throw new Exception("Missing Type: 'HeroController+d__1253'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("HeroController+d__1253", "MoveNext"); } } internal static class _ctor { } internal static class System_IDisposable_Dispose { } internal static class System_Collections_Generic_IEnumerator_System_Object__get_Current { } internal static class System_Collections_IEnumerator_Reset { } internal static class System_Collections_IEnumerator_get_Current { } } internal static class _Die_d__1101 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate ReturnFlow ControlFlowPrefixSignature(object self, ref bool returnValue); public delegate void PostfixSignature(object 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 (Type.GetType("HeroController+d__1101, Assembly-CSharp") ?? throw new Exception("Missing Type: 'HeroController+d__1101'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("HeroController+d__1101", "MoveNext"); } } internal static class _ctor { } internal static class System_IDisposable_Dispose { } internal static class System_Collections_Generic_IEnumerator_System_Object__get_Current { } internal static class System_Collections_IEnumerator_Reset { } internal static class System_Collections_IEnumerator_get_Current { } } internal static class _DieFromHazard_d__1104 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate ReturnFlow ControlFlowPrefixSignature(object self, ref bool returnValue); public delegate void PostfixSignature(object 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 (Type.GetType("HeroController+d__1104, Assembly-CSharp") ?? throw new Exception("Missing Type: 'HeroController+d__1104'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("HeroController+d__1104", "MoveNext"); } } internal static class _ctor { } internal static class System_IDisposable_Dispose { } internal static class System_Collections_Generic_IEnumerator_System_Object__get_Current { } internal static class System_Collections_IEnumerator_Reset { } internal static class System_Collections_IEnumerator_get_Current { } } internal static class _EnterHeroSubFadeUp_d__976 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate ReturnFlow ControlFlowPrefixSignature(object self, ref bool returnValue); public delegate void PostfixSignature(object 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 (Type.GetType("HeroController+d__976, Assembly-CSharp") ?? throw new Exception("Missing Type: 'HeroController+d__976'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("HeroController+d__976", "MoveNext"); } } internal static class _ctor { } internal static class System_IDisposable_Dispose { } internal static class System_Collections_Generic_IEnumerator_System_Object__get_Current { } internal static class System_Collections_IEnumerator_Reset { } internal static class System_Collections_IEnumerator_get_Current { } } internal static class _EnterHeroSubHorizontal_d__975 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate ReturnFlow ControlFlowPrefixSignature(object self, ref bool returnValue); public delegate void PostfixSignature(object 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 (Type.GetType("HeroController+d__975, Assembly-CSharp") ?? throw new Exception("Missing Type: 'HeroController+d__975'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("HeroController+d__975", "MoveNext"); } } internal static class _ctor { } internal static class System_IDisposable_Dispose { } internal static class System_Collections_Generic_IEnumerator_System_Object__get_Current { } internal static class System_Collections_IEnumerator_Reset { } internal static class System_Collections_IEnumerator_get_Current { } } internal static class _EnterScene_d__974 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate ReturnFlow ControlFlowPrefixSignature(object self, ref bool returnValue); public delegate void PostfixSignature(object 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 (Type.GetType("HeroController+d__974, Assembly-CSharp") ?? throw new Exception("Missing Type: 'HeroController+d__974'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("HeroController+d__974", "MoveNext"); } } internal static class _ctor { } internal static class System_IDisposable_Dispose { } internal static class System_Collections_Generic_IEnumerator_System_Object__get_Current { } internal static class System_Collections_IEnumerator_Reset { } internal static class System_Collections_IEnumerator_get_Current { } } internal static class _FirstFadeIn_d__1112 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate ReturnFlow ControlFlowPrefixSignature(object self, ref bool returnValue); public delegate void PostfixSignature(object 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 (Type.GetType("HeroController+d__1112, Assembly-CSharp") ?? throw new Exception("Missing Type: 'HeroController+d__1112'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("HeroController+d__1112", "MoveNext"); } } internal static class _ctor { } internal static class System_IDisposable_Dispose { } internal static class System_Collections_Generic_IEnumerator_System_Object__get_Current { } internal static class System_Collections_IEnumerator_Reset { } internal static class System_Collections_IEnumerator_get_Current { } } internal static class _HazardRespawn_d__986 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate ReturnFlow ControlFlowPrefixSignature(object self, ref bool returnValue); public delegate void PostfixSignature(object 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 (Type.GetType("HeroController+d__986, Assembly-CSharp") ?? throw new Exception("Missing Type: 'HeroController+d__986'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("HeroController+d__986", "MoveNext"); } } internal static class _ctor { } internal static class System_IDisposable_Dispose { } internal static class System_Collections_Generic_IEnumerator_System_Object__get_Current { } internal static class System_Collections_IEnumerator_Reset { } internal static class System_Collections_IEnumerator_get_Current { } } internal static class _Invulnerable_d__1109 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate ReturnFlow ControlFlowPrefixSignature(object self, ref bool returnValue); public delegate void PostfixSignature(object 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 (Type.GetType("HeroController+d__1109, Assembly-CSharp") ?? throw new Exception("Missing Type: 'HeroController+d__1109'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("HeroController+d__1109", "MoveNext"); } } internal static class _ctor { } internal static class System_IDisposable_Dispose { } internal static class System_Collections_Generic_IEnumerator_System_Object__get_Current { } internal static class System_Collections_IEnumerator_Reset { } internal static class System_Collections_IEnumerator_get_Current { } } internal static class _MoveToPositionX_d__1241 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate ReturnFlow ControlFlowPrefixSignature(object self, ref bool returnValue); public delegate void PostfixSignature(object 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 (Type.GetType("HeroController+d__1241, Assembly-CSharp") ?? throw new Exception("Missing Type: 'HeroController+d__1241'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("HeroController+d__1241", "MoveNext"); } } internal static class _ctor { } internal static class System_IDisposable_Dispose { } internal static class System_Collections_Generic_IEnumerator_System_Object__get_Current { } internal static class System_Collections_IEnumerator_Reset { } internal static class System_Collections_IEnumerator_get_Current { } } internal static class _Respawn_d__983 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate ReturnFlow ControlFlowPrefixSignature(object self, ref bool returnValue); public delegate void PostfixSignature(object 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 (Type.GetType("HeroController+d__983, Assembly-CSharp") ?? throw new Exception("Missing Type: 'HeroController+d__983'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("HeroController+d__983", "MoveNext"); } } internal static class _ctor { } internal static class System_IDisposable_Dispose { } internal static class System_Collections_Generic_IEnumerator_System_Object__get_Current { } internal static class System_Collections_IEnumerator_Reset { } internal static class System_Collections_IEnumerator_get_Current { } } internal static class _StartRecoil_d__1105 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate ReturnFlow ControlFlowPrefixSignature(object self, ref bool returnValue); public delegate void PostfixSignature(object 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 (Type.GetType("HeroController+d__1105, Assembly-CSharp") ?? throw new Exception("Missing Type: 'HeroController+d__1105'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("HeroController+d__1105", "MoveNext"); } } internal static class _ctor { } internal static class System_IDisposable_Dispose { } internal static class System_Collections_Generic_IEnumerator_System_Object__get_Current { } internal static class System_Collections_IEnumerator_Reset { } internal static class System_Collections_IEnumerator_get_Current { } } internal static class _TilemapTestPause_d__1162 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate ReturnFlow ControlFlowPrefixSignature(object self, ref bool returnValue); public delegate void PostfixSignature(object 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 (Type.GetType("HeroController+d__1162, Assembly-CSharp") ?? throw new Exception("Missing Type: 'HeroController+d__1162'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("HeroController+d__1162", "MoveNext"); } } internal static class _ctor { } internal static class System_IDisposable_Dispose { } internal static class System_Collections_Generic_IEnumerator_System_Object__get_Current { } internal static class System_Collections_IEnumerator_Reset { } internal static class System_Collections_IEnumerator_get_Current { } } internal static class RefreshSilk { public delegate void PrefixSignature(HeroController self); public delegate ReturnFlow ControlFlowPrefixSignature(HeroController self); public delegate void PostfixSignature(HeroController 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(HeroController).GetMethod("RefreshSilk", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("HeroController", "RefreshSilk"); } } internal static class Die { public delegate void PrefixSignature(HeroController self, ref bool nonLethal, ref bool frostDeath); public delegate ReturnFlow ControlFlowPrefixSignature(HeroController self, ref bool nonLethal, ref bool frostDeath, ref IEnumerator returnValue); public delegate void PostfixSignature(HeroController self, ref bool nonLethal, ref bool frostDeath, ref IEnumerator returnValue); public delegate void PrefixMoveNextSignature(SpeakableEnumerator self); public delegate ReturnFlow ControlFlowPrefixMoveNextSignature(SpeakableEnumerator self, ref bool continueEnumeration); public delegate void PostfixMoveNextSignature(SpeakableEnumerator self, ref bool continueEnumeration); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MonoDetourHook PrefixMoveNext(PrefixMoveNextSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook((MethodBase)StateMachineTarget(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefixMoveNext(ControlFlowPrefixMoveNextSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook((MethodBase)StateMachineTarget(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook PostfixMoveNext(PostfixMoveNextSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook((MethodBase)StateMachineTarget(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHookMoveNext(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook((MethodBase)StateMachineTarget(), manipulator, config, applyByDefault); } public static MethodBase Target() { return typeof(HeroController).GetMethod("Die", (BindingFlags)(-1), null, new Type[2] { typeof(bool), typeof(bool) }, null) ?? throw new MissingMethodException("HeroController", "Die"); } public static MethodInfo StateMachineTarget() { return Extensions.GetStateMachineTarget((MethodInfo)Target()); } } internal static class Update { public delegate void PrefixSignature(HeroController self); public delegate ReturnFlow ControlFlowPrefixSignature(HeroController self); public delegate void PostfixSignature(HeroController 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(HeroController).GetMethod("Update", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("HeroController", "Update"); } } internal static class MaxHealth { public delegate void PrefixSignature(HeroController self); public delegate ReturnFlow ControlFlowPrefixSignature(HeroController self); public delegate void PostfixSignature(HeroController 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(HeroController).GetMethod("MaxHealth", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("HeroController", "MaxHealth"); } } internal static class RefillAll { public delegate void PrefixSignature(HeroController self); public delegate ReturnFlow ControlFlowPrefixSignature(HeroController self); public delegate void PostfixSignature(HeroController 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(HeroController).GetMethod("RefillAll", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("HeroController", "RefillAll"); } } internal static class AddToMaxHealth { public delegate void PrefixSignature(HeroController self, ref int amount); public delegate ReturnFlow ControlFlowPrefixSignature(HeroController self, ref int amount); public delegate void PostfixSignature(HeroController self, ref int amount); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return typeof(HeroController).GetMethod("AddToMaxHealth", (BindingFlags)(-1), null, new Type[1] { typeof(int) }, null) ?? throw new MissingMethodException("HeroController", "AddToMaxHealth"); } } internal static class Awake { public delegate void PrefixSignature(HeroController self); public delegate ReturnFlow ControlFlowPrefixSignature(HeroController self); public delegate void PostfixSignature(HeroController 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(HeroController).GetMethod("Awake", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("HeroController", "Awake"); } } internal static class Pause { public delegate void PrefixSignature(HeroController self); public delegate ReturnFlow ControlFlowPrefixSignature(HeroController self); public delegate void PostfixSignature(HeroController 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(HeroController).GetMethod("Pause", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("HeroController", "Pause"); } } internal static class ResetSilkRegen { public delegate void PrefixSignature(HeroController self); public delegate ReturnFlow ControlFlowPrefixSignature(HeroController self); public delegate void PostfixSignature(HeroController 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(HeroController).GetMethod("ResetSilkRegen", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("HeroController", "ResetSilkRegen"); } } internal static class AddSilk_System_Int32_System_Boolean_SilkSpool_SilkAddSource_System_Boolean { public delegate void PrefixSignature(HeroController self, ref int amount, ref bool heroEffect, ref SilkAddSource source, ref bool forceCanBindEffect); public delegate ReturnFlow ControlFlowPrefixSignature(HeroController self, ref int amount, ref bool heroEffect, ref SilkAddSource source, ref bool forceCanBindEffect); public delegate void PostfixSignature(HeroController self, ref int amount, ref bool heroEffect, ref SilkAddSource source, ref bool forceCanBindEffect); 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(HeroController).GetMethod("AddSilk", (BindingFlags)(-1), null, new Type[4] { typeof(int), typeof(bool), typeof(SilkAddSource), typeof(bool) }, null) ?? throw new MissingMethodException("HeroController", "AddSilk"); } } internal static class DoSilkRegen { public delegate void PrefixSignature(HeroController self); public delegate ReturnFlow ControlFlowPrefixSignature(HeroController self); public delegate void PostfixSignature(HeroController 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(HeroController).GetMethod("DoSilkRegen", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("HeroController", "DoSilkRegen"); } } internal static class StartSilkRegen { public delegate void PrefixSignature(HeroController self); public delegate ReturnFlow ControlFlowPrefixSignature(HeroController self); public delegate void PostfixSignature(HeroController 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(HeroController).GetMethod("StartSilkRegen", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("HeroController", "StartSilkRegen"); } } internal static class get_CurrentNailChargeTime { } internal static class get_CurrentNailChargeBeginTime { } internal static class get_HeroLockState { } internal static class set_HeroLockState { } internal static class get_CanTurn { } internal static class get_fallTimer { } internal static class set_fallTimer { } internal static class get_AudioCtrl { } internal static class get_Bounds { } internal static class get_proxyFSM { } internal static class set_proxyFSM { } internal static class get_NailImbuement { } internal static class set_NailImbuement { } internal static class get_IsSprintMasterActive { } internal static class get_IsGravityApplied { } internal static class set_IsGravityApplied { } internal static class get_sceneEntryGate { } internal static class set_sceneEntryGate { } internal static class get_PositionHistory { } internal static class add_FrostAmountUpdated { } internal static class remove_FrostAmountUpdated { } internal static class add_OnDoubleJumped { } internal static class remove_OnDoubleJumped { } internal static class get_ForceWalkingSound { } internal static class set_ForceWalkingSound { } internal static class get_ForceRunningSound { } internal static class set_ForceRunningSound { } internal static class get_IsStunned { } internal static class set_IsStunned { } internal static class get_SlashComponent { } internal static class set_SlashComponent { } internal static class add_OnHeroInstanceSet { } internal static class remove_OnHeroInstanceSet { } internal static class add_preHeroInPosition { } internal static class remove_preHeroInPosition { } internal static class add_heroInPosition { } internal static class remove_heroInPosition { } internal static class add_heroInPositionDelayed { } internal static class remove_heroInPositionDelayed { } internal static class add_OnTakenDamage { } internal static class remove_OnTakenDamage { } internal static class add_OnTakenDamageExtra { } internal static class remove_OnTakenDamageExtra { } internal static class add_OnDeath { } internal static class remove_OnDeath { } internal static class add_OnHazardDeath { } internal static class remove_OnHazardDeath { } internal static class add_OnHazardRespawn { } internal static class remove_OnHazardRespawn { } internal static class add_BeforeApplyConveyorSpeed { } internal static class remove_BeforeApplyConveyorSpeed { } internal static class add_FlippedSprite { } internal static class remove_FlippedSprite { } internal static class add_HeroLeavingScene { } internal static class remove_HeroLeavingScene { } internal static class get_WarriorState { } internal static class get_ReaperState { } internal static class get_HunterUpgState { } internal static class get_WandererState { } internal static class set_WandererState { } internal static class get_IsUsingQuickening { } internal static class get_IsInLifebloodState { } internal static class set_IsInLifebloodState { } internal static class get_IsWandererLucky { } internal static class get_PoisonHealthCount { } internal static class set_PoisonHealthCount { } internal static class get_Body { } internal static class get_HasAnimationControl { } internal static class get_AnimCtrl { } internal static class get_instance { } internal static class get_SilentInstance { } internal static class get_UnsafeInstance { } internal static class get_Config { } internal static class get_CurrentConfigGroup { } internal static class set_CurrentConfigGroup { } internal static class get_SpriteFlash { } internal static class get_TagDamageEffectPos { } internal static class get_IsRefillSoundsSuppressed { } internal static class get_ForceClampTerminalVelocity { } internal static class set_ForceClampTerminalVelocity { } internal static class get_CriticalHealthValue { } internal static class OnValidate { } internal static class OnDestroy { } internal static class SpawnChildPrefab_UnityEngine_GameObject { } internal static class Start { } internal static class SendPreHeroInPosition { } internal static class SendHeroInPosition { } internal static class UpdateConfig { } internal static class SetConfigGroup { } internal static class SceneInit { } internal static class SetIsMaggoted { } internal static class AddToMaggotCharmTimer { } internal static class DidMaggotCharmHit { } internal static class TickFrostEffect { } internal static class SpawnDeliveryItemEffect { } internal static class RemoveDeliveryItemEffect { } internal static class SetupDeliveryItems { } internal static class TickDeliveryItems { } internal static class GetDeliveryTimers { } internal static class GetTotalFrostSpeed { } internal static class TickSilkEat { } internal static class ShuttleCockCancel { } internal static class ShuttleCockCancelInert { } internal static class FixedUpdate { } internal static class ShoveOff { } internal static class UpdateMoveInput { } internal static class DoMovement { } internal static class DoRecoilMovement { } internal static class ConveyorReset { } internal static class SetBlockSteepSlopes { } internal static class IsSteepSlopeRayHitting { } internal static class UpdateSteepSlopes { } internal static class UpdateEdgeAdjust { } internal static class GetWillThrowTool { } internal static class CanThrowTool_ToolItem_AttackToolBinding_System_Boolean { } internal static class SetToolCooldown { } internal static class ThrowTool { } internal static class DidUseAttackTool { } internal static class ThrowToolEnd { } internal static class QueueLifeBloodStateQuick { } internal static class EnterLifebloodStateQuick { } internal static class TrySetCorrectFacing { } internal static class DoEdgeAdjust { } internal static class Update10 { } internal static class LateUpdate { } internal static class OnLevelUnload { } internal static class OnDisable { } internal static class Move { } internal static class Jump { } internal static class DoubleJump { } internal static class SetSlashComponent { } internal static class DoAttack { } internal static class IncrementAttackCounter { } internal static class Attack { } internal static class AttackCancelWallSlide { } internal static class QueueCancelDownAttack { } internal static class DownAttack { } internal static class DidAttack { } internal static class Dash { } internal static class BackDash { } internal static class Downspike { } internal static class StartAirHang { } internal static class FaceRight { } internal static class FaceLeft { } internal static class ChangedFacing { } internal static class SetBackOnGround { } internal static class SetStartWithWallslide { } internal static class TryFsmCancelToWallSlide { } internal static class SetStartWithShuttlecock { } internal static class SetStartWithJump { } internal static class SetStartWithWallJump { } internal static class SetStartWithTinyJump { } internal static class SetStartWithFlipJump { } internal static class SilkChargeEnd { } internal static class HarpoonDashEnd { } internal static class SetStartWithAnyJump { } internal static class SetStartWithFullJump { } internal static class SetStartWithBackflipJump { } internal static class SetStartWithBrolly { } internal static class SetStartWithDoubleJump { } internal static class SetStartWithWallsprintLaunch { } internal static class SetStartWithDash { } internal static class SetStartWithDashKeepFacing { } internal static class SetStartWithAttack { } internal static class SetStartWithToolThrow { } internal static class SetStartWithDashStabBounce { } internal static class SetStartWithDownSpikeBounce { } internal static class SetStartWithDownSpikeBounceSlightlyShort { } internal static class SetStartWithDownSpikeBounceShort { } internal static class ResetAnimationDownspikeBounce { } internal static class SetStartWithDownSpikeEnd { } internal static class SetStartWithBalloonBounce { } internal static class SetStartWithHarpoonBounce { } internal static class CancelQueuedBounces { } internal static class SetStartWithWitchSprintBounce { } internal static class SetStartWithUpdraftExit { } internal static class SetStartWithScrambleLeap { } internal static class SetStartWithRecoilBack { } internal static class SetStartWithRecoilBackLong { } internal static class SetStartWithWhipPullRecoil { } internal static class SetSuperDashExit { } internal static class SetQuakeExit { } internal static class SetTakeNoDamage { } internal static class EndTakeNoDamage { } internal static class SetStartFromMantle { } internal static class SetStartFromReaperUpperslash { } internal static class SetHeroParent { } internal static class SetBlockFsmMove { } internal static class IsSwimming { } internal static class AddFrost { } internal static class SetFrostAmount { } internal static class NotSwimming { } internal static class GetAirdashed { } internal static class GetCanAirDashCancel { } internal static class EnableRenderer { } internal static class ResetAirMoves { } internal static class SetConveyorSpeed { } internal static class EnterWithoutInput { } internal static class SetDarkness { } internal static class CancelHeroJump { } internal static class StartHarpoonDashCooldown { } internal static class StartHarpoonDashCooldownShort { } internal static class CharmUpdate { } internal static class UpdateBlueHealth { } internal static class HitMaxBlueHealth { } internal static class HitMaxBlueHealthBurst { } internal static class GetMaxFallVelocity { } internal static class ResetLifebloodState { } internal static class checkEnvironment { } internal static class SetBenchRespawn_System_String_System_String_System_Int32_System_Boolean { } internal static class SetBenchRespawn_RespawnMarker_System_String_System_Int32 { } internal static class SetHazardRespawn { } internal static class AddGeo { } internal static class ToZero { } internal static class AddGeoQuietly { } internal static class AddGeoToCounter { } internal static class TakeGeo { } internal static class AddShards { } internal static class TakeShards { } internal static class AddCurrency { } internal static class TakeCurrency { } internal static class GetCurrencyAmount { } internal static class TempStoreCurrency { } internal static class RestoreTempStoredCurrency { } internal static class UpdateGeo { } internal static class CanInput { } internal static class IsPaused { } internal static class IsHunterCrestEquipped { } internal static class IsArchitectCrestEquipped { } internal static class IsShamanCrestEquipped { } internal static class FlipSprite { } internal static class RefreshFacing { } internal static class RefreshScale { } internal static class NeedleArtRecovery { } internal static class CrestAttackRecovery { } internal static class NailParry { } internal static class IsParrying { } internal static class IsParryingActive { } internal static class NailParryRecover { } internal static class QuakeInvuln { } internal static class CrossStitchInvuln { } internal static class StartRevengeWindow { } internal static class StartWandererDashComboWindow { } internal static class ForceSoftLanding { } internal static class PlaySoftLandingEffect { } internal static class TakeQuickDamage_System_Int32_System_Boolean { } internal static class TakeQuickDamage_System_Int32_System_Boolean_System_Boolean { } internal static class TakeQuickDamageSimple { } internal static class TakeFrostDamage { } internal static class TakeChompDamage { } internal static class ApplyTagDamage { } internal static class DoSpecialDamage { } internal static class CriticalDamage { } internal static class CheckParry { } internal static class TakeDamage { } internal static class CheckDeathCatch { } internal static class ActivateVoidAcid { } internal static class IsLavaBellActive { } internal static class UseLavaBell { } internal static class GetLuckyDiceShieldThreshold { } internal static class GetLuckModifier { } internal static class DamageSelf { } internal static class CanTryHarpoonDash { } internal static class HeroDamaged { } internal static class SendHeroDamagedEvent { } internal static class SendHeroDamagedEvent_HeroController_DamageInfo { } internal static class HeroRespawned { } internal static class DoBindReminder { } internal static class WillDoBellBindHit { } internal static class WillDoBellBindHit_System_Boolean { } internal static class DoMossToolHit { } internal static class GetEntryGateName { } internal static class GetShuttlecockTime { } internal static class SilkGain { } internal static class SilkGain_HitInstance { } internal static class NailHitEnemy { } internal static class GetRageModeHealCap { } internal static class GetWitchHealCap { } internal static class GetReaperPayout { } internal static class ResetAllCrestStateMinimal { } internal static class ResetAllCrestState { } internal static class ResetAllCrestState_System_Boolean { } internal static class ResetWarriorRageEffect { } internal static class ResetWarriorCrestState { } internal static class ResetReaperCrestState { } internal static class SetSilkPartsTimeLeft { } internal static class ResetHunterUpgCrestState { } internal static class ResetWandererCrestState { } internal static class AddSilk_System_Int32_System_Boolean { } internal static class ReduceOdours { } internal static class AddSilk_System_Int32_System_Boolean_SilkSpool_SilkAddSource { } internal static class RefillSilkToMax { } internal static class AddFinalMaxSilk { } internal static class AddSilkParts_System_Int32 { } internal static class AddSilkParts_System_Int32_System_Boolean { } internal static class TakeSilk_System_Int32 { } internal static class TakeSilk_System_Int32_SilkSpool_SilkTakeSource { } internal static class ClearSpoolMossChunks { } internal static class MaxRegenSilk { } internal static class MaxRegenSilkInstant { } internal static class SetSilkRegenBlocked { } internal static class SetSilkRegenBlockedSilkHeart { } internal static class UpdateSilkCursed { } internal static class AddHealth { } internal static class RefillHealthToMax { } internal static class SuppressRefillSound { } internal static class RefillSilkToMaxSilent { } internal static class BindCompleted { } internal static class RestartWarriorRageEffect { } internal static class BindInterrupted { } internal static class TakeHealth { } internal static class MaxHealthKeepBlue { } internal static class AddToMaxSilk { } internal static class AddToMaxSilkRegen { } internal static class IsHealthCritical { } internal static class DownspikeBounce { } internal static class DownspikeBounceSlightlyShort { } internal static class DownspikeBounceShort { } internal static class Bounce { } internal static class BounceShort { } internal static class BounceHigh { } internal static class ShroomBounce { } internal static class RecoilLeft { } internal static class RecoilRight { } internal static class RecoilRightLong { } internal static class RecoilLeftLong { } internal static class CanRecoil { } internal static class CanCustomRecoil { } internal static class PreventRecoil { } internal static class AllowRecoil { } internal static class Recoil_System_Boolean_System_Boolean { } internal static class DrillDash { } internal static class DrillPull { } internal static class Recoil_System_Int32_System_Single { } internal static class Recoil_System_Boolean_System_Int32_System_Single { } internal static class ChargeSlashRecoilRight { } internal static class ChargeSlashRecoilLeft { } internal static class RecoilDown { } internal static class ForceHardLanding { } internal static class EnterUpdraft { } internal static class ExitUpdraft { } internal static class ResetUpdraft { } internal static class AllowMantle { } internal static class EnterSceneDreamGate { } internal static class EnterScene { } internal static class EnterHeroSubHorizontal { } internal static class EnterHeroSubFadeUp { } internal static class GetSceneFadeUpPadding { } internal static class MoveIfNotInDontDestroyOnLoad { } internal static class ResetHeroInPositionState { } internal static class LeaveScene { } internal static class BetaLeave { } internal static class BetaReturn { } internal static class Respawn { } internal static class HazardRespawnReset { } internal static class ResetShuttlecock { } internal static class HazardRespawn { } internal static class GetCState { } internal static class SetCState { } internal static class CStateExists { } internal static class ResetHardLandingTimer { } internal static class CancelSuperDash { } internal static class CancelDownSpike { } internal static class CancelDownSpikeBounces { } internal static class RelinquishControlNotVelocity { } internal static class get_ControlVersion { } internal static class set_ControlVersion { } internal static class RelinquishControl { } internal static class RegainControl { } internal static class RegainControl_System_Boolean { } internal static class OnShuttleCockJump { } internal static class PreventCastByDialogueEnd { } internal static class CanDoFsmMove { } internal static class IsHardLanding { } internal static class CanCast { } internal static class CanBind { } internal static class CanDoFSMCancelMove { } internal static class CanDoSpecial { } internal static class CanNailArt { } internal static class CanQuickMap { } internal static class CanQuickMapBench { } internal static class CanQuickMap_System_Boolean { } internal static class IsLostInSlab { } internal static class HasNoMap { } internal static class CanInspect { } internal static class CanBackDash { } internal static class CanPlayNeedolin { } internal static class HasNeedolin { } internal static class CanInteract { } internal static class CanTakeControl { } internal static class CanOpenInventory { } internal static class SetDamageMode_System_Int32 { } internal static class SetDamageModeFSM { } internal static class ResetQuakeDamage { } internal static class SetDamageMode_GlobalEnums_DamageMode { } internal static class get_AnimationControlVersion { } internal static class set_AnimationControlVersion { } internal static class StopAnimationControl { } internal static class StopAnimationControlVersioned { } internal static class StartAnimationControl { } internal static class StartAnimationControl_System_Int32 { } internal static class StartAnimationControlRunning { } internal static class StartAnimationControlToIdle { } internal static class StartAnimationControlToIdleForcePlay { } internal static class IgnoreInput { } internal static class IgnoreInputWithoutReset { } internal static class AcceptInput { } internal static class UnPause { } internal static class NearBench { } internal static class SetWalkZone { } internal static class ResetState { } internal static class StopPlayingAudio { } internal static class PauseAudio { } internal static class UnPauseAudio { } internal static class PauseInput { } internal static class UnPauseInput { } internal static class SetCanSoftLand { } internal static class TrySpawnSoftLandingPrefab { } internal static class CanSoftLand { } internal static class PreventSoftLand { } internal static class SpawnSoftLandingPrefab { } internal static class AffectedByGravity { } internal static class TryRestoreGravity { } internal static class ResetGravity { } internal static class ResetVelocity { } internal static class AddInputBlocker { } internal static class RemoveInputBlocker { } internal static class IsInputBlocked { } internal static class IsPressingOnlyDown { } internal static class LookForInput { } internal static class ForceTouchingWall { } internal static class BeginWallSlide { } internal static class WallKickoff { } internal static class TryDoWallJumpFromMove { } internal static class LookForQueueInput { } internal static class ResetInputQueues { } internal static class HeroJump { } internal static class ResetStartWithJumps { } internal static class PreventShuttlecock { } internal static class HeroJump_System_Boolean { } internal static class OnHeroJumped { } internal static class BecomeAirborne { } internal static class HeroJumpNoEffect { } internal static class ClearActionsInputState { } internal static class ClearJumpInputState { } internal static class DoWallJump { } internal static class DoDoubleJump { } internal static class SetBlockFootstepAudio { } internal static class StartFloat { } internal static class DoHardLanding { } internal static class DoHardLandingEffect { } internal static class DoHardLandingEffectNoHit { } internal static class HeroDashPressed { } internal static class HeroDash { } internal static class SetDashCooldownTimer { } internal static class StartDashEffect { } internal static class StartFallRumble { } internal static class IsOnWall { } internal static class CanExitNoInput { } internal static class SetState { } internal static class FinishedEnteringScene { } internal static class ResetSceneExitedStates { } internal static class GetHeroDeathPrefab { } internal static class ElevatorReset { } internal static class DieFromHazard { } internal static class StartRecoil { } internal static class StartInvulnerable { } internal static class Invulnerable { } internal static class AddInvulnerabilitySource { } internal static class RemoveInvulnerabilitySource { } internal static class FirstFadeIn { } internal static class FallCheck { } internal static class OutOfBoundsCheck { } internal static class ConfirmOutOfBounds { } internal static class FailSafeChecks { } internal static class LocateSpawnPoint { } internal static class CancelJump { } internal static class CancelDoubleJump { } internal static class CancelDash { } internal static class StopDashEffect { } internal static class CancelWallsliding { } internal static class CancelBackDash { } internal static class CancelDownAttack { } internal static class CancelAttack { } internal static class CancelAttack_System_Boolean { } internal static class CancelDownspike { } internal static class CancelDownspikeAndDamage { } internal static class CancelAttackNotDownspikeBounce { } internal static class CancelAttackNotDownspikeBounce_System_Boolean { } internal static class CancelAttackNotSlash { } internal static class CancelBounce { } internal static class CancelRecoilHorizontal { } internal static class CancelDamageRecoil { } internal static class CancelDamageRecoilSimple { } internal static class CancelFallEffects { } internal static class ResetAttacksShared { } internal static class ResetAttacks { } internal static class StopNailChargeEffects { } internal static class CancelNailCharge { } internal static class ResetAttacksDash { } internal static class ResetMotion { } internal static class ResetMotionNotVelocity { } internal static class ResetLook { } internal static class ResetInput { } internal static class CheckAndRequestUnlock { } internal static class IsBlocked { } internal static class AddLockStates { } internal static class RemoveLockStates { } internal static class SetLockStates { } internal static class AddUnlockRequest { } internal static class RemoveUnlockRequest { } internal static class BackOnGround { } internal static class JumpReleased { } internal static class SetDoFullJump { } internal static class FinishedDashing { } internal static class FinishDownspike { } internal static class FinishDownspike_System_Boolean { } internal static class SetStartingMotionState { } internal static class SetStartingMotionState_System_Boolean { } internal static class TileMapTest { } internal static class TilemapTestPause { } internal static class StopTilemapTest { } internal static class TryDoTerrainThunk { } internal static class ResetFixedUpdateCaches { } internal static class CheckStillTouchingWall { } internal static class CheckForBump_GlobalEnums_CollisionSide { } internal static class CheckForBump_GlobalEnums_CollisionSide_out_System_Boolean_out_System_Boolean_out_System_Boolean { } internal static class CheckNearRoof { } internal static class CheckClamberLedge { } internal static class CheckTouchingGround { } internal static class CheckTouchingGround_System_Boolean { } internal static class CheckTouching { } internal static class CheckTouchingAdvanced { } internal static class FindCollisionDirection { } internal static class CanJump { } internal static class AllowShuttleCock { } internal static class CouldJumpCancel { } internal static class CanDoubleJump { } internal static class CanInfiniteAirJump { } internal static class CanSwim { } internal static class CanDash { } internal static class DashCooldownReady { } internal static class HasHarpoonDash { } internal static class CanHarpoonDash { } internal static class CanSprint { } internal static class CanSuperJump { } internal static class CanAttack { } internal static class ThrowToolCooldownReady { } internal static class CanThrowTool { } internal static class CanThrowTool_System_Boolean { } internal static class CanStartWithThrowTool { } internal static class CanAttackAction { } internal static class CanDownAttack { } internal static class TryQueueWallJumpInterrupt { } internal static class IsAttackLocked { } internal static class IsDashLocked { } internal static class CanFloat { } internal static class IsApproachingSolidGround { } internal static class CanNailCharge { } internal static class IsFacingNearWall_System_Single_UnityEngine_Color { } internal static class IsFacingNearWall_System_Boolean_System_Single_UnityEngine_Color { } internal static class IsFacingNearWall_System_Single_UnityEngine_Color_out_UnityEngine_Collider2D { } internal static class IsFacingNearWall_System_Boolean_System_Single_UnityEngine_Color_out_UnityEngine_Collider2D { } internal static class IsFacingNearSlideableWall { } internal static class CanStartWithWallSlide { } internal static class CanWallSlide { } internal static class CanContinueWallSlide { } internal static class CanTakeDamage { } internal static class CanTakeDamageIgnoreInvul { } internal static class CanBeGrabbed_System_Boolean { } internal static class CanBeGrabbed { } internal static class CanBeBarnacleGrabbed { } internal static class CanWallJump { } internal static class CanChainWallJumps { } internal static class CanWallScramble { } internal static class ShouldHardLand { } internal static class IsOnGroundLayer { } internal static class OnCollisionEnter2D { } internal static class HandleCollisionTouching { } internal static class OnCollisionStay2D { } internal static class OnCollisionExit2D { } internal static class LeftGround { } internal static class SetupGameRefs { } internal static class SetupPools { } internal static class FilterInput { } internal static class FindGroundPoint { } internal static class FindGroundPointY { } internal static class TryFindGroundPoint { } internal static class StartDownspikeInvulnerability { } internal static class StartDownspikeInvulnerabilityLong { } internal static class CancelDownspikeInvulnerability { } internal static class DetachHeroLight { } internal static class ReattachHeroLight { } internal static class SetAllowNailChargingWhileRelinquished { } internal static class SetAllowRecoilWhileRelinquished { } internal static class SetRecoilZeroVelocity { } internal static class MoveToPositionX { } internal static class ToggleNoClip { } internal static class GetIsNoClip { } internal static class GetRunSpeed { } internal static class GetWalkSpeed { } internal static class ActivateQuickening { } internal static class StartRoarLock { } internal static class StartRoarLockNoRecoil { } internal static class StopRoarLock { } internal static class CocoonBroken { } internal static class CocoonBroken_System_Boolean { } internal static class CocoonBroken_System_Boolean_System_Boolean { } internal static class CocoonFloatRoutine { } internal static class RecordLeaveSceneCState { } internal static class CleanSpawnedDeliveryEffects { } internal static class LeavingScene { } internal static class DoSprintSkid { } internal static class AddExtraAirMoveVelocity { } internal static class ClearEffectsInstant { } internal static class ClearEffects { } internal static class ClearEffectsLite { } internal static class ResetMaggotCharm { } internal static class StopQuickening { } internal static class SilkTaunted { } internal static class SilkTauntEffectConsume { } internal static class RingTaunted { } internal static class RingTauntEffectConsume { } internal static class ResetTauntEffects { } internal static class ResetLavaBell { } internal static class GetVibrationCtrl { } internal static class ReportPoisonHealthAdded { } internal static class ReportPoisonHealthRemoved { } internal static class _ctor { } internal static class _cctor { } internal static class ITagDamageTakerOwner_get_transform { } internal static class ConfigGroup { internal static class get_NormalSlash { } internal static class set_NormalSlash { } internal static class get_NormalSlashDamager { } internal static class set_NormalSlashDamager { } internal static class get_AlternateSlash { } internal static class set_AlternateSlash { } internal static class get_AlternateSlashDamager { } internal static class set_AlternateSlashDamager { } internal static class get_UpSlash { } internal static class set_UpSlash { } internal static class get_UpSlashDamager { } internal static class set_UpSlashDamager { } internal static class get_AltUpSlash { } internal static class set_AltUpSlash { } internal static class get_AltUpSlashDamager { } internal static class set_AltUpSlashDamager { } internal static class get_DownSlash { } internal static class set_DownSlash { } internal static class get_Downspike { } internal static class set_Downspike { } internal static class get_DownSlashDamager { } internal static class set_DownSlashDamager { } internal static class get_AltDownSlash { } internal static class set_AltDownSlash { } internal static class get_AltDownspike { } internal static class set_AltDownspike { } internal static class get_AltDownSlashDamager { } internal static class set_AltDownSlashDamager { } internal static class get_WallSlash { } internal static class set_WallSlash { } internal static class get_WallSlashDamager { } internal static class set_WallSlashDamager { } internal static class Setup { } internal static class _ctor { } } internal static class DecayingVelocity { internal static class _ctor { } internal static class SkipBehaviours { internal static class _ctor { } } } internal static class SilkEatTracker { internal static class _ctor { } } internal static class DeliveryTimer { internal static class _ctor { } } internal static class DamageInfo { internal static class _ctor { } internal static class _ctor_GlobalEnums_HazardType { } } internal static class WarriorCrestStateInfo { internal static class _ctor { } } internal static class ReaperCrestStateInfo { internal static class _ctor { } } internal static class HunterUpgCrestStateInfo { internal static class _ctor { } internal static class get_IsComboMeterAboveExtra { } } internal static class WandererCrestStateInfo { internal static class _ctor { } } internal static class __c__DisplayClass1241_0 { internal static class _ctor { } } internal static class __c__DisplayClass695_0 { internal static class _ctor { } } internal static class __c__DisplayClass983_0 { internal static class _ctor { } } internal static class __c__DisplayClass986_0 { internal static class _ctor { } } } 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")] 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")] internal sealed class PatcherAutoPluginAttribute : Attribute { public PatcherAutoPluginAttribute(string? id = null, string? name = null, string? version = null) { } } } namespace Silksong.TheHuntIsOn { public record GlobalSaveData { [JsonProperty] internal bool Enabled; [JsonProperty] internal RoleId Role = RoleId.Hunter; [JsonProperty] internal ModuleDataset ModuleDataset = new ModuleDataset(); [JsonProperty] internal CosmeticConfig Cosmetics = new CosmeticConfig(); [CompilerGenerated] protected virtual bool PrintMembers(StringBuilder builder) { return false; } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("io.github.silksong.thehuntison", "TheHuntIsOn", "1.0.3")] public class TheHuntIsOnPlugin : BaseUnityPlugin, IModMenuCustomMenu, IModMenuInterface, IGlobalDataMod, IGlobalDataMod { private static TheHuntIsOnPlugin? instance; private readonly Dictionary modules = new Dictionary(); private readonly EventSuppressor updateMenu = new EventSuppressor(); [CompilerGenerated] private GlobalSaveData? k__BackingField; private GlobalSaveDataMenu? globalSaveDataMenu; public const string Id = "io.github.silksong.thehuntison"; public GlobalSaveData? GlobalData { [CompilerGenerated] get { return k__BackingField; } set { GlobalSaveData prev = k__BackingField; k__BackingField = value; UpdateMenu(); UpdateModulesGlobal(prev); } } public static string Name => "TheHuntIsOn"; public static string Version => "1.0.3"; private static bool GetModuleData(GlobalSaveData? saveData, string name, [MaybeNullWhen(false)] out ModuleData data) { if (saveData != null && saveData.Enabled) { return saveData.ModuleDataset.TryGetValue(name, out data); } data = null; return false; } private static ModuleSettings? GetSettings(GlobalSaveData? saveData, string name) { if (!GetModuleData(saveData, name, out ModuleData data)) { return null; } return data.GetSettings(saveData.Role); } private static bool IsEnabled(GlobalSaveData? saveData, string name) { if (GetModuleData(saveData, name, out ModuleData data)) { return data.IsEnabled(saveData.Role); } return false; } private void UpdateModulesGlobal(GlobalSaveData? prev) { foreach (ModuleBase value in modules.Values) { value.Enabled = IsEnabled(GlobalData, value.Name); value.OnGlobalConfigChanged(GetSettings(prev, value.Name), GetSettings(GlobalData, value.Name)); } } private void OnModuleDataset(ModuleDataset moduleDataset) { GlobalSaveData? obj = GlobalData ?? new GlobalSaveData(); GlobalData = obj with { ModuleDataset = moduleDataset }; } private void MaybeSeedModuleDataset() { if (!(GlobalData == null)) { SeedModuleDataset packet = new SeedModuleDataset { ModuleDataset = GlobalData.ModuleDataset.Clone() }; HuntClientAddon.Instance?.Send(packet); } } internal static RoleId GetRole() { if (!((Object)(object)instance != (Object)null)) { return RoleId.Hunter; } return instance.GlobalData?.Role ?? RoleId.Hunter; } internal static ModuleActivation GetModuleActivation(string name) { if ((Object)(object)instance != (Object)null) { GlobalSaveData globalData = instance.GlobalData; if (globalData != null && globalData.Enabled && globalData.ModuleDataset.TryGetValue(name, out ModuleData value)) { return value.ModuleActivation; } } return ModuleActivation.Inactive; } internal static T GetGlobalConfig(string name) where T : ModuleSettings, new() { if ((Object)(object)instance != (Object)null) { GlobalSaveData globalData = instance.GlobalData; if (globalData != null && globalData.ModuleDataset.TryGetValue(name, out ModuleData value) && value.GetSettings(globalData.Role) is T result) { return result; } } return new T(); } internal static T GetCosmeticConfig(string name) where T : new() { if ((Object)(object)instance != (Object)null && instance.GlobalData != null && instance.GlobalData.Cosmetics.Config.TryGetValue(name, out object value) && value is T) { return (T)value; } return new T(); } internal static void SetCosmeticConfig(string name, T config) where T : class { if (!((Object)(object)instance == (Object)null)) { TheHuntIsOnPlugin theHuntIsOnPlugin = instance; if ((object)theHuntIsOnPlugin.GlobalData == null) { GlobalSaveData globalSaveData2 = (theHuntIsOnPlugin.GlobalData = new GlobalSaveData()); } instance.GlobalData.Cosmetics.Config[name] = config; } } internal static void UpdateCosmeticConfig(string name, Action update) where T : class, new() { T cosmeticConfig = GetCosmeticConfig(name); update(cosmeticConfig); SetCosmeticConfig(name, cosmeticConfig); } private static void LogError(string message) { if ((Object)(object)instance != (Object)null) { ((BaseUnityPlugin)instance).Logger.LogError((object)message); } else { Console.WriteLine(message); } } private void Awake() { HuntLogger.LogError = LogError; instance = this; MonoDetourManager.InvokeHookInitializers(Assembly.GetExecutingAssembly()); UIEvents.Load(); foreach (ModuleBase allModule in ModuleBase.GetAllModules()) { modules.Add(allModule.Name, allModule); } HuntClientAddon huntClientAddon = new HuntClientAddon(); HuntClientAddon.On.Received += OnModuleDataset; huntClientAddon.OnConnect += MaybeSeedModuleDataset; ClientAddon.RegisterAddon((ClientAddon)(object)huntClientAddon); new HuntServerAddon().SeedModuleDataset = () => GlobalData?.ModuleDataset?.Clone(); ServerAddon.RegisterAddon((ServerAddon)(object)new HuntServerAddon()); ((BaseUnityPlugin)this).Logger.LogInfo((object)("Plugin " + Name + " (io.github.silksong.thehuntison) has loaded!")); } public LocalizedText ModMenuName() { return LocalizedText.op_Implicit("The Hunt is On"); } private void UpdateMenu() { if (!updateMenu.Suppressed) { globalSaveDataMenu?.Apply(GlobalData ?? new GlobalSaveData()); } } private MenuElement BuildCustomizeButton() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Expected O, but got Unknown //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Expected O, but got Unknown //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Expected O, but got Unknown PaginatedMenuScreenBuilder val = new PaginatedMenuScreenBuilder(LocalizedText.op_Implicit("The Hunt is On - Customize"), 8); foreach (ModuleBase item in from e in modules orderby e.Key select e.Value) { List list = item.CreateCosmeticsMenuElements().ToList(); if (list.Count != 0) { PaginatedMenuScreenBuilder val2 = new PaginatedMenuScreenBuilder(LocalizedText.op_Implicit("Customize - " + item.Name), 8); val2.AddRange((IEnumerable)list); PaginatedMenuScreen subMenuScreen = val2.Build(); TextButton val3 = new TextButton(LocalizedText.op_Implicit(item.Name)); val3.OnSubmit = (Action)Delegate.Combine(val3.OnSubmit, (Action)delegate { MenuScreenNavigation.Show((AbstractMenuScreen)(object)subMenuScreen, (HistoryMode)0); }); val.Add((MenuElement)(object)val3); } } PaginatedMenuScreen customizeScreen = val.Build(); TextButton val4 = new TextButton(LocalizedText.op_Implicit("Customize")); val4.OnSubmit = (Action)Delegate.Combine(val4.OnSubmit, (Action)delegate { MenuScreenNavigation.Show((AbstractMenuScreen)(object)customizeScreen, (HistoryMode)0); }); return (MenuElement)val4; } public AbstractMenuScreen BuildCustomMenu() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown SimpleMenuScreen val = new SimpleMenuScreen("The Hunt is On"); ((MenuDisposable)val).OnDispose += delegate { globalSaveDataMenu = null; }; globalSaveDataMenu = new GlobalSaveDataMenu(GlobalData ?? new GlobalSaveData(), modules.Values); globalSaveDataMenu.OnGlobalSaveDataChanged += delegate(GlobalSaveData newSaveData) { using (updateMenu.Suppress()) { GlobalData = newSaveData; } }; globalSaveDataMenu.AppendTo(val); val.Add(BuildCustomizeButton()); return (AbstractMenuScreen)(object)val; } } } namespace Silksong.TheHuntIsOn.Util { internal class ActionQueue { private readonly Queue actionQueue = new Queue(); internal void Enqueue(Action action) { lock (actionQueue) { actionQueue.Enqueue(action); Monitor.Pulse(actionQueue); } } private Action Dequeue() { lock (actionQueue) { while (actionQueue.Count == 0) { Monitor.Wait(actionQueue); } return actionQueue.Dequeue(); } } internal void Run() { while (true) { Action action = Dequeue(); try { action(); } catch (Exception arg) { HuntLogger.LogError($"{arg}"); } } } } public interface ICloneable { ICloneable CloneRaw(); } public interface ICloneable : ICloneable where T : ICloneable { T Clone(); } public abstract class Cloneable : ICloneable, ICloneable where T : Cloneable { public ICloneable CloneRaw() { return Clone(); } public virtual T Clone() { return (T)MemberwiseClone(); } public T With(Action edit) { T val = Clone(); edit(val); return val; } } internal static class ICloneableExtensions { internal static Dictionary CloneDictDeep(this IReadOnlyDictionary self) where V : ICloneable { Dictionary dictionary = new Dictionary(); foreach (KeyValuePair item in self) { dictionary.Add(item.Key, item.Value.Clone()); } return dictionary; } internal static Dictionary CloneDictShallow(this IReadOnlyDictionary self) { Dictionary dictionary = new Dictionary(); foreach (KeyValuePair item in self) { dictionary.Add(item.Key, item.Value); } return dictionary; } } internal static class CollectionUtil { internal static int ArrayIndexOf(this T[] self, Func filter) { for (int i = 0; i < self.Length; i++) { if (filter(self[i])) { return i; } } return -1; } internal static void Compare(IReadOnlyDictionary left, IReadOnlyDictionary right, Action callback) where V : struct { foreach (K item in left.Keys.Concat(right.Keys).Distinct()) { callback(item, left.TryGetValue(item, out var value) ? new V?(value) : null, right.TryGetValue(item, out var value2) ? new V?(value2) : null); } } internal static void Compare(IReadOnlyDictionary left, IReadOnlyDictionary right, Action callback) where V : class { foreach (K item in left.Keys.Concat(right.Keys).Distinct()) { callback(item, left.TryGetValue(item, out V value) ? value : null, right.TryGetValue(item, out V value2) ? value2 : null); } } } internal class DeltaBaseWrapper where B : IDeltaBase, new() where D : IDelta, new() { private B prevData = new B(); private B currentData = new B(); internal B Value => currentData; internal bool Update(D delta, out D realDelta) { if (!currentData.Update(delta)) { realDelta = new D(); return false; } realDelta = currentData.DeltaFrom(prevData); prevData.Update(realDelta); return true; } internal void Reset() { prevData = new B(); currentData = new B(); } } internal class Empty : NetworkedCloneable { public override Empty Clone() { return this; } public override void ReadData(IPacket packet) { } public override void WriteData(IPacket packet) { } } internal class Empty : NetworkedCloneable where T : Empty { public override T Clone() { return (T)this; } public override void ReadData(IPacket packet) { } public override void WriteData(IPacket packet) { } } [MonoDetourTargets(typeof(Fsm))] [MonoDetourTargets(typeof(GameManager))] [MonoDetourTargets(typeof(HeroController), GenerateControlFlowVariants = true)] [MonoDetourTargets(typeof(PlayMakerFSM))] internal static class Events { private static readonly HashMultimap> pdIntModifiers = new HashMultimap>(); private static readonly HashMultimap> sceneEditsByName = new HashMultimap>(); private static readonly HashSet> rawFsmEdits = new HashSet>(); private static readonly HashMultimap> fsmEditsByName = new HashMultimap>(); private static readonly HashMultimap<(string, string), Action> fsmEditsByObjAndName = new HashMultimap<(string, string), Action>(); private static readonly HashMultimap<(string, string, string), Action> fsmEditsBySceneObjAndName = new HashMultimap<(string, string, string), Action>(); internal static event Action? OnLeaveScene; internal static event Action? OnEnterScene; internal static event Action? OnHeroUpdate; internal static event Action? OnGameManagerUpdate; internal static void AddPdIntModifier(string name, Func modifier) { pdIntModifiers.Add(name, modifier); } internal static void RemovePdIntModifier(string name, Func modifier) { pdIntModifiers.Remove(name, modifier); } private static int OverrideGetPDInt(PlayerData playerData, string name, int current) { foreach (Func item in pdIntModifiers.Get(name)) { current += item(); } return current; } private static int OverrideSetPDInt(PlayerData playerData, string name, int current) { foreach (Func item in pdIntModifiers.Get(name)) { current -= item(); } return current; } internal static void AddSceneEdit(string sceneName, Action edit) { sceneEditsByName.Add(sceneName, edit); } internal static void RemoveSceneEdit(string sceneName, Action edit) { sceneEditsByName.Remove(sceneName, edit); } private static void OnLevelActivated(GameManager self, ref Scene before, ref Scene after) { //IL_000c: 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_004b: Unknown result type (might be due to invalid IL or missing references) Events.OnLeaveScene?.Invoke(before); Events.OnEnterScene?.Invoke(after); foreach (Action item in sceneEditsByName.Get(((Scene)(ref after)).name)) { item(after); } } internal static void AddRawFsmEdit(Action fsm) { rawFsmEdits.Add(fsm); } internal static void AddFsmEdit(string fsmName, Action fsmEdit) { fsmEditsByName.Add(fsmName, fsmEdit); } internal static void AddFsmEdit(string objName, string fsmName, Action fsmEdit) { fsmEditsByObjAndName.Add((objName, fsmName), fsmEdit); } internal static void AddFsmEdit(string sceneName, string objName, string fsmName, Action fsmEdit) { fsmEditsBySceneObjAndName.Add((sceneName, objName, fsmName), fsmEdit); } internal static void RemoveRawFsmEdit(Action fsm) { rawFsmEdits.Remove(fsm); } internal static void RemoveFsmEdit(string fsmName, Action fsmEdit) { fsmEditsByName.Remove(fsmName, fsmEdit); } internal static void RemoveFsmEdit(string objName, string fsmName, Action fsmEdit) { fsmEditsByObjAndName.Remove((objName, fsmName), fsmEdit); } internal static void RemoveFsmEdit(string sceneName, string objName, string fsmName, Action fsmEdit) { fsmEditsBySceneObjAndName.Remove((sceneName, objName, fsmName), fsmEdit); } private static void OnEnableFsm(Fsm fsm) { foreach (Action rawFsmEdit in rawFsmEdits) { rawFsmEdit(fsm); } } private static void OnEnablePlayMakerFSM(PlayMakerFSM fsm) { //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) foreach (Action item in fsmEditsByName.Get(fsm.FsmName)) { item(fsm); } foreach (Action item2 in fsmEditsByObjAndName.Get((((Object)((Component)fsm).gameObject).name, fsm.FsmName))) { item2(fsm); } HashMultimap<(string, string, string), Action> obj = fsmEditsBySceneObjAndName; Scene scene = ((Component)fsm).gameObject.scene; foreach (Action item3 in obj.Get((((Scene)(ref scene)).name, ((Object)((Component)fsm).gameObject).name, fsm.FsmName))) { item3(fsm); } } private static void PostfixOnHeroUpdate(HeroController self) { Events.OnHeroUpdate?.Invoke(); } private static void PostfixOnGameManagerUpdate(GameManager self) { Events.OnGameManagerUpdate?.Invoke(); } [MonoDetourHookInitialize] private static void Hook() { PlayerDataVariableEvents.OnGetVariable += OverrideGetPDInt; PlayerDataVariableEvents.OnSetVariable += OverrideSetPDInt; Md.HutongGames.PlayMaker.Fsm.OnEnable.Prefix(OnEnableFsm); LevelActivated.Prefix(OnLevelActivated); Md.GameManager.Update.Postfix(PostfixOnGameManagerUpdate); Md.HeroController.Update.Postfix(PostfixOnHeroUpdate); Md.PlayMakerFSM.OnEnable.Postfix(OnEnablePlayMakerFSM); } } internal class EventSuppressor { private class Scoped : IDisposable { private readonly EventSuppressor parent; private readonly bool before; internal Scoped(EventSuppressor parent) { this.parent = parent; before = parent.Suppressed; parent.Suppressed = true; } public void Dispose() { parent.Suppressed = before; } } public bool Suppressed { get; private set; } public IDisposable Suppress() { return new Scoped(this); } } internal static class FsmEdits { internal static bool HasStates(this Fsm fsm, IEnumerable states) { HashSet hashSet = new HashSet(); foreach (string item in fsm.states.Select((FsmState s) => s.Name)) { hashSet.Add(item); } HashSet hashSet2 = hashSet; return states.All(hashSet2.Contains); } internal static bool IsCallMethodProper(this FsmStateAction self, string behaviour, string methodName) { CallMethodProper val = (CallMethodProper)(object)((self is CallMethodProper) ? self : null); if (val != null && val.behaviour.Value == behaviour) { return val.methodName.Value == methodName; } return false; } internal static bool IsCallMethodProper(this FsmStateAction self, string methodName) { return self.IsCallMethodProper(typeof(T).Name, methodName); } internal static void ReplaceActions(this FsmState self, Func matcher, Action action) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown for (int i = 0; i < self.Actions.Length; i++) { if (matcher(self.Actions[i])) { self.Actions[i] = (FsmStateAction)new LambdaAction { Method = action }; } } } internal static void ReplaceActions(this PlayMakerFSM self, Func matcher, Action action) { FsmState[] fsmStates = self.FsmStates; for (int i = 0; i < fsmStates.Length; i++) { fsmStates[i].ReplaceActions(matcher, action); } } } internal static class GameObjectExtensions { internal static void DoOnDestroy(this GameObject self, Action action) { UnityExtensions.GetOrAddComponent(self).Action += action; } internal static void DoOnUpdate(this GameObject self, Action action) { UnityExtensions.GetOrAddComponent(self).Action += action; } } internal class OnDestroyHelper : MonoBehaviour { internal event Action? Action; private void OnDestroy() { this.Action?.Invoke(); } } internal class OnUpdateHelper : MonoBehaviour { internal event Action? Action; private void Update() { this.Action?.Invoke(); } } internal static class HuntLogger { internal static Action LogError = Console.WriteLine; } internal interface IDelta where B : IDeltaBase where D : IDelta { bool IsEmpty { get; } } internal interface IDeltaBase where B : IDeltaBase where D : IDelta { bool Update(D delta); D DeltaFrom(B deltaBase); } internal class JsonUtil { internal static JsonSerializer Serializer() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown //IL_002b: Expected O, but got Unknown JsonSerializer val = new JsonSerializer { DefaultValueHandling = (DefaultValueHandling)0, Formatting = (Formatting)1, TypeNameHandling = (TypeNameHandling)4 }; ((Collection)(object)val.Converters).Add((JsonConverter)new StringEnumConverter()); return val; } internal static T DeserializeFromFile(string path) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Expected O, but got Unknown using StreamReader streamReader = File.OpenText(path); JsonTextReader val = new JsonTextReader((TextReader)streamReader); try { T val2 = Serializer().Deserialize((JsonReader)(object)val); if (val2 == null) { throw new ArgumentNullException("path: " + path); } return val2; } finally { ((IDisposable)val)?.Dispose(); } } internal static T DeserializeFromDataResource(string path) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Silksong.TheHuntIsOn.Resources.Data." + path); using StreamReader streamReader = new StreamReader(stream); JsonTextReader val = new JsonTextReader((TextReader)streamReader); try { T val2 = Serializer().Deserialize((JsonReader)(object)val); if (val2 == null) { throw new ArgumentNullException("path: " + path); } return val2; } finally { ((IDisposable)val)?.Dispose(); } } } public delegate bool LRUCacheLoader(K key, out V value); internal class LRUCache { private record Entry(K Key, V Value); [CompilerGenerated] private int P; [CompilerGenerated] private LRUCacheLoader P; private readonly LinkedList cacheList; private readonly Dictionary> cacheDict; private readonly HashSet negativeCache; public LRUCache(int Size, LRUCacheLoader Loader) { P = Size; P = Loader; cacheList = new LinkedList(); cacheDict = new Dictionary>(); negativeCache = new HashSet(); base..ctor(); } public bool TryGetValue(K key, [MaybeNullWhen(false)] out V value) { if (negativeCache.Contains(key)) { value = default(V); return false; } if (cacheDict.TryGetValue(key, out LinkedListNode value2)) { cacheList.Remove(value2); cacheList.AddLast(value2); value = value2.Value.Value; return true; } if (P(key, out value)) { value2 = cacheList.AddLast(new Entry(key, value)); cacheDict.Add(key, value2); if (cacheList.Count > P) { LinkedListNode first = cacheList.First; cacheList.RemoveFirst(); cacheDict.Remove(first.Value.Key); } return true; } negativeCache.Add(key); value = default(V); return false; } public void Evict(K key) { if (!negativeCache.Remove(key) && cacheDict.TryGetValue(key, out LinkedListNode value)) { cacheDict.Remove(key); cacheList.Remove(value); } } public void Clear() { cacheList.Clear(); cacheDict.Clear(); negativeCache.Clear(); } } internal class RateLimiter { [CompilerGenerated] private float P; private float cooldown; public RateLimiter(float limit) { P = limit; base..ctor(); } internal bool Check() { return cooldown <= 0f; } internal void Update(float? time = null) { if (!(cooldown <= 0f)) { cooldown -= time ?? Time.deltaTime; if (cooldown < 0f) { cooldown = 0f; } } } internal void Reset() { cooldown = P; } } internal class SHA1Hash : NetworkedCloneable, IEquatable { private const int NUM_BYTES = 20; public byte[] Hash = new byte[20]; public SHA1Hash() { } public SHA1Hash(byte[] bytes) { if (bytes.Length != 20) { throw new ArgumentException($"{bytes.Length} != {20}"); } Hash = bytes; } public override void ReadData(IPacket packet) { for (int i = 0; i < 20; i++) { Hash[i] = packet.ReadByte(); } } public override void WriteData(IPacket packet) { byte[] hash = Hash; foreach (byte b in hash) { packet.Write(b); } } public override SHA1Hash Clone() { SHA1Hash sHA1Hash = new SHA1Hash(); Array.Copy(Hash, sHA1Hash.Hash, 20); return sHA1Hash; } internal static SHA1Hash Compute(string data) { return new SHA1Hash(SHA1.Create().ComputeHash(Encoding.UTF8.GetBytes(data))); } internal static SHA1Hash Compute(Stream data) { return new SHA1Hash(SHA1.Create().ComputeHash(data)); } public bool Equals(SHA1Hash other) { for (int i = 0; i < 20; i++) { if (Hash[i] != other.Hash[i]) { return false; } } return true; } public override int GetHashCode() { int num = 0; for (int i = 0; i < 20; i += 4) { int num2 = num; Span span = Hash.AsSpan(); int num3 = i; num = num2 ^ BitConverter.ToInt32(span.Slice(num3, span.Length - num3)); } return num; } public override bool Equals(object obj) { if (obj is SHA1Hash other) { return Equals(other); } return false; } } internal static class StringUtil { internal static bool ConsumePrefix(this ReadOnlySpan self, ReadOnlySpan prefix, out ReadOnlySpan suffix) { if (self.StartsWith(prefix)) { int length = prefix.Length; suffix = self.Slice(length, self.Length - length); return true; } suffix = default(ReadOnlySpan); return false; } internal static bool ConsumeSuffix(this ReadOnlySpan self, ReadOnlySpan suffix, out ReadOnlySpan prefix) { if (self.EndsWith(suffix)) { prefix = self.Slice(0, self.Length - suffix.Length); return true; } prefix = default(ReadOnlySpan); return false; } internal static bool Split2(this ReadOnlySpan self, char delimeter, out ReadOnlySpan one, out ReadOnlySpan two) { one = default(ReadOnlySpan); two = default(ReadOnlySpan); for (int i = 0; i < self.Length; i++) { if (self[i] != delimeter) { continue; } for (int j = i + 1; j < self.Length; j++) { if (self[j] == delimeter) { return false; } } one = self.Slice(0, i); int num = i + 1; two = self.Slice(num, self.Length - num); return true; } return false; } } internal class TempSet { private class Lease : IDisposable { private readonly TempSet parent; private readonly T item; internal Lease(TempSet parent, T item) { this.parent = parent; this.item = item; parent.set.Add(item); } public void Dispose() { parent.set.Remove(item); } } private readonly HashMultiset set = new HashMultiset(); public bool Contains(T item) { return set.Contains(item); } public IDisposable TempAdd(T item) { return new Lease(this, item); } } internal static class UIEvents { private static readonly HashSet healthDisplays = new HashSet(); private static readonly TempSet suppressWait = new TempSet(); private static readonly HashSet silkSpoolFsms = new HashSet(); private static readonly EventSuppressor disableSpoolAnimSkip = new EventSuppressor(); private static bool loaded = false; internal static void UpdateHealth() { if (PlayerDataAccess.health > PlayerData.instance.CurrentMaxHealth) { PlayerDataAccess.health = PlayerData.instance.CurrentMaxHealth; } foreach (PlayMakerFSM item in healthDisplays.Where((PlayMakerFSM fsm) => ((Component)fsm).gameObject.activeInHierarchy)) { if (!((Behaviour)item).enabled) { ((Behaviour)item).enabled = true; } using (suppressWait.TempAdd(item)) { item.SendEvent("HUD APPEAR RESET"); } } } private static void TrackHealthDisplay(PlayMakerFSM fsm) { PlayMakerFSM fsm2 = fsm; healthDisplays.Add(fsm2); ((Component)fsm2).gameObject.DoOnDestroy(delegate { healthDisplays.Remove(fsm2); }); FsmUtil.AddMethod(FsmUtil.GetState(fsm2, "Set Appear Pause"), (Action)delegate(FsmStateAction action) { if (suppressWait.Contains(action.Fsm.FsmComponent)) { int value = action.Fsm.variables.GetFsmInt("Health Number").Value; action.Fsm.variables.GetFsmFloat("Appear Pause").Value = (float)value * 0.05f; } }); } private static void SkipSpoolAnimation(PlayMakerFSM fsm) { PlayMakerFSM fsm2 = fsm; silkSpoolFsms.Add(fsm2); ((Component)fsm2).gameObject.DoOnDestroy(delegate { silkSpoolFsms.Remove(fsm2); }); FsmState state = FsmUtil.GetState(fsm2, "Init"); FsmUtil.AddTransition(state, "SKIP", "Appear Anim"); FsmUtil.InsertMethod(state, 0, (Action)delegate { if (disableSpoolAnimSkip.Suppressed) { fsm2.SendEvent("SKIP"); } }); } internal static void UpdateSilk() { if (PlayerDataAccess.silk > PlayerDataAccess.silkMax) { PlayerDataAccess.silk = PlayerDataAccess.silkMax; } using (disableSpoolAnimSkip.Suppress()) { foreach (PlayMakerFSM silkSpoolFsm in silkSpoolFsms) { if (!((Behaviour)silkSpoolFsm).enabled) { ((Behaviour)silkSpoolFsm).enabled = true; } silkSpoolFsm.SendEvent("HUD APPEAR RESET"); } } } internal static void Load() { if (!loaded) { loaded = true; Events.AddFsmEdit("health_display", TrackHealthDisplay); Events.AddFsmEdit("Spool", "Animate", SkipSpoolAnimation); } } } internal class Updater where T : struct { public T Value { get; private set; } public Updater(T value) { Value = value; base..ctor(); } public bool Update(T newValue) { if (EqualityComparer.Default.Equals(Value, newValue)) { return false; } Value = newValue; return true; } public bool Update(T value, out T prevValue, out T newValue) { prevValue = Value; newValue = value; return Update(newValue); } } internal static class ValueModelUtil { internal static void FormatPercent(this IValueModel self) { if (self is ListChoiceModel val) { val.DisplayFn = (int _, float value) => LocalizedText.op_Implicit($"{value * 100f:0.#}%"); } } internal static void FormatIntDelta(this IValueModel self, int defaultValue) { if (!(self is ListChoiceModel val)) { return; } val.DisplayFn = delegate(int _, int value) { if (value == defaultValue) { return LocalizedText.op_Implicit($"{value}"); } return (value > defaultValue) ? LocalizedText.op_Implicit($"{value} (+{value - defaultValue})") : LocalizedText.op_Implicit($"{value} (-{defaultValue - value})"); }; } } } namespace Silksong.TheHuntIsOn.SsmpAddon { internal static class AddonIdentifiers { public const string NAME = "TheHuntIsOn"; public static readonly string VERSION = Assembly.GetExecutingAssembly().GetName().Version.ToString(); public const uint API_VERSION = 1u; } internal enum ClientPacketId { ArchitectLevelData, ArchitectLevelsMetadata, HunterItemGrants, HunterItemGrantsDelta, ModuleDataset, ServerPauseState, SpeedrunnerEvents, SpeedrunnerEventsDelta } internal class HuntClientAddon : TogglableClientAddon { internal class On where T : IIdentifiedPacket { public static event Action? Received; internal static void Invoke(T packet) { On.Received?.Invoke(packet); } } private IClientApi? api; private IClientAddonNetworkSender? sender; private IClientAddonNetworkReceiver? receiver; private readonly PacketGenerators packetGenerators = new PacketGenerators(); internal static HuntClientAddon? Instance { get; private set; } internal static bool IsConnected { get { if (Instance != null && !((TogglableClientAddon)Instance).Disabled) { IClientApi? obj = Instance.api; if (obj == null) { return false; } return obj.NetClient.IsConnected; } return false; } } public override bool NeedsNetwork => true; public override uint ApiVersion => 1u; protected override string Name => "TheHuntIsOn"; protected override string Version => AddonIdentifiers.VERSION; internal event Action? OnConnect; public override void Initialize(IClientApi clientApi) { api = clientApi; sender = api.NetClient.GetNetworkSender((ClientAddon)(object)this); receiver = api.NetClient.GetNetworkReceiver((ClientAddon)(object)this, (Func)packetGenerators.Instantiate); HandleClientPacket(); HandleClientPacket(); HandleClientPacket(); HandleClientPacket(); HandleClientPacket(); HandleClientPacket(); HandleClientPacket(); HandleClientPacket(); api.ClientManager.ConnectEvent += delegate { this.OnConnect?.Invoke(); }; Instance = this; } protected override void OnEnable() { } protected override void OnDisable() { } internal static bool OpponentsInRoom() { HuntClientAddon? instance = Instance; bool? obj; if (instance == null) { obj = null; } else { IClientApi? obj2 = instance.api; obj = ((obj2 != null) ? new bool?(obj2.ClientManager.Players.Any((IClientPlayer p) => p.Team != Instance.api.ClientManager.Team && p.IsInLocalScene)) : null); } bool? flag = obj; return flag.GetValueOrDefault(); } private void HandleClientPacket() where T : IIdentifiedPacket, new() { packetGenerators.Register(); receiver.RegisterPacketHandler(new T().Identifier, (GenericClientPacketHandler)On.Invoke); } internal void SendMessage(string message) { IClientApi? obj = api; if (obj != null) { obj.UiManager.ChatBox.AddMessage(message); } } internal void Send(T packet) where T : IIdentifiedPacket, new() { if (api != null && api.NetClient.IsConnected) { if (packet.Single) { sender?.SendSingleData(packet.Identifier, (IPacketData)(object)packet); } else { sender?.SendCollectionData(packet.Identifier, packet); } } } } internal class HuntCommand : IServerCommand, ICommand { [CompilerGenerated] private HuntServerAddon P; private static readonly SubcommandRegister subcommands = new SubcommandRegister("/hunt", new <>z__ReadOnlyArray>(new Subcommand[4] { new ResetSubcommand(), new StatusSubcommand(), new UpdateArchitectCommand(), new UpdateEventsCommand() })); public bool AuthorizedOnly => true; public string Trigger => "/thehuntison"; public string[] Aliases => new string[1] { "/hunt" }; internal DateTime LastReset { get; private set; } internal event Action? OnGameReset; public HuntCommand(HuntServerAddon serverAddon) { P = serverAddon; LastReset = DateTime.UtcNow; base..ctor(); } internal void StartNewSession() { LastReset = DateTime.UtcNow; this.OnGameReset?.Invoke(); } internal void UpdateArchitectLevels() { P.UpdateArchitectLevels(); } internal void UpdateEvents() { P.UpdateEvents(); } internal void BroadcastMessage(string message) { P.BroadcastMessage(message); } public void Execute(ICommandSender commandSender, string[] arguments) { subcommands.Execute(this, commandSender, arguments); } } internal class ResetSubcommand : Subcommand { public override string Name => "reset"; public override IEnumerable Aliases => new <>z__ReadOnlyArray(new string[2] { "start", "newgame" }); public override string Usage => "'/hunt reset': Reset hunter power ups and start a new session."; public override bool Execute(HuntCommand parent, ICommandSender commandSender, string[] arguments) { if (!Subcommand.MaxArguments(commandSender, arguments, 0)) { return false; } parent.StartNewSession(); parent.BroadcastMessage("Hunt session reset."); return true; } } internal class StatusSubcommand : Subcommand { public override string Name => "status"; public override IEnumerable Aliases => new <>z__ReadOnlySingleElementList("state"); public override string Usage => "'/hunt status': Query the status of the current session."; public override bool Execute(HuntCommand parent, ICommandSender commandSender, string[] arguments) { if (!Subcommand.MaxArguments(commandSender, arguments, 0)) { return false; } commandSender.SendMessage("Current game started " + Subcommand.FormatDuration(DateTime.UtcNow - parent.LastReset) + " ago."); return true; } } internal class UpdateArchitectCommand : Subcommand { public override string Name => "update-architect"; public override IEnumerable Aliases => new <>z__ReadOnlySingleElementList("update-levels"); public override string Usage => "'/hunt update-architect': Reload Architect-Server levels and notify clients."; public override bool Execute(HuntCommand parent, ICommandSender commandSender, string[] arguments) { if (!Subcommand.MaxArguments(commandSender, arguments, 0)) { return false; } parent.UpdateArchitectLevels(); commandSender.SendMessage("Reloaded Architect levels."); return true; } } internal class UpdateEventsCommand : Subcommand { public override string Name => "update-events"; public override string Usage => "'/hunt update-events': Reload events.json on the server and notify clients."; public override bool Execute(HuntCommand parent, ICommandSender commandSender, string[] arguments) { if (!Subcommand.MaxArguments(commandSender, arguments, 0)) { return false; } parent.UpdateEvents(); commandSender.SendMessage("Reloaded events.json"); return true; } } internal class HuntServerAddon : ServerAddon { private IServerApi? api; private IServerAddonNetworkSender? sender; private IServerAddonNetworkReceiver? receiver; private readonly ArchitectModuleServerAddon architectModuleServerAddon; private readonly EventsModuleServerAddon eventsModuleServerAddon; private readonly HuntCommand huntCommand; private readonly PauseTimerCommand pauseTimerCommand; private ModuleDataset? moduleDataset; internal Func? SeedModuleDataset; private readonly PacketGenerators packetGenerators = new PacketGenerators(); public override bool NeedsNetwork => true; public override uint ApiVersion => 1u; protected override string Name => "TheHuntIsOn"; protected override string Version => AddonIdentifiers.VERSION; internal event Action? OnUpdatePlayer; internal void UpdateArchitectLevels() { architectModuleServerAddon.Refresh(); } internal void UpdateEvents() { eventsModuleServerAddon.Refresh(); } public HuntServerAddon() { huntCommand = new HuntCommand(this); architectModuleServerAddon = new ArchitectModuleServerAddon(this); eventsModuleServerAddon = new EventsModuleServerAddon(this, huntCommand); pauseTimerCommand = new PauseTimerCommand(this, huntCommand); } public override void Initialize(IServerApi serverApi) { api = serverApi; sender = api.NetServer.GetNetworkSender((ServerAddon)(object)this); receiver = api.NetServer.GetNetworkReceiver((ServerAddon)(object)this, (Func)packetGenerators.Instantiate); moduleDataset = SeedModuleDataset?.Invoke(); api.ServerManager.PlayerConnectEvent += delegate(IServerPlayer player) { this.OnUpdatePlayer?.Invoke(player); }; OnUpdatePlayer += SendModuleDataset; ((ICommandManager)(object)api.CommandManager).RegisterCommand((IServerCommand)(object)huntCommand); ((ICommandManager)(object)api.CommandManager).RegisterCommand((IServerCommand)(object)pauseTimerCommand); HandleServerPacket(OnIntelligenceMessage); HandleServerPacket(OnModuleDataset); HandleServerPacket(OnReportDesync); HandleServerPacket(architectModuleServerAddon.OnRequestArchitectLevelData); HandleServerPacket(OnSeedModuleDataset); HandleServerPacket(eventsModuleServerAddon.OnSpeedrunnerEventsDelta); } private void HandleServerPacket(Action handler) where T : IIdentifiedPacket, new() { Action handler2 = handler; packetGenerators.Register(); receiver.RegisterPacketHandler(new T().Identifier, (GenericServerPacketHandler)delegate(ushort id, T data) { handler2(id, data); }); } private bool IsPlayerAuthorized(ushort id) { IServerApi? obj = api; bool? obj2; if (obj == null) { obj2 = null; } else { IServerPlayer player = obj.ServerManager.GetPlayer(id); obj2 = ((player != null) ? new bool?(player.IsAuthorized) : null); } bool? flag = obj2; return flag.GetValueOrDefault(); } private string PlayerName(ushort id) { IServerApi? obj = api; object obj2; if (obj == null) { obj2 = null; } else { IServerPlayer player = obj.ServerManager.GetPlayer(id); obj2 = ((player != null) ? player.Username : null); } if (obj2 == null) { obj2 = ""; } return (string)obj2; } internal void SendToPlayer(IServerPlayer player, T data) where T : IIdentifiedPacket, new() { SendToPlayer(player.Id, data); } internal void SendToPlayer(ushort id, T data) where T : IIdentifiedPacket, new() { if (data.Single) { sender?.SendSingleData(data.Identifier, (IPacketData)(object)data, id); } else { sender?.SendCollectionData(data.Identifier, data, id); } } private void SendModuleDataset(IServerPlayer player) { if (moduleDataset != null) { SendToPlayer(player, moduleDataset); } } internal void SendMessage(ushort id, string message) { IServerApi? obj = api; if (obj != null) { obj.ServerManager.SendMessage(id, message); } } internal void BroadcastMessage(string message) { IServerApi? obj = api; if (obj != null) { obj.ServerManager.BroadcastMessage(message); } } internal void Broadcast(T packet) where T : IIdentifiedPacket, new() { if (packet.Single) { sender?.BroadcastSingleData(packet.Identifier, (IPacketData)(object)packet); } else { sender?.BroadcastCollectionData(packet.Identifier, packet); } } private void OnIntelligenceMessage(ushort id, IntelligenceMessage intelligenceMessage) { BroadcastMessage(intelligenceMessage.Message); } private void OnModuleDataset(ushort id, ModuleDataset moduleDataset) { if (!IsPlayerAuthorized(id)) { SendMessage(id, "Only authorized users can change module settings."); return; } this.moduleDataset = moduleDataset; Broadcast(moduleDataset); BroadcastMessage(PlayerName(id) + " updated module settings."); } private void OnSeedModuleDataset(ushort id, SeedModuleDataset seedModuleDataset) { if (moduleDataset == null) { if (!IsPlayerAuthorized(id)) { SendMessage(id, "Only authorized users can seed module settings."); return; } moduleDataset = seedModuleDataset.ModuleDataset; Broadcast(moduleDataset); BroadcastMessage(PlayerName(id) + " seeded module settings."); } } private void OnReportDesync(ushort id, ReportDesync reportDesync) { IServerApi? obj = api; IServerPlayer val = ((obj != null) ? obj.ServerManager.GetPlayer(id) : null); if (val != null) { this.OnUpdatePlayer?.Invoke(val); } } } internal class ReportDesync : Empty, IIdentifiedPacket, IPacketData { public ServerPacketId Identifier => ServerPacketId.ReportDesync; public bool Single => true; public bool IsReliable => true; public bool DropReliableDataIfNewerExists => true; } internal class SeedModuleDataset : IIdentifiedPacket, IPacketData { public ModuleDataset ModuleDataset = new ModuleDataset(); public ServerPacketId Identifier => ServerPacketId.SeedModuleDataset; public bool Single => true; public bool IsReliable => true; public bool DropReliableDataIfNewerExists => true; public void ReadData(IPacket packet) { ModuleDataset.ReadData(packet); } public void WriteData(IPacket packet) { ModuleDataset.WriteData(packet); } } internal enum ServerPacketId { IntelligenceMessage, ModuleDataset, ReportDesync, RequestArchitectLevelData, SeedModuleDataset, SpeedrunnerEventsDelta } internal abstract class Subcommand { public abstract string Name { get; } public virtual IEnumerable Aliases => Array.Empty(); public abstract string Usage { get; } protected static bool MinArguments(ICommandSender commandSender, string[] arguments, int min) { if (arguments.Length >= min) { return true; } commandSender.SendMessage("Missing arguments."); return false; } protected static bool MaxArguments(ICommandSender commandSender, string[] arguments, int max) { if (arguments.Length <= max) { return true; } commandSender.SendMessage("Too many arguments."); return false; } protected static bool ParseInt(ICommandSender commandSender, string arg, out int value) { if (int.TryParse(arg, out value) && value >= 0) { return true; } commandSender.SendMessage("Invalid integer '" + arg + "'"); return false; } protected static string FormatDuration(TimeSpan span) { if (span.Seconds < 60) { return $"{span.Seconds}s"; } if (span.Seconds < 600) { int minutes = span.Minutes; int num = span.Seconds % 60; if (num <= 0) { return $"{minutes}m"; } return $"{minutes}m{num}s"; } if (span.Seconds < 3600) { return $"{span.Minutes}m"; } if (span.Seconds < 36000) { return $"{span.Hours}h{span.Minutes % 60}m"; } return $"{span.Hours}h"; } public abstract bool Execute(T parent, ICommandSender commandSender, string[] arguments); } internal class SubcommandRegister { private readonly string self; private readonly List> subcommands; public SubcommandRegister(string self, IEnumerable> subcommands) { this.self = self; this.subcommands = subcommands.ToList(); base..ctor(); } private string AllSubcommands() { return string.Join("|", (from s in subcommands select s.Name into s orderby s select s).ToArray()); } private bool TryGetSubcommand(string name, [MaybeNullWhen(false)] out Subcommand subcommand) { foreach (Subcommand subcommand2 in subcommands) { if (subcommand2.Name == name || subcommand2.Aliases.Contains(name)) { subcommand = subcommand2; return true; } } subcommand = null; return false; } internal void Execute(T parent, ICommandSender commandSender, string[] arguments) { if (arguments.Length <= 1) { commandSender.SendMessage("Usage: '" + self + " <" + AllSubcommands() + ">'"); commandSender.SendMessage("Use '" + self + " help ' for details"); return; } string text = arguments[1].ToLower(); Subcommand subcommand; if (text == "help") { if (arguments.Length == 2) { commandSender.SendMessage("Usage: '" + self + " help <" + AllSubcommands() + ">'"); } else if (TryGetSubcommand(arguments[2].ToLower(), out subcommand)) { commandSender.SendMessage("Usage: " + subcommand.Usage); List list = subcommand.Aliases.ToList(); if (list.Count > 0) { list.Sort(); commandSender.SendMessage("Aliases: " + string.Join("|", list)); } } else { commandSender.SendMessage("Unrecognized command '" + text + "'."); commandSender.SendMessage("Usage: '" + self + " help <" + AllSubcommands() + ">'"); } } else if (!TryGetSubcommand(text, out subcommand)) { commandSender.SendMessage("Unrecognized command '" + text + "'."); commandSender.SendMessage("Usage: '" + self + " <" + AllSubcommands() + ">'"); } else if (!subcommand.Execute(parent, commandSender, arguments.Skip(2).ToArray())) { commandSender.SendMessage("Usage: " + subcommand.Usage); } } } } namespace Silksong.TheHuntIsOn.SsmpAddon.PacketUtil { internal class EnumList : List, INetworkedCloneable>, ICloneable>, Silksong.TheHuntIsOn.Util.ICloneable, INetworkedCloneable, IWireInterface where T : Enum { public EnumList Clone() { EnumList enumList = new EnumList(); using List.Enumerator enumerator = GetEnumerator(); while (enumerator.MoveNext()) { T current = enumerator.Current; enumList.Add(current); } return enumList; } public void ReadData(IPacket packet) { ((ICollection)this).ReadData(packet, (Func)((IPacket packet) => packet.ReadEnum())); } public void WriteData(IPacket packet) { ((IReadOnlyCollection)this).WriteData(packet, (Action)delegate(IPacket packet, T value) { value.WriteData(packet); }); } INetworkedCloneable INetworkedCloneable.CloneRaw() { return Clone(); } Silksong.TheHuntIsOn.Util.ICloneable Silksong.TheHuntIsOn.Util.ICloneable.CloneRaw() { return Clone(); } } internal class EnumMultiset : HashMultiset, INetworkedCloneable>, ICloneable>, Silksong.TheHuntIsOn.Util.ICloneable, INetworkedCloneable, IWireInterface where T : Enum { public EnumMultiset() { } public EnumMultiset(EnumMultiset clone) : base((HashMultiset)(object)clone) { } public EnumMultiset Clone() { return new EnumMultiset(this); } public void ReadData(IPacket packet) { ((HashMultiset)(object)this).ReadData(packet, (IPacket packet) => packet.ReadEnum()); } public void WriteData(IPacket packet) { ((HashMultiset)(object)this).WriteData(packet, delegate(IPacket packet, T value) { value.WriteData(packet); }); } INetworkedCloneable INetworkedCloneable.CloneRaw() { return Clone(); } Silksong.TheHuntIsOn.Util.ICloneable Silksong.TheHuntIsOn.Util.ICloneable.CloneRaw() { return Clone(); } } internal class EnumSet : HashSet, INetworkedCloneable>, ICloneable>, Silksong.TheHuntIsOn.Util.ICloneable, INetworkedCloneable, IWireInterface where T : Enum { public EnumSet Clone() { EnumSet enumSet = new EnumSet(); using HashSet.Enumerator enumerator = GetEnumerator(); while (enumerator.MoveNext()) { T current = enumerator.Current; enumSet.Add(current); } return enumSet; } public void ReadData(IPacket packet) { ((ICollection)this).ReadData(packet, (Func)((IPacket packet) => packet.ReadEnum())); } public void WriteData(IPacket packet) { ((IReadOnlyCollection)this).WriteData(packet, (Action)delegate(IPacket packet, T value) { value.WriteData(packet); }); } INetworkedCloneable INetworkedCloneable.CloneRaw() { return Clone(); } Silksong.TheHuntIsOn.Util.ICloneable Silksong.TheHuntIsOn.Util.ICloneable.CloneRaw() { return Clone(); } } internal interface IDynamicValue where E : Enum where T : IDynamicValue where F : IDynamicValueFactory, new() { E DynamicType(); void ReadDynamicData(IPacket packet); void WriteDynamicData(IPacket packet); } internal interface IDynamicValueFactory where E : Enum where T : IDynamicValue where F : IDynamicValueFactory, new() { T Create(E type); } internal interface IIdentifiedPacket : IPacketData where E : Enum { E Identifier { get; } bool Single { get; } } internal interface IWireInterface { void WriteData(IPacket packet); void ReadData(IPacket packet); } internal static class IWireInterfaceExtensions { internal static void ReadData(this ref bool self, IPacket packet) { self = packet.ReadBool(); } internal static void WriteData(this bool self, IPacket packet) { packet.Write(self); } internal static void ReadData(this ref int self, IPacket packet) { self = packet.ReadInt(); } internal static void WriteData(this int self, IPacket packet) { packet.Write(self); } internal static void ReadData(this ref int? self, IPacket packet) { self = (packet.ReadBool() ? new int?(packet.ReadInt()) : null); } internal static void WriteData(this int? self, IPacket packet) { packet.Write(self.HasValue); if (self.HasValue) { packet.Write(self.Value); } } internal static int ReadVarint(this IPacket self) { int num = 0; while (true) { byte b = self.ReadByte(); num += b & 0x7F; if ((b & 0x80) == 0) { break; } num *= 128; } return num; } internal static void WriteVarint(this IPacket self, int value) { if (value < 0) { throw new ArgumentException(string.Format("{0}: {1}", "value", value)); } if (value == 0) { self.Write((byte)0); return; } while (value > 0) { byte b = (byte)((uint)value & 0x7Fu); if (value >= 128) { b = (byte)(b | 0x80u); self.Write(b); continue; } self.Write(b); break; } } internal static void ReadData(this ref float self, IPacket packet) { self = packet.ReadFloat(); } internal static void WriteData(this float self, IPacket packet) { packet.Write(self); } internal static void ReadData(this ref long self, IPacket packet) { self = packet.ReadLong(); } internal static void WriteData(this long self, IPacket packet) { packet.Write(self); } internal static void ReadData(this ref long? self, IPacket packet) { self = (packet.ReadBool() ? new long?(packet.ReadLong()) : null); } internal static void WriteData(this long? self, IPacket packet) { packet.Write(self.HasValue); if (self.HasValue) { packet.Write(self.Value); } } internal static void WriteData(this string self, IPacket packet) { packet.Write(self); } internal static T ReadEnum(this IPacket self) where T : Enum { return (T)Enum.ToObject(typeof(T), self.ReadVarint()); } internal static void WriteData(this T self, IPacket packet) where T : Enum { packet.WriteVarint(Convert.ToInt32(self)); } private static T ReadIntoNew(this IPacket self) where T : IWireInterface, new() { T result = new T(); result.ReadData(self); return result; } private static void Write(this IPacket self, T value) where T : IWireInterface { value.WriteData(self); } internal static T ReadDynamic(this IPacket self) where E : Enum where T : IDynamicValue where F : IDynamicValueFactory, new() { E type = self.ReadEnum(); T result = new F().Create(type); result.ReadDynamicData(self); return result; } internal static T? ReadOptionalDynamic(this IPacket self) where E : Enum where T : class, IDynamicValue where F : IDynamicValueFactory, new() { if (!self.ReadBool()) { return null; } return self.ReadDynamic(); } internal static void WriteDynamic(this IDynamicValue self, IPacket packet) where E : Enum where T : IDynamicValue where F : IDynamicValueFactory, new() { self.DynamicType().WriteData(packet); self.WriteDynamicData(packet); } internal static void WriteOptionalDynamic(this IDynamicValue? self, IPacket packet) where E : Enum where T : class, IDynamicValue where F : IDynamicValueFactory, new() { packet.Write(self != null); self?.WriteDynamic(packet); } internal static void ReadData(this ICollection self, IPacket packet, Func read) { self.Clear(); int num = packet.ReadVarint(); for (int i = 0; i < num; i++) { self.Add(read(packet)); } } internal static void ReadData(this ICollection self, IPacket packet) where T : IWireInterface, new() { self.ReadData(packet, ReadIntoNew); } internal static void WriteData(this IReadOnlyCollection self, IPacket packet, Action write) { packet.WriteVarint(self.Count); foreach (T item in self) { write(packet, item); } } internal static void WriteData(this IReadOnlyCollection self, IPacket packet) where T : IWireInterface { self.WriteData(packet, Write); } internal static void ReadData(this HashMultiset self, IPacket packet, Func read) { self.Clear(); int num = packet.ReadVarint(); for (int i = 0; i < num; i++) { T val = read(packet); int num2 = packet.ReadVarint(); self.Add(val, num2); } } internal static void ReadData(this HashMultiset self, IPacket packet) where T : IWireInterface, new() { self.ReadData(packet, ReadIntoNew); } internal static void WriteData(this HashMultiset self, IPacket packet, Action write) { packet.WriteVarint(self.Distinct.Count); foreach (var (arg, value) in self.Counts) { write(packet, arg); packet.WriteVarint(value); } } internal static void ReadData(this IDictionary self, IPacket packet, Func readKey, Func readValue) { self.Clear(); int num = packet.ReadVarint(); for (int i = 0; i < num; i++) { K key = readKey(packet); V value = readValue(packet); self.Add(key, value); } } internal static void ReadData(this IDictionary self, IPacket packet, Func readKey) where V : IWireInterface, new() { self.ReadData(packet, readKey, ReadIntoNew); } internal static void WriteData(this IReadOnlyDictionary self, IPacket packet, Action writeKey, Action writeValue) { packet.WriteVarint(self.Count); foreach (KeyValuePair item in self) { writeKey(packet, item.Key); writeValue(packet, item.Value); } } internal static void WriteData(this IReadOnlyDictionary self, IPacket packet, Action writeKey) where V : IWireInterface { self.WriteData(packet, writeKey, Write); } internal static void ReadData(this ListMultimap self, IPacket packet, Func readKey, Func readValue) { int num = packet.ReadVarint(); for (int i = 0; i < num; i++) { K val = readKey(packet); List list = new List(); ((ICollection)list).ReadData(packet, readValue); self.Add(val, (IEnumerable)list); } } internal static void ReadData(this ListMultimap self, IPacket packet, Func readKey) where V : IWireInterface, new() { self.ReadData(packet, readKey, ReadIntoNew); } internal static void WriteData(this ListMultimap self, IPacket packet, Action writeKey, Action writeValue) { packet.WriteVarint(self.Keys.Count); foreach (var (arg, self2) in self) { writeKey(packet, arg); ((IReadOnlyCollection)self2).WriteData(packet, writeValue); } } internal static void WriteData(this ListMultimap self, IPacket packet, Action writeKey) where V : IWireInterface, new() { self.WriteData(packet, writeKey, Write); } } internal interface INetworkedCloneable : Silksong.TheHuntIsOn.Util.ICloneable, IWireInterface { new INetworkedCloneable CloneRaw(); } internal interface INetworkedCloneable : ICloneable, Silksong.TheHuntIsOn.Util.ICloneable, INetworkedCloneable, IWireInterface where T : INetworkedCloneable { } internal abstract class NetworkedCloneable : Cloneable, INetworkedCloneable, ICloneable, Silksong.TheHuntIsOn.Util.ICloneable, INetworkedCloneable, IWireInterface where T : NetworkedCloneable { public new INetworkedCloneable CloneRaw() { return Clone(); } public abstract void ReadData(IPacket packet); public abstract void WriteData(IPacket packet); } internal class PacketGenerators where E : Enum { private readonly Dictionary> generators = new Dictionary>(); public void Register() where T : IIdentifiedPacket, new() { T val = new T(); generators.Add(val.Identifier, val.Single ? ((Func)(() => (IPacketData)(object)new T())) : ((Func)(() => (IPacketData)(object)new PacketDataCollection()))); } public IPacketData Instantiate(E id) { if (!generators.TryGetValue(id, out Func value)) { throw new ArgumentException($"Unsupported id: {id}"); } return value(); } } } namespace Silksong.TheHuntIsOn.Modules { [GenerateMenu] public class AutoTriggerSettings : ModuleSettings { [Description("Auto-trigger the Bell Beast fight.")] public bool BellBeast; [Description("Auto-trigger the Last Judge fight.")] public bool LastJudge; [Description("Auto-trigger the Grand Mother Silk fight.")] public bool GrandMotherSilk; public override ModuleSettingsType DynamicType() { return ModuleSettingsType.AutoTrigger; } public override void ReadDynamicData(IPacket packet) { BellBeast.ReadData(packet); LastJudge.ReadData(packet); GrandMotherSilk.ReadData(packet); } public override void WriteDynamicData(IPacket packet) { BellBeast.WriteData(packet); LastJudge.WriteData(packet); GrandMotherSilk.WriteData(packet); } protected override bool Equivalent(AutoTriggerSettings other) { if (BellBeast == other.BellBeast && LastJudge == other.LastJudge) { return GrandMotherSilk == other.GrandMotherSilk; } return false; } } internal class AutoTriggerModule : GlobalSettingsModule { public override string Name => "Auto Trigger"; public override ModuleActivationType ModuleActivationType => ModuleActivationType.AnyConfiguration; protected override AutoTriggerModule Self() { return this; } private static void AutoTriggerBellBeast(PlayMakerFSM fsm) { //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_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Expected O, but got Unknown PlayMakerFSM fsm2 = fsm; FsmUtil.AddAction(FsmUtil.GetState(fsm2, "Idle"), (FsmStateAction)new LambdaAction { Method = delegate { //IL_000a: Unknown result type (might be due to invalid IL or missing references) float x = HeroController.instance.transform.position.x; if (Module.GetEnabledConfig(out var config) && config.BellBeast && x >= 70.5f && x <= 101f) { fsm2.SendEvent("ENTER"); fsm2.SendEvent("DESTROY"); } }, EveryFrame = true }); } private static void AutoTriggerLastJudge(PlayMakerFSM fsm) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: 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_0051: Expected O, but got Unknown PlayMakerFSM fsm2 = fsm; FsmState obj = FsmUtil.AddState(fsm2, "Wait for Refight"); FsmUtil.AddTransition(obj, "START REFIGHT", "Start Refight"); FsmUtil.AddAction(obj, (FsmStateAction)new LambdaAction { Method = delegate { //IL_000a: Unknown result type (might be due to invalid IL or missing references) if (HeroController.instance.transform.position.x >= 9f) { fsm2.SendEvent("START REFIGHT"); } }, EveryFrame = true }); FsmState state = FsmUtil.GetState(fsm2, "Init"); FsmUtil.AddTransition(state, "AUTO TRIGGER", "Wait for Refight"); int num = state.Actions.ArrayIndexOf((FsmStateAction a) => a is PlayerDataBoolTest); FsmUtil.InsertMethod(state, (Action)delegate { if (Module.GetEnabledConfig(out var config) && config.LastJudge) { fsm2.SendEvent("AUTO TRIGGER"); } }, num); } private static void AutoTriggerGrandMotherSilk(PlayMakerFSM fsm) { //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_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Expected O, but got Unknown //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Expected O, but got Unknown PlayMakerFSM fsm2 = fsm; FsmUtil.AddAction(FsmUtil.GetState(fsm2, "Idle"), (FsmStateAction)new LambdaAction { Method = delegate { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) Vector3 position = HeroController.instance.transform.position; if (Module.GetEnabledConfig(out var config2) && config2.GrandMotherSilk && position.x >= 22f && position.y >= 133f) { fsm2.SendEvent("CHALLENGE START"); } }, EveryFrame = true }); FsmUtil.AddAction(FsmUtil.GetState(fsm2, "Challenge Cam"), (FsmStateAction)new LambdaAction { Method = delegate { if (Module.GetEnabledConfig(out var config) && config.GrandMotherSilk) { fsm2.SendEvent("CHALLENGE"); } }, EveryFrame = true }); } internal AutoTriggerModule() { Events.AddFsmEdit("Bone_05_boss", "Thick Silk Vines Beast", "Control", AutoTriggerBellBeast); Events.AddFsmEdit("Bone_05_boss", "Return Battle", "Start Return Battle", AutoTriggerBellBeast); Events.AddFsmEdit("Coral_Judge_Arena", "Boss Scene", "Control", AutoTriggerLastJudge); Events.AddFsmEdit("Cradle_03", "Intro Sequence", "First Challenge", AutoTriggerGrandMotherSilk); } } [GenerateMenu] public class BindSettings : ModuleSettings { [Description("Number of masks to heal when binding.")] [ModMenuOptions(new object[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 })] public int HealMasks = 3; [Description("Number of masks to heal when multi-binding.")] [ModMenuOptions(new object[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 })] public int MultibinderHealMasks = 2; [Description("Number of silk spools required to bind.")] [ModMenuOptions(new object[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 })] public int SilkCost = 9; [Description("Multiplier on the time it takes to bind.")] [ModMenuOptions(new object[] { 0.25f, 0.5f, 0.75f, 1f, 1.5f, 2f, 3f })] public float TimePenalty = 1f; public override ModuleSettingsType DynamicType() { return ModuleSettingsType.Bind; } public override void ReadDynamicData(IPacket packet) { HealMasks.ReadData(packet); MultibinderHealMasks.ReadData(packet); SilkCost.ReadData(packet); TimePenalty.ReadData(packet); } public override void WriteDynamicData(IPacket packet) { HealMasks.WriteData(packet); MultibinderHealMasks.WriteData(packet); SilkCost.WriteData(packet); TimePenalty.WriteData(packet); } protected override bool Equivalent(BindSettings other) { if (HealMasks == other.HealMasks && MultibinderHealMasks == other.MultibinderHealMasks && SilkCost == other.SilkCost) { return TimePenalty == other.TimePenalty; } return false; } } [MonoDetourTargets(typeof(SilkSpool))] internal class BindModule : GlobalSettingsModule { public override string Name => "Bind"; public override ModuleActivationType ModuleActivationType => ModuleActivationType.AnyConfiguration; protected override BindModule Self() { return this; } protected override void OnGlobalConfigChanged(BindSettings before, BindSettings after) { if (before.SilkCost != after.SilkCost) { UIEvents.UpdateSilk(); } } protected override void CustomizeMenu(BindSettingsMenu menu) { menu.HealMasks.Model.FormatIntDelta(3); menu.MultibinderHealMasks.Model.FormatIntDelta(2); menu.SilkCost.Model.FormatIntDelta(9); menu.TimePenalty.Model.FormatPercent(); } private static void EditBindFsm(PlayMakerFSM fsm) { PlayMakerFSM fsm2 = fsm; FsmUtil.InsertAction(FsmUtil.GetState(fsm2, "Can Bind?"), 0, Module.IfEnabled(delegate(BindSettings s) { fsm2.FsmVariables.GetFsmInt("Silk Cost").Value = s.SilkCost; })); FsmUtil.InsertAction(FsmUtil.GetState(fsm2, "Set Normal"), 3, Module.IfEnabled(delegate(BindSettings s) { fsm2.FsmVariables.GetFsmInt("Heal Amount").Value = s.HealMasks; })); FsmUtil.AddAction(FsmUtil.GetState(fsm2, "Multi Bind"), Module.IfEnabled(delegate(BindSettings s) { fsm2.FsmVariables.GetFsmInt("Heal Amount").Value = s.MultibinderHealMasks; })); FsmUtil.InsertAction(FsmUtil.GetState(fsm2, "Bind Shared"), 0, Module.IfEnabled(delegate(BindSettings s) { FsmFloat fsmFloat = fsm2.FsmVariables.GetFsmFloat("Bind Time"); fsmFloat.Value *= s.TimePenalty; })); } private static void OverrideBindCost(ref float result) { if (!PlayerData.instance.IsAnyCursed && Module.GetEnabledConfig(out var config)) { result = config.SilkCost; } } static BindModule() { Events.AddFsmEdit("Hero_Hornet(Clone)", "Bind", EditBindFsm); } [MonoDetourHookInitialize] private static void Hook() { get_BindCost.Postfix(OverrideBindCost); } } [GenerateMenu] public class DeathSettings : ModuleSettings { [Description("Seconds to wait to respawn after death.")] [ModMenuOptions(new object[] { 0, 10, 20, 30, 45, 60, 90, 120, 180, 300 })] public int RespawnTimer; [Description("If false, don't spawn coccoons at all.")] public bool SpawnCoccoon = true; [Description("If false, don't lose rosaries on death.")] public bool LoseRosaries = true; [Description("If false, don't restrict silk on death.")] public bool LimitSilk = true; public override ModuleSettingsType DynamicType() { return ModuleSettingsType.Death; } public override void ReadDynamicData(IPacket packet) { RespawnTimer.ReadData(packet); SpawnCoccoon.ReadData(packet); LoseRosaries.ReadData(packet); LimitSilk.ReadData(packet); } public override void WriteDynamicData(IPacket packet) { RespawnTimer.WriteData(packet); SpawnCoccoon.WriteData(packet); LoseRosaries.WriteData(packet); LimitSilk.WriteData(packet); } protected override bool Equivalent(DeathSettings other) { if (RespawnTimer == other.RespawnTimer && SpawnCoccoon == other.SpawnCoccoon && LoseRosaries == other.LoseRosaries) { return LimitSilk == other.LimitSilk; } return false; } } [MonoDetourTargets(typeof(HeroController), GenerateControlFlowVariants = true)] internal class DeathModule : GlobalSettingsModule { [CompilerGenerated] private sealed class <>c__DisplayClass8_0 { public IEnumerator orig; public DeathSettings s; } public override string Name => "Death"; public override ModuleActivationType ModuleActivationType => ModuleActivationType.AnyConfiguration; internal static int GetRespawnTimer() { if (!Module.GetEnabledConfig(out var config)) { return 0; } return config.RespawnTimer; } protected override DeathModule Self() { return this; } protected override void OnGlobalConfigChanged(DeathSettings before, DeathSettings after) { if (before.RespawnTimer > after.RespawnTimer) { PauseTimerUI.ShortenRespawn(before.RespawnTimer - after.RespawnTimer); } } protected override void CustomizeMenu(DeathSettingsMenu menu) { DeathSettingsMenu menu2 = menu; menu2.SpawnCoccoon.OnValueChanged += UpdateInteractable; UpdateInteractable(menu2.SpawnCoccoon.Value); void UpdateInteractable(bool value) { ((SelectableElement)menu2.LoseRosaries).Interactable = value; ((SelectableElement)menu2.LimitSilk).Interactable = value; } } private static void ExtendDeath(HeroController self, ref bool nonLethal, ref bool frostDeath, ref IEnumerator coroutine) { <>c__DisplayClass8_0 CS$<>8__locals0 = new <>c__DisplayClass8_0(); if (!nonLethal && Module.GetEnabledConfig(out CS$<>8__locals0.s)) { CS$<>8__locals0.orig = coroutine; coroutine = Append(); } [IteratorStateMachine(typeof(<>c__DisplayClass8_0.<g__Append|0>d))] IEnumerator Append() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <>c__DisplayClass8_0.<g__Append|0>d(0) { <>4__this = CS$<>8__locals0 }; } } [MonoDetourHookInitialize] private static void Hook() { Die.Postfix(ExtendDeath); } } public enum MaskHealType { FullHeal, HealOneMask, NoHeal } [GenerateMenu] public class HealingSettings : ModuleSettings { [Description("Heal when sitting at a bench.")] public bool BenchHeal = true; [Description("Heal when completing a new mask.")] public MaskHealType MaskHeal; [Description("Heal when obtaining a new ability or silk heart.")] public bool AbilityHeal = true; [Description("Heal when bathing at a spa.")] public bool SpaHeal = true; public override ModuleSettingsType DynamicType() { return ModuleSettingsType.Healing; } public override void ReadDynamicData(IPacket packet) { BenchHeal.ReadData(packet); MaskHeal = packet.ReadEnum(); AbilityHeal.ReadData(packet); SpaHeal.ReadData(packet); } public override void WriteDynamicData(IPacket packet) { BenchHeal.WriteData(packet); MaskHeal.WriteData(packet); AbilityHeal.WriteData(packet); SpaHeal.WriteData(packet); } protected override bool Equivalent(HealingSettings other) { if (BenchHeal == other.BenchHeal && MaskHeal == other.MaskHeal && AbilityHeal == other.AbilityHeal) { return SpaHeal == other.SpaHeal; } return false; } } [MonoDetourTargets(typeof(CallMethodProper))] [MonoDetourTargets(typeof(PlayerData), GenerateControlFlowVariants = true)] internal class HealingModule : GlobalSettingsModule { public override string Name => "Healing"; public override ModuleActivationType ModuleActivationType => ModuleActivationType.AnyConfiguration; protected override HealingModule Self() { return this; } private static void BenchControlInterceptMaxHealth(PlayMakerFSM fsm) { fsm.ReplaceActions((FsmStateAction a) => a.IsCallMethodProper("MaxHealth"), MaybeBenchHeal); } private static void MaybeBenchHeal() { if ((Object)(object)HeroController.instance != (Object)null && (!Module.GetEnabledConfig(out var config) || config.BenchHeal)) { HeroController.instance.MaxHealth(); } } private static void MaskShardInterceptHealing(PlayMakerFSM fsm) { PlayMakerFSM fsm2 = fsm; FsmUtil.InsertMethod(FsmUtil.GetState(fsm2, "Full Health?"), 0, (Action)delegate { if (Module.GetEnabledConfig(out var config) && config.MaskHeal != 0) { fsm2.SendEvent("FINISHED"); } }); } private static ReturnFlow OverrideAddToMaxHealth(PlayerData self, ref int count) { if (Module.GetEnabledConfig(out var config) && config.MaskHeal != 0) { PlayerDataAccess.maxHealth += count; PlayerDataAccess.maxHealthBase += count; if (config.MaskHeal == MaskHealType.HealOneMask) { PlayerDataAccess.prevHealth = PlayerDataAccess.health; PlayerDataAccess.health += 1; } return (ReturnFlow)1; } return (ReturnFlow)0; } private static void ShrineInterceptHealing(PlayMakerFSM fsm) { PlayMakerFSM fsm2 = fsm; FsmUtil.InsertAction(FsmUtil.GetState(fsm2, "Heal"), Module.IfEnabled(delegate(HealingSettings config) { if (!config.AbilityHeal) { fsm2.SendEvent("FINISHED"); } }), 0); } private static void CrestInterceptHealing(PlayMakerFSM fsm) { FsmUtil.GetState(fsm, "Set Return").ReplaceActions((FsmStateAction a) => a.IsCallMethodProper("RefillAll"), MaybeCrestHeal); } private static void MaybeCrestHeal() { if ((Object)(object)HeroController.instance != (Object)null && (!Module.GetEnabledConfig(out var config) || config.AbilityHeal)) { HeroController.instance.RefillAll(); } } private static void SpaInterceptHealing(PlayMakerFSM fsm) { PlayMakerFSM fsm2 = fsm; FsmUtil.InsertAction(FsmUtil.GetState(fsm2, "Healing"), 0, Module.IfEnabled(delegate(HealingSettings config) { if (!config.SpaHeal) { fsm2.SendEvent("LEAVE"); } })); } static HealingModule() { Events.AddFsmEdit("Bench Control", BenchControlInterceptMaxHealth); Events.AddFsmEdit("Heart Container UI", MaskShardInterceptHealing); Events.AddFsmEdit("Shrine Weaver Ability", "Inspection", ShrineInterceptHealing); Events.AddFsmEdit("Crest Get Shrine", "Control", CrestInterceptHealing); Events.AddFsmEdit("Spa Region", SpaInterceptHealing); } [MonoDetourHookInitialize] private static void Hook() { Md.PlayerData.AddToMaxHealth.ControlFlowPrefix(OverrideAddToMaxHealth); } } public enum NotificationSetting { Silent, Notify } public enum TravelNotificationSetting { Silent, NotifyLocal, NotifyDestinationLocal, NotifyGlobal, NotifyGlobalDestinationLocal, NotifyDestinationGlobal } [GenerateMenu] public class IntelligenceSettings : ModuleSettings { public NotificationSetting BossKills; public NotificationSetting ShopPurchases; public NotificationSetting TollPurchases; public NotificationSetting SimpleKeyUsages; public NotificationSetting LeverHits; public NotificationSetting BellShrines; public NotificationSetting FleaRescues; public NotificationSetting CaravanRides; public TravelNotificationSetting BellwayRides; public TravelNotificationSetting VentricaRides; public override ModuleSettingsType DynamicType() { return ModuleSettingsType.Intelligence; } public override void ReadDynamicData(IPacket packet) { BossKills = packet.ReadEnum(); ShopPurchases = packet.ReadEnum(); TollPurchases = packet.ReadEnum(); SimpleKeyUsages = packet.ReadEnum(); LeverHits = packet.ReadEnum(); BellShrines = packet.ReadEnum(); FleaRescues = packet.ReadEnum(); CaravanRides = packet.ReadEnum(); BellwayRides = packet.ReadEnum(); VentricaRides = packet.ReadEnum(); } public override void WriteDynamicData(IPacket packet) { BossKills.WriteData(packet); ShopPurchases.WriteData(packet); TollPurchases.WriteData(packet); SimpleKeyUsages.WriteData(packet); LeverHits.WriteData(packet); BellShrines.WriteData(packet); FleaRescues.WriteData(packet); CaravanRides.WriteData(packet); BellwayRides.WriteData(packet); VentricaRides.WriteData(packet); } protected override bool Equivalent(IntelligenceSettings other) { if (BossKills == other.BossKills && ShopPurchases == other.ShopPurchases && TollPurchases == other.TollPurchases && SimpleKeyUsages == other.SimpleKeyUsages && LeverHits == other.LeverHits && BellShrines == other.BellShrines && FleaRescues == other.FleaRescues && CaravanRides == other.CaravanRides && BellwayRides == other.BellwayRides) { return VentricaRides == other.VentricaRides; } return false; } } internal class IntelligenceMessage : IIdentifiedPacket, IPacketData { public string Message = ""; public ServerPacketId Identifier => ServerPacketId.IntelligenceMessage; public bool Single => false; public bool IsReliable => true; public bool DropReliableDataIfNewerExists => false; public void ReadData(IPacket packet) { Message = packet.ReadString(); } public void WriteData(IPacket packet) { Message.WriteData(packet); } } [MonoDetourTargets(typeof(GameManager))] [MonoDetourTargets(typeof(HealthManager))] [MonoDetourTargets(typeof(Lever))] [MonoDetourTargets(typeof(Lever_tk2d))] [MonoDetourTargets(typeof(ShopItem))] internal class IntelligenceModule : GlobalSettingsModule { private const string BOSS_KILL = "You hear screams of agony echoing in the distance. A mighty foe has been slain."; private const string SHOP_PURCHASE = "You hear the hubble of barter and the clacking of rosaries. A deal has been made."; private const string TOLL_PURCHASE = "You hear rosaries clinking down a metal chute. A toll has been purchased."; private const string SIMPLE_KEY_USAGES = "You hear a simple door creak open, its key expired."; private static readonly IReadOnlyList LEVER_HITS = new <>z__ReadOnlyArray(new string[3] { "You hear the groan of a lever in the distance. A lever has been hit.", "You hear the slam of a lever in the distance. A lever has been hit.", "You hear gears creaking — a door moving in the distance. A lever has been hit." }); private const string BELL_SHRINES = "You hear a mighty bell echoing in the distance. A grand gate bell has been rung."; private const string FLEA_RESCUES = "You hear an excited 'Awoo!' in the distance. A flea has been saved."; private const string CARAVAN_RIDES = "You hear the great caravan setting off in the distance. The speedrunner has traveled with the fleas."; private readonly EventSuppressor sendMessages = new EventSuppressor(); private readonly Updater simpleKeys = new Updater(0); private readonly Updater defeatedBosses = new Updater(0); private readonly Updater bellshrines = new Updater(0); private readonly Updater savedFleas = new Updater(0); private static readonly HashSet ignoreLeverNames = new HashSet { "Bell Shrine Lever", "lever_bot", "lever_bottom", "lever_left", "lever_right", "lever_top", "Lever Bottom", "Lever Cog", "Lever Top" }; public override string Name => "Intelligence"; public override ModuleActivationType ModuleActivationType => ModuleActivationType.OnOffOnly; private static string BellwayDestinationString(FastTravelLocations destination) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Expected I4, but got Unknown return (int)destination switch { 0 => "nowhere", 1 => "Bone Bottom", 2 => "the Deep Docks", 3 => "the Far Fields", 4 => "Greymoor", 5 => "Bellhart", 6 => "the Blasted Steps", 9 => "the Grand Bellway", 11 => "the Slab", 12 => "Shellwood", 13 => "the Marrow", 14 => "Bilewater", 15 => "the Putrefied Ducts", _ => "the unknown", }; } private static string BellwayRideString(bool includeDestination, FastTravelLocations destination) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) string text = (includeDestination ? (", tossed about the ground of " + BellwayDestinationString(destination)) : ""); return "You hear the growl of a beast surging through a thousand little bells" + text + ". The speedrunner has traveled with the Bell Beast."; } private static string VentricaDestinationString(TubeTravelLocations destination) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected I4, but got Unknown return (int)destination switch { 0 => "nowhere land", 1 => "Terminus", 2 => "the Choral Chambers", 3 => "the Underworks", 4 => "the Grand Bellway", 5 => "the High Halls", 7 => "Songclave", 8 => "the Memorium", _ => "the unknown", }; } private static string VentricaRideString(bool includeDestination, TubeTravelLocations destination) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) string text = (includeDestination ? (". A heavy thump is heard in " + VentricaDestinationString(destination)) : ""); return "You hear a tube flying across the citadel" + text + ". The speedrunner has traveled with the Ventrica."; } protected override IntelligenceModule Self() { return this; } public IntelligenceModule() { Events.OnHeroUpdate += WatchPlayerData; Events.OnLeaveScene += WatchCaravanRide; Events.AddRawFsmEdit(ModifyTollFsm); Events.AddFsmEdit("rosary_string_machine", "Behaviour (special)", ModifyStringMachineFsm); Events.AddFsmEdit("Bone Beast NPC", "Interaction", ModifyBellBeast); Events.AddFsmEdit("City Travel Tube", "Tube Travel", ModifyVentrica); Events.AddFsmEdit("cog_lever", "Control", ModifyCogLeverFsm); Events.AddFsmEdit("cog_lever (1)", "Control", ModifyCogLeverFsm); Events.AddFsmEdit("cog_lever (2)", "Control", ModifyCogLeverFsm); } private static int CalculateDefeatedBosses() { return (PlayerDataAccess.ant02GuardDefeated ? 1 : 0) + (PlayerDataAccess.cog7_automaton_defeated ? 1 : 0) + (PlayerDataAccess.defeatedAntQueen ? 1 : 0) + (PlayerDataAccess.defeatedAntTrapper ? 1 : 0) + (PlayerDataAccess.defeatedBellBeast ? 1 : 0) + (PlayerDataAccess.defeatedBoneFlyerGiant ? 1 : 0) + (PlayerDataAccess.DefeatedBonetownBoss ? 1 : 0) + (PlayerDataAccess.defeatedBroodMother ? 1 : 0) + (PlayerDataAccess.defeatedCloverDancers ? 1 : 0) + (PlayerDataAccess.defeatedCogworkDancers ? 1 : 0) + (PlayerDataAccess.defeatedCoralDrillers ? 1 : 0) + (PlayerDataAccess.defeatedCoralDrillerSolo ? 1 : 0) + (PlayerDataAccess.defeatedCoralKing ? 1 : 0) + (PlayerDataAccess.defeatedCrowCourt ? 1 : 0) + (PlayerDataAccess.defeatedDockForemen ? 1 : 0) + (PlayerDataAccess.defeatedFirstWeaver ? 1 : 0) + (PlayerDataAccess.defeatedFlowerQueen ? 1 : 0) + (PlayerDataAccess.defeatedGreyWarrior ? 1 : 0) + (PlayerDataAccess.defeatedLace1 ? 1 : 0) + (PlayerDataAccess.defeatedLaceTower ? 1 : 0) + (PlayerDataAccess.defeatedLastJudge ? 1 : 0) + (PlayerDataAccess.defeatedMossEvolver ? 1 : 0) + (PlayerDataAccess.defeatedMossMother ? 1 : 0) + (PlayerDataAccess.defeatedPhantom ? 1 : 0) + (PlayerDataAccess.defeatedRoachkeeperChef ? 1 : 0) + (PlayerDataAccess.defeatedSeth ? 1 : 0) + (PlayerDataAccess.defeatedSongChevalierBoss ? 1 : 0) + (PlayerDataAccess.defeatedSplinterQueen ? 1 : 0) + (PlayerDataAccess.defeatedTrobbio ? 1 : 0) + (PlayerDataAccess.defeatedTormentedTrobbio ? 1 : 0) + (PlayerDataAccess.defeatedWhiteCloverstag ? 1 : 0) + (PlayerDataAccess.defeatedVampireGnatBoss ? 1 : 0) + (PlayerDataAccess.defeatedWispPyreEffigy ? 1 : 0) + (PlayerDataAccess.defeatedZapCoreEnemy ? 1 : 0) + (PlayerDataAccess.garmondBlackThreadDefeated ? 1 : 0) + (PlayerDataAccess.skullKingDefeated ? 1 : 0) + (PlayerDataAccess.spinnerDefeated ? 1 : 0) + (PlayerDataAccess.wardBossDefeated ? 1 : 0); } private static int CalculateBellshrines() { return (PlayerDataAccess.bellShrineBellhart ? 1 : 0) + (PlayerDataAccess.bellShrineBoneForest ? 1 : 0) + (PlayerDataAccess.bellShrineEnclave ? 1 : 0) + (PlayerDataAccess.bellShrineGreymoor ? 1 : 0) + (PlayerDataAccess.bellShrineShellwood ? 1 : 0) + (PlayerDataAccess.bellShrineWilds ? 1 : 0); } private static int CalculateSavedFleas(PlayerData pd) { return pd.SavedFleasCount + (PlayerDataAccess.CaravanLechSaved ? 1 : 0) + (PlayerDataAccess.MetTroupeHunterWild ? 1 : 0) + (PlayerDataAccess.tamedGiantFlea ? 1 : 0); } private void WatchPlayerData() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) PlayerData instance = PlayerData.instance; if (simpleKeys.Update(((SerializableNamedList)(object)PlayerData.instance.Collectables).GetData("Simple Key").Amount, out var prevValue, out var newValue) && prevValue > newValue) { SendMessage("You hear a simple door creak open, its key expired."); } if (defeatedBosses.Update(CalculateDefeatedBosses())) { SendMessage("You hear screams of agony echoing in the distance. A mighty foe has been slain."); } if (bellshrines.Update(CalculateBellshrines())) { SendMessage("You hear a mighty bell echoing in the distance. A grand gate bell has been rung."); } if (savedFleas.Update(CalculateSavedFleas(instance))) { SendMessage("You hear an excited 'Awoo!' in the distance. A flea has been saved."); } } private void WatchCaravanRide(Scene scene) { if (!(((Scene)(ref scene)).name != "Room_Caravan_Interior_Travel") && base.Enabled) { SendMessage("You hear the great caravan setting off in the distance. The speedrunner has traveled with the fleas."); } } private void ModifyTollFsm(Fsm fsm) { if (!fsm.HasStates(new <>z__ReadOnlyArray(new string[10] { "Get Text", "Confirm", "Cancel", "Start Sequence", "Wait For Currency Counter", "Taking Currency", "Wait Frame", "Before Sequence Pause", "Keep Reach", "End" }))) { return; } FsmUtil.InsertMethod(fsm.GetState("End"), (Action)delegate { if (Module.GetEnabledConfig(out var config) && config.TollPurchases == NotificationSetting.Notify) { SendMessage("You hear rosaries clinking down a metal chute. A toll has been purchased."); } }, 0, false); } private void ModifyStringMachineFsm(PlayMakerFSM fsm) { FsmUtil.AddMethod(FsmUtil.GetState(fsm, "Give Object"), (Action)delegate { if (Module.GetEnabledConfig(out var config) && config.TollPurchases == NotificationSetting.Notify) { SendMessage("You hear rosaries clinking down a metal chute. A toll has been purchased."); } }, false); } private void SendTravelMessage(PlayMakerFSM fsm, TravelNotificationSetting setting, Func messageFn) where T : Enum { T arg = (T)fsm.FsmVariables.GetFsmEnum("Target Location").Value; bool flag = HuntClientAddon.OpponentsInRoom(); switch (setting) { case TravelNotificationSetting.NotifyLocal: if (flag) { SendMessage(messageFn(arg1: false, arg)); } break; case TravelNotificationSetting.NotifyDestinationLocal: if (flag) { SendMessage(messageFn(arg1: true, arg)); } break; case TravelNotificationSetting.NotifyGlobal: SendMessage(messageFn(arg1: false, arg)); break; case TravelNotificationSetting.NotifyGlobalDestinationLocal: SendMessage(messageFn(flag, arg)); break; case TravelNotificationSetting.NotifyDestinationGlobal: SendMessage(messageFn(arg1: true, arg)); break; case TravelNotificationSetting.Silent: break; } } private void ModifyBellBeast(PlayMakerFSM fsm) { PlayMakerFSM fsm2 = fsm; FsmUtil.AddMethod(FsmUtil.GetState(fsm2, "Fade"), (Action)delegate { if (Module.GetEnabledConfig(out var config)) { SendTravelMessage(fsm2, config.BellwayRides, (Func)BellwayRideString); } }, false); } private void ModifyVentrica(PlayMakerFSM fsm) { PlayMakerFSM fsm2 = fsm; FsmUtil.AddMethod(FsmUtil.GetState(fsm2, "Preload Scene"), (Action)delegate { if (Module.GetEnabledConfig(out var config)) { SendTravelMessage(fsm2, config.VentricaRides, (Func)VentricaRideString); } }, false); } private void SendMessage(string msg) { if (!sendMessages.Suppressed && TheHuntIsOnPlugin.GetRole() == RoleId.Speedrunner && GameManager.instance.profileID != 0) { HuntClientAddon.Instance?.Send(new IntelligenceMessage { Message = msg }); } } private static void PostfixLoadGameData(GameManager self, ref SaveGameData saveGameData, ref int saveSlot) { if (Module.Instance == null) { return; } using (Module.Instance.sendMessages.Suppress()) { Module.Instance.WatchPlayerData(); } } private static bool IgnoreLever(Lever lever) { if (ignoreLeverNames.Contains(((Object)lever).name)) { return true; } if (((Object)lever).name.Contains("Understore Lever")) { return true; } if ((Object)(object)((Component)lever).transform.parent != (Object)null) { return ((Object)((Component)lever).transform.parent).name == "Cage"; } return false; } private static bool IgnoreLeverTk2d(Lever_tk2d lever) { return ((Object)((Component)lever).gameObject).name == "Bell Shrine Lever"; } private void ModifyCogLeverFsm(PlayMakerFSM fsm) { FsmUtil.InsertMethod(FsmUtil.GetState(fsm, "Complete Shake"), (Action)delegate { if (Module.GetEnabledConfig(out var config) && config.LeverHits == NotificationSetting.Notify) { Module.Instance?.SendLeverMessage(); } }, 0, false); } private void SendLeverMessage() { SendMessage(LEVER_HITS[Random.Range(0, LEVER_HITS.Count)]); } private static void PostfixLeverAwake(Lever self) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Expected O, but got Unknown Lever self2 = self; self2.OnActivated.AddListener((UnityAction)delegate { if (Module.GetEnabledConfig(out var config) && config.LeverHits == NotificationSetting.Notify && !IgnoreLever(self2)) { Module.Instance?.SendLeverMessage(); } }); } private static void PostfixLeverTk2dAwake(Lever_tk2d self) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Expected O, but got Unknown Lever_tk2d self2 = self; self2.CustomGateOpen.AddListener((UnityAction)delegate { if (Module.GetEnabledConfig(out var config) && config.LeverHits == NotificationSetting.Notify && !IgnoreLeverTk2d(self2)) { Module.Instance?.SendLeverMessage(); } }); } private static void PostfixShopItemPurchased(ShopItem self, ref Action onComplete, ref int subItemIndex) { if (Module.GetEnabledConfig(out var config) && config.ShopPurchases == NotificationSetting.Notify) { Module.Instance?.SendMessage("You hear the hubble of barter and the clacking of rosaries. A deal has been made."); } } [MonoDetourHookInitialize] private static void Hook() { SetLoadedGameData_SaveGameData_System_Int32.Postfix(PostfixLoadGameData); Md.Lever.Awake.Postfix(PostfixLeverAwake); Md.Lever_tk2d.Awake.Postfix(PostfixLeverTk2dAwake); SetPurchased.Postfix(PostfixShopItemPurchased); } } [GenerateMenu] public class SilkRegenerationSettings : ModuleSettings { public int Silkhearts; [Description("Time to regenerate the first silk spool (default 1.45)")] [ModMenuRange(0.1f, 60f)] public float FirstSilkRegenTime = 1.45f; [Description("Time to regenerate all spools but the first (default 3.9)")] [ModMenuRange(0.1f, 60f)] public float SilkRegenTime = 3.9f; [Description("Whether silk can be obtained outside of regen")] public bool CanFarmSilk = true; public override ModuleSettingsType DynamicType() { return ModuleSettingsType.SilkRegeneration; } public override void ReadDynamicData(IPacket packet) { Silkhearts.ReadData(packet); FirstSilkRegenTime.ReadData(packet); SilkRegenTime.ReadData(packet); CanFarmSilk.ReadData(packet); } public override void WriteDynamicData(IPacket packet) { Silkhearts.WriteData(packet); FirstSilkRegenTime.WriteData(packet); SilkRegenTime.WriteData(packet); CanFarmSilk.WriteData(packet); } protected override bool Equivalent(SilkRegenerationSettings other) { if (Silkhearts == other.Silkhearts && FirstSilkRegenTime == other.FirstSilkRegenTime && SilkRegenTime == other.SilkRegenTime) { return CanFarmSilk == other.CanFarmSilk; } return false; } } [MonoDetourTargets(typeof(HeroController), GenerateControlFlowVariants = true)] internal class SilkRegenerationModule : GlobalSettingsModule { [CompilerGenerated] private static class <>O { public static Action <0>__ReallyAddSilk; public static AddSilk_System_Int32_System_Boolean_SilkSpool_SilkAddSource_System_Boolean.ControlFlowPrefixSignature <1>__PrefixAddSilk; public static Manipulator <2>__HookDoSilkRegen; public static ResetSilkRegen.PrefixSignature <3>__PrefixResetSilkRegen; public static StartSilkRegen.PrefixSignature <4>__PrefixStartSilkRegen; } private readonly Func extraSilkhearts = () => Module.GetEnabledConfig(out var config) ? config.Silkhearts : 0; private static readonly EventSuppressor blockSilkGain = new EventSuppressor(); public override string Name => "Silk Regeneration"; public override ModuleActivationType ModuleActivationType => ModuleActivationType.AnyConfiguration; protected override SilkRegenerationModule Self() { return this; } public override void OnEnabled() { Events.AddPdIntModifier("silkRegenMax", extraSilkhearts); } public override void OnDisabled() { Events.RemovePdIntModifier("silkRegenMax", extraSilkhearts); } protected override void OnGlobalConfigChanged(SilkRegenerationSettings before, SilkRegenerationSettings after) { if (before.Silkhearts != after.Silkhearts && (Object)(object)HeroController.instance != (Object)null) { HeroController.instance.ResetSilkRegen(); } } protected override void CustomizeMenu(SilkRegenerationSettingsMenu menu) { menu.Silkhearts = (SelectableValueElement)(object)new SliderElement(LocalizedText.op_Implicit("Silkhearts"), (SliderModel)(object)SliderModels.ForInts(0, 18)); } private static ReturnFlow PrefixAddSilk(HeroController self, ref int amount, ref bool heroEffect, ref SilkAddSource source, ref bool forceCanBindEffect) { if (Module.GetEnabledConfig(out var config) && !config.CanFarmSilk && !blockSilkGain.Suppressed) { return (ReturnFlow)1; } return (ReturnFlow)0; } private static void HookDoSilkRegen(ILManipulationInfo info) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown ILCursor val = new ILCursor(info.Context); val.Goto(0, (MoveType)0, false); if (val.TryGotoNext(new Func[1] { (Instruction i) => ILPatternMatchingExt.MatchCall(i, "AddSilk") })) { val.Remove(); val.EmitDelegate>((Action)ReallyAddSilk); } static void ReallyAddSilk(HeroController self, int amount, bool heroEffect) { using (blockSilkGain.Suppress()) { self.AddSilk(amount, heroEffect); } } } private static void PrefixResetSilkRegen(HeroController self) { SilkRegenerationSettings config; bool enabledConfig = Module.GetEnabledConfig(out config); self.FIRST_SILK_REGEN_DELAY = 0.65f * (enabledConfig ? (config.FirstSilkRegenTime / 1.45f) : 1f); self.SILK_REGEN_DELAY = 1.9f * (enabledConfig ? (config.SilkRegenTime / 3.9f) : 1f); } private static void PrefixStartSilkRegen(HeroController self) { SilkRegenerationSettings config; bool enabledConfig = Module.GetEnabledConfig(out config); self.FIRST_SILK_REGEN_DURATION = 0.8f * (enabledConfig ? (config.FirstSilkRegenTime / 1.45f) : 1f); self.SILK_REGEN_DURATION = 2f * (enabledConfig ? (config.SilkRegenTime / 3.9f) : 1f); } [MonoDetourHookInitialize] private static void Hook() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Expected O, but got Unknown AddSilk_System_Int32_System_Boolean_SilkSpool_SilkAddSource_System_Boolean.ControlFlowPrefix(PrefixAddSilk); object obj = <>O.<2>__HookDoSilkRegen; if (obj == null) { Manipulator val = HookDoSilkRegen; <>O.<2>__HookDoSilkRegen = val; obj = (object)val; } DoSilkRegen.ILHook((Manipulator)obj); ResetSilkRegen.Prefix(PrefixResetSilkRegen); StartSilkRegen.Prefix(PrefixStartSilkRegen); } } public enum SpawnPoint { Unchanged, BoneBottom, Bellhart, MossGrotto, Songclave } [GenerateMenu] public class SpawnPointSettings : ModuleSettings { [Description("Forced respawn point on death.")] public SpawnPoint SpawnPoint; public override ModuleSettingsType DynamicType() { return ModuleSettingsType.SpawnPoint; } public override void ReadDynamicData(IPacket packet) { SpawnPoint = packet.ReadEnum(); } public override void WriteDynamicData(IPacket packet) { SpawnPoint.WriteData(packet); } protected override bool Equivalent(SpawnPointSettings other) { return SpawnPoint == other.SpawnPoint; } } [MonoDetourTargets(typeof(GameManager))] internal class SpawnPointModule : GlobalSettingsModule { private class RespawnData { public string Scene = ""; public Vector2 Position; public bool FacingRight; } [CompilerGenerated] private static class <>O { public static Func <0>__Delegate; public static Action <1>__Delegate; public static Manipulator <2>__OverridePlayerDeadMoveNext; public static Manipulator <3>__OverrideReadyForRespawn; } private static readonly Dictionary respawnData = new Dictionary { [SpawnPoint.Bellhart] = new RespawnData { Scene = "Belltown", Position = new Vector2(46f, 23f), FacingRight = true }, [SpawnPoint.BoneBottom] = new RespawnData { Scene = "Bonetown", Position = new Vector2(218f, 8f), FacingRight = true }, [SpawnPoint.MossGrotto] = new RespawnData { Scene = "Tut_01", Position = new Vector2(54.5f, 5f), FacingRight = false }, [SpawnPoint.Songclave] = new RespawnData { Scene = "Song_Enclave", Position = new Vector2(91f, 8f), FacingRight = false } }; private static readonly Lazy> respawnDataByScene = new Lazy>(delegate { Dictionary dictionary = new Dictionary(); foreach (RespawnData value in respawnData.Values) { dictionary[value.Scene] = value; } return dictionary; }); private const string RESPAWN_MARKER_NAME = "TheHuntIsOn-RespawnMarker"; public override string Name => "Spawn Point"; public override ModuleActivationType ModuleActivationType => ModuleActivationType.AnyConfiguration; internal SpawnPointModule() { Events.OnEnterScene += OnNewScene; } protected override SpawnPointModule Self() { return this; } public override void OnEnabled() { PlayerDataVariableEvents.OnGetVariable += OverrideRespawnString; PlayerDataVariableEvents.OnGetVariable += OverrideRespawnInt; } public override void OnDisabled() { PlayerDataVariableEvents.OnGetVariable -= OverrideRespawnString; PlayerDataVariableEvents.OnGetVariable -= OverrideRespawnInt; } private static bool GetRespawnData(out RespawnData data) { if (Module.GetEnabledConfig(out var config)) { return respawnData.TryGetValue(config.SpawnPoint, out data); } data = new RespawnData(); return false; } private static void OverridePlayerDeadMoveNext(ILManipulationInfo info) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown ILCursor val = new ILCursor(info.Context); val.Goto(0, (MoveType)0, false); if (val.TryGotoNext(new Func[1] { (Instruction i) => ILPatternMatchingExt.MatchCall(i, "SpawnPreloader") }) && val.TryGotoPrev((MoveType)2, new Func[1] { (Instruction i) => ILPatternMatchingExt.MatchLdloc(i, 3) })) { val.EmitDelegate>((Func)Delegate); } static string Delegate(string scene) { if (!GetRespawnData(out RespawnData data)) { return scene; } return data.Scene; } } private static void OverrideReadyForRespawn(ILManipulationInfo info) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown ILCursor val = new ILCursor(info.Context); val.Goto(0, (MoveType)0, false); if (val.TryGotoNext(new Func[1] { (Instruction i) => ILPatternMatchingExt.MatchCall(i, "BeginSceneTransition") })) { val.Remove(); val.EmitDelegate>((Action)Delegate); } static void Delegate(GameManager self, SceneLoadInfo info) { if (GetRespawnData(out RespawnData data)) { info.SceneName = data.Scene; info.EntryGateName = "TheHuntIsOn-RespawnMarker"; } self.BeginSceneTransition(info); } } private string OverrideRespawnString(PlayerData self, string name, string current) { RespawnData data; return name switch { "respawnScene" => GetRespawnData(out data) ? data.Scene : current, "respawnMarkerName" => (base.GlobalConfig.SpawnPoint != 0) ? "TheHuntIsOn-RespawnMarker" : current, "tempRespawnScene" => (base.GlobalConfig.SpawnPoint != 0) ? "" : current, "tempRespawnMarker" => (base.GlobalConfig.SpawnPoint != 0) ? "" : current, _ => current, }; } private int OverrideRespawnInt(PlayerData playerData, string name, int current) { if (name == "respawnType") { return (base.GlobalConfig.SpawnPoint == SpawnPoint.Unchanged) ? current : 0; } return current; } private void OnNewScene(Scene scene) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: 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_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Expected O, but got Unknown //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown if (GetRespawnData(out RespawnData data) && !(((Scene)(ref scene)).name != data.Scene)) { GameObject val = new GameObject("TheHuntIsOn-RespawnMarker"); val.transform.position = Vector2.op_Implicit(data.Position); val.tag = "RespawnPoint"; RespawnMarker obj = val.AddComponent(); obj.respawnFacingRight = data.FacingRight; obj.customFadeDuration = new OverrideFloat(); obj.overrideMapZone = new OverrideMapZone(); val.SetActive(true); } } [MonoDetourHookInitialize] private static void Hook() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Expected O, but got Unknown object obj = <>O.<2>__OverridePlayerDeadMoveNext; if (obj == null) { Manipulator val = OverridePlayerDeadMoveNext; <>O.<2>__OverridePlayerDeadMoveNext = val; obj = (object)val; } _PlayerDead_d__245.MoveNext.ILHook((Manipulator)obj); object obj2 = <>O.<3>__OverrideReadyForRespawn; if (obj2 == null) { Manipulator val2 = OverrideReadyForRespawn; <>O.<3>__OverrideReadyForRespawn = val2; obj2 = (object)val2; } ReadyForRespawn.ILHook((Manipulator)obj2); } } [GenerateMenu] public class StatsSettings : ModuleSettings { [Description("Number of masks players start with.")] [ModMenuOptions(new object[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 })] public int StartingMasks = 5; [Description("Number of silk spools players start with.")] [ModMenuOptions(new object[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 })] public int StartingSilkSpools = 9; public override ModuleSettingsType DynamicType() { return ModuleSettingsType.Stats; } public override void ReadDynamicData(IPacket packet) { StartingMasks.ReadData(packet); StartingSilkSpools.ReadData(packet); } public override void WriteDynamicData(IPacket packet) { StartingMasks.WriteData(packet); StartingSilkSpools.WriteData(packet); } protected override bool Equivalent(StatsSettings other) { if (StartingMasks == other.StartingMasks) { return StartingSilkSpools == other.StartingSilkSpools; } return false; } } internal class StatsModule : GlobalSettingsModule { private static readonly Dictionary> intModifiers = new Dictionary> { ["maxHealth"] = FromSettings((StatsSettings s) => s.StartingMasks - 5), ["maxHealthBase"] = FromSettings((StatsSettings s) => s.StartingMasks - 5), ["silkMax"] = FromSettings((StatsSettings s) => s.StartingSilkSpools - 9) }; public override string Name => "Stats"; public override ModuleActivationType ModuleActivationType => ModuleActivationType.AnyConfiguration; protected override StatsModule Self() { return this; } private static Func FromSettings(Func func) { Func func2 = func; StatsSettings config; return () => Module.GetEnabledConfig(out config) ? func2(config) : 0; } public override void OnEnabled() { foreach (KeyValuePair> intModifier in intModifiers) { Events.AddPdIntModifier(intModifier.Key, intModifier.Value); } UIEvents.UpdateHealth(); UIEvents.UpdateSilk(); } public override void OnDisabled() { foreach (KeyValuePair> intModifier in intModifiers) { Events.RemovePdIntModifier(intModifier.Key, intModifier.Value); } UIEvents.UpdateHealth(); UIEvents.UpdateSilk(); } protected override void OnGlobalConfigChanged(StatsSettings before, StatsSettings after) { if (before.StartingMasks != after.StartingMasks) { UIEvents.UpdateHealth(); } if (before.StartingSilkSpools != after.StartingSilkSpools) { UIEvents.UpdateSilk(); } } protected override void CustomizeMenu(StatsSettingsMenu menu) { menu.StartingMasks.Model.FormatIntDelta(5); menu.StartingSilkSpools.Model.FormatIntDelta(9); } } [GeneratedCode("ModMenuGenerator", "0.7.1")] public class AutoTriggerSettingsMenu : ICustomMenu, ICustomMenu { [CompilerGenerated] private sealed class d__18 : IEnumerable, IEnumerable, IEnumerator, IEnumerator, IDisposable { private int <>1__state; private MenuElement <>2__current; private int <>l__initialThreadId; public AutoTriggerSettingsMenu <>4__this; MenuElement IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__18(int <>1__state) { this.<>1__state = <>1__state; <>l__initialThreadId = Environment.CurrentManagedThreadId; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { int num = <>1__state; AutoTriggerSettingsMenu autoTriggerSettingsMenu = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <>2__current = (MenuElement)(object)autoTriggerSettingsMenu.BellBeast; <>1__state = 1; return true; case 1: <>1__state = -1; <>2__current = (MenuElement)(object)autoTriggerSettingsMenu.LastJudge; <>1__state = 2; return true; case 2: <>1__state = -1; <>2__current = (MenuElement)(object)autoTriggerSettingsMenu.GrandMotherSilk; <>1__state = 3; return true; case 3: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } [DebuggerHidden] IEnumerator IEnumerable.GetEnumerator() { d__18 result; if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId) { <>1__state = 0; result = this; } else { result = new d__18(0) { <>4__this = <>4__this }; } return result; } [DebuggerHidden] IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable)this).GetEnumerator(); } } private SelectableValueElement _BellBeast; private SelectableValueElement _LastJudge; private SelectableValueElement _GrandMotherSilk; private readonly EventSuppressor notifySubscribers = new EventSuppressor(); private readonly Action _BellBeast_subscriber; private readonly Action _LastJudge_subscriber; private readonly Action _GrandMotherSilk_subscriber; public SelectableValueElement BellBeast { get { return _BellBeast; } set { if (value == null) { throw new ArgumentNullException("BellBeast"); } if (_BellBeast != value) { if (_BellBeast != null) { _BellBeast.OnValueChanged -= _BellBeast_subscriber; } _BellBeast = value; _BellBeast.OnValueChanged += _BellBeast_subscriber; } } } public SelectableValueElement LastJudge { get { return _LastJudge; } set { if (value == null) { throw new ArgumentNullException("LastJudge"); } if (_LastJudge != value) { if (_LastJudge != null) { _LastJudge.OnValueChanged -= _LastJudge_subscriber; } _LastJudge = value; _LastJudge.OnValueChanged += _LastJudge_subscriber; } } } public SelectableValueElement GrandMotherSilk { get { return _GrandMotherSilk; } set { if (value == null) { throw new ArgumentNullException("GrandMotherSilk"); } if (_GrandMotherSilk != value) { if (_GrandMotherSilk != null) { _GrandMotherSilk.OnValueChanged -= _GrandMotherSilk_subscriber; } _GrandMotherSilk = value; _GrandMotherSilk.OnValueChanged += _GrandMotherSilk_subscriber; } } } public event Action? OnValueChanged; public AutoTriggerSettingsMenu() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown _BellBeast_subscriber = delegate(bool value) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown InvokeValueChanged(new CustomMenuValueChangedEvent("BellBeast", (object)value)); }; BellBeast = (SelectableValueElement)(object)new ChoiceElement(LocalizedText.op_Implicit("Bell Beast"), (IChoiceModel)(object)ChoiceModels.ForBool(), LocalizedText.op_Implicit("Auto-trigger the Bell Beast fight.")); _LastJudge_subscriber = delegate(bool value) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown InvokeValueChanged(new CustomMenuValueChangedEvent("LastJudge", (object)value)); }; LastJudge = (SelectableValueElement)(object)new ChoiceElement(LocalizedText.op_Implicit("Last Judge"), (IChoiceModel)(object)ChoiceModels.ForBool(), LocalizedText.op_Implicit("Auto-trigger the Last Judge fight.")); _GrandMotherSilk_subscriber = delegate(bool value) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown InvokeValueChanged(new CustomMenuValueChangedEvent("GrandMotherSilk", (object)value)); }; GrandMotherSilk = (SelectableValueElement)(object)new ChoiceElement(LocalizedText.op_Implicit("Grand Mother Silk"), (IChoiceModel)(object)ChoiceModels.ForBool(), LocalizedText.op_Implicit("Auto-trigger the Grand Mother Silk fight.")); } public void ExportTo(AutoTriggerSettings data) { data.BellBeast = BellBeast.Value; data.LastJudge = LastJudge.Value; data.GrandMotherSilk = GrandMotherSilk.Value; } public void ApplyFrom(AutoTriggerSettings data) { using (notifySubscribers.Suppress()) { BellBeast.Value = data.BellBeast; LastJudge.Value = data.LastJudge; GrandMotherSilk.Value = data.GrandMotherSilk; } } [IteratorStateMachine(typeof(d__18))] public IEnumerable Elements() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__18(-2) { <>4__this = this }; } private void InvokeValueChanged(CustomMenuValueChangedEvent args) { if (!notifySubscribers.Suppressed) { this.OnValueChanged?.Invoke(args); } } } [GeneratedCode("ModMenuGenerator", "0.7.1")] public class BindSettingsMenu : ICustomMenu, ICustomMenu { [CompilerGenerated] private sealed class d__22 : IEnumerable, IEnumerable, IEnumerator, IEnumerator, IDisposable { private int <>1__state; private MenuElement <>2__current; private int <>l__initialThreadId; public BindSettingsMenu <>4__this; MenuElement IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__22(int <>1__state) { this.<>1__state = <>1__state; <>l__initialThreadId = Environment.CurrentManagedThreadId; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { int num = <>1__state; BindSettingsMenu bindSettingsMenu = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <>2__current = (MenuElement)(object)bindSettingsMenu.HealMasks; <>1__state = 1; return true; case 1: <>1__state = -1; <>2__current = (MenuElement)(object)bindSettingsMenu.MultibinderHealMasks; <>1__state = 2; return true; case 2: <>1__state = -1; <>2__current = (MenuElement)(object)bindSettingsMenu.SilkCost; <>1__state = 3; return true; case 3: <>1__state = -1; <>2__current = (MenuElement)(object)bindSettingsMenu.TimePenalty; <>1__state = 4; return true; case 4: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } [DebuggerHidden] IEnumerator IEnumerable.GetEnumerator() { d__22 result; if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId) { <>1__state = 0; result = this; } else { result = new d__22(0) { <>4__this = <>4__this }; } return result; } [DebuggerHidden] IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable)this).GetEnumerator(); } } private SelectableValueElement _HealMasks; private SelectableValueElement _MultibinderHealMasks; private SelectableValueElement _SilkCost; private SelectableValueElement _TimePenalty; private readonly EventSuppressor notifySubscribers = new EventSuppressor(); private readonly Action _HealMasks_subscriber; private readonly Action _MultibinderHealMasks_subscriber; private readonly Action _SilkCost_subscriber; private readonly Action _TimePenalty_subscriber; public SelectableValueElement HealMasks { get { return _HealMasks; } set { if (value == null) { throw new ArgumentNullException("HealMasks"); } if (_HealMasks != value) { if (_HealMasks != null) { _HealMasks.OnValueChanged -= _HealMasks_subscriber; } _HealMasks = value; _HealMasks.OnValueChanged += _HealMasks_subscriber; } } } public SelectableValueElement MultibinderHealMasks { get { return _MultibinderHealMasks; } set { if (value == null) { throw new ArgumentNullException("MultibinderHealMasks"); } if (_MultibinderHealMasks != value) { if (_MultibinderHealMasks != null) { _MultibinderHealMasks.OnValueChanged -= _MultibinderHealMasks_subscriber; } _MultibinderHealMasks = value; _MultibinderHealMasks.OnValueChanged += _MultibinderHealMasks_subscriber; } } } public SelectableValueElement SilkCost { get { return _SilkCost; } set { if (value == null) { throw new ArgumentNullException("SilkCost"); } if (_SilkCost != value) { if (_SilkCost != null) { _SilkCost.OnValueChanged -= _SilkCost_subscriber; } _SilkCost = value; _SilkCost.OnValueChanged += _SilkCost_subscriber; } } } public SelectableValueElement TimePenalty { get { return _TimePenalty; } set { if (value == null) { throw new ArgumentNullException("TimePenalty"); } if (_TimePenalty != value) { if (_TimePenalty != null) { _TimePenalty.OnValueChanged -= _TimePenalty_subscriber; } _TimePenalty = value; _TimePenalty.OnValueChanged += _TimePenalty_subscriber; } } } public event Action? OnValueChanged; public BindSettingsMenu() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown _HealMasks_subscriber = delegate(int value) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown InvokeValueChanged(new CustomMenuValueChangedEvent("HealMasks", (object)value)); }; HealMasks = (SelectableValueElement)(object)new ChoiceElement(LocalizedText.op_Implicit("Heal Masks"), (IChoiceModel)(object)ChoiceModels.ForValues(new List(11) { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }), LocalizedText.op_Implicit("Number of masks to heal when binding.")); _MultibinderHealMasks_subscriber = delegate(int value) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown InvokeValueChanged(new CustomMenuValueChangedEvent("MultibinderHealMasks", (object)value)); }; MultibinderHealMasks = (SelectableValueElement)(object)new ChoiceElement(LocalizedText.op_Implicit("Multibinder Heal Masks"), (IChoiceModel)(object)ChoiceModels.ForValues(new List(11) { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }), LocalizedText.op_Implicit("Number of masks to heal when multi-binding.")); _SilkCost_subscriber = delegate(int value) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown InvokeValueChanged(new CustomMenuValueChangedEvent("SilkCost", (object)value)); }; SilkCost = (SelectableValueElement)(object)new ChoiceElement(LocalizedText.op_Implicit("Silk Cost"), (IChoiceModel)(object)ChoiceModels.ForValues(new List(18) { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 }), LocalizedText.op_Implicit("Number of silk spools required to bind.")); _TimePenalty_subscriber = delegate(float value) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown InvokeValueChanged(new CustomMenuValueChangedEvent("TimePenalty", (object)value)); }; TimePenalty = (SelectableValueElement)(object)new ChoiceElement(LocalizedText.op_Implicit("Time Penalty"), (IChoiceModel)(object)ChoiceModels.ForValues(new List(7) { 0.25f, 0.5f, 0.75f, 1f, 1.5f, 2f, 3f }), LocalizedText.op_Implicit("Multiplier on the time it takes to bind.")); } public void ExportTo(BindSettings data) { data.HealMasks = HealMasks.Value; data.MultibinderHealMasks = MultibinderHealMasks.Value; data.SilkCost = SilkCost.Value; data.TimePenalty = TimePenalty.Value; } public void ApplyFrom(BindSettings data) { using (notifySubscribers.Suppress()) { HealMasks.Value = data.HealMasks; MultibinderHealMasks.Value = data.MultibinderHealMasks; SilkCost.Value = data.SilkCost; TimePenalty.Value = data.TimePenalty; } } [IteratorStateMachine(typeof(d__22))] public IEnumerable Elements() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__22(-2) { <>4__this = this }; } private void InvokeValueChanged(CustomMenuValueChangedEvent args) { if (!notifySubscribers.Suppressed) { this.OnValueChanged?.Invoke(args); } } } [GeneratedCode("ModMenuGenerator", "0.7.1")] public class DeathSettingsMenu : ICustomMenu, ICustomMenu { [CompilerGenerated] private sealed class d__22 : IEnumerable, IEnumerable, IEnumerator, IEnumerator, IDisposable { private int <>1__state; private MenuElement <>2__current; private int <>l__initialThreadId; public DeathSettingsMenu <>4__this; MenuElement IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__22(int <>1__state) { this.<>1__state = <>1__state; <>l__initialThreadId = Environment.CurrentManagedThreadId; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { int num = <>1__state; DeathSettingsMenu deathSettingsMenu = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <>2__current = (MenuElement)(object)deathSettingsMenu.RespawnTimer; <>1__state = 1; return true; case 1: <>1__state = -1; <>2__current = (MenuElement)(object)deathSettingsMenu.SpawnCoccoon; <>1__state = 2; return true; case 2: <>1__state = -1; <>2__current = (MenuElement)(object)deathSettingsMenu.LoseRosaries; <>1__state = 3; return true; case 3: <>1__state = -1; <>2__current = (MenuElement)(object)deathSettingsMenu.LimitSilk; <>1__state = 4; return true; case 4: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } [DebuggerHidden] IEnumerator IEnumerable.GetEnumerator() { d__22 result; if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId) { <>1__state = 0; result = this; } else { result = new d__22(0) { <>4__this = <>4__this }; } return result; } [DebuggerHidden] IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable)this).GetEnumerator(); } } private SelectableValueElement _RespawnTimer; private SelectableValueElement _SpawnCoccoon; private SelectableValueElement _LoseRosaries; private SelectableValueElement _LimitSilk; private readonly EventSuppressor notifySubscribers = new EventSuppressor(); private readonly Action _RespawnTimer_subscriber; private readonly Action _SpawnCoccoon_subscriber; private readonly Action _LoseRosaries_subscriber; private readonly Action _LimitSilk_subscriber; public SelectableValueElement RespawnTimer { get { return _RespawnTimer; } set { if (value == null) { throw new ArgumentNullException("RespawnTimer"); } if (_RespawnTimer != value) { if (_RespawnTimer != null) { _RespawnTimer.OnValueChanged -= _RespawnTimer_subscriber; } _RespawnTimer = value; _RespawnTimer.OnValueChanged += _RespawnTimer_subscriber; } } } public SelectableValueElement SpawnCoccoon { get { return _SpawnCoccoon; } set { if (value == null) { throw new ArgumentNullException("SpawnCoccoon"); } if (_SpawnCoccoon != value) { if (_SpawnCoccoon != null) { _SpawnCoccoon.OnValueChanged -= _SpawnCoccoon_subscriber; } _SpawnCoccoon = value; _SpawnCoccoon.OnValueChanged += _SpawnCoccoon_subscriber; } } } public SelectableValueElement LoseRosaries { get { return _LoseRosaries; } set { if (value == null) { throw new ArgumentNullException("LoseRosaries"); } if (_LoseRosaries != value) { if (_LoseRosaries != null) { _LoseRosaries.OnValueChanged -= _LoseRosaries_subscriber; } _LoseRosaries = value; _LoseRosaries.OnValueChanged += _LoseRosaries_subscriber; } } } public SelectableValueElement LimitSilk { get { return _LimitSilk; } set { if (value == null) { throw new ArgumentNullException("LimitSilk"); } if (_LimitSilk != value) { if (_LimitSilk != null) { _LimitSilk.OnValueChanged -= _LimitSilk_subscriber; } _LimitSilk = value; _LimitSilk.OnValueChanged += _LimitSilk_subscriber; } } } public event Action? OnValueChanged; public DeathSettingsMenu() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown _RespawnTimer_subscriber = delegate(int value) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown InvokeValueChanged(new CustomMenuValueChangedEvent("RespawnTimer", (object)value)); }; RespawnTimer = (SelectableValueElement)(object)new ChoiceElement(LocalizedText.op_Implicit("Respawn Timer"), (IChoiceModel)(object)ChoiceModels.ForValues(new List(10) { 0, 10, 20, 30, 45, 60, 90, 120, 180, 300 }), LocalizedText.op_Implicit("Seconds to wait to respawn after death.")); _SpawnCoccoon_subscriber = delegate(bool value) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown InvokeValueChanged(new CustomMenuValueChangedEvent("SpawnCoccoon", (object)value)); }; SpawnCoccoon = (SelectableValueElement)(object)new ChoiceElement(LocalizedText.op_Implicit("Spawn Coccoon"), (IChoiceModel)(object)ChoiceModels.ForBool(), LocalizedText.op_Implicit("If false, don't spawn coccoons at all.")); _LoseRosaries_subscriber = delegate(bool value) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown InvokeValueChanged(new CustomMenuValueChangedEvent("LoseRosaries", (object)value)); }; LoseRosaries = (SelectableValueElement)(object)new ChoiceElement(LocalizedText.op_Implicit("Lose Rosaries"), (IChoiceModel)(object)ChoiceModels.ForBool(), LocalizedText.op_Implicit("If false, don't lose rosaries on death.")); _LimitSilk_subscriber = delegate(bool value) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown InvokeValueChanged(new CustomMenuValueChangedEvent("LimitSilk", (object)value)); }; LimitSilk = (SelectableValueElement)(object)new ChoiceElement(LocalizedText.op_Implicit("Limit Silk"), (IChoiceModel)(object)ChoiceModels.ForBool(), LocalizedText.op_Implicit("If false, don't restrict silk on death.")); } public void ExportTo(DeathSettings data) { data.RespawnTimer = RespawnTimer.Value; data.SpawnCoccoon = SpawnCoccoon.Value; data.LoseRosaries = LoseRosaries.Value; data.LimitSilk = LimitSilk.Value; } public void ApplyFrom(DeathSettings data) { using (notifySubscribers.Suppress()) { RespawnTimer.Value = data.RespawnTimer; SpawnCoccoon.Value = data.SpawnCoccoon; LoseRosaries.Value = data.LoseRosaries; LimitSilk.Value = data.LimitSilk; } } [IteratorStateMachine(typeof(d__22))] public IEnumerable Elements() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__22(-2) { <>4__this = this }; } private void InvokeValueChanged(CustomMenuValueChangedEvent args) { if (!notifySubscribers.Suppressed) { this.OnValueChanged?.Invoke(args); } } } [GeneratedCode("ModMenuGenerator", "0.7.1")] public class HealingSettingsMenu : ICustomMenu, ICustomMenu { [CompilerGenerated] private sealed class d__22 : IEnumerable, IEnumerable, IEnumerator, IEnumerator, IDisposable { private int <>1__state; private MenuElement <>2__current; private int <>l__initialThreadId; public HealingSettingsMenu <>4__this; MenuElement IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__22(int <>1__state) { this.<>1__state = <>1__state; <>l__initialThreadId = Environment.CurrentManagedThreadId; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { int num = <>1__state; HealingSettingsMenu healingSettingsMenu = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <>2__current = (MenuElement)(object)healingSettingsMenu.BenchHeal; <>1__state = 1; return true; case 1: <>1__state = -1; <>2__current = (MenuElement)(object)healingSettingsMenu.MaskHeal; <>1__state = 2; return true; case 2: <>1__state = -1; <>2__current = (MenuElement)(object)healingSettingsMenu.AbilityHeal; <>1__state = 3; return true; case 3: <>1__state = -1; <>2__current = (MenuElement)(object)healingSettingsMenu.SpaHeal; <>1__state = 4; return true; case 4: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } [DebuggerHidden] IEnumerator IEnumerable.GetEnumerator() { d__22 result; if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId) { <>1__state = 0; result = this; } else { result = new d__22(0) { <>4__this = <>4__this }; } return result; } [DebuggerHidden] IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable)this).GetEnumerator(); } } private SelectableValueElement _BenchHeal; private SelectableValueElement _MaskHeal; private SelectableValueElement _AbilityHeal; private SelectableValueElement _SpaHeal; private readonly EventSuppressor notifySubscribers = new EventSuppressor(); private readonly Action _BenchHeal_subscriber; private readonly Action _MaskHeal_subscriber; private readonly Action _AbilityHeal_subscriber; private readonly Action _SpaHeal_subscriber; public SelectableValueElement BenchHeal { get { return _BenchHeal; } set { if (value == null) { throw new ArgumentNullException("BenchHeal"); } if (_BenchHeal != value) { if (_BenchHeal != null) { _BenchHeal.OnValueChanged -= _BenchHeal_subscriber; } _BenchHeal = value; _BenchHeal.OnValueChanged += _BenchHeal_subscriber; } } } public SelectableValueElement MaskHeal { get { return _MaskHeal; } set { if (value == null) { throw new ArgumentNullException("MaskHeal"); } if (_MaskHeal != value) { if (_MaskHeal != null) { _MaskHeal.OnValueChanged -= _MaskHeal_subscriber; } _MaskHeal = value; _MaskHeal.OnValueChanged += _MaskHeal_subscriber; } } } public SelectableValueElement AbilityHeal { get { return _AbilityHeal; } set { if (value == null) { throw new ArgumentNullException("AbilityHeal"); } if (_AbilityHeal != value) { if (_AbilityHeal != null) { _AbilityHeal.OnValueChanged -= _AbilityHeal_subscriber; } _AbilityHeal = value; _AbilityHeal.OnValueChanged += _AbilityHeal_subscriber; } } } public SelectableValueElement SpaHeal { get { return _SpaHeal; } set { if (value == null) { throw new ArgumentNullException("SpaHeal"); } if (_SpaHeal != value) { if (_SpaHeal != null) { _SpaHeal.OnValueChanged -= _SpaHeal_subscriber; } _SpaHeal = value; _SpaHeal.OnValueChanged += _SpaHeal_subscriber; } } } public event Action? OnValueChanged; public HealingSettingsMenu() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown _BenchHeal_subscriber = delegate(bool value) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown InvokeValueChanged(new CustomMenuValueChangedEvent("BenchHeal", (object)value)); }; BenchHeal = (SelectableValueElement)(object)new ChoiceElement(LocalizedText.op_Implicit("Bench Heal"), (IChoiceModel)(object)ChoiceModels.ForBool(), LocalizedText.op_Implicit("Heal when sitting at a bench.")); _MaskHeal_subscriber = delegate(MaskHealType value) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown InvokeValueChanged(new CustomMenuValueChangedEvent("MaskHeal", (object)value)); }; MaskHeal = (SelectableValueElement)(object)new ChoiceElement(LocalizedText.op_Implicit("Mask Heal"), (IChoiceModel)(object)ChoiceModels.ForEnum(), LocalizedText.op_Implicit("Heal when completing a new mask.")); _AbilityHeal_subscriber = delegate(bool value) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown InvokeValueChanged(new CustomMenuValueChangedEvent("AbilityHeal", (object)value)); }; AbilityHeal = (SelectableValueElement)(object)new ChoiceElement(LocalizedText.op_Implicit("Ability Heal"), (IChoiceModel)(object)ChoiceModels.ForBool(), LocalizedText.op_Implicit("Heal when obtaining a new ability or silk heart.")); _SpaHeal_subscriber = delegate(bool value) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown InvokeValueChanged(new CustomMenuValueChangedEvent("SpaHeal", (object)value)); }; SpaHeal = (SelectableValueElement)(object)new ChoiceElement(LocalizedText.op_Implicit("Spa Heal"), (IChoiceModel)(object)ChoiceModels.ForBool(), LocalizedText.op_Implicit("Heal when bathing at a spa.")); } public void ExportTo(HealingSettings data) { data.BenchHeal = BenchHeal.Value; data.MaskHeal = MaskHeal.Value; data.AbilityHeal = AbilityHeal.Value; data.SpaHeal = SpaHeal.Value; } public void ApplyFrom(HealingSettings data) { using (notifySubscribers.Suppress()) { BenchHeal.Value = data.BenchHeal; MaskHeal.Value = data.MaskHeal; AbilityHeal.Value = data.AbilityHeal; SpaHeal.Value = data.SpaHeal; } } [IteratorStateMachine(typeof(d__22))] public IEnumerable Elements() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__22(-2) { <>4__this = this }; } private void InvokeValueChanged(CustomMenuValueChangedEvent args) { if (!notifySubscribers.Suppressed) { this.OnValueChanged?.Invoke(args); } } } [GeneratedCode("ModMenuGenerator", "0.7.1")] public class IntelligenceSettingsMenu : ICustomMenu, ICustomMenu { [CompilerGenerated] private sealed class d__46 : IEnumerable, IEnumerable, IEnumerator, IEnumerator, IDisposable { private int <>1__state; private MenuElement <>2__current; private int <>l__initialThreadId; public IntelligenceSettingsMenu <>4__this; MenuElement IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__46(int <>1__state) { this.<>1__state = <>1__state; <>l__initialThreadId = Environment.CurrentManagedThreadId; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { int num = <>1__state; IntelligenceSettingsMenu intelligenceSettingsMenu = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <>2__current = (MenuElement)(object)intelligenceSettingsMenu.BossKills; <>1__state = 1; return true; case 1: <>1__state = -1; <>2__current = (MenuElement)(object)intelligenceSettingsMenu.ShopPurchases; <>1__state = 2; return true; case 2: <>1__state = -1; <>2__current = (MenuElement)(object)intelligenceSettingsMenu.TollPurchases; <>1__state = 3; return true; case 3: <>1__state = -1; <>2__current = (MenuElement)(object)intelligenceSettingsMenu.SimpleKeyUsages; <>1__state = 4; return true; case 4: <>1__state = -1; <>2__current = (MenuElement)(object)intelligenceSettingsMenu.LeverHits; <>1__state = 5; return true; case 5: <>1__state = -1; <>2__current = (MenuElement)(object)intelligenceSettingsMenu.BellShrines; <>1__state = 6; return true; case 6: <>1__state = -1; <>2__current = (MenuElement)(object)intelligenceSettingsMenu.FleaRescues; <>1__state = 7; return true; case 7: <>1__state = -1; <>2__current = (MenuElement)(object)intelligenceSettingsMenu.CaravanRides; <>1__state = 8; return true; case 8: <>1__state = -1; <>2__current = (MenuElement)(object)intelligenceSettingsMenu.BellwayRides; <>1__state = 9; return true; case 9: <>1__state = -1; <>2__current = (MenuElement)(object)intelligenceSettingsMenu.VentricaRides; <>1__state = 10; return true; case 10: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } [DebuggerHidden] IEnumerator IEnumerable.GetEnumerator() { d__46 result; if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId) { <>1__state = 0; result = this; } else { result = new d__46(0) { <>4__this = <>4__this }; } return result; } [DebuggerHidden] IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable)this).GetEnumerator(); } } private SelectableValueElement _BossKills; private SelectableValueElement _ShopPurchases; private SelectableValueElement _TollPurchases; private SelectableValueElement _SimpleKeyUsages; private SelectableValueElement _LeverHits; private SelectableValueElement _BellShrines; private SelectableValueElement _FleaRescues; private SelectableValueElement _CaravanRides; private SelectableValueElement _BellwayRides; private SelectableValueElement _VentricaRides; private readonly EventSuppressor notifySubscribers = new EventSuppressor(); private readonly Action _BossKills_subscriber; private readonly Action _ShopPurchases_subscriber; private readonly Action _TollPurchases_subscriber; private readonly Action _SimpleKeyUsages_subscriber; private readonly Action _LeverHits_subscriber; private readonly Action _BellShrines_subscriber; private readonly Action _FleaRescues_subscriber; private readonly Action _CaravanRides_subscriber; private readonly Action _BellwayRides_subscriber; private readonly Action _VentricaRides_subscriber; public SelectableValueElement BossKills { get { return _BossKills; } set { if (value == null) { throw new ArgumentNullException("BossKills"); } if (_BossKills != value) { if (_BossKills != null) { _BossKills.OnValueChanged -= _BossKills_subscriber; } _BossKills = value; _BossKills.OnValueChanged += _BossKills_subscriber; } } } public SelectableValueElement ShopPurchases { get { return _ShopPurchases; } set { if (value == null) { throw new ArgumentNullException("ShopPurchases"); } if (_ShopPurchases != value) { if (_ShopPurchases != null) { _ShopPurchases.OnValueChanged -= _ShopPurchases_subscriber; } _ShopPurchases = value; _ShopPurchases.OnValueChanged += _ShopPurchases_subscriber; } } } public SelectableValueElement TollPurchases { get { return _TollPurchases; } set { if (value == null) { throw new ArgumentNullException("TollPurchases"); } if (_TollPurchases != value) { if (_TollPurchases != null) { _TollPurchases.OnValueChanged -= _TollPurchases_subscriber; } _TollPurchases = value; _TollPurchases.OnValueChanged += _TollPurchases_subscriber; } } } public SelectableValueElement SimpleKeyUsages { get { return _SimpleKeyUsages; } set { if (value == null) { throw new ArgumentNullException("SimpleKeyUsages"); } if (_SimpleKeyUsages != value) { if (_SimpleKeyUsages != null) { _SimpleKeyUsages.OnValueChanged -= _SimpleKeyUsages_subscriber; } _SimpleKeyUsages = value; _SimpleKeyUsages.OnValueChanged += _SimpleKeyUsages_subscriber; } } } public SelectableValueElement LeverHits { get { return _LeverHits; } set { if (value == null) { throw new ArgumentNullException("LeverHits"); } if (_LeverHits != value) { if (_LeverHits != null) { _LeverHits.OnValueChanged -= _LeverHits_subscriber; } _LeverHits = value; _LeverHits.OnValueChanged += _LeverHits_subscriber; } } } public SelectableValueElement BellShrines { get { return _BellShrines; } set { if (value == null) { throw new ArgumentNullException("BellShrines"); } if (_BellShrines != value) { if (_BellShrines != null) { _BellShrines.OnValueChanged -= _BellShrines_subscriber; } _BellShrines = value; _BellShrines.OnValueChanged += _BellShrines_subscriber; } } } public SelectableValueElement FleaRescues { get { return _FleaRescues; } set { if (value == null) { throw new ArgumentNullException("FleaRescues"); } if (_FleaRescues != value) { if (_FleaRescues != null) { _FleaRescues.OnValueChanged -= _FleaRescues_subscriber; } _FleaRescues = value; _FleaRescues.OnValueChanged += _FleaRescues_subscriber; } } } public SelectableValueElement CaravanRides { get { return _CaravanRides; } set { if (value == null) { throw new ArgumentNullException("CaravanRides"); } if (_CaravanRides != value) { if (_CaravanRides != null) { _CaravanRides.OnValueChanged -= _CaravanRides_subscriber; } _CaravanRides = value; _CaravanRides.OnValueChanged += _CaravanRides_subscriber; } } } public SelectableValueElement BellwayRides { get { return _BellwayRides; } set { if (value == null) { throw new ArgumentNullException("BellwayRides"); } if (_BellwayRides != value) { if (_BellwayRides != null) { _BellwayRides.OnValueChanged -= _BellwayRides_subscriber; } _BellwayRides = value; _BellwayRides.OnValueChanged += _BellwayRides_subscriber; } } } public SelectableValueElement VentricaRides { get { return _VentricaRides; } set { if (value == null) { throw new ArgumentNullException("VentricaRides"); } if (_VentricaRides != value) { if (_VentricaRides != null) { _VentricaRides.OnValueChanged -= _VentricaRides_subscriber; } _VentricaRides = value; _VentricaRides.OnValueChanged += _VentricaRides_subscriber; } } } public event Action? OnValueChanged; public IntelligenceSettingsMenu() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown _BossKills_subscriber = delegate(NotificationSetting value) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown InvokeValueChanged(new CustomMenuValueChangedEvent("BossKills", (object)value)); }; BossKills = (SelectableValueElement)(object)new ChoiceElement(LocalizedText.op_Implicit("Boss Kills"), (IChoiceModel)(object)ChoiceModels.ForEnum(), LocalizedText.op_Implicit("")); _ShopPurchases_subscriber = delegate(NotificationSetting value) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown InvokeValueChanged(new CustomMenuValueChangedEvent("ShopPurchases", (object)value)); }; ShopPurchases = (SelectableValueElement)(object)new ChoiceElement(LocalizedText.op_Implicit("Shop Purchases"), (IChoiceModel)(object)ChoiceModels.ForEnum(), LocalizedText.op_Implicit("")); _TollPurchases_subscriber = delegate(NotificationSetting value) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown InvokeValueChanged(new CustomMenuValueChangedEvent("TollPurchases", (object)value)); }; TollPurchases = (SelectableValueElement)(object)new ChoiceElement(LocalizedText.op_Implicit("Toll Purchases"), (IChoiceModel)(object)ChoiceModels.ForEnum(), LocalizedText.op_Implicit("")); _SimpleKeyUsages_subscriber = delegate(NotificationSetting value) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown InvokeValueChanged(new CustomMenuValueChangedEvent("SimpleKeyUsages", (object)value)); }; SimpleKeyUsages = (SelectableValueElement)(object)new ChoiceElement(LocalizedText.op_Implicit("Simple Key Usages"), (IChoiceModel)(object)ChoiceModels.ForEnum(), LocalizedText.op_Implicit("")); _LeverHits_subscriber = delegate(NotificationSetting value) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown InvokeValueChanged(new CustomMenuValueChangedEvent("LeverHits", (object)value)); }; LeverHits = (SelectableValueElement)(object)new ChoiceElement(LocalizedText.op_Implicit("Lever Hits"), (IChoiceModel)(object)ChoiceModels.ForEnum(), LocalizedText.op_Implicit("")); _BellShrines_subscriber = delegate(NotificationSetting value) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown InvokeValueChanged(new CustomMenuValueChangedEvent("BellShrines", (object)value)); }; BellShrines = (SelectableValueElement)(object)new ChoiceElement(LocalizedText.op_Implicit("Bell Shrines"), (IChoiceModel)(object)ChoiceModels.ForEnum(), LocalizedText.op_Implicit("")); _FleaRescues_subscriber = delegate(NotificationSetting value) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown InvokeValueChanged(new CustomMenuValueChangedEvent("FleaRescues", (object)value)); }; FleaRescues = (SelectableValueElement)(object)new ChoiceElement(LocalizedText.op_Implicit("Flea Rescues"), (IChoiceModel)(object)ChoiceModels.ForEnum(), LocalizedText.op_Implicit("")); _CaravanRides_subscriber = delegate(NotificationSetting value) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown InvokeValueChanged(new CustomMenuValueChangedEvent("CaravanRides", (object)value)); }; CaravanRides = (SelectableValueElement)(object)new ChoiceElement(LocalizedText.op_Implicit("Caravan Rides"), (IChoiceModel)(object)ChoiceModels.ForEnum(), LocalizedText.op_Implicit("")); _BellwayRides_subscriber = delegate(TravelNotificationSetting value) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown InvokeValueChanged(new CustomMenuValueChangedEvent("BellwayRides", (object)value)); }; BellwayRides = (SelectableValueElement)(object)new ChoiceElement(LocalizedText.op_Implicit("Bellway Rides"), (IChoiceModel)(object)ChoiceModels.ForEnum(), LocalizedText.op_Implicit("")); _VentricaRides_subscriber = delegate(TravelNotificationSetting value) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown InvokeValueChanged(new CustomMenuValueChangedEvent("VentricaRides", (object)value)); }; VentricaRides = (SelectableValueElement)(object)new ChoiceElement(LocalizedText.op_Implicit("Ventrica Rides"), (IChoiceModel)(object)ChoiceModels.ForEnum(), LocalizedText.op_Implicit("")); } public void ExportTo(IntelligenceSettings data) { data.BossKills = BossKills.Value; data.ShopPurchases = ShopPurchases.Value; data.TollPurchases = TollPurchases.Value; data.SimpleKeyUsages = SimpleKeyUsages.Value; data.LeverHits = LeverHits.Value; data.BellShrines = BellShrines.Value; data.FleaRescues = FleaRescues.Value; data.CaravanRides = CaravanRides.Value; data.BellwayRides = BellwayRides.Value; data.VentricaRides = VentricaRides.Value; } public void ApplyFrom(IntelligenceSettings data) { using (notifySubscribers.Suppress()) { BossKills.Value = data.BossKills; ShopPurchases.Value = data.ShopPurchases; TollPurchases.Value = data.TollPurchases; SimpleKeyUsages.Value = data.SimpleKeyUsages; LeverHits.Value = data.LeverHits; BellShrines.Value = data.BellShrines; FleaRescues.Value = data.FleaRescues; CaravanRides.Value = data.CaravanRides; BellwayRides.Value = data.BellwayRides; VentricaRides.Value = data.VentricaRides; } } [IteratorStateMachine(typeof(d__46))] public IEnumerable Elements() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__46(-2) { <>4__this = this }; } private void InvokeValueChanged(CustomMenuValueChangedEvent args) { if (!notifySubscribers.Suppressed) { this.OnValueChanged?.Invoke(args); } } } [GeneratedCode("ModMenuGenerator", "0.7.1")] public class SilkRegenerationSettingsMenu : ICustomMenu, ICustomMenu { [CompilerGenerated] private sealed class d__22 : IEnumerable, IEnumerable, IEnumerator, IEnumerator, IDisposable { private int <>1__state; private MenuElement <>2__current; private int <>l__initialThreadId; public SilkRegenerationSettingsMenu <>4__this; MenuElement IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__22(int <>1__state) { this.<>1__state = <>1__state; <>l__initialThreadId = Environment.CurrentManagedThreadId; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { int num = <>1__state; SilkRegenerationSettingsMenu silkRegenerationSettingsMenu = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <>2__current = (MenuElement)(object)silkRegenerationSettingsMenu.Silkhearts; <>1__state = 1; return true; case 1: <>1__state = -1; <>2__current = (MenuElement)(object)silkRegenerationSettingsMenu.FirstSilkRegenTime; <>1__state = 2; return true; case 2: <>1__state = -1; <>2__current = (MenuElement)(object)silkRegenerationSettingsMenu.SilkRegenTime; <>1__state = 3; return true; case 3: <>1__state = -1; <>2__current = (MenuElement)(object)silkRegenerationSettingsMenu.CanFarmSilk; <>1__state = 4; return true; case 4: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } [DebuggerHidden] IEnumerator IEnumerable.GetEnumerator() { d__22 result; if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId) { <>1__state = 0; result = this; } else { result = new d__22(0) { <>4__this = <>4__this }; } return result; } [DebuggerHidden] IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable)this).GetEnumerator(); } } private SelectableValueElement _Silkhearts; private SelectableValueElement _FirstSilkRegenTime; private SelectableValueElement _SilkRegenTime; private SelectableValueElement _CanFarmSilk; private readonly EventSuppressor notifySubscribers = new EventSuppressor(); private readonly Action _Silkhearts_subscriber; private readonly Action _FirstSilkRegenTime_subscriber; private readonly Action _SilkRegenTime_subscriber; private readonly Action _CanFarmSilk_subscriber; public SelectableValueElement Silkhearts { get { return _Silkhearts; } set { if (value == null) { throw new ArgumentNullException("Silkhearts"); } if (_Silkhearts != value) { if (_Silkhearts != null) { _Silkhearts.OnValueChanged -= _Silkhearts_subscriber; } _Silkhearts = value; _Silkhearts.OnValueChanged += _Silkhearts_subscriber; } } } public SelectableValueElement FirstSilkRegenTime { get { return _FirstSilkRegenTime; } set { if (value == null) { throw new ArgumentNullException("FirstSilkRegenTime"); } if (_FirstSilkRegenTime != value) { if (_FirstSilkRegenTime != null) { _FirstSilkRegenTime.OnValueChanged -= _FirstSilkRegenTime_subscriber; } _FirstSilkRegenTime = value; _FirstSilkRegenTime.OnValueChanged += _FirstSilkRegenTime_subscriber; } } } public SelectableValueElement SilkRegenTime { get { return _SilkRegenTime; } set { if (value == null) { throw new ArgumentNullException("SilkRegenTime"); } if (_SilkRegenTime != value) { if (_SilkRegenTime != null) { _SilkRegenTime.OnValueChanged -= _SilkRegenTime_subscriber; } _SilkRegenTime = value; _SilkRegenTime.OnValueChanged += _SilkRegenTime_subscriber; } } } public SelectableValueElement CanFarmSilk { get { return _CanFarmSilk; } set { if (value == null) { throw new ArgumentNullException("CanFarmSilk"); } if (_CanFarmSilk != value) { if (_CanFarmSilk != null) { _CanFarmSilk.OnValueChanged -= _CanFarmSilk_subscriber; } _CanFarmSilk = value; _CanFarmSilk.OnValueChanged += _CanFarmSilk_subscriber; } } } public event Action? OnValueChanged; public SilkRegenerationSettingsMenu() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown _Silkhearts_subscriber = delegate(int value) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown InvokeValueChanged(new CustomMenuValueChangedEvent("Silkhearts", (object)value)); }; Silkhearts = (SelectableValueElement)(object)new TextInput(LocalizedText.op_Implicit("Silkhearts"), (ITextModel)(object)TextModels.ForIntegers(), LocalizedText.op_Implicit("")); _FirstSilkRegenTime_subscriber = delegate(float value) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown InvokeValueChanged(new CustomMenuValueChangedEvent("FirstSilkRegenTime", (object)value)); }; FirstSilkRegenTime = (SelectableValueElement)(object)new TextInput(LocalizedText.op_Implicit("First Silk Regen Time"), (ITextModel)(object)TextModels.ForFloats(), LocalizedText.op_Implicit("Time to regenerate the first silk spool (default 1.45)")); _SilkRegenTime_subscriber = delegate(float value) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown InvokeValueChanged(new CustomMenuValueChangedEvent("SilkRegenTime", (object)value)); }; SilkRegenTime = (SelectableValueElement)(object)new TextInput(LocalizedText.op_Implicit("Silk Regen Time"), (ITextModel)(object)TextModels.ForFloats(), LocalizedText.op_Implicit("Time to regenerate all spools but the first (default 3.9)")); _CanFarmSilk_subscriber = delegate(bool value) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown InvokeValueChanged(new CustomMenuValueChangedEvent("CanFarmSilk", (object)value)); }; CanFarmSilk = (SelectableValueElement)(object)new ChoiceElement(LocalizedText.op_Implicit("Can Farm Silk"), (IChoiceModel)(object)ChoiceModels.ForBool(), LocalizedText.op_Implicit("Whether silk can be obtained outside of regen")); } public void ExportTo(SilkRegenerationSettings data) { data.Silkhearts = Silkhearts.Value; data.FirstSilkRegenTime = FirstSilkRegenTime.Value; data.SilkRegenTime = SilkRegenTime.Value; data.CanFarmSilk = CanFarmSilk.Value; } public void ApplyFrom(SilkRegenerationSettings data) { using (notifySubscribers.Suppress()) { Silkhearts.Value = data.Silkhearts; FirstSilkRegenTime.Value = data.FirstSilkRegenTime; SilkRegenTime.Value = data.SilkRegenTime; CanFarmSilk.Value = data.CanFarmSilk; } } [IteratorStateMachine(typeof(d__22))] public IEnumerable Elements() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__22(-2) { <>4__this = this }; } private void InvokeValueChanged(CustomMenuValueChangedEvent args) { if (!notifySubscribers.Suppressed) { this.OnValueChanged?.Invoke(args); } } } [GeneratedCode("ModMenuGenerator", "0.7.1")] public class SpawnPointSettingsMenu : ICustomMenu, ICustomMenu { [CompilerGenerated] private sealed class d__10 : IEnumerable, IEnumerable, IEnumerator, IEnumerator, IDisposable { private int <>1__state; private MenuElement <>2__current; private int <>l__initialThreadId; public SpawnPointSettingsMenu <>4__this; MenuElement IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__10(int <>1__state) { this.<>1__state = <>1__state; <>l__initialThreadId = Environment.CurrentManagedThreadId; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { int num = <>1__state; SpawnPointSettingsMenu spawnPointSettingsMenu = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <>2__current = (MenuElement)(object)spawnPointSettingsMenu.SpawnPoint; <>1__state = 1; return true; case 1: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } [DebuggerHidden] IEnumerator IEnumerable.GetEnumerator() { d__10 result; if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId) { <>1__state = 0; result = this; } else { result = new d__10(0) { <>4__this = <>4__this }; } return result; } [DebuggerHidden] IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable)this).GetEnumerator(); } } private SelectableValueElement _SpawnPoint; private readonly EventSuppressor notifySubscribers = new EventSuppressor(); private readonly Action _SpawnPoint_subscriber; public SelectableValueElement SpawnPoint { get { return _SpawnPoint; } set { if (value == null) { throw new ArgumentNullException("SpawnPoint"); } if (_SpawnPoint != value) { if (_SpawnPoint != null) { _SpawnPoint.OnValueChanged -= _SpawnPoint_subscriber; } _SpawnPoint = value; _SpawnPoint.OnValueChanged += _SpawnPoint_subscriber; } } } public event Action? OnValueChanged; public SpawnPointSettingsMenu() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown _SpawnPoint_subscriber = delegate(SpawnPoint value) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown InvokeValueChanged(new CustomMenuValueChangedEvent("SpawnPoint", (object)value)); }; SpawnPoint = (SelectableValueElement)(object)new ChoiceElement(LocalizedText.op_Implicit("Spawn Point"), (IChoiceModel)(object)ChoiceModels.ForEnum(), LocalizedText.op_Implicit("Forced respawn point on death.")); } public void ExportTo(SpawnPointSettings data) { data.SpawnPoint = SpawnPoint.Value; } public void ApplyFrom(SpawnPointSettings data) { using (notifySubscribers.Suppress()) { SpawnPoint.Value = data.SpawnPoint; } } [IteratorStateMachine(typeof(d__10))] public IEnumerable Elements() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__10(-2) { <>4__this = this }; } private void InvokeValueChanged(CustomMenuValueChangedEvent args) { if (!notifySubscribers.Suppressed) { this.OnValueChanged?.Invoke(args); } } } [GeneratedCode("ModMenuGenerator", "0.7.1")] public class StatsSettingsMenu : ICustomMenu, ICustomMenu { [CompilerGenerated] private sealed class d__14 : IEnumerable, IEnumerable, IEnumerator, IEnumerator, IDisposable { private int <>1__state; private MenuElement <>2__current; private int <>l__initialThreadId; public StatsSettingsMenu <>4__this; MenuElement IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__14(int <>1__state) { this.<>1__state = <>1__state; <>l__initialThreadId = Environment.CurrentManagedThreadId; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { int num = <>1__state; StatsSettingsMenu statsSettingsMenu = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <>2__current = (MenuElement)(object)statsSettingsMenu.StartingMasks; <>1__state = 1; return true; case 1: <>1__state = -1; <>2__current = (MenuElement)(object)statsSettingsMenu.StartingSilkSpools; <>1__state = 2; return true; case 2: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } [DebuggerHidden] IEnumerator IEnumerable.GetEnumerator() { d__14 result; if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId) { <>1__state = 0; result = this; } else { result = new d__14(0) { <>4__this = <>4__this }; } return result; } [DebuggerHidden] IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable)this).GetEnumerator(); } } private SelectableValueElement _StartingMasks; private SelectableValueElement _StartingSilkSpools; private readonly EventSuppressor notifySubscribers = new EventSuppressor(); private readonly Action _StartingMasks_subscriber; private readonly Action _StartingSilkSpools_subscriber; public SelectableValueElement StartingMasks { get { return _StartingMasks; } set { if (value == null) { throw new ArgumentNullException("StartingMasks"); } if (_StartingMasks != value) { if (_StartingMasks != null) { _StartingMasks.OnValueChanged -= _StartingMasks_subscriber; } _StartingMasks = value; _StartingMasks.OnValueChanged += _StartingMasks_subscriber; } } } public SelectableValueElement StartingSilkSpools { get { return _StartingSilkSpools; } set { if (value == null) { throw new ArgumentNullException("StartingSilkSpools"); } if (_StartingSilkSpools != value) { if (_StartingSilkSpools != null) { _StartingSilkSpools.OnValueChanged -= _StartingSilkSpools_subscriber; } _StartingSilkSpools = value; _StartingSilkSpools.OnValueChanged += _StartingSilkSpools_subscriber; } } } public event Action? OnValueChanged; public StatsSettingsMenu() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown _StartingMasks_subscriber = delegate(int value) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown InvokeValueChanged(new CustomMenuValueChangedEvent("StartingMasks", (object)value)); }; StartingMasks = (SelectableValueElement)(object)new ChoiceElement(LocalizedText.op_Implicit("Starting Masks"), (IChoiceModel)(object)ChoiceModels.ForValues(new List(10) { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }), LocalizedText.op_Implicit("Number of masks players start with.")); _StartingSilkSpools_subscriber = delegate(int value) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown InvokeValueChanged(new CustomMenuValueChangedEvent("StartingSilkSpools", (object)value)); }; StartingSilkSpools = (SelectableValueElement)(object)new ChoiceElement(LocalizedText.op_Implicit("Starting Silk Spools"), (IChoiceModel)(object)ChoiceModels.ForValues(new List(18) { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 }), LocalizedText.op_Implicit("Number of silk spools players start with.")); } public void ExportTo(StatsSettings data) { data.StartingMasks = StartingMasks.Value; data.StartingSilkSpools = StartingSilkSpools.Value; } public void ApplyFrom(StatsSettings data) { using (notifySubscribers.Suppress()) { StartingMasks.Value = data.StartingMasks; StartingSilkSpools.Value = data.StartingSilkSpools; } } [IteratorStateMachine(typeof(d__14))] public IEnumerable Elements() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__14(-2) { <>4__this = this }; } private void InvokeValueChanged(CustomMenuValueChangedEvent args) { if (!notifySubscribers.Suppressed) { this.OnValueChanged?.Invoke(args); } } } } namespace Silksong.TheHuntIsOn.Modules.PauseTimerModule { internal class Countdown : NetworkedCloneable { public const int MAX_MESSAGE_LENGTH = 255; public long FinishTimeTicks; public long? FrozenRemainder; public long? UnfreezeTimeTicks; public string Message = ""; public override void ReadData(IPacket packet) { FinishTimeTicks.ReadData(packet); FrozenRemainder.ReadData(packet); UnfreezeTimeTicks.ReadData(packet); Message = packet.ReadString(); } public override void WriteData(IPacket packet) { FinishTimeTicks.WriteData(packet); FrozenRemainder.WriteData(packet); UnfreezeTimeTicks.WriteData(packet); Message.WriteData(packet); } public bool IsFrozen(DateTime now) { if (FrozenRemainder.HasValue) { if (UnfreezeTimeTicks.HasValue) { return UnfreezeTimeTicks.Value > now.Ticks; } return true; } return false; } public bool IsCompleted(DateTime now) { if (!IsFrozen(now)) { return now.Ticks >= FinishTimeTicks; } return false; } public bool GetDisplayTime(out float seconds) { DateTime utcNow = DateTime.UtcNow; if (IsFrozen(utcNow) || !IsCompleted(utcNow)) { TimeSpan timeSpan = new TimeSpan(IsFrozen(utcNow) ? FrozenRemainder.Value : (FinishTimeTicks - utcNow.Ticks)); seconds = (float)timeSpan.TotalSeconds; return true; } seconds = 0f; return false; } public Countdown Pause(DateTime now) { if (IsCompleted(now)) { return this; } if (IsFrozen(now)) { return With(delegate(Countdown c) { c.UnfreezeTimeTicks = null; }); } return With(delegate(Countdown c) { c.FrozenRemainder = FinishTimeTicks - now.Ticks; c.UnfreezeTimeTicks = null; }); } public Countdown UnpauseAt(DateTime now, DateTime unpauseWhen) { if (IsCompleted(now)) { return this; } if (IsFrozen(now)) { return With(delegate(Countdown c) { c.FinishTimeTicks = unpauseWhen.Ticks + FrozenRemainder.Value; c.UnfreezeTimeTicks = unpauseWhen.Ticks; }); } long remainder = FinishTimeTicks - now.Ticks; return With(delegate(Countdown c) { c.FinishTimeTicks = unpauseWhen.Ticks + remainder; c.FrozenRemainder = remainder; c.UnfreezeTimeTicks = unpauseWhen.Ticks; }); } } internal class PauseTimerCommand : IServerCommand, ICommand { private readonly HuntServerAddon serverAddon; private readonly ServerPauseState state = new ServerPauseState(); private static readonly SubcommandRegister subcommands = new SubcommandRegister("/pt", new <>z__ReadOnlyArray>(new Subcommand[4] { new PauseSubcommand(), new UnpauseSubcommand(), new CountdownSubcommand(), new ClearCountdownsSubcommand() })); public string Trigger => "/pausetimer"; public string[] Aliases => new string[1] { "/pt" }; public bool AuthorizedOnly => true; internal bool ServerPaused => state.ServerPaused; public PauseTimerCommand(HuntServerAddon serverAddon, HuntCommand huntCommand) { HuntServerAddon serverAddon2 = serverAddon; base..ctor(); PauseTimerCommand pauseTimerCommand = this; this.serverAddon = serverAddon2; serverAddon2.OnUpdatePlayer += delegate(IServerPlayer player) { serverAddon2.SendToPlayer(player, pauseTimerCommand.state); }; huntCommand.OnGameReset += delegate { pauseTimerCommand.state.Clear(); serverAddon2.Broadcast(pauseTimerCommand.state); }; } internal void BroadcastMessage(string message) { serverAddon.BroadcastMessage(message); } internal void Broadcast(T packet) where T : IIdentifiedPacket, new() { serverAddon.Broadcast(packet); } internal bool IsServerPaused(out float? remaining) { return state.IsServerPaused(out remaining); } private void UpdateCountdowns(DateTime now, Func map) { state.Countdowns = state.Countdowns.Select(map).ToList(); state.UpdateCountdowns(now); Broadcast(state); } internal void UpdatePauseState(bool paused, long unpauseTimeTicks) { state.ServerPaused = paused; state.UnpauseTimeTicks = unpauseTimeTicks; Broadcast(state); } internal bool AddCountdown(DateTime now, Countdown countdown) { state.UpdateCountdowns(now); if (state.Countdowns.Count >= 10) { return false; } state.Countdowns.Add(countdown); Broadcast(state); return true; } internal void ClearCountdowns() { state.Countdowns.Clear(); Broadcast(state); } internal void PauseCountdowns(DateTime now) { UpdateCountdowns(now, (Countdown c) => c.Pause(now)); } internal void UnpauseCountdowns(DateTime now, DateTime unpauseWhen) { UpdateCountdowns(now, (Countdown c) => c.UnpauseAt(now, unpauseWhen)); } public void Execute(ICommandSender commandSender, string[] arguments) { subcommands.Execute(this, commandSender, arguments); } } internal class PauseSubcommand : Subcommand { public override string Name => "pause"; public override string Usage => "'/pt pause [X]': Pause the game for all players. If X is specified, unpause after X seconds."; public override bool Execute(PauseTimerCommand parent, ICommandSender commandSender, string[] arguments) { if (!Subcommand.MaxArguments(commandSender, arguments, 1)) { return false; } bool paused = true; long unpauseTimeTicks = long.MaxValue; DateTime utcNow = DateTime.UtcNow; int value = 0; if (arguments.Length == 1) { if (!Subcommand.ParseInt(commandSender, arguments[0], out value)) { return false; } DateTime unpauseWhen = utcNow.AddSeconds(value); unpauseTimeTicks = unpauseWhen.Ticks; parent.PauseCountdowns(utcNow); parent.UnpauseCountdowns(utcNow, unpauseWhen); } else { parent.PauseCountdowns(utcNow); } parent.UpdatePauseState(paused, unpauseTimeTicks); commandSender.SendMessage((value == 0) ? "Paused server." : $"Paused server for {value} seconds."); parent.BroadcastMessage((value == 0) ? "Server paused." : $"Server paused for {value} seconds."); return true; } } internal class UnpauseSubcommand : Subcommand { public override string Name => "unpause"; public override string Usage => "'/pt unpause [X]': Unpause the game for all players. If X is specified, unpause after X seconds."; public override bool Execute(PauseTimerCommand parent, ICommandSender commandSender, string[] arguments) { if (!Subcommand.MaxArguments(commandSender, arguments, 1)) { return false; } if (!parent.ServerPaused) { commandSender.SendMessage("Server is already unpaused."); return true; } DateTime utcNow = DateTime.UtcNow; int value = 0; bool paused; long unpauseTimeTicks; if (arguments.Length == 1) { if (!Subcommand.ParseInt(commandSender, arguments[0], out value)) { return false; } DateTime unpauseWhen = utcNow.AddSeconds(value); paused = true; unpauseTimeTicks = unpauseWhen.Ticks; parent.UnpauseCountdowns(utcNow, unpauseWhen); } else { paused = false; unpauseTimeTicks = 0L; parent.UnpauseCountdowns(utcNow, utcNow); } parent.UpdatePauseState(paused, unpauseTimeTicks); commandSender.SendMessage((value == 0) ? "Unpaused server." : $"Scheduled unpause in {value} seconds."); parent.BroadcastMessage((value == 0) ? "Server unpaused." : $"Server unpausing in {value} seconds."); return true; } } internal class CountdownSubcommand : Subcommand { public override string Name => "countdown"; public override string Usage => "'/pt countdown X [msg...]': Start a countdown for all players on the server lasting X seconds, with an optional message attached."; public override bool Execute(PauseTimerCommand parent, ICommandSender commandSender, string[] arguments) { if (!Subcommand.MinArguments(commandSender, arguments, 1)) { return false; } if (!Subcommand.ParseInt(commandSender, arguments[0], out var value)) { return false; } DateTime utcNow = DateTime.UtcNow; Countdown countdown = new Countdown { FinishTimeTicks = utcNow.AddSeconds(value).Ticks }; if (parent.IsServerPaused(out var remaining)) { countdown = ((!remaining.HasValue) ? countdown.Pause(utcNow) : countdown.UnpauseAt(utcNow, utcNow.AddSeconds(remaining.Value))); } if (arguments.Length > 1) { countdown.Message = string.Join(" ", arguments.Skip(1)); if (countdown.Message.Length > 255) { commandSender.SendMessage("Countdown message is too long."); return false; } } if (!parent.AddCountdown(utcNow, countdown)) { commandSender.SendMessage("Too many countdowns. Try '/pt clearcountdowns'."); return true; } commandSender.SendMessage($"Broadcasted new {value} second countdown."); return true; } } internal class ClearCountdownsSubcommand : Subcommand { public override string Name => "clearcountdowns"; public override IEnumerable Aliases => new <>z__ReadOnlySingleElementList("clear"); public override string Usage => "'/pt clearcountdowns': clear all outstanding countdowns"; public override bool Execute(PauseTimerCommand parent, ICommandSender commandSender, string[] arguments) { if (!Subcommand.MaxArguments(commandSender, arguments, 0)) { return false; } parent.ClearCountdowns(); commandSender.SendMessage("Cleared all active countdowns."); return true; } } internal class PauseTimerModule : Module { private ServerPauseState serverPauseState = new ServerPauseState(); private float prevTimeScale = 1f; public override string Name => "Pause Timer"; public override ModuleActivationType ModuleActivationType => ModuleActivationType.OnOffOnly; internal static ServerPauseState GetServerPauseState() { if (!Module.IsEnabled) { return new ServerPauseState(); } return Module.Instance?.serverPauseState ?? new ServerPauseState(); } internal static PauseTimerUIConfig GetUIConfig() { return Module.Instance?.CosmeticConfig ?? new PauseTimerUIConfig(); } public PauseTimerModule() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Expected O, but got Unknown HuntClientAddon.On.Received += delegate(ServerPauseState state) { serverPauseState = state; }; TimeManager.OnTimeScaleUpdated += (TimeScaleUpdateDelegate)delegate(float value) { prevTimeScale = value; UpdateTimeScale(); }; Events.OnGameManagerUpdate += UpdateTimeScale; PauseTimerUI.Load(); } private void UpdateTimeScale() { //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) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Invalid comparison between Unknown and I4 //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Invalid comparison between Unknown and I4 GameState gameState = GameManager.instance.GameState; Time.timeScale = ((HuntClientAddon.IsConnected && ((int)gameState == 4 || (int)gameState == 5) && GetServerPauseState().IsServerPaused(out var _)) ? 0f : prevTimeScale); } protected override PauseTimerModule Self() { return this; } public override IEnumerable CreateCosmeticsMenuElements() { return PauseTimerUIConfig.CreateMenu(base.CosmeticConfig, base.UpdateCosmeticConfig); } } [MonoDetourTargets(typeof(GameManager))] internal class PauseTimerUI { private record StatusMessage { public static readonly StatusMessage Empty = new StatusMessage(""); public readonly string Actual; public readonly string Spacing; public StatusMessage(string Actual, string Spacing) { this.Actual = Actual; this.Spacing = Spacing; base..ctor(); } public StatusMessage(string singleton) : this(singleton, singleton) { } [CompilerGenerated] protected StatusMessage(StatusMessage original) { Actual = original.Actual; Spacing = original.Spacing; } [CompilerGenerated] public void Deconstruct(out string Actual, out string Spacing) { Actual = this.Actual; Spacing = this.Spacing; } } [CompilerGenerated] private sealed class <>c__DisplayClass19_0 { public PauseTimerUI <>4__this; public IEnumerator orig; internal bool b__1() { return <>4__this.respawnTimer <= 0f; } } private static readonly PauseTimerUI instance = new PauseTimerUI(); private GameObject? parent; private readonly List textCache = new List(); private float respawnTimer; private static readonly Lazy Font = new Lazy((Func)(() => (from f in Resources.FindObjectsOfTypeAll() where ((Object)f).name == "trajan_bold_tmpro" select f).First())); private static readonly Vector2 INACTIVE_POS = new Vector2(-1000f, -1000f); private PauseTimerUI() { Events.OnGameManagerUpdate += Update; } internal static void Load() { } private bool EnsureParent() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Expected O, but got Unknown //IL_006d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)parent != (Object)null) { return true; } textCache.Clear(); GameObject val = GameObject.Find("_GameCameras/HudCamera/In-game"); if ((Object)(object)val == (Object)null) { return false; } parent = new GameObject("CountdownsDisplayer"); Object.DontDestroyOnLoad((Object)(object)parent); parent.transform.SetParent(val.transform); parent.transform.localPosition = Vector3.zero; return true; } private static StatusMessage MessageWithTime(string msg, float time) { return new StatusMessage(msg + ": " + FormatTime(time), msg + ": " + FormatTimeSpacing(time)); } private static string FormatHours(float timeSeconds) { int num = Mathf.FloorToInt(timeSeconds / 3600f); int num2 = Mathf.FloorToInt(timeSeconds % 3600f / 60f); if (num2 >= 60) { num2 = 59; } string text = string.Format("{0} {1}", num, (num > 1) ? "hours" : "hour"); if (num2 > 0) { text = string.Format("{0} and {1} {2}", text, num2, (num2 > 1) ? "minutes" : "minute"); } return text; } private static string FormatTime(float timeSeconds) { if (timeSeconds <= 0f) { return "0.00"; } if (timeSeconds < 10f) { return $"{timeSeconds:0.00}"; } if (timeSeconds < 60f) { return $"{timeSeconds:00.0}"; } if (timeSeconds < 3600f) { int num = Mathf.FloorToInt(timeSeconds / 60f); int num2 = Mathf.FloorToInt(timeSeconds % 60f); if (num2 >= 60) { num2 = 59; } return $"{num}:{num2:00}"; } return FormatHours(timeSeconds); } private static string FormatTimeSpacing(float timeSeconds) { if (timeSeconds < 10f) { return "0.00"; } if (timeSeconds < 60f) { return "00.0"; } if (timeSeconds < 600f) { return "0:00"; } if (timeSeconds < 3600f) { return "00:00"; } return FormatHours(timeSeconds); } private List ComputeStatuses() { List list = new List(); ServerPauseState serverPauseState = PauseTimerModule.GetServerPauseState(); if (serverPauseState.IsServerPaused(out var remainingSeconds)) { if (!remainingSeconds.HasValue) { list.Add(new StatusMessage("Server Paused")); } else { list.Add(MessageWithTime("Unpausing in", remainingSeconds.Value)); } } if (respawnTimer > 0f) { list.Add(MessageWithTime("Respawn in", respawnTimer)); } foreach (Countdown countdown in serverPauseState.Countdowns) { if (countdown.GetDisplayTime(out var seconds)) { list.Add(MessageWithTime(countdown.Message, seconds)); } } return list; } private void CreateText() { //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) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Display") { layer = 5 }; val.transform.SetParent(parent.transform); TextMeshPro val2 = val.AddComponent(); ((TMP_Text)val2).font = Font.Value; ((Graphic)val2).color = Color.white; ((TMP_Text)val2).enableWordWrapping = false; ((TMP_Text)val2).autoSizeTextContainer = true; MeshRenderer component = val.GetComponent(); ((Renderer)component).sortingLayerName = "HUD"; ((Renderer)component).sortingOrder = 11; val.SetActive(false); textCache.Add(val2); } private void UpdateStatuses(List statuses) { //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_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) PauseTimerUIConfig uIConfig = PauseTimerModule.GetUIConfig(); PauseTimerSpacingParameters pauseTimerSpacingParameters = uIConfig.PauseTimerPosition.SpacingParameters(); for (int i = 0; i < textCache.Count; i++) { TextMeshPro val = textCache[i]; StatusMessage statusMessage = ((i < statuses.Count) ? statuses[i] : StatusMessage.Empty); if (statusMessage.Actual == "") { ((Component)val).gameObject.SetActive(false); ((TMP_Text)val).text = ""; val.transform.position = Vector2.op_Implicit(INACTIVE_POS); continue; } ((Component)val).gameObject.SetActive(true); float num = uIConfig.PauseTimerSize.FontScale(); val.transform.localScale = new Vector3(num, num, 1f); ((TMP_Text)val).fontSize = 40f; ((TMP_Text)val).text = statusMessage.Spacing; ((TMP_Text)val).ForceMeshUpdate(); val.transform.position = Vector2.op_Implicit(pauseTimerSpacingParameters.GetPosition(i, statuses.Count, uIConfig.PauseTimerSize.Spacing(), num, ((TMP_Text)val).bounds)); ((TMP_Text)val).text = statusMessage.Actual; } } internal static void ShortenRespawn(float reduce) { if (instance != null) { instance.respawnTimer = Mathf.Max(0f, instance.respawnTimer - reduce); } } private void Update() { if (respawnTimer > 0f && !PauseTimerModule.GetServerPauseState().IsServerPaused(out var _)) { respawnTimer -= Time.unscaledDeltaTime; if (respawnTimer < 0f) { respawnTimer = 0f; } } if (EnsureParent()) { List list = ComputeStatuses(); while (textCache.Count < list.Count) { CreateText(); } UpdateStatuses(list); } } private IEnumerator WaitForRespawn(IEnumerator orig) { <>c__DisplayClass19_0 CS$<>8__locals0 = new <>c__DisplayClass19_0(); CS$<>8__locals0.<>4__this = this; CS$<>8__locals0.orig = orig; if (respawnTimer <= 0f) { return CS$<>8__locals0.orig; } return Modified(); [IteratorStateMachine(typeof(<>c__DisplayClass19_0.<g__Modified|0>d))] IEnumerator Modified() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <>c__DisplayClass19_0.<g__Modified|0>d(0) { <>4__this = CS$<>8__locals0 }; } } private static void PostfixBeginSceneTransitionRoutine(GameManager self, ref SceneLoadInfo sceneLoadInfo, ref IEnumerator returnValue) { returnValue = instance?.WaitForRespawn(returnValue) ?? returnValue; } private static void PostfixPlayerDead(GameManager self, ref float waitTime, ref IEnumerator coroutine) { if (instance != null) { instance.respawnTimer = Mathf.Max(instance.respawnTimer, (float)DeathModule.GetRespawnTimer()); } } [MonoDetourHookInitialize] private static void Hook() { BeginSceneTransitionRoutine.Postfix(PostfixBeginSceneTransitionRoutine); PlayerDead.Postfix(PostfixPlayerDead); } } internal enum PauseTimerPosition { BottomLeft, BottomCenter, BottomRight, CenterLeft, CenterRight, TopCenter, TopRight, BelowHud } internal record PauseTimerSpacingParameters(PauseTimerPosition Position, Vector2 AnchorPos, Vector2 ForwardSpace, Vector2 ReverseSpace) { public Vector2 GetPosition(int i, int count, float spacing, float scale, Bounds localBounds) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000f: 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_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //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_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: 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_0097: Unknown result type (might be due to invalid IL or missing references) Vector2 val = AnchorPos + spacing * (ForwardSpace * (float)i + ReverseSpace * (float)(count - 1 - i)); Vector2 val2 = default(Vector2); ((Vector2)(ref val2))..ctor(Position.IsLeft() ? (0f - ((Bounds)(ref localBounds)).min.x) : (Position.IsRight() ? (0f - ((Bounds)(ref localBounds)).max.x) : (0f - ((Bounds)(ref localBounds)).center.x)), Position.IsBottom() ? (0f - ((Bounds)(ref localBounds)).min.y) : (Position.IsTop() ? (0f - ((Bounds)(ref localBounds)).max.y) : (0f - ((Bounds)(ref localBounds)).center.y))); return val + val2 * scale; } [CompilerGenerated] protected virtual bool PrintMembers(StringBuilder builder) { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) RuntimeHelpers.EnsureSufficientExecutionStack(); builder.Append("Position = "); builder.Append(Position.ToString()); builder.Append(", AnchorPos = "); Vector2 val = AnchorPos; builder.Append(((object)(Vector2)(ref val)).ToString()); builder.Append(", ForwardSpace = "); val = ForwardSpace; builder.Append(((object)(Vector2)(ref val)).ToString()); builder.Append(", ReverseSpace = "); val = ReverseSpace; builder.Append(((object)(Vector2)(ref val)).ToString()); return true; } } public static class PauseTimerPositionExtensions { internal static bool IsLeft(this PauseTimerPosition self) { if (self != PauseTimerPosition.BelowHud && self != PauseTimerPosition.CenterLeft) { return self == PauseTimerPosition.BottomLeft; } return true; } internal static bool IsRight(this PauseTimerPosition self) { if (self != PauseTimerPosition.BottomRight && self != PauseTimerPosition.CenterRight) { return self == PauseTimerPosition.TopRight; } return true; } internal static bool IsTop(this PauseTimerPosition self) { if (self != PauseTimerPosition.BelowHud && self != PauseTimerPosition.TopCenter) { return self == PauseTimerPosition.TopRight; } return true; } internal static bool IsBottom(this PauseTimerPosition self) { if (self != 0 && self != PauseTimerPosition.BottomCenter) { return self == PauseTimerPosition.BottomRight; } return true; } internal static bool IsVCenter(this PauseTimerPosition self) { if (self != PauseTimerPosition.CenterLeft) { return self == PauseTimerPosition.CenterRight; } return true; } internal static PauseTimerSpacingParameters SpacingParameters(this PauseTimerPosition self) { //IL_00d2: 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_00d4: Unknown result type (might be due to invalid IL or missing references) Vector2 anchorPos = default(Vector2); anchorPos.x = (self.IsLeft() ? (-14.5f) : (self.IsRight() ? 14.5f : 0f)); anchorPos.y = (self.IsTop() ? 7.5f : (self.IsBottom() ? (-8.25f) : 0f)); if (self == PauseTimerPosition.BelowHud) { anchorPos.y = 4.5f; } if (self == PauseTimerPosition.BottomLeft) { anchorPos.y = -4.5f; } Vector2 forwardSpace = default(Vector2); ((Vector2)(ref forwardSpace))..ctor(0f, self.IsTop() ? (-1f) : (self.IsVCenter() ? (-0.5f) : 0f)); Vector2 reverseSpace = default(Vector2); ((Vector2)(ref reverseSpace))..ctor(0f, self.IsBottom() ? 1f : (self.IsVCenter() ? 0.5f : 0f)); return new PauseTimerSpacingParameters(self, anchorPos, forwardSpace, reverseSpace); } } internal enum PauseTimerSize { Normal, Small, Large } internal static class PauseTimerSizeExtensions { internal static float FontScale(this PauseTimerSize size) { return size switch { PauseTimerSize.Normal => 0.25f, PauseTimerSize.Small => 0.15f, PauseTimerSize.Large => 0.35f, _ => 0.25f, }; } internal static float Spacing(this PauseTimerSize size) { return size switch { PauseTimerSize.Normal => 0.95f, PauseTimerSize.Small => 0.6f, PauseTimerSize.Large => 1.3f, _ => 0.95f, }; } } internal class PauseTimerUIConfig { [CompilerGenerated] private sealed class <>c__DisplayClass2_0 { public Action> editor; internal void b__0(PauseTimerPosition value) { <>c__DisplayClass2_1 CS$<>8__locals0 = new <>c__DisplayClass2_1 { value = value }; editor(delegate(PauseTimerUIConfig c) { c.PauseTimerPosition = CS$<>8__locals0.value; }); } internal void b__1(PauseTimerSize value) { <>c__DisplayClass2_2 CS$<>8__locals0 = new <>c__DisplayClass2_2 { value = value }; editor(delegate(PauseTimerUIConfig c) { c.PauseTimerSize = CS$<>8__locals0.value; }); } } [CompilerGenerated] private sealed class <>c__DisplayClass2_1 { public PauseTimerPosition value; internal void b__2(PauseTimerUIConfig c) { c.PauseTimerPosition = value; } } [CompilerGenerated] private sealed class <>c__DisplayClass2_2 { public PauseTimerSize value; internal void b__3(PauseTimerUIConfig c) { c.PauseTimerSize = value; } } [CompilerGenerated] private sealed class d__2 : IEnumerable, IEnumerable, IEnumerator, IEnumerator, IDisposable { private int <>1__state; private MenuElement <>2__current; private int <>l__initialThreadId; private Action> editor; public Action> <>3__editor; private PauseTimerUIConfig config; public PauseTimerUIConfig <>3__config; private <>c__DisplayClass2_0 <>8__1; MenuElement IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__2(int <>1__state) { this.<>1__state = <>1__state; <>l__initialThreadId = Environment.CurrentManagedThreadId; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = null; <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: { <>1__state = -1; <>8__1 = new <>c__DisplayClass2_0(); <>8__1.editor = editor; ChoiceElement val2 = new ChoiceElement(LocalizedText.op_Implicit("Position"), (IChoiceModel)(object)ChoiceModels.ForEnum(), LocalizedText.op_Implicit("Where to display the pause timer.")) { Value = config.PauseTimerPosition }; ((SelectableValueElement)(object)val2).OnValueChanged += delegate(PauseTimerPosition value) { <>c__DisplayClass2_1 CS$<>8__locals0 = new <>c__DisplayClass2_1 { value = value }; <>8__1.editor(delegate(PauseTimerUIConfig c) { c.PauseTimerPosition = CS$<>8__locals0.value; }); }; <>2__current = (MenuElement)(object)val2; <>1__state = 1; return true; } case 1: { <>1__state = -1; ChoiceElement val = new ChoiceElement(LocalizedText.op_Implicit("Size"), (IChoiceModel)(object)ChoiceModels.ForEnum(), LocalizedText.op_Implicit("Font size for the pause timer.")) { Value = config.PauseTimerSize }; ((SelectableValueElement)(object)val).OnValueChanged += delegate(PauseTimerSize value) { <>c__DisplayClass2_2 CS$<>8__locals1 = new <>c__DisplayClass2_2 { value = value }; <>8__1.editor(delegate(PauseTimerUIConfig c) { c.PauseTimerSize = CS$<>8__locals1.value; }); }; <>2__current = (MenuElement)(object)val; <>1__state = 2; return true; } case 2: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } [DebuggerHidden] IEnumerator IEnumerable.GetEnumerator() { d__2 d__; if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId) { <>1__state = 0; d__ = this; } else { d__ = new d__2(0); } d__.config = <>3__config; d__.editor = <>3__editor; return d__; } [DebuggerHidden] IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable)this).GetEnumerator(); } } public PauseTimerPosition PauseTimerPosition = PauseTimerPosition.BottomCenter; public PauseTimerSize PauseTimerSize; [IteratorStateMachine(typeof(d__2))] public static IEnumerable CreateMenu(PauseTimerUIConfig config, Action> editor) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__2(-2) { <>3__config = config, <>3__editor = editor }; } } internal class ServerPauseState : IIdentifiedPacket, IPacketData { public const int MAX_COUNTDOWNS = 10; public List Countdowns = new List(); public bool ServerPaused; public long UnpauseTimeTicks = long.MaxValue; public ClientPacketId Identifier => ClientPacketId.ServerPauseState; public bool Single => true; public bool IsReliable => true; public bool DropReliableDataIfNewerExists => true; public void ReadData(IPacket packet) { Countdowns.ReadData(packet); ServerPaused.ReadData(packet); UnpauseTimeTicks.ReadData(packet); } public void WriteData(IPacket packet) { ((IReadOnlyCollection)Countdowns).WriteData(packet); ServerPaused.WriteData(packet); UnpauseTimeTicks.WriteData(packet); } public void Clear() { Countdowns.Clear(); ServerPaused = false; UnpauseTimeTicks = long.MaxValue; } public void UpdateCountdowns(DateTime now) { Countdowns = Countdowns.Where((Countdown c) => !c.IsCompleted(now)).ToList(); } public bool IsServerPaused(out float? remainingSeconds) { remainingSeconds = null; if (!ServerPaused) { return false; } if (UnpauseTimeTicks == long.MaxValue) { return true; } long ticks = DateTime.UtcNow.Ticks; if (ticks >= UnpauseTimeTicks) { return false; } remainingSeconds = (float)new TimeSpan(UnpauseTimeTicks - ticks).TotalSeconds; return true; } } } namespace Silksong.TheHuntIsOn.Modules.Lib { internal class CosmeticConfig { public Dictionary Config = new Dictionary(); } public sealed class EmptySettings : ModuleSettings { public override ModuleSettingsType DynamicType() { return ModuleSettingsType.Empty; } public override ModuleSettings Clone() { return this; } protected override bool Equivalent(EmptySettings other) { return true; } public override void ReadDynamicData(IPacket packet) { } public override void WriteDynamicData(IPacket packet) { } } internal abstract class GlobalSettingsModule : Module where ModuleT : GlobalSettingsModule where GlobalT : ModuleSettings, new() where SubMenuT : ICustomMenu, new() { } internal abstract class Module : ModuleBase where ModuleT : Module where GlobalT : ModuleSettings, new() where SubMenuT : ICustomMenu, new() where CosmeticT : class, new() { protected static ModuleT? Instance { get; private set; } protected GlobalT GlobalConfig => TheHuntIsOnPlugin.GetGlobalConfig(Name); protected ModuleActivation ModuleActivation => TheHuntIsOnPlugin.GetModuleActivation(Name); protected static bool IsEnabled => Instance?.Enabled ?? false; protected CosmeticT CosmeticConfig { get { return TheHuntIsOnPlugin.GetCosmeticConfig(Name); } set { TheHuntIsOnPlugin.SetCosmeticConfig(Name, value); } } protected Module() { Instance = Self(); } protected abstract ModuleT Self(); protected static bool GetEnabledConfig(out GlobalT config) { if (Instance == null || !Instance.Enabled) { config = new GlobalT(); return false; } config = Instance.GlobalConfig; return true; } public override void OnGlobalConfigChanged(ModuleSettings? before, ModuleSettings? after) { GlobalT val = (before as GlobalT) ?? new GlobalT(); GlobalT val2 = (after as GlobalT) ?? new GlobalT(); if (!val.Equivalent(val2)) { OnGlobalConfigChanged(val, val2); } } protected virtual void OnGlobalConfigChanged(GlobalT before, GlobalT after) { } protected static FsmStateAction IfEnabled(Action action) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown Action action2 = action; return (FsmStateAction)new LambdaAction { Method = delegate { if (GetEnabledConfig(out var config)) { action2(config); } } }; } protected void UpdateCosmeticConfig(Action action) { TheHuntIsOnPlugin.UpdateCosmeticConfig(Name, action); } protected virtual void CustomizeMenu(SubMenuT menu) { } public override IModuleMenu CreateGlobalDataSubMenu() { SubMenuT val = new SubMenuT(); CustomizeMenu(val); return new ModuleMenu((ICustomMenu)(object)val); } } internal enum ModuleActivation { Inactive, HuntersOnly, SpeedrunnerOnly, EveryoneSame, EveryoneDifferent } internal enum ModuleActivationType { OnOffOnly, AnyConfiguration } internal abstract class ModuleBase { [CompilerGenerated] private bool k__BackingField; public abstract string Name { get; } public abstract ModuleActivationType ModuleActivationType { get; } public bool Enabled { [CompilerGenerated] get { return k__BackingField; } set { if (k__BackingField != value) { k__BackingField = value; if (value) { OnEnabled(); } else { OnDisabled(); } } } } public abstract IModuleMenu CreateGlobalDataSubMenu(); public virtual IEnumerable CreateCosmeticsMenuElements() { return Array.Empty(); } public virtual void OnEnabled() { } public virtual void OnDisabled() { } public virtual void OnGlobalConfigChanged(ModuleSettings? before, ModuleSettings? after) { } public static IEnumerable GetAllModules() { return new <>z__ReadOnlyArray(new ModuleBase[11] { new Silksong.TheHuntIsOn.Modules.ArchitectModule.ArchitectModule(), new AutoTriggerModule(), new BindModule(), new DeathModule(), new Silksong.TheHuntIsOn.Modules.EventsModule.EventsModule(), new HealingModule(), new IntelligenceModule(), new Silksong.TheHuntIsOn.Modules.PauseTimerModule.PauseTimerModule(), new SilkRegenerationModule(), new SpawnPointModule(), new StatsModule() }); } } internal class ModuleData : NetworkedCloneable { public ModuleActivation ModuleActivation; public ModuleSettings? SpeedrunnerSettings; public ModuleSettings? HunterSettings; public ModuleSettings? EveryoneSettings; public ModuleData() { } public ModuleData(ModuleActivation moduleActivation, ModuleSettings? speedrunnerSettings, ModuleSettings? hunterSettings, ModuleSettings? everyoneSettings) { ModuleActivation = moduleActivation; SpeedrunnerSettings = speedrunnerSettings; HunterSettings = hunterSettings; EveryoneSettings = everyoneSettings; } private static ModuleSettings? ReadSettings(IPacket packet) { return packet.ReadOptionalDynamic(); } public override void ReadData(IPacket packet) { ModuleActivation = packet.ReadEnum(); SpeedrunnerSettings = ReadSettings(packet); HunterSettings = ReadSettings(packet); EveryoneSettings = ReadSettings(packet); } public override void WriteData(IPacket packet) { ModuleActivation.WriteData(packet); SpeedrunnerSettings.WriteOptionalDynamic(packet); HunterSettings.WriteOptionalDynamic(packet); EveryoneSettings.WriteOptionalDynamic(packet); } public override ModuleData Clone() { return new ModuleData(ModuleActivation, SpeedrunnerSettings?.Clone(), HunterSettings?.Clone(), EveryoneSettings?.Clone()); } public bool IsEnabled(RoleId role) { return ModuleActivation switch { ModuleActivation.Inactive => false, ModuleActivation.SpeedrunnerOnly => role == RoleId.Speedrunner, ModuleActivation.HuntersOnly => role == RoleId.Hunter, ModuleActivation.EveryoneSame => true, ModuleActivation.EveryoneDifferent => true, _ => false, }; } public ModuleSettings? GetSettings(RoleId role) { return ModuleActivation switch { ModuleActivation.Inactive => null, ModuleActivation.SpeedrunnerOnly => (role == RoleId.Speedrunner) ? SpeedrunnerSettings : null, ModuleActivation.HuntersOnly => (role == RoleId.Hunter) ? HunterSettings : null, ModuleActivation.EveryoneSame => EveryoneSettings, ModuleActivation.EveryoneDifferent => (role == RoleId.Speedrunner) ? SpeedrunnerSettings : HunterSettings, _ => null, }; } } internal class ModuleDataset : Dictionary, INetworkedCloneable, ICloneable, Silksong.TheHuntIsOn.Util.ICloneable, INetworkedCloneable, IWireInterface, IIdentifiedPacket, IPacketData, IIdentifiedPacket { ClientPacketId IIdentifiedPacket.Identifier => ClientPacketId.ModuleDataset; ServerPacketId IIdentifiedPacket.Identifier => ServerPacketId.ModuleDataset; public bool Single => true; public bool IsReliable => true; public bool DropReliableDataIfNewerExists => true; public ModuleDataset() { } public ModuleDataset(IReadOnlyDictionary data) : base((IDictionary)data.CloneDictDeep()) { } public void WriteData(IPacket packet) { ((IReadOnlyDictionary)this).WriteData(packet, (Action)delegate(IPacket packet, string value) { value.WriteData(packet); }); } public void ReadData(IPacket packet) { ((IDictionary)this).ReadData(packet, (Func)((IPacket packet) => packet.ReadString())); } public ModuleDataset Clone() { return new ModuleDataset(this); } public INetworkedCloneable CloneRaw() { return Clone(); } Silksong.TheHuntIsOn.Util.ICloneable Silksong.TheHuntIsOn.Util.ICloneable.CloneRaw() { return Clone(); } } public enum ModuleSettingsType { Empty, Architect, AutoTrigger, Bind, Death, Healing, Intelligence, SilkRegeneration, SpawnPoint, Stats } public abstract class ModuleSettings : Cloneable, IDynamicValue { public abstract ModuleSettingsType DynamicType(); public abstract void ReadDynamicData(IPacket packet); public abstract void WriteDynamicData(IPacket packet); public abstract bool Equivalent(ModuleSettings other); } public abstract class ModuleSettings : ModuleSettings, ICloneable, Silksong.TheHuntIsOn.Util.ICloneable where T : ModuleSettings { T ICloneable.Clone() { return (T)Clone(); } public override bool Equivalent(ModuleSettings other) { if (other is T other2) { return Equivalent(other2); } return false; } protected abstract bool Equivalent(T other); } internal class ModuleSettingsFactory : IDynamicValueFactory { public ModuleSettings Create(ModuleSettingsType type) { return type switch { ModuleSettingsType.Empty => new EmptySettings(), ModuleSettingsType.Architect => new ArchitectSettings(), ModuleSettingsType.AutoTrigger => new AutoTriggerSettings(), ModuleSettingsType.Bind => new BindSettings(), ModuleSettingsType.Death => new DeathSettings(), ModuleSettingsType.Healing => new HealingSettings(), ModuleSettingsType.Intelligence => new IntelligenceSettings(), ModuleSettingsType.SilkRegeneration => new SilkRegenerationSettings(), ModuleSettingsType.SpawnPoint => new SpawnPointSettings(), ModuleSettingsType.Stats => new StatsSettings(), _ => throw new ArgumentException(string.Format("{0}: {1}", "type", type)), }; } } internal enum RoleId { Speedrunner, Hunter } } namespace Silksong.TheHuntIsOn.Modules.EventsModule { internal record EventRewards { public EnumList Items = new EnumList(); public string Message = ""; } internal class EventsData : Dictionary { public static EventsData Load() { string path = Path.Join(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location).AsSpan(), "events.json".AsSpan()); if (!File.Exists(path)) { return JsonUtil.DeserializeFromDataResource("default-events.json"); } return JsonUtil.DeserializeFromFile(path); } } internal class ParsedEventsData { public readonly Dictionary BoolRewards = new Dictionary(); public readonly Dictionary CountRewards = new Dictionary(); public void Parse(EventsData eventsData) { foreach (KeyValuePair eventsDatum in eventsData) { if (Enum.TryParse(eventsDatum.Key, out var result)) { BoolRewards.Add(result, eventsDatum.Value); continue; } if (SpeedrunnerCountEvent.TryParse(eventsDatum.Key, out SpeedrunnerCountEvent result2)) { CountRewards.Add(result2, eventsDatum.Value); continue; } throw new ArgumentException("Unrecognized event key: '" + eventsDatum.Key + "'"); } } public static ParsedEventsData Load() { ParsedEventsData parsedEventsData = new ParsedEventsData(); parsedEventsData.Parse(EventsData.Load()); return parsedEventsData; } } internal class EventsModule : Module { private readonly HunterItemGranter hunterItemGranter = new HunterItemGranter(); private SpeedrunnerEvents speedrunnerEvents = new SpeedrunnerEvents(); private bool reportDesync; private readonly RateLimiter desyncRateLimiter = new RateLimiter(1f); private readonly RateLimiter publishRateLimiter = new RateLimiter(1f); private readonly Updater hunterMasks = new Updater(0); private readonly Updater hunterSilk = new Updater(0); public override string Name => "Events"; public override ModuleActivationType ModuleActivationType => ModuleActivationType.OnOffOnly; public EventsModule() { HuntClientAddon.On.Received += hunterItemGranter.Reset; HuntClientAddon.On.Received += delegate(HunterItemGrantsDelta delta) { hunterItemGranter.Update(delta, out var desynced); reportDesync |= desynced; }; HuntClientAddon.On.Received += delegate(SpeedrunnerEvents speedrunnerEvents) { this.speedrunnerEvents = speedrunnerEvents; }; HuntClientAddon.On.Received += delegate(SpeedrunnerEventsDelta speedrunnerEventsDelta) { speedrunnerEvents.Update(speedrunnerEventsDelta); }; } protected override EventsModule Self() { return this; } public override void OnEnabled() { hunterItemGranter.OnEnabled(); Events.OnHeroUpdate += Update; } public override void OnDisabled() { hunterItemGranter.OnDisabled(); Events.OnHeroUpdate -= Update; } private void Update() { desyncRateLimiter.Update(); publishRateLimiter.Update(); if (reportDesync && desyncRateLimiter.Check()) { HuntLogger.LogError("Desync! Requesting all server information again."); HuntClientAddon.Instance?.Send(new ReportDesync()); desyncRateLimiter.Reset(); } if (hunterMasks.Update(hunterItemGranter.MaxHealthAdds())) { UIEvents.UpdateHealth(); } if (hunterSilk.Update(hunterItemGranter.MaxSilkAdds())) { UIEvents.UpdateSilk(); } if (TheHuntIsOnPlugin.GetRole() == RoleId.Speedrunner && publishRateLimiter.Check()) { SpeedrunnerEventsDelta speedrunnerEventsDelta = SpeedrunnerEvents.Calculate(PlayerData.instance).DeltaFrom(speedrunnerEvents); if (!speedrunnerEventsDelta.IsEmpty) { HuntClientAddon.Instance?.Send(speedrunnerEventsDelta); publishRateLimiter.Reset(); } } } } internal class EventsModuleServerAddon { private readonly HuntServerAddon serverAddon; private ParsedEventsData parsedEventsData = ParsedEventsData.Load(); private readonly DeltaBaseWrapper speedrunnerEvents = new DeltaBaseWrapper(); private readonly HunterItemGrants hunterItemGrants = new HunterItemGrants(); internal EventsModuleServerAddon(HuntServerAddon serverAddon, HuntCommand huntCommand) { HuntServerAddon serverAddon2 = serverAddon; base..ctor(); EventsModuleServerAddon eventsModuleServerAddon = this; this.serverAddon = serverAddon2; serverAddon2.OnUpdatePlayer += delegate(IServerPlayer player) { serverAddon2.SendToPlayer(player, eventsModuleServerAddon.speedrunnerEvents.Value); serverAddon2.SendToPlayer(player, eventsModuleServerAddon.hunterItemGrants); }; huntCommand.OnGameReset += OnGameReset; } private void OnGameReset() { speedrunnerEvents.Reset(); hunterItemGrants.Clear(); serverAddon.Broadcast(speedrunnerEvents.Value); serverAddon.Broadcast(hunterItemGrants); } internal void Refresh() { parsedEventsData = ParsedEventsData.Load(); OnGameReset(); } internal void OnSpeedrunnerEventsDelta(ushort id, SpeedrunnerEventsDelta eventsDelta) { if (!speedrunnerEvents.Update(eventsDelta, out SpeedrunnerEventsDelta realDelta)) { return; } HunterItemGrantsDelta grantsDelta = new HunterItemGrantsDelta(); foreach (SpeedrunnerBoolEvent boolEvent in realDelta.BoolEvents) { if (parsedEventsData.BoolRewards.TryGetValue(boolEvent, out EventRewards value)) { AddRewards($"{boolEvent}", value); } } foreach (SpeedrunnerCountEventDelta countEvent in realDelta.CountEvents) { for (int i = countEvent.PrevCount + 1; i <= countEvent.NewCount; i++) { if (parsedEventsData.CountRewards.TryGetValue(new SpeedrunnerCountEvent(countEvent.Type, i), out EventRewards value2)) { AddRewards($"{countEvent.Type}{i}", value2); } } } serverAddon.Broadcast(realDelta); if (!grantsDelta.IsEmpty) { hunterItemGrants.Update(grantsDelta); serverAddon.Broadcast(grantsDelta); } void AddRewards(string id, EventRewards rewards) { grantsDelta.Grants.Add(id, rewards.Items); if (rewards.Message != "") { serverAddon.BroadcastMessage(rewards.Message); } } } } internal class HunterItemGrant : IWireInterface { public string GrantId = ""; public EnumList Types = new EnumList(); public void ReadData(IPacket packet) { GrantId = packet.ReadString(); Types.ReadData(packet); } public void WriteData(IPacket packet) { GrantId.WriteData(packet); Types.WriteData(packet); } } internal class HunterItemGranter { private static readonly IReadOnlyList<(HunterItemGrantType, int)> MASK_SHARD_REWARDS = new <>z__ReadOnlyArray<(HunterItemGrantType, int)>(new(HunterItemGrantType, int)[2] { (HunterItemGrantType.MaskShard, 1), (HunterItemGrantType.Mask, 4) }); private static readonly IReadOnlyList<(HunterItemGrantType, int)> SILK_SPOOL_REWARDS = new <>z__ReadOnlyArray<(HunterItemGrantType, int)>(new(HunterItemGrantType, int)[2] { (HunterItemGrantType.SpoolFragment, 1), (HunterItemGrantType.SilkSpool, 2) }); private readonly Dictionary> intModifiers; private readonly Func maxHealthModifier; private readonly Func maxSilkModifier; private readonly HunterItemGrants hunterItemGrants = new HunterItemGrants(); private readonly HashSet allGrantIds = new HashSet(); private readonly HashMultiset allGrants = new HashMultiset(); private static readonly Dictionary boolGrants = new Dictionary { ["hasDash"] = HunterItemGrantType.SwiftStep, ["hasBrolly"] = HunterItemGrantType.DriftersCloak, ["hasWalljump"] = HunterItemGrantType.ClingGrip, ["hasNeedolin"] = HunterItemGrantType.Needolin, ["hasHarpoonDash"] = HunterItemGrantType.Clawline, ["hasDoubleJump"] = HunterItemGrantType.FaydownCloak, ["hasSuperJump"] = HunterItemGrantType.SilkSoar, ["hasNeedleThrow"] = HunterItemGrantType.Silkspear, ["hasSilkCharge"] = HunterItemGrantType.Sharpdart, ["hasThreadSphere"] = HunterItemGrantType.ThreadStorm, ["hasSilkBomb"] = HunterItemGrantType.RuneRage, ["hasParry"] = HunterItemGrantType.CrossStitch, ["hasSilkBossNeedle"] = HunterItemGrantType.PaleNails }; private static readonly Dictionary origFields = new Dictionary(); internal HunterItemGranter() { maxHealthModifier = QuotientModifier(MASK_SHARD_REWARDS, "heartPieces", 4); maxSilkModifier = QuotientModifier(SILK_SPOOL_REWARDS, "silkSpoolParts", 2); intModifiers = new Dictionary> { ["heartPieces"] = ModulusModifier(MASK_SHARD_REWARDS, "heartPieces", 4), ["maxHealth"] = maxHealthModifier, ["maxHealthBase"] = maxHealthModifier, ["silkSpoolParts"] = ModulusModifier(SILK_SPOOL_REWARDS, "silkSpoolParts", 2), ["silkMax"] = maxSilkModifier, ["nailUpgrades"] = IntModifier(HunterItemGrantType.NeedleUpgrade) }; } internal int MaxHealthAdds() { return maxHealthModifier(); } internal int MaxSilkAdds() { return maxSilkModifier(); } internal bool Update(HunterItemGrantsDelta delta, out bool desynced) { if (!hunterItemGrants.Update(delta, out desynced)) { return false; } foreach (KeyValuePair> grant in delta.Grants) { if (allGrantIds.Add(grant.Key)) { allGrants.AddRange((IEnumerable)grant.Value); } } return true; } internal void Reset(HunterItemGrants newGrants) { hunterItemGrants.Clear(); allGrantIds.Clear(); allGrants.Clear(); foreach (KeyValuePair> grant in newGrants.Grants) { allGrantIds.Add(grant.Key); allGrants.AddRange((IEnumerable)grant.Value); } } internal void OnEnabled() { PlayerDataVariableEvents.OnGetVariable += OverrideGetPDBool; foreach (KeyValuePair> intModifier in intModifiers) { Events.AddPdIntModifier(intModifier.Key, intModifier.Value); } } internal void OnDisabled() { PlayerDataVariableEvents.OnGetVariable -= OverrideGetPDBool; foreach (KeyValuePair> intModifier in intModifiers) { Events.RemovePdIntModifier(intModifier.Key, intModifier.Value); } } private bool OverrideGetPDBool(PlayerData instance, string name, bool current) { if (current || TheHuntIsOnPlugin.GetRole() != RoleId.Hunter) { return current; } if (boolGrants.TryGetValue(name, out var value)) { return allGrants.Contains(value); } return false; } private Func IntModifier(HunterItemGrantType type) { return () => (TheHuntIsOnPlugin.GetRole() == RoleId.Hunter) ? allGrants.Count(type) : 0; } private static int GetOrigPDInt(string name) { if (!origFields.TryGetValue(name, out FieldInfo value)) { value = typeof(PlayerData).GetField(name, BindingFlags.Instance | BindingFlags.Public) ?? typeof(PlayerData).GetField(name, BindingFlags.Instance | BindingFlags.NonPublic); origFields.Add(name, value); } return (int)value.GetValue(PlayerData.instance); } private bool GetNewShards(IEnumerable<(HunterItemGrantType, int)> shardRewards, string pdShardName, int modulus, out int origShards, out int newShards) { if (TheHuntIsOnPlugin.GetRole() != RoleId.Hunter) { origShards = 0; newShards = 0; return false; } origShards = GetOrigPDInt(pdShardName); newShards = origShards; foreach (var (hunterItemGrantType, num) in shardRewards) { newShards += num * allGrants.Count(hunterItemGrantType); } return true; } private Func QuotientModifier(IEnumerable<(HunterItemGrantType, int)> shardRewards, string pdShardName, int modulus) { IEnumerable<(HunterItemGrantType, int)> shardRewards2 = shardRewards; string pdShardName2 = pdShardName; int origShards; int newShards; return () => GetNewShards(shardRewards2, pdShardName2, modulus, out origShards, out newShards) ? (newShards / modulus) : 0; } private Func ModulusModifier(IEnumerable<(HunterItemGrantType, int)> shardRewards, string pdShardName, int modulus) { IEnumerable<(HunterItemGrantType, int)> shardRewards2 = shardRewards; string pdShardName2 = pdShardName; int origShards; int newShards; return () => GetNewShards(shardRewards2, pdShardName2, modulus, out origShards, out newShards) ? (newShards % modulus - origShards) : 0; } } internal class HunterItemGrants : IDeltaBase, IIdentifiedPacket, IPacketData { public Dictionary> Grants = new Dictionary>(); public ClientPacketId Identifier => ClientPacketId.HunterItemGrants; public bool Single => false; public bool IsReliable => true; public bool DropReliableDataIfNewerExists => false; public void ReadData(IPacket packet) { ((IDictionary>)Grants).ReadData(packet, (Func)((IPacket packet) => packet.ReadString())); } public void WriteData(IPacket packet) { ((IReadOnlyDictionary>)Grants).WriteData(packet, (Action)delegate(IPacket packet, string value) { value.WriteData(packet); }); } public void Clear() { Grants.Clear(); } public bool Update(HunterItemGrantsDelta delta, out bool desynced) { bool result = false; foreach (KeyValuePair> grant in delta.Grants) { if (!Grants.ContainsKey(grant.Key)) { result = true; Grants.Add(grant.Key, grant.Value.Clone()); } } desynced = delta.TotalGrants.HasValue && Grants.Count != delta.TotalGrants.Value; return result; } public bool Update(HunterItemGrantsDelta delta) { bool desynced; return Update(delta, out desynced); } public HunterItemGrantsDelta DeltaFrom(HunterItemGrants deltaBase) { HunterItemGrantsDelta hunterItemGrantsDelta = new HunterItemGrantsDelta { TotalGrants = Grants.Count }; foreach (KeyValuePair> grant in Grants) { if (!deltaBase.Grants.ContainsKey(grant.Key)) { hunterItemGrantsDelta.Grants.Add(grant.Key, grant.Value.Clone()); } } return hunterItemGrantsDelta; } } internal class HunterItemGrantsDelta : IDelta, IIdentifiedPacket, IPacketData { public Dictionary> Grants = new Dictionary>(); public int? TotalGrants; public ClientPacketId Identifier => ClientPacketId.HunterItemGrantsDelta; public bool Single => false; public bool IsReliable => true; public bool DropReliableDataIfNewerExists => false; public bool IsEmpty => Grants.Count == 0; public void ReadData(IPacket packet) { ((IDictionary>)Grants).ReadData(packet, (Func)((IPacket packet) => packet.ReadString())); TotalGrants.ReadData(packet); } public void WriteData(IPacket packet) { ((IReadOnlyDictionary>)Grants).WriteData(packet, (Action)delegate(IPacket packet, string value) { value.WriteData(packet); }); TotalGrants.WriteData(packet); } } internal enum HunterItemGrantType { SwiftStep, DriftersCloak, ClingGrip, Needolin, Clawline, FaydownCloak, SilkSoar, Silkspear, Sharpdart, ThreadStorm, RuneRage, CrossStitch, PaleNails, MaskShard, Mask, SpoolFragment, SilkSpool, NeedleUpgrade } internal enum SpeedrunnerBoolEvent { SwiftStep, DriftersCloak, ClingGrip, Needolin, Clawline, FaydownCloak, SilkSoar, Silkspear, Sharpdart, ThreadStorm, RuneRage, CrossStitch, PaleNails, ArchitectsMelody, ConductorsMelody, VaultkeepersMelody, HuntersHeart, PollenHeart, EncrustedHeart, ConjoinedHeart, Everbloom } internal class SpeedrunnerCountEvent : IWireInterface { public SpeedrunnerCountEventType Type; public int Value; public SpeedrunnerCountEvent(SpeedrunnerCountEventType type, int value) { Type = type; Value = value; base..ctor(); } public static bool TryParse(string s, out SpeedrunnerCountEvent result) { result = new SpeedrunnerCountEvent(); for (int i = 0; i < s.Length; i++) { if (char.IsDigit(s[i])) { if (Enum.TryParse(s.Substring(0, i), out result.Type)) { int num = i; return int.TryParse(s.Substring(num, s.Length - num), out result.Value); } return false; } } return false; } public SpeedrunnerCountEvent() : this(SpeedrunnerCountEventType.Masks, 0) { } public void ReadData(IPacket packet) { Type = packet.ReadEnum(); Value.ReadData(packet); } public void WriteData(IPacket packet) { Type.WriteData(packet); Value.WriteData(packet); } public override int GetHashCode() { return Type.GetHashCode() ^ Value.GetHashCode(); } public override bool Equals(object obj) { if (obj is SpeedrunnerCountEvent speedrunnerCountEvent && Type == speedrunnerCountEvent.Type) { return Value == speedrunnerCountEvent.Value; } return false; } } internal class SpeedrunnerCountEventDelta : IWireInterface { public SpeedrunnerCountEventType Type; public int PrevCount; public int NewCount; public void ReadData(IPacket packet) { Type = packet.ReadEnum(); PrevCount = packet.ReadVarint(); NewCount = packet.ReadVarint(); } public void WriteData(IPacket packet) { Type.WriteData(packet); packet.WriteVarint(PrevCount); packet.WriteVarint(NewCount); } } internal enum SpeedrunnerCountEventType { Masks, SilkSpools, SilkHearts, SilkSkills, CraftingKits, ToolPouches, NeedleUpgrades, Melodies, Hearts } internal class SpeedrunnerEvents : IDeltaBase, IIdentifiedPacket, IPacketData { public EnumSet BoolEvents = new EnumSet(); public EnumMultiset CountEvents = new EnumMultiset(); private static readonly Dictionary pdBoolChecks = new Dictionary { [SpeedrunnerBoolEvent.SwiftStep] = "hasDash", [SpeedrunnerBoolEvent.DriftersCloak] = "hasBrolly", [SpeedrunnerBoolEvent.ClingGrip] = "hasWalljump", [SpeedrunnerBoolEvent.Needolin] = "hasNeedolin", [SpeedrunnerBoolEvent.Clawline] = "hasHarpoonDash", [SpeedrunnerBoolEvent.FaydownCloak] = "hasDoubleJump", [SpeedrunnerBoolEvent.SilkSoar] = "hasSuperJump", [SpeedrunnerBoolEvent.Silkspear] = "hasNeedleThrow", [SpeedrunnerBoolEvent.Sharpdart] = "hasSilkCharge", [SpeedrunnerBoolEvent.ThreadStorm] = "hasThreadSphere", [SpeedrunnerBoolEvent.RuneRage] = "hasSilkBomb", [SpeedrunnerBoolEvent.CrossStitch] = "hasParry", [SpeedrunnerBoolEvent.PaleNails] = "hasSilkBossNeedle", [SpeedrunnerBoolEvent.ArchitectsMelody] = "HasMelodyArchitect", [SpeedrunnerBoolEvent.ConductorsMelody] = "HasMelodyConductor", [SpeedrunnerBoolEvent.VaultkeepersMelody] = "HasMelodyLibrarian", [SpeedrunnerBoolEvent.HuntersHeart] = "CollectedHeartHunter", [SpeedrunnerBoolEvent.PollenHeart] = "CollectedHeartFlower", [SpeedrunnerBoolEvent.EncrustedHeart] = "CollectedHeartCoral", [SpeedrunnerBoolEvent.ConjoinedHeart] = "CollectedHeartClover" }; private static readonly Dictionary pdIntChecks = new Dictionary { [SpeedrunnerCountEventType.Masks] = "maxHealth", [SpeedrunnerCountEventType.SilkSpools] = "silkMax", [SpeedrunnerCountEventType.SilkHearts] = "silkRegenMax", [SpeedrunnerCountEventType.CraftingKits] = "ToolKitUpgrades", [SpeedrunnerCountEventType.ToolPouches] = "ToolPouchUpgrades", [SpeedrunnerCountEventType.NeedleUpgrades] = "nailUpgrades" }; public ClientPacketId Identifier => ClientPacketId.SpeedrunnerEvents; public bool Single => false; public bool IsReliable => true; public bool DropReliableDataIfNewerExists => true; public void Clear() { BoolEvents.Clear(); ((HashMultiset)CountEvents).Clear(); } public void ReadData(IPacket packet) { BoolEvents.ReadData(packet); CountEvents.ReadData(packet); } public void WriteData(IPacket packet) { BoolEvents.WriteData(packet); CountEvents.WriteData(packet); } public bool Update(SpeedrunnerEventsDelta delta) { bool flag = false; foreach (SpeedrunnerBoolEvent boolEvent in delta.BoolEvents) { flag |= BoolEvents.Add(boolEvent); } foreach (SpeedrunnerCountEventDelta countEvent in delta.CountEvents) { flag |= ((HashMultiset)CountEvents).Set(countEvent.Type, Math.Max(((HashMultiset)CountEvents).Count(countEvent.Type), countEvent.NewCount)); } return flag; } public SpeedrunnerEventsDelta DeltaFrom(SpeedrunnerEvents deltaBase) { SpeedrunnerEventsDelta speedrunnerEventsDelta = new SpeedrunnerEventsDelta(); foreach (SpeedrunnerBoolEvent boolEvent in BoolEvents) { if (!deltaBase.BoolEvents.Contains(boolEvent)) { speedrunnerEventsDelta.BoolEvents.Add(boolEvent); } } foreach (var count in ((HashMultiset)CountEvents).Counts) { SpeedrunnerCountEventType item = count.Item1; int item2 = count.Item2; int num = ((HashMultiset)deltaBase.CountEvents).Count(item); if (num < item2) { speedrunnerEventsDelta.CountEvents.Add(new SpeedrunnerCountEventDelta { Type = item, PrevCount = num, NewCount = item2 }); } } return speedrunnerEventsDelta; } public static SpeedrunnerEvents Calculate(PlayerData playerData) { SpeedrunnerEvents speedrunnerEvents = new SpeedrunnerEvents(); foreach (KeyValuePair pdBoolCheck in pdBoolChecks) { if (playerData.GetBool(pdBoolCheck.Value)) { speedrunnerEvents.BoolEvents.Add(pdBoolCheck.Key); } } if (playerData.HasWhiteFlower) { speedrunnerEvents.BoolEvents.Add(SpeedrunnerBoolEvent.Everbloom); } foreach (KeyValuePair pdIntCheck in pdIntChecks) { if (playerData.GetInt(pdIntCheck.Value) > 0) { ((HashMultiset)speedrunnerEvents.CountEvents).Add(pdIntCheck.Key, playerData.GetInt(pdIntCheck.Value)); } } speedrunnerEvents.DeriveInt(SpeedrunnerCountEventType.SilkSkills, new <>z__ReadOnlyArray(new SpeedrunnerBoolEvent[6] { SpeedrunnerBoolEvent.Silkspear, SpeedrunnerBoolEvent.Sharpdart, SpeedrunnerBoolEvent.ThreadStorm, SpeedrunnerBoolEvent.RuneRage, SpeedrunnerBoolEvent.CrossStitch, SpeedrunnerBoolEvent.PaleNails })); speedrunnerEvents.DeriveInt(SpeedrunnerCountEventType.Melodies, new <>z__ReadOnlyArray(new SpeedrunnerBoolEvent[3] { SpeedrunnerBoolEvent.ArchitectsMelody, SpeedrunnerBoolEvent.ConductorsMelody, SpeedrunnerBoolEvent.VaultkeepersMelody })); speedrunnerEvents.DeriveInt(SpeedrunnerCountEventType.Hearts, new <>z__ReadOnlyArray(new SpeedrunnerBoolEvent[4] { SpeedrunnerBoolEvent.HuntersHeart, SpeedrunnerBoolEvent.EncrustedHeart, SpeedrunnerBoolEvent.EncrustedHeart, SpeedrunnerBoolEvent.ConjoinedHeart })); return speedrunnerEvents; } private void DeriveInt(SpeedrunnerCountEventType countType, IEnumerable boolEvents) { int num = boolEvents.Where(BoolEvents.Contains).Count(); ((HashMultiset)CountEvents).Add(countType, num); } } internal class SpeedrunnerEventsDelta : IDelta, IIdentifiedPacket, IPacketData, IIdentifiedPacket { public EnumSet BoolEvents = new EnumSet(); public List CountEvents = new List(); ClientPacketId IIdentifiedPacket.Identifier => ClientPacketId.SpeedrunnerEventsDelta; ServerPacketId IIdentifiedPacket.Identifier => ServerPacketId.SpeedrunnerEventsDelta; public bool Single => false; public bool IsReliable => true; public bool DropReliableDataIfNewerExists => false; public bool IsEmpty { get { if (BoolEvents.Count == 0) { return CountEvents.Count == 0; } return false; } } public void ReadData(IPacket packet) { BoolEvents.ReadData(packet); CountEvents.ReadData(packet); } public void WriteData(IPacket packet) { BoolEvents.WriteData(packet); ((IReadOnlyCollection)CountEvents).WriteData(packet); } } } namespace Silksong.TheHuntIsOn.Modules.ArchitectModule { internal class ArchitectLevelData : IIdentifiedPacket, IPacketData { public string ArchitectGroupId = ""; public string SceneName = ""; public string LevelData = ""; public SHA1Hash LevelDataHash = new SHA1Hash(); public ClientPacketId Identifier => ClientPacketId.ArchitectLevelData; public bool Single => false; public bool IsReliable => true; public bool DropReliableDataIfNewerExists => false; public void ReadData(IPacket packet) { ArchitectGroupId = packet.ReadString(); SceneName = packet.ReadString(); LevelData = packet.ReadString(); LevelDataHash.ReadData(packet); } public void WriteData(IPacket packet) { ArchitectGroupId.WriteData(packet); SceneName.WriteData(packet); LevelData.WriteData(packet); LevelDataHash.WriteData(packet); } } internal class ArchitectLevelMetadata : Dictionary, INetworkedCloneable, ICloneable, Silksong.TheHuntIsOn.Util.ICloneable, INetworkedCloneable, IWireInterface { public ArchitectLevelMetadata() { } public ArchitectLevelMetadata(IReadOnlyDictionary dict) : base((IEnumerable>)dict) { } public void ReadData(IPacket packet) { ((IDictionary)this).ReadData(packet, (Func)((IPacket packet) => packet.ReadString())); } public void WriteData(IPacket packet) { ((IReadOnlyDictionary)this).WriteData(packet, (Action)delegate(IPacket packet, string value) { value.WriteData(packet); }); } public ArchitectLevelMetadata Clone() { return new ArchitectLevelMetadata(this.CloneDictDeep()); } public INetworkedCloneable CloneRaw() { return Clone(); } Silksong.TheHuntIsOn.Util.ICloneable Silksong.TheHuntIsOn.Util.ICloneable.CloneRaw() { return Clone(); } public void Diff(ArchitectLevelMetadata target, Action updateLevel, Action deleteLevel) { Action updateLevel2 = updateLevel; Action deleteLevel2 = deleteLevel; CollectionUtil.Compare(this, target, delegate(string sceneName, SHA1Hash? myHash, SHA1Hash? targetHash) { if (targetHash != null) { if (myHash == null || !myHash.Equals(targetHash)) { updateLevel2(sceneName, targetHash); } } else if (myHash != null) { deleteLevel2(sceneName); } }); } } internal class ArchitectLevelsMetadata : Dictionary, INetworkedCloneable, ICloneable, Silksong.TheHuntIsOn.Util.ICloneable, INetworkedCloneable, IWireInterface, IIdentifiedPacket, IPacketData { ClientPacketId IIdentifiedPacket.Identifier => ClientPacketId.ArchitectLevelsMetadata; public bool Single => true; public bool IsReliable => true; public bool DropReliableDataIfNewerExists => true; public ArchitectLevelsMetadata() { } public ArchitectLevelsMetadata(IReadOnlyDictionary dict) : base((IEnumerable>)dict) { } public bool Contains(string groupId, string sceneName) { if (TryGetValue(groupId, out ArchitectLevelMetadata value)) { return value.ContainsKey(sceneName); } return false; } public bool TryGet(string groupId, string sceneName, out SHA1Hash hash) { if (TryGetValue(groupId, out ArchitectLevelMetadata value)) { return value.TryGetValue(sceneName, out hash); } hash = new SHA1Hash(); return false; } public void ReadData(IPacket packet) { ((IDictionary)this).ReadData(packet, (Func)((IPacket packet) => packet.ReadString())); } public void WriteData(IPacket packet) { ((IReadOnlyDictionary)this).WriteData(packet, (Action)delegate(IPacket packet, string value) { value.WriteData(packet); }); } public ArchitectLevelsMetadata Clone() { return new ArchitectLevelsMetadata(this.CloneDictDeep()); } public Silksong.TheHuntIsOn.Util.ICloneable CloneRaw() { return Clone(); } INetworkedCloneable INetworkedCloneable.CloneRaw() { return Clone(); } public void Diff(ArchitectLevelsMetadata target, Action deleteGroup, Action updateLevel, Action deleteLevel) { Action updateLevel2 = updateLevel; Action deleteLevel2 = deleteLevel; Action deleteGroup2 = deleteGroup; CollectionUtil.Compare(this, target, delegate(string groupId, ArchitectLevelMetadata? myGroup, ArchitectLevelMetadata? targetGroup) { if (targetGroup != null) { (myGroup ?? new ArchitectLevelMetadata()).Diff(targetGroup, delegate(string sceneName, SHA1Hash hash) { updateLevel2(groupId, sceneName, hash); }, delegate(string sceneName) { deleteLevel2(groupId, sceneName); }); } else if (myGroup != null) { deleteGroup2(groupId); } }); } } internal class ArchitectSettings : ModuleSettings { public HashSet EnabledGroups = new HashSet(); public override ModuleSettingsType DynamicType() { return ModuleSettingsType.Architect; } public override void ReadDynamicData(IPacket packet) { ((ICollection)EnabledGroups).ReadData(packet, (Func)((IPacket packet) => packet.ReadString())); } public override void WriteDynamicData(IPacket packet) { ((IReadOnlyCollection)EnabledGroups).WriteData(packet, (Action)delegate(IPacket packet, string value) { value.WriteData(packet); }); } protected override bool Equivalent(ArchitectSettings other) { if (EnabledGroups.Count == other.EnabledGroups.Count) { return EnabledGroups.All(other.EnabledGroups.Contains); } return false; } public override ModuleSettings Clone() { ArchitectSettings architectSettings = new ArchitectSettings(); ArchitectSettings architectSettings2 = architectSettings; HashSet hashSet = new HashSet(); foreach (string enabledGroup in EnabledGroups) { hashSet.Add(enabledGroup); } architectSettings2.EnabledGroups = hashSet; return architectSettings; } } internal class ArchitectModule : GlobalSettingsModule { internal const string NONE_GROUP = "None"; private readonly ClientArchitectLevelManager levelManager; public override string Name => "Architect"; public override ModuleActivationType ModuleActivationType => ModuleActivationType.AnyConfiguration; public ArchitectModule() { levelManager = new ClientArchitectLevelManager(() => (!Module.GetEnabledConfig(out var config)) ? ((IEnumerable)new HashSet()) : ((IEnumerable)config.EnabledGroups)); } protected override ArchitectModule Self() { return this; } internal static IEnumerable GetAllGroups() { return Module.Instance?.levelManager.GetAllGroups() ?? Array.Empty(); } } internal class ArchitectGroupSelectorModel : IChoiceModel, IValueModel, IBaseValueModel, IDisplayable, IBaseChoiceModel { [CompilerGenerated] private string k__BackingField = AllGroups()[0]; public string Value { [CompilerGenerated] get { return k__BackingField; } set { if (!(k__BackingField == value)) { k__BackingField = value; this.OnValueChanged?.Invoke(value); this.OnRawValueChanged?.Invoke(value); } } } public event Action? OnValueChanged; public event Action? OnRawValueChanged; private static List AllGroups() { List list = ArchitectModule.GetAllGroups().ToList(); if (list.Count == 0) { list.Add("None"); } return list; } public LocalizedText DisplayString() { return LocalizedText.op_Implicit(Value); } public string GetValue() { return Value; } private bool HandleOne(List all, out bool changed) { if (all.Count == 1) { changed = Value != all[0]; Value = all[0]; return true; } if (Value == "None") { Value = all[0]; changed = true; return true; } changed = false; return false; } public bool MoveLeft() { List list = AllGroups(); if (HandleOne(list, out var changed)) { return changed; } for (int i = 0; i < list.Count; i++) { if (list[i] == Value || list[i].CompareTo(Value) > 0) { Value = list[(i - 1 + list.Count) % list.Count]; return true; } } Value = list.Last(); return true; } internal void PickClosest() { List list = AllGroups(); if (!list.Contains(Value)) { MoveRight(list); } } internal bool MoveRight(List all) { if (HandleOne(all, out var changed)) { return changed; } for (int num = all.Count - 1; num >= 0; num--) { if (all[num] == Value || all[num].CompareTo(Value) < 0) { Value = all[(num + 1) % all.Count]; return true; } } Value = all.First(); return true; } public bool MoveRight() { return MoveRight(AllGroups()); } public bool SetValue(string value) { Value = value; return true; } } internal class ArchitectSettingsMenu : ICustomMenu, ICustomMenu { private readonly ArchitectGroupSelectorModel model; private readonly ChoiceElement GroupSelector; private readonly ChoiceElement Enabled; private readonly HashSet enabledGroups = new HashSet(); private readonly EventSuppressor updateEnabled = new EventSuppressor(); public event Action? OnValueChanged; private void UpdateEnabled() { using (updateEnabled.Suppress()) { ChoiceElement enabled = Enabled; if (enabled != null) { ((SelectableElement)enabled).Interactable = ((SelectableValueElement)(object)GroupSelector).Value != "None"; } ChoiceElement enabled2 = Enabled; if (enabled2 != null) { ((SelectableValueElement)(object)enabled2).Value = enabledGroups.Contains(((SelectableValueElement)(object)GroupSelector).Value); } } } public ArchitectSettingsMenu() { model = new ArchitectGroupSelectorModel(); GroupSelector = new ChoiceElement(LocalizedText.op_Implicit("Level Group"), (IChoiceModel)(object)model, LocalizedText.op_Implicit("Level group to enable/disable.")); ((SelectableValueElement)(object)GroupSelector).OnValueChanged += delegate { UpdateEnabled(); }; Enabled = new ChoiceElement(LocalizedText.op_Implicit("Enabled"), (IChoiceModel)(object)ChoiceModels.ForBool("No", "Yes")); ((SelectableValueElement)(object)Enabled).OnValueChanged += delegate(bool enabled) { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Expected O, but got Unknown if (!updateEnabled.Suppressed) { if (enabled) { enabledGroups.Add(((SelectableValueElement)(object)GroupSelector).Value); } else { enabledGroups.Remove(((SelectableValueElement)(object)GroupSelector).Value); } this.OnValueChanged?.Invoke(new CustomMenuValueChangedEvent("Enabled", (object)enabledGroups)); } }; } public void ApplyFrom(ArchitectSettings data) { enabledGroups.Clear(); foreach (string enabledGroup in data.EnabledGroups) { enabledGroups.Add(enabledGroup); } model.PickClosest(); UpdateEnabled(); } public void ExportTo(ArchitectSettings data) { HashSet hashSet = new HashSet(); foreach (string enabledGroup in enabledGroups) { hashSet.Add(enabledGroup); } data.EnabledGroups = hashSet; } public IEnumerable Elements() { return new <>z__ReadOnlyArray((MenuElement[])(object)new MenuElement[2] { (MenuElement)GroupSelector, (MenuElement)Enabled }); } } internal class ArchitectModuleServerAddon { private readonly HuntServerAddon serverAddon; private readonly ServerArchitectLevelManager levelManager = new ServerArchitectLevelManager(); private readonly ActionQueue actionQueue = new ActionQueue(); private void Enqueue(Action action) { actionQueue.Enqueue(action); } public ArchitectModuleServerAddon(HuntServerAddon serverAddon) { HuntServerAddon serverAddon2 = serverAddon; base..ctor(); ArchitectModuleServerAddon architectModuleServerAddon = this; this.serverAddon = serverAddon2; new Thread(actionQueue.Run).Start(); serverAddon2.OnUpdatePlayer += delegate(IServerPlayer player) { IServerPlayer player2 = player; architectModuleServerAddon.Enqueue(delegate { serverAddon2.SendToPlayer(player2, architectModuleServerAddon.levelManager.GetLevelsMetadata()); }); }; } internal void OnRequestArchitectLevelData(ushort id, RequestArchitectLevelData request) { RequestArchitectLevelData request2 = request; Enqueue(delegate { if (levelManager.TryGetLevelData(request2.ArchitectGroupId, request2.SceneName, out string levelData, out SHA1Hash hash)) { ArchitectLevelData data = new ArchitectLevelData { ArchitectGroupId = request2.ArchitectGroupId, SceneName = request2.SceneName, LevelData = levelData, LevelDataHash = hash }; serverAddon.SendToPlayer(id, data); } }); } internal void Refresh() { Enqueue(delegate { levelManager.UpdateDiskMetadata(); serverAddon.Broadcast(levelManager.GetLevelsMetadata()); }); } } internal abstract class BaseArchitectLevelManager { protected const string ARCHITECT_SUFFIX = ".architect.json"; protected const string EMBEDDED_PREFIX = "Silksong.TheHuntIsOn.Resources.Data.Architect."; protected readonly string diskFolder = Path.Join(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location).AsSpan(), ("Architect-" + diskFolderName).AsSpan()); protected BaseArchitectLevelManager(string diskFolderName) { } protected static ArchitectLevelsMetadata HashEmbedded() { ArchitectLevelsMetadata architectLevelsMetadata = new ArchitectLevelsMetadata(); string[] manifestResourceNames = Assembly.GetExecutingAssembly().GetManifestResourceNames(); foreach (string text in manifestResourceNames) { if (text.AsSpan().ConsumePrefix("Silksong.TheHuntIsOn.Resources.Data.Architect.".AsSpan(), out var suffix) && suffix.ConsumeSuffix(".architect.json".AsSpan(), out var prefix) && prefix.Split2('.', out var one, out var two)) { string key = new string(one); if (!architectLevelsMetadata.TryGetValue(key, out ArchitectLevelMetadata value)) { value = new ArchitectLevelMetadata(); architectLevelsMetadata.Add(key, value); } string key2 = new string(two); using Stream data = Assembly.GetExecutingAssembly().GetManifestResourceStream(text); value.Add(key2, SHA1Hash.Compute(data)); } } return architectLevelsMetadata; } protected string DiskGroupPath(string groupId) { return Path.Join(diskFolder.AsSpan(), groupId.AsSpan()); } protected string DiskLevelPath(string groupId, string sceneName) { return Path.Join(DiskGroupPath(groupId).AsSpan(), (sceneName + ".architect.json").AsSpan()); } protected static Stream EmbeddedLevelStream(string groupId, string sceneName) { return Assembly.GetExecutingAssembly().GetManifestResourceStream("Silksong.TheHuntIsOn.Resources.Data.Architect." + groupId + "." + sceneName + ".architect.json"); } } internal class ClientArchitectLevelManager : BaseArchitectLevelManager { private class DiskArchitectLevelMetadata { public readonly ArchitectLevelMetadata Metadata = new ArchitectLevelMetadata(); public readonly HashSet Tombstones = new HashSet(); public bool Contains(string sceneName) { if (!Tombstones.Contains(sceneName)) { return Metadata.ContainsKey(sceneName); } return false; } public void OverlayOnto(ArchitectLevelMetadata other) { foreach (KeyValuePair metadatum in Metadata) { other[metadatum.Key] = metadatum.Value; } foreach (string tombstone in Tombstones) { other.Remove(tombstone); } } } private class DiskArchitectLevelsMetadata { public readonly Dictionary Metadata = new Dictionary(); public readonly HashSet Tombstones = new HashSet(); public bool Contains(string groupId, string sceneName) { if (!Tombstones.Contains(groupId) && Metadata.TryGetValue(groupId, out DiskArchitectLevelMetadata value)) { return value.Contains(sceneName); } return false; } public bool ContainsTombstone(string groupId, string sceneName) { if (!Tombstones.Contains(groupId) && Metadata.TryGetValue(groupId, out DiskArchitectLevelMetadata value)) { return value.Tombstones.Contains(sceneName); } return false; } public void OverlayOnto(ArchitectLevelsMetadata other) { foreach (KeyValuePair metadatum in Metadata) { if (other.TryGetValue(metadatum.Key, out ArchitectLevelMetadata value)) { metadatum.Value.OverlayOnto(value); } else { other[metadatum.Key] = metadatum.Value.Metadata; } } foreach (string tombstone in Tombstones) { other.Remove(tombstone); } } } private const string TOMBSTONE_SUFFIX = ".tombstone"; private readonly ArchitectLevelsMetadata embeddedMetadata; private readonly DiskArchitectLevelsMetadata diskMetadata; private readonly Func> getEnabledGroups; private readonly LRUCache<(string, string), LevelData> levelDataCache; private DiskArchitectLevelsMetadata HashDisk() { DiskArchitectLevelsMetadata diskArchitectLevelsMetadata = new DiskArchitectLevelsMetadata(); if (!Directory.Exists(diskFolder)) { return diskArchitectLevelsMetadata; } foreach (string item in Directory.EnumerateDirectories(diskFolder)) { DiskArchitectLevelMetadata diskArchitectLevelMetadata = new DiskArchitectLevelMetadata(); diskArchitectLevelsMetadata.Metadata.Add(Path.GetFileName(item), diskArchitectLevelMetadata); foreach (string item2 in Directory.EnumerateFiles(item)) { string fileName = Path.GetFileName(item2); if (fileName.AsSpan().ConsumeSuffix(".tombstone".AsSpan(), out var prefix)) { diskArchitectLevelMetadata.Tombstones.Add(new string(prefix)); } else if (fileName.AsSpan().ConsumeSuffix(".architect.json".AsSpan(), out prefix)) { string key = new string(prefix); using FileStream data = File.OpenRead(item2); diskArchitectLevelMetadata.Metadata.Add(key, SHA1Hash.Compute(data)); } } } foreach (string item3 in Directory.EnumerateFiles(diskFolder)) { if (Path.GetFileName(item3).AsSpan().ConsumeSuffix(".tombstone".AsSpan(), out var prefix2)) { diskArchitectLevelsMetadata.Tombstones.Add(new string(prefix2)); } } return diskArchitectLevelsMetadata; } public ClientArchitectLevelManager(Func> getEnabledGroups) : base("Client") { embeddedMetadata = BaseArchitectLevelManager.HashEmbedded(); diskMetadata = HashDisk(); Reduce(); HuntClientAddon.On.Received += OnArchitectLevelsMetadata; HuntClientAddon.On.Received += OnArchitectLevelData; this.getEnabledGroups = getEnabledGroups; levelDataCache = new LRUCache<(string, string), LevelData>(10, LoadLevelData); MapLoader.AddMapLoader((Func)InjectLevelData); } private bool LoadLevelData((string, string) key, out LevelData levelData) { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Expected O, but got Unknown //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Expected O, but got Unknown var (text, sceneName) = key; if (diskMetadata.Tombstones.Contains(text) || diskMetadata.ContainsTombstone(text, sceneName)) { levelData = new LevelData(new List(), new List<(int, int)>(), new List(), new List()); return false; } if (diskMetadata.Contains(text, sceneName)) { string text2 = File.ReadAllText(DiskLevelPath(text, sceneName)); levelData = StorageManager.DeserializeLevel(text2); return true; } if (embeddedMetadata.Contains(text, sceneName)) { using (Stream stream = BaseArchitectLevelManager.EmbeddedLevelStream(text, sceneName)) { using StreamReader streamReader = new StreamReader(stream, Encoding.UTF8); levelData = StorageManager.DeserializeLevel(streamReader.ReadToEnd()); return true; } } levelData = new LevelData(new List(), new List<(int, int)>(), new List(), new List()); return false; } protected LevelData InjectLevelData(string sceneName) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown LevelData val = new LevelData(new List(), new List<(int, int)>(), new List(), new List()); foreach (string item in getEnabledGroups()) { if (levelDataCache.TryGetValue((item, sceneName), out LevelData value)) { val.Merge(value); } } return val; } private string GroupTombstonePath(string groupId) { return Path.Join(diskFolder.AsSpan(), (groupId + ".tombstone").AsSpan()); } private string LevelTombstonePath(string groupId, string sceneName) { return Path.Join(diskFolder.AsSpan(), groupId.AsSpan(), (sceneName + ".tombstone").AsSpan()); } private void FixTombstones() { foreach (string item in diskMetadata.Tombstones.ToList()) { if (diskMetadata.Metadata.ContainsKey(item)) { Directory.Delete(DiskGroupPath(item), recursive: true); diskMetadata.Metadata.Remove(item); } if (!embeddedMetadata.ContainsKey(item)) { File.Delete(GroupTombstonePath(item)); diskMetadata.Tombstones.Remove(item); } } foreach (KeyValuePair metadatum in diskMetadata.Metadata) { string key = metadatum.Key; metadatum.Value.Tombstones.ToList(); foreach (string tombstone in metadatum.Value.Tombstones) { if (metadatum.Value.Metadata.ContainsKey(tombstone)) { File.Delete(DiskLevelPath(key, tombstone)); metadatum.Value.Metadata.Remove(tombstone); } if (!embeddedMetadata.Contains(key, tombstone)) { File.Delete(LevelTombstonePath(key, tombstone)); metadatum.Value.Tombstones.Remove(tombstone); } } } } private void RemoveDupes() { List list = new List(); foreach (KeyValuePair metadatum in diskMetadata.Metadata) { string key = metadatum.Key; List list2 = new List(); foreach (KeyValuePair metadatum2 in metadatum.Value.Metadata) { string key2 = metadatum2.Key; if (embeddedMetadata.TryGet(key, key2, out SHA1Hash hash) && metadatum2.Value == hash) { list2.Add(key2); } } foreach (string item in list2) { File.Delete(DiskLevelPath(key, item)); metadatum.Value.Metadata.Remove(item); } if (metadatum.Value.Tombstones.Count == 0 && metadatum.Value.Metadata.Count == 0) { list.Add(key); } } foreach (string item2 in list) { Directory.Delete(DiskGroupPath(item2), recursive: true); diskMetadata.Metadata.Remove(item2); } } private void Reduce() { FixTombstones(); RemoveDupes(); } public ArchitectLevelsMetadata ComputeMetadata() { ArchitectLevelsMetadata architectLevelsMetadata = embeddedMetadata.Clone(); diskMetadata.OverlayOnto(architectLevelsMetadata); return architectLevelsMetadata; } private DiskArchitectLevelMetadata EnsureDiskGroup(string groupId) { if (diskMetadata.Tombstones.Contains(groupId)) { File.Delete(GroupTombstonePath(groupId)); diskMetadata.Tombstones.Remove(groupId); } if (!diskMetadata.Metadata.TryGetValue(groupId, out DiskArchitectLevelMetadata value)) { if (!Directory.Exists(diskFolder)) { Directory.CreateDirectory(diskFolder); } Directory.CreateDirectory(DiskGroupPath(groupId)); value = new DiskArchitectLevelMetadata(); diskMetadata.Metadata.Add(groupId, value); } return value; } private void DeleteGroup(string groupId) { if (diskMetadata.Metadata.ContainsKey(groupId)) { Directory.Delete(DiskGroupPath(groupId), recursive: true); diskMetadata.Metadata.Remove(groupId); } if (embeddedMetadata.ContainsKey(groupId) && diskMetadata.Tombstones.Add(groupId)) { File.Create(GroupTombstonePath(groupId)); } levelDataCache.Clear(); } public void OnArchitectLevelData(ArchitectLevelData update) { DiskArchitectLevelMetadata diskArchitectLevelMetadata = EnsureDiskGroup(update.ArchitectGroupId); string path = DiskLevelPath(update.ArchitectGroupId, update.SceneName); if (File.Exists(path)) { File.Delete(path); } File.WriteAllText(path, update.LevelData); diskArchitectLevelMetadata.Metadata[update.SceneName] = update.LevelDataHash; levelDataCache.Evict((update.ArchitectGroupId, update.SceneName)); } private void UpdateLevel(string groupId, string sceneName, SHA1Hash levelHash) { if (embeddedMetadata.TryGet(groupId, sceneName, out SHA1Hash hash) && hash.Equals(levelHash)) { RemoveDiskLevel(groupId, sceneName); return; } HuntClientAddon.Instance?.Send(new RequestArchitectLevelData { ArchitectGroupId = groupId, SceneName = sceneName }); } private void MakeTombstone(string groupId, string sceneName) { if (diskMetadata.Contains(groupId, sceneName)) { File.Delete(DiskLevelPath(groupId, sceneName)); diskMetadata.Metadata[groupId].Metadata.Remove(sceneName); } if (embeddedMetadata.Contains(groupId, sceneName) && !diskMetadata.ContainsTombstone(groupId, sceneName)) { EnsureDiskGroup(groupId).Tombstones.Add(sceneName); File.Create(LevelTombstonePath(groupId, sceneName)); } levelDataCache.Evict((groupId, sceneName)); } private void RemoveDiskLevel(string groupId, string sceneName) { if (diskMetadata.Contains(groupId, sceneName)) { File.Delete(DiskLevelPath(groupId, sceneName)); diskMetadata.Metadata[groupId].Metadata.Remove(sceneName); levelDataCache.Evict((groupId, sceneName)); } } private void DeleteLevel(string groupId, string sceneName) { if (embeddedMetadata.Contains(groupId, sceneName)) { MakeTombstone(groupId, sceneName); } else { RemoveDiskLevel(groupId, sceneName); } } public void OnArchitectLevelsMetadata(ArchitectLevelsMetadata metadata) { ComputeMetadata().Diff(metadata, DeleteGroup, UpdateLevel, DeleteLevel); } public IEnumerable GetAllGroups() { HashSet hashSet = new HashSet(); foreach (string item in embeddedMetadata.Keys.Concat(diskMetadata.Metadata.Keys).Distinct()) { hashSet.Add(item); } HashSet hashSet2 = hashSet; foreach (string tombstone in diskMetadata.Tombstones) { hashSet2.Remove(tombstone); } List list = new List(); list.AddRange(hashSet2.OrderBy((string n) => n)); return new <>z__ReadOnlyList(list); } } internal class RequestArchitectLevelData : IIdentifiedPacket, IPacketData { public string ArchitectGroupId = ""; public string SceneName = ""; public ServerPacketId Identifier => ServerPacketId.RequestArchitectLevelData; public bool Single => false; public bool IsReliable => true; public bool DropReliableDataIfNewerExists => false; public void ReadData(IPacket packet) { ArchitectGroupId = packet.ReadString(); SceneName = packet.ReadString(); } public void WriteData(IPacket packet) { ArchitectGroupId.WriteData(packet); SceneName.WriteData(packet); } } internal class ServerArchitectLevelManager : BaseArchitectLevelManager { private readonly ArchitectLevelsMetadata embeddedMetadata; private ArchitectLevelsMetadata diskMetadata; private ArchitectLevelsMetadata overlayMetadata; private readonly LRUCache<(string, string), (string, SHA1Hash)> levelDataCache; private ArchitectLevelsMetadata HashDisk() { ArchitectLevelsMetadata architectLevelsMetadata = new ArchitectLevelsMetadata(); if (!Directory.Exists(diskFolder)) { return architectLevelsMetadata; } foreach (string item in Directory.EnumerateDirectories(diskFolder)) { ArchitectLevelMetadata architectLevelMetadata = new ArchitectLevelMetadata(); architectLevelsMetadata.Add(Path.GetFileName(item), architectLevelMetadata); foreach (string item2 in Directory.EnumerateFiles(item)) { if (Path.GetFileName(item2).AsSpan().ConsumeSuffix(".architect.json".AsSpan(), out var prefix)) { string key = new string(prefix); using FileStream data = File.OpenRead(item2); architectLevelMetadata.Add(key, SHA1Hash.Compute(data)); } } } return architectLevelsMetadata; } public ServerArchitectLevelManager() : base("Server") { embeddedMetadata = BaseArchitectLevelManager.HashEmbedded(); levelDataCache = new LRUCache<(string, string), (string, SHA1Hash)>(100, LoadLevelData); diskMetadata = new ArchitectLevelsMetadata(); overlayMetadata = new ArchitectLevelsMetadata(); UpdateDiskMetadata(); } private bool LoadLevelData((string, string) key, out (string, SHA1Hash) value) { var (text, text2) = key; SHA1Hash hash; if (diskMetadata.TryGetValue(text, out ArchitectLevelMetadata value2)) { if (value2.TryGetValue(text2, out SHA1Hash value3)) { value = (File.ReadAllText(DiskLevelPath(text, text2)), value3); return true; } } else if (embeddedMetadata.TryGet(text, text2, out hash)) { using (Stream stream = BaseArchitectLevelManager.EmbeddedLevelStream(text, text2)) { using StreamReader streamReader = new StreamReader(stream, Encoding.UTF8); value = (streamReader.ReadToEnd(), hash); return true; } } value = ("", new SHA1Hash()); return false; } internal void UpdateDiskMetadata() { diskMetadata = HashDisk(); overlayMetadata = embeddedMetadata.Clone(); foreach (KeyValuePair diskMetadatum in diskMetadata) { overlayMetadata[diskMetadatum.Key] = diskMetadatum.Value; } } internal ArchitectLevelsMetadata GetLevelsMetadata() { return overlayMetadata; } internal bool TryGetLevelData(string groupId, string sceneName, out string levelData, out SHA1Hash hash) { if (levelDataCache.TryGetValue((groupId, sceneName), out (string, SHA1Hash) value)) { (levelData, hash) = value; return true; } levelData = ""; hash = new SHA1Hash(); return false; } } } namespace Silksong.TheHuntIsOn.Menu { public class EmptySettingsMenu : ICustomMenu, ICustomMenu { public event Action? OnValueChanged; public void ApplyFrom(EmptySettings data) { } public void ExportTo(EmptySettings data) { } public IEnumerable Elements() { return Array.Empty(); } } internal class GlobalSaveDataMenu { private readonly ChoiceElement Enabled = new ChoiceElement(LocalizedText.op_Implicit("Enable"), (IChoiceModel)(object)ChoiceModels.ForBool("No", "Yes"), LocalizedText.op_Implicit("Enabled this mod.")); private readonly ChoiceElement Role = new ChoiceElement(LocalizedText.op_Implicit("Role"), (IChoiceModel)(object)ChoiceModels.ForEnum(), LocalizedText.op_Implicit("Team to play on.")); private readonly Dictionary ModuleMultiMenus = new Dictionary(); private readonly ModuleDataset currentModuleDataset; private readonly EventSuppressor saveDataChanged = new EventSuppressor(); public event Action? OnGlobalSaveDataChanged; internal GlobalSaveDataMenu(GlobalSaveData globalSaveData, IEnumerable modules) { currentModuleDataset = globalSaveData.ModuleDataset.Clone(); foreach (ModuleBase module in modules) { ModuleBase localModule = module; ModuleMultiMenu menu = new ModuleMultiMenu(module); menu.Apply(globalSaveData.ModuleDataset.TryGetValue(module.Name, out ModuleData value) ? value : new ModuleData()); menu.OnUpdateData += delegate { if (!HuntClientAddon.IsConnected && !saveDataChanged.Suppressed) { currentModuleDataset[localModule.Name] = menu.Export(); this.OnGlobalSaveDataChanged?.Invoke(Export()); } }; ModuleMultiMenus[module.Name] = menu; } ((SelectableValueElement)(object)Enabled).Value = globalSaveData.Enabled; ((SelectableValueElement)(object)Enabled).OnValueChanged += delegate { InvokeSaveDataChanged(); }; ((SelectableValueElement)(object)Role).Value = globalSaveData.Role; ((SelectableValueElement)(object)Role).OnValueChanged += delegate { InvokeSaveDataChanged(); }; } private void InvokeSaveDataChanged() { if (!saveDataChanged.Suppressed) { this.OnGlobalSaveDataChanged?.Invoke(Export()); } } public void AppendTo(SimpleMenuScreen screen) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Expected O, but got Unknown //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Expected O, but got Unknown //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Expected O, but got Unknown screen.Add((MenuElement)(object)Enabled); screen.Add((MenuElement)(object)Role); PaginatedMenuScreenBuilder val = new PaginatedMenuScreenBuilder(LocalizedText.op_Implicit("The Hunt is On - Modules"), 8); val.AddRange(from e in ModuleMultiMenus orderby e.Key select e.Value.RootElement); PaginatedMenuScreen modulesScreen = val.Build(); TextButton val2 = new TextButton(LocalizedText.op_Implicit("Modules")); val2.OnSubmit = (Action)Delegate.Combine(val2.OnSubmit, (Action)delegate { MenuScreenNavigation.Show((AbstractMenuScreen)(object)modulesScreen, (HistoryMode)0); }); screen.Add((MenuElement)(object)val2); TextButton applyButton = new TextButton(LocalizedText.op_Implicit("Send Module Settings")); ((MenuElement)applyButton).Container.DoOnUpdate(delegate { ((SelectableElement)applyButton).Interactable = HuntClientAddon.IsConnected; }); TextButton obj = applyButton; obj.OnSubmit = (Action)Delegate.Combine(obj.OnSubmit, (Action)delegate { ModuleDataset moduleDataset = new ModuleDataset(); foreach (KeyValuePair moduleMultiMenu in ModuleMultiMenus) { moduleDataset[moduleMultiMenu.Key] = moduleMultiMenu.Value.Export(); } HuntClientAddon.Instance?.Send(moduleDataset); }); screen.Add((MenuElement)(object)applyButton); TextButton revertButton = new TextButton(LocalizedText.op_Implicit("Revert Module Settings")); ((MenuElement)revertButton).Container.DoOnUpdate(delegate { ((SelectableElement)revertButton).Interactable = HuntClientAddon.IsConnected; }); TextButton obj2 = revertButton; obj2.OnSubmit = (Action)Delegate.Combine(obj2.OnSubmit, (Action)delegate { Apply(Export()); }); screen.Add((MenuElement)(object)revertButton); } public void Apply(GlobalSaveData globalSaveData) { using (saveDataChanged.Suppress()) { ((SelectableValueElement)(object)Enabled).Value = globalSaveData.Enabled; ((SelectableValueElement)(object)Role).Value = globalSaveData.Role; currentModuleDataset.Clear(); foreach (var (key, moduleData2) in globalSaveData.ModuleDataset) { currentModuleDataset.Add(key, moduleData2); if (ModuleMultiMenus.TryGetValue(key, out ModuleMultiMenu value)) { value.Apply(moduleData2); } } } } private GlobalSaveData Export() { return new GlobalSaveData { Enabled = ((SelectableValueElement)(object)Enabled).Value, Role = ((SelectableValueElement)(object)Role).Value, ModuleDataset = currentModuleDataset.Clone() }; } } internal interface IModuleMenu { event Action? OnValueChanged; IEnumerable Elements(); void ApplyRaw(ModuleSettings? settings); ModuleSettings ExportRaw(); } internal class ModuleMenu : IModuleMenu where T : ModuleSettings, new() { public readonly ICustomMenu menu; public event Action? OnValueChanged; public ModuleMenu(ICustomMenu menu) { this.menu = menu; menu.OnValueChanged += delegate { this.OnValueChanged?.Invoke(); }; } public void ApplyRaw(ModuleSettings? settings) { if (settings is T val) { menu.ApplyFrom(val); } } public ModuleSettings ExportRaw() { T val = new T(); menu.ExportTo(val); return val; } public IEnumerable Elements() { return menu.Elements(); } } internal class ModuleMultiMenu { public readonly MenuElement RootElement; private readonly ChoiceElement ModuleActivation; private readonly IModuleMenu mainMenu; private readonly List mainElements = new List(); private readonly IModuleMenu? speedrunnersSubMenu; private readonly TextButton? speedrunnersSubMenuButton; private readonly IModuleMenu? huntersSubMenu; private readonly TextButton? huntersSubMenuButton; private ModuleSettings? speedrunnersMenuData; private ModuleSettings? huntersMenuData; private ModuleSettings? everyoneMenuData; private readonly EventSuppressor updateData = new EventSuppressor(); internal event Action? OnUpdateData; private static (IChoiceModel, string) GetChoiceModel(ModuleBase module) { (ListChoiceModel, string) tuple = module.ModuleActivationType switch { ModuleActivationType.OnOffOnly => (ChoiceModels.ForNamedValues((IEnumerable>)new <>z__ReadOnlyArray<(ModuleActivation, string)>(new(ModuleActivation, string)[2] { (Silksong.TheHuntIsOn.Modules.Lib.ModuleActivation.Inactive, "Inactive"), (Silksong.TheHuntIsOn.Modules.Lib.ModuleActivation.EveryoneSame, "Active") })), "Whether this module should be active or not."), ModuleActivationType.AnyConfiguration => (ChoiceModels.ForEnum(), "Which teams this module should be enabled for."), _ => throw new ArgumentException($"Unsupported enum: {module.ModuleActivationType}"), }; return ((IChoiceModel)(object)tuple.Item1, tuple.Item2); } internal ModuleMultiMenu(ModuleBase module) { //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Expected O, but got Unknown //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Expected O, but got Unknown //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Expected O, but got Unknown mainMenu = module.CreateGlobalDataSubMenu(); mainMenu.OnValueChanged += UpdateData; List list = mainMenu.Elements().ToList(); var (val, text) = GetChoiceModel(module); if (list.Count == 0) { ModuleActivation = new ChoiceElement(LocalizedText.op_Implicit(module.Name + " Module"), val, LocalizedText.op_Implicit(text)); RootElement = (MenuElement)(object)ModuleActivation; } else { ModuleActivation = new ChoiceElement(LocalizedText.op_Implicit("Activation"), val, LocalizedText.op_Implicit(text)); SimpleMenuScreen subScreen = new SimpleMenuScreen(module.Name + " Module"); subScreen.Add((MenuElement)(object)ModuleActivation); if (list.Count <= 5) { mainElements.AddRange(list); } else { PaginatedMenuScreenBuilder val2 = new PaginatedMenuScreenBuilder(LocalizedText.op_Implicit(module.Name + " Module Settings"), 8); val2.AddRange((IEnumerable)list); PaginatedMenuScreen screen = val2.Build(); TextButton val3 = new TextButton(LocalizedText.op_Implicit("Module Settings")); val3.OnSubmit = (Action)Delegate.Combine(val3.OnSubmit, (Action)delegate { MenuScreenNavigation.Show((AbstractMenuScreen)(object)screen, (HistoryMode)0); }); mainElements.Add((MenuElement)(object)val3); } subScreen.AddRange((IEnumerable)mainElements); speedrunnersSubMenu = module.CreateGlobalDataSubMenu(); speedrunnersSubMenu.OnValueChanged += UpdateData; speedrunnersSubMenuButton = CreateRoleSpecificMenuButton(module.Name, "Speedrunner", speedrunnersSubMenu); subScreen.Add((MenuElement)(object)speedrunnersSubMenuButton); huntersSubMenu = module.CreateGlobalDataSubMenu(); huntersSubMenu.OnValueChanged += UpdateData; huntersSubMenuButton = CreateRoleSpecificMenuButton(module.Name, "Hunter", huntersSubMenu); subScreen.Add((MenuElement)(object)huntersSubMenuButton); TextButton val4 = new TextButton(LocalizedText.op_Implicit(module.Name + " Module")); val4.OnSubmit = (Action)Delegate.Combine(val4.OnSubmit, (Action)delegate { MenuScreenNavigation.Show((AbstractMenuScreen)(object)subScreen, (HistoryMode)0); }); RootElement = (MenuElement)(object)val4; } ((SelectableValueElement)(object)ModuleActivation).OnValueChanged += UpdateModuleActivation; } private void UpdateData() { if (!updateData.Suppressed) { switch (((SelectableValueElement)(object)ModuleActivation).Value) { case Silksong.TheHuntIsOn.Modules.Lib.ModuleActivation.SpeedrunnerOnly: speedrunnersMenuData = mainMenu.ExportRaw(); break; case Silksong.TheHuntIsOn.Modules.Lib.ModuleActivation.HuntersOnly: huntersMenuData = mainMenu.ExportRaw(); break; case Silksong.TheHuntIsOn.Modules.Lib.ModuleActivation.EveryoneSame: everyoneMenuData = mainMenu.ExportRaw(); break; case Silksong.TheHuntIsOn.Modules.Lib.ModuleActivation.EveryoneDifferent: speedrunnersMenuData = speedrunnersSubMenu?.ExportRaw(); huntersMenuData = huntersSubMenu?.ExportRaw(); break; } this.OnUpdateData?.Invoke(); } } private void UpdateModuleActivation(ModuleActivation value) { bool flag = value != 0 && value != Silksong.TheHuntIsOn.Modules.Lib.ModuleActivation.EveryoneDifferent; foreach (MenuElement mainElement in mainElements) { IMenuEntityExtensions[(IMenuEntity)(object)mainElement] = flag; } bool flag2 = value == Silksong.TheHuntIsOn.Modules.Lib.ModuleActivation.EveryoneDifferent; TextButton? obj = speedrunnersSubMenuButton; if (obj != null) { IMenuEntityExtensions[(IMenuEntity)(object)obj] = flag2; } TextButton? obj2 = huntersSubMenuButton; if (obj2 != null) { IMenuEntityExtensions[(IMenuEntity)(object)obj2] = flag2; } using (updateData.Suppress()) { speedrunnersSubMenu?.ApplyRaw(speedrunnersMenuData); huntersSubMenu?.ApplyRaw(huntersMenuData); switch (value) { case Silksong.TheHuntIsOn.Modules.Lib.ModuleActivation.SpeedrunnerOnly: mainMenu.ApplyRaw(speedrunnersMenuData); break; case Silksong.TheHuntIsOn.Modules.Lib.ModuleActivation.HuntersOnly: mainMenu.ApplyRaw(huntersMenuData); break; default: mainMenu.ApplyRaw(everyoneMenuData); break; } } this.OnUpdateData?.Invoke(); } internal void Apply(ModuleData data) { speedrunnersMenuData = data.SpeedrunnerSettings; huntersMenuData = data.HunterSettings; everyoneMenuData = data.EveryoneSettings; ((SelectableValueElement)(object)ModuleActivation).Value = data.ModuleActivation; UpdateModuleActivation(((SelectableValueElement)(object)ModuleActivation).Value); } internal ModuleData Export() { return new ModuleData(((SelectableValueElement)(object)ModuleActivation).Value, speedrunnersMenuData, huntersMenuData, everyoneMenuData); } private static TextButton CreateRoleSpecificMenuButton(string moduleName, string teamName, IModuleMenu subMenu) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Expected O, but got Unknown //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Expected O, but got Unknown TextButton val = new TextButton(LocalizedText.op_Implicit(teamName + " Settings")); SimpleMenuScreen screen = new SimpleMenuScreen(moduleName + " " + teamName + " Settings"); screen.AddRange(subMenu.Elements()); val.OnSubmit = (Action)Delegate.Combine(val.OnSubmit, (Action)delegate { MenuScreenNavigation.Show((AbstractMenuScreen)(object)screen, (HistoryMode)0); }); return val; } } }