Decompiled source of helltime v1.2.5
BepInEx/plugins/2018-LC_API/LC_API.dll
Decompiled 11 months ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Concurrent; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using GameNetcodeStuff; using HarmonyLib; using LC_API.BundleAPI; using LC_API.ClientAPI; using LC_API.Comp; using LC_API.Data; using LC_API.Exceptions; using LC_API.Extensions; using LC_API.GameInterfaceAPI; using LC_API.GameInterfaceAPI.Events; using LC_API.GameInterfaceAPI.Events.Cache; using LC_API.GameInterfaceAPI.Events.EventArgs.Player; using LC_API.GameInterfaceAPI.Events.Handlers; using LC_API.GameInterfaceAPI.Features; using LC_API.ManualPatches; using LC_API.ServerAPI; using Microsoft.CodeAnalysis; using Steamworks; using Steamworks.Data; using TMPro; using Unity.Netcode; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.InputSystem; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETFramework,Version=v4.6", FrameworkDisplayName = ".NET Framework 4.6")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: AssemblyCompany("LC_API")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyDescription("Utilities for plugin devs")] [assembly: AssemblyFileVersion("3.1.0.0")] [assembly: AssemblyInformationalVersion("3.1.0")] [assembly: AssemblyProduct("Lethal Company API")] [assembly: AssemblyTitle("LC_API")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("3.1.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] internal class <Module> { static <Module>() { } } namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [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 LC_API { internal static class CheatDatabase { private const string DAT_CD_BROADCAST = "LC_API_CD_Broadcast"; private const string SIG_REQ_GUID = "LC_API_ReqGUID"; private const string SIG_SEND_MODS = "LC_APISendMods"; private static Dictionary<string, PluginInfo> PluginsLoaded = new Dictionary<string, PluginInfo>(); public static void RunLocalCheatDetector() { PluginsLoaded = Chainloader.PluginInfos; using Dictionary<string, PluginInfo>.ValueCollection.Enumerator enumerator = PluginsLoaded.Values.GetEnumerator(); while (enumerator.MoveNext()) { switch (enumerator.Current.Metadata.GUID) { case "mikes.lethalcompany.mikestweaks": case "mom.llama.enhancer": case "Posiedon.GameMaster": case "LethalCompanyScalingMaster": case "verity.amberalert": ModdedServer.SetServerModdedOnly(); break; } } } public static void OtherPlayerCheatDetector() { Plugin.Log.LogWarning((object)"Asking all other players for their mod list.."); GameTips.ShowTip("Mod List:", "Asking all other players for installed mods.."); GameTips.ShowTip("Mod List:", "Check the logs for more detailed results.\n<size=13>(Note that if someone doesnt show up on the list, they may not have LC_API installed)</size>"); Networking.Broadcast("LC_API_CD_Broadcast", "LC_API_ReqGUID"); } internal static void CDNetGetString(string data, string signature) { if (data == "LC_API_CD_Broadcast" && signature == "LC_API_ReqGUID") { string text = ""; foreach (PluginInfo value in PluginsLoaded.Values) { text = text + "\n" + value.Metadata.GUID; } Networking.Broadcast(GameNetworkManager.Instance.localPlayerController.playerUsername + " responded with these mods:" + text, "LC_APISendMods"); } if (signature == "LC_APISendMods") { GameTips.ShowTip("Mod List:", data); Plugin.Log.LogWarning((object)data); } } } [BepInPlugin("LC_API", "Lethal Company API", "3.1.0")] public sealed class Plugin : BaseUnityPlugin { internal static ManualLogSource Log; private ConfigEntry<bool> configOverrideModServer; private ConfigEntry<bool> configLegacyAssetLoading; private ConfigEntry<bool> configDisableBundleLoader; public static bool Initialized { get; private set; } private void Awake() { //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Expected O, but got Unknown //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Expected O, but got Unknown //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Expected O, but got Unknown //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Expected O, but got Unknown //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Expected O, but got Unknown //IL_0299: Expected O, but got Unknown configOverrideModServer = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Force modded server browser", false, "Should the API force you into the modded server browser?"); configLegacyAssetLoading = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Legacy asset bundle loading", false, "Should the BundleLoader use legacy asset loading? Turning this on may help with loading assets from older plugins."); configDisableBundleLoader = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Disable BundleLoader", false, "Should the BundleLoader be turned off? Enable this if you are having problems with mods that load assets using a different method from LC_API's BundleLoader."); CommandHandler.commandPrefix = ((BaseUnityPlugin)this).Config.Bind<string>("General", "Prefix", "/", "Command prefix"); Log = ((BaseUnityPlugin)this).Logger; ((BaseUnityPlugin)this).Logger.LogWarning((object)"\n.____ _________ _____ __________ .___ \r\n| | \\_ ___ \\ / _ \\ \\______ \\| | \r\n| | / \\ \\/ / /_\\ \\ | ___/| | \r\n| |___\\ \\____ / | \\| | | | \r\n|_______ \\\\______ /______\\____|__ /|____| |___| \r\n \\/ \\//_____/ \\/ \r\n "); ((BaseUnityPlugin)this).Logger.LogInfo((object)"LC_API Starting up.."); if (configOverrideModServer.Value) { ModdedServer.SetServerModdedOnly(); } Harmony val = new Harmony("ModAPI"); MethodInfo methodInfo = AccessTools.Method(typeof(GameNetworkManager), "SteamMatchmaking_OnLobbyCreated", (Type[])null, (Type[])null); AccessTools.Method(typeof(GameNetworkManager), "LobbyDataIsJoinable", (Type[])null, (Type[])null); MethodInfo methodInfo2 = AccessTools.Method(typeof(ServerPatch), "OnLobbyCreate", (Type[])null, (Type[])null); MethodInfo methodInfo3 = AccessTools.Method(typeof(MenuManager), "Awake", (Type[])null, (Type[])null); MethodInfo methodInfo4 = AccessTools.Method(typeof(ServerPatch), "CacheMenuManager", (Type[])null, (Type[])null); MethodInfo methodInfo5 = AccessTools.Method(typeof(HUDManager), "AddChatMessage", (Type[])null, (Type[])null); MethodInfo methodInfo6 = AccessTools.Method(typeof(ServerPatch), "ChatInterpreter", (Type[])null, (Type[])null); MethodInfo methodInfo7 = AccessTools.Method(typeof(HUDManager), "SubmitChat_performed", (Type[])null, (Type[])null); MethodInfo methodInfo8 = AccessTools.Method(typeof(CommandHandler.SubmitChatPatch), "Transpiler", (Type[])null, (Type[])null); MethodInfo methodInfo9 = AccessTools.Method(typeof(GameNetworkManager), "Awake", (Type[])null, (Type[])null); MethodInfo methodInfo10 = AccessTools.Method(typeof(ServerPatch), "GameNetworkManagerAwake", (Type[])null, (Type[])null); val.Patch((MethodBase)methodInfo3, new HarmonyMethod(methodInfo4), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); val.Patch((MethodBase)methodInfo5, new HarmonyMethod(methodInfo6), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); val.Patch((MethodBase)methodInfo, new HarmonyMethod(methodInfo2), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); val.Patch((MethodBase)methodInfo7, (HarmonyMethod)null, (HarmonyMethod)null, new HarmonyMethod(methodInfo8), (HarmonyMethod)null, (HarmonyMethod)null); val.Patch((MethodBase)methodInfo9, new HarmonyMethod(methodInfo10), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); Networking.GetString = (Action<string, string>)Delegate.Combine(Networking.GetString, new Action<string, string>(CheatDatabase.CDNetGetString)); Networking.GetListString = (Action<List<string>, string>)Delegate.Combine(Networking.GetListString, new Action<List<string>, string>(Networking.LCAPI_NET_SYNCVAR_SET)); Networking.SetupNetworking(); Events.Patch(val); } internal void Start() { Initialize(); } internal void OnDestroy() { Initialize(); } internal void Initialize() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown if (!Initialized) { Initialized = true; if (!configDisableBundleLoader.Value) { BundleLoader.Load(configLegacyAssetLoading.Value); } GameObject val = new GameObject("API"); Object.DontDestroyOnLoad((Object)val); val.AddComponent<LC_APIManager>(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"LC_API Started!"); CheatDatabase.RunLocalCheatDetector(); } } internal static void PatchMethodManual(MethodInfo method, MethodInfo patch, Harmony harmony) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown harmony.Patch((MethodBase)method, new HarmonyMethod(patch), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } } public static class Utils { public static string ReplaceWithCase(this string input, string toReplace, string replacement) { Dictionary<string, string> map = new Dictionary<string, string> { { toReplace, replacement } }; return input.ReplaceWithCase(map); } public static string ReplaceWithCase(this string input, Dictionary<string, string> map) { string text = input; foreach (KeyValuePair<string, string> item in map) { string key = item.Key; string value = item.Value; text = Regex.Replace(text, key, delegate(Match match) { string value2 = match.Value; char[] array = value2.ToCharArray(); string[] source = value2.Split(new char[1] { ' ' }); bool flag = char.IsUpper(array[0]); bool flag2 = source.All((string w) => char.IsUpper(w[0]) || !char.IsLetter(w[0])); if (array.All((char c) => char.IsUpper(c) || !char.IsLetter(c))) { return value.ToUpper(); } if (flag2) { return Regex.Replace(value, "\\b\\w", (Match charMatch) => charMatch.Value.ToUpper()); } char[] array2 = value.ToCharArray(); array2[0] = (flag ? char.ToUpper(array2[0]) : char.ToLower(array2[0])); return new string(array2); }, RegexOptions.IgnoreCase); } return text; } } public static class MyPluginInfo { public const string PLUGIN_GUID = "LC_API"; public const string PLUGIN_NAME = "Lethal Company API"; public const string PLUGIN_VERSION = "3.1.0"; } } namespace LC_API.ServerAPI { public static class ModdedServer { private static bool moddedOnly; [Obsolete("Use SetServerModdedOnly() instead. This will be removed/private in a future update.")] public static bool setModdedOnly; public static int GameVersion { get; internal set; } public static bool ModdedOnly => moddedOnly; public static void SetServerModdedOnly() { moddedOnly = true; Plugin.Log.LogMessage((object)"A plugin has set your game to only allow you to play with other people who have mods!"); } public static void OnSceneLoaded() { if (Object.op_Implicit((Object)(object)GameNetworkManager.Instance) && ModdedOnly) { GameNetworkManager instance = GameNetworkManager.Instance; instance.gameVersionNum += 16440; setModdedOnly = true; } } } public static class Networking { public static Action<string, string> GetString = delegate { }; public static Action<List<string>, string> GetListString = delegate { }; public static Action<int, string> GetInt = delegate { }; public static Action<float, string> GetFloat = delegate { }; public static Action<Vector3, string> GetVector3 = delegate { }; private static Dictionary<string, string> syncStringVars = new Dictionary<string, string>(); public static void Broadcast(string data, string signature) { if (data.Contains("/")) { Plugin.Log.LogError((object)"Invalid character in broadcasted string event! ( / )"); return; } HUDManager.Instance.AddTextToChatOnServer("<size=0>NWE/" + data + "/" + signature + "/" + NetworkBroadcastDataType.BDstring.ToString() + "/" + GameNetworkManager.Instance.localPlayerController.playerClientId + "/</size>", -1); } public static void Broadcast(List<string> data, string signature) { string text = ""; foreach (string datum in data) { if (datum.Contains("/")) { Plugin.Log.LogError((object)"Invalid character in broadcasted string event! ( / )"); return; } if (datum.Contains("\n")) { Plugin.Log.LogError((object)"Invalid character in broadcasted string event! ( NewLine )"); return; } text = text + datum + "\n"; } HUDManager.Instance.AddTextToChatOnServer("<size=0>NWE/" + data?.ToString() + "/" + signature + "/" + NetworkBroadcastDataType.BDlistString.ToString() + "/" + GameNetworkManager.Instance.localPlayerController.playerClientId + "/</size>", -1); } public static void Broadcast(int data, string signature) { HUDManager.Instance.AddTextToChatOnServer("<size=0>NWE/" + data + "/" + signature + "/" + NetworkBroadcastDataType.BDint.ToString() + "/" + GameNetworkManager.Instance.localPlayerController.playerClientId + "/</size>", -1); } public static void Broadcast(float data, string signature) { HUDManager.Instance.AddTextToChatOnServer("<size=0>NWE/" + data + "/" + signature + "/" + NetworkBroadcastDataType.BDfloat.ToString() + "/" + GameNetworkManager.Instance.localPlayerController.playerClientId + "/</size>", -1); } public static void Broadcast(Vector3 data, string signature) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) HUDManager instance = HUDManager.Instance; string[] obj = new string[9] { "<size=0>NWE/", null, null, null, null, null, null, null, null }; Vector3 val = data; obj[1] = ((object)(Vector3)(ref val)).ToString(); obj[2] = "/"; obj[3] = signature; obj[4] = "/"; obj[5] = NetworkBroadcastDataType.BDvector3.ToString(); obj[6] = "/"; obj[7] = GameNetworkManager.Instance.localPlayerController.playerClientId.ToString(); obj[8] = "/</size>"; instance.AddTextToChatOnServer(string.Concat(obj), -1); } public static void RegisterSyncVariable(string name) { if (!syncStringVars.ContainsKey(name)) { syncStringVars.Add(name, ""); } else { Plugin.Log.LogError((object)("Cannot register Sync Variable! A Sync Variable has already been registered with name " + name)); } } public static void SetSyncVariable(string name, string value) { if (syncStringVars.ContainsKey(name)) { syncStringVars[name] = value; Broadcast(new List<string> { name, value }, "LCAPI_NET_SYNCVAR_SET"); } else { Plugin.Log.LogError((object)("Cannot set the value of Sync Variable " + name + " as it is not registered!")); } } private static void SetSyncVariableB(string name, string value) { if (syncStringVars.ContainsKey(name)) { syncStringVars[name] = value; } else { Plugin.Log.LogError((object)("Cannot set the value of Sync Variable " + name + " as it is not registered!")); } } internal static void LCAPI_NET_SYNCVAR_SET(List<string> list, string arg2) { if (arg2 == "LCAPI_NET_SYNCVAR_SET") { SetSyncVariableB(list[0], list[1]); } } public static string GetSyncVariable(string name) { if (syncStringVars.ContainsKey(name)) { return syncStringVars[name]; } Plugin.Log.LogError((object)("Cannot get the value of Sync Variable " + name + " as it is not registered!")); return ""; } private static void GotString(string data, string signature) { } private static void GotInt(int data, string signature) { } private static void GotFloat(float data, string signature) { } private static void GotVector3(Vector3 data, string signature) { } internal static void SetupNetworking() { Type[] types = Assembly.GetExecutingAssembly().GetTypes(); for (int i = 0; i < types.Length; i++) { MethodInfo[] methods = types[i].GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); foreach (MethodInfo methodInfo in methods) { if (methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false).Length != 0) { methodInfo.Invoke(null, null); } } } } } } namespace LC_API.ManualPatches { internal static class ServerPatch { internal static bool OnLobbyCreate(GameNetworkManager __instance, Result result, Lobby lobby) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Invalid comparison between Unknown and I4 //IL_0009: Unknown result type (might be due to invalid IL or missing references) if ((int)result != 1) { Debug.LogError((object)$"Lobby could not be created! {result}", (Object)(object)__instance); } __instance.lobbyHostSettings.lobbyName = "[MODDED]" + __instance.lobbyHostSettings.lobbyName.ToString(); Plugin.Log.LogMessage((object)"server pre-setup success"); return true; } internal static bool CacheMenuManager(MenuManager __instance) { LC_APIManager.MenuManager = __instance; return true; } internal static bool ChatInterpreter(HUDManager __instance, string chatMessage) { //IL_0312: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_03a2: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) if (!chatMessage.Contains("NWE") || !chatMessage.Contains("<size=0>")) { return true; } string[] array = chatMessage.Split(new char[1] { '/' }); if (array.Length < 5) { if (array.Length >= 3) { if (!int.TryParse(array[4], out var result)) { Plugin.Log.LogWarning((object)"Failed to parse player ID!!"); return false; } if ((result == (int)GameNetworkManager.Instance.localPlayerController.playerClientId) & !LC_APIManager.netTester) { return false; } Enum.TryParse<NetworkBroadcastDataType>(array[3], out var result2); switch (result2) { case NetworkBroadcastDataType.BDstring: Networking.GetString(array[1], array[2]); break; case NetworkBroadcastDataType.BDint: Networking.GetInt(int.Parse(array[1]), array[2]); break; case NetworkBroadcastDataType.BDfloat: Networking.GetFloat(float.Parse(array[1]), array[2]); break; case NetworkBroadcastDataType.BDvector3: { string[] array2 = array[1].Replace("(", "").Replace(")", "").Split(new char[1] { ',' }); Vector3 arg = default(Vector3); if (array2.Length == 3) { if (float.TryParse(array2[0], out var result3) && float.TryParse(array2[1], out var result4) && float.TryParse(array2[2], out var result5)) { arg.x = result3; arg.y = result4; arg.z = result5; } else { Plugin.Log.LogError((object)"Vector3 Network receive fail. This is a failure of the API, and it should be reported as a bug."); } } else { Plugin.Log.LogError((object)"Vector3 Network receive fail. This is a failure of the API, and it should be reported as a bug."); } Networking.GetVector3(arg, array[2]); break; } case NetworkBroadcastDataType.BDlistString: { string[] source = array[1].Split(new char[1] { '\n' }); Networking.GetListString(source.ToList(), array[2]); break; } } _ = LC_APIManager.netTester; return false; } Plugin.Log.LogError((object)"Generic Network receive fail. This is a failure of the API, and it should be reported as a bug."); Plugin.Log.LogError((object)$"Generic Network receive fail (expected 5+ data fragments, got {array.Length}). This is a failure of the API, and it should be reported as a bug."); return true; } if (!int.TryParse(array[4], out var result6)) { Plugin.Log.LogWarning((object)("Failed to parse player ID '" + array[4] + "'!!")); return false; } if ((result6 == (int)GameNetworkManager.Instance.localPlayerController.playerClientId) & !LC_APIManager.netTester) { return false; } if (!Enum.TryParse<NetworkBroadcastDataType>(array[3], out var result7)) { Plugin.Log.LogError((object)("Unknown datatype - unable to parse '" + array[3] + "' into a known data type!")); return false; } switch (result7) { case NetworkBroadcastDataType.BDstring: Networking.GetString.InvokeActionSafe(array[1], array[2]); break; case NetworkBroadcastDataType.BDint: Networking.GetInt.InvokeActionSafe(int.Parse(array[1]), array[2]); break; case NetworkBroadcastDataType.BDfloat: Networking.GetFloat.InvokeActionSafe(float.Parse(array[1]), array[2]); break; case NetworkBroadcastDataType.BDvector3: { string text = array[1].Trim('(', ')'); string[] array3 = text.Split(new char[1] { ',' }); Vector3 param = default(Vector3); float result8; float result9; float result10; if (array3.Length != 3) { Plugin.Log.LogError((object)$"Vector3 Network receive fail (expected 3 numbers, got {array3.Length} number(?)(s) instead). This is a failure of the API, and it should be reported as a bug. (passing an empty Vector3 in its place)"); } else if (float.TryParse(array3[0], out result8) && float.TryParse(array3[1], out result9) && float.TryParse(array3[2], out result10)) { param.x = result8; param.y = result9; param.z = result10; } else { Plugin.Log.LogError((object)("Vector3 Network receive fail (failed to parse '" + text + "' as numbers). This is a failure of the API, and it should be reported as a bug.")); } Networking.GetVector3.InvokeActionSafe(param, array[2]); break; } } _ = LC_APIManager.netTester; return false; } internal static bool ChatCommands(HUDManager __instance, CallbackContext context) { if (__instance.chatTextField.text.ToLower().Contains("/modcheck")) { CheatDatabase.OtherPlayerCheatDetector(); return false; } return true; } internal static void GameNetworkManagerAwake(GameNetworkManager __instance) { if ((Object)(object)GameNetworkManager.Instance == (Object)null) { ModdedServer.GameVersion = __instance.gameVersionNum; } } } } namespace LC_API.GameInterfaceAPI { public static class GameState { private static readonly Action NothingAction = delegate { }; public static int AlivePlayerCount { get; private set; } public static ShipState ShipState { get; private set; } public static event Action PlayerDied; public static event Action LandOnMoon; public static event Action WentIntoOrbit; public static event Action ShipStartedLeaving; internal static void GSUpdate() { if (!((Object)(object)StartOfRound.Instance == (Object)null)) { if (StartOfRound.Instance.shipHasLanded && ShipState != ShipState.OnMoon) { ShipState = ShipState.OnMoon; GameState.LandOnMoon.InvokeActionSafe(); } if (StartOfRound.Instance.inShipPhase && ShipState != 0) { ShipState = ShipState.InOrbit; GameState.WentIntoOrbit.InvokeActionSafe(); } if (StartOfRound.Instance.shipIsLeaving && ShipState != ShipState.LeavingMoon) { ShipState = ShipState.LeavingMoon; GameState.ShipStartedLeaving.InvokeActionSafe(); } if (AlivePlayerCount < StartOfRound.Instance.livingPlayers) { GameState.PlayerDied.InvokeActionSafe(); } AlivePlayerCount = StartOfRound.Instance.livingPlayers; } } static GameState() { GameState.PlayerDied = NothingAction; GameState.LandOnMoon = NothingAction; GameState.WentIntoOrbit = NothingAction; GameState.ShipStartedLeaving = NothingAction; } } public class GameTips { private static List<string> tipHeaders = new List<string>(); private static List<string> tipBodys = new List<string>(); private static float lastMessageTime; public static void ShowTip(string header, string body) { tipHeaders.Add(header); tipBodys.Add(body); } public static void UpdateInternal() { lastMessageTime -= Time.deltaTime; if ((tipHeaders.Count > 0) & (lastMessageTime < 0f)) { lastMessageTime = 5f; if ((Object)(object)HUDManager.Instance != (Object)null) { HUDManager.Instance.DisplayTip(tipHeaders[0], tipBodys[0], false, false, "LC_Tip1"); } tipHeaders.RemoveAt(0); tipBodys.RemoveAt(0); } } } } namespace LC_API.GameInterfaceAPI.Features { public class Item : NetworkBehaviour { private bool hasNewProps; internal static GameObject ItemNetworkPrefab { get; set; } public static Dictionary<GrabbableObject, Item> Dictionary { get; } = new Dictionary<GrabbableObject, Item>(); public static IReadOnlyCollection<Item> List => Dictionary.Values; public GrabbableObject GrabbableObject { get; private set; } public Item ItemProperties => GrabbableObject.itemProperties; public ScanNodeProperties ScanNodeProperties { get; set; } public bool IsHeld => GrabbableObject.isHeld; public bool IsTwoHanded => ItemProperties.twoHanded; public Player Holder { get { if (!IsHeld) { return null; } if (!Player.Dictionary.TryGetValue(GrabbableObject.playerHeldBy, out var value)) { return null; } return value; } } public string Name { get { return ItemProperties.itemName; } set { if (!NetworkManager.Singleton.IsServer && !NetworkManager.Singleton.IsHost) { throw new NoAuthorityException("Tried to set item name on client."); } string oldName = ItemProperties.itemName.ToLower(); CloneProperties(); ItemProperties.itemName = value; OverrideTooltips(oldName, value.ToLower()); ScanNodeProperties.headerText = value; SetGrabbableNameClientRpc(value); } } public Vector3 Position { get { //IL_000b: Unknown result type (might be due to invalid IL or missing references) return ((Component)GrabbableObject).transform.position; } set { //IL_0029: 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_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) if (!NetworkManager.Singleton.IsServer && !NetworkManager.Singleton.IsHost) { throw new NoAuthorityException("Tried to set item position on client."); } GrabbableObject.startFallingPosition = value; GrabbableObject.targetFloorPosition = value; ((Component)GrabbableObject).transform.position = value; SetItemPositionClientRpc(value); } } public Quaternion Rotation { get { //IL_000b: Unknown result type (might be due to invalid IL or missing references) return ((Component)GrabbableObject).transform.rotation; } set { //IL_000b: Unknown result type (might be due to invalid IL or missing references) ((Component)GrabbableObject).transform.rotation = value; } } public Vector3 Scale { get { //IL_000b: Unknown result type (might be due to invalid IL or missing references) return ((Component)GrabbableObject).transform.localScale; } set { //IL_000b: Unknown result type (might be due to invalid IL or missing references) ((Component)GrabbableObject).transform.localScale = value; } } public bool IsScrap { get { return ItemProperties.isScrap; } set { if (!NetworkManager.Singleton.IsServer && !NetworkManager.Singleton.IsHost) { throw new NoAuthorityException("Tried to set item name on client."); } CloneProperties(); ItemProperties.isScrap = value; SetIsScrapClientRpc(value); } } public int ScrapValue { get { return GrabbableObject.scrapValue; } set { if (!NetworkManager.Singleton.IsServer && !NetworkManager.Singleton.IsHost) { throw new NoAuthorityException("Tried to set scrap value on client."); } GrabbableObject.SetScrapValue(value); SetScrapValueClientRpc(value); } } [ClientRpc] private void SetGrabbableNameClientRpc(string name) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(66243798u, val, (RpcDelivery)0); bool flag = name != null; ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(name, false); } ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 66243798u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { string oldName = ItemProperties.itemName.ToLower(); CloneProperties(); ItemProperties.itemName = name; OverrideTooltips(oldName, name.ToLower()); ScanNodeProperties.headerText = name; } } private void OverrideTooltips(string oldName, string newName) { for (int i = 0; i < ItemProperties.toolTips.Length; i++) { ItemProperties.toolTips[i] = ItemProperties.toolTips[i].ReplaceWithCase(oldName, newName); } if (IsHeld && (Object)(object)Holder == (Object)(object)Player.LocalPlayer) { GrabbableObject.SetControlTipsForItem(); } } [ClientRpc] private void SetItemPositionClientRpc(Vector3 pos) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(949135576u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref pos); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 949135576u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { GrabbableObject.startFallingPosition = pos; GrabbableObject.targetFloorPosition = pos; ((Component)GrabbableObject).transform.position = pos; } } } public void SetAndSyncRotation(Quaternion rotation) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) if (!NetworkManager.Singleton.IsServer && !NetworkManager.Singleton.IsHost) { throw new NoAuthorityException("Tried to sync item rotation from client."); } SetItemRotationClientRpc(rotation); } [ClientRpc] private void SetItemRotationClientRpc(Quaternion rotation) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1528367091u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref rotation); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1528367091u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { Rotation = rotation; } } } public void SetAndSyncScale(Vector3 scale) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) if (!NetworkManager.Singleton.IsServer && !NetworkManager.Singleton.IsHost) { throw new NoAuthorityException("Tried to sync item scale from client."); } SetItemScaleClientRpc(scale); } [ClientRpc] private void SetItemScaleClientRpc(Vector3 scale) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2688253945u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref scale); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2688253945u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { Scale = scale; } } } [ClientRpc] private void SetIsScrapClientRpc(bool isScrap) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(4227417717u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref isScrap, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4227417717u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { CloneProperties(); ItemProperties.isScrap = isScrap; } } } [ClientRpc] private void SetScrapValueClientRpc(int scrapValue) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3866863385u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, scrapValue); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3866863385u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { GrabbableObject.SetScrapValue(scrapValue); } } } public void RemoveFromHolder(Vector3 position = default(Vector3), Quaternion rotation = default(Quaternion)) { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) if (!NetworkManager.Singleton.IsServer && !NetworkManager.Singleton.IsHost) { throw new NoAuthorityException("Tried to remove item from player on client."); } if (IsHeld) { ((NetworkBehaviour)this).NetworkObject.RemoveOwnership(); Holder.Inventory.RemoveItem(this); RemoveFromHolderClientRpc(); Position = position; Rotation = rotation; } } [ClientRpc] private void RemoveFromHolderClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1050513218u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1050513218u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && IsHeld) { Holder.Inventory.RemoveItem(this); } } } public void EnablePhysics(bool enable) { GrabbableObject.EnablePhysics(enable); } public void EnableMeshes(bool enable) { GrabbableObject.EnableItemMeshes(enable); } public void FallToGround(bool randomizePosition = false) { GrabbableObject.FallToGround(randomizePosition); } public bool PocketItem() { if (!IsHeld || (Object)(object)Holder.HeldItem != (Object)(object)this || IsTwoHanded) { return false; } GrabbableObject.PocketItem(); return true; } public bool GiveTo(Player player, bool switchTo = true) { if (!NetworkManager.Singleton.IsServer && !NetworkManager.Singleton.IsHost) { throw new NoAuthorityException("Tried to give item to player on client."); } return player.Inventory.TryAddItem(this, switchTo); } public void InitializeScrap() { if (RoundManager.Instance.AnomalyRandom != null) { InitializeScrap((int)((float)RoundManager.Instance.AnomalyRandom.Next(ItemProperties.minValue, ItemProperties.maxValue) * RoundManager.Instance.scrapValueMultiplier)); } else { InitializeScrap((int)((float)Random.Range(ItemProperties.minValue, ItemProperties.maxValue) * RoundManager.Instance.scrapValueMultiplier)); } } public void InitializeScrap(int scrapValue) { if (!NetworkManager.Singleton.IsServer && !NetworkManager.Singleton.IsHost) { throw new NoAuthorityException("Tried to initialize scrap on client."); } ScrapValue = scrapValue; InitializeScrapClientRpc(); } [ClientRpc] private void InitializeScrapClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1334565671u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1334565671u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } MeshFilter val3 = default(MeshFilter); if (((Component)GrabbableObject).gameObject.TryGetComponent<MeshFilter>(ref val3) && ItemProperties.meshVariants != null && ItemProperties.meshVariants.Length != 0) { if (RoundManager.Instance.ScrapValuesRandom != null) { val3.mesh = ItemProperties.meshVariants[RoundManager.Instance.ScrapValuesRandom.Next(ItemProperties.meshVariants.Length)]; } else { val3.mesh = ItemProperties.meshVariants[0]; } } MeshRenderer val4 = default(MeshRenderer); if (((Component)GrabbableObject).gameObject.TryGetComponent<MeshRenderer>(ref val4) && ItemProperties.materialVariants != null && ItemProperties.materialVariants.Length != 0) { if (RoundManager.Instance.ScrapValuesRandom != null) { ((Renderer)val4).sharedMaterial = ItemProperties.materialVariants[RoundManager.Instance.ScrapValuesRandom.Next(ItemProperties.materialVariants.Length)]; } else { ((Renderer)val4).sharedMaterial = ItemProperties.materialVariants[0]; } } } public static Item CreateAndSpawnItem(string itemName, bool andInitialize = true, Vector3 position = default(Vector3), Quaternion rotation = default(Quaternion)) { //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) if (!NetworkManager.Singleton.IsServer && !NetworkManager.Singleton.IsHost) { throw new NoAuthorityException("Tried to create and spawn item on client."); } string name = itemName.ToLower(); GameObject val = ((IEnumerable<Item>)StartOfRound.Instance.allItemsList.itemsList).FirstOrDefault((Func<Item, bool>)((Item i) => i.itemName.ToLower().Contains(name)))?.spawnPrefab; if ((Object)(object)val != (Object)null) { GameObject obj = Object.Instantiate<GameObject>(val, position, rotation); obj.GetComponent<NetworkObject>().Spawn(false); Item component = obj.GetComponent<Item>(); if (component.IsScrap && andInitialize) { component.InitializeScrap(); } return component; } return null; } public static Item CreateAndGiveItem(string itemName, Player player, bool andInitialize = true, bool switchTo = true) { //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) if (!NetworkManager.Singleton.IsServer && !NetworkManager.Singleton.IsHost) { throw new NoAuthorityException("Tried to create and give item on client."); } string name = itemName.ToLower(); GameObject val = ((IEnumerable<Item>)StartOfRound.Instance.allItemsList.itemsList).FirstOrDefault((Func<Item, bool>)((Item i) => i.itemName.ToLower().Contains(name)))?.spawnPrefab; if ((Object)(object)val != (Object)null) { GameObject obj = Object.Instantiate<GameObject>(val, Vector3.zero, default(Quaternion)); obj.GetComponent<NetworkObject>().Spawn(false); Item component = obj.GetComponent<Item>(); if (component.IsScrap && andInitialize) { component.InitializeScrap(); } component.GiveTo(player, switchTo); return component; } return null; } private void Awake() { GrabbableObject = ((Component)this).GetComponent<GrabbableObject>(); ScanNodeProperties = ((Component)GrabbableObject).gameObject.GetComponentInChildren<ScanNodeProperties>(); Dictionary.Add(GrabbableObject, this); } private void CloneProperties() { Item itemProperties = Object.Instantiate<Item>(ItemProperties); if (hasNewProps) { Object.Destroy((Object)(object)ItemProperties); } GrabbableObject.itemProperties = itemProperties; hasNewProps = true; } public override void OnDestroy() { Dictionary.Remove(GrabbableObject); ((NetworkBehaviour)this).OnDestroy(); } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_Item() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Expected O, but got Unknown //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Expected O, but got Unknown //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Expected O, but got Unknown //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Expected O, but got Unknown //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(66243798u, new RpcReceiveHandler(__rpc_handler_66243798)); NetworkManager.__rpc_func_table.Add(949135576u, new RpcReceiveHandler(__rpc_handler_949135576)); NetworkManager.__rpc_func_table.Add(1528367091u, new RpcReceiveHandler(__rpc_handler_1528367091)); NetworkManager.__rpc_func_table.Add(2688253945u, new RpcReceiveHandler(__rpc_handler_2688253945)); NetworkManager.__rpc_func_table.Add(4227417717u, new RpcReceiveHandler(__rpc_handler_4227417717)); NetworkManager.__rpc_func_table.Add(3866863385u, new RpcReceiveHandler(__rpc_handler_3866863385)); NetworkManager.__rpc_func_table.Add(1050513218u, new RpcReceiveHandler(__rpc_handler_1050513218)); NetworkManager.__rpc_func_table.Add(1334565671u, new RpcReceiveHandler(__rpc_handler_1334565671)); } private static void __rpc_handler_66243798(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: 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_007b: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives)); string grabbableNameClientRpc = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref grabbableNameClientRpc, false); } target.__rpc_exec_stage = (__RpcExecStage)2; ((Item)(object)target).SetGrabbableNameClientRpc(grabbableNameClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_949135576(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 itemPositionClientRpc = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref itemPositionClientRpc); target.__rpc_exec_stage = (__RpcExecStage)2; ((Item)(object)target).SetItemPositionClientRpc(itemPositionClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1528367091(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Quaternion itemRotationClientRpc = default(Quaternion); ((FastBufferReader)(ref reader)).ReadValueSafe(ref itemRotationClientRpc); target.__rpc_exec_stage = (__RpcExecStage)2; ((Item)(object)target).SetItemRotationClientRpc(itemRotationClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2688253945(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 itemScaleClientRpc = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref itemScaleClientRpc); target.__rpc_exec_stage = (__RpcExecStage)2; ((Item)(object)target).SetItemScaleClientRpc(itemScaleClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4227417717(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool isScrapClientRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref isScrapClientRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)2; ((Item)(object)target).SetIsScrapClientRpc(isScrapClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3866863385(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int scrapValueClientRpc = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref scrapValueClientRpc); target.__rpc_exec_stage = (__RpcExecStage)2; ((Item)(object)target).SetScrapValueClientRpc(scrapValueClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1050513218(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)2; ((Item)(object)target).RemoveFromHolderClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1334565671(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)2; ((Item)(object)target).InitializeScrapClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "Item"; } } public class Player : NetworkBehaviour { public class PlayerInventory : NetworkBehaviour { public Player Player { get; private set; } public Item[] Items => Player.PlayerController.ItemSlots.Select((GrabbableObject i) => (!((Object)(object)i != (Object)null)) ? null : Item.Dictionary[i]).ToArray(); public int CurrentSlot { get { return Player.PlayerController.currentItemSlot; } set { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) if (Player.IsLocalPlayer) { SetSlotServerRpc(value); } else if (NetworkManager.Singleton.IsHost || NetworkManager.Singleton.IsServer) { SetSlotClientRpc(value); } } } [ServerRpc] private void SetSlotServerRpc(int slot, ServerRpcParams serverRpcParams = default(ServerRpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Invalid comparison between Unknown and I4 //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1475903090u, serverRpcParams, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, slot); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1475903090u, serverRpcParams, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost) && serverRpcParams.Receive.SenderClientId == Player.ClientId) { SetSlotClientRpc(slot); } } [ClientRpc] private void SetSlotClientRpc(int slot) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2977994897u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, slot); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2977994897u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { Player.PlayerController.SwitchToItemSlot(slot, (GrabbableObject)null); } } } public int GetFirstEmptySlot() { return Player.PlayerController.FirstEmptyItemSlot(); } public bool TryGetFirstEmptySlot(out int slot) { slot = Player.PlayerController.FirstEmptyItemSlot(); return slot != -1; } public bool TryAddItem(Item item, bool switchTo = true) { //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005b: 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) if (!NetworkManager.Singleton.IsServer && !NetworkManager.Singleton.IsHost) { throw new NoAuthorityException("Tried to add item from client."); } if (TryGetFirstEmptySlot(out var slot)) { if (item.IsTwoHanded && !Player.HasFreeHands) { return false; } if (item.IsHeld) { item.RemoveFromHolder(); } ((NetworkBehaviour)item).NetworkObject.ChangeOwnership(Player.ClientId); if (item.IsTwoHanded) { SetSlotAndItemClientRpc(slot, ((NetworkBehaviour)item).NetworkObjectId); } else if (switchTo && Player.HasFreeHands) { SetSlotAndItemClientRpc(slot, ((NetworkBehaviour)item).NetworkObjectId); } else if (Player.PlayerController.currentItemSlot == slot) { SetSlotAndItemClientRpc(slot, ((NetworkBehaviour)item).NetworkObjectId); } else { SetItemInSlotClientRpc(slot, ((NetworkBehaviour)item).NetworkObjectId); } return true; } return false; } public bool TryAddItemToSlot(Item item, int slot, bool switchTo = true) { //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) if (!NetworkManager.Singleton.IsServer && !NetworkManager.Singleton.IsHost) { throw new NoAuthorityException("Tried to add item from client."); } if (slot < Player.PlayerController.ItemSlots.Length && (Object)(object)Player.PlayerController.ItemSlots[slot] == (Object)null) { if (item.IsTwoHanded && !Player.HasFreeHands) { return false; } if (item.IsHeld) { item.RemoveFromHolder(); } ((NetworkBehaviour)item).NetworkObject.ChangeOwnership(Player.ClientId); if (item.IsTwoHanded) { SetSlotAndItemClientRpc(slot, ((NetworkBehaviour)item).NetworkObjectId); } else if (switchTo && Player.HasFreeHands) { SetSlotAndItemClientRpc(slot, ((NetworkBehaviour)item).NetworkObjectId); } else if (Player.PlayerController.currentItemSlot == slot) { SetSlotAndItemClientRpc(slot, ((NetworkBehaviour)item).NetworkObjectId); } else { SetItemInSlotClientRpc(slot, ((NetworkBehaviour)item).NetworkObjectId); } return true; } return false; } [ClientRpc] private void SetItemInSlotClientRpc(int slot, ulong itemId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2222069819u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, slot); BytePacker.WriteValueBitPacked(val2, itemId); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2222069819u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ulong itemId2 = itemId; Item item = Item.List.FirstOrDefault((Item i) => ((NetworkBehaviour)i).NetworkObjectId == itemId2); if ((Object)(object)item != (Object)null) { if (Player.IsLocalPlayer) { HUDManager.Instance.itemSlotIcons[slot].sprite = item.ItemProperties.itemIcon; ((Behaviour)HUDManager.Instance.itemSlotIcons[slot]).enabled = true; } item.GrabbableObject.EnablePhysics(false); item.GrabbableObject.EnableItemMeshes(false); item.GrabbableObject.playerHeldBy = Player.PlayerController; item.GrabbableObject.hasHitGround = false; item.GrabbableObject.isInFactory = Player.IsInFactory; Player.CarryWeight += Mathf.Clamp(item.ItemProperties.weight - 1f, 0f, 10f); if (!Player.IsLocalPlayer) { item.GrabbableObject.parentObject = Player.PlayerController.serverItemHolder; } else { item.GrabbableObject.parentObject = Player.PlayerController.localItemHolder; } Player.PlayerController.ItemSlots[slot] = item.GrabbableObject; } } [ClientRpc] private void SetSlotAndItemClientRpc(int slot, ulong itemId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1630079273u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, slot); BytePacker.WriteValueBitPacked(val2, itemId); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1630079273u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ulong itemId2 = itemId; Item item = Item.List.FirstOrDefault((Item i) => ((NetworkBehaviour)i).NetworkObjectId == itemId2); if ((Object)(object)item != (Object)null) { Player.PlayerController.SwitchToItemSlot(slot, item.GrabbableObject); item.GrabbableObject.EnablePhysics(false); item.GrabbableObject.isHeld = true; item.GrabbableObject.hasHitGround = false; item.GrabbableObject.isInFactory = Player.IsInFactory; Player.PlayerController.twoHanded = item.ItemProperties.twoHanded; Player.PlayerController.twoHandedAnimation = item.ItemProperties.twoHandedAnimation; Player.PlayerController.isHoldingObject = true; Player.CarryWeight += Mathf.Clamp(item.ItemProperties.weight - 1f, 0f, 10f); if (!Player.IsLocalPlayer) { item.GrabbableObject.parentObject = Player.PlayerController.serverItemHolder; } else { item.GrabbableObject.parentObject = Player.PlayerController.localItemHolder; } } } public void RemoveItem(int slot) { //IL_0024: 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) if (NetworkManager.Singleton.IsHost || NetworkManager.Singleton.IsServer) { RemoveItemClientRpc(slot); } else { RemoveItemServerRpc(slot); } } [ServerRpc(RequireOwnership = false)] private void RemoveItemServerRpc(int slot, ServerRpcParams serverRpcParams = default(ServerRpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1641630752u, serverRpcParams, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, slot); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1641630752u, serverRpcParams, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost) && serverRpcParams.Receive.SenderClientId == Player.ClientId) { RemoveItemClientRpc(slot); } } } [ClientRpc] private void RemoveItemClientRpc(int slot) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2246700294u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, slot); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2246700294u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost) || slot == -1) { return; } bool flag = slot == Player.Inventory.CurrentSlot; Item item = Items[slot]; if ((Object)(object)item == (Object)null) { return; } GrabbableObject grabbableObject = item.GrabbableObject; if (Player.IsLocalPlayer) { ((Behaviour)HUDManager.Instance.itemSlotIcons[slot]).enabled = false; if (item.IsTwoHanded) { ((Behaviour)HUDManager.Instance.holdingTwoHandedItem).enabled = false; } } if (flag) { if (Player.IsLocalPlayer) { grabbableObject.DiscardItemOnClient(); } else { grabbableObject.DiscardItem(); } Player.PlayerController.currentlyHeldObject = null; Player.PlayerController.currentlyHeldObjectServer = null; Player.PlayerController.isHoldingObject = false; if (item.IsTwoHanded) { Player.PlayerController.twoHanded = false; Player.PlayerController.twoHandedAnimation = false; } } grabbableObject.heldByPlayerOnServer = false; grabbableObject.parentObject = null; item.EnablePhysics(enable: false); item.EnableMeshes(enable: true); item.Scale = item.GrabbableObject.originalScale; if (NetworkManager.Singleton.IsHost || NetworkManager.Singleton.IsServer) { item.Position = Vector3.zero; } grabbableObject.isHeld = false; grabbableObject.isPocketed = false; Player.CarryWeight -= Mathf.Clamp(item.ItemProperties.weight - 1f, 0f, 10f); Player.PlayerController.ItemSlots[slot] = null; } public void RemoveItem(Item item) { RemoveItem(Array.IndexOf(Player.PlayerController.ItemSlots, item.GrabbableObject)); } public void RemoveAllItems() { for (int i = 0; i < Player.PlayerController.ItemSlots.Length; i++) { RemoveItem(i); } } private void Awake() { Player = ((Component)this).GetComponent<Player>(); } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_PlayerInventory() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Expected O, but got Unknown //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Expected O, but got Unknown //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(1475903090u, new RpcReceiveHandler(__rpc_handler_1475903090)); NetworkManager.__rpc_func_table.Add(2977994897u, new RpcReceiveHandler(__rpc_handler_2977994897)); NetworkManager.__rpc_func_table.Add(2222069819u, new RpcReceiveHandler(__rpc_handler_2222069819)); NetworkManager.__rpc_func_table.Add(1630079273u, new RpcReceiveHandler(__rpc_handler_1630079273)); NetworkManager.__rpc_func_table.Add(1641630752u, new RpcReceiveHandler(__rpc_handler_1641630752)); NetworkManager.__rpc_func_table.Add(2246700294u, new RpcReceiveHandler(__rpc_handler_2246700294)); } private static void __rpc_handler_1475903090(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { int slot = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref slot); ServerRpcParams server = rpcParams.Server; target.__rpc_exec_stage = (__RpcExecStage)1; ((PlayerInventory)(object)target).SetSlotServerRpc(slot, server); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2977994897(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int slotClientRpc = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref slotClientRpc); target.__rpc_exec_stage = (__RpcExecStage)2; ((PlayerInventory)(object)target).SetSlotClientRpc(slotClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2222069819(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int slot = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref slot); ulong itemId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref itemId); target.__rpc_exec_stage = (__RpcExecStage)2; ((PlayerInventory)(object)target).SetItemInSlotClientRpc(slot, itemId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1630079273(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int slot = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref slot); ulong itemId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref itemId); target.__rpc_exec_stage = (__RpcExecStage)2; ((PlayerInventory)(object)target).SetSlotAndItemClientRpc(slot, itemId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1641630752(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int slot = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref slot); ServerRpcParams server = rpcParams.Server; target.__rpc_exec_stage = (__RpcExecStage)1; ((PlayerInventory)(object)target).RemoveItemServerRpc(slot, server); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2246700294(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int slot = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref slot); target.__rpc_exec_stage = (__RpcExecStage)2; ((PlayerInventory)(object)target).RemoveItemClientRpc(slot); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "PlayerInventory"; } } internal static GameObject PlayerNetworkPrefab { get; set; } public static Dictionary<PlayerControllerB, Player> Dictionary { get; } = new Dictionary<PlayerControllerB, Player>(); public static IReadOnlyCollection<Player> List => Dictionary.Values; public static IReadOnlyCollection<Player> ActiveList => List.Where((Player p) => p.IsActive).ToList(); public static Player LocalPlayer { get; internal set; } public static Player HostPlayer { get; internal set; } public PlayerControllerB PlayerController { get; internal set; } internal NetworkVariable<ulong> NetworkClientId { get; } = new NetworkVariable<ulong>(ulong.MaxValue, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public ulong ClientId => PlayerController.actualClientId; public ulong SteamId => PlayerController.playerSteamId; public bool IsHost => (Object)(object)((Component)PlayerController).gameObject == (Object)(object)PlayerController.playersManager.allPlayerObjects[0]; public bool IsLocalPlayer => (Object)(object)PlayerController == (Object)(object)StartOfRound.Instance.localPlayerController; public bool IsActive { get { if (!IsControlled) { return IsDead; } return true; } } public bool IsControlled => PlayerController.isPlayerControlled; public bool IsDead => PlayerController.isPlayerDead; public string Username { get { return PlayerController.playerUsername; } set { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) PlayerController.playerUsername = value; if (NetworkManager.Singleton.IsServer || NetworkManager.Singleton.IsHost) { SetPlayerUsernameClientRpc(value); } else { SetPlayerUsernameServerRpc(value); } } } public float SprintMeter { get { return PlayerController.sprintMeter; } set { if (!NetworkManager.Singleton.IsServer && !NetworkManager.Singleton.IsHost) { throw new NoAuthorityException("Tried to set sprint meter on client."); } PlayerController.sprintMeter = value; SetSprintMeterClientRpc(value); } } public Vector3 Position { get { //IL_000b: Unknown result type (might be due to invalid IL or missing references) return ((Component)PlayerController).transform.position; } set { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) if (!NetworkManager.Singleton.IsServer && !NetworkManager.Singleton.IsHost) { throw new NoAuthorityException("Tried to set position on client."); } ((Component)PlayerController).transform.position = value; PlayerController.serverPlayerPosition = value; TeleportPlayerClientRpc(value); } } public Vector3 EulerAngles { get { //IL_000b: Unknown result type (might be due to invalid IL or missing references) return ((Component)PlayerController).transform.eulerAngles; } set { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) if (!IsLocalPlayer && !NetworkManager.Singleton.IsHost && !NetworkManager.Singleton.IsServer) { throw new NoAuthorityException("Tried to update euler angles from other client."); } ((Component)PlayerController).transform.eulerAngles = value; if (NetworkManager.Singleton.IsHost || NetworkManager.Singleton.IsServer) { PlayerController.UpdatePlayerRotationFullClientRpc(value); } } } public Quaternion Rotation { get { //IL_000b: Unknown result type (might be due to invalid IL or missing references) return ((Component)PlayerController).transform.rotation; } set { //IL_0036: 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_0073: Unknown result type (might be due to invalid IL or missing references) if (!IsLocalPlayer && !NetworkManager.Singleton.IsHost && !NetworkManager.Singleton.IsServer) { throw new NoAuthorityException("Tried to update rotation from other client."); } ((Component)PlayerController).transform.rotation = value; ((Component)PlayerController).transform.eulerAngles = ((Quaternion)(ref value)).eulerAngles; if (NetworkManager.Singleton.IsHost || NetworkManager.Singleton.IsServer) { PlayerController.UpdatePlayerRotationFullClientRpc(((Quaternion)(ref value)).eulerAngles); } } } public int Health { get { return PlayerController.health; } set { if (!NetworkManager.Singleton.IsServer && !NetworkManager.Singleton.IsHost) { throw new NoAuthorityException("Tried to set health on client."); } PlayerController.health = value; SetHealthClientRpc(value); } } public bool IsInFactory => PlayerController.isInsideFactory; public Item HeldItem { get { if ((Object)(object)PlayerController.currentlyHeldObjectServer == (Object)null) { return null; } return Item.Dictionary[PlayerController.currentlyHeldObjectServer]; } } public bool IsHoldingItem => (Object)(object)HeldItem != (Object)null; public bool HasFreeHands { get { if (IsHoldingItem) { return !HeldItem.IsTwoHanded; } return true; } } public PlayerInventory Inventory { get; private set; } public float CarryWeight { get { return PlayerController.carryWeight; } set { PlayerController.carryWeight = value; } } [ServerRpc(RequireOwnership = false)] private void SetPlayerUsernameServerRpc(string name, ServerRpcParams @params = default(ServerRpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3898702292u, @params, (RpcDelivery)0); bool flag = name != null; ((FastBufferWriter)(ref val)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe(name, false); } ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3898702292u, @params, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost) && @params.Receive.SenderClientId == ClientId) { SetPlayerUsernameClientRpc(name); } } [ClientRpc] private void SetPlayerUsernameClientRpc(string name) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1254211676u, val, (RpcDelivery)0); bool flag = name != null; ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(name, false); } ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1254211676u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { PlayerController.playerUsername = name; ((TMP_Text)PlayerController.usernameBillboardText).text = name; } } [ClientRpc] private void SetSprintMeterClientRpc(float value) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(442815492u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref value, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 442815492u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && NetworkManager.Singleton.IsClient) { PlayerController.sprintMeter = value; } } } [ClientRpc] private void TeleportPlayerClientRpc(Vector3 position) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1267434055u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref position); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1267434055u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && NetworkManager.Singleton.IsClient) { PlayerController.TeleportPlayer(position, false, 0f, false, true); if (IsLocalPlayer) { PlayerController.UpdatePlayerPositionServerRpc(position, PlayerController.isInElevator, PlayerController.isExhausted, PlayerController.thisController.isGrounded); } } } [ClientRpc] private void SetHealthClientRpc(int health) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1407071784u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, health); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1407071784u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && NetworkManager.Singleton.IsClient) { int health2 = PlayerController.health; PlayerController.health = health; if (((NetworkBehaviour)PlayerController).IsOwner) { HUDManager.Instance.UpdateHealthUI(health, health < health2); } if (health <= 0 && !PlayerController.isPlayerDead && PlayerController.AllowPlayerDeath()) { PlayerController.KillPlayer(default(Vector3), true, (CauseOfDeath)0, 0); } } } public void Hurt(int damage, CauseOfDeath causeOfDeath = 0, Vector3 bodyVelocity = default(Vector3), bool overrideOneShotProtection = false, int deathAnimation = 0, bool fallDamage = false, bool hasSFX = true) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0010: 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) if (overrideOneShotProtection && Health - da
BepInEx/plugins/AlexCodesGames-AdditionalSuits/AdditionalSuits.dll
Decompiled 11 months agousing System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Logging; using HarmonyLib; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("AdditionalSuits")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("AdditionalSuits")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("0c25b026-8574-4dd2-9af2-4265f618ef8a")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace AdditionalSuits; [Serializable] public class UnlockableSuitDef { public string suitID; public string suitName; public string suitTexture; } public class UnlockableSuitDefListing { public List<UnlockableSuitDef> unlockableSuits = new List<UnlockableSuitDef>(); } [BepInPlugin("ACS.AdditionalSuits", "AdditionalSuits", "1.1.3")] public class AdditionalSuitsBase : BaseUnityPlugin { [HarmonyPatch(typeof(StartOfRound))] internal class acgAdditionalSuitsPatch { [HarmonyPatch("Start")] [HarmonyPrefix] private static void acsStartOfRoundPatch(StartOfRound __instance) { //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Expected O, but got Unknown try { if (SuitsLoaded) { return; } UnlockableItem val = null; for (int i = 0; i < __instance.unlockablesList.unlockables.Count; i++) { UnlockableItem val2 = __instance.unlockablesList.unlockables[i]; if (!((Object)(object)val2.suitMaterial == (Object)null) && val2.alreadyUnlocked) { val = val2; break; } } string text = Path.Combine(ModResourceFolder, "suit-defs.json"); AddLog("attempting to parse json file: " + text); string text2 = File.ReadAllText(text); if (text2 == null) { AddLog("ERROR: json file was not found"); return; } AddLog("converting json file to manifest..."); string[] array = text2.Split(new char[1] { '[' }); array = array[1].Split(new char[1] { ']' }); array = array[0].Split(new char[1] { '{' }); SuitDefManifest = new UnlockableSuitDefListing(); for (int j = 1; j < array.Length; j++) { string text3 = "{" + array[j].Trim(); if (j != array.Length - 1) { text3 = text3.Substring(0, text3.Length - 1); } UnlockableSuitDef item = JsonUtility.FromJson<UnlockableSuitDef>(text3); SuitDefManifest.unlockableSuits.Add(item); } AddLog("attempting to parse json file: items were found..."); foreach (UnlockableSuitDef unlockableSuit in SuitDefManifest.unlockableSuits) { AddLog("processing custom suit {id=" + unlockableSuit.suitID + ", name=" + unlockableSuit.suitName + "}..."); UnlockableItem val3 = JsonUtility.FromJson<UnlockableItem>(JsonUtility.ToJson((object)val)); Texture2D val4 = new Texture2D(2, 2); ImageConversion.LoadImage(val4, File.ReadAllBytes(Path.Combine(ModResourceFolder, unlockableSuit.suitTexture))); Material val5 = Object.Instantiate<Material>(val3.suitMaterial); val5.mainTexture = (Texture)(object)val4; val3.suitMaterial = val5; val3.unlockableName = unlockableSuit.suitName; __instance.unlockablesList.unlockables.Add(val3); mls.LogInfo((object)("AdditionalSuits - added custom suit {id=" + unlockableSuit.suitID + ", name=" + unlockableSuit.suitName + "}!")); } mls.LogInfo((object)"AdditionalSuits - loaded item defs from json file!"); SuitsLoaded = true; } catch (Exception ex) { mls.LogInfo((object)("AdditionalSuits - initialization failed!\nERROR: " + ex)); } } } private static AdditionalSuitsBase Instance; private const string modGUID = "ACS.AdditionalSuits"; private const string modName = "AdditionalSuits"; private const string modVersion = "1.1.3"; private readonly Harmony harmony = new Harmony("ACS.AdditionalSuits"); private static ManualLogSource mls; public static bool SuitsLoaded; public static string ModResourceFolder; public static UnlockableSuitDefListing SuitDefManifest; public string ModGUID => "ACS.AdditionalSuits"; public string ModName => "AdditionalSuits"; public string ModVersion => "1.1.3"; public static void AddLog(string log) { mls.LogInfo((object)("AdditionalSuits - " + log)); } private void Awake() { if ((Object)(object)Instance == (Object)null) { Instance = this; } mls = Logger.CreateLogSource("ACS.AdditionalSuits"); AddLog("initializing..."); ModResourceFolder = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "resAdditionalSuits"); harmony.PatchAll(); AddLog("initialized!"); } }
BepInEx/plugins/anormaltwig-LateCompany/LateCompanyV1.0.7.dll
Decompiled 11 months agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using GameNetcodeStuff; using HarmonyLib; using Microsoft.CodeAnalysis; using Unity.Netcode; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETFramework,Version=v4.6", FrameworkDisplayName = ".NET Framework 4.6")] [assembly: AssemblyCompany("LateCompany")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+dd1c760480cb012e5275a3b7e6464b2b2dffb1d0")] [assembly: AssemblyProduct("LateCompany")] [assembly: AssemblyTitle("LateCompany")] [assembly: AssemblyVersion("1.0.0.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [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 LateCompany { public static class PluginInfo { public const string GUID = "twig.latecompany"; public const string PrintName = "Late Company"; public const string Version = "1.0.7"; } [BepInPlugin("twig.latecompany", "Late Company", "1.0.7")] internal class Plugin : BaseUnityPlugin { private ConfigEntry<bool> configLateJoinOrbitOnly; public static bool OnlyLateJoinInOrbit = false; public static bool LobbyJoinable = true; public void Awake() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown configLateJoinOrbitOnly = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Late join orbit only", true, "Don't allow joining while the ship is not in orbit."); OnlyLateJoinInOrbit = configLateJoinOrbitOnly.Value; Harmony val = new Harmony("twig.latecompany"); val.PatchAll(typeof(Plugin).Assembly); ((BaseUnityPlugin)this).Logger.Log((LogLevel)16, (object)"Late Company loaded!"); } public static void SetLobbyJoinable(bool joinable) { LobbyJoinable = joinable; GameNetworkManager.Instance.SetLobbyJoinable(joinable); QuickMenuManager val = Object.FindObjectOfType<QuickMenuManager>(); if (Object.op_Implicit((Object)(object)val)) { val.inviteFriendsTextAlpha.alpha = (joinable ? 1f : 0.2f); } } } } namespace LateCompany.Patches { [HarmonyPatch(typeof(GameNetworkManager), "LeaveLobbyAtGameStart")] [HarmonyWrapSafe] internal static class LeaveLobbyAtGameStart_Patch { [HarmonyPrefix] private static bool Prefix() { return false; } } [HarmonyPatch(typeof(GameNetworkManager), "ConnectionApproval")] [HarmonyWrapSafe] internal static class ConnectionApproval_Patch { [HarmonyPostfix] private static void Postfix(ConnectionApprovalRequest request, ConnectionApprovalResponse response) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) if (request.ClientNetworkId != NetworkManager.Singleton.LocalClientId && response.Reason.Contains("Game has already started") && Plugin.LobbyJoinable) { response.Reason = ""; response.CreatePlayerObject = false; response.Approved = true; response.Pending = false; } } } [HarmonyPatch(typeof(QuickMenuManager), "DisableInviteFriendsButton")] internal static class DisableInviteFriendsButton_Patch { [HarmonyPrefix] private static bool Prefix() { return false; } } [HarmonyPatch(typeof(QuickMenuManager), "InviteFriendsButton")] internal static class InviteFriendsButton_Patch { [HarmonyPrefix] private static bool Prefix() { if (Plugin.LobbyJoinable) { GameNetworkManager.Instance.InviteFriendsUI(); } return false; } } internal class RpcEnum : NetworkBehaviour { public static int None => 0; public static int Client => 2; public static int Server => 1; } internal static class WeatherSync { public static bool DoOverride = false; public static LevelWeatherType CurrentWeather = (LevelWeatherType)(-1); } [HarmonyPatch(typeof(RoundManager), "__rpc_handler_1193916134")] [HarmonyWrapSafe] internal static class __rpc_handler_1193916134_Patch { public static FieldInfo RPCExecStage = typeof(NetworkBehaviour).GetField("__rpc_exec_stage", BindingFlags.Instance | BindingFlags.NonPublic); [HarmonyPrefix] private static bool Prefix(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if ((Object)(object)networkManager != (Object)null && networkManager.IsListening) { try { int num = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref num); int num2 = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref num2); int num3 = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref num3); WeatherSync.CurrentWeather = (LevelWeatherType)num3; WeatherSync.DoOverride = true; RPCExecStage.SetValue(target, RpcEnum.Client); ((RoundManager)((target is RoundManager) ? target : null)).GenerateNewLevelClientRpc(num, num2); RPCExecStage.SetValue(target, RpcEnum.None); } catch { WeatherSync.DoOverride = false; ((FastBufferReader)(ref reader)).Seek(0); return true; } } return false; } } [HarmonyPatch(typeof(RoundManager), "SetToCurrentLevelWeather")] internal static class SetToCurrentLevelWeather_Patch { [HarmonyPrefix] private static void Prefix() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) if (WeatherSync.DoOverride) { RoundManager.Instance.currentLevel.currentWeather = WeatherSync.CurrentWeather; WeatherSync.DoOverride = false; } } } [HarmonyPatch(typeof(StartOfRound), "OnPlayerConnectedClientRpc")] [HarmonyWrapSafe] internal static class OnPlayerConnectedClientRpc_Patch { public static MethodInfo BeginSendClientRpc = typeof(RoundManager).GetMethod("__beginSendClientRpc", BindingFlags.Instance | BindingFlags.NonPublic); public static MethodInfo EndSendClientRpc = typeof(RoundManager).GetMethod("__endSendClientRpc", BindingFlags.Instance | BindingFlags.NonPublic); [HarmonyPostfix] private static void Postfix(ulong clientId, int connectedPlayers, ulong[] connectedPlayerIdsOrdered, int assignedPlayerObjectId, int serverMoneyAmount, int levelID, int profitQuota, int timeUntilDeadline, int quotaFulfilled, int randomSeed) { //IL_0066: 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_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: 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_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Expected I4, but got Unknown //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) StartOfRound instance = StartOfRound.Instance; PlayerControllerB val = instance.allPlayerScripts[assignedPlayerObjectId]; if (instance.connectedPlayersAmount + 1 >= instance.allPlayerScripts.Length) { Plugin.SetLobbyJoinable(joinable: false); } val.DisablePlayerModel(instance.allPlayerObjects[assignedPlayerObjectId], true, true); if (((NetworkBehaviour)instance).IsServer && !instance.inShipPhase) { RoundManager instance2 = RoundManager.Instance; ClientRpcParams val2 = default(ClientRpcParams); val2.Send = new ClientRpcSendParams { TargetClientIds = new List<ulong> { clientId } }; ClientRpcParams val3 = val2; FastBufferWriter val4 = (FastBufferWriter)BeginSendClientRpc.Invoke(instance2, new object[3] { 1193916134u, val3, 0 }); BytePacker.WriteValueBitPacked(val4, StartOfRound.Instance.randomMapSeed); BytePacker.WriteValueBitPacked(val4, StartOfRound.Instance.currentLevelID); BytePacker.WriteValueBitPacked(val4, (int)instance2.currentLevel.currentWeather); EndSendClientRpc.Invoke(instance2, new object[4] { val4, 1193916134u, val3, 0 }); FastBufferWriter val5 = (FastBufferWriter)BeginSendClientRpc.Invoke(instance2, new object[3] { 2729232387u, val3, 0 }); EndSendClientRpc.Invoke(instance2, new object[4] { val5, 2729232387u, val3, 0 }); } instance.livingPlayers = instance.connectedPlayersAmount + 1; for (int i = 0; i < instance.allPlayerScripts.Length; i++) { PlayerControllerB val6 = instance.allPlayerScripts[i]; if (val6.isPlayerControlled && val6.isPlayerDead) { instance.livingPlayers--; } } } } [HarmonyPatch(typeof(StartOfRound), "OnPlayerDC")] [HarmonyWrapSafe] internal static class OnPlayerDC_Patch { [HarmonyPostfix] private static void Postfix() { if (StartOfRound.Instance.inShipPhase || (!Plugin.OnlyLateJoinInOrbit && StartOfRound.Instance.shipHasLanded)) { Plugin.SetLobbyJoinable(joinable: true); } } } [HarmonyPatch(typeof(StartOfRound), "SetShipReadyToLand")] internal static class SetShipReadyToLand_Patch { [HarmonyPostfix] private static void Postfix() { if (Plugin.OnlyLateJoinInOrbit && StartOfRound.Instance.connectedPlayersAmount + 1 < StartOfRound.Instance.allPlayerScripts.Length) { Plugin.SetLobbyJoinable(joinable: true); } } } [HarmonyPatch(typeof(StartOfRound), "StartGame")] internal static class StartGame_Patch { [HarmonyPrefix] private static void Prefix() { Plugin.SetLobbyJoinable(joinable: false); } } [HarmonyPatch(typeof(StartOfRound), "OnShipLandedMiscEvents")] internal static class OnShipLandedMiscEvents_Patch { [HarmonyPostfix] private static void Postfix() { if (!Plugin.OnlyLateJoinInOrbit && StartOfRound.Instance.connectedPlayersAmount + 1 < StartOfRound.Instance.allPlayerScripts.Length) { Plugin.SetLobbyJoinable(joinable: true); } } } [HarmonyPatch(typeof(StartOfRound), "ShipLeave")] internal static class ShipLeave_Patch { [HarmonyPostfix] private static void Postfix() { Plugin.SetLobbyJoinable(joinable: false); } } }
BepInEx/plugins/BlueAmulet-LogNeuter/LogNeuter.dll
Decompiled 11 months agousing System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Text; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using UnityEngine; using UnityEngine.SceneManagement; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("LogNeuter")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("LogNeuter")] [assembly: AssemblyCopyright("Copyright © BlueAmulet 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("de27b4d1-820d-4505-a953-6001420281e4")] [assembly: AssemblyFileVersion("1.0.2")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.2.0")] namespace LogNeuter; [BepInPlugin("BlueAmulet.LogNeuter", "LogNeuter", "1.0.2")] public class LogNeuter : BaseUnityPlugin { internal const string Name = "LogNeuter"; internal const string Author = "BlueAmulet"; internal const string Version = "1.0.2"; private const string ID = "BlueAmulet.LogNeuter"; private static ManualLogSource Log; private static ConfigFile ConfigFile; private const int ConfVersion = 1; private static ConfigEntry<int> version; private static ConfigEntry<bool> fixSpatializer; private static ConfigEntry<bool> fixLookRotation; private static ConfigEntry<bool> genBlockAll; private static bool allowSave = false; private static bool warnSave = true; private static readonly Harmony harmony = new Harmony("BlueAmulet.LogNeuter"); private static readonly HarmonyMethod transpiler = new HarmonyMethod(AccessTools.Method(typeof(LogNeuter), "Transpiler", (Type[])null, (Type[])null)); private static readonly Dictionary<string, HashSet<string>> staticLogs = new Dictionary<string, HashSet<string>>(); private static readonly Dictionary<string, List<Regex>> dynamicLogs = new Dictionary<string, List<Regex>>(); private static StreamWriter genFile; public void Awake() { //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Expected O, but got Unknown //IL_0372: Unknown result type (might be due to invalid IL or missing references) //IL_0379: Expected O, but got Unknown //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_0258: Expected O, but got Unknown //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Expected O, but got Unknown Log = ((BaseUnityPlugin)this).Logger; ConfigFile = ((BaseUnityPlugin)this).Config; SceneManager.sceneLoaded += OnSceneLoaded; MethodBase methodBase = AccessTools.Method(typeof(ConfigFile), "Save", (Type[])null, (Type[])null); HarmonyMethod val = new HarmonyMethod(AccessTools.Method(typeof(LogNeuter), "PrefixConfigSave", (Type[])null, (Type[])null)); harmony.Patch(methodBase, val, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); if (AccessTools.DeclaredPropertyGetter(typeof(ConfigFile), "OrphanedEntries")?.Invoke(((BaseUnityPlugin)this).Config, null) is Dictionary<ConfigDefinition, string> dictionary) { ConfigDefinition key = new ConfigDefinition("Config", "Version"); if (dictionary.Count != 0 && !dictionary.ContainsKey(key)) { dictionary[key] = "0"; } } warnSave = false; version = ((BaseUnityPlugin)this).Config.Bind<int>("Config", "Version", 1, "Disable broken spatialize on audio sources"); fixSpatializer = ((BaseUnityPlugin)this).Config.Bind<bool>("Config", "FixSpatializer", true, "Disable broken spatialize on audio sources"); fixLookRotation = ((BaseUnityPlugin)this).Config.Bind<bool>("Config", "FixLookRotation", true, "Mask \"Look rotation viewing vector is zero\" messages"); genBlockAll = ((BaseUnityPlugin)this).Config.Bind<bool>("Config", "GenBlockAll", false, "Generate a config file that blocks all logging"); warnSave = true; if (version.Value < 1) { ((BaseUnityPlugin)this).Logger.LogWarning((object)$"Configuration out of date, expected version {1}, got {version.Value}"); } else if (version.Value > 1) { ((BaseUnityPlugin)this).Logger.LogError((object)$"Configuration too new, expected version {1}, got {version.Value}"); } if (genBlockAll.Value) { Assembly assembly = Array.Find(AppDomain.CurrentDomain.GetAssemblies(), (Assembly a) => a.GetName().Name == "Assembly-CSharp"); if (assembly != null) { genFile = new StreamWriter(Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Config.ConfigFilePath), "BlueAmulet.LogNeuter.Generated.cfg"), append: false, Encoding.UTF8); genFile.WriteLine("## This is a generated file, it does not actively do anything and only serves as reference for the real config file"); Harmony val2 = new Harmony("BlueAmulet.LogNeuter.Generated"); HarmonyMethod val3 = new HarmonyMethod(AccessTools.Method(typeof(LogNeuter), "TranspilerGen", (Type[])null, (Type[])null)); Type[] types = assembly.GetTypes(); foreach (Type type in types) { ((BaseUnityPlugin)this).Logger.LogInfo((object)("Scanning " + type.FullName)); MethodInfo[] methods = type.GetMethods(BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); foreach (MethodInfo methodInfo in methods) { try { val2.Patch((MethodBase)methodInfo, (HarmonyMethod)null, (HarmonyMethod)null, val3, (HarmonyMethod)null, (HarmonyMethod)null); val2.Unpatch((MethodBase)methodInfo, (HarmonyPatchType)3, "BlueAmulet.LogNeuter.Generated"); } catch (HarmonyException) { } } } genFile.Close(); } else { ((BaseUnityPlugin)this).Logger.LogError((object)"Could not find Assembly-CSharp, generation skipped"); } } if (fixLookRotation.Value) { MethodBase methodBase2 = AccessTools.Method(typeof(Quaternion), "LookRotation", new Type[2] { typeof(Vector3), typeof(Vector3) }, (Type[])null); HarmonyMethod val5 = new HarmonyMethod(AccessTools.Method(typeof(LogNeuter), "TranspilerLookRotation", (Type[])null, (Type[])null)); harmony.Patch(methodBase2, (HarmonyMethod)null, (HarmonyMethod)null, val5, (HarmonyMethod)null, (HarmonyMethod)null); } if (File.Exists(((BaseUnityPlugin)this).Config.ConfigFilePath)) { MethodBase methodBase3 = null; string text = null; foreach (string item in File.ReadLines(((BaseUnityPlugin)this).Config.ConfigFilePath)) { string text2 = item.Trim(); if (text2.Length == 0 || text2.StartsWith("#")) { continue; } if (text2.StartsWith("[") && text2.EndsWith("]")) { PatchMethod(methodBase3); methodBase3 = null; staticLogs.Clear(); text = text2.Substring(1, text2.Length - 2); if (!text.Contains("|")) { continue; } string[] array = text.Split(new char[1] { '|' }, 2); if (array.Length == 2) { string text3 = array[0]; if (!text3.Contains(",")) { text3 += ", Assembly-CSharp"; } Type type2 = Type.GetType(text3); if (type2 == null) { ((BaseUnityPlugin)this).Logger.LogWarning((object)("Could not find type: " + array[0])); continue; } methodBase3 = AccessTools.Method(type2, array[1], (Type[])null, (Type[])null); if (methodBase3 == null) { ((BaseUnityPlugin)this).Logger.LogWarning((object)("Could not find method: " + text)); } } else { ((BaseUnityPlugin)this).Logger.LogWarning((object)("Unknown entry: " + text)); } } else { if (text == null) { continue; } if (text2.StartsWith("^") && text2.EndsWith("$")) { if (!dynamicLogs.ContainsKey(text)) { dynamicLogs[text] = new List<Regex>(); } dynamicLogs[text].Add(new Regex(text2, RegexOptions.Compiled)); } else { if (!staticLogs.ContainsKey(text)) { staticLogs[text] = new HashSet<string>(); } staticLogs[text].Add(text2); } } } PatchMethod(methodBase3); } else { allowSave = true; ((BaseUnityPlugin)this).Config.Save(); allowSave = false; } int num = 0; foreach (MethodBase patchedMethod in harmony.GetPatchedMethods()) { ((BaseUnityPlugin)this).Logger.LogInfo((object)("Patched " + patchedMethod.DeclaringType.Name + "." + patchedMethod.Name)); num++; } ((BaseUnityPlugin)this).Logger.LogInfo((object)(num + " patches applied")); } private void OnSceneLoaded(Scene scene, LoadSceneMode mode) { if (!fixSpatializer.Value) { return; } int num = 0; AudioSource[] array = Resources.FindObjectsOfTypeAll<AudioSource>(); foreach (AudioSource val in array) { if (val.spatialize) { val.spatialize = false; num++; } } ((BaseUnityPlugin)this).Logger.LogInfo((object)$"Fixed {num} spatilization settings"); } private static bool PrefixConfigSave(ref ConfigFile __instance) { if (__instance == ConfigFile && !allowSave) { if (warnSave) { Log.LogWarning((object)"Saving LogNeuter config blocked for data loss prevention"); } return false; } return true; } private static IEnumerable<CodeInstruction> TranspilerLookRotation(IEnumerable<CodeInstruction> instructions, ILGenerator generator) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Expected O, but got Unknown //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Expected O, but got Unknown //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Expected O, but got Unknown //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Expected O, but got Unknown //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Expected O, but got Unknown //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Expected O, but got Unknown List<CodeInstruction> list = new List<CodeInstruction>(instructions); Label label = generator.DefineLabel(); list[0].labels.Add(label); list.InsertRange(0, new List<CodeInstruction> { new CodeInstruction(OpCodes.Ldarg_0, (object)null), new CodeInstruction(OpCodes.Call, (object)AccessTools.PropertyGetter(typeof(Vector3), "zero")), new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(Vector3), "op_Equality", (Type[])null, (Type[])null)), new CodeInstruction(OpCodes.Brfalse_S, (object)label), new CodeInstruction(OpCodes.Call, (object)AccessTools.PropertyGetter(typeof(Quaternion), "identity")), new CodeInstruction(OpCodes.Ret, (object)null) }); return list; } private static void PatchMethod(MethodBase patchMethod) { if (patchMethod != null) { string key = SectionName(patchMethod); if (staticLogs.ContainsKey(key) || dynamicLogs.ContainsKey(key)) { harmony.Patch(patchMethod, (HarmonyMethod)null, (HarmonyMethod)null, transpiler, (HarmonyMethod)null, (HarmonyMethod)null); } } } private static string SectionName(MethodBase method) { Type declaringType = method.DeclaringType; string name = declaringType.Assembly.GetName().Name; if (name == "Assembly-CSharp") { return declaringType.FullName + "|" + method.Name; } return declaringType.FullName + ", " + name + "|" + method.Name; } private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions, MethodBase original) { //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Expected O, but got Unknown //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Expected O, but got Unknown //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Expected O, but got Unknown string text = SectionName(original); bool flag = false; List<CodeInstruction> list = new List<CodeInstruction>(instructions); for (int i = 1; i < list.Count; i++) { CodeInstruction val = list[i]; if (!(val.opcode == OpCodes.Call) || !(val.operand is MethodInfo methodInfo) || !methodInfo.IsStatic || !(methodInfo.DeclaringType == typeof(Debug)) || !methodInfo.Name.StartsWith("Log") || !(methodInfo.Name != "LogException")) { continue; } CodeInstruction val2 = list[i - 1]; if (val2.opcode == OpCodes.Ldstr) { if (staticLogs.ContainsKey(text) && staticLogs[text].Contains((string)val2.operand)) { list[i] = new CodeInstruction(OpCodes.Pop, (object)null); flag = true; } } else if (dynamicLogs.ContainsKey(text)) { string text2 = methodInfo.Name + methodInfo.GetParameters().Length; MethodInfo methodInfo2 = AccessTools.Method(typeof(LogNeuter), text2, (Type[])null, (Type[])null); if (methodInfo2 != null) { list[i] = new CodeInstruction(OpCodes.Call, (object)methodInfo2); list.Insert(i, new CodeInstruction(OpCodes.Ldstr, (object)text)); flag = true; } } } if (!flag) { Log.LogWarning((object)("Made no changes to method: " + text)); } return list; } private static void GenWriteEntry(ref bool wroteHeader, string section, HashSet<string> strings, string log) { if (!strings.Contains(log)) { strings.Add(log); if (!wroteHeader) { genFile.WriteLine(); genFile.WriteLine("[" + section + "]"); wroteHeader = true; } if (!log.Contains("=")) { genFile.WriteLine(log); } } } private static IEnumerable<CodeInstruction> TranspilerGen(IEnumerable<CodeInstruction> instructions, MethodBase original) { List<CodeInstruction> list = new List<CodeInstruction>(instructions); Stream baseStream = genFile.BaseStream; if (baseStream != null && baseStream.CanWrite) { string section = SectionName(original); bool wroteHeader = false; HashSet<string> strings = new HashSet<string>(); for (int i = 1; i < list.Count; i++) { CodeInstruction val = list[i]; if (!(val.opcode == OpCodes.Call) || !(val.operand is MethodInfo methodInfo) || !methodInfo.IsStatic || !(methodInfo.DeclaringType == typeof(Debug)) || !methodInfo.Name.StartsWith("Log")) { continue; } CodeInstruction val2 = list[i - 1]; if (val2.opcode == OpCodes.Ldstr) { GenWriteEntry(ref wroteHeader, section, strings, (string)val2.operand); } else { if (!(val2.opcode == OpCodes.Call) || !(val2.operand is MethodInfo methodInfo2) || !methodInfo2.IsStatic || !(methodInfo2.DeclaringType == typeof(string)) || !(methodInfo2.Name == "Format")) { continue; } ParameterInfo[] parameters = methodInfo2.GetParameters(); if (parameters.Length == 0 || !(parameters[0].ParameterType == typeof(string))) { continue; } int num = i; do { num--; } while ((list[num].opcode != OpCodes.Ldstr || !((string)list[num].operand).Contains("{")) && num > 0); CodeInstruction val3 = list[num]; if (val3.opcode == OpCodes.Ldstr) { string text = (string)val3.operand; if (text.Contains("{") && text.Contains("}")) { string text2 = Regex.Escape(text); text2 = text2.Replace("\\ ", " "); text2 = Regex.Replace(text2, "\\\\{[0-9]+}", ".*?"); GenWriteEntry(ref wroteHeader, section, strings, "^" + text2 + "$"); } } } } } return list; } private static bool MatchAny(string section, string log) { if (section == null || !dynamicLogs.ContainsKey(section)) { return false; } foreach (Regex item in dynamicLogs[section]) { if (item.IsMatch(log)) { return true; } } return false; } public static void Log1(object message, string section) { if (!MatchAny(section, message.ToString())) { Debug.Log(message); } } public static void LogWarning1(object message, string section) { if (!MatchAny(section, message.ToString())) { Debug.LogWarning(message); } } public static void LogWarning2(object message, Object context, string section) { if (!MatchAny(section, message.ToString())) { Debug.LogWarning(message, context); } } public static void LogError1(object message, string section) { if (!MatchAny(section, message.ToString())) { Debug.LogError(message); } } public static void LogError2(object message, Object context, string section) { if (!MatchAny(section, message.ToString())) { Debug.LogError(message, context); } } }
BepInEx/plugins/Drakorle-MoreItems/MoreItems.dll
Decompiled 11 months agousing System; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using MoreItems.Patches; [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("MoreItems")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyDescription("My first plugin")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("MoreItems")] [assembly: AssemblyTitle("MoreItems")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [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 MoreItems { [BepInPlugin("MoreItems", "MoreItems", "1.0.0")] public class Plugin : BaseUnityPlugin { private readonly Harmony harmony = new Harmony("MoreItems"); private void Awake() { ((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin MoreItems is loaded!"); harmony.PatchAll(typeof(StartOfRoundPatch)); } } public static class PluginInfo { public const string PLUGIN_GUID = "MoreItems"; public const string PLUGIN_NAME = "MoreItems"; public const string PLUGIN_VERSION = "1.0.0"; } } namespace MoreItems.Patches { [HarmonyPatch(typeof(StartOfRound))] internal class StartOfRoundPatch { private const int newMaxItemCapacity = 999; [HarmonyPatch("Awake")] [HarmonyPostfix] private static void IncreaseShipItemCapacity(ref int ___maxShipItemCapacity) { ___maxShipItemCapacity = 999; Logger.CreateLogSource("MoreItems").LogInfo((object)$"Maximum amount of items that can be saved set to {999}."); } } }
BepInEx/plugins/EliteMasterEric-Coroner/Coroner.dll
Decompiled 11 months agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using Coroner.LCAPI; using GameNetcodeStuff; using HarmonyLib; using LC_API.ServerAPI; using Microsoft.CodeAnalysis; using TMPro; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("EliteMasterEric")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyDescription("Rework the Performance Report with new info, including cause of death.")] [assembly: AssemblyFileVersion("1.4.2.0")] [assembly: AssemblyInformationalVersion("1.4.2+57d4bb87a701adc39b5551b5ba1ecaf239a1871c")] [assembly: AssemblyProduct("Coroner")] [assembly: AssemblyTitle("Coroner")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.4.2.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [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 Coroner { internal class AdvancedDeathTracker { public const int PLAYER_CAUSE_OF_DEATH_DROPSHIP = 300; public static readonly string[] FUNNY_NOTES = new string[20] { "The goofiest goober.", "The cutest employee.", "Had the most fun.", "Had the least fun.", "The bravest employee.", "Did a sick flip.", "Stubbed their toe.", "The most likely to die next time.", "The least likely to die next time.", "Dislikes smoke.", "A team player.", "A real go-getter.", "Ate the most snacks.", "Passed GO and collected $200.", "Got freaky on a Friday night.", "I think this one's a serial killer.", "Perfectly unremarkable.", "Hasn't called their mother in a while.", "Has IP address 127.0.0.1.", "Secretly a lizard" }; private static readonly Dictionary<int, AdvancedCauseOfDeath> PlayerCauseOfDeath = new Dictionary<int, AdvancedCauseOfDeath>(); private static readonly Dictionary<int, string> PlayerNotes = new Dictionary<int, string>(); public static void ClearDeathTracker() { PlayerCauseOfDeath.Clear(); PlayerNotes.Clear(); } public static void SetCauseOfDeath(int playerIndex, AdvancedCauseOfDeath causeOfDeath, bool broadcast = true) { PlayerCauseOfDeath[playerIndex] = causeOfDeath; if (broadcast) { DeathBroadcaster.BroadcastCauseOfDeath(playerIndex, causeOfDeath); } } public static void SetCauseOfDeath(int playerIndex, CauseOfDeath causeOfDeath, bool broadcast = true) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) SetCauseOfDeath(playerIndex, ConvertCauseOfDeath(causeOfDeath), broadcast); } public static void SetCauseOfDeath(PlayerControllerB playerController, CauseOfDeath causeOfDeath, bool broadcast = true) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) SetCauseOfDeath((int)playerController.playerClientId, ConvertCauseOfDeath(causeOfDeath), broadcast); } public static void SetCauseOfDeath(PlayerControllerB playerController, AdvancedCauseOfDeath causeOfDeath, bool broadcast = true) { SetCauseOfDeath((int)playerController.playerClientId, causeOfDeath, broadcast); } public static AdvancedCauseOfDeath GetCauseOfDeath(int playerIndex) { PlayerControllerB playerController = StartOfRound.Instance.allPlayerScripts[playerIndex]; return GetCauseOfDeath(playerController); } public static AdvancedCauseOfDeath GetCauseOfDeath(PlayerControllerB playerController) { if (!PlayerCauseOfDeath.ContainsKey((int)playerController.playerClientId)) { Plugin.Instance.PluginLogger.LogDebug((object)$"Player {playerController.playerClientId} has no custom cause of death stored! Using fallback..."); return GuessCauseOfDeath(playerController); } Plugin.Instance.PluginLogger.LogDebug((object)$"Player {playerController.playerClientId} has custom cause of death stored! {PlayerCauseOfDeath[(int)playerController.playerClientId]}"); return PlayerCauseOfDeath[(int)playerController.playerClientId]; } public static AdvancedCauseOfDeath GuessCauseOfDeath(PlayerControllerB playerController) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Invalid comparison between Unknown and I4 //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Invalid comparison between Unknown and I4 if (playerController.isPlayerDead) { if (IsHoldingJetpack(playerController)) { if ((int)playerController.causeOfDeath == 2) { return AdvancedCauseOfDeath.Player_Jetpack_Gravity; } if ((int)playerController.causeOfDeath == 3) { return AdvancedCauseOfDeath.Player_Jetpack_Blast; } } return ConvertCauseOfDeath(playerController.causeOfDeath); } return AdvancedCauseOfDeath.Unknown; } public static bool IsHoldingJetpack(PlayerControllerB playerController) { GrabbableObject currentlyHeldObjectServer = playerController.currentlyHeldObjectServer; if ((Object)(object)currentlyHeldObjectServer == (Object)null) { return false; } GameObject gameObject = ((Component)currentlyHeldObjectServer).gameObject; if ((Object)(object)gameObject == (Object)null) { return false; } GrabbableObject component = gameObject.GetComponent<GrabbableObject>(); if ((Object)(object)component == (Object)null) { return false; } if (component is JetpackItem) { return true; } return false; } public static AdvancedCauseOfDeath ConvertCauseOfDeath(CauseOfDeath causeOfDeath) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0004: 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_003b: Expected I4, but got Unknown return (int)causeOfDeath switch { 0 => AdvancedCauseOfDeath.Unknown, 1 => AdvancedCauseOfDeath.Bludgeoning, 2 => AdvancedCauseOfDeath.Gravity, 3 => AdvancedCauseOfDeath.Blast, 4 => AdvancedCauseOfDeath.Strangulation, 5 => AdvancedCauseOfDeath.Suffocation, 6 => AdvancedCauseOfDeath.Mauling, 7 => AdvancedCauseOfDeath.Gunshots, 8 => AdvancedCauseOfDeath.Crushing, 9 => AdvancedCauseOfDeath.Drowning, 10 => AdvancedCauseOfDeath.Abandoned, 11 => AdvancedCauseOfDeath.Electrocution, _ => AdvancedCauseOfDeath.Unknown, }; } public static string StringifyCauseOfDeath(CauseOfDeath causeOfDeath) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return StringifyCauseOfDeath(ConvertCauseOfDeath(causeOfDeath), Plugin.RANDOM); } public static string StringifyCauseOfDeath(AdvancedCauseOfDeath? causeOfDeath) { return StringifyCauseOfDeath(causeOfDeath, Plugin.RANDOM); } public static string StringifyCauseOfDeath(AdvancedCauseOfDeath? causeOfDeath, Random random) { string[] array = SelectCauseOfDeath(causeOfDeath); if (array.Length == 1 || Plugin.Instance.PluginConfig.ShouldUseSeriousDeathMessages()) { return array[0]; } return array[random.Next(array.Length)]; } public static string[] SelectCauseOfDeath(AdvancedCauseOfDeath? causeOfDeath) { if (!causeOfDeath.HasValue) { return FUNNY_NOTES; } return causeOfDeath switch { AdvancedCauseOfDeath.Bludgeoning => new string[1] { "Bludgeoned to death." }, AdvancedCauseOfDeath.Gravity => new string[2] { "Fell to their death.", "Fell off a cliff." }, AdvancedCauseOfDeath.Blast => new string[3] { "Exploded.", "Went out with a bang.", "Was blown to smithereens." }, AdvancedCauseOfDeath.Strangulation => new string[1] { "Strangled to death." }, AdvancedCauseOfDeath.Suffocation => new string[1] { "Suffocated to death." }, AdvancedCauseOfDeath.Mauling => new string[1] { "Mauled to death." }, AdvancedCauseOfDeath.Gunshots => new string[2] { "Shot to death.", "Filled to the brim with bullets." }, AdvancedCauseOfDeath.Crushing => new string[1] { "Crushed to death." }, AdvancedCauseOfDeath.Drowning => new string[1] { "Drowned to death." }, AdvancedCauseOfDeath.Abandoned => new string[1] { "Abandoned by their coworkers." }, AdvancedCauseOfDeath.Electrocution => new string[1] { "Electrocuted to death." }, AdvancedCauseOfDeath.Kicking => new string[1] { "Kicked to death." }, AdvancedCauseOfDeath.Enemy_Bracken => new string[2] { "Had their neck snapped by a Bracken.", "Stared at a Bracken too long." }, AdvancedCauseOfDeath.Enemy_EyelessDog => new string[3] { "Was eaten by an Eyeless Dog.", "Got caught using a mechanical keyboard.", "Wasn't quiet around an Eyeless Dog." }, AdvancedCauseOfDeath.Enemy_ForestGiant => new string[1] { "Swallowed whole by a Forest Giant." }, AdvancedCauseOfDeath.Enemy_CircuitBees => new string[1] { "Electro-stung to death by Circuit Bees." }, AdvancedCauseOfDeath.Enemy_GhostGirl => new string[4] { "Died a mysterious death.", "Lost their mind.", "Got a real bad headache.", "???" }, AdvancedCauseOfDeath.Enemy_EarthLeviathan => new string[1] { "Swallowed whole by an Earth Leviathan." }, AdvancedCauseOfDeath.Enemy_BaboonHawk => new string[2] { "Was eaten by a Baboon Hawk.", "Was mauled by a Baboon Hawk." }, AdvancedCauseOfDeath.Enemy_Jester => new string[4] { "Mauled to death by a Jester.", "Was the butt of the Jester's joke.", "Got pranked by the Jester.", "Got popped like a weasel." }, AdvancedCauseOfDeath.Enemy_CoilHead => new string[3] { "Mauled to death by a Coil Head.", "Got in a staring contest with a Coil Head.", "Lost a staring contest with a Coil Head." }, AdvancedCauseOfDeath.Enemy_SnareFlea => new string[1] { "Was suffocated by a Snare Flea." }, AdvancedCauseOfDeath.Enemy_Hygrodere => new string[3] { "Was absorbed by a Hygrodere.", "Got lost in the sauce.", "Had an oopsie with a Hygrodere." }, AdvancedCauseOfDeath.Enemy_HoarderBug => new string[4] { "Was mauled by a Hoarder Bug.", "Was swarmed by a Hoarder Bug.", "Was hoarded by a Hoarder Bug.", "Tried to steal from a Hoarder Bug." }, AdvancedCauseOfDeath.Enemy_SporeLizard => new string[2] { "Was bitten by a Spore Lizard.", "Was puffed by a Spore Lizard." }, AdvancedCauseOfDeath.Enemy_BunkerSpider => new string[1] { "Ensnared in the Bunker Spider's web." }, AdvancedCauseOfDeath.Enemy_Thumper => new string[2] { "Was ravaged by a Thumper.", "Got thumped by a Thumper." }, AdvancedCauseOfDeath.Enemy_MaskedPlayer_Wear => new string[2] { "Donned the Mask.", "Nobody cared who they were until they put on the Mask." }, AdvancedCauseOfDeath.Enemy_MaskedPlayer_Victim => new string[2] { "Was killed by a Masked coworker.", "Became a tragedy at the hands of the Mask." }, AdvancedCauseOfDeath.Enemy_Nutcracker_Kicked => new string[2] { "Was kicked to death by a Nutcracker.", "Got their nuts cracked by a Nutcracker." }, AdvancedCauseOfDeath.Enemy_Nutcracker_Shot => new string[2] { "Got shot by a Nutcracker.", "Was at the wrong end of a 21-gun salute." }, AdvancedCauseOfDeath.Player_Jetpack_Gravity => new string[3] { "Fell while using a jetpack.", "Flew too close to the sun.", "Ran out of fuel." }, AdvancedCauseOfDeath.Player_Jetpack_Blast => new string[2] { "Blew up while using a Jetpack.", "Turned into a firework." }, AdvancedCauseOfDeath.Player_Murder_Melee => new string[4] { "Was bludgeoned to death by a coworker.", "Was the victim of a murder.", "Got murdered.", "Got backstabbed by a coworker." }, AdvancedCauseOfDeath.Player_Murder_Shotgun => new string[5] { "Was shot to death by a coworker.", "Was the victim of a murder.", "Got murdered.", "Got one-pumped by a coworker.", "Got 360-noscoped by a coworker." }, AdvancedCauseOfDeath.Player_Quicksand => new string[2] { "Got stuck in quicksand.", "Drowned in quicksand" }, AdvancedCauseOfDeath.Player_StunGrenade => new string[2] { "Got flashbanged by a coworker.", "Was the victim of a murder." }, AdvancedCauseOfDeath.Other_DepositItemsDesk => new string[2] { "Received a demotion.", "Was put on disciplinary leave." }, AdvancedCauseOfDeath.Other_Dropship => new string[3] { "Was crushed by the Item Dropship.", "Couldn't wait for their items.", "Got too impatient for their items." }, AdvancedCauseOfDeath.Other_Landmine => new string[1] { "Stepped on a landmine." }, AdvancedCauseOfDeath.Other_Turret => new string[1] { "Got shot by a turret." }, AdvancedCauseOfDeath.Other_Lightning => new string[1] { "Was struck by lightning." }, _ => new string[3] { "Died somehow.", "Most sincerely dead.", "Expired in an inexplicable manner." }, }; } internal static void SetCauseOfDeath(PlayerControllerB playerControllerB, object enemy_BaboonHawk) { throw new NotImplementedException(); } } internal enum AdvancedCauseOfDeath { Unknown, Bludgeoning, Gravity, Blast, Strangulation, Suffocation, Mauling, Gunshots, Crushing, Drowning, Abandoned, Electrocution, Kicking, Enemy_BaboonHawk, Enemy_Bracken, Enemy_CircuitBees, Enemy_CoilHead, Enemy_EarthLeviathan, Enemy_EyelessDog, Enemy_ForestGiant, Enemy_GhostGirl, Enemy_Hygrodere, Enemy_Jester, Enemy_SnareFlea, Enemy_SporeLizard, Enemy_HoarderBug, Enemy_Thumper, Enemy_BunkerSpider, Enemy_MaskedPlayer_Wear, Enemy_MaskedPlayer_Victim, Enemy_Nutcracker_Kicked, Enemy_Nutcracker_Shot, Player_Jetpack_Gravity, Player_Jetpack_Blast, Player_Quicksand, Player_Murder_Melee, Player_Murder_Shotgun, Player_StunGrenade, Other_Landmine, Other_Turret, Other_Lightning, Other_DepositItemsDesk, Other_Dropship } internal class DeathBroadcaster { private const string SIGNATURE_DEATH = "com.elitemastereric.coroner.death"; public static void Initialize() { if (Plugin.Instance.IsLCAPIPresent) { DeathBroadcasterLCAPI.Initialize(); } else { Plugin.Instance.PluginLogger.LogInfo((object)"LC_API is not present! Skipping registration..."); } } public static void BroadcastCauseOfDeath(int playerId, AdvancedCauseOfDeath causeOfDeath) { AttemptBroadcast(BuildDataCauseOfDeath(playerId, causeOfDeath), "com.elitemastereric.coroner.death"); } private static string BuildDataCauseOfDeath(int playerId, AdvancedCauseOfDeath causeOfDeath) { string text = playerId.ToString(); int num = (int)causeOfDeath; return text + "|" + num; } private static void AttemptBroadcast(string data, string signature) { if (Plugin.Instance.IsLCAPIPresent) { DeathBroadcasterLCAPI.AttemptBroadcast(data, signature); } else { Plugin.Instance.PluginLogger.LogInfo((object)"LC_API is not present! Skipping broadcast..."); } } } public static class PluginInfo { public const string PLUGIN_ID = "Coroner"; public const string PLUGIN_NAME = "Coroner"; public const string PLUGIN_VERSION = "1.4.2"; public const string PLUGIN_GUID = "com.elitemastereric.coroner"; } [BepInPlugin("com.elitemastereric.coroner", "Coroner", "1.4.2")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { public static readonly Random RANDOM = new Random(); public ManualLogSource PluginLogger; public PluginConfig PluginConfig; public bool IsLCAPIPresent = false; public static Plugin Instance { get; private set; } private void Awake() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown Instance = this; PluginLogger = ((BaseUnityPlugin)this).Logger; Harmony val = new Harmony("com.elitemastereric.coroner"); val.PatchAll(); PluginLogger.LogInfo((object)"Plugin Coroner (com.elitemastereric.coroner) is loaded!"); LoadConfig(); QueryLCAPI(); DeathBroadcaster.Initialize(); } private void QueryLCAPI() { PluginLogger.LogInfo((object)"Checking for LC_API..."); if (Chainloader.PluginInfos.ContainsKey("LC_API")) { Chainloader.PluginInfos.TryGetValue("LC_API", out var value); if (value == null) { PluginLogger.LogError((object)"Detected LC_API, but could not get plugin info!"); IsLCAPIPresent = false; } else { PluginLogger.LogInfo((object)("LCAPI is present! " + value.Metadata.GUID + ":" + value.Metadata.Version)); IsLCAPIPresent = true; } } else { PluginLogger.LogInfo((object)"LCAPI is not present."); IsLCAPIPresent = false; } } private void LoadConfig() { PluginConfig = new PluginConfig(); PluginConfig.BindConfig(((BaseUnityPlugin)this).Config); } } public class PluginConfig { private ConfigEntry<bool> DisplayCauseOfDeath; private ConfigEntry<bool> SeriousDeathMessages; private ConfigEntry<bool> DisplayFunnyNotes; private ConfigEntry<bool> DeathReplacesNotes; public void BindConfig(ConfigFile _config) { DisplayCauseOfDeath = _config.Bind<bool>("General", "DisplayCauseOfDeath", true, "Display the cause of death in the player notes."); SeriousDeathMessages = _config.Bind<bool>("General", "SeriousDeathMessages", false, "Cause of death messages are more to-the-point."); DisplayFunnyNotes = _config.Bind<bool>("General", "DisplayFunnyNotes", true, "Display a random note when the player has no notes."); DeathReplacesNotes = _config.Bind<bool>("General", "DeathReplacesNotes", true, "True to replace notes when the player dies, false to append."); } public bool ShouldDisplayCauseOfDeath() { return DisplayCauseOfDeath.Value; } public bool ShouldUseSeriousDeathMessages() { return SeriousDeathMessages.Value; } public bool ShouldDisplayFunnyNotes() { return DisplayFunnyNotes.Value; } public bool ShouldDeathReplaceNotes() { return DeathReplacesNotes.Value; } } } namespace Coroner.Patch { [HarmonyPatch(typeof(PlayerControllerB))] [HarmonyPatch("KillPlayer")] internal class PlayerControllerBKillPlayerPatch { public static void Prefix(PlayerControllerB __instance, ref CauseOfDeath causeOfDeath) { try { if ((int)causeOfDeath == 300) { Plugin.Instance.PluginLogger.LogDebug((object)"Player died from item dropship! Setting special cause of death..."); AdvancedDeathTracker.SetCauseOfDeath(__instance, AdvancedCauseOfDeath.Other_Dropship); causeOfDeath = (CauseOfDeath)8; } else if (__instance.isSinking && (int)causeOfDeath == 5) { Plugin.Instance.PluginLogger.LogDebug((object)"Player died of suffociation while sinking in quicksand! Setting special cause of death..."); AdvancedDeathTracker.SetCauseOfDeath(__instance, AdvancedCauseOfDeath.Player_Quicksand); } else if ((int)causeOfDeath != 3) { Plugin.Instance.PluginLogger.LogDebug((object)"Player is dying! No cause of death registered in hook..."); } } catch (Exception ex) { Plugin.Instance.PluginLogger.LogError((object)("Error in PlayerControllerBKillPlayerPatch.Prefix: " + ex)); Plugin.Instance.PluginLogger.LogError((object)ex.StackTrace); } } } [HarmonyPatch(typeof(DepositItemsDesk))] [HarmonyPatch("AnimationGrabPlayer")] internal class DepositItemsDeskAnimationGrabPlayerPatch { public static void Postfix(int playerID) { try { Plugin.Instance.PluginLogger.LogDebug((object)"Accessing state after tentacle devouring..."); PlayerControllerB playerController = StartOfRound.Instance.allPlayerScripts[playerID]; Plugin.Instance.PluginLogger.LogDebug((object)"Player is dying! Setting special cause of death..."); AdvancedDeathTracker.SetCauseOfDeath(playerController, AdvancedCauseOfDeath.Other_DepositItemsDesk); } catch (Exception ex) { Plugin.Instance.PluginLogger.LogError((object)("Error in DepositItemsDeskAnimationGrabPlayerPatch.Postfix: " + ex)); Plugin.Instance.PluginLogger.LogError((object)ex.StackTrace); } } } [HarmonyPatch(typeof(JesterAI))] [HarmonyPatch("killPlayerAnimation")] internal class JesterAIKillPlayerAnimationPatch { public static void Postfix(int playerId) { try { Plugin.Instance.PluginLogger.LogDebug((object)"Accessing state after Jester mauling..."); PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[playerId]; if ((Object)(object)val == (Object)null) { Plugin.Instance.PluginLogger.LogWarning((object)"Could not access player after death!"); return; } Plugin.Instance.PluginLogger.LogDebug((object)"Player is now dead! Setting special cause of death..."); AdvancedDeathTracker.SetCauseOfDeath(val, AdvancedCauseOfDeath.Enemy_Jester); } catch (Exception ex) { Plugin.Instance.PluginLogger.LogError((object)("Error in JesterAIKillPlayerAnimationPatch.Postfix: " + ex)); Plugin.Instance.PluginLogger.LogError((object)ex.StackTrace); } } } [HarmonyPatch(typeof(SandWormAI))] [HarmonyPatch("EatPlayer")] internal class SandWormAIEatPlayerPatch { public static void Postfix(PlayerControllerB playerScript) { try { Plugin.Instance.PluginLogger.LogDebug((object)"Accessing state after Sand Worm devouring..."); if ((Object)(object)playerScript == (Object)null) { Plugin.Instance.PluginLogger.LogWarning((object)"Could not access player after death!"); return; } Plugin.Instance.PluginLogger.LogDebug((object)"Player is now dead! Setting special cause of death..."); AdvancedDeathTracker.SetCauseOfDeath(playerScript, AdvancedCauseOfDeath.Enemy_EarthLeviathan); } catch (Exception ex) { Plugin.Instance.PluginLogger.LogError((object)("Error in SandWormAIEatPlayerPatch.Postfix: " + ex)); Plugin.Instance.PluginLogger.LogError((object)ex.StackTrace); } } } [HarmonyPatch(typeof(RedLocustBees))] [HarmonyPatch("BeeKillPlayerOnLocalClient")] internal class RedLocustBeesBeeKillPlayerOnLocalClientPatch { public static void Postfix(int playerId) { try { Plugin.Instance.PluginLogger.LogDebug((object)"Accessing state after Circuit Bee electrocution..."); PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[playerId]; if ((Object)(object)val == (Object)null) { Plugin.Instance.PluginLogger.LogWarning((object)"Could not access player after death!"); } else if (val.isPlayerDead) { Plugin.Instance.PluginLogger.LogDebug((object)"Player is now dead! Setting special cause of death..."); AdvancedDeathTracker.SetCauseOfDeath(val, AdvancedCauseOfDeath.Enemy_CircuitBees); } else { Plugin.Instance.PluginLogger.LogDebug((object)"Player is somehow still alive! Skipping..."); } } catch (Exception ex) { Plugin.Instance.PluginLogger.LogError((object)("Error in RedLocustBeesBeeKillPlayerOnLocalClientPatch.Postfix: " + ex)); Plugin.Instance.PluginLogger.LogError((object)ex.StackTrace); } } } [HarmonyPatch(typeof(DressGirlAI))] [HarmonyPatch("OnCollideWithPlayer")] internal class DressGirlAIOnCollideWithPlayerPatch { public static void Postfix(DressGirlAI __instance) { try { Plugin.Instance.PluginLogger.LogDebug((object)"Processing Ghost Girl player collision..."); if ((Object)(object)__instance.hauntingPlayer == (Object)null) { Plugin.Instance.PluginLogger.LogWarning((object)"Could not access player after collision!"); } else if (__instance.hauntingPlayer.isPlayerDead) { Plugin.Instance.PluginLogger.LogDebug((object)"Player is now dead! Setting special cause of death..."); AdvancedDeathTracker.SetCauseOfDeath(__instance.hauntingPlayer, AdvancedCauseOfDeath.Enemy_GhostGirl); } } catch (Exception ex) { Plugin.Instance.PluginLogger.LogError((object)("Error in DressGirlAIOnCollideWithPlayerPatch.Postfix: " + ex)); Plugin.Instance.PluginLogger.LogError((object)ex.StackTrace); } } } [HarmonyPatch(typeof(FlowermanAI))] [HarmonyPatch("killAnimation")] internal class FlowermanAIKillAnimationPatch { public static void Postfix(FlowermanAI __instance) { try { Plugin.Instance.PluginLogger.LogDebug((object)"Accessing state after Bracken snapping neck..."); if ((Object)(object)((EnemyAI)__instance).inSpecialAnimationWithPlayer == (Object)null) { Plugin.Instance.PluginLogger.LogWarning((object)"Could not access player after snapping neck!"); return; } Plugin.Instance.PluginLogger.LogDebug((object)"Player is now dead! Setting special cause of death..."); AdvancedDeathTracker.SetCauseOfDeath(((EnemyAI)__instance).inSpecialAnimationWithPlayer, AdvancedCauseOfDeath.Enemy_Bracken); } catch (Exception ex) { Plugin.Instance.PluginLogger.LogError((object)("Error in FlowermanAIKillAnimationPatch.Postfix: " + ex)); Plugin.Instance.PluginLogger.LogError((object)ex.StackTrace); } } } [HarmonyPatch(typeof(ForestGiantAI))] [HarmonyPatch("EatPlayerAnimation")] internal class ForestGiantAIEatPlayerAnimationPatch { public static void Postfix(PlayerControllerB playerBeingEaten) { try { Plugin.Instance.PluginLogger.LogDebug((object)"Accessing state after Forest Giant devouring..."); if ((Object)(object)playerBeingEaten == (Object)null) { Plugin.Instance.PluginLogger.LogWarning((object)"Could not access player after death!"); return; } Plugin.Instance.PluginLogger.LogDebug((object)"Player is now dead! Setting special cause of death..."); AdvancedDeathTracker.SetCauseOfDeath(playerBeingEaten, AdvancedCauseOfDeath.Enemy_ForestGiant); } catch (Exception ex) { Plugin.Instance.PluginLogger.LogError((object)("Error in ForestGiantAIEatPlayerAnimationPatch.Postfix: " + ex)); Plugin.Instance.PluginLogger.LogError((object)ex.StackTrace); } } } [HarmonyPatch(typeof(MouthDogAI))] [HarmonyPatch("KillPlayer")] internal class MouthDogAIKillPlayerPatch { public static void Postfix(int playerId) { try { Plugin.Instance.PluginLogger.LogDebug((object)"Accessing state after dog devouring..."); PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[playerId]; if ((Object)(object)val == (Object)null) { Plugin.Instance.PluginLogger.LogWarning((object)"Could not access player after death!"); return; } Plugin.Instance.PluginLogger.LogDebug((object)"Player is now dead! Setting special cause of death..."); AdvancedDeathTracker.SetCauseOfDeath(val, AdvancedCauseOfDeath.Enemy_EyelessDog); } catch (Exception ex) { Plugin.Instance.PluginLogger.LogError((object)("Error in MouthDogAIKillPlayerPatch.Postfix: " + ex)); Plugin.Instance.PluginLogger.LogError((object)ex.StackTrace); } } } [HarmonyPatch(typeof(CentipedeAI))] [HarmonyPatch("DamagePlayerOnIntervals")] internal class CentipedeAIDamagePlayerOnIntervalsPatch { public static void Postfix(CentipedeAI __instance) { //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Invalid comparison between Unknown and I4 try { Plugin.Instance.PluginLogger.LogDebug((object)"Handling Snare Flea damage..."); if ((Object)(object)__instance.clingingToPlayer == (Object)null) { Plugin.Instance.PluginLogger.LogWarning((object)"Could not access player being clung to!"); } else if (__instance.clingingToPlayer.isPlayerDead && (int)__instance.clingingToPlayer.causeOfDeath == 5) { Plugin.Instance.PluginLogger.LogDebug((object)"Player is now dead! Setting special cause of death..."); AdvancedDeathTracker.SetCauseOfDeath(__instance.clingingToPlayer, AdvancedCauseOfDeath.Enemy_SnareFlea); } else if (__instance.clingingToPlayer.isPlayerDead) { Plugin.Instance.PluginLogger.LogDebug((object)"Player somehow died while attacked by Snare Flea! Skipping..."); } } catch (Exception ex) { Plugin.Instance.PluginLogger.LogError((object)("Error in CentipedeAIDamagePlayerOnIntervalsPatch.Postfix: " + ex)); Plugin.Instance.PluginLogger.LogError((object)ex.StackTrace); } } } [HarmonyPatch(typeof(BaboonBirdAI))] [HarmonyPatch("OnCollideWithPlayer")] internal class BaboonBirdAIOnCollideWithPlayerPatch { public static void Postfix(Collider other) { try { Plugin.Instance.PluginLogger.LogDebug((object)"Handling Baboon Hawk damage..."); PlayerControllerB component = ((Component)other).gameObject.GetComponent<PlayerControllerB>(); if ((Object)(object)component == (Object)null) { Plugin.Instance.PluginLogger.LogWarning((object)"Could not access player after death!"); } else if (component.isPlayerDead) { Plugin.Instance.PluginLogger.LogDebug((object)"Player is now dead! Setting special cause of death..."); AdvancedDeathTracker.SetCauseOfDeath(component, AdvancedCauseOfDeath.Enemy_BaboonHawk); } else { Plugin.Instance.PluginLogger.LogDebug((object)"Player is somehow still alive! Skipping..."); } } catch (Exception ex) { Plugin.Instance.PluginLogger.LogError((object)("Error in BaboonBirdAIOnCollideWithPlayerPatch.Postfix: " + ex)); Plugin.Instance.PluginLogger.LogError((object)ex.StackTrace); } } } [HarmonyPatch(typeof(PlayerControllerB))] [HarmonyPatch("DamagePlayerFromOtherClientClientRpc")] internal class PlayerControllerBDamagePlayerFromOtherClientClientRpcPatch { public static void Postfix(PlayerControllerB __instance) { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Invalid comparison between Unknown and I4 //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Invalid comparison between Unknown and I4 //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Invalid comparison between Unknown and I4 try { Plugin.Instance.PluginLogger.LogDebug((object)"Handling friendly fire damage..."); if ((Object)(object)__instance == (Object)null) { Plugin.Instance.PluginLogger.LogWarning((object)"Could not access victim after death!"); } else if (__instance.isPlayerDead) { if ((int)__instance.causeOfDeath == 1) { Plugin.Instance.PluginLogger.LogDebug((object)"Player is now dead! Setting special cause of death..."); AdvancedDeathTracker.SetCauseOfDeath(__instance, AdvancedCauseOfDeath.Player_Murder_Melee); } else if ((int)__instance.causeOfDeath == 6) { Plugin.Instance.PluginLogger.LogDebug((object)"Player is now dead! Setting special cause of death..."); AdvancedDeathTracker.SetCauseOfDeath(__instance, AdvancedCauseOfDeath.Player_Murder_Melee); } else if ((int)__instance.causeOfDeath == 7) { Plugin.Instance.PluginLogger.LogDebug((object)"Player is now dead! Setting special cause of death..."); AdvancedDeathTracker.SetCauseOfDeath(__instance, AdvancedCauseOfDeath.Player_Murder_Shotgun); } else { Plugin.Instance.PluginLogger.LogWarning((object)("Player was killed by someone else but we don't know how! " + ((object)(CauseOfDeath)(ref __instance.causeOfDeath)).ToString())); } } else { Plugin.Instance.PluginLogger.LogDebug((object)"Player is somehow still alive! Skipping..."); } } catch (Exception ex) { Plugin.Instance.PluginLogger.LogError((object)("Error in PlayerControllerBDamagePlayerFromOtherClientClientRpcPatch.Postfix: " + ex)); Plugin.Instance.PluginLogger.LogError((object)ex.StackTrace); } } } [HarmonyPatch(typeof(PufferAI))] [HarmonyPatch("OnCollideWithPlayer")] internal class PufferAIOnCollideWithPlayerPatch { public static void Postfix(Collider other) { try { Plugin.Instance.PluginLogger.LogDebug((object)"Handling Spore Lizard damage..."); PlayerControllerB component = ((Component)other).gameObject.GetComponent<PlayerControllerB>(); if ((Object)(object)component == (Object)null) { Plugin.Instance.PluginLogger.LogWarning((object)"Could not access player after death!"); } else if (component.isPlayerDead) { Plugin.Instance.PluginLogger.LogDebug((object)"Player is now dead! Setting special cause of death..."); AdvancedDeathTracker.SetCauseOfDeath(component, AdvancedCauseOfDeath.Enemy_SporeLizard); } else { Plugin.Instance.PluginLogger.LogDebug((object)"Player is somehow still alive! Skipping..."); } } catch (Exception ex) { Plugin.Instance.PluginLogger.LogError((object)("Error in PufferAIOnCollideWithPlayerPatch.Postfix: " + ex)); Plugin.Instance.PluginLogger.LogError((object)ex.StackTrace); } } } [HarmonyPatch(typeof(SpringManAI))] [HarmonyPatch("OnCollideWithPlayer")] internal class SpringManAIOnCollideWithPlayerPatch { public static void Postfix(Collider other) { try { Plugin.Instance.PluginLogger.LogDebug((object)"Handling Coil Head damage..."); PlayerControllerB component = ((Component)other).gameObject.GetComponent<PlayerControllerB>(); if ((Object)(object)component == (Object)null) { Plugin.Instance.PluginLogger.LogWarning((object)"Could not access player after death!"); } else if (component.isPlayerDead) { Plugin.Instance.PluginLogger.LogDebug((object)"Player is now dead! Setting special cause of death..."); AdvancedDeathTracker.SetCauseOfDeath(component, AdvancedCauseOfDeath.Enemy_CoilHead); } else { Plugin.Instance.PluginLogger.LogDebug((object)"Player is somehow still alive! Skipping..."); } } catch (Exception ex) { Plugin.Instance.PluginLogger.LogError((object)("Error in SpringManAIOnCollideWithPlayerPatch.Postfix: " + ex)); Plugin.Instance.PluginLogger.LogError((object)ex.StackTrace); } } } [HarmonyPatch(typeof(BlobAI))] [HarmonyPatch("SlimeKillPlayerEffectServerRpc")] internal class BlobAISlimeKillPlayerEffectServerRpcPatch { public static void Postfix(int playerKilled) { try { PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[playerKilled]; if ((Object)(object)val == (Object)null) { Plugin.Instance.PluginLogger.LogWarning((object)"Could not access player after death!"); } else if (val.isPlayerDead) { Plugin.Instance.PluginLogger.LogDebug((object)"Player is now dead! Setting special cause of death..."); AdvancedDeathTracker.SetCauseOfDeath(val, AdvancedCauseOfDeath.Enemy_Hygrodere); } else { Plugin.Instance.PluginLogger.LogDebug((object)"Player is somehow still alive! Skipping..."); } } catch (Exception ex) { Plugin.Instance.PluginLogger.LogError((object)("Error in BlobAISlimeKillPlayerEffectServerRpcPatch.Postfix: " + ex)); Plugin.Instance.PluginLogger.LogError((object)ex.StackTrace); } } } [HarmonyPatch(typeof(HoarderBugAI))] [HarmonyPatch("OnCollideWithPlayer")] internal class HoarderBugAIOnCollideWithPlayerPatch { public static void Postfix(Collider other) { try { Plugin.Instance.PluginLogger.LogDebug((object)"Handling Hoarder Bug damage..."); PlayerControllerB component = ((Component)other).gameObject.GetComponent<PlayerControllerB>(); if ((Object)(object)component == (Object)null) { Plugin.Instance.PluginLogger.LogWarning((object)"Could not access player after death!"); } else if (component.isPlayerDead) { Plugin.Instance.PluginLogger.LogDebug((object)"Player is now dead! Setting special cause of death..."); AdvancedDeathTracker.SetCauseOfDeath(component, AdvancedCauseOfDeath.Enemy_HoarderBug); } else { Plugin.Instance.PluginLogger.LogDebug((object)"Player is somehow still alive! Skipping..."); } } catch (Exception ex) { Plugin.Instance.PluginLogger.LogError((object)("Error in HoarderBugAIOnCollideWithPlayerPatch.Postfix: " + ex)); Plugin.Instance.PluginLogger.LogError((object)ex.StackTrace); } } } [HarmonyPatch(typeof(CrawlerAI))] [HarmonyPatch("OnCollideWithPlayer")] internal class CrawlerAIOnCollideWithPlayerPatch { public static void Postfix(Collider other) { try { Plugin.Instance.PluginLogger.LogDebug((object)"Handling Thumper damage..."); PlayerControllerB component = ((Component)other).gameObject.GetComponent<PlayerControllerB>(); if ((Object)(object)component == (Object)null) { Plugin.Instance.PluginLogger.LogWarning((object)"Could not access player after death!"); } else if (component.isPlayerDead) { Plugin.Instance.PluginLogger.LogDebug((object)"Player is now dead! Setting special cause of death..."); AdvancedDeathTracker.SetCauseOfDeath(component, AdvancedCauseOfDeath.Enemy_Thumper); } else { Plugin.Instance.PluginLogger.LogDebug((object)"Player is somehow still alive! Skipping..."); } } catch (Exception ex) { Plugin.Instance.PluginLogger.LogError((object)("Error in CrawlerAIOnCollideWithPlayerPatch.Postfix: " + ex)); Plugin.Instance.PluginLogger.LogError((object)ex.StackTrace); } } } [HarmonyPatch(typeof(SandSpiderAI))] [HarmonyPatch("OnCollideWithPlayer")] internal class SandSpiderAIOnCollideWithPlayerPatch { public static void Postfix(Collider other) { try { Plugin.Instance.PluginLogger.LogDebug((object)"Handling Bunker Spider damage..."); PlayerControllerB component = ((Component)other).gameObject.GetComponent<PlayerControllerB>(); if ((Object)(object)component == (Object)null) { Plugin.Instance.PluginLogger.LogWarning((object)"Could not access player after death!"); } else if (component.isPlayerDead) { Plugin.Instance.PluginLogger.LogDebug((object)"Player is now dead! Setting special cause of death..."); AdvancedDeathTracker.SetCauseOfDeath(component, AdvancedCauseOfDeath.Enemy_BunkerSpider); } else { Plugin.Instance.PluginLogger.LogDebug((object)"Player is somehow still alive! Skipping..."); } } catch (Exception ex) { Plugin.Instance.PluginLogger.LogError((object)("Error in SandSpiderAIOnCollideWithPlayerPatch.Postfix: " + ex)); Plugin.Instance.PluginLogger.LogError((object)ex.StackTrace); } } } [HarmonyPatch(typeof(NutcrackerEnemyAI))] [HarmonyPatch("LegKickPlayer")] internal class NutcrackerEnemyAILegKickPlayerPatch { public static void Postfix(int playerId) { try { Plugin.Instance.PluginLogger.LogDebug((object)"Nutcracker kicked a player to death!"); PlayerControllerB playerController = StartOfRound.Instance.allPlayerScripts[playerId]; Plugin.Instance.PluginLogger.LogDebug((object)"Player is dying! Setting special cause of death..."); AdvancedDeathTracker.SetCauseOfDeath(playerController, AdvancedCauseOfDeath.Enemy_Nutcracker_Kicked); } catch (Exception ex) { Plugin.Instance.PluginLogger.LogError((object)("Error in NutcrackerEnemyAILegKickPlayerPatch.Postfix: " + ex)); Plugin.Instance.PluginLogger.LogError((object)ex.StackTrace); } } } [HarmonyPatch(typeof(ShotgunItem))] [HarmonyPatch("ShootGun")] internal class ShotgunItemShootGunPatch { public static void Postfix(ShotgunItem __instance) { //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Invalid comparison between Unknown and I4 try { Plugin.Instance.PluginLogger.LogDebug((object)"Handling shotgun shot..."); PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if ((Object)(object)localPlayerController == (Object)null) { Plugin.Instance.PluginLogger.LogWarning((object)"Could not access local player after shotgun shot!"); } else if (localPlayerController.isPlayerDead && (int)localPlayerController.causeOfDeath == 7) { if (((GrabbableObject)__instance).isHeldByEnemy) { Plugin.Instance.PluginLogger.LogDebug((object)"Player is now dead! Setting special cause of death..."); AdvancedDeathTracker.SetCauseOfDeath(localPlayerController, AdvancedCauseOfDeath.Enemy_Nutcracker_Shot); } else { Plugin.Instance.PluginLogger.LogDebug((object)"Player is now dead! Setting special cause of death..."); AdvancedDeathTracker.SetCauseOfDeath(localPlayerController, AdvancedCauseOfDeath.Player_Murder_Shotgun); } } else if (localPlayerController.isPlayerDead) { Plugin.Instance.PluginLogger.LogWarning((object)("Player died while attacked by shotgun? Skipping... " + ((object)(CauseOfDeath)(ref localPlayerController.causeOfDeath)).ToString())); } } catch (Exception ex) { Plugin.Instance.PluginLogger.LogError((object)("Error in ShotgunItemShootGunPatch.Postfix: " + ex)); Plugin.Instance.PluginLogger.LogError((object)ex.StackTrace); } } } [HarmonyPatch(typeof(MaskedPlayerEnemy))] [HarmonyPatch("killAnimation")] internal class MaskedPlayerEnemykillAnimationPatch { public static void Postfix(MaskedPlayerEnemy __instance) { try { Plugin.Instance.PluginLogger.LogDebug((object)"Masked Player killed someone..."); PlayerControllerB inSpecialAnimationWithPlayer = ((EnemyAI)__instance).inSpecialAnimationWithPlayer; if ((Object)(object)inSpecialAnimationWithPlayer == (Object)null) { Plugin.Instance.PluginLogger.LogWarning((object)"Could not access player after death!"); return; } Plugin.Instance.PluginLogger.LogDebug((object)"Player is now dead! Setting special cause of death..."); AdvancedDeathTracker.SetCauseOfDeath(inSpecialAnimationWithPlayer, AdvancedCauseOfDeath.Enemy_MaskedPlayer_Victim); } catch (Exception ex) { Plugin.Instance.PluginLogger.LogError((object)("Error in MaskedPlayerEnemykillAnimationPatch.Postfix: " + ex)); Plugin.Instance.PluginLogger.LogError((object)ex.StackTrace); } } } [HarmonyPatch(typeof(HauntedMaskItem))] [HarmonyPatch("FinishAttaching")] internal class HauntedMaskItemFinishAttachingPatch { public static void Postfix(HauntedMaskItem __instance) { try { Plugin.Instance.PluginLogger.LogDebug((object)"Masked Player killed someone..."); PlayerControllerB value = Traverse.Create((object)__instance).Field("previousPlayerHeldBy").GetValue<PlayerControllerB>(); if ((Object)(object)value == (Object)null) { Plugin.Instance.PluginLogger.LogWarning((object)"Could not access player after death!"); } else if (value.isPlayerDead) { Plugin.Instance.PluginLogger.LogDebug((object)"Player is now dead! Setting special cause of death..."); AdvancedDeathTracker.SetCauseOfDeath(value, AdvancedCauseOfDeath.Enemy_MaskedPlayer_Wear); } else { Plugin.Instance.PluginLogger.LogDebug((object)"Player is somehow still alive! Skipping..."); } } catch (Exception ex) { Plugin.Instance.PluginLogger.LogError((object)("Error in HauntedMaskItemFinishAttachingPatch.Postfix: " + ex)); Plugin.Instance.PluginLogger.LogError((object)ex.StackTrace); } } } [HarmonyPatch(typeof(ExtensionLadderItem))] [HarmonyPatch("StartLadderAnimation")] internal class ExtensionLadderItemStartLadderAnimationPatch { public static void Postfix(ExtensionLadderItem __instance) { //IL_00cf: Unknown result type (might be due to invalid IL or missing references) try { Plugin.Instance.PluginLogger.LogDebug((object)"Extension ladder started animation! Modifying kill trigger..."); GameObject gameObject = ((Component)__instance).gameObject; if ((Object)(object)gameObject == (Object)null) { Plugin.Instance.PluginLogger.LogError((object)"Could not fetch GameObject from ExtensionLadderItem."); } Transform val = gameObject.transform.Find("AnimContainer/MeshContainer/LadderMeshContainer/BaseLadder/LadderSecondPart/KillTrigger"); if ((Object)(object)val == (Object)null) { Plugin.Instance.PluginLogger.LogError((object)"Could not fetch KillTrigger Transform from ExtensionLadderItem."); } GameObject gameObject2 = ((Component)val).gameObject; if ((Object)(object)gameObject2 == (Object)null) { Plugin.Instance.PluginLogger.LogError((object)"Could not fetch KillTrigger GameObject from ExtensionLadderItem."); } KillLocalPlayer component = gameObject2.GetComponent<KillLocalPlayer>(); if ((Object)(object)component == (Object)null) { Plugin.Instance.PluginLogger.LogError((object)"Could not fetch KillLocalPlayer from KillTrigger GameObject."); } component.causeOfDeath = (CauseOfDeath)8; } catch (Exception ex) { Plugin.Instance.PluginLogger.LogError((object)("Error in ExtensionLadderItemStartLadderAnimationPatch.Postfix: " + ex)); Plugin.Instance.PluginLogger.LogError((object)ex.StackTrace); } } } [HarmonyPatch(typeof(ItemDropship))] [HarmonyPatch("Start")] internal class ItemDropshipStartPatch { public static void Postfix(ItemDropship __instance) { //IL_00d3: Unknown result type (might be due to invalid IL or missing references) try { Plugin.Instance.PluginLogger.LogDebug((object)"Item dropship spawned! Modifying kill trigger..."); GameObject gameObject = ((Component)__instance).gameObject; if ((Object)(object)gameObject == (Object)null) { Plugin.Instance.PluginLogger.LogError((object)"Could not fetch GameObject from ItemDropship."); } Transform val = gameObject.transform.Find("ItemShip/KillTrigger"); if ((Object)(object)val == (Object)null) { Plugin.Instance.PluginLogger.LogError((object)"Could not fetch KillTrigger Transform from ItemDropship."); } GameObject gameObject2 = ((Component)val).gameObject; if ((Object)(object)gameObject2 == (Object)null) { Plugin.Instance.PluginLogger.LogError((object)"Could not fetch KillTrigger GameObject from ItemDropship."); } KillLocalPlayer component = gameObject2.GetComponent<KillLocalPlayer>(); if ((Object)(object)component == (Object)null) { Plugin.Instance.PluginLogger.LogError((object)"Could not fetch KillLocalPlayer from KillTrigger GameObject."); } component.causeOfDeath = (CauseOfDeath)300; } catch (Exception ex) { Plugin.Instance.PluginLogger.LogError((object)("Error in ItemDropshipStartPatch.Postfix: " + ex)); Plugin.Instance.PluginLogger.LogError((object)ex.StackTrace); } } } [HarmonyPatch(typeof(Turret))] [HarmonyPatch("Update")] public class TurretUpdatePatch { public static void Postfix(Turret __instance) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Invalid comparison between Unknown and I4 //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Invalid comparison between Unknown and I4 if ((int)__instance.turretMode == 2) { PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if (localPlayerController.isPlayerDead && (int)localPlayerController.causeOfDeath == 7) { Plugin.Instance.PluginLogger.LogDebug((object)"Player is now dead! Setting special cause of death..."); AdvancedDeathTracker.SetCauseOfDeath(localPlayerController, AdvancedCauseOfDeath.Other_Turret); } } } } [HarmonyPatch(typeof(Landmine))] [HarmonyPatch("SpawnExplosion")] public class LandmineSpawnExplosionPatch { private const string KILL_PLAYER_SIGNATURE = "Void KillPlayer(UnityEngine.Vector3, Boolean, CauseOfDeath, Int32)"; private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator, MethodBase method) { List<CodeInstruction> list = new List<CodeInstruction>(instructions); List<CodeInstruction> list2 = BuildInstructionsToInsert(method); if (list2 == null) { Plugin.Instance.PluginLogger.LogError((object)"Could not build instructions to insert in LandmineSpawnExplosionPatch! Safely aborting..."); return instructions; } int num = -1; for (int i = 0; i < list.Count; i++) { CodeInstruction val = list[i]; if (val.opcode == OpCodes.Callvirt && val.operand.ToString() == "Void KillPlayer(UnityEngine.Vector3, Boolean, CauseOfDeath, Int32)") { num = i; break; } } if (num == -1) { Plugin.Instance.PluginLogger.LogError((object)"Could not find PlayerControllerB.KillPlayer call in LandmineSpawnExplosionPatch! Safely aborting..."); return instructions; } Plugin.Instance.PluginLogger.LogInfo((object)"Injecting patch into Landmine.SpawnExplosion..."); list.InsertRange(num, list2); Plugin.Instance.PluginLogger.LogInfo((object)"Done."); return list; } private static List<CodeInstruction> BuildInstructionsToInsert(MethodBase method) { //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Expected O, but got Unknown //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Expected O, but got Unknown //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Expected O, but got Unknown List<CodeInstruction> list = new List<CodeInstruction>(); int num = 2; IList<LocalVariableInfo> localVariables = method.GetMethodBody().LocalVariables; LocalVariableInfo localVariableInfo = null; for (int i = 0; i < localVariables.Count; i++) { LocalVariableInfo localVariableInfo2 = localVariables[i]; if (localVariableInfo2.LocalType == typeof(PlayerControllerB)) { if (localVariableInfo != null) { Plugin.Instance.PluginLogger.LogError((object)"Found multiple PlayerControllerB local variables in LandmineSpawnExplosionPatch!"); return null; } localVariableInfo = localVariableInfo2; break; } } list.Add(new CodeInstruction(OpCodes.Ldloc_S, (object)localVariableInfo.LocalIndex)); list.Add(new CodeInstruction(OpCodes.Ldarg, (object)num)); list.Add(new CodeInstruction(OpCodes.Call, (object)typeof(LandmineSpawnExplosionPatch).GetMethod("RewriteCauseOfDeath"))); return list; } public static void RewriteCauseOfDeath(PlayerControllerB targetPlayer, float killRange) { AdvancedCauseOfDeath causeOfDeath = AdvancedCauseOfDeath.Blast; if (killRange == 5f) { causeOfDeath = AdvancedCauseOfDeath.Player_Jetpack_Blast; } else if (killRange == 5.7f) { causeOfDeath = AdvancedCauseOfDeath.Other_Landmine; } else if (killRange == 2.4f) { causeOfDeath = AdvancedCauseOfDeath.Other_Lightning; } AdvancedDeathTracker.SetCauseOfDeath(targetPlayer, causeOfDeath); } } [HarmonyPatch(typeof(HUDManager))] [HarmonyPatch("FillEndGameStats")] internal class HUDManagerFillEndGameStatsPatch { public static void Postfix(HUDManager __instance) { try { OverridePerformanceReport(__instance); } catch (Exception ex) { Plugin.Instance.PluginLogger.LogError((object)("Error in HUDManagerFillEndGameStatsPatch.Postfix: " + ex)); Plugin.Instance.PluginLogger.LogError((object)ex.StackTrace); } } private static Random BuildSyncedRandom(HUDManager __instance) { int randomMapSeed = StartOfRound.Instance.randomMapSeed; Plugin.Instance.PluginLogger.LogDebug((object)("Syncing randomization to map seed: '" + randomMapSeed + "'")); return new Random(randomMapSeed); } private static void OverridePerformanceReport(HUDManager __instance) { Plugin.Instance.PluginLogger.LogDebug((object)"Applying Coroner patches to player notes..."); Random random = BuildSyncedRandom(__instance); for (int i = 0; i < __instance.statsUIElements.playerNotesText.Length; i++) { PlayerControllerB val = __instance.playersManager.allPlayerScripts[i]; if (!val.disconnectedMidGame && !val.isPlayerDead && !val.isPlayerControlled) { Plugin.Instance.PluginLogger.LogInfo((object)("Player " + i + " is not controlled by a player. Skipping...")); continue; } TextMeshProUGUI val2 = __instance.statsUIElements.playerNotesText[i]; if (val.isPlayerDead) { if (Plugin.Instance.PluginConfig.ShouldDisplayCauseOfDeath()) { if (Plugin.Instance.PluginConfig.ShouldDeathReplaceNotes()) { Plugin.Instance.PluginLogger.LogInfo((object)("[REPORT] Player " + i + " is dead! Replacing notes with Cause of Death...")); ((TMP_Text)val2).text = "Cause of Death: \n"; } else { Plugin.Instance.PluginLogger.LogInfo((object)("[REPORT] Player " + i + " is dead! Appending notes with Cause of Death...")); } AdvancedCauseOfDeath causeOfDeath = AdvancedDeathTracker.GetCauseOfDeath(val); string text = "* " + AdvancedDeathTracker.StringifyCauseOfDeath(causeOfDeath, random) + "\n"; ((TMP_Text)val2).text = ((TMP_Text)val2).text + text; } else { Plugin.Instance.PluginLogger.LogInfo((object)("[REPORT] Player " + i + " is dead, but Config says leave it be...")); } } else if (Plugin.Instance.PluginConfig.ShouldDisplayFunnyNotes()) { Plugin.Instance.PluginLogger.LogInfo((object)("[REPORT] Player " + i + " has no notes! Injecting something funny...")); string text2 = "* " + AdvancedDeathTracker.StringifyCauseOfDeath(null, random) + "\n"; ((TMP_Text)val2).text = ((TMP_Text)val2).text + text2; ((TMP_Text)val2).text = "Notes: \n"; ((TMP_Text)val2).text = ((TMP_Text)val2).text + text2; } else { Plugin.Instance.PluginLogger.LogInfo((object)("[REPORT] Player " + i + " has no notes, but Config says leave it be...")); } } AdvancedDeathTracker.ClearDeathTracker(); } } } namespace Coroner.LCAPI { internal class DeathBroadcasterLCAPI { private const string SIGNATURE_DEATH = "com.elitemastereric.coroner.death"; public static void Initialize() { Plugin.Instance.PluginLogger.LogDebug((object)"Initializing DeathBroadcaster..."); if (Plugin.Instance.IsLCAPIPresent) { Plugin.Instance.PluginLogger.LogDebug((object)"LC_API is present! Registering signature..."); Networking.GetString = (Action<string, string>)Delegate.Combine(Networking.GetString, new Action<string, string>(OnBroadcastString)); } else { Plugin.Instance.PluginLogger.LogError((object)"LC_API is not present! Why did you try to register the DeathBroadcaster?"); } } private static void OnBroadcastString(string data, string signature) { if (signature == "com.elitemastereric.coroner.death") { Plugin.Instance.PluginLogger.LogDebug((object)"Broadcast has been received from LC_API!"); string[] array = data.Split('|'); int playerIndex = int.Parse(array[0]); int num = int.Parse(array[1]); AdvancedCauseOfDeath advancedCauseOfDeath = (AdvancedCauseOfDeath)num; Plugin.Instance.PluginLogger.LogDebug((object)("Player " + playerIndex + " died of " + AdvancedDeathTracker.StringifyCauseOfDeath((AdvancedCauseOfDeath?)advancedCauseOfDeath))); AdvancedDeathTracker.SetCauseOfDeath(playerIndex, advancedCauseOfDeath, broadcast: false); } } public static void AttemptBroadcast(string data, string signature) { if (Plugin.Instance.IsLCAPIPresent) { Plugin.Instance.PluginLogger.LogDebug((object)"LC_API is present! Broadcasting..."); Networking.Broadcast(data, signature); } else { Plugin.Instance.PluginLogger.LogDebug((object)"LC_API is not present! Skipping broadcast..."); } } } }
BepInEx/plugins/Evaisa-LethalLib/LethalLib/LethalLib.dll
Decompiled 11 months agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using DunGen; using DunGen.Graph; using LethalLib.Extras; using LethalLib.Modules; using Microsoft.CodeAnalysis; using Mono.Cecil.Cil; using MonoMod.Cil; using MonoMod.RuntimeDetour; using On; using Unity.Netcode; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("LethalLib")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyDescription("Mod for Lethal Company")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+e240b2389e720ccbaf0153b7635890a084fde8b4")] [assembly: AssemblyProduct("LethalLib")] [assembly: AssemblyTitle("LethalLib")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] internal class <Module> { static <Module>() { } } namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [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 LethalLib { [BepInPlugin("evaisa.lethallib", "LethalLib", "0.8.0")] public class Plugin : BaseUnityPlugin { public const string ModGUID = "evaisa.lethallib"; public const string ModName = "LethalLib"; public const string ModVersion = "0.8.0"; public static AssetBundle MainAssets; public static ManualLogSource logger; private void Awake() { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Expected O, but got Unknown //IL_003f: Unknown result type (might be due to invalid IL or missing references) logger = ((BaseUnityPlugin)this).Logger; ((BaseUnityPlugin)this).Logger.LogInfo((object)"LethalLib loaded!!"); new ILHook((MethodBase)typeof(StackTrace).GetMethod("AddFrames", BindingFlags.Instance | BindingFlags.NonPublic), new Manipulator(IlHook)); Enemies.Init(); Items.Init(); Unlockables.Init(); MapObjects.Init(); Dungeon.Init(); Weathers.Init(); NetworkPrefabs.Init(); } private void IlHook(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown ILCursor val = new ILCursor(il); val.GotoNext(new Func<Instruction, bool>[1] { (Instruction x) => ILPatternMatchingExt.MatchCallvirt(x, (MethodBase)typeof(StackFrame).GetMethod("GetFileLineNumber", BindingFlags.Instance | BindingFlags.Public)) }); val.RemoveRange(2); val.EmitDelegate<Func<StackFrame, string>>((Func<StackFrame, string>)GetLineOrIL); } private static string GetLineOrIL(StackFrame instance) { int fileLineNumber = instance.GetFileLineNumber(); if (fileLineNumber == -1 || fileLineNumber == 0) { return "IL_" + instance.GetILOffset().ToString("X4"); } return fileLineNumber.ToString(); } } } namespace LethalLib.Modules { public class Dungeon { public class CustomDungeonArchetype { public DungeonArchetype archeType; public Levels.LevelTypes LevelTypes; public int lineIndex = -1; } public class CustomGraphLine { public GraphLine graphLine; public Levels.LevelTypes LevelTypes; } public class CustomDungeon { public int rarity; public DungeonFlow dungeonFlow; public Levels.LevelTypes LevelTypes; public int dungeonIndex = -1; public AudioClip firstTimeDungeonAudio; } [CompilerGenerated] private static class <>O { public static hook_GenerateNewFloor <0>__RoundManager_GenerateNewFloor; public static hook_Start <1>__RoundManager_Start; public static hook_Start <2>__StartOfRound_Start; } public static List<CustomDungeonArchetype> customDungeonArchetypes = new List<CustomDungeonArchetype>(); public static List<CustomGraphLine> customGraphLines = new List<CustomGraphLine>(); public static Dictionary<string, TileSet> extraTileSets = new Dictionary<string, TileSet>(); public static Dictionary<string, GameObjectChance> extraRooms = new Dictionary<string, GameObjectChance>(); public static List<CustomDungeon> customDungeons = new List<CustomDungeon>(); public static void Init() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Expected O, but got Unknown object obj = <>O.<0>__RoundManager_GenerateNewFloor; if (obj == null) { hook_GenerateNewFloor val = RoundManager_GenerateNewFloor; <>O.<0>__RoundManager_GenerateNewFloor = val; obj = (object)val; } RoundManager.GenerateNewFloor += (hook_GenerateNewFloor)obj; object obj2 = <>O.<1>__RoundManager_Start; if (obj2 == null) { hook_Start val2 = RoundManager_Start; <>O.<1>__RoundManager_Start = val2; obj2 = (object)val2; } RoundManager.Start += (hook_Start)obj2; object obj3 = <>O.<2>__StartOfRound_Start; if (obj3 == null) { hook_Start val3 = StartOfRound_Start; <>O.<2>__StartOfRound_Start = val3; obj3 = (object)val3; } StartOfRound.Start += (hook_Start)obj3; } private static void StartOfRound_Start(orig_Start orig, StartOfRound self) { //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Expected O, but got Unknown foreach (CustomDungeon dungeon in customDungeons) { SelectableLevel[] levels = self.levels; foreach (SelectableLevel val in levels) { string name = ((Object)val).name; if (Enum.IsDefined(typeof(Levels.LevelTypes), name)) { Levels.LevelTypes levelTypes = (Levels.LevelTypes)Enum.Parse(typeof(Levels.LevelTypes), name); if (dungeon.LevelTypes.HasFlag(levelTypes) && !val.dungeonFlowTypes.Any((IntWithRarity rarityInt) => rarityInt.id == dungeon.dungeonIndex)) { List<IntWithRarity> list = val.dungeonFlowTypes.ToList(); list.Add(new IntWithRarity { id = dungeon.dungeonIndex, rarity = dungeon.rarity }); val.dungeonFlowTypes = list.ToArray(); } } } } Plugin.logger.LogInfo((object)"Added custom dungeons to levels"); orig.Invoke(self); } private static void RoundManager_Start(orig_Start orig, RoundManager self) { foreach (CustomDungeon customDungeon in customDungeons) { if (self.dungeonFlowTypes.Contains(customDungeon.dungeonFlow)) { continue; } List<DungeonFlow> list = self.dungeonFlowTypes.ToList(); list.Add(customDungeon.dungeonFlow); self.dungeonFlowTypes = list.ToArray(); int dungeonIndex = self.dungeonFlowTypes.Length - 1; customDungeon.dungeonIndex = dungeonIndex; List<AudioClip> list2 = self.firstTimeDungeonAudios.ToList(); if (list2.Count != self.dungeonFlowTypes.Length - 1) { while (list2.Count < self.dungeonFlowTypes.Length - 1) { list2.Add(null); } } list2.Add(customDungeon.firstTimeDungeonAudio); self.firstTimeDungeonAudios = list2.ToArray(); } orig.Invoke(self); } private static void RoundManager_GenerateNewFloor(orig_GenerateNewFloor orig, RoundManager self) { string name = ((Object)self.currentLevel).name; if (Enum.IsDefined(typeof(Levels.LevelTypes), name)) { Levels.LevelTypes levelEnum = (Levels.LevelTypes)Enum.Parse(typeof(Levels.LevelTypes), name); int index = 0; self.dungeonGenerator.Generator.DungeonFlow.Lines.ForEach(delegate(GraphLine line) { foreach (CustomDungeonArchetype customDungeonArchetype in customDungeonArchetypes) { if (customDungeonArchetype.LevelTypes.HasFlag(levelEnum) && !line.DungeonArchetypes.Contains(customDungeonArchetype.archeType) && (customDungeonArchetype.lineIndex == -1 || customDungeonArchetype.lineIndex == index)) { line.DungeonArchetypes.Add(customDungeonArchetype.archeType); Plugin.logger.LogInfo((object)("Added " + ((Object)customDungeonArchetype.archeType).name + " to " + name)); } } foreach (DungeonArchetype dungeonArchetype in line.DungeonArchetypes) { string name2 = ((Object)dungeonArchetype).name; if (extraTileSets.ContainsKey(name2)) { TileSet val4 = extraTileSets[name2]; if (!dungeonArchetype.TileSets.Contains(val4)) { dungeonArchetype.TileSets.Add(val4); Plugin.logger.LogInfo((object)("Added " + ((Object)val4).name + " to " + name)); } } foreach (TileSet tileSet in dungeonArchetype.TileSets) { string name3 = ((Object)tileSet).name; if (extraRooms.ContainsKey(name3)) { GameObjectChance item = extraRooms[name3]; if (!tileSet.TileWeights.Weights.Contains(item)) { tileSet.TileWeights.Weights.Add(item); } } } } index++; }); foreach (CustomGraphLine customGraphLine in customGraphLines) { if (customGraphLine.LevelTypes.HasFlag(levelEnum) && !self.dungeonGenerator.Generator.DungeonFlow.Lines.Contains(customGraphLine.graphLine)) { self.dungeonGenerator.Generator.DungeonFlow.Lines.Add(customGraphLine.graphLine); } } } orig.Invoke(self); NetworkManager val = Object.FindObjectOfType<NetworkManager>(); RandomMapObject[] array = Object.FindObjectsOfType<RandomMapObject>(); RandomMapObject[] array2 = array; foreach (RandomMapObject val2 in array2) { for (int j = 0; j < val2.spawnablePrefabs.Count; j++) { string prefabName = ((Object)val2.spawnablePrefabs[j]).name; NetworkPrefab val3 = val.NetworkConfig.Prefabs.m_Prefabs.First((NetworkPrefab x) => ((Object)x.Prefab).name == prefabName); if (val3 != null && (Object)(object)val3.Prefab != (Object)(object)val2.spawnablePrefabs[j]) { val2.spawnablePrefabs[j] = val3.Prefab; } } } } public static void AddArchetype(DungeonArchetype archetype, Levels.LevelTypes levelFlags, int lineIndex = -1) { CustomDungeonArchetype customDungeonArchetype = new CustomDungeonArchetype(); customDungeonArchetype.archeType = archetype; customDungeonArchetype.LevelTypes = levelFlags; customDungeonArchetype.lineIndex = lineIndex; customDungeonArchetypes.Add(customDungeonArchetype); } public static void AddLine(GraphLine line, Levels.LevelTypes levelFlags) { CustomGraphLine customGraphLine = new CustomGraphLine(); customGraphLine.graphLine = line; customGraphLine.LevelTypes = levelFlags; customGraphLines.Add(customGraphLine); } public static void AddLine(DungeonGraphLineDef line, Levels.LevelTypes levelFlags) { AddLine(line.graphLine, levelFlags); } public static void AddTileSet(TileSet set, string archetypeName) { extraTileSets.Add(archetypeName, set); } public static void AddRoom(GameObjectChance room, string tileSetName) { extraRooms.Add(tileSetName, room); } public static void AddRoom(GameObjectChanceDef room, string tileSetName) { AddRoom(room.gameObjectChance, tileSetName); } public static void AddDungeon(DungeonDef dungeon, Levels.LevelTypes levelFlags) { AddDungeon(dungeon.dungeonFlow, dungeon.rarity, levelFlags, dungeon.firstTimeDungeonAudio); } public static void AddDungeon(DungeonFlow dungeon, int rarity, Levels.LevelTypes levelFlags, AudioClip firstTimeDungeonAudio = null) { customDungeons.Add(new CustomDungeon { dungeonFlow = dungeon, rarity = rarity, LevelTypes = levelFlags, firstTimeDungeonAudio = firstTimeDungeonAudio }); } } public class Enemies { public enum SpawnType { Default, Daytime, Outside } public class SpawnableEnemy { public EnemyType enemy; public int rarity; public Levels.LevelTypes spawnLevels; public SpawnType spawnType; public TerminalNode terminalNode; public TerminalKeyword infoKeyword; public string modName; public SpawnableEnemy(EnemyType enemy, int rarity, Levels.LevelTypes spawnLevels, SpawnType spawnType) { this.enemy = enemy; this.rarity = rarity; this.spawnLevels = spawnLevels; this.spawnType = spawnType; } } [CompilerGenerated] private static class <>O { public static hook_Awake <0>__RegisterLevelEnemies; public static hook_Start <1>__Terminal_Start; } public static List<SpawnableEnemy> spawnableEnemies = new List<SpawnableEnemy>(); public static void Init() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown object obj = <>O.<0>__RegisterLevelEnemies; if (obj == null) { hook_Awake val = RegisterLevelEnemies; <>O.<0>__RegisterLevelEnemies = val; obj = (object)val; } StartOfRound.Awake += (hook_Awake)obj; object obj2 = <>O.<1>__Terminal_Start; if (obj2 == null) { hook_Start val2 = Terminal_Start; <>O.<1>__Terminal_Start = val2; obj2 = (object)val2; } Terminal.Start += (hook_Start)obj2; } private static void Terminal_Start(orig_Start orig, Terminal self) { //IL_0273: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_0285: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Expected O, but got Unknown TerminalKeyword val = self.terminalNodes.allKeywords.First((TerminalKeyword keyword) => keyword.word == "info"); List<string> list = new List<string>(); foreach (SpawnableEnemy spawnableEnemy in spawnableEnemies) { if (list.Contains(spawnableEnemy.enemy.enemyName)) { Plugin.logger.LogInfo((object)("Skipping " + spawnableEnemy.enemy.enemyName + " because it was already added")); continue; } if ((Object)(object)spawnableEnemy.terminalNode == (Object)null) { spawnableEnemy.terminalNode = ScriptableObject.CreateInstance<TerminalNode>(); spawnableEnemy.terminalNode.displayText = spawnableEnemy.enemy.enemyName + "\n\nDanger level: Unknown\n\n[No information about this creature was found.]\n\n"; spawnableEnemy.terminalNode.clearPreviousText = true; spawnableEnemy.terminalNode.maxCharactersToType = 35; spawnableEnemy.terminalNode.creatureName = spawnableEnemy.enemy.enemyName; } if (self.enemyFiles.Any((TerminalNode x) => x.creatureName == spawnableEnemy.terminalNode.creatureName)) { Plugin.logger.LogInfo((object)("Skipping " + spawnableEnemy.enemy.enemyName + " because it was already added")); continue; } TerminalKeyword keyword2 = (((Object)(object)spawnableEnemy.infoKeyword != (Object)null) ? spawnableEnemy.infoKeyword : TerminalUtils.CreateTerminalKeyword(spawnableEnemy.terminalNode.creatureName.ToLowerInvariant().Replace(" ", "-"), isVerb: false, null, null, val)); keyword2.defaultVerb = val; List<TerminalKeyword> list2 = self.terminalNodes.allKeywords.ToList(); if (!list2.Any((TerminalKeyword x) => x.word == keyword2.word)) { list2.Add(keyword2); self.terminalNodes.allKeywords = list2.ToArray(); } List<CompatibleNoun> list3 = val.compatibleNouns.ToList(); if (!list3.Any((CompatibleNoun x) => x.noun.word == keyword2.word)) { list3.Add(new CompatibleNoun { noun = keyword2, result = spawnableEnemy.terminalNode }); } val.compatibleNouns = list3.ToArray(); spawnableEnemy.terminalNode.creatureFileID = self.enemyFiles.Count; self.enemyFiles.Add(spawnableEnemy.terminalNode); spawnableEnemy.enemy.enemyPrefab.GetComponentInChildren<ScanNodeProperties>().creatureScanID = spawnableEnemy.terminalNode.creatureFileID; } orig.Invoke(self); } private static void RegisterLevelEnemies(orig_Awake orig, StartOfRound self) { //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Expected O, but got Unknown orig.Invoke(self); SelectableLevel[] levels = self.levels; foreach (SelectableLevel val in levels) { string name = ((Object)val).name; if (!Enum.IsDefined(typeof(Levels.LevelTypes), name)) { continue; } Levels.LevelTypes levelTypes = (Levels.LevelTypes)Enum.Parse(typeof(Levels.LevelTypes), name); foreach (SpawnableEnemy spawnableEnemy in spawnableEnemies) { if (!spawnableEnemy.spawnLevels.HasFlag(levelTypes)) { continue; } SpawnableEnemyWithRarity item = new SpawnableEnemyWithRarity { enemyType = spawnableEnemy.enemy, rarity = spawnableEnemy.rarity }; switch (spawnableEnemy.spawnType) { case SpawnType.Default: if (!val.Enemies.Any((SpawnableEnemyWithRarity x) => (Object)(object)x.enemyType == (Object)(object)spawnableEnemy.enemy)) { val.Enemies.Add(item); Plugin.logger.LogInfo((object)("Added " + ((Object)spawnableEnemy.enemy).name + " to " + name + " with SpawnType [Default]")); } break; case SpawnType.Daytime: if (!val.DaytimeEnemies.Any((SpawnableEnemyWithRarity x) => (Object)(object)x.enemyType == (Object)(object)spawnableEnemy.enemy)) { val.DaytimeEnemies.Add(item); Plugin.logger.LogInfo((object)("Added " + ((Object)spawnableEnemy.enemy).name + " to " + name + " with SpawnType [Daytime]")); } break; case SpawnType.Outside: if (!val.OutsideEnemies.Any((SpawnableEnemyWithRarity x) => (Object)(object)x.enemyType == (Object)(object)spawnableEnemy.enemy)) { val.OutsideEnemies.Add(item); Plugin.logger.LogInfo((object)("Added " + ((Object)spawnableEnemy.enemy).name + " to " + name + " with SpawnType [Outside]")); } break; } } } } public static void RegisterEnemy(EnemyType enemy, int rarity, Levels.LevelTypes levelFlags, SpawnType spawnType, TerminalNode infoNode = null, TerminalKeyword infoKeyword = null) { SpawnableEnemy spawnableEnemy = new SpawnableEnemy(enemy, rarity, levelFlags, spawnType); spawnableEnemy.terminalNode = infoNode; spawnableEnemy.infoKeyword = infoKeyword; Assembly callingAssembly = Assembly.GetCallingAssembly(); string name = callingAssembly.GetName().Name; spawnableEnemy.modName = name; spawnableEnemies.Add(spawnableEnemy); } public static void RegisterEnemy(EnemyType enemy, int rarity, Levels.LevelTypes levelFlags, TerminalNode infoNode = null, TerminalKeyword infoKeyword = null) { SpawnableEnemy spawnableEnemy = new SpawnableEnemy(enemy, rarity, levelFlags, enemy.isDaytimeEnemy ? SpawnType.Daytime : (enemy.isOutsideEnemy ? SpawnType.Outside : SpawnType.Default)); spawnableEnemy.terminalNode = infoNode; spawnableEnemy.infoKeyword = infoKeyword; Assembly callingAssembly = Assembly.GetCallingAssembly(); string name = callingAssembly.GetName().Name; spawnableEnemy.modName = name; spawnableEnemies.Add(spawnableEnemy); } } public class Items { public class ScrapItem { public Item item; public int rarity; public Levels.LevelTypes spawnLevels; public string modName; public ScrapItem(Item item, int rarity, Levels.LevelTypes spawnLevels) { this.item = item; this.rarity = rarity; this.spawnLevels = spawnLevels; } } public class PlainItem { public Item item; public string modName; public PlainItem(Item item) { this.item = item; } } public class ShopItem { public Item item; public TerminalNode buyNode1; public TerminalNode buyNode2; public TerminalNode itemInfo; public int price; public string modName; public ShopItem(Item item, TerminalNode buyNode1 = null, TerminalNode buyNode2 = null, TerminalNode itemInfo = null, int price = 0) { this.item = item; this.price = price; if ((Object)(object)buyNode1 != (Object)null) { this.buyNode1 = buyNode1; } if ((Object)(object)buyNode2 != (Object)null) { this.buyNode2 = buyNode2; } if ((Object)(object)itemInfo != (Object)null) { this.itemInfo = itemInfo; } } } [CompilerGenerated] private static class <>O { public static hook_Awake <0>__StartOfRound_Awake; public static hook_Awake <1>__Terminal_Awake; } public static List<ScrapItem> scrapItems = new List<ScrapItem>(); public static List<ShopItem> shopItems = new List<ShopItem>(); public static List<PlainItem> plainItems = new List<PlainItem>(); public static void Init() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown object obj = <>O.<0>__StartOfRound_Awake; if (obj == null) { hook_Awake val = StartOfRound_Awake; <>O.<0>__StartOfRound_Awake = val; obj = (object)val; } StartOfRound.Awake += (hook_Awake)obj; object obj2 = <>O.<1>__Terminal_Awake; if (obj2 == null) { hook_Awake val2 = Terminal_Awake; <>O.<1>__Terminal_Awake = val2; obj2 = (object)val2; } Terminal.Awake += (hook_Awake)obj2; } private static void Terminal_Awake(orig_Awake orig, Terminal self) { //IL_02fe: Unknown result type (might be due to invalid IL or missing references) //IL_0303: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Unknown result type (might be due to invalid IL or missing references) //IL_0341: Expected O, but got Unknown //IL_0343: Unknown result type (might be due to invalid IL or missing references) //IL_0348: Unknown result type (might be due to invalid IL or missing references) //IL_037d: Unknown result type (might be due to invalid IL or missing references) //IL_0385: Expected O, but got Unknown //IL_03e9: Unknown result type (might be due to invalid IL or missing references) //IL_03ee: Unknown result type (might be due to invalid IL or missing references) //IL_03f6: Unknown result type (might be due to invalid IL or missing references) //IL_0403: Expected O, but got Unknown //IL_0497: Unknown result type (might be due to invalid IL or missing references) //IL_049c: Unknown result type (might be due to invalid IL or missing references) //IL_04a4: Unknown result type (might be due to invalid IL or missing references) //IL_04b1: Expected O, but got Unknown List<Item> list = self.buyableItemsList.ToList(); TerminalKeyword val = self.terminalNodes.allKeywords.First((TerminalKeyword keyword) => keyword.word == "buy"); TerminalNode result = val.compatibleNouns[0].result.terminalOptions[1].result; TerminalKeyword val2 = self.terminalNodes.allKeywords.First((TerminalKeyword keyword) => keyword.word == "info"); Plugin.logger.LogInfo((object)$"Adding {shopItems.Count} items to terminal"); foreach (ShopItem item in shopItems) { if (list.Any((Item x) => x.itemName == item.item.itemName)) { Plugin.logger.LogInfo((object)("Item " + item.item.itemName + " already exists in terminal, skipping")); continue; } if (item.price == -1) { item.price = item.item.creditsWorth; } else { item.item.creditsWorth = item.price; } list.Add(item.item); string itemName = item.item.itemName; char c = itemName[itemName.Length - 1]; string text = itemName; TerminalNode val3 = item.buyNode2; if ((Object)(object)val3 == (Object)null) { val3 = ScriptableObject.CreateInstance<TerminalNode>(); ((Object)val3).name = itemName.Replace(" ", "-") + "BuyNode2"; val3.displayText = "Ordered [variableAmount] " + text + ". Your new balance is [playerCredits].\n\nOur contractors enjoy fast, free shipping while on the job! Any purchased items will arrive hourly at your approximate location.\r\n\r\n"; val3.clearPreviousText = true; val3.maxCharactersToType = 15; } val3.buyItemIndex = list.Count - 1; val3.isConfirmationNode = false; val3.itemCost = item.price; val3.playSyncedClip = 0; TerminalNode val4 = item.buyNode1; if ((Object)(object)val4 == (Object)null) { val4 = ScriptableObject.CreateInstance<TerminalNode>(); ((Object)val4).name = itemName.Replace(" ", "-") + "BuyNode1"; val4.displayText = "You have requested to order " + text + ". Amount: [variableAmount].\nTotal cost of items: [totalCost].\n\nPlease CONFIRM or DENY.\r\n\r\n"; val4.clearPreviousText = true; val4.maxCharactersToType = 35; } val4.buyItemIndex = list.Count - 1; val4.isConfirmationNode = true; val4.overrideOptions = true; val4.itemCost = item.price; val4.terminalOptions = (CompatibleNoun[])(object)new CompatibleNoun[2] { new CompatibleNoun { noun = self.terminalNodes.allKeywords.First((TerminalKeyword keyword2) => keyword2.word == "confirm"), result = val3 }, new CompatibleNoun { noun = self.terminalNodes.allKeywords.First((TerminalKeyword keyword2) => keyword2.word == "deny"), result = result } }; TerminalKeyword val5 = TerminalUtils.CreateTerminalKeyword(itemName.ToLowerInvariant().Replace(" ", "-"), isVerb: false, null, null, val); List<TerminalKeyword> list2 = self.terminalNodes.allKeywords.ToList(); list2.Add(val5); self.terminalNodes.allKeywords = list2.ToArray(); List<CompatibleNoun> list3 = val.compatibleNouns.ToList(); list3.Add(new CompatibleNoun { noun = val5, result = val4 }); val.compatibleNouns = list3.ToArray(); TerminalNode val6 = item.itemInfo; if ((Object)(object)val6 == (Object)null) { val6 = ScriptableObject.CreateInstance<TerminalNode>(); ((Object)val6).name = itemName.Replace(" ", "-") + "InfoNode"; val6.displayText = "[No information about this object was found.]\n\n"; val6.clearPreviousText = true; val6.maxCharactersToType = 25; } self.terminalNodes.allKeywords = list2.ToArray(); List<CompatibleNoun> list4 = val2.compatibleNouns.ToList(); list4.Add(new CompatibleNoun { noun = val5, result = val6 }); val2.compatibleNouns = list4.ToArray(); Plugin.logger.LogInfo((object)(item.modName + " registered item: " + item.item.itemName)); } self.buyableItemsList = list.ToArray(); orig.Invoke(self); } private static void StartOfRound_Awake(orig_Awake orig, StartOfRound self) { //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Expected O, but got Unknown orig.Invoke(self); SelectableLevel[] levels = self.levels; foreach (SelectableLevel val in levels) { string name = ((Object)val).name; if (!Enum.IsDefined(typeof(Levels.LevelTypes), name)) { continue; } Levels.LevelTypes levelTypes = (Levels.LevelTypes)Enum.Parse(typeof(Levels.LevelTypes), name); foreach (ScrapItem scrapItem in scrapItems) { if (scrapItem.spawnLevels.HasFlag(levelTypes)) { SpawnableItemWithRarity item = new SpawnableItemWithRarity { spawnableItem = scrapItem.item, rarity = scrapItem.rarity }; if (!val.spawnableScrap.Any((SpawnableItemWithRarity x) => (Object)(object)x.spawnableItem == (Object)(object)scrapItem.item)) { val.spawnableScrap.Add(item); } } } } foreach (ScrapItem scrapItem2 in scrapItems) { if (!self.allItemsList.itemsList.Contains(scrapItem2.item)) { Plugin.logger.LogInfo((object)(scrapItem2.modName + " registered item: " + scrapItem2.item.itemName)); self.allItemsList.itemsList.Add(scrapItem2.item); } } foreach (ShopItem shopItem in shopItems) { if (!self.allItemsList.itemsList.Contains(shopItem.item)) { Plugin.logger.LogInfo((object)(shopItem.modName + " registered item: " + shopItem.item.itemName)); self.allItemsList.itemsList.Add(shopItem.item); } } foreach (PlainItem plainItem in plainItems) { if (!self.allItemsList.itemsList.Contains(plainItem.item)) { Plugin.logger.LogInfo((object)(plainItem.modName + " registered item: " + plainItem.item.itemName)); self.allItemsList.itemsList.Add(plainItem.item); } } } public static void RegisterScrap(Item spawnableItem, int rarity, Levels.LevelTypes levelFlags) { ScrapItem scrapItem = new ScrapItem(spawnableItem, rarity, levelFlags); Assembly callingAssembly = Assembly.GetCallingAssembly(); string name = callingAssembly.GetName().Name; scrapItem.modName = name; scrapItems.Add(scrapItem); } public static void RegisterShopItem(Item shopItem, TerminalNode buyNode1 = null, TerminalNode buyNode2 = null, TerminalNode itemInfo = null, int price = -1) { ShopItem shopItem2 = new ShopItem(shopItem, buyNode1, buyNode2, itemInfo, price); Assembly callingAssembly = Assembly.GetCallingAssembly(); string name = callingAssembly.GetName().Name; shopItem2.modName = name; shopItems.Add(shopItem2); } public static void RegisterShopItem(Item shopItem, int price = -1) { ShopItem shopItem2 = new ShopItem(shopItem, null, null, null, price); Assembly callingAssembly = Assembly.GetCallingAssembly(); string name = callingAssembly.GetName().Name; shopItem2.modName = name; shopItems.Add(shopItem2); } public static void RegisterItem(Item plainItem) { PlainItem plainItem2 = new PlainItem(plainItem); Assembly callingAssembly = Assembly.GetCallingAssembly(); string name = callingAssembly.GetName().Name; plainItem2.modName = name; plainItems.Add(plainItem2); } } public class Levels { [Flags] public enum LevelTypes { None = 1, ExperimentationLevel = 2, AssuranceLevel = 4, VowLevel = 8, OffenseLevel = 0x10, MarchLevel = 0x20, RendLevel = 0x40, DineLevel = 0x80, TitanLevel = 0x100, All = 0x1FE } } public class MapObjects { public class RegisteredMapObject { public SpawnableMapObject mapObject; public SpawnableOutsideObjectWithRarity outsideObject; public Levels.LevelTypes levels; public Func<SelectableLevel, AnimationCurve> spawnRateFunction; } [CompilerGenerated] private static class <>O { public static hook_Awake <0>__StartOfRound_Awake; public static hook_SpawnMapObjects <1>__RoundManager_SpawnMapObjects; } public static List<RegisteredMapObject> mapObjects = new List<RegisteredMapObject>(); public static void Init() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown object obj = <>O.<0>__StartOfRound_Awake; if (obj == null) { hook_Awake val = StartOfRound_Awake; <>O.<0>__StartOfRound_Awake = val; obj = (object)val; } StartOfRound.Awake += (hook_Awake)obj; object obj2 = <>O.<1>__RoundManager_SpawnMapObjects; if (obj2 == null) { hook_SpawnMapObjects val2 = RoundManager_SpawnMapObjects; <>O.<1>__RoundManager_SpawnMapObjects = val2; obj2 = (object)val2; } RoundManager.SpawnMapObjects += (hook_SpawnMapObjects)obj2; } private static void RoundManager_SpawnMapObjects(orig_SpawnMapObjects orig, RoundManager self) { RandomMapObject[] array = Object.FindObjectsOfType<RandomMapObject>(); RandomMapObject[] array2 = array; foreach (RandomMapObject val in array2) { foreach (RegisteredMapObject mapObject in mapObjects) { if (mapObject.mapObject != null && !val.spawnablePrefabs.Any((GameObject prefab) => (Object)(object)prefab == (Object)(object)mapObject.mapObject.prefabToSpawn)) { val.spawnablePrefabs.Add(mapObject.mapObject.prefabToSpawn); } } } orig.Invoke(self); } private static void StartOfRound_Awake(orig_Awake orig, StartOfRound self) { orig.Invoke(self); SelectableLevel[] levels = self.levels; foreach (SelectableLevel val in levels) { string name = ((Object)val).name; if (!Enum.IsDefined(typeof(Levels.LevelTypes), name)) { continue; } Levels.LevelTypes levelTypes = (Levels.LevelTypes)Enum.Parse(typeof(Levels.LevelTypes), name); foreach (RegisteredMapObject mapObject in mapObjects) { if (!mapObject.levels.HasFlag(levelTypes)) { continue; } if (mapObject.mapObject != null) { if (!val.spawnableMapObjects.Any((SpawnableMapObject x) => (Object)(object)x.prefabToSpawn == (Object)(object)mapObject.mapObject.prefabToSpawn)) { List<SpawnableMapObject> list = val.spawnableMapObjects.ToList(); list.RemoveAll((SpawnableMapObject x) => (Object)(object)x.prefabToSpawn == (Object)(object)mapObject.mapObject.prefabToSpawn); val.spawnableMapObjects = list.ToArray(); } SpawnableMapObject mapObject2 = mapObject.mapObject; if (mapObject.spawnRateFunction != null) { mapObject2.numberToSpawn = mapObject.spawnRateFunction(val); } List<SpawnableMapObject> list2 = val.spawnableMapObjects.ToList(); list2.Add(mapObject2); val.spawnableMapObjects = list2.ToArray(); Plugin.logger.LogInfo((object)("Added " + ((Object)mapObject2.prefabToSpawn).name + " to " + name)); } else { if (mapObject.outsideObject == null) { continue; } if (!val.spawnableOutsideObjects.Any((SpawnableOutsideObjectWithRarity x) => (Object)(object)x.spawnableObject.prefabToSpawn == (Object)(object)mapObject.outsideObject.spawnableObject.prefabToSpawn)) { List<SpawnableOutsideObjectWithRarity> list3 = val.spawnableOutsideObjects.ToList(); list3.RemoveAll((SpawnableOutsideObjectWithRarity x) => (Object)(object)x.spawnableObject.prefabToSpawn == (Object)(object)mapObject.outsideObject.spawnableObject.prefabToSpawn); val.spawnableOutsideObjects = list3.ToArray(); } SpawnableOutsideObjectWithRarity outsideObject = mapObject.outsideObject; if (mapObject.spawnRateFunction != null) { outsideObject.randomAmount = mapObject.spawnRateFunction(val); } List<SpawnableOutsideObjectWithRarity> list4 = val.spawnableOutsideObjects.ToList(); list4.Add(outsideObject); val.spawnableOutsideObjects = list4.ToArray(); Plugin.logger.LogInfo((object)("Added " + ((Object)outsideObject.spawnableObject.prefabToSpawn).name + " to " + name)); } } } } public static void RegisterMapObject(SpawnableMapObjectDef mapObject, Levels.LevelTypes levels, Func<SelectableLevel, AnimationCurve> spawnRateFunction = null) { RegisterMapObject(mapObject.spawnableMapObject, levels, spawnRateFunction); } public static void RegisterMapObject(SpawnableMapObject mapObject, Levels.LevelTypes levels, Func<SelectableLevel, AnimationCurve> spawnRateFunction = null) { mapObjects.Add(new RegisteredMapObject { mapObject = mapObject, levels = levels, spawnRateFunction = spawnRateFunction }); } public static void RegisterOutsideObject(SpawnableOutsideObjectDef mapObject, Levels.LevelTypes levels, Func<SelectableLevel, AnimationCurve> spawnRateFunction = null) { RegisterOutsideObject(mapObject.spawnableMapObject, levels, spawnRateFunction); } public static void RegisterOutsideObject(SpawnableOutsideObjectWithRarity mapObject, Levels.LevelTypes levels, Func<SelectableLevel, AnimationCurve> spawnRateFunction = null) { mapObjects.Add(new RegisteredMapObject { outsideObject = mapObject, levels = levels, spawnRateFunction = spawnRateFunction }); } } public class NetworkPrefabs { [CompilerGenerated] private static class <>O { public static hook_Start <0>__GameNetworkManager_Start; } private static List<GameObject> _networkPrefabs = new List<GameObject>(); internal static void Init() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown object obj = <>O.<0>__GameNetworkManager_Start; if (obj == null) { hook_Start val = GameNetworkManager_Start; <>O.<0>__GameNetworkManager_Start = val; obj = (object)val; } GameNetworkManager.Start += (hook_Start)obj; } public static void RegisterNetworkPrefab(GameObject prefab) { _networkPrefabs.Add(prefab); } private static void GameNetworkManager_Start(orig_Start orig, GameNetworkManager self) { orig.Invoke(self); foreach (GameObject networkPrefab in _networkPrefabs) { ((Component)self).GetComponent<NetworkManager>().AddNetworkPrefab(networkPrefab); } } } public class Shaders { public static void FixShaders(GameObject gameObject) { Renderer[] componentsInChildren = gameObject.GetComponentsInChildren<Renderer>(); foreach (Renderer val in componentsInChildren) { Material[] materials = val.materials; foreach (Material val2 in materials) { if (((Object)val2.shader).name.Contains("Standard")) { val2.shader = Shader.Find("HDRP/Lit"); } } } } } public class TerminalUtils { public static TerminalKeyword CreateTerminalKeyword(string word, bool isVerb = false, CompatibleNoun[] compatibleNouns = null, TerminalNode specialKeywordResult = null, TerminalKeyword defaultVerb = null, bool accessTerminalObjects = false) { TerminalKeyword val = ScriptableObject.CreateInstance<TerminalKeyword>(); ((Object)val).name = word; val.word = word; val.isVerb = isVerb; val.compatibleNouns = compatibleNouns; val.specialKeywordResult = specialKeywordResult; val.defaultVerb = defaultVerb; val.accessTerminalObjects = accessTerminalObjects; return val; } } public enum StoreType { None, ShipUpgrade, Decor } public class Unlockables { public class RegisteredUnlockable { public UnlockableItem unlockable; public StoreType StoreType; public TerminalNode buyNode1; public TerminalNode buyNode2; public TerminalNode itemInfo; public int price; public string modName; public RegisteredUnlockable(UnlockableItem unlockable, TerminalNode buyNode1 = null, TerminalNode buyNode2 = null, TerminalNode itemInfo = null, int price = -1) { this.unlockable = unlockable; this.buyNode1 = buyNode1; this.buyNode2 = buyNode2; this.itemInfo = itemInfo; this.price = price; } } [CompilerGenerated] private static class <>O { public static hook_Awake <0>__StartOfRound_Awake; public static hook_Start <1>__Terminal_Start; public static hook_TextPostProcess <2>__Terminal_TextPostProcess; } public static List<RegisteredUnlockable> registeredUnlockables = new List<RegisteredUnlockable>(); public static void Init() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Expected O, but got Unknown object obj = <>O.<0>__StartOfRound_Awake; if (obj == null) { hook_Awake val = StartOfRound_Awake; <>O.<0>__StartOfRound_Awake = val; obj = (object)val; } StartOfRound.Awake += (hook_Awake)obj; object obj2 = <>O.<1>__Terminal_Start; if (obj2 == null) { hook_Start val2 = Terminal_Start; <>O.<1>__Terminal_Start = val2; obj2 = (object)val2; } Terminal.Start += (hook_Start)obj2; object obj3 = <>O.<2>__Terminal_TextPostProcess; if (obj3 == null) { hook_TextPostProcess val3 = Terminal_TextPostProcess; <>O.<2>__Terminal_TextPostProcess = val3; obj3 = (object)val3; } Terminal.TextPostProcess += (hook_TextPostProcess)obj3; } private static string Terminal_TextPostProcess(orig_TextPostProcess orig, Terminal self, string modifiedDisplayText, TerminalNode node) { if (modifiedDisplayText.Contains("[buyableItemsList]") && modifiedDisplayText.Contains("[unlockablesSelectionList]")) { int num = modifiedDisplayText.IndexOf(":"); foreach (RegisteredUnlockable registeredUnlockable in registeredUnlockables) { if (registeredUnlockable.StoreType == StoreType.ShipUpgrade) { string unlockableName = registeredUnlockable.unlockable.unlockableName; int price = registeredUnlockable.price; string value = $"\n* {unlockableName} // Price: ${price}"; modifiedDisplayText = modifiedDisplayText.Insert(num + 1, value); } } } return orig.Invoke(self, modifiedDisplayText, node); } private static void Terminal_Start(orig_Start orig, Terminal self) { //IL_0390: Unknown result type (might be due to invalid IL or missing references) //IL_0395: Unknown result type (might be due to invalid IL or missing references) //IL_03ca: Unknown result type (might be due to invalid IL or missing references) //IL_03d3: Expected O, but got Unknown //IL_03d5: Unknown result type (might be due to invalid IL or missing references) //IL_03da: Unknown result type (might be due to invalid IL or missing references) //IL_040f: Unknown result type (might be due to invalid IL or missing references) //IL_0417: Expected O, but got Unknown //IL_049e: Unknown result type (might be due to invalid IL or missing references) //IL_04a3: Unknown result type (might be due to invalid IL or missing references) //IL_04b0: Unknown result type (might be due to invalid IL or missing references) //IL_04bd: Expected O, but got Unknown //IL_0551: Unknown result type (might be due to invalid IL or missing references) //IL_0556: Unknown result type (might be due to invalid IL or missing references) //IL_0563: Unknown result type (might be due to invalid IL or missing references) //IL_0570: Expected O, but got Unknown TerminalKeyword val = self.terminalNodes.allKeywords.First((TerminalKeyword keyword) => keyword.word == "buy"); TerminalNode result = val.compatibleNouns[0].result.terminalOptions[1].result; TerminalKeyword val2 = self.terminalNodes.allKeywords.First((TerminalKeyword keyword) => keyword.word == "info"); List<RegisteredUnlockable> list = registeredUnlockables.FindAll((RegisteredUnlockable unlockable) => unlockable.price != -1).ToList(); Plugin.logger.LogInfo((object)$"Adding {list.Count} items to terminal"); foreach (RegisteredUnlockable item in list) { string unlockableName = item.unlockable.unlockableName; TerminalKeyword keyword3 = TerminalUtils.CreateTerminalKeyword(unlockableName.ToLowerInvariant().Replace(" ", "-"), isVerb: false, null, null, val); if (self.terminalNodes.allKeywords.Any((TerminalKeyword kw) => kw.word == keyword3.word)) { Plugin.logger.LogInfo((object)("Keyword " + keyword3.word + " already registed, skipping.")); continue; } int shipUnlockableID = StartOfRound.Instance.unlockablesList.unlockables.FindIndex((UnlockableItem unlockable) => unlockable.unlockableName == item.unlockable.unlockableName); StartOfRound instance = StartOfRound.Instance; if ((Object)(object)instance == (Object)null) { Debug.Log((object)"STARTOFROUND INSTANCE NOT FOUND"); } if (item.price == -1 && (Object)(object)item.buyNode1 != (Object)null) { item.price = item.buyNode1.itemCost; } char c = unlockableName[unlockableName.Length - 1]; string text = unlockableName; TerminalNode val3 = item.buyNode2; if ((Object)(object)val3 == (Object)null) { val3 = ScriptableObject.CreateInstance<TerminalNode>(); ((Object)val3).name = unlockableName.Replace(" ", "-") + "BuyNode2"; val3.displayText = "Ordered [variableAmount] " + text + ". Your new balance is [playerCredits].\n\nOur contractors enjoy fast, free shipping while on the job! Any purchased items will arrive hourly at your approximate location.\r\n\r\n"; val3.clearPreviousText = true; val3.maxCharactersToType = 15; } val3.buyItemIndex = -1; val3.shipUnlockableID = shipUnlockableID; val3.buyUnlockable = true; val3.creatureName = unlockableName; val3.isConfirmationNode = false; val3.itemCost = item.price; val3.playSyncedClip = 0; TerminalNode val4 = item.buyNode1; if ((Object)(object)val4 == (Object)null) { val4 = ScriptableObject.CreateInstance<TerminalNode>(); ((Object)val4).name = unlockableName.Replace(" ", "-") + "BuyNode1"; val4.displayText = "You have requested to order " + text + ". Amount: [variableAmount].\nTotal cost of items: [totalCost].\n\nPlease CONFIRM or DENY.\r\n\r\n"; val4.clearPreviousText = true; val4.maxCharactersToType = 35; } val4.buyItemIndex = -1; val4.shipUnlockableID = shipUnlockableID; val4.creatureName = unlockableName; val4.isConfirmationNode = true; val4.overrideOptions = true; val4.itemCost = item.price; val4.terminalOptions = (CompatibleNoun[])(object)new CompatibleNoun[2] { new CompatibleNoun { noun = self.terminalNodes.allKeywords.First((TerminalKeyword keyword2) => keyword2.word == "confirm"), result = val3 }, new CompatibleNoun { noun = self.terminalNodes.allKeywords.First((TerminalKeyword keyword2) => keyword2.word == "deny"), result = result } }; if (item.StoreType == StoreType.Decor) { item.unlockable.shopSelectionNode = val4; } else { item.unlockable.shopSelectionNode = null; } List<TerminalKeyword> list2 = self.terminalNodes.allKeywords.ToList(); list2.Add(keyword3); self.terminalNodes.allKeywords = list2.ToArray(); List<CompatibleNoun> list3 = val.compatibleNouns.ToList(); list3.Add(new CompatibleNoun { noun = keyword3, result = val4 }); val.compatibleNouns = list3.ToArray(); TerminalNode val5 = item.itemInfo; if ((Object)(object)val5 == (Object)null) { val5 = ScriptableObject.CreateInstance<TerminalNode>(); ((Object)val5).name = unlockableName.Replace(" ", "-") + "InfoNode"; val5.displayText = "[No information about this object was found.]\n\n"; val5.clearPreviousText = true; val5.maxCharactersToType = 25; } self.terminalNodes.allKeywords = list2.ToArray(); List<CompatibleNoun> list4 = val2.compatibleNouns.ToList(); list4.Add(new CompatibleNoun { noun = keyword3, result = val5 }); val2.compatibleNouns = list4.ToArray(); Plugin.logger.LogInfo((object)(item.modName + " registered item: " + item.unlockable.unlockableName)); } orig.Invoke(self); } private static void StartOfRound_Awake(orig_Awake orig, StartOfRound self) { orig.Invoke(self); Plugin.logger.LogInfo((object)$"Adding {registeredUnlockables.Count} unlockables to unlockables list"); foreach (RegisteredUnlockable unlockable in registeredUnlockables) { if (self.unlockablesList.unlockables.Any((UnlockableItem x) => x.unlockableName == unlockable.unlockable.unlockableName)) { Plugin.logger.LogInfo((object)("Unlockable " + unlockable.unlockable.unlockableName + " already exists in unlockables list, skipping")); continue; } if ((Object)(object)unlockable.unlockable.prefabObject != (Object)null) { PlaceableShipObject componentInChildren = unlockable.unlockable.prefabObject.GetComponentInChildren<PlaceableShipObject>(); if ((Object)(object)componentInChildren != (Object)null) { componentInChildren.unlockableID = self.unlockablesList.unlockables.Count; } } self.unlockablesList.unlockables.Add(unlockable.unlockable); } } public static void RegisterUnlockable(UnlockableItemDef unlockable, int price = -1, StoreType storeType = StoreType.None) { RegisterUnlockable(unlockable.unlockable, storeType, null, null, null, price); } public static void RegisterUnlockable(UnlockableItem unlockable, int price = -1, StoreType storeType = StoreType.None) { RegisterUnlockable(unlockable, storeType, null, null, null, price); } public static void RegisterUnlockable(UnlockableItemDef unlockable, StoreType storeType = StoreType.None, TerminalNode buyNode1 = null, TerminalNode buyNode2 = null, TerminalNode itemInfo = null, int price = -1) { RegisterUnlockable(unlockable.unlockable, storeType, buyNode1, buyNode2, itemInfo, price); } public static void RegisterUnlockable(UnlockableItem unlockable, StoreType storeType = StoreType.None, TerminalNode buyNode1 = null, TerminalNode buyNode2 = null, TerminalNode itemInfo = null, int price = -1) { RegisteredUnlockable registeredUnlockable = new RegisteredUnlockable(unlockable, buyNode1, buyNode2, itemInfo, price); Assembly callingAssembly = Assembly.GetCallingAssembly(); string name = callingAssembly.GetName().Name; registeredUnlockable.modName = name; registeredUnlockable.StoreType = storeType; registeredUnlockables.Add(registeredUnlockable); } } public class Weathers { public class CustomWeather { public string name; public int weatherVariable1; public int weatherVariable2; public WeatherEffect weatherEffect; public Levels.LevelTypes levels; public CustomWeather(string name, WeatherEffect weatherEffect, Levels.LevelTypes levels = Levels.LevelTypes.None, int weatherVariable1 = 0, int weatherVariable2 = 0) { this.name = name; this.weatherVariable1 = weatherVariable1; this.weatherVariable2 = weatherVariable2; this.weatherEffect = weatherEffect; this.levels = levels; } } [CompilerGenerated] private static class <>O { public static hook_Awake <0>__TimeOfDay_Awake; public static hook_Awake <1>__StartOfRound_Awake; } public static Dictionary<int, CustomWeather> customWeathers = new Dictionary<int, CustomWeather>(); public static int numCustomWeathers = 0; public static void Init() { //IL_002f: 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_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Expected O, but got Unknown //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Expected O, but got Unknown new Hook((MethodBase)typeof(Enum).GetMethod("ToString", new Type[0]), typeof(Weathers).GetMethod("ToStringHook")); object obj = <>O.<0>__TimeOfDay_Awake; if (obj == null) { hook_Awake val = TimeOfDay_Awake; <>O.<0>__TimeOfDay_Awake = val; obj = (object)val; } TimeOfDay.Awake += (hook_Awake)obj; object obj2 = <>O.<1>__StartOfRound_Awake; if (obj2 == null) { hook_Awake val2 = StartOfRound_Awake; <>O.<1>__StartOfRound_Awake = val2; obj2 = (object)val2; } StartOfRound.Awake += (hook_Awake)obj2; } private static void StartOfRound_Awake(orig_Awake orig, StartOfRound self) { //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Expected O, but got Unknown SelectableLevel[] levels = self.levels; foreach (SelectableLevel val in levels) { string name = ((Object)val).name; if (!Enum.IsDefined(typeof(Levels.LevelTypes), name)) { continue; } Levels.LevelTypes levelTypes = (Levels.LevelTypes)Enum.Parse(typeof(Levels.LevelTypes), name); List<RandomWeatherWithVariables> list = val.randomWeathers.ToList(); foreach (KeyValuePair<int, CustomWeather> customWeather in customWeathers) { if (customWeather.Value.levels.HasFlag(levelTypes)) { list.Add(new RandomWeatherWithVariables { weatherType = (LevelWeatherType)customWeather.Key, weatherVariable = customWeather.Value.weatherVariable1, weatherVariable2 = customWeather.Value.weatherVariable2 }); Plugin.logger.LogInfo((object)$"Added weather {customWeather.Value.name} to level {((Object)val).name} at weather index: {customWeather.Key}"); } } val.randomWeathers = list.ToArray(); } orig.Invoke(self); } private static void TimeOfDay_Awake(orig_Awake orig, TimeOfDay self) { List<WeatherEffect> list = self.effects.ToList(); int num = 0; foreach (KeyValuePair<int, CustomWeather> customWeather in customWeathers) { if (customWeather.Key > num) { num = customWeather.Key; } } while (list.Count <= num) { list.Add(null); } foreach (KeyValuePair<int, CustomWeather> customWeather2 in customWeathers) { list[customWeather2.Key] = customWeather2.Value.weatherEffect; } self.effects = list.ToArray(); orig.Invoke(self); } public static string ToStringHook(Func<Enum, string> orig, Enum self) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected I4, but got Unknown //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Expected I4, but got Unknown if (self.GetType() == typeof(LevelWeatherType) && customWeathers.ContainsKey((int)(LevelWeatherType)(object)self)) { return customWeathers[(int)(LevelWeatherType)(object)self].name; } return orig(self); } public static void RegisterWeather(WeatherDef weather) { RegisterWeather(weather.weatherName, weather.weatherEffect, weather.levels, weather.weatherVariable1, weather.weatherVariable2); } public static void RegisterWeather(string name, WeatherEffect weatherEffect, Levels.LevelTypes levels = Levels.LevelTypes.None, int weatherVariable1 = 0, int weatherVariable2 = 0) { Array values = Enum.GetValues(typeof(LevelWeatherType)); int num = values.Length - 1; num += numCustomWeathers; numCustomWeathers++; Plugin.logger.LogInfo((object)$"Registering weather {name} at index {num - 1}"); customWeathers.Add(num, new CustomWeather(name, weatherEffect, levels, weatherVariable1, weatherVariable2)); } } } namespace LethalLib.Extras { [CreateAssetMenu(menuName = "ScriptableObjects/DungeonDef")] public class DungeonDef : ScriptableObject { public DungeonFlow dungeonFlow; [Range(0f, 300f)] public int rarity; public AudioClip firstTimeDungeonAudio; } [CreateAssetMenu(menuName = "ScriptableObjects/DungeonGraphLine")] public class DungeonGraphLineDef : ScriptableObject { public GraphLine graphLine; } [CreateAssetMenu(menuName = "ScriptableObjects/GameObjectChance")] public class GameObjectChanceDef : ScriptableObject { public GameObjectChance gameObjectChance; } [CreateAssetMenu(menuName = "ScriptableObjects/SpawnableMapObject")] public class SpawnableMapObjectDef : ScriptableObject { public SpawnableMapObject spawnableMapObject; } [CreateAssetMenu(menuName = "ScriptableObjects/SpawnableOutsideObject")] public class SpawnableOutsideObjectDef : ScriptableObject { public SpawnableOutsideObjectWithRarity spawnableMapObject; } [CreateAssetMenu(menuName = "ScriptableObjects/UnlockableItem")] public class UnlockableItemDef : ScriptableObject { public StoreType storeType = StoreType.None; public UnlockableItem unlockable; } [CreateAssetMenu(menuName = "ScriptableObjects/WeatherDef")] public class WeatherDef : ScriptableObject { public string weatherName; public Levels.LevelTypes levels = Levels.LevelTypes.None; public int weatherVariable1; public int weatherVariable2; public WeatherEffect weatherEffect; } }
BepInEx/plugins/Evaisa-LethalThings/LethalThings/LethalThings.dll
Decompiled 11 months ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text.RegularExpressions; using System.Threading; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using GameNetcodeStuff; using HarmonyLib; using LethalCompanyInputUtils.Api; using LethalLib.Extras; using LethalLib.Modules; using LethalThings.Extensions; using LethalThings.MonoBehaviours; using LethalThings.Patches; using Microsoft.CodeAnalysis; using MonoMod.RuntimeDetour; using On; using On.GameNetcodeStuff; using TMPro; using Unity.Netcode; using Unity.Netcode.Components; using UnityEngine; using UnityEngine.AI; using UnityEngine.Events; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; using UnityEngine.InputSystem.Utilities; using UnityEngine.Rendering.HighDefinition; 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("LethalThings")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyDescription("Mod for Lethal Company")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+86ae65aa973bc30ae45609c9c37649bfb7da4c59")] [assembly: AssemblyProduct("LethalThings")] [assembly: AssemblyTitle("LethalThings")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] internal class <Module> { static <Module>() { NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy<bool>(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable<bool>(); NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy<Vector3>(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable<Vector3>(); NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy<float>(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable<float>(); NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy<HackingTool.HackState>(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedValueEquals<HackingTool.HackState>(); } } namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [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 LethalLib.Modules { public class SaveData { [CompilerGenerated] private static class <>O { public static hook_ResetSavedGameValues <0>__GameNetworkManager_ResetSavedGameValues; public static hook_SaveItemsInShip <1>__GameNetworkManager_SaveItemsInShip; public static hook_LoadShipGrabbableItems <2>__StartOfRound_LoadShipGrabbableItems; } public static List<string> saveKeys = new List<string>(); public static void Init() { //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_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: 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_005b: Expected O, but got Unknown object obj = <>O.<0>__GameNetworkManager_ResetSavedGameValues; if (obj == null) { hook_ResetSavedGameValues val = GameNetworkManager_ResetSavedGameValues; <>O.<0>__GameNetworkManager_ResetSavedGameValues = val; obj = (object)val; } GameNetworkManager.ResetSavedGameValues += (hook_ResetSavedGameValues)obj; object obj2 = <>O.<1>__GameNetworkManager_SaveItemsInShip; if (obj2 == null) { hook_SaveItemsInShip val2 = GameNetworkManager_SaveItemsInShip; <>O.<1>__GameNetworkManager_SaveItemsInShip = val2; obj2 = (object)val2; } GameNetworkManager.SaveItemsInShip += (hook_SaveItemsInShip)obj2; object obj3 = <>O.<2>__StartOfRound_LoadShipGrabbableItems; if (obj3 == null) { hook_LoadShipGrabbableItems val3 = StartOfRound_LoadShipGrabbableItems; <>O.<2>__StartOfRound_LoadShipGrabbableItems = val3; obj3 = (object)val3; } StartOfRound.LoadShipGrabbableItems += (hook_LoadShipGrabbableItems)obj3; } private static void StartOfRound_LoadShipGrabbableItems(orig_LoadShipGrabbableItems orig, StartOfRound self) { orig.Invoke(self); SaveableObject[] array = Object.FindObjectsOfType<SaveableObject>(); SaveableNetworkBehaviour[] array2 = Object.FindObjectsOfType<SaveableNetworkBehaviour>(); SaveableObject[] array3 = array; for (int i = 0; i < array3.Length; i++) { array3[i].LoadObjectData(); } SaveableNetworkBehaviour[] array4 = array2; for (int i = 0; i < array4.Length; i++) { array4[i].LoadObjectData(); } if (ES3.KeyExists("LethalLibItemSaveKeys", GameNetworkManager.Instance.currentSaveFileName)) { saveKeys = ES3.Load<List<string>>("LethalLibItemSaveKeys", GameNetworkManager.Instance.currentSaveFileName); } } private static void GameNetworkManager_SaveItemsInShip(orig_SaveItemsInShip orig, GameNetworkManager self) { orig.Invoke(self); SaveableObject[] array = Object.FindObjectsOfType<SaveableObject>(); SaveableNetworkBehaviour[] array2 = Object.FindObjectsOfType<SaveableNetworkBehaviour>(); SaveableObject[] array3 = array; for (int i = 0; i < array3.Length; i++) { array3[i].SaveObjectData(); } SaveableNetworkBehaviour[] array4 = array2; for (int i = 0; i < array4.Length; i++) { array4[i].SaveObjectData(); } ES3.Save<List<string>>("LethalLibItemSaveKeys", saveKeys, GameNetworkManager.Instance.currentSaveFileName); } private static void GameNetworkManager_ResetSavedGameValues(orig_ResetSavedGameValues orig, GameNetworkManager self) { orig.Invoke(self); foreach (string saveKey in saveKeys) { ES3.DeleteKey(saveKey, GameNetworkManager.Instance.currentSaveFileName); } saveKeys.Clear(); } public static void SaveObjectData<T>(string key, T data, int objectId) { List<T> list = new List<T>(); if (ES3.KeyExists("LethalThingsSave_" + key, GameNetworkManager.Instance.currentSaveFileName)) { list = ES3.Load<List<T>>("LethalThingsSave_" + key, GameNetworkManager.Instance.currentSaveFileName); } List<int> list2 = new List<int>(); if (ES3.KeyExists("LethalThingsSave_objectIds_" + key, GameNetworkManager.Instance.currentSaveFileName)) { list2 = ES3.Load<List<int>>("LethalThingsSave_objectIds_" + key, GameNetworkManager.Instance.currentSaveFileName); } list.Add(data); list2.Add(objectId); if (!saveKeys.Contains("LethalThingsSave_" + key)) { saveKeys.Add("LethalThingsSave_" + key); } if (!saveKeys.Contains("LethalThingsSave_objectIds_" + key)) { saveKeys.Add("LethalThingsSave_objectIds_" + key); } ES3.Save<List<T>>("LethalThingsSave_" + key, list, GameNetworkManager.Instance.currentSaveFileName); ES3.Save<List<int>>("LethalThingsSave_objectIds_" + key, list2, GameNetworkManager.Instance.currentSaveFileName); } public static T LoadObjectData<T>(string key, int objectId) { List<T> list = new List<T>(); if (ES3.KeyExists("LethalThingsSave_" + key, GameNetworkManager.Instance.currentSaveFileName)) { list = ES3.Load<List<T>>("LethalThingsSave_" + key, GameNetworkManager.Instance.currentSaveFileName); } List<int> list2 = new List<int>(); if (ES3.KeyExists("LethalThingsSave_objectIds_" + key, GameNetworkManager.Instance.currentSaveFileName)) { list2 = ES3.Load<List<int>>("LethalThingsSave_objectIds_" + key, GameNetworkManager.Instance.currentSaveFileName); } if (!saveKeys.Contains("LethalThingsSave_" + key)) { saveKeys.Add("LethalThingsSave_" + key); } if (!saveKeys.Contains("LethalThingsSave_objectIds_" + key)) { saveKeys.Add("LethalThingsSave_objectIds_" + key); } if (list2.Contains(objectId)) { int index = list2.IndexOf(objectId); return list[index]; } return default(T); } } } namespace LethalThings { public class Config { public static ConfigEntry<int> arsonSpawnWeight; public static ConfigEntry<int> dirtyArsonSpawnWeight; public static ConfigEntry<int> toimariSpawnWeight; public static ConfigEntry<int> hamisSpawnWeight; public static ConfigEntry<int> cookieSpawnWeight; public static ConfigEntry<int> maxwellSpawnWeight; public static ConfigEntry<float> evilMaxwellChance; public static ConfigEntry<bool> maxwellPlayMusicDefault; public static ConfigEntry<int> glizzySpawnChance; public static ConfigEntry<int> revolverSpawnChance; public static ConfigEntry<int> gremlinSodaSpawnChance; public static ConfigEntry<bool> toyHammerEnabled; public static ConfigEntry<int> toyHammerPrice; public static ConfigEntry<bool> pouchyBeltEnabled; public static ConfigEntry<int> pouchyBeltPrice; public static ConfigEntry<bool> remoteRadarEnabled; public static ConfigEntry<int> remoteRadarPrice; public static ConfigEntry<bool> rocketLauncherEnabled; public static ConfigEntry<int> rocketLauncherPrice; public static ConfigEntry<bool> hackingToolEnabled; public static ConfigEntry<int> hackingToolPrice; public static ConfigEntry<bool> flareGunEnabled; public static ConfigEntry<int> flareGunPrice; public static ConfigEntry<int> flareGunAmmoPrice; public static ConfigEntry<int> boombaSpawnWeight; public static ConfigEntry<bool> rugsEnabled; public static ConfigEntry<int> smallRugPrice; public static ConfigEntry<int> largeRugPrice; public static ConfigEntry<bool> fatalitiesSignEnabled; public static ConfigEntry<int> fatalitiesSignPrice; public static ConfigEntry<bool> dartBoardEnabled; public static ConfigEntry<int> dartBoardPrice; public static ConfigEntry<bool> teleporterTrapsEnabled; public static ConfigEntry<bool> enableItemChargerElectrocution; public static ConfigEntry<int> itemChargerElectrocutionDamage; public static ConfigEntry<bool> disableOverlappingModContent; public static ConfigFile VolumeConfig; public static ConfigEntry<string> version; public static void Load() { //IL_04ae: Unknown result type (might be due to invalid IL or missing references) //IL_04b8: Expected O, but got Unknown arsonSpawnWeight = Plugin.config.Bind<int>("Scrap", "Arson", 5, "How much does Arson spawn, higher = more common"); dirtyArsonSpawnWeight = Plugin.config.Bind<int>("Scrap", "DirtyArson", 5, "How much does Arson (Dirty) spawn, higher = more common"); toimariSpawnWeight = Plugin.config.Bind<int>("Scrap", "Toimari", 10, "How much does Toimari spawn, higher = more common"); hamisSpawnWeight = Plugin.config.Bind<int>("Scrap", "Hamis", 10, "How much does Hamis spawn, higher = more common"); cookieSpawnWeight = Plugin.config.Bind<int>("Scrap", "Cookie", 10, "How much does Cookie spawn, higher = more common"); maxwellSpawnWeight = Plugin.config.Bind<int>("Scrap", "Maxwell", 3, "How much does Maxwell spawn, higher = more common"); evilMaxwellChance = Plugin.config.Bind<float>("Scrap", "MaxwellEvilChance", 10f, "Chance for maxwell to be evil, percentage."); maxwellPlayMusicDefault = Plugin.config.Bind<bool>("Scrap", "MaxwellPlayMusicDefault", true, "Does Maxwell play music by default?"); glizzySpawnChance = Plugin.config.Bind<int>("Scrap", "GlizzySpawnChance", 5, "How much do glizzies spawn, higher = more common"); revolverSpawnChance = Plugin.config.Bind<int>("Scrap", "Revolver", 10, "How much do revolvers spawn, higher = more common"); gremlinSodaSpawnChance = Plugin.config.Bind<int>("Scrap", "GremlinEnergyDrink", 10, "How much does Gremlin Energy Drink spawn, higher = more common"); toyHammerEnabled = Plugin.config.Bind<bool>("Items", "ToyHammer", true, "Is Toy Hammer enabled?"); toyHammerPrice = Plugin.config.Bind<int>("Items", "ToyHammerPrice", 15, "How much does Toy Hammer cost?"); pouchyBeltEnabled = Plugin.config.Bind<bool>("Items", "PouchyBelt", true, "Is Pouchy Belt enabled?"); pouchyBeltPrice = Plugin.config.Bind<int>("Items", "PouchyBeltPrice", 290, "How much does Pouchy Belt cost?"); remoteRadarEnabled = Plugin.config.Bind<bool>("Items", "RemoteRadar", true, "Is Remote Radar enabled?"); remoteRadarPrice = Plugin.config.Bind<int>("Items", "RemoteRadarPrice", 150, "How much does Remote Radar cost?"); rocketLauncherEnabled = Plugin.config.Bind<bool>("Items", "RocketLauncher", true, "Is Rocket Launcher enabled?"); rocketLauncherPrice = Plugin.config.Bind<int>("Items", "RocketLauncherPrice", 300, "How much does Rocket Launcher cost?"); hackingToolEnabled = Plugin.config.Bind<bool>("Items", "HackingTool", true, "Is Hacking Tool enabled?"); hackingToolPrice = Plugin.config.Bind<int>("Items", "HackingToolPrice", 120, "How much does Hacking Tool cost?"); flareGunEnabled = Plugin.config.Bind<bool>("Items", "FlareGun", true, "Is Flare Gun enabled?"); flareGunPrice = Plugin.config.Bind<int>("Items", "FlareGunPrice", 100, "How much does Flare Gun cost?"); flareGunAmmoPrice = Plugin.config.Bind<int>("Items", "FlareGunAmmoPrice", 20, "How much does Flare Gun ammo cost?"); boombaSpawnWeight = Plugin.config.Bind<int>("Enemies", "Boomba", 20, "How much does Boomba spawn, higher = more common"); rugsEnabled = Plugin.config.Bind<bool>("Decor", "Rugs", true, "Are rugs enabled?"); smallRugPrice = Plugin.config.Bind<int>("Decor", "SmallRugPrice", 80, "How much does a small rug cost?"); largeRugPrice = Plugin.config.Bind<int>("Decor", "LargeRugPrice", 110, "How much does a large rug cost?"); fatalitiesSignEnabled = Plugin.config.Bind<bool>("Decor", "FatalitiesSign", true, "Is Fatalities Sign enabled?"); fatalitiesSignPrice = Plugin.config.Bind<int>("Decor", "FatalitiesSignPrice", 100, "How much does Fatalities Sign cost?"); dartBoardEnabled = Plugin.config.Bind<bool>("Decor", "DartBoard", true, "Is Dart Board enabled?"); dartBoardPrice = Plugin.config.Bind<int>("Decor", "DartBoardPrice", 120, "How much does Dart Board cost?"); teleporterTrapsEnabled = Plugin.config.Bind<bool>("Traps", "TeleporterTraps", true, "Are teleporter traps enabled?"); enableItemChargerElectrocution = Plugin.config.Bind<bool>("Misc", "EnableItemChargerElectrocution", true, "Do players get electrocuted when stuffing conductive objects in the item charger."); itemChargerElectrocutionDamage = Plugin.config.Bind<int>("Misc", "ItemChargerElectrocutionDamage", 20, "How much damage does the item charger electrocution do."); disableOverlappingModContent = Plugin.config.Bind<bool>("Misc", "DisableOverlappingModContent", true, "Disable content from other mods which exists in this one (e.g. maxwell)."); version = Plugin.config.Bind<string>("Misc", "Version", "1.0.0", "Version of the mod config."); VolumeConfig = new ConfigFile(Paths.ConfigPath + "\\LethalThings.AudioVolume.cfg", true); } } public class Content { public class CustomItem { public string name = ""; public string itemPath = ""; public string infoPath = ""; public Action<Item> itemAction = delegate { }; public bool enabled = true; public CustomItem(string name, string itemPath, string infoPath, Action<Item> action = null) { this.name = name; this.itemPath = itemPath; this.infoPath = infoPath; if (action != null) { itemAction = action; } } public static CustomItem Add(string name, string itemPath, string infoPath = null, Action<Item> action = null) { return new CustomItem(name, itemPath, infoPath, action); } } public class CustomUnlockable { public string name = ""; public string unlockablePath = ""; public string infoPath = ""; public Action<UnlockableItem> unlockableAction = delegate { }; public bool enabled = true; public int unlockCost = -1; public CustomUnlockable(string name, string unlockablePath, string infoPath, Action<UnlockableItem> action = null, int unlockCost = -1) { this.name = name; this.unlockablePath = unlockablePath; this.infoPath = infoPath; if (action != null) { unlockableAction = action; } this.unlockCost = unlockCost; } public static CustomUnlockable Add(string name, string unlockablePath, string infoPath = null, Action<UnlockableItem> action = null, int unlockCost = -1, bool enabled = true) { return new CustomUnlockable(name, unlockablePath, infoPath, action, unlockCost) { enabled = enabled }; } } public class CustomShopItem : CustomItem { public int itemPrice; public CustomShopItem(string name, string itemPath, string infoPath = null, int itemPrice = 0, Action<Item> action = null) : base(name, itemPath, infoPath, action) { this.itemPrice = itemPrice; } public static CustomShopItem Add(string name, string itemPath, string infoPath = null, int itemPrice = 0, Action<Item> action = null, bool enabled = true) { return new CustomShopItem(name, itemPath, infoPath, itemPrice, action) { enabled = enabled }; } } public class CustomScrap : CustomItem { public LevelTypes levelType = (LevelTypes)510; public int rarity; public CustomScrap(string name, string itemPath, LevelTypes levelType, int rarity, Action<Item> action = null) : base(name, itemPath, null, action) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) this.levelType = levelType; this.rarity = rarity; } public static CustomScrap Add(string name, string itemPath, LevelTypes levelType, int rarity, Action<Item> action = null) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) return new CustomScrap(name, itemPath, levelType, rarity, action); } } public class CustomPlainItem : CustomItem { public CustomPlainItem(string name, string itemPath, Action<Item> action = null) : base(name, itemPath, null, action) { } public static CustomPlainItem Add(string name, string itemPath, Action<Item> action = null) { return new CustomPlainItem(name, itemPath, action); } } public class CustomEnemy { public string name; public string enemyPath; public int rarity; public LevelTypes levelFlags; public SpawnType spawnType; public string infoKeyword; public string infoNode; public bool enabled = true; public CustomEnemy(string name, string enemyPath, int rarity, LevelTypes levelFlags, SpawnType spawnType, string infoKeyword, string infoNode) { //IL_0023: 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_002b: 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) this.name = name; this.enemyPath = enemyPath; this.rarity = rarity; this.levelFlags = levelFlags; this.spawnType = spawnType; this.infoKeyword = infoKeyword; this.infoNode = infoNode; } public static CustomEnemy Add(string name, string enemyPath, int rarity, LevelTypes levelFlags, SpawnType spawnType, string infoKeyword, string infoNode, bool enabled = true) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Unknown result type (might be due to invalid IL or missing references) return new CustomEnemy(name, enemyPath, rarity, levelFlags, spawnType, infoKeyword, infoNode) { enabled = enabled }; } } public class CustomMapObject { public string name; public string objectPath; public LevelTypes levelFlags; public Func<SelectableLevel, AnimationCurve> spawnRateFunction; public bool enabled = true; public CustomMapObject(string name, string objectPath, LevelTypes levelFlags, Func<SelectableLevel, AnimationCurve> spawnRateFunction = null, bool enabled = false) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) this.name = name; this.objectPath = objectPath; this.levelFlags = levelFlags; this.spawnRateFunction = spawnRateFunction; this.enabled = enabled; } public static CustomMapObject Add(string name, string objectPath, LevelTypes levelFlags, Func<SelectableLevel, AnimationCurve> spawnRateFunction = null, bool enabled = false) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) return new CustomMapObject(name, objectPath, levelFlags, spawnRateFunction, enabled); } } public static AssetBundle MainAssets; public static Dictionary<string, GameObject> Prefabs = new Dictionary<string, GameObject>(); public static GameObject devMenuPrefab; public static List<CustomUnlockable> customUnlockables; public static List<CustomItem> customItems; public static List<CustomEnemy> customEnemies; public static List<CustomMapObject> customMapObjects; public static GameObject ConfigManagerPrefab; public static void TryLoadAssets() { if ((Object)(object)MainAssets == (Object)null) { MainAssets = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "lethalthings")); Plugin.logger.LogInfo((object)"Loaded asset bundle"); } } public static void Load() { //IL_0583: Unknown result type (might be due to invalid IL or missing references) //IL_070f: Unknown result type (might be due to invalid IL or missing references) //IL_0716: Unknown result type (might be due to invalid IL or missing references) //IL_07a5: Unknown result type (might be due to invalid IL or missing references) TryLoadAssets(); customItems = new List<CustomItem> { CustomScrap.Add("Arson", "Assets/Custom/LethalThings/Scrap/Arson/ArsonPlush.asset", (LevelTypes)510, Config.arsonSpawnWeight.Value), CustomScrap.Add("Cookie", "Assets/Custom/LethalThings/Scrap/Cookie/CookieFumo.asset", (LevelTypes)510, Config.cookieSpawnWeight.Value), CustomScrap.Add("Bilka", "Assets/Custom/LethalThings/Scrap/Toimari/ToimariPlush.asset", (LevelTypes)510, Config.toimariSpawnWeight.Value), CustomScrap.Add("Hamis", "Assets/Custom/LethalThings/Scrap/Hamis/HamisPlush.asset", (LevelTypes)510, Config.hamisSpawnWeight.Value), CustomScrap.Add("ArsonDirty", "Assets/Custom/LethalThings/Scrap/Arson/ArsonPlushDirty.asset", (LevelTypes)510, Config.dirtyArsonSpawnWeight.Value), CustomScrap.Add("Maxwell", "Assets/Custom/LethalThings/Scrap/Maxwell/Dingus.asset", (LevelTypes)510, Config.maxwellSpawnWeight.Value), CustomScrap.Add("Glizzy", "Assets/Custom/LethalThings/Scrap/glizzy/glizzy.asset", (LevelTypes)510, Config.glizzySpawnChance.Value), CustomScrap.Add("Revolver", "Assets/Custom/LethalThings/Scrap/Flaggun/Toygun.asset", (LevelTypes)510, Config.revolverSpawnChance.Value), CustomShopItem.Add("RocketLauncher", "Assets/Custom/LethalThings/Items/RocketLauncher/RocketLauncher.asset", "Assets/Custom/LethalThings/Items/RocketLauncher/RocketLauncherInfo.asset", Config.rocketLauncherPrice.Value, delegate(Item item) { NetworkPrefabs.RegisterNetworkPrefab(item.spawnPrefab.GetComponent<RocketLauncher>().missilePrefab); }, Config.rocketLauncherEnabled.Value), CustomShopItem.Add("Flaregun", "Assets/Custom/LethalThings/Items/Flaregun/Flaregun.asset", "Assets/Custom/LethalThings/Items/Flaregun/FlaregunInfo.asset", Config.flareGunPrice.Value, delegate(Item item) { NetworkPrefabs.RegisterNetworkPrefab(item.spawnPrefab.GetComponent<ProjectileWeapon>().projectilePrefab); }, Config.flareGunEnabled.Value), CustomShopItem.Add("FlaregunAmmo", "Assets/Custom/LethalThings/Items/Flaregun/FlaregunAmmo.asset", "Assets/Custom/LethalThings/Items/Flaregun/FlaregunAmmoInfo.asset", Config.flareGunAmmoPrice.Value, null, Config.flareGunEnabled.Value), CustomShopItem.Add("ToyHammer", "Assets/Custom/LethalThings/Items/ToyHammer/ToyHammer.asset", "Assets/Custom/LethalThings/Items/ToyHammer/ToyHammerInfo.asset", Config.toyHammerPrice.Value, null, Config.toyHammerEnabled.Value), CustomShopItem.Add("RemoteRadar", "Assets/Custom/LethalThings/Items/Radar/HandheldRadar.asset", "Assets/Custom/LethalThings/Items/Radar/HandheldRadarInfo.asset", Config.remoteRadarPrice.Value, null, Config.remoteRadarEnabled.Value), CustomShopItem.Add("PouchyBelt", "Assets/Custom/LethalThings/Items/Pouch/Pouch.asset", "Assets/Custom/LethalThings/Items/Pouch/PouchInfo.asset", Config.pouchyBeltPrice.Value, null, Config.pouchyBeltEnabled.Value), CustomShopItem.Add("HackingTool", "Assets/Custom/LethalThings/Items/HackingTool/HackingTool.asset", "Assets/Custom/LethalThings/Items/HackingTool/HackingToolInfo.asset", Config.hackingToolPrice.Value, null, Config.hackingToolEnabled.Value), CustomPlainItem.Add("Dart", "Assets/Custom/LethalThings/Unlockables/dartboard/Dart.asset"), CustomScrap.Add("GremlinEnergy", "Assets/Custom/LethalThings/Scrap/GremlinEnergy/GremlinEnergy.asset", (LevelTypes)510, Config.gremlinSodaSpawnChance.Value) }; customEnemies = new List<CustomEnemy> { CustomEnemy.Add("Boomba", "Assets/Custom/LethalThings/Enemies/Roomba/Boomba.asset", Config.boombaSpawnWeight.Value, (LevelTypes)510, (SpawnType)0, null, "Assets/Custom/LethalThings/Enemies/Roomba/BoombaFile.asset") }; customUnlockables = new List<CustomUnlockable> { CustomUnlockable.Add("SmallRug", "Assets/Custom/LethalThings/Unlockables/Rug/SmallRug.asset", "Assets/Custom/LethalThings/Unlockables/Rug/RugInfo.asset", null, Config.smallRugPrice.Value, Config.rugsEnabled.Value), CustomUnlockable.Add("LargeRug", "Assets/Custom/LethalThings/Unlockables/Rug/LargeRug.asset", "Assets/Custom/LethalThings/Unlockables/Rug/RugInfo.asset", null, Config.largeRugPrice.Value, Config.rugsEnabled.Value), CustomUnlockable.Add("FatalitiesSign", "Assets/Custom/LethalThings/Unlockables/Sign/Sign.asset", "Assets/Custom/LethalThings/Unlockables/Sign/SignInfo.asset", null, Config.fatalitiesSignPrice.Value, Config.fatalitiesSignEnabled.Value), CustomUnlockable.Add("Dartboard", "Assets/Custom/LethalThings/Unlockables/dartboard/Dartboard.asset", "Assets/Custom/LethalThings/Unlockables/dartboard/DartboardInfo.asset", null, Config.dartBoardPrice.Value, Config.dartBoardEnabled.Value) }; customMapObjects = new List<CustomMapObject> { CustomMapObject.Add("TeleporterTrap", "Assets/Custom/LethalThings/hazards/TeleporterTrap/TeleporterTrap.asset", (LevelTypes)510, (SelectableLevel level) => new AnimationCurve((Keyframe[])(object)new Keyframe[2] { new Keyframe(0f, 0f), new Keyframe(1f, 4f) }), Config.teleporterTrapsEnabled.Value) }; foreach (CustomItem customItem in customItems) { if (customItem.enabled) { Item val = MainAssets.LoadAsset<Item>(customItem.itemPath); if ((Object)(object)val.spawnPrefab.GetComponent<NetworkTransform>() == (Object)null && (Object)(object)val.spawnPrefab.GetComponent<CustomNetworkTransform>() == (Object)null) { NetworkTransform obj = val.spawnPrefab.AddComponent<NetworkTransform>(); obj.SlerpPosition = false; obj.Interpolate = false; obj.SyncPositionX = false; obj.SyncPositionY = false; obj.SyncPositionZ = false; obj.SyncScaleX = false; obj.SyncScaleY = false; obj.SyncScaleZ = false; obj.UseHalfFloatPrecision = true; } Prefabs.Add(customItem.name, val.spawnPrefab); NetworkPrefabs.RegisterNetworkPrefab(val.spawnPrefab); customItem.itemAction(val); if (customItem is CustomShopItem) { TerminalNode val2 = MainAssets.LoadAsset<TerminalNode>(customItem.infoPath); Plugin.logger.LogInfo((object)$"Registering shop item {customItem.name} with price {((CustomShopItem)customItem).itemPrice}"); Items.RegisterShopItem(val, (TerminalNode)null, (TerminalNode)null, val2, ((CustomShopItem)customItem).itemPrice); } else if (customItem is CustomScrap) { Items.RegisterScrap(val, ((CustomScrap)customItem).rarity, ((CustomScrap)customItem).levelType); } else if (customItem is CustomPlainItem) { Items.RegisterItem(val); } } } foreach (CustomUnlockable customUnlockable in customUnlockables) { if (customUnlockable.enabled) { UnlockableItem unlockable = MainAssets.LoadAsset<UnlockableItemDef>(customUnlockable.unlockablePath).unlockable; if ((Object)(object)unlockable.prefabObject != (Object)null) { NetworkPrefabs.RegisterNetworkPrefab(unlockable.prefabObject); } Prefabs.Add(customUnlockable.name, unlockable.prefabObject); TerminalNode val3 = null; if (customUnlockable.infoPath != null) { val3 = MainAssets.LoadAsset<TerminalNode>(customUnlockable.infoPath); } Unlockables.RegisterUnlockable(unlockable, (StoreType)2, (TerminalNode)null, (TerminalNode)null, val3, customUnlockable.unlockCost); } } foreach (CustomEnemy customEnemy in customEnemies) { if (customEnemy.enabled) { EnemyType val4 = MainAssets.LoadAsset<EnemyType>(customEnemy.enemyPath); TerminalNode val5 = MainAssets.LoadAsset<TerminalNode>(customEnemy.infoNode); TerminalKeyword val6 = null; if (customEnemy.infoKeyword != null) { val6 = MainAssets.LoadAsset<TerminalKeyword>(customEnemy.infoKeyword); } NetworkPrefabs.RegisterNetworkPrefab(val4.enemyPrefab); Prefabs.Add(customEnemy.name, val4.enemyPrefab); Enemies.RegisterEnemy(val4, customEnemy.rarity, customEnemy.levelFlags, customEnemy.spawnType, val5, val6); } } foreach (CustomMapObject customMapObject in customMapObjects) { if (customMapObject.enabled) { SpawnableMapObjectDef val7 = MainAssets.LoadAsset<SpawnableMapObjectDef>(customMapObject.objectPath); NetworkPrefabs.RegisterNetworkPrefab(val7.spawnableMapObject.prefabToSpawn); Prefabs.Add(customMapObject.name, val7.spawnableMapObject.prefabToSpawn); MapObjects.RegisterMapObject(val7, customMapObject.levelFlags, customMapObject.spawnRateFunction); } } foreach (KeyValuePair<string, GameObject> prefab in Prefabs) { GameObject value = prefab.Value; string key = prefab.Key; AudioSource[] componentsInChildren = value.GetComponentsInChildren<AudioSource>(); if (componentsInChildren.Length != 0) { ConfigEntry<float> val8 = Config.VolumeConfig.Bind<float>("Volume", key ?? "", 100f, "Audio volume for " + key + " (0 - 100)"); AudioSource[] array = componentsInChildren; foreach (AudioSource obj2 in array) { obj2.volume *= val8.Value / 100f; } } } GameObject obj3 = MainAssets.LoadAsset<GameObject>("Assets/Custom/LethalThings/DevMenu.prefab"); NetworkPrefabs.RegisterNetworkPrefab(obj3); devMenuPrefab = obj3; try { foreach (Type loadableType in Assembly.GetExecutingAssembly().GetLoadableTypes()) { MethodInfo[] methods = loadableType.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); foreach (MethodInfo methodInfo in methods) { if (methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false).Length != 0) { methodInfo.Invoke(null, null); } } } } catch (Exception) { } Plugin.logger.LogInfo((object)"Custom content loaded!"); } } public static class InputCompat { public static InputActionAsset Asset; public static bool Enabled => Chainloader.PluginInfos.ContainsKey("com.rune580.LethalCompanyInputUtils"); public static InputAction LTUtilityBeltQuick1 => Keybinds.Instance.LTUtilityBeltQuick1; public static InputAction LTUtilityBeltQuick2 => Keybinds.Instance.LTUtilityBeltQuick2; public static InputAction LTUtilityBeltQuick3 => Keybinds.Instance.LTUtilityBeltQuick3; public static InputAction LTUtilityBeltQuick4 => Keybinds.Instance.LTUtilityBeltQuick4; public static void Init() { Keybinds.Instance = new Keybinds(); Asset = Keybinds.Instance.GetAsset(); } } public class Keybinds : LcInputActions { public static Keybinds Instance; [InputAction("", Name = "[LT] Utility Belt Quick 1")] public InputAction LTUtilityBeltQuick1 { get; set; } [InputAction("", Name = "[LT] Utility Belt Quick 2")] public InputAction LTUtilityBeltQuick2 { get; set; } [InputAction("", Name = "[LT] Utility Belt Quick 3")] public InputAction LTUtilityBeltQuick3 { get; set; } [InputAction("", Name = "[LT] Utility Belt Quick 4")] public InputAction LTUtilityBeltQuick4 { get; set; } public InputActionAsset GetAsset() { return ((LcInputActions)this).Asset; } } public class Dingus : SaveableObject { public AudioSource noiseAudio; public AudioSource noiseAudioFar; public AudioSource musicAudio; public AudioSource musicAudioFar; [Space(3f)] public AudioClip[] noiseSFX; public AudioClip[] noiseSFXFar; public AudioClip evilNoise; [Space(3f)] public float noiseRange; public float maxLoudness; public float minLoudness; public float minPitch; public float maxPitch; private Random noisemakerRandom; public Animator triggerAnimator; private int timesPlayedWithoutTurningOff; private RoundManager roundManager; private float noiseInterval = 1f; public Animator danceAnimator; public bool wasLoadedFromSave; public bool exploding; private NetworkVariable<bool> isEvil = new NetworkVariable<bool>(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public GameObject evilObject; public NetworkVariable<bool> isPlayingMusic = new NetworkVariable<bool>(Config.maxwellPlayMusicDefault.Value, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)1); public NetworkVariable<bool> isPipebomb = new NetworkVariable<bool>(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public override void SaveObjectData() { SaveData.SaveObjectData("dingusBeEvil", isEvil.Value, uniqueId); } public override void LoadObjectData() { if (((NetworkBehaviour)this).IsHost) { bool flag = SaveData.LoadObjectData<bool>("dingusBeEvil", uniqueId); if (flag) { isEvil.Value = flag; } } } public override void Start() { ((GrabbableObject)this).Start(); roundManager = Object.FindObjectOfType<RoundManager>(); noisemakerRandom = new Random(StartOfRound.Instance.randomMapSeed + 85); Debug.Log((object)"Making the dingus dance"); } public override void OnNetworkSpawn() { ((NetworkBehaviour)this).OnNetworkSpawn(); if (((NetworkBehaviour)this).IsOwner) { isPlayingMusic.Value = Config.maxwellPlayMusicDefault.Value; } if (((NetworkBehaviour)this).IsHost) { isEvil.Value = Random.Range(0f, 100f) <= Config.evilMaxwellChance.Value; } } public override void ItemActivate(bool used, bool buttonDown = true) { //IL_0117: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).ItemActivate(used, buttonDown); if (!((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)null)) { int num = noisemakerRandom.Next(0, noiseSFX.Length); float num2 = (float)noisemakerRandom.Next((int)(minLoudness * 100f), (int)(maxLoudness * 100f)) / 100f; float pitch = (float)noisemakerRandom.Next((int)(minPitch * 100f), (int)(maxPitch * 100f)) / 100f; noiseAudio.pitch = pitch; noiseAudio.PlayOneShot(noiseSFX[num], num2); if ((Object)(object)noiseAudioFar != (Object)null) { noiseAudioFar.pitch = pitch; noiseAudioFar.PlayOneShot(noiseSFXFar[num], num2); } if ((Object)(object)triggerAnimator != (Object)null) { triggerAnimator.SetTrigger("playAnim"); } WalkieTalkie.TransmitOneShotAudio(noiseAudio, noiseSFX[num], num2); RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, noiseRange, num2, 0, ((GrabbableObject)this).isInElevator && StartOfRound.Instance.hangarDoorsClosed, 0); } } public override void DiscardItem() { if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null) { ((GrabbableObject)this).playerHeldBy.equippedUsableItemQE = false; } ((GrabbableObject)this).isBeingUsed = false; ((GrabbableObject)this).DiscardItem(); } public override void EquipItem() { ((GrabbableObject)this).EquipItem(); ((GrabbableObject)this).playerHeldBy.equippedUsableItemQE = true; danceAnimator.Play("dingusIdle"); Debug.Log((object)"Making the dingus idle"); } public override void ItemInteractLeftRight(bool right) { ((GrabbableObject)this).ItemInteractLeftRight(right); if (!right && ((NetworkBehaviour)this).IsOwner) { isPlayingMusic.Value = !isPlayingMusic.Value; } } public override void InteractItem() { ((GrabbableObject)this).InteractItem(); if (isEvil.Value && !exploding && !isPipebomb.Value) { EvilMaxwellServerRpc(); } } public void EvilMaxwellTruly() { danceAnimator.Play("dingusIdle"); if (musicAudio.isPlaying) { musicAudio.Pause(); musicAudioFar.Pause(); } ((MonoBehaviour)this).StartCoroutine(evilMaxwellMoment()); } [ServerRpc(RequireOwnership = false)] public void EvilMaxwellServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(88404199u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 88404199u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { isPipebomb.Value = true; EvilMaxwellClientRpc(); } } } [ClientRpc] public void EvilMaxwellClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1120322383u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1120322383u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { EvilMaxwellTruly(); exploding = true; if (((NetworkBehaviour)this).IsOwner) { isPlayingMusic.Value = false; } timesPlayedWithoutTurningOff = 0; danceAnimator.Play("dingusIdle"); if (musicAudio.isPlaying) { musicAudio.Pause(); musicAudioFar.Pause(); } Plugin.logger.LogInfo((object)"Evil maxwell moment"); } } public IEnumerator evilMaxwellMoment() { yield return (object)new WaitForSeconds(1f); noiseAudio.PlayOneShot(evilNoise, 1f); evilObject.SetActive(true); ((Renderer)((GrabbableObject)this).mainObjectRenderer).enabled = false; if ((Object)(object)noiseAudioFar != (Object)null) { noiseAudioFar.PlayOneShot(evilNoise, 1f); } if ((Object)(object)triggerAnimator != (Object)null) { triggerAnimator.SetTrigger("playAnim"); } WalkieTalkie.TransmitOneShotAudio(noiseAudio, evilNoise, 1f); RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, noiseRange, 1f, 0, ((GrabbableObject)this).isInElevator && StartOfRound.Instance.hangarDoorsClosed, 0); yield return (object)new WaitForSeconds(1.5f); Utilities.CreateExplosion(((Component)this).transform.position, spawnExplosionEffect: true, 100, 0f, 6.4f, 6, (CauseOfDeath)3); Rigidbody[] componentsInChildren = evilObject.GetComponentsInChildren<Rigidbody>(); foreach (Rigidbody obj in componentsInChildren) { obj.isKinematic = false; obj.AddExplosionForce(1000f, evilObject.transform.position, 100f); } yield return (object)new WaitForSeconds(2f); if (((NetworkBehaviour)this).IsServer) { ((Component)this).GetComponent<NetworkObject>().Despawn(true); } } public override void Update() { //IL_00bb: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).Update(); if (isEvil.Value) { ((GrabbableObject)this).grabbable = false; ((GrabbableObject)this).grabbableToEnemies = false; } if (isPlayingMusic.Value && !exploding) { if (!musicAudio.isPlaying) { musicAudio.Play(); musicAudioFar.Play(); } if (!((GrabbableObject)this).isHeld) { danceAnimator.Play("dingusDance"); } else { danceAnimator.Play("dingusIdle"); } if (noiseInterval <= 0f) { noiseInterval = 1f; timesPlayedWithoutTurningOff++; roundManager.PlayAudibleNoise(((Component)this).transform.position, 16f, 0.9f, timesPlayedWithoutTurningOff, false, 5); } else { noiseInterval -= Time.deltaTime; } } else { timesPlayedWithoutTurningOff = 0; danceAnimator.Play("dingusIdle"); if (musicAudio.isPlaying) { musicAudio.Pause(); musicAudioFar.Pause(); } } } protected override void __initializeVariables() { if (isEvil == null) { throw new Exception("Dingus.isEvil cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)isEvil).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)isEvil, "isEvil"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)isEvil); if (isPlayingMusic == null) { throw new Exception("Dingus.isPlayingMusic cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)isPlayingMusic).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)isPlayingMusic, "isPlayingMusic"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)isPlayingMusic); if (isPipebomb == null) { throw new Exception("Dingus.isPipebomb cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)isPipebomb).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)isPipebomb, "isPipebomb"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)isPipebomb); base.__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_Dingus() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(88404199u, new RpcReceiveHandler(__rpc_handler_88404199)); NetworkManager.__rpc_func_table.Add(1120322383u, new RpcReceiveHandler(__rpc_handler_1120322383)); } private static void __rpc_handler_88404199(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((Dingus)(object)target).EvilMaxwellServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1120322383(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)2; ((Dingus)(object)target).EvilMaxwellClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "Dingus"; } } public class Missile : NetworkBehaviour { public int damage = 50; public float maxDistance = 10f; public float minDistance; public float gravity = 2.4f; public float flightDelay = 0.5f; public float flightForce = 150f; public float flightTime = 2f; public float autoDestroyTime = 3f; private float timeAlive; public float LobForce = 100f; public ParticleSystem particleSystem; private void OnCollisionEnter(Collision collision) { if (((NetworkBehaviour)this).IsHost) { Boom(); BoomClientRpc(); } else { BoomServerRpc(); } } private void Start() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) ((Component)this).GetComponent<Rigidbody>().useGravity = false; if (((NetworkBehaviour)this).IsHost) { ((Component)this).GetComponent<Rigidbody>().AddForce(((Component)this).transform.forward * LobForce, (ForceMode)1); } } [ClientRpc] public void BoomClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3331368301u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3331368301u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { Boom(); } } } [ServerRpc] public void BoomServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(452316787u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 452316787u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { Boom(); BoomClientRpc(); } } public void CreateExplosion() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB attacker = ((IEnumerable<PlayerControllerB>)StartOfRound.Instance.allPlayerScripts).FirstOrDefault((Func<PlayerControllerB, bool>)((PlayerControllerB x) => ((NetworkBehaviour)x).OwnerClientId == ((NetworkBehaviour)this).OwnerClientId)); Utilities.CreateExplosion(((Component)this).transform.position, spawnExplosionEffect: true, damage, minDistance, maxDistance, 10, (CauseOfDeath)3, attacker); } public void Boom() { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)particleSystem == (Object)null) { Debug.LogError((object)"No particle system set on missile, destruction time!!"); CreateExplosion(); if (((NetworkBehaviour)this).IsHost) { Object.Destroy((Object)(object)((Component)this).gameObject); } return; } particleSystem.Stop(true, (ParticleSystemStopBehavior)1); ((Component)particleSystem).transform.SetParent((Transform)null); ((Component)particleSystem).transform.localScale = Vector3.one; GameObject gameObject = ((Component)particleSystem).gameObject; MainModule main = particleSystem.main; float duration = ((MainModule)(ref main)).duration; main = particleSystem.main; MinMaxCurve startLifetime = ((MainModule)(ref main)).startLifetime; Object.Destroy((Object)(object)gameObject, duration + ((MinMaxCurve)(ref startLifetime)).constant); CreateExplosion(); if (((NetworkBehaviour)this).IsHost) { Object.Destroy((Object)(object)((Component)this).gameObject); } } private void FixedUpdate() { //IL_001d: 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_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) if (!((NetworkBehaviour)this).IsHost) { return; } ((Component)this).GetComponent<Rigidbody>().useGravity = false; ((Component)this).GetComponent<Rigidbody>().AddForce(Vector3.down * gravity); if (timeAlive <= flightTime && timeAlive >= flightDelay) { ((Component)this).GetComponent<Rigidbody>().AddForce(((Component)this).transform.forward * flightForce); } timeAlive += Time.fixedDeltaTime; if (timeAlive > autoDestroyTime) { if (((NetworkBehaviour)this).IsHost) { Boom(); BoomClientRpc(); } else { BoomServerRpc(); } } else { Debug.Log((object)("Time alive: " + timeAlive + " / " + autoDestroyTime)); } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_Missile() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(3331368301u, new RpcReceiveHandler(__rpc_handler_3331368301)); NetworkManager.__rpc_func_table.Add(452316787u, new RpcReceiveHandler(__rpc_handler_452316787)); } private static void __rpc_handler_3331368301(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)2; ((Missile)(object)target).BoomClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_452316787(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { target.__rpc_exec_stage = (__RpcExecStage)1; ((Missile)(object)target).BoomServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "Missile"; } } public class PouchyBelt : GrabbableObject { [CompilerGenerated] private static class <>O { public static hook_SetHoverTipAndCurrentInteractTrigger <0>__PlayerControllerB_SetHoverTipAndCurrentInteractTrigger; public static hook_BeginGrabObject <1>__PlayerControllerB_BeginGrabObject; } public Transform beltCosmetic; public Vector3 beltCosmeticPositionOffset = new Vector3(0f, 0f, 0f); public Vector3 beltCosmeticRotationOffset = new Vector3(0f, 0f, 0f); public int beltCapacity = 3; private PlayerControllerB previousPlayerHeldBy; public List<int> slotIndexes = new List<int>(); public static void Initialize() { //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_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown object obj = <>O.<0>__PlayerControllerB_SetHoverTipAndCurrentInteractTrigger; if (obj == null) { hook_SetHoverTipAndCurrentInteractTrigger val = PlayerControllerB_SetHoverTipAndCurrentInteractTrigger; <>O.<0>__PlayerControllerB_SetHoverTipAndCurrentInteractTrigger = val; obj = (object)val; } PlayerControllerB.SetHoverTipAndCurrentInteractTrigger += (hook_SetHoverTipAndCurrentInteractTrigger)obj; object obj2 = <>O.<1>__PlayerControllerB_BeginGrabObject; if (obj2 == null) { hook_BeginGrabObject val2 = PlayerControllerB_BeginGrabObject; <>O.<1>__PlayerControllerB_BeginGrabObject = val2; obj2 = (object)val2; } PlayerControllerB.BeginGrabObject += (hook_BeginGrabObject)obj2; } public void Awake() { if (InputCompat.Enabled) { InputCompat.LTUtilityBeltQuick1.started += InputReceived; InputCompat.LTUtilityBeltQuick2.started += InputReceived; InputCompat.LTUtilityBeltQuick3.started += InputReceived; InputCompat.LTUtilityBeltQuick4.started += InputReceived; } } private static void PlayerControllerB_BeginGrabObject(orig_BeginGrabObject orig, PlayerControllerB self) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) self.interactRay = new Ray(((Component)self.gameplayCamera).transform.position, ((Component)self.gameplayCamera).transform.forward); if (!Physics.Raycast(self.interactRay, ref self.hit, self.grabDistance, self.interactableObjectsMask) || ((Component)((RaycastHit)(ref self.hit)).collider).gameObject.layer == 8 || !(((Component)((RaycastHit)(ref self.hit)).collider).tag == "PhysicsProp") || self.twoHanded || self.sinkingValue > 0.73f) { return; } self.currentlyGrabbingObject = ((Component)((Component)((RaycastHit)(ref self.hit)).collider).transform).gameObject.GetComponent<GrabbableObject>(); if ((!GameNetworkManager.Instance.gameHasStarted && !self.currentlyGrabbingObject.itemProperties.canBeGrabbedBeforeGameStart && ((Object)(object)StartOfRound.Instance.testRoom == (Object)null || !StartOfRound.Instance.testRoom.activeSelf)) || (Object)(object)self.currentlyGrabbingObject == (Object)null || self.inSpecialInteractAnimation || self.currentlyGrabbingObject.isHeld || self.currentlyGrabbingObject.isPocketed) { return; } NetworkObject networkObject = ((NetworkBehaviour)self.currentlyGrabbingObject).NetworkObject; if (!((Object)(object)networkObject == (Object)null) && networkObject.IsSpawned) { if (self.currentlyGrabbingObject is PouchyBelt && self.ItemSlots.Any((GrabbableObject x) => (Object)(object)x != (Object)null && x is PouchyBelt)) { self.currentlyGrabbingObject.grabbable = false; } orig.Invoke(self); if (self.currentlyGrabbingObject is PouchyBelt) { self.currentlyGrabbingObject.grabbable = true; } } } private static void PlayerControllerB_SetHoverTipAndCurrentInteractTrigger(orig_SetHoverTipAndCurrentInteractTrigger orig, PlayerControllerB self) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (!Physics.Raycast(self.interactRay, ref self.hit, self.grabDistance, self.interactableObjectsMask) || ((Component)((RaycastHit)(ref self.hit)).collider).gameObject.layer == 8 || !(((Component)((RaycastHit)(ref self.hit)).collider).tag == "PhysicsProp")) { return; } if (self.FirstEmptyItemSlot() == -1) { ((TMP_Text)self.cursorTip).text = "Inventory full!"; } else if (((Component)((RaycastHit)(ref self.hit)).collider).gameObject.GetComponent<GrabbableObject>() is PouchyBelt) { if (self.ItemSlots.Any((GrabbableObject x) => (Object)(object)x != (Object)null && x is PouchyBelt)) { ((TMP_Text)self.cursorTip).text = "(Cannot hold more than 1 belt)"; } else { ((TMP_Text)self.cursorTip).text = "Pick up belt"; } } } public void InputReceived(CallbackContext context) { if (((NetworkBehaviour)this).IsOwner && (Object)(object)base.playerHeldBy != (Object)null && ((CallbackContext)(ref context)).started) { int num = -1; if (((CallbackContext)(ref context)).action == InputCompat.LTUtilityBeltQuick1) { num = 0; } else if (((CallbackContext)(ref context)).action == InputCompat.LTUtilityBeltQuick2) { num = 1; } else if (((CallbackContext)(ref context)).action == InputCompat.LTUtilityBeltQuick3) { num = 2; } else if (((CallbackContext)(ref context)).action == InputCompat.LTUtilityBeltQuick4) { num = 3; } if (num != -1 && num < slotIndexes.Count) { base.playerHeldBy.SwitchItemSlots(slotIndexes[num]); Plugin.logger.LogInfo((object)$"Switched to slot: {slotIndexes[num]}"); } } } public override void LateUpdate() { //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).LateUpdate(); if ((Object)(object)previousPlayerHeldBy != (Object)null) { ((Component)beltCosmetic).gameObject.SetActive(true); beltCosmetic.SetParent((Transform)null); ((Renderer)((Component)beltCosmetic).GetComponent<MeshRenderer>()).enabled = true; if (((NetworkBehaviour)this).IsOwner) { ((Renderer)((Component)beltCosmetic).GetComponent<MeshRenderer>()).enabled = false; } Transform parent = previousPlayerHeldBy.lowerSpine.parent; beltCosmetic.position = parent.position + beltCosmeticPositionOffset; Quaternion rotation = parent.rotation; Quaternion rotation2 = Quaternion.Euler(((Quaternion)(ref rotation)).eulerAngles + beltCosmeticRotationOffset); beltCosmetic.rotation = rotation2; ((Renderer)base.mainObjectRenderer).enabled = false; ((Component)this).gameObject.SetActive(true); } else { ((Component)beltCosmetic).gameObject.SetActive(false); ((Renderer)base.mainObjectRenderer).enabled = true; beltCosmetic.SetParent(((Component)this).transform); } } public void UpdateHUD(bool add) { //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) slotIndexes.Clear(); HUDManager instance = HUDManager.Instance; if (add) { int num = 0; GrabbableObject[] itemSlots = GameNetworkManager.Instance.localPlayerController.ItemSlots; for (int i = 0; i < itemSlots.Length; i++) { if (itemSlots[i] is PouchyBelt) { num++; } } Image val = instance.itemSlotIconFrames[0]; Image val2 = instance.itemSlotIcons[0]; int num2 = instance.itemSlotIconFrames.Length; ((Component)val).GetComponentInParent<CanvasScaler>(); ((Component)val).GetComponentInParent<AspectRatioFitter>(); float x2 = ((Graphic)val).rectTransform.sizeDelta.x; float y = ((Graphic)val).rectTransform.sizeDelta.y; float num3 = ((Graphic)val).rectTransform.anchoredPosition.y + 1.125f * y * (float)num; Vector3 localEulerAngles = ((Transform)((Graphic)val).rectTransform).localEulerAngles; Vector3 localEulerAngles2 = ((Transform)((Graphic)val2).rectTransform).localEulerAngles; List<Image> list = instance.itemSlotIconFrames.ToList(); List<Image> list2 = instance.itemSlotIcons.ToList(); int num4 = list.FindLastIndex((Image x) => Regex.IsMatch(((Object)((Component)x).gameObject).name.ToLowerInvariant(), "\\bslot\\d\\b")); _ = beltCapacity; _ = beltCapacity; Debug.Log((object)$"Adding {beltCapacity} item slots! Surely this will go well.."); Debug.Log((object)$"Adding after index: {num4}"); for (int j = 0; j < beltCapacity; j++) { float num5 = 0f - ((Component)((Transform)((Graphic)val).rectTransform).parent).GetComponent<RectTransform>().sizeDelta.x / 2f - 3f + (float)j * x2 + (float)j * 15f; Image val3 = Object.Instantiate<Image>(list[0], ((Component)val).transform.parent); ((Object)val3).name = $"Slot{num2 + j}[LethalThingsBelt]"; ((Graphic)val3).rectTransform.anchoredPosition = new Vector2(num5, num3); ((Transform)((Graphic)val3).rectTransform).eulerAngles = localEulerAngles; Image component = ((Component)((Component)val3).transform.GetChild(0)).GetComponent<Image>(); ((Object)component).name = "icon"; ((Behaviour)component).enabled = false; ((Transform)((Graphic)component).rectTransform).eulerAngles = localEulerAngles2; ((Transform)((Graphic)component).rectTransform).Rotate(new Vector3(0f, 0f, -90f)); int num6 = num4 + j + 1; list.Insert(num6, val3); list2.Insert(num6, component); slotIndexes.Add(num6); ((Component)val3).transform.SetSiblingIndex(num6); } instance.itemSlotIconFrames = list.ToArray(); instance.itemSlotIcons = list2.ToArray(); Debug.Log((object)$"Added {beltCapacity} item slots!"); return; } List<Image> list3 = instance.itemSlotIconFrames.ToList(); List<Image> list4 = instance.itemSlotIcons.ToList(); int count = list3.Count; int num7 = 0; for (int num8 = count - 1; num8 >= 0; num8--) { if (((Object)list3[num8]).name.Contains("[LethalThingsBelt]")) { num7++; Image obj = list3[num8]; list3.RemoveAt(num8); list4.RemoveAt(num8); Object.Destroy((Object)(object)((Component)obj).gameObject); if (num7 >= beltCapacity) { break; } } } instance.itemSlotIconFrames = list3.ToArray(); instance.itemSlotIcons = list4.ToArray(); Debug.Log((object)$"Removed {beltCapacity} item slots!"); } public void AddItemSlots() { if ((Object)(object)base.playerHeldBy != (Object)null) { List<GrabbableObject> list = base.playerHeldBy.ItemSlots.ToList(); base.playerHeldBy.ItemSlots = (GrabbableObject[])(object)new GrabbableObject[list.Count + beltCapacity]; for (int i = 0; i < list.Count; i++) { base.playerHeldBy.ItemSlots[i] = list[i]; } if ((Object)(object)base.playerHeldBy == (Object)(object)GameNetworkManager.Instance.localPlayerController) { UpdateHUD(add: true); } } } public void RemoveItemSlots() { if (!((Object)(object)base.playerHeldBy != (Object)null)) { return; } int num = base.playerHeldBy.ItemSlots.Length - beltCapacity; int currentItemSlot = base.playerHeldBy.currentItemSlot; for (int i = 0; i < beltCapacity; i++) { GrabbableObject val = base.playerHeldBy.ItemSlots[num + i]; if ((Object)(object)val != (Object)null) { base.playerHeldBy.DropItem(val, num + i); } } int currentItemSlot2 = base.playerHeldBy.currentItemSlot; currentItemSlot2 = ((currentItemSlot < base.playerHeldBy.ItemSlots.Length) ? currentItemSlot : 0); List<GrabbableObject> list = base.playerHeldBy.ItemSlots.ToList(); base.playerHeldBy.ItemSlots = (GrabbableObject[])(object)new GrabbableObject[list.Count - beltCapacity]; for (int j = 0; j < base.playerHeldBy.ItemSlots.Length; j++) { base.playerHeldBy.ItemSlots[j] = list[j]; } if ((Object)(object)base.playerHeldBy == (Object)(object)GameNetworkManager.Instance.localPlayerController) { UpdateHUD(add: false); } base.playerHeldBy.SwitchItemSlots(currentItemSlot2); } public override void DiscardItem() { RemoveItemSlots(); previousPlayerHeldBy = null; ((GrabbableObject)this).DiscardItem(); } public override void OnNetworkDespawn() { RemoveItemSlots(); previousPlayerHeldBy = null; ((NetworkBehaviour)this).OnNetworkDespawn(); } public void GrabItemOnClient() { ((GrabbableObject)this).GrabItemOnClient(); } public override void OnDestroy() { if (InputCompat.Enabled) { InputCompat.LTUtilityBeltQuick1.started -= InputReceived; InputCompat.LTUtilityBeltQuick2.started -= InputReceived; InputCompat.LTUtilityBeltQuick3.started -= InputReceived; InputCompat.LTUtilityBeltQuick4.started -= InputReceived; } ((NetworkBehaviour)this).OnDestroy(); } public override void EquipItem() { ((GrabbableObject)this).EquipItem(); if ((Object)(object)base.playerHeldBy != (Object)null) { if ((Object)(object)base.playerHeldBy != (Object)(object)previousPlayerHeldBy) { AddItemSlots(); } previousPlayerHeldBy = base.playerHeldBy; } } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected internal override string __getTypeName() { return "PouchyBelt"; } } public class PowerOutletStun : NetworkBehaviour { private Coroutine electrocutionCoroutine; public AudioSource strikeAudio; public ParticleSystem strikeParticle; private NetworkVariable<int> damage = new NetworkVariable<int>(20, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public void Electrocute(ItemCharger socket) { Debug.Log((object)"Attempting electrocution"); if (electrocutionCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(electrocutionCoroutine); } electrocutionCoroutine = ((MonoBehaviour)this).StartCoroutine(electrocutionDelayed(socket)); } public void Awake() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) StormyWeather val = Object.FindObjectOfType<StormyWeather>(true); GameObject gameObject = ((Component)val.targetedStrikeAudio).gameObject; strikeAudio = Object.Instantiate<GameObject>(gameObject, ((Component)this).transform).GetComponent<AudioSource>(); ((Component)strikeAudio).transform.localPosition = Vector3.zero; ((Component)strikeAudio).gameObject.SetActive(true); strikeParticle = Object.Instantiate<GameObject>(((Component)val.explosionEffectParticle).gameObject, ((Component)this).transform).GetComponent<ParticleSystem>(); ((Component)strikeParticle).transform.localPosition = Vector3.zero; ((Component)strikeParticle).gameObject.SetActive(true); if (((NetworkBehaviour)this).IsHost) { damage.Value = Config.itemChargerElectrocutionDamage.Value; } } private IEnumerator electrocutionDelayed(ItemCharger socket) { Debug.Log((object)"Electrocution started"); socket.zapAudio.Play(); yield return (object)new WaitForSeconds(0.75f); socket.chargeStationAnimator.SetTrigger("zap"); Debug.Log((object)"Electrocution finished"); if (((NetworkBehaviour)this).NetworkObject.IsOwner && !((NetworkBehaviour)this).NetworkObject.IsOwnedByServer) { Debug.Log((object)"Sending stun to server!!"); ElectrocutedServerRpc(((Component)this).transform.position); } else if (((NetworkBehaviour)this).NetworkObject.IsOwner && ((NetworkBehaviour)this).NetworkObject.IsOwnedByServer) { Debug.Log((object)"Sending stun to clients!!"); ElectrocutedClientRpc(((Component)this).transform.position); Electrocuted(((Component)this).transform.position); } } [ClientRpc] private void ElectrocutedClientRpc(Vector3 position) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(328188188u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref position); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 328188188u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { Debug.Log((object)"Stun received!!"); Electrocuted(position); } } } private void Electrocuted(Vector3 position) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) StormyWeather obj = Object.FindObjectOfType<StormyWeather>(true); Utilities.CreateExplosion(position, spawnExplosionEffect: false, Config.itemChargerElectrocutionDamage.Value, 0f, 5f, 3, (CauseOfDeath)11); strikeParticle.Play(); obj.PlayThunderEffects(position, strikeAudio); } [ServerRpc] private void ElectrocutedServerRpc(Vector3 position) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Invalid comparison between Unknown and I4 //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2844681185u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref position); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2844681185u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ElectrocutedClientRpc(position); } } protected override void __initializeVariables() { if (damage == null) { throw new Exception("PowerOutletStun.damage cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)damage).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)damage, "damage"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)damage); ((NetworkBehaviour)this).__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_PowerOutletStun() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(328188188u, new RpcReceiveHandler(__rpc_handler_328188188)); NetworkManager.__rpc_func_table.Add(2844681185u, new RpcReceiveHandler(__rpc_handler_2844681185)); } private static void __rpc_handler_328188188(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 position = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref position); target.__rpc_exec_stage = (__RpcExecStage)2; ((PowerOutletStun)(object)target).ElectrocutedClientRpc(position); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2844681185(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { Vector3 position = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref position); target.__rpc_exec_stage = (__RpcExecStage)1; ((PowerOutletStun)(object)target).ElectrocutedServerRpc(position); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "PowerOutletStun"; } } public class ProjectileWeapon : SaveableObject { public AudioSource mainAudio; public AudioClip[] activateClips; public AudioClip[] noAmmoSounds; public AudioClip[] reloadSounds; public Transform aimDirection; public int maxAmmo = 4; private NetworkVariable<int> currentAmmo = new NetworkVariable<int>(4, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public GameObject projectilePrefab; public float LobForce = 100f; private float timeSinceLastShot; private PlayerControllerB previousPlayerHeldBy; public Animator Animator; public ParticleSystem particleSystem; public Item ammoItem; public int ammoSlotToUse = -1; public override void SaveObjectData() { SaveData.SaveObjectData("projectileWeaponAmmoData", currentAmmo.Value, uniqueId); } public override void LoadObjectData() { if (((NetworkBehaviour)this).IsHost) { currentAmmo.Value = SaveData.LoadObjectData<int>("projectileWeaponAmmoData", uniqueId); } } public static void Init() { } private static bool GrabbableObject_UseItemBatteries(orig_UseItemBatteries orig, GrabbableObject self) { if (self is ProjectileWeapon) { return true; } return orig.Invoke(self); } public override void Start() { ((GrabbableObject)this).Start(); } public override void OnDestroy() { ((NetworkBehaviour)this).OnDestroy(); } public override void OnNetworkSpawn() { ((NetworkBehaviour)this).OnNetworkSpawn(); if (((NetworkBehaviour)this).IsServer) { currentAmmo.Value = maxAmmo; } } public override void ItemActivate(bool used, bool buttonDown = true) { //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_0085: 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) ((GrabbableObject)this).ItemActivate(used, buttonDown); if (currentAmmo.Value > 0) { if (((NetworkBehaviour)this).IsHost) { NetworkVariable<int> obj = currentAmmo; int value = obj.Value; obj.Value = value - 1; } PlayRandomAudio(mainAudio, activateClips); Animator.Play("fire"); particleSystem.Play(); timeSinceLastShot = 0f; if (((NetworkBehaviour)this).IsOwner) { if (((NetworkBehaviour)this).IsHost) { ProjectileSpawner(aimDirection.position, aimDirection.rotation); } else { SpawnProjectileServerRpc(aimDirection.position, aimDirection.rotation); } } } else { PlayRandomAudio(mainAudio, noAmmoSounds); } } private bool ReloadedGun() { int num = FindAmmoInInventory(); if (num == -1) { return false; } ammoSlotToUse = num; return true; } private int FindAmmoInInventory() { for (int i = 0; i < ((GrabbableObject)this).playerHeldBy.ItemSlots.Length; i++) { if (!((Object)(object)((GrabbableObject)this).playerHeldBy.ItemSlots[i] == (Object)null) && ((GrabbableObject)this).playerHeldBy.ItemSlots[i].itemProperties.itemId == ammoItem.itemId) { return i; } } return -1; } [ServerRpc] private void FixWeightServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(43845628u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 43845628u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { FixWeightClientRpc(); } } [ClientRpc] private void FixWeightClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(948021082u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 948021082u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && (Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null) { PlayerControllerB playerHeldBy = ((GrabbableObject)this).playerHeldBy; playerHeldBy.carryWeight -= Mathf.Clamp(ammoItem.weight - 1f, 0f, 10f); } } } public override void ItemInteractLeftRight(bool right) { ((GrabbableObject)this).ItemInteractLeftRight(right); if (right || !((NetworkBehaviour)this).IsOwner) { return; } if (ReloadedGun()) { if (currentAmmo.Value > 0) { HUDManager.Instance.DisplayTip("Item already loaded.", "You can reload once you use up all the ammo.", false, false, "LC_Tip1"); return; } ReloadAmmoServerRpc(); DestroyItemInSlotAndSync(ammoSlotToUse); ammoSlotToUse = -1; } else { HUDManager.Instance.DisplayTip("No ammo found.", "Buy " + ammoItem.itemName + " from the Terminal to reload.", false, false, "LC_Tip1"); } } [ServerRpc] private void ReloadAmmoServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1064596822u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1064596822u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { currentAmmo.Value = maxAmmo; ReloadAmmoSoundClientRpc(); } } [ClientRpc] private void ReloadAmmoSoundClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3520251861u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3520251861u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { PlayRandomAudio(mainAudio, reloadSounds); Animator.Play("reload"); } } } [ServerRpc] private void SpawnProjectileServerRpc(Vector3 aimPosition, Quaternion aimRotation) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Invalid comparison between Unknown and I4 //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(681922146u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref aimPosition); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref aimRotation); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 681922146u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ProjectileSpawner(aimPosition, aimRotation); } } private void ProjectileSpawner(Vector3 aimPosition, Quaternion aimRotation) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) GameObject obj = Object.Instantiate<GameObject>(projectilePrefab, aimPosition, aimRotation); obj.GetComponent<NetworkObject>().SpawnWithOwnership(((NetworkBehaviour)this).OwnerClientId, false); obj.GetComponent<Rigidbody>().AddForce(aimDirection.forward * LobForce, (ForceMode)1); } private void PlayRandomAudio(AudioSource audioSource, AudioClip[] audioClips) { if (audioClips.Length != 0) { audioSource.PlayOneShot(audioClips[Random.Range(0, audioClips.Length)]); } } public override void Update() { ((GrabbableObject)this).Update(); timeSinceLastShot += Time.deltaTime; } private void OnEnable() { } private void OnDisable() { } public override void PocketItem() { ((GrabbableObject)this).PocketItem(); if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null) { ((GrabbableObject)this).playerHeldBy.equippedUsableItemQE = false; } } public override void DiscardItem() { ((GrabbableObject)this).DiscardItem(); if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null) { ((GrabbableObject)this).playerHeldBy.equippedUsableItemQE = false; } } public override void EquipItem() { ((GrabbableObject)this).EquipItem(); ((GrabbableObject)this).playerHeldBy.equippedUsableItemQE = true; } public void DestroyItemInSlotAndSync(int itemSlot) { if (((NetworkBehaviour)this).IsOwner) { if (itemSlot >= ((GrabbableObject)this).playerHeldBy.ItemSlots.Length || (Object)(object)((GrabbableObject)this).playerHeldBy.ItemSlots[itemSlot] == (Object)null) { Debug.LogError((object)$"Destroy item in slot called for a slot (slot {itemSlot}) which is empty or incorrect"); } DestroyItemInSlotServerRpc(itemSlot); } } [ServerRpc] public void DestroyItemInSlotServerRpc(int itemSlot) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Invalid comparison between Unknown and I4 //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3656085789u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, itemSlot); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3656085789u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { DestroyItemInSlotClientRpc(itemSlot); } } [ClientRpc] public void DestroyItemInSlotClientRpc(int itemSlot) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(314723133u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, itemSlot); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 314723133u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { DestroyItemInSlot(itemSlot); } } } public void DestroyItemInSlot(int itemSlot) { if ((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)null || (Object)(object)NetworkManager.Singleton == (Object)null || NetworkManager.Singleton.ShutdownInProgress) { return; } GrabbableObject val = ((GrabbableObject)this).playerHeldBy.ItemSlots[itemSlot]; if ((Object)(object)val == (Object)null || (Object)(object)val.itemProperties == (Object)null) { Plugin.logger.LogError((object)"Item properties are null, cannot destroy item in slot"); return; } PlayerControllerB playerHeldBy = ((GrabbableObject)this).playerHeldBy; playerHeldBy.carryWeight -= Mathf.Clamp(val.itemProperties.weight - 1f, 0f, 10f); if (((GrabbableObject)this).playerHeldBy.currentItemSlot == itemSlot) { ((GrabbableObject)this).playerHeldBy.isHoldingObject = false; ((GrabbableObject)this).playerHeldBy.twoHanded = false; if (((NetworkBehaviour)((GrabbableObject)this).playerHeldBy).IsOwner) { ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.SetBool("cancelHolding", true); ((GrabbableObject)this).playerHeldBy.playerBod
BepInEx/plugins/FlipMods-ReservedFlashlightSlot/ReservedFlashlightSlot.dll
Decompiled 11 months agousing System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using GameNetcodeStuff; using HarmonyLib; using ReservedFlashlightSlot.Patches; using ReservedItemSlotCore; using ReservedItemSlotCore.Networking; using ReservedItemSlotCore.Patches; using Unity.Netcode; using UnityEngine; using UnityEngine.InputSystem; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("ReservedFlashlightSlot")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("ReservedFlashlightSlot")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("5b7d6563-4e51-4a69-bcf9-fa1dea6eff75")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace ReservedFlashlightSlot { public static class ConfigSettings { public static ConfigEntry<string> activateFlashlightKey; public static ConfigEntry<bool> hideFlashlightMeshShoulder; public static string activateFlashlightDisplayName; public static void BindConfigSettings() { Plugin.Log("BindingConfigs"); activateFlashlightKey = ((BaseUnityPlugin)Plugin.instance).Config.Bind<string>("ReservedItemSlotCore", "ActivateFlashlightKey", "<Keyboard>/f", "Activate flashlight keybind."); hideFlashlightMeshShoulder = ((BaseUnityPlugin)Plugin.instance).Config.Bind<bool>("ReservedItemSlotCore", "HideFlashlightOnShoulder", false, "Hides the flashlight mesh while on your shoulder."); activateFlashlightDisplayName = GetDisplayName(activateFlashlightKey.Value); } public static string GetDisplayName(string key) { key = key.Replace("<Keyboard>/", ""); key = key.Replace("<Mouse>/", ""); string text = key; text = text.Replace("leftAlt", "Alt"); text = text.Replace("rightAlt", "Alt"); text = text.Replace("leftCtrl", "Ctrl"); text = text.Replace("rightCtrl", "Ctrl"); text = text.Replace("leftShift", "Shift"); text = text.Replace("rightShift", "Shift"); text = text.Replace("leftButton", "LMB"); text = text.Replace("rightButton", "RMB"); return text.Replace("middleButton", "MMB"); } } [HarmonyPatch] internal static class Keybinds { public static PlayerControllerB localPlayerController; private static InputAction activateFlashlightAction; [HarmonyPatch(typeof(PlayerControllerB), "ConnectClientToPlayerObject")] [HarmonyPostfix] public static void OnLocalPlayerConnect(PlayerControllerB __instance) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown localPlayerController = __instance; activateFlashlightAction = new InputAction((string)null, (InputActionType)0, ConfigSettings.activateFlashlightKey.Value, "Press", (string)null, (string)null); if (((Component)localPlayerController).gameObject.activeSelf) { SubscribeToEvents(); } } private static void SubscribeToEvents() { if (activateFlashlightAction != null) { activateFlashlightAction.Enable(); activateFlashlightAction.performed += OnActivateFlashlightPerformed; } } [HarmonyPatch(typeof(PlayerControllerB), "OnEnable")] [HarmonyPostfix] public static void OnEnable(PlayerControllerB __instance) { if ((Object)(object)__instance == (Object)(object)localPlayerController) { SubscribeToEvents(); } } [HarmonyPatch(typeof(PlayerControllerB), "OnDisable")] [HarmonyPostfix] public static void OnDisable(PlayerControllerB __instance) { if (activateFlashlightAction != null && !((Object)(object)__instance != (Object)(object)localPlayerController)) { activateFlashlightAction.performed -= OnActivateFlashlightPerformed; activateFlashlightAction.Disable(); } } private static void OnActivateFlashlightPerformed(CallbackContext context) { if ((Object)(object)localPlayerController == (Object)null || !localPlayerController.isPlayerControlled || localPlayerController.inTerminalMenu || (((NetworkBehaviour)localPlayerController).IsServer && !localPlayerController.isHostPlayerObject)) { return; } FlashlightItem mainFlashlight = Patcher.GetMainFlashlight(localPlayerController); if (((CallbackContext)(ref context)).performed && !((Object)(object)mainFlashlight == (Object)null)) { float num = (float)Traverse.Create((object)localPlayerController).Field("timeSinceSwitchingSlots").GetValue(); if (!(num < 0.075f)) { ((GrabbableObject)mainFlashlight).UseItemOnClient(!((GrabbableObject)mainFlashlight).isBeingUsed); Traverse.Create((object)localPlayerController).Field("timeSinceSwitchingSlots").SetValue((object)0); } } } } [BepInPlugin("FlipMods.ReservedFlashlightSlot", "ReservedFlashlightSlot", "1.5.1")] [BepInDependency(/*Could not decode attribute arguments.*/)] internal class Plugin : BaseUnityPlugin { public static Plugin instance; private Harmony _harmony; public static ReservedItemInfo proFlashlightInfo = new ReservedItemInfo("Pro-flashlight", 120, true, true, true, true); public static ReservedItemInfo flashlightInfo = new ReservedItemInfo("Flashlight", 120, true, true, true, true); public static ReservedItemInfo laserPointerInfo = new ReservedItemInfo("Laser pointer", 120, true, true, true, true); private void Awake() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown instance = this; ConfigSettings.BindConfigSettings(); _harmony = new Harmony("ReservedFlashlightSlot"); _harmony.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"ReservedFlashlightSlot loaded"); } public static void Log(string message) { ((BaseUnityPlugin)instance).Logger.LogInfo((object)message); } } public static class PluginInfo { public const string PLUGIN_GUID = "FlipMods.ReservedFlashlightSlot"; public const string PLUGIN_NAME = "ReservedFlashlightSlot"; public const string PLUGIN_VERSION = "1.5.1"; } } namespace ReservedFlashlightSlot.Patches { [HarmonyPatch] internal static class Patcher { private static Vector3 playerShoulderPositionOffset = new Vector3(0.2f, 0f, 0f); private static Vector3 playerShoulderRotationOffset = new Vector3(90f, 0f, 0f); private static string originalControlTooltip = ""; public static PlayerControllerB localPlayerController => PlayerPatcher.localPlayerController; public static PlayerControllerB GetPreviousPlayerHeldBy(FlashlightItem flashlightItem) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown return (PlayerControllerB)Traverse.Create((object)flashlightItem).Field("previousPlayerHeldBy").GetValue(); } public static FlashlightItem GetMainFlashlight(PlayerControllerB playerController) { return GetCurrentlySelectedFlashlight(playerController) ?? GetReservedFlashlight(playerController); } public static FlashlightItem GetReservedFlashlight(PlayerControllerB playerController) { GrabbableObject obj = ((playerController != null) ? playerController.ItemSlots[Plugin.flashlightInfo.indexInInventory] : null); return (FlashlightItem)(object)((obj is FlashlightItem) ? obj : null); } public static FlashlightItem GetCurrentlySelectedFlashlight(PlayerControllerB playerController) { GrabbableObject obj = ((playerController != null) ? playerController.ItemSlots[playerController.currentItemSlot] : null); return (FlashlightItem)(object)((obj is FlashlightItem) ? obj : null); } public static bool IsFlashlightOn(PlayerControllerB playerController) { return ((GrabbableObject)(GetMainFlashlight(playerController)?)).isBeingUsed ?? false; } [HarmonyPatch(typeof(FlashlightItem), "__initializeVariables")] [HarmonyPostfix] public static void EditTooltips(FlashlightItem __instance) { if (originalControlTooltip == "") { originalControlTooltip = ((GrabbableObject)__instance).itemProperties.toolTips[((GrabbableObject)__instance).itemProperties.toolTips.Length - 1]; } ((GrabbableObject)__instance).itemProperties.toolTips[((GrabbableObject)__instance).itemProperties.toolTips.Length - 1] = $"{originalControlTooltip}[{ConfigSettings.activateFlashlightDisplayName.ToUpper()}]"; } [HarmonyPatch(typeof(MenuManager), "OnEnable")] [HarmonyPostfix] public static void ResetVariables() { Keybinds.localPlayerController = null; } [HarmonyPatch(typeof(PlayerControllerB), "ActivateItem_performed")] [HarmonyPrefix] public static bool PreventActivatingDuplicateItem(CallbackContext context, PlayerControllerB __instance) { FlashlightItem currentlySelectedFlashlight = GetCurrentlySelectedFlashlight(__instance); if ((Object)(object)__instance != (Object)(object)localPlayerController || (Object)(object)currentlySelectedFlashlight == (Object)null) { return true; } if (!((CallbackContext)(ref context)).performed) { return false; } return true; } [HarmonyPatch(typeof(FlashlightItem), "SwitchFlashlight")] [HarmonyPostfix] public static void OnSwitchOnOffFlashlight(bool on, FlashlightItem __instance) { if (!((Object)(object)((GrabbableObject)__instance).playerHeldBy == (Object)null)) { UpdateAllFlashlightStates(((GrabbableObject)__instance).playerHeldBy, on); } } [HarmonyPatch(typeof(FlashlightItem), "PocketItem")] [HarmonyPostfix] public static void OnPocketFlashlightLocal(FlashlightItem __instance) { OnPocketFlashlight(__instance, ((GrabbableObject)__instance).isBeingUsed); } [HarmonyPatch(typeof(FlashlightItem), "PocketFlashlightClientRpc")] [HarmonyPrefix] public static bool OnPocketFlashlightClientRpc(bool stillUsingFlashlight, FlashlightItem __instance) { if (!NetworkHelper.IsValidClientRpcExecStage((NetworkBehaviour)(object)__instance) || ((NetworkBehaviour)__instance).IsOwner || (Object)(object)((GrabbableObject)__instance).playerHeldBy == (Object)null || (Object)(object)((GrabbableObject)__instance).playerHeldBy == (Object)(object)localPlayerController || !NetworkHelper.IsClientExecStage((NetworkBehaviour)(object)__instance)) { return false; } OnPocketFlashlight(__instance, stillUsingFlashlight); return true; } private static void OnPocketFlashlight(FlashlightItem flashlightItem, bool stillUsingFlashlight = false) { if (!((Object)(object)((GrabbableObject)flashlightItem).playerHeldBy == (Object)null)) { FlashlightItem currentlySelectedFlashlight = GetCurrentlySelectedFlashlight(((GrabbableObject)flashlightItem).playerHeldBy); FlashlightItem reservedFlashlight = GetReservedFlashlight(((GrabbableObject)flashlightItem).playerHeldBy); bool mainFlashlightActive = stillUsingFlashlight || ((Object)(object)currentlySelectedFlashlight != (Object)null && ((GrabbableObject)currentlySelectedFlashlight).isBeingUsed); if ((Object)(object)currentlySelectedFlashlight != (Object)null && ((GrabbableObject)currentlySelectedFlashlight).isBeingUsed) { ((GrabbableObject)flashlightItem).playerHeldBy.pocketedFlashlight = null; } else if (((GrabbableObject)flashlightItem).isBeingUsed) { ((GrabbableObject)flashlightItem).playerHeldBy.pocketedFlashlight = (GrabbableObject)(object)flashlightItem; } else if ((Object)(object)reservedFlashlight != (Object)null && ((Object)(object)((GrabbableObject)flashlightItem).playerHeldBy.pocketedFlashlight == (Object)null || !((GrabbableObject)flashlightItem).playerHeldBy.pocketedFlashlight.isBeingUsed)) { ((GrabbableObject)flashlightItem).playerHeldBy.pocketedFlashlight = (GrabbableObject)(object)reservedFlashlight; } if ((Object)(object)flashlightItem == (Object)(object)reservedFlashlight) { ((GrabbableObject)flashlightItem).parentObject = ((GrabbableObject)flashlightItem).playerHeldBy.playerGlobalHead; } UpdateAllFlashlightStates(((GrabbableObject)flashlightItem).playerHeldBy, mainFlashlightActive); } } [HarmonyPatch(typeof(FlashlightItem), "EquipItem")] [HarmonyPostfix] public static void OnEquipFlashlight(FlashlightItem __instance) { if (!((Object)(object)((GrabbableObject)__instance).playerHeldBy == (Object)null)) { bool mainFlashlightActive = ((Object)(object)((GrabbableObject)__instance).playerHeldBy.pocketedFlashlight != (Object)null && ((GrabbableObject)__instance).playerHeldBy.pocketedFlashlight.isBeingUsed) || ((GrabbableObject)__instance).isBeingUsed; FlashlightItem reservedFlashlight = GetReservedFlashlight(((GrabbableObject)__instance).playerHeldBy); if (((GrabbableObject)__instance).isBeingUsed || (Object)(object)__instance == (Object)(object)((GrabbableObject)__instance).playerHeldBy.pocketedFlashlight) { ((GrabbableObject)__instance).playerHeldBy.pocketedFlashlight = null; } else if ((Object)(object)reservedFlashlight != (Object)null && ((Object)(object)((GrabbableObject)__instance).playerHeldBy.pocketedFlashlight == (Object)null || !((GrabbableObject)__instance).playerHeldBy.pocketedFlashlight.isBeingUsed)) { ((GrabbableObject)__instance).playerHeldBy.pocketedFlashlight = (GrabbableObject)(object)reservedFlashlight; } ((GrabbableObject)__instance).parentObject = (((Object)(object)((GrabbableObject)__instance).playerHeldBy == (Object)(object)localPlayerController) ? ((GrabbableObject)__instance).playerHeldBy.localItemHolder : ((GrabbableObject)__instance).playerHeldBy.serverItemHolder); UpdateAllFlashlightStates(((GrabbableObject)__instance).playerHeldBy, mainFlashlightActive); } } [HarmonyPatch(typeof(FlashlightItem), "DiscardItem")] [HarmonyPrefix] public static void ResetPocketedFlashlight(FlashlightItem __instance) { PlayerControllerB previousPlayerHeldBy = GetPreviousPlayerHeldBy(__instance); if (!((Object)(object)previousPlayerHeldBy == (Object)null)) { FlashlightItem reservedFlashlight = GetReservedFlashlight(previousPlayerHeldBy); if ((Object)(object)reservedFlashlight != (Object)null && ((Object)(object)__instance == (Object)(object)previousPlayerHeldBy.pocketedFlashlight || (Object)(object)previousPlayerHeldBy.pocketedFlashlight == (Object)null)) { previousPlayerHeldBy.pocketedFlashlight = (GrabbableObject)(object)reservedFlashlight; } } } [HarmonyPatch(typeof(GrabbableObject), "LateUpdate")] [HarmonyPostfix] public static void SetPositionOffset(GrabbableObject __instance) { //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) if (__instance is FlashlightItem && (Object)(object)__instance.playerHeldBy != (Object)null && __instance.isPocketed && (Object)(object)__instance.parentObject != (Object)null && (Object)(object)__instance != (Object)(object)GetCurrentlySelectedFlashlight(__instance.playerHeldBy)) { Transform transform = ((Component)__instance.parentObject).transform; ((Component)__instance).transform.rotation = ((Component)__instance.parentObject).transform.rotation * Quaternion.Euler(playerShoulderRotationOffset); ((Component)__instance).transform.position = transform.position + transform.rotation * playerShoulderPositionOffset; } } [HarmonyPatch(typeof(GrabbableObject), "EnableItemMeshes")] [HarmonyPrefix] public static void OnEnableItemMeshes(ref bool enable, GrabbableObject __instance) { if (__instance is FlashlightItem && (Object)(object)__instance.playerHeldBy != (Object)null && ((Object)(object)__instance == (Object)(object)GetCurrentlySelectedFlashlight(__instance.playerHeldBy) || ((Object)(object)__instance == (Object)(object)GetReservedFlashlight(__instance.playerHeldBy) && (Object)(object)__instance.playerHeldBy != (Object)(object)localPlayerController))) { enable = true; } } private static void UpdateAllFlashlightStates(PlayerControllerB playerController, bool mainFlashlightActive = true) { FlashlightItem mainFlashlight = GetMainFlashlight(playerController); if ((Object)(object)mainFlashlight == (Object)null) { ((Behaviour)playerController.helmetLight).enabled = false; mainFlashlightActive = false; } else { playerController.ChangeHelmetLight(mainFlashlight.flashlightTypeID, mainFlashlightActive && (Object)(object)playerController == (Object)(object)localPlayerController && (Object)(object)playerController.ItemSlots[playerController.currentItemSlot] != (Object)(object)mainFlashlight); } for (int i = 0; i < PlayerPatcher.combinedHotbarSize; i++) { GrabbableObject obj = playerController.ItemSlots[i]; FlashlightItem val = (FlashlightItem)(object)((obj is FlashlightItem) ? obj : null); if ((Object)(object)val != (Object)null) { UpdateFlashlightState(val, (Object)(object)val == (Object)(object)mainFlashlight && mainFlashlightActive); } } } private static void UpdateFlashlightState(FlashlightItem flashlightItem, bool active) { if (!((Object)(object)((GrabbableObject)flashlightItem).playerHeldBy == (Object)null)) { PlayerControllerB playerHeldBy = ((GrabbableObject)flashlightItem).playerHeldBy; ((GrabbableObject)flashlightItem).isBeingUsed = active; bool flag = (Object)(object)playerHeldBy != (Object)(object)localPlayerController || (Object)(object)playerHeldBy.ItemSlots[playerHeldBy.currentItemSlot] == (Object)(object)flashlightItem; ((Behaviour)flashlightItem.flashlightBulb).enabled = active && flag; ((Behaviour)flashlightItem.flashlightBulbGlow).enabled = active && flag; flashlightItem.usingPlayerHelmetLight = active && !flag; } } } }
BepInEx/plugins/FlipMods-ReservedItemSlotCore/ReservedItemSlotCore.dll
Decompiled 11 months agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using GameNetcodeStuff; using HarmonyLib; using ReservedItemSlotCore.Config; using ReservedItemSlotCore.Networking; using ReservedItemSlotCore.Patches; using TMPro; using Unity.Collections; using Unity.Netcode; using UnityEngine; using UnityEngine.InputSystem; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("ReservedItemSlotCore")] [assembly: AssemblyDescription("Mod made by flipf17")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("ReservedItemSlotCore")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("238ce080-e339-46b6-9b08-992a950453a1")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: InternalsVisibleTo("ReservedFlashlightSlot")] [assembly: InternalsVisibleTo("ReservedWalkieSlot")] [assembly: InternalsVisibleTo("ReservedBoomboxSlot")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace ReservedItemSlotCore { [HarmonyPatch] internal static class HotbarSlotSync { public static PlayerControllerB localPlayerController; [HarmonyPatch(typeof(PlayerControllerB), "ConnectClientToPlayerObject")] [HarmonyPostfix] public static void Init(PlayerControllerB __instance) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Expected O, but got Unknown localPlayerController = __instance; NetworkManager.Singleton.CustomMessagingManager.RegisterNamedMessageHandler("OnSwapHotbarClientRpc", new HandleNamedMessageDelegate(OnSwapHotbarClientRpc)); if (NetworkManager.Singleton.IsServer) { NetworkManager.Singleton.CustomMessagingManager.RegisterNamedMessageHandler("OnSwapHotbarServerRpc", new HandleNamedMessageDelegate(OnSwapHotbarServerRpc)); } } private static void SendSwapHotbarUpdate(int hotbarSlot) { //IL_0038: 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_0056: Unknown result type (might be due to invalid IL or missing references) if (NetworkManager.Singleton.IsClient) { FastBufferWriter val = default(FastBufferWriter); ((FastBufferWriter)(ref val))..ctor(4, (Allocator)2, -1); try { Plugin.Log("Sending hotbar swap slot: " + hotbarSlot); ((FastBufferWriter)(ref val)).WriteValue<int>(ref hotbarSlot, default(ForPrimitives)); NetworkManager.Singleton.CustomMessagingManager.SendNamedMessage("OnSwapHotbarServerRpc", 0uL, val, (NetworkDelivery)3); return; } finally { ((IDisposable)(FastBufferWriter)(ref val)).Dispose(); } } Plugin.Log("Failed to send hotbar swap index."); } private static void OnSwapHotbarServerRpc(ulong clientId, FastBufferReader reader) { //IL_002d: 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_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0082: 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_009e: Unknown result type (might be due to invalid IL or missing references) if (!NetworkManager.Singleton.IsServer) { return; } if (((FastBufferReader)(ref reader)).TryBeginRead(4)) { int num = default(int); ((FastBufferReader)(ref reader)).ReadValue<int>(ref num, default(ForPrimitives)); Plugin.Log("Receiving request for hotbar swap. Slot: " + num + " ClientId: " + clientId); FastBufferWriter val = default(FastBufferWriter); ((FastBufferWriter)(ref val))..ctor(12, (Allocator)2, -1); try { ((FastBufferWriter)(ref val)).WriteValueSafe<int>(ref num, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe<ulong>(ref clientId, default(ForPrimitives)); NetworkManager.Singleton.CustomMessagingManager.SendNamedMessageToAll("OnSwapHotbarClientRpc", val, (NetworkDelivery)3); return; } finally { ((IDisposable)(FastBufferWriter)(ref val)).Dispose(); } } Plugin.Log("Failed to receive hotbar swap index from Client: " + clientId); } private static void OnSwapHotbarClientRpc(ulong clientId, FastBufferReader reader) { //IL_002e: 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_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) if (!NetworkManager.Singleton.IsClient) { return; } if (((FastBufferReader)(ref reader)).TryBeginRead(12)) { int hotbarSlot = default(int); ((FastBufferReader)(ref reader)).ReadValue<int>(ref hotbarSlot, default(ForPrimitives)); ulong num = default(ulong); ((FastBufferReader)(ref reader)).ReadValue<ulong>(ref num, default(ForPrimitives)); Plugin.Log("Receiving update for hotbar swap. Slot: " + hotbarSlot + " ClientId: " + num); if (num == localPlayerController.actualClientId || UpdateClientHotbarSlot(num, hotbarSlot)) { return; } Plugin.Log("Failed to receive hotbar swap index from Client: " + num); } Plugin.Log("Failed to receive hotbar swap index from Client"); } private static bool UpdateClientHotbarSlot(ulong clientId, int hotbarSlot) { Plugin.Log("Updating hotbar slot: " + hotbarSlot + " ClientId: " + clientId); for (int i = 0; i < StartOfRound.Instance.allPlayerScripts.Length; i++) { if (StartOfRound.Instance.allPlayerScripts[i].actualClientId == clientId) { CallSwitchToItemSlotMethod(StartOfRound.Instance.allPlayerScripts[i], hotbarSlot); return true; } } return false; } public static void SwapHotbarSlot(int hotbarIndex) { SendSwapHotbarUpdate(hotbarIndex); CallSwitchToItemSlotMethod(localPlayerController, hotbarIndex); Traverse.Create((object)localPlayerController).Field("timeSinceSwitchingSlots").SetValue((object)0); } private static void CallSwitchToItemSlotMethod(PlayerControllerB playerController, int hotbarIndex) { ShipBuildModeManager.Instance.CancelBuildMode(true); MethodInfo method = ((object)playerController).GetType().GetMethod("SwitchToItemSlot", BindingFlags.Instance | BindingFlags.NonPublic); method.Invoke(playerController, new object[2] { hotbarIndex, null }); if ((Object)(object)playerController.currentlyHeldObjectServer != (Object)null) { ((Component)playerController.currentlyHeldObjectServer).gameObject.GetComponent<AudioSource>().PlayOneShot(playerController.currentlyHeldObjectServer.itemProperties.grabSFX, 0.6f); } } } [HarmonyPatch] internal static class Keybinds { public static PlayerControllerB localPlayerController; public static InputAction focusReservedHotbarAction; public static bool holdingModifierKey; [HarmonyPatch(typeof(PlayerControllerB), "ConnectClientToPlayerObject")] [HarmonyPostfix] public static void OnLocalPlayerConnect(PlayerControllerB __instance) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown localPlayerController = __instance; focusReservedHotbarAction = new InputAction((string)null, (InputActionType)0, ConfigSettings.focusReservedHotbarHotkey.Value, (string)null, (string)null, (string)null); if (((Component)localPlayerController).gameObject.activeSelf) { SubscribeToEvents(); } } private static void SubscribeToEvents() { if (focusReservedHotbarAction != null && Plugin.numReservedItemSlots > 0) { focusReservedHotbarAction.performed += FocusReservedHotbarSlotsAction; focusReservedHotbarAction.canceled += UnfocusReservedHotbarSlotsPerformed; focusReservedHotbarAction.Enable(); } } [HarmonyPatch(typeof(PlayerControllerB), "OnEnable")] [HarmonyPostfix] public static void OnEnable(PlayerControllerB __instance) { if ((Object)(object)__instance == (Object)(object)localPlayerController) { SubscribeToEvents(); } } [HarmonyPatch(typeof(PlayerControllerB), "OnDisable")] [HarmonyPostfix] public static void OnDisable(PlayerControllerB __instance) { if (focusReservedHotbarAction != null && Plugin.numReservedItemSlots > 0 && !((Object)(object)__instance != (Object)(object)localPlayerController)) { focusReservedHotbarAction.performed -= FocusReservedHotbarSlotsAction; focusReservedHotbarAction.canceled -= UnfocusReservedHotbarSlotsPerformed; focusReservedHotbarAction.Disable(); } } private static void FocusReservedHotbarSlotsAction(CallbackContext context) { if (!((Object)(object)localPlayerController == (Object)null) && !((Object)(object)localPlayerController == (Object)null) && ((NetworkBehaviour)localPlayerController).IsOwner && localPlayerController.isPlayerControlled && (!((NetworkBehaviour)localPlayerController).IsServer || localPlayerController.isHostPlayerObject)) { holdingModifierKey = true; bool flag = (bool)Traverse.Create((object)localPlayerController).Field("throwingObject").GetValue(); if (!(localPlayerController.inTerminalMenu || localPlayerController.isPlayerDead || localPlayerController.isGrabbingObjectAnimation || localPlayerController.inSpecialInteractAnimation || flag) && !localPlayerController.isTypingChat && !localPlayerController.twoHanded && !localPlayerController.activatingItem && ((CallbackContext)(ref context)).performed) { ReservedItemPatcher.SetFocusReservedHotbarSlots(active: true); } } } private static void UnfocusReservedHotbarSlotsPerformed(CallbackContext context) { if (!((Object)(object)localPlayerController == (Object)null) && ((NetworkBehaviour)localPlayerController).IsOwner && (!((NetworkBehaviour)localPlayerController).IsServer || localPlayerController.isHostPlayerObject)) { holdingModifierKey = false; if (ReservedItemPatcher.CanSwapToReservedHotbarSlot() && ((CallbackContext)(ref context)).canceled) { ReservedItemPatcher.SetFocusReservedHotbarSlots(active: false); } } } } [BepInPlugin("FlipMods.ReservedItemSlotCore", "ReservedItemSlotCore", "1.6.6")] internal class Plugin : BaseUnityPlugin { private Harmony _harmony; public static Plugin instance; public static Dictionary<string, ReservedItemInfo> reservedItemsDict => ReservedItemInfo.reservedItemsDict; public static List<ReservedItemInfo> reservedItemsList => ReservedItemInfo.reservedItemsList; public static List<ReservedItemInfo> reservedItemSlotReps => ReservedItemInfo.reservedItemSlotReps; public static int numReservedItemSlots => ReservedItemInfo.numReservedItemSlots; private void Awake() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown instance = this; _harmony = new Harmony("ReservedItemSlotCore"); ConfigSettings.BindConfigSettings(); _harmony.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"ReservedItemSlotCore loaded"); } public static void Log(string message) { ((BaseUnityPlugin)instance).Logger.LogInfo((object)message); } public static bool IsReservedItem(string itemName) { return reservedItemsDict.ContainsKey(itemName); } public static ReservedItemInfo GetReservedItemInfo(string itemName) { return IsReservedItem(itemName) ? reservedItemsDict[itemName] : null; } public static ReservedItemInfo GetReservedItemInfo(GrabbableObject item) { return ((Object)(object)item != (Object)null) ? GetReservedItemInfo(item.itemProperties.itemName) : null; } public static int GetReservedItemHotbarIndex(string itemName) { return IsReservedItem(itemName) ? reservedItemsDict[itemName].indexInInventory : (-1); } } internal class ReservedItemInfo { public static Dictionary<string, ReservedItemInfo> reservedItemsDict = new Dictionary<string, ReservedItemInfo>(); public static List<ReservedItemInfo> reservedItemsList = new List<ReservedItemInfo>(); public static List<ReservedItemInfo> reservedItemSlotReps = new List<ReservedItemInfo>(); public static int defaultHotbarSlotPriority = 10; public static int currentUndefinedHotbarSlotPriority = 0; public string itemName; public int hotbarSlotPriority; private int undefinedHotbarSlotPriority = -1; public int reservedItemIndex; public bool forceUpdateCanBeGrabbedBeforeGameStart = false; public bool canBeGrabbedBeforeGameStart = false; public bool forceUpdateRequiresBattery = false; public bool requiresBattery = false; public static int numReservedItemSlots => reservedItemSlotReps.Count; public int indexInInventory => ((Object)(object)PlayerPatcher.localPlayerController != (Object)null) ? (PlayerPatcher.reservedItemsStartIndex + reservedItemIndex) : (-1); public ReservedItemInfo(string itemName, int hotbarSlotPriority = -1, bool forceUpdateCanBeGrabbedBeforeGameStart = false, bool canBeGrabbedBeforeGameStart = false, bool forceUpdateRequiresBattery = false, bool requiresBattery = false) { this.itemName = itemName; this.forceUpdateCanBeGrabbedBeforeGameStart = forceUpdateCanBeGrabbedBeforeGameStart; this.canBeGrabbedBeforeGameStart = canBeGrabbedBeforeGameStart; this.forceUpdateRequiresBattery = forceUpdateRequiresBattery; this.requiresBattery = requiresBattery; if (hotbarSlotPriority != -1) { this.hotbarSlotPriority = hotbarSlotPriority; } else { this.hotbarSlotPriority = defaultHotbarSlotPriority; undefinedHotbarSlotPriority = ++currentUndefinedHotbarSlotPriority; } if (!reservedItemsDict.ContainsKey(this.itemName)) { reservedItemsDict.Add(this.itemName, this); reservedItemsList.Add(this); int i; for (i = 0; i < reservedItemSlotReps.Count; i++) { ReservedItemInfo reservedItemInfo = reservedItemSlotReps[i]; if (this.hotbarSlotPriority == reservedItemInfo.hotbarSlotPriority || this.hotbarSlotPriority > reservedItemInfo.hotbarSlotPriority) { break; } } reservedItemIndex = i; if (i != reservedItemSlotReps.Count && reservedItemSlotReps[i].undefinedHotbarSlotPriority == undefinedHotbarSlotPriority) { return; } reservedItemSlotReps.Insert(i, this); { foreach (ReservedItemInfo reservedItems in reservedItemsList) { if (this != reservedItems && reservedItems.reservedItemIndex >= i) { reservedItems.reservedItemIndex++; } } return; } } Plugin.Log($"Tried to add duplicate item name to the ReservedItems list: {this.itemName}"); } } public static class PluginInfo { public const string PLUGIN_GUID = "FlipMods.ReservedItemSlotCore"; public const string PLUGIN_NAME = "ReservedItemSlotCore"; public const string PLUGIN_VERSION = "1.6.6"; } } namespace ReservedItemSlotCore.Config { public static class ConfigSettings { public static ConfigEntry<string> focusReservedHotbarHotkey; public static ConfigEntry<bool> preventReservedItemSlotFade; public static ConfigEntry<string> specialReservedItemUseHotkey; public static string focusReservedHotbarHotkeyDisplayName; public static void BindConfigSettings() { Plugin.Log("BindingConfigs"); focusReservedHotbarHotkey = ((BaseUnityPlugin)Plugin.instance).Config.Bind<string>("ReservedItemSlotCore", "FocusReservedItemSlotsHotkey", "<Keyboard>/leftAlt", "Which key will focus your reserved item slots hotbar to allow selcting, dropping, charging, etc."); preventReservedItemSlotFade = ((BaseUnityPlugin)Plugin.instance).Config.Bind<bool>("ReservedItemSlotCore", "PreventReservedHotbarSlotFade", false, "If true, the reserved hotbar slots will not fade with the rest of the default slots."); specialReservedItemUseHotkey = ((BaseUnityPlugin)Plugin.instance).Config.Bind<string>("ReservedItemSlotCore", "SpecialReservedItemUseHotkey", "<Mouse>/middleButton", "[REMOVED] Which key will focus your reserved item slots hotbar to allow selcting, dropping, charging, etc."); focusReservedHotbarHotkeyDisplayName = GetDisplayName(focusReservedHotbarHotkey.Value); } public static string GetDisplayName(string key) { key = key.Replace("<Keyboard>/", ""); key = key.Replace("<Mouse>/", ""); string text = key; text = text.Replace("leftAlt", "Alt"); text = text.Replace("rightAlt", "Alt"); text = text.Replace("leftCtrl", "Ctrl"); text = text.Replace("rightCtrl", "Ctrl"); text = text.Replace("leftShift", "Shift"); text = text.Replace("rightShift", "Shift"); text = text.Replace("leftButton", "LMB"); text = text.Replace("rightButton", "RMB"); return text.Replace("middleButton", "MMB"); } } } namespace ReservedItemSlotCore.Networking { public static class NetworkHelper { private static int NONE_EXEC_STAGE = 0; private static int SERVER_EXEC_STAGE = 1; private static int CLIENT_EXEC_STAGE = 2; public static int GetExecStage(NetworkBehaviour __instance) { return (int)Traverse.Create((object)__instance).Field("__rpc_exec_stage").GetValue(); } public static bool IsClientExecStage(NetworkBehaviour __instance) { return GetExecStage(__instance) == CLIENT_EXEC_STAGE; } public static bool IsServerExecStage(NetworkBehaviour __instance) { return GetExecStage(__instance) == SERVER_EXEC_STAGE; } public static bool IsValidClientRpcExecStage(NetworkBehaviour __instance) { NetworkManager singleton = NetworkManager.Singleton; if ((Object)(object)singleton == (Object)null || !singleton.IsListening) { return false; } int num = (int)Traverse.Create((object)__instance).Field("__rpc_exec_stage").GetValue(); if ((singleton.IsServer || singleton.IsHost) && num != 2) { return false; } return true; } } } namespace ReservedItemSlotCore.Patches { [HarmonyPatch] public static class HUDPatcher { private static CanvasScaler canvasScaler; private static AspectRatioFitter aspectRatioFitter; private static float iconWidth; private static float xPos; public static int startIndexReservedItemSlots; [HarmonyPatch(typeof(HUDManager), "Awake")] [HarmonyPrefix] public static void Initialize(HUDManager __instance) { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) canvasScaler = ((Component)__instance.itemSlotIconFrames[0]).GetComponentInParent<CanvasScaler>(); aspectRatioFitter = ((Component)__instance.itemSlotIconFrames[0]).GetComponentInParent<AspectRatioFitter>(); iconWidth = ((Component)__instance.itemSlotIconFrames[0]).GetComponent<RectTransform>().sizeDelta.x; xPos = canvasScaler.referenceResolution.x / 2f / aspectRatioFitter.aspectRatio - iconWidth / 4f; } public static void AddNewHotbarSlotsHud() { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Unknown result type (might be due to invalid IL or missing references) //IL_0294: Unknown result type (might be due to invalid IL or missing references) //IL_02a9: Unknown result type (might be due to invalid IL or missing references) //IL_02b6: Unknown result type (might be due to invalid IL or missing references) //IL_02c0: Unknown result type (might be due to invalid IL or missing references) //IL_02d4: Unknown result type (might be due to invalid IL or missing references) //IL_02f0: Unknown result type (might be due to invalid IL or missing references) if (PlayerPatcher.reservedHotbarSize > 0) { List<Image> list = new List<Image>(HUDManager.Instance.itemSlotIconFrames); List<Image> list2 = new List<Image>(HUDManager.Instance.itemSlotIcons); float y = ((Component)HUDManager.Instance.itemSlotIconFrames[0]).GetComponent<RectTransform>().sizeDelta.y; Vector3 eulerAngles = ((Transform)((Component)HUDManager.Instance.itemSlotIconFrames[0]).GetComponent<RectTransform>()).eulerAngles; Vector3 eulerAngles2 = ((Transform)((Component)HUDManager.Instance.itemSlotIcons[0]).GetComponent<RectTransform>()).eulerAngles; Plugin.Log($"Adding {ReservedItemInfo.reservedItemSlotReps.Count} Reserved item slots to the inventory HUD. Previous inventory HUD size: {PlayerPatcher.reservedItemsStartIndex}"); for (int i = 0; i < Plugin.reservedItemSlotReps.Count; i++) { ReservedItemInfo reservedItemInfo = Plugin.reservedItemSlotReps[i]; Plugin.Log($"Adding Reserved item slot for item types [{reservedItemInfo.itemName}]. Inventory index: {list.Count}"); float num = ((Graphic)HUDManager.Instance.itemSlotIconFrames[0]).rectTransform.anchoredPosition.y + 1.125f * y * (float)i; Image val = Object.Instantiate<Image>(HUDManager.Instance.itemSlotIconFrames[PlayerPatcher.reservedItemsStartIndex - 1], ((Component)HUDManager.Instance.itemSlotIconFrames[0]).transform.parent); ((Object)val).name = $"ReservedItemSlot{i} [{reservedItemInfo.itemName}]"; ((Graphic)val).rectTransform.anchoredPosition = new Vector2(xPos, num); ((Transform)((Graphic)val).rectTransform).eulerAngles = eulerAngles; CanvasGroup val2 = ((Component)val).gameObject.AddComponent<CanvasGroup>(); val2.ignoreParentGroups = ConfigSettings.preventReservedItemSlotFade.Value; val2.alpha = 1f; Image component = ((Component)((Component)val).transform.GetChild(0)).GetComponent<Image>(); ((Object)component).name = "Icon"; ((Transform)((Graphic)component).rectTransform).eulerAngles = eulerAngles2; list.Add(val); list2.Add(component); } if (Plugin.numReservedItemSlots > 0) { TextMeshProUGUI component2 = new GameObject("ReservedItemSlotTooltip", new Type[2] { typeof(RectTransform), typeof(TextMeshProUGUI) }).GetComponent<TextMeshProUGUI>(); RectTransform rectTransform = ((TMP_Text)component2).rectTransform; ((Component)rectTransform).transform.parent = ((Component)list[PlayerPatcher.reservedItemsStartIndex]).transform; ((Transform)rectTransform).localScale = Vector3.one; rectTransform.sizeDelta = new Vector2(((Graphic)list[0]).rectTransform.sizeDelta.x * 2f, 10f); rectTransform.pivot = Vector2.one / 2f; rectTransform.anchoredPosition3D = new Vector3(0f, (0f - rectTransform.sizeDelta.x / 2f) * 1.2f, 0f); ((TMP_Text)component2).font = ((TMP_Text)HUDManager.Instance.controlTipLines[0]).font; ((TMP_Text)component2).fontSize = 7f; ((TMP_Text)component2).alignment = (TextAlignmentOptions)514; ((TMP_Text)component2).text = string.Format($"Hold: [{ConfigSettings.GetDisplayName(ConfigSettings.focusReservedHotbarHotkey.Value)}]"); } HUDManager.Instance.itemSlotIconFrames = list.ToArray(); HUDManager.Instance.itemSlotIcons = list2.ToArray(); Plugin.Log($"Finished adding {PlayerPatcher.reservedHotbarSize} Reserved Item slots in the inventory HUD."); } } public static void UpdateHUD() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < PlayerPatcher.reservedHotbarSize; i++) { int num = PlayerPatcher.reservedItemsStartIndex + i; float num2 = ((Graphic)HUDManager.Instance.itemSlotIconFrames[0]).rectTransform.anchoredPosition.y + 1.125f * iconWidth * (float)i; ((Graphic)HUDManager.Instance.itemSlotIconFrames[num]).rectTransform.anchoredPosition = new Vector2(xPos, num2); } } } [HarmonyPatch] public static class ReservedItemPatcher { public static bool isReservedHotbarFocused; public static int indexUnfocusedReservedHotbar; public static int indexFocusedReservedHotbar; internal static Dictionary<PlayerControllerB, ReservedItemInfo> grabbingReservedItemInfoDict; private static GrabbableObject previouslyHeldObjectServer; public static PlayerControllerB localPlayerController => PlayerPatcher.localPlayerController; public static int reservedItemsStartIndex => PlayerPatcher.reservedItemsStartIndex; public static int reservedHotbarSize => Plugin.numReservedItemSlots; internal static ReservedItemInfo grabbingReservedItemInfoLocal { get { return ((Object)(object)localPlayerController != (Object)null) ? grabbingReservedItemInfoDict[localPlayerController] : null; } set { if (!((Object)(object)localPlayerController == (Object)null)) { grabbingReservedItemInfoDict[localPlayerController] = value; } } } [HarmonyPatch(typeof(MenuManager), "OnEnable")] [HarmonyPrefix] public static void ResetVariables(MenuManager __instance) { if (grabbingReservedItemInfoDict == null) { grabbingReservedItemInfoDict = new Dictionary<PlayerControllerB, ReservedItemInfo>(); } if (grabbingReservedItemInfoDict.Count > 0) { grabbingReservedItemInfoDict.Clear(); } } [HarmonyPatch(typeof(PlayerControllerB), "ConnectClientToPlayerObject")] [HarmonyPostfix] public static void OnLocalPlayerConnect(PlayerControllerB __instance) { grabbingReservedItemInfoDict[__instance] = null; } private static GrabbableObject GetCurrentlyGrabbingObject(PlayerControllerB playerController) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown return (GrabbableObject)Traverse.Create((object)playerController).Field("currentlyGrabbingObject").GetValue(); } private static void SetCurrentlyGrabbingObject(PlayerControllerB playerController, GrabbableObject grabbable) { Traverse.Create((object)playerController).Field("currentlyGrabbingObject").SetValue((object)grabbable); } [HarmonyPatch(typeof(PlayerControllerB), "BeginGrabObject")] [HarmonyPrefix] public static bool GrabReservedItemPrefix(PlayerControllerB __instance) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Expected O, but got Unknown if (isReservedHotbarFocused) { return false; } Ray val = default(Ray); ((Ray)(ref val))..ctor(((Component)__instance.gameplayCamera).transform.position, ((Component)__instance.gameplayCamera).transform.forward); RaycastHit val2 = default(RaycastHit); if (!Physics.Raycast(val, ref val2, __instance.grabDistance, PlayerPatcher.INTERACTABLE_OBJECT_MASK) || ((Component)((RaycastHit)(ref val2)).collider).gameObject.layer == 8 || !(((Component)((RaycastHit)(ref val2)).collider).tag == "PhysicsProp") || __instance.twoHanded || __instance.sinkingValue > 0.73f) { grabbingReservedItemInfoLocal = null; return true; } GrabbableObject component = ((Component)((Component)((RaycastHit)(ref val2)).collider).transform).gameObject.GetComponent<GrabbableObject>(); grabbingReservedItemInfoLocal = Plugin.GetReservedItemInfo(component); if (grabbingReservedItemInfoLocal == null) { return true; } if (!GameNetworkManager.Instance.gameHasStarted && !component.itemProperties.canBeGrabbedBeforeGameStart && !StartOfRound.Instance.testRoom.activeSelf) { return false; } Traverse.Create((object)__instance).Field("grabInvalidated").SetValue((object)false); SetCurrentlyGrabbingObject(__instance, component); if (__instance.inSpecialInteractAnimation || component.isHeld || component.isPocketed) { return false; } NetworkObject networkObject = ((NetworkBehaviour)component).NetworkObject; if ((Object)(object)networkObject == (Object)null || !networkObject.IsSpawned) { return false; } if (grabbingReservedItemInfoLocal == null || !IsItemSlotEmpty(grabbingReservedItemInfoLocal)) { return true; } ((Behaviour)__instance.cursorIcon).enabled = false; ((TMP_Text)__instance.cursorTip).text = ""; __instance.twoHanded = component.itemProperties.twoHanded; __instance.carryWeight += Mathf.Clamp(component.itemProperties.weight - 1f, 0f, 10f); __instance.grabObjectAnimationTime = 0f; MethodInfo method = ((object)__instance).GetType().GetMethod("GrabObjectServerRpc", BindingFlags.Instance | BindingFlags.NonPublic); method.Invoke(__instance, new object[1] { NetworkObjectReference.op_Implicit(networkObject) }); Coroutine val3 = (Coroutine)Traverse.Create((object)__instance).Field("grabObjectCoroutine").GetValue(); if (val3 != null) { ((MonoBehaviour)__instance).StopCoroutine(val3); } MethodInfo method2 = ((object)__instance).GetType().GetMethod("GrabObject", BindingFlags.Instance | BindingFlags.NonPublic); val3 = ((MonoBehaviour)__instance).StartCoroutine((IEnumerator)method2.Invoke(__instance, new object[0])); Traverse.Create((object)__instance).Field("grabObjectCoroutine").SetValue((object)val3); return false; } [HarmonyPatch(typeof(PlayerControllerB), "GrabObjectClientRpc")] [HarmonyPrefix] public static bool GrabReservedItemClientRpcPrefix(bool grabValidated, NetworkObjectReference grabbedObject, PlayerControllerB __instance) { if (!NetworkHelper.IsClientExecStage((NetworkBehaviour)(object)__instance)) { return true; } if ((Object)(object)NetworkManager.Singleton != (Object)null && NetworkManager.Singleton.IsListening) { if (grabValidated) { NetworkObject val = default(NetworkObject); if (((NetworkObjectReference)(ref grabbedObject)).TryGet(ref val, (NetworkManager)null)) { GrabbableObject component = ((Component)val).GetComponent<GrabbableObject>(); ReservedItemInfo reservedItemInfo = Plugin.GetReservedItemInfo(component); if (reservedItemInfo != null && IsItemSlotEmpty(reservedItemInfo, __instance)) { __instance.ItemSlots[reservedItemInfo.indexInInventory] = component; component.playerHeldBy = __instance; component.isHeld = true; component.EnablePhysics(false); component.hasHitGround = false; component.isInFactory = __instance.isInsideFactory; component.EnableItemMeshes(false); Traverse.Create((object)component).Field("previousPlayerHeldBy").SetValue((object)__instance); component.PocketItem(); if ((Object)(object)__instance != (Object)(object)localPlayerController) { Plugin.Log("Grab object completed on player: " + ((Object)__instance).name); if ((Object)(object)component.itemProperties.grabSFX != (Object)null) { __instance.itemAudio.PlayOneShot(component.itemProperties.grabSFX, 1f); } grabbingReservedItemInfoDict[__instance] = null; } else { HUDManager.Instance.itemSlotIcons[reservedItemInfo.indexInInventory].sprite = component.itemProperties.itemIcon; ((Behaviour)HUDManager.Instance.itemSlotIcons[reservedItemInfo.indexInInventory]).enabled = true; HUDManager.Instance.PingHUDElement(HUDManager.Instance.Inventory, 1.5f, 1f, 0.13f); previouslyHeldObjectServer = localPlayerController.currentlyHeldObjectServer; localPlayerController.currentlyHeldObjectServer = component; } return false; } } } else if ((Object)(object)__instance == (Object)(object)localPlayerController) { Plugin.Log("Failed to validate ReservedItemGrab by the local player. Object id: " + ((NetworkObjectReference)(ref grabbedObject)).NetworkObjectId + "."); Traverse.Create((object)localPlayerController).Field("grabInvalidated").SetValue((object)true); } else { Plugin.Log("Failed to validate ReservedItemGrab by player with id: " + ((Object)__instance).name + ". Object id: " + ((NetworkObjectReference)(ref grabbedObject)).NetworkObjectId + "."); } } grabbingReservedItemInfoDict[__instance] = null; return true; } [HarmonyPatch(typeof(GrabbableObject), "GrabItemOnClient")] [HarmonyPrefix] public static void OnReservedItemGrabbed(GrabbableObject __instance) { if (grabbingReservedItemInfoLocal != null && !((Object)(object)__instance != (Object)(object)GetCurrentlyGrabbingObject(localPlayerController))) { OnLocalPlayerGrabbedReservedItem(); __instance.PocketItem(); } } private static void OnLocalPlayerGrabbedReservedItem() { localPlayerController.currentlyHeldObjectServer = previouslyHeldObjectServer; previouslyHeldObjectServer = null; grabbingReservedItemInfoLocal = null; } [HarmonyPatch(typeof(PlayerControllerB), "FirstEmptyItemSlot")] [HarmonyPostfix] public static void GetReservedItemSlotPlacementIndex(ref int __result, PlayerControllerB __instance) { ReservedItemInfo reservedItemInfo = grabbingReservedItemInfoDict[__instance]; if (reservedItemInfo != null) { if (__result == reservedItemInfo.indexInInventory && IsItemSlotEmpty(reservedItemInfo, __instance)) { return; } grabbingReservedItemInfoDict[__instance] = null; } if (__result < reservedItemsStartIndex || __result >= reservedItemsStartIndex + reservedHotbarSize) { return; } __result = -1; for (int i = 0; i < __instance.ItemSlots.Length; i++) { if ((i < reservedItemsStartIndex || i >= reservedItemsStartIndex + reservedHotbarSize) && (Object)(object)__instance.ItemSlots[i] == (Object)null) { __result = i; break; } } } [HarmonyPatch(typeof(PlayerControllerB), "NextItemSlot")] [HarmonyPrefix] public static bool PreventScrollingOtherHotbar(ref int __result, bool forward, PlayerControllerB __instance) { if (reservedHotbarSize <= 0) { return true; } __result = __instance.currentItemSlot; bool flag = __result >= reservedItemsStartIndex && __result < reservedItemsStartIndex + reservedHotbarSize; int num = (forward ? 1 : (-1)); if (!flag) { __result += num; if (__result < 0) { __result = __instance.ItemSlots.Length - 1; if (__result >= reservedItemsStartIndex && __result < reservedItemsStartIndex + reservedHotbarSize) { __result = reservedItemsStartIndex - 1; } } else if (__result >= reservedItemsStartIndex && __result < reservedItemsStartIndex + reservedHotbarSize) { __result = (forward ? (reservedItemsStartIndex + reservedHotbarSize) : (reservedItemsStartIndex - 1)); } if (__result >= __instance.ItemSlots.Length) { __result = 0; } } else { __result = Mathf.Clamp(__result, reservedItemsStartIndex, reservedItemsStartIndex + reservedHotbarSize - 1) + num; if (__result < reservedItemsStartIndex) { __result = reservedItemsStartIndex + reservedHotbarSize - 1; } else if (__result >= reservedItemsStartIndex + reservedHotbarSize) { __result = reservedItemsStartIndex; } } return false; } [HarmonyPatch(typeof(PlayerControllerB), "LateUpdate")] [HarmonyPrefix] public static void RefocusReservedHotbarAfterAnimation(PlayerControllerB __instance) { if (!((Object)(object)__instance != (Object)(object)localPlayerController) && Keybinds.holdingModifierKey != isReservedHotbarFocused && CanSwapToReservedHotbarSlot()) { SetFocusReservedHotbarSlots(Keybinds.holdingModifierKey); } } public static bool CanSwapToReservedHotbarSlot() { bool flag = (bool)Traverse.Create((object)localPlayerController).Field("throwingObject").GetValue(); return !(localPlayerController.inTerminalMenu || localPlayerController.isPlayerDead || localPlayerController.isGrabbingObjectAnimation || localPlayerController.inSpecialInteractAnimation || flag) && !localPlayerController.isTypingChat && !localPlayerController.twoHanded && !localPlayerController.activatingItem; } [HarmonyPatch(typeof(PlayerControllerB), "UpdateSpecialAnimationValue")] [HarmonyPostfix] public static void OnSpecialAnimationUpdate(bool specialAnimation, PlayerControllerB __instance) { if (!((Object)(object)__instance != (Object)(object)localPlayerController) && !specialAnimation && isReservedHotbarFocused != Keybinds.holdingModifierKey) { SetFocusReservedHotbarSlots(Keybinds.holdingModifierKey); } } public static void SetFocusReservedHotbarSlots(bool active) { if (reservedHotbarSize <= 0 || isReservedHotbarFocused == active) { return; } Plugin.Log("SettingFocusReservedHotbar to: " + active); isReservedHotbarFocused = active; int num = localPlayerController.currentItemSlot; if (isReservedHotbarFocused && (num < reservedItemsStartIndex || num >= reservedItemsStartIndex + reservedHotbarSize)) { if (indexFocusedReservedHotbar == -1) { indexFocusedReservedHotbar = reservedItemsStartIndex; } indexUnfocusedReservedHotbar = num; num = Mathf.Clamp(indexFocusedReservedHotbar, reservedItemsStartIndex, reservedItemsStartIndex + reservedHotbarSize - 1); if ((Object)(object)localPlayerController.ItemSlots[num] == (Object)null) { for (int i = 0; i < reservedHotbarSize; i++) { int num2 = reservedItemsStartIndex + i; if ((Object)(object)localPlayerController.ItemSlots[num2] != (Object)null) { num = num2; break; } } } } else if (!isReservedHotbarFocused && num >= reservedItemsStartIndex && num < reservedItemsStartIndex + reservedHotbarSize) { indexFocusedReservedHotbar = num; if (indexUnfocusedReservedHotbar >= reservedItemsStartIndex && indexUnfocusedReservedHotbar < reservedItemsStartIndex + reservedHotbarSize) { indexUnfocusedReservedHotbar = 0; } num = indexUnfocusedReservedHotbar; } HotbarSlotSync.SwapHotbarSlot(num); } public static bool IsItemSlotEmpty(string itemName, PlayerControllerB player = null) { return IsItemSlotEmpty(Plugin.GetReservedItemInfo(itemName), player); } internal static bool IsItemSlotEmpty(ReservedItemInfo itemInfo, PlayerControllerB player = null) { if ((Object)(object)player == (Object)null) { player = localPlayerController; } if ((Object)(object)player == (Object)null) { return false; } return itemInfo != null && itemInfo.indexInInventory < player.ItemSlots.Length && (Object)(object)player.ItemSlots[itemInfo.indexInInventory] == (Object)null; } public static GrabbableObject GetHeldReservedObject(string itemName, PlayerControllerB player = null) { if ((Object)(object)player == (Object)null) { player = localPlayerController; } if ((Object)(object)player == (Object)null) { return null; } int reservedItemHotbarIndex = Plugin.GetReservedItemHotbarIndex(itemName); return (reservedItemHotbarIndex >= 0 && reservedItemHotbarIndex < player.ItemSlots.Length && (Object)(object)player.ItemSlots[reservedItemHotbarIndex] != (Object)null) ? player.ItemSlots[reservedItemHotbarIndex] : null; } [HarmonyPatch(typeof(GrabbableObject), "Start")] [HarmonyPostfix] public static void InitializeReservedItemProperties(GrabbableObject __instance) { ReservedItemInfo reservedItemInfo = Plugin.GetReservedItemInfo(__instance.itemProperties.itemName); if (reservedItemInfo != null) { if (reservedItemInfo.forceUpdateCanBeGrabbedBeforeGameStart) { __instance.itemProperties.canBeGrabbedBeforeGameStart = reservedItemInfo.canBeGrabbedBeforeGameStart; } if (reservedItemInfo.forceUpdateRequiresBattery) { __instance.itemProperties.requiresBattery = reservedItemInfo.requiresBattery; } } } } [HarmonyPatch] public static class PlayerPatcher { public static PlayerControllerB localPlayerController; public static int vanillaHotbarSize = -1; public static int reservedItemsStartIndex = 4; public static int oldHotbarSize = -1; public static int INTERACTABLE_OBJECT_MASK { get; private set; } public static int reservedHotbarSize => Plugin.numReservedItemSlots; public static int combinedHotbarSize => reservedItemsStartIndex + reservedHotbarSize; [HarmonyPatch(typeof(MenuManager), "OnEnable")] [HarmonyPrefix] public static void ResetVariables(MenuManager __instance) { localPlayerController = null; vanillaHotbarSize = -1; ReservedItemPatcher.isReservedHotbarFocused = false; ReservedItemPatcher.indexUnfocusedReservedHotbar = 0; ReservedItemPatcher.indexFocusedReservedHotbar = -1; Keybinds.localPlayerController = null; Keybinds.focusReservedHotbarAction = null; Keybinds.holdingModifierKey = false; HotbarSlotSync.localPlayerController = null; } [HarmonyPatch(typeof(PlayerControllerB), "Awake")] [HarmonyPostfix] public static void InitializePlayerController(PlayerControllerB __instance) { if (vanillaHotbarSize == -1) { vanillaHotbarSize = __instance.ItemSlots.Length; } } [HarmonyPatch(typeof(PlayerControllerB), "Start")] [HarmonyPostfix] public static void InitializePlayerControllerLate(PlayerControllerB __instance) { } [HarmonyPatch(typeof(PlayerControllerB), "Update")] [HarmonyPostfix] public static void CheckForIncreasedInventorySize(PlayerControllerB __instance) { if ((Object)(object)__instance != (Object)(object)localPlayerController || reservedHotbarSize == 0 || oldHotbarSize == __instance.ItemSlots.Length) { return; } for (int i = 0; i < HUDManager.Instance.itemSlotIconFrames.Length; i++) { if (((Object)HUDManager.Instance.itemSlotIconFrames[i]).name.ToLower().StartsWith("reserveditemslot")) { reservedItemsStartIndex = i; oldHotbarSize = __instance.ItemSlots.Length; HUDPatcher.UpdateHUD(); break; } } } [HarmonyPatch(typeof(PlayerControllerB), "ConnectClientToPlayerObject")] [HarmonyPostfix] public static void OnLocalPlayerConnect(PlayerControllerB __instance) { localPlayerController = __instance; INTERACTABLE_OBJECT_MASK = (int)Traverse.Create((object)__instance).Field("interactableObjectsMask").GetValue(); ((MonoBehaviour)__instance).StartCoroutine(UpdateHotbarSlotsAfterSpawnAnimation()); } private static IEnumerator UpdateHotbarSlotsAfterSpawnAnimation() { yield return (object)new WaitForSeconds(3f); reservedItemsStartIndex = localPlayerController.ItemSlots.Length; PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; foreach (PlayerControllerB playerController in allPlayerScripts) { playerController.ItemSlots = (GrabbableObject[])(object)new GrabbableObject[playerController.ItemSlots.Length + reservedHotbarSize]; } HUDPatcher.AddNewHotbarSlotsHud(); } } }
BepInEx/plugins/HomelessGinger-MaskedEnemyOverhaul/MaskedEnemyRework.dll
Decompiled 11 months agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using GameNetcodeStuff; using HarmonyLib; using MaskedEnemyRework.Patches; using Microsoft.CodeAnalysis; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETFramework,Version=v4.8.1", FrameworkDisplayName = ".NET Framework 4.8.1")] [assembly: AssemblyCompany("MaskedEnemyRework")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyDescription("My first plugin")] [assembly: AssemblyFileVersion("2.1.0.0")] [assembly: AssemblyInformationalVersion("2.1.0")] [assembly: AssemblyProduct("MaskedEnemyRework")] [assembly: AssemblyTitle("MaskedEnemyRework")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("2.1.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [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 MaskedEnemyRework { [BepInPlugin("MaskedEnemyRework", "MaskedEnemyRework", "2.1.0")] public class Plugin : BaseUnityPlugin { private readonly Harmony harmony = new Harmony("MaskedEnemyRework"); private static Plugin Instance; internal ManualLogSource logger; private ConfigEntry<bool> RemoveMasksConfig; private ConfigEntry<bool> RemoveZombieArmsConfig; private ConfigEntry<bool> UseSpawnRarityConfig; private ConfigEntry<int> SpawnRarityConfig; private ConfigEntry<bool> CanSpawnOutsideConfig; private ConfigEntry<int> MaxSpawnCountConfig; private ConfigEntry<bool> ZombieApocalypeModeConfig; private ConfigEntry<bool> UseVanillaSpawnsConfig; private ConfigEntry<int> ZombieApocalypeRandomChanceConfig; private ConfigEntry<float> InsideEnemySpawnCurveConfig; private ConfigEntry<float> MiddayInsideEnemySpawnCurveConfig; private ConfigEntry<float> StartOutsideEnemySpawnCurveConfig; private ConfigEntry<float> MidOutsideEnemySpawnCurveConfig; private ConfigEntry<float> EndOutsideEnemySpawnCurveConfig; public static bool RemoveMasks; public static bool RemoveZombieArms; public static bool UseSpawnRarity; public static int SpawnRarity; public static bool CanSpawnOutside; public static int MaxSpawnCount; public static bool ZombieApocalypseMode; public static bool UseVanillaSpawns; public static int RandomChanceZombieApocalypse; public static float InsideEnemySpawnCurve; public static float MiddayInsideEnemySpawnCurve; public static float StartOutsideEnemySpawnCurve; public static float MidOutsideEnemySpawnCurve; public static float EndOutsideEnemySpawnCurve; public static int PlayerCount; public static SpawnableEnemyWithRarity maskedPrefab; public static SpawnableEnemyWithRarity flowerPrefab; private void Awake() { if ((Object)(object)Instance == (Object)null) { Instance = this; } RemoveMasksConfig = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Remove Mask From Masked Enemy", true, "Whether or not the Masked Enemy has a mask on."); RemoveZombieArmsConfig = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Remove Zombie Arms", true, "Remove the animation where the Masked raise arms like a zombie."); UseVanillaSpawnsConfig = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Use Vanilla Spawns", false, "Ignores anything else in this mod. Only uses the above settings from this config. Will not spawn on all moons. will ignore EVERYTHING in the config below this point."); UseSpawnRarityConfig = ((BaseUnityPlugin)this).Config.Bind<bool>("Spawns", "Use Spawn Rarity", false, "Use custom spawn rate from config. If this is false, the masked spawns at the same rate as the Bracken. If true, will spawn at whatever rarity is given in Spawn Rarity config option"); SpawnRarityConfig = ((BaseUnityPlugin)this).Config.Bind<int>("Spawns", "Spawn Rarity", 15, "The rarity for the Masked Enemy to spawn. The higher the number, the more likely to spawn. Can go to 1000000000, any higher will break. Use Spawn Rarity must be set to True"); CanSpawnOutsideConfig = ((BaseUnityPlugin)this).Config.Bind<bool>("Spawns", "Allow Masked To Spawn Outside", false, "Whether the Masked Enemy can spawn outside the building"); MaxSpawnCountConfig = ((BaseUnityPlugin)this).Config.Bind<int>("Spawns", "Max Number of Masked", 2, "Max Number of possible masked to spawn in one level"); ZombieApocalypeModeConfig = ((BaseUnityPlugin)this).Config.Bind<bool>("Zombie Apocalypse Mode", "Zombie Apocalype Mode", false, "Only spawns Masked! Make sure to crank up the Max Spawn Count in this config! Would also recommend bringing a gun (mod), a shovel works fine too though.... This mode does not play nice with other mods that affect spawn rates. Disable those before playing for best results"); ZombieApocalypeRandomChanceConfig = ((BaseUnityPlugin)this).Config.Bind<int>("Zombie Apocalypse Mode", "Random Zombie Apocalype Mode", -1, "[Must Be Whole Number] The percent chance from 1 to 100 that a day could contain a zombie apocalypse. Put at -1 to never have the chance arise and don't have Only Spawn Masked turned on"); InsideEnemySpawnCurveConfig = ((BaseUnityPlugin)this).Config.Bind<float>("Zombie Apocalypse Mode", "StartOfDay Inside Masked Spawn Curve", 0.1f, "Spawn curve for masked inside, start of the day. Crank this way up for immediate action. More info in the readme"); MiddayInsideEnemySpawnCurveConfig = ((BaseUnityPlugin)this).Config.Bind<float>("Zombie Apocalypse Mode", "Midday Inside Masked Spawn Curve", 500f, "Spawn curve for masked inside, midday."); StartOutsideEnemySpawnCurveConfig = ((BaseUnityPlugin)this).Config.Bind<float>("Zombie Apocalypse Mode", "StartOfDay Masked Outside Spawn Curve", -30f, "Spawn curve for outside masked, start of the day."); MidOutsideEnemySpawnCurveConfig = ((BaseUnityPlugin)this).Config.Bind<float>("Zombie Apocalypse Mode", "Midday Outside Masked Spawn Curve", -30f, "Spawn curve for outside masked, midday."); EndOutsideEnemySpawnCurveConfig = ((BaseUnityPlugin)this).Config.Bind<float>("Zombie Apocalypse Mode", "EOD Outside Masked Spawn Curve", 10f, "Spawn curve for outside masked, end of day"); RemoveMasks = RemoveMasksConfig.Value; UseVanillaSpawns = UseVanillaSpawnsConfig.Value; RemoveZombieArms = RemoveZombieArmsConfig.Value; UseSpawnRarity = UseSpawnRarityConfig.Value; CanSpawnOutside = CanSpawnOutsideConfig.Value; MaxSpawnCount = MaxSpawnCountConfig.Value; SpawnRarity = SpawnRarityConfig.Value; ZombieApocalypseMode = ZombieApocalypeModeConfig.Value; InsideEnemySpawnCurve = InsideEnemySpawnCurveConfig.Value; MiddayInsideEnemySpawnCurve = MiddayInsideEnemySpawnCurveConfig.Value; StartOutsideEnemySpawnCurve = StartOutsideEnemySpawnCurveConfig.Value; MidOutsideEnemySpawnCurve = MaxSpawnCountConfig.Value; EndOutsideEnemySpawnCurve = EndOutsideEnemySpawnCurveConfig.Value; RandomChanceZombieApocalypse = ZombieApocalypeRandomChanceConfig.Value; logger = Logger.CreateLogSource("MaskedEnemyRework"); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin MaskedEnemyRework is loaded! Woohoo!"); harmony.PatchAll(typeof(Plugin)); harmony.PatchAll(typeof(GetMaskedPrefabForLaterUse)); harmony.PatchAll(typeof(MaskedVisualRework)); harmony.PatchAll(typeof(MaskedSpawnSettings)); harmony.PatchAll(typeof(RemoveZombieArms)); } } public static class PluginInfo { public const string PLUGIN_GUID = "MaskedEnemyRework"; public const string PLUGIN_NAME = "MaskedEnemyRework"; public const string PLUGIN_VERSION = "2.1.0"; } } namespace MaskedEnemyRework.Patches { [HarmonyPatch(typeof(Terminal))] internal class GetMaskedPrefabForLaterUse { [HarmonyPatch("Start")] [HarmonyPostfix] private static void SavesPrefabForLaterUse(ref SelectableLevel[] ___moonsCatalogueList) { ManualLogSource val = Logger.CreateLogSource("MaskedEnemyRework"); SelectableLevel[] array = ___moonsCatalogueList; foreach (SelectableLevel val2 in array) { foreach (SpawnableEnemyWithRarity enemy in val2.Enemies) { if (enemy.enemyType.enemyName == "Masked") { val.LogInfo((object)"Found Masked!"); Plugin.maskedPrefab = enemy; } else if (enemy.enemyType.enemyName == "Flowerman") { Plugin.flowerPrefab = enemy; val.LogInfo((object)"Found Flowerman!"); } } } } } [HarmonyPatch(typeof(RoundManager))] internal class MaskedSpawnSettings { [HarmonyPatch("BeginEnemySpawning")] [HarmonyPrefix] private static void UpdateSpawnRates(ref SelectableLevel ___currentLevel) { //IL_0234: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_0263: Expected O, but got Unknown //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_027c: Unknown result type (might be due to invalid IL or missing references) //IL_028d: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_029c: Unknown result type (might be due to invalid IL or missing references) //IL_02a6: Expected O, but got Unknown //IL_02ba: Unknown result type (might be due to invalid IL or missing references) //IL_02bf: Unknown result type (might be due to invalid IL or missing references) //IL_02d0: Unknown result type (might be due to invalid IL or missing references) //IL_02d5: Unknown result type (might be due to invalid IL or missing references) //IL_02e6: Unknown result type (might be due to invalid IL or missing references) //IL_02eb: Unknown result type (might be due to invalid IL or missing references) //IL_02f5: Unknown result type (might be due to invalid IL or missing references) //IL_02ff: Expected O, but got Unknown if (Plugin.UseVanillaSpawns) { return; } ManualLogSource val = Logger.CreateLogSource("MaskedEnemyRework"); val.LogInfo((object)"Starting Round Manager"); SpawnableEnemyWithRarity maskedPrefab = Plugin.maskedPrefab; SpawnableEnemyWithRarity val2 = Plugin.flowerPrefab; SelectableLevel obj = ___currentLevel; obj.maxEnemyPowerCount += maskedPrefab.enemyType.MaxCount; SelectableLevel obj2 = ___currentLevel; obj2.maxDaytimeEnemyPowerCount += maskedPrefab.enemyType.MaxCount; SelectableLevel obj3 = ___currentLevel; obj3.maxOutsideEnemyPowerCount += maskedPrefab.enemyType.MaxCount; List<SpawnableEnemyWithRarity> enemies = ___currentLevel.Enemies; for (int i = 0; i < ___currentLevel.Enemies.Count; i++) { SpawnableEnemyWithRarity val3 = ___currentLevel.Enemies[i]; if (val3.enemyType.enemyName == "Masked") { enemies.Remove(val3); } if (val3.enemyType.enemyName == "Flowerman") { val2 = val3; } } ___currentLevel.Enemies = enemies; maskedPrefab.enemyType.PowerLevel = 1; maskedPrefab.enemyType.probabilityCurve = val2.enemyType.probabilityCurve; if (Plugin.UseSpawnRarity) { maskedPrefab.rarity = Plugin.SpawnRarity; } else { maskedPrefab.rarity = val2.rarity; } maskedPrefab.enemyType.MaxCount = Plugin.MaxSpawnCount; maskedPrefab.enemyType.isOutsideEnemy = Plugin.CanSpawnOutside; int num = 0; num = ((StartOfRound.Instance.randomMapSeed.ToString().Length >= 3) ? int.Parse(StartOfRound.Instance.randomMapSeed.ToString().Substring(1, 2)) : 0); val.LogInfo((object)("Map seed " + num + " random chance " + Plugin.RandomChanceZombieApocalypse)); num = Mathf.Clamp(num, 0, 100); if (Plugin.ZombieApocalypseMode || (num <= Plugin.RandomChanceZombieApocalypse && Plugin.RandomChanceZombieApocalypse >= 0)) { val.LogInfo((object)"ZOMBIE APOCALYPSE"); ___currentLevel.enemySpawnChanceThroughoutDay = new AnimationCurve((Keyframe[])(object)new Keyframe[2] { new Keyframe(0f, Plugin.InsideEnemySpawnCurve), new Keyframe(0.5f, Plugin.MiddayInsideEnemySpawnCurve) }); ___currentLevel.daytimeEnemySpawnChanceThroughDay = new AnimationCurve((Keyframe[])(object)new Keyframe[2] { new Keyframe(0f, 7f), new Keyframe(0.5f, 7f) }); ___currentLevel.outsideEnemySpawnChanceThroughDay = new AnimationCurve((Keyframe[])(object)new Keyframe[3] { new Keyframe(0f, Plugin.StartOutsideEnemySpawnCurve), new Keyframe(20f, Plugin.MidOutsideEnemySpawnCurve), new Keyframe(21f, Plugin.EndOutsideEnemySpawnCurve) }); ___currentLevel.DaytimeEnemies.Clear(); ___currentLevel.OutsideEnemies.Clear(); maskedPrefab.rarity = 1000000000; foreach (SpawnableEnemyWithRarity enemy in ___currentLevel.Enemies) { enemy.rarity = 0; } if (Plugin.CanSpawnOutside) { maskedPrefab.enemyType.isOutsideEnemy = true; ___currentLevel.OutsideEnemies.Add(maskedPrefab); ___currentLevel.DaytimeEnemies.Add(maskedPrefab); } } else { val.LogInfo((object)"no zombies :("); } ___currentLevel.Enemies.Add(maskedPrefab); } } [HarmonyPatch(typeof(MaskedPlayerEnemy))] internal class MaskedVisualRework { [HarmonyPatch("Start")] [HarmonyPostfix] private static void ReformVisuals(ref MaskedPlayerEnemy __instance) { ManualLogSource val = Logger.CreateLogSource("MaskedEnemyRework"); PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; int num = StartOfRound.Instance.ClientPlayerList.Count; if (num == 0) { num = Random.Range(0, 2); val.LogInfo((object)"Player count was zero"); } int num2 = StartOfRound.Instance.randomMapSeed % num; val.LogInfo((object)("player count" + num)); val.LogInfo((object)("player index" + num2)); num2 = Mathf.Clamp(num2, 0, num); PlayerControllerB val2 = allPlayerScripts[num2]; __instance.mimickingPlayer = val2; __instance.SetSuit(val2.currentSuitID); if (Plugin.RemoveMasks) { ((Component)((Component)__instance).gameObject.transform.Find("ScavengerModel/metarig/spine/spine.001/spine.002/spine.003/spine.004/HeadMaskComedy")).gameObject.SetActive(false); ((Component)((Component)__instance).gameObject.transform.Find("ScavengerModel/metarig/spine/spine.001/spine.002/spine.003/spine.004/HeadMaskTragedy")).gameObject.SetActive(false); } } } internal class RemoveZombieArms { [HarmonyPatch(typeof(MaskedPlayerEnemy), "SetHandsOutClientRpc")] [HarmonyPrefix] private static void RemoveArms(ref bool setOut) { if (Plugin.RemoveZombieArms) { setOut = false; } } } }
BepInEx/plugins/IntegrityChaos-Diversity/Diversity.dll
Decompiled 11 months agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using Diversity.Items; using Diversity.Misc; using Diversity.Monsters; using Diversity.Patches; using Diversity.Player; using GameNetcodeStuff; using HarmonyLib; using Microsoft.CodeAnalysis; using TMPro; using Unity.Netcode; using UnityEngine; using UnityEngine.Rendering; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("Diversity")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Diversity")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("6163c54c-2d5b-4683-ac86-9337d16cc4fd")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] 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; } } } public enum Condition { BrokenLeg, BrokenArm, FracturedLeg, FracturedArm, Bleeding, Blindness, Concussed } public enum DamageType { GunShotted, Mauled, Electrified, Falling, Bitten, Concussed, Burned, Gas } namespace Diversity { public class Configuration { public static ConfigEntry<bool> spiderRevamp; public static ConfigEntry<float> spiderSlowAmount; public static ConfigEntry<bool> crawlerRevamp; public static ConfigEntry<float> crawlerSlowAmount; public static ConfigEntry<bool> centipedeRevamp; public static ConfigEntry<int> clickAmount; public static ConfigEntry<int> hurtChance; public static ConfigEntry<bool> brakenRevamp; public static ConfigEntry<float> brakenRange; public static ConfigEntry<bool> brakenAnger; public static ConfigEntry<int> flickerChance; public static ConfigEntry<int> breakerChance; public static ConfigEntry<bool> apparatusAnger; public static ConfigEntry<bool> chaseTriggerer; public static ConfigEntry<bool> dressGirlRevamp; public static ConfigEntry<float> walkieTalkieFrequency; public static ConfigEntry<bool> playerConditions; public static ConfigEntry<bool> fullDarkness; public static ConfigEntry<float> fullDarknessIntensity; public static ConfigEntry<float> interactRange; public static void Load() { spiderRevamp = Diversity.config.Bind<bool>("Spider", "SpiderRevamp", true, "Should spider revamp be enabled?"); spiderSlowAmount = Diversity.config.Bind<float>("Spider", "SpiderSlow", 0.8f, "How much slown should spiders be on hit?"); crawlerRevamp = Diversity.config.Bind<bool>("Crawler", "CrawlerRevamp", true, "Should crawler revamp be enabled?"); crawlerSlowAmount = Diversity.config.Bind<float>("Crawler", "CrawlerSlow", 0.9f, "How much slown should crawlers be on hit?"); centipedeRevamp = Diversity.config.Bind<bool>("Centipede", "CentipedeRevamp", true, "Should centipede revamp be enabled?"); clickAmount = Diversity.config.Bind<int>("Centipede", "ClickAmount", 30, "How many times should you have to click to remove the centipede from someone's head?"); hurtChance = Diversity.config.Bind<int>("Centipede", "HurtChance", 10, "Chance of hurting the player when trying to free the centipede."); brakenRevamp = Diversity.config.Bind<bool>("Bracken", "BrakenRevamp", true, "Should Bracken revamp be enabled?"); brakenRange = Diversity.config.Bind<float>("Bracken", "BrakenRange", 15f, "From how far should the Bracken be able to turn off lights?"); brakenAnger = Diversity.config.Bind<bool>("Bracken", "BrakenAnger", true, "Should Bracken get anggered from the breaker box?"); flickerChance = Diversity.config.Bind<int>("Bracken", "FlickerChance", 100, "Chance on flickering and turning off lights."); breakerChance = Diversity.config.Bind<int>("Bracken", "BreakerChance", 75, "Chance for the Bracken to turn off the breaker box."); apparatusAnger = Diversity.config.Bind<bool>("Bracken", "ApparatusAnger", true, "Should taking the Apparatus anger the Bracken?"); chaseTriggerer = Diversity.config.Bind<bool>("Bracken", "ChaseTriggerer", true, "Should the Bracken chase the one who angered him?"); dressGirlRevamp = Diversity.config.Bind<bool>("Dress Girl", "DressGirlRevamp", true, "Should Dress girl revamp be enabled?"); walkieTalkieFrequency = Diversity.config.Bind<float>("Dress Girl", "WalkieTalkieFrequency", 1f, "How frequent should the Dress girl haunt the walkie-talkie?"); playerConditions = Diversity.config.Bind<bool>("Player", "PlayerConditions", true, "Should players be able to gain conditions?"); fullDarkness = Diversity.config.Bind<bool>("Player", "FullDarkness", true, "Should players with no light source be completely in the dark?"); fullDarknessIntensity = Diversity.config.Bind<float>("Player", "FullDarknessIntensity", 1f, "How intense should full darkness be?"); interactRange = Diversity.config.Bind<float>("Player", "InteractRange", 3f, "How far can players remove centipede from their head?"); } } public class Content { public static AssetBundle MainAssets; public static void TryLoadAssets() { if ((Object)(object)MainAssets == (Object)null) { MainAssets = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "diversity")); Diversity.mls.LogInfo((object)"Loaded asset bundle!"); } } } [BepInPlugin("Chaos.Diversity", "Diversity", "1.0.8")] public class Diversity : BaseUnityPlugin { private const string modGUID = "Chaos.Diversity"; private const string modName = "Diversity"; private const string modVersion = "1.0.8"; private readonly Harmony harmony = new Harmony("Chaos.Diversity"); public static Diversity Instance; public static ManualLogSource mls; public static ConfigFile config; private void Awake() { if ((Object)(object)Instance == (Object)null) { Instance = this; } mls = ((BaseUnityPlugin)this).Logger; config = ((BaseUnityPlugin)this).Config; Configuration.Load(); Content.TryLoadAssets(); harmony.PatchAll(typeof(BaboonBirdAIPatch)); harmony.PatchAll(typeof(BlobAIPatch)); harmony.PatchAll(typeof(BreakerBoxPatch)); harmony.PatchAll(typeof(CentipedeAIPatch)); harmony.PatchAll(typeof(CrawlerAIPatch)); harmony.PatchAll(typeof(DressGirlAIPatch)); harmony.PatchAll(typeof(FlashlightPatch)); harmony.PatchAll(typeof(FlowermanAIPatch)); harmony.PatchAll(typeof(HoarderBugAIPatch)); harmony.PatchAll(typeof(HUDPatch)); harmony.PatchAll(typeof(LungPropPatch)); harmony.PatchAll(typeof(PlayerControllerBPatch)); harmony.PatchAll(typeof(PufferAIPatch)); harmony.PatchAll(typeof(RadarBoosterItemPatch)); harmony.PatchAll(typeof(RedLocustBeesPatch)); harmony.PatchAll(typeof(RoundManagerPatch)); harmony.PatchAll(typeof(SandSpiderAIPatch)); harmony.PatchAll(typeof(SpringManAIPatch)); harmony.PatchAll(typeof(StartOfRoundPatch)); harmony.PatchAll(typeof(SteamValveHazardPatch)); harmony.PatchAll(typeof(Diversity)); mls.LogInfo((object)"Diversity started."); } } public class DiversityBehaviour : MonoBehaviour { public int anger = 3; private void Start() { anger = Random.Range(1, 4); } } } namespace Diversity.Player { public class PlayerRevamp : MonoBehaviour { public List<Condition> conditions = new List<Condition>(); public bool isHaunted; public Light lastLight; public int lastID = 0; private static float timeElapsed; private bool unfinished = false; public void ApplyConditions(DamageType damageType, float modifier) { Diversity.mls.LogInfo((object)("Player took damage type: " + damageType)); if (damageType == DamageType.Falling) { float value = Random.value; if (value <= 0.1f * modifier) { bool flag = false; foreach (Condition condition in conditions) { if (condition == Condition.FracturedLeg) { flag = true; } } if (!flag) { conditions.Add(Condition.FracturedLeg); Diversity.mls.LogInfo((object)("Player just received condition:" + Condition.FracturedLeg)); } else { bool flag2 = false; foreach (Condition condition2 in conditions) { if (condition2 == Condition.BrokenLeg) { flag2 = true; } } if (!flag2) { conditions.Remove(Condition.FracturedLeg); Diversity.mls.LogInfo((object)("Player just lost condition:" + Condition.FracturedLeg)); conditions.Add(Condition.BrokenLeg); Diversity.mls.LogInfo((object)("Player just received condition:" + Condition.BrokenLeg)); } } } } else if (damageType == DamageType.GunShotted || damageType == DamageType.Mauled || damageType == DamageType.Bitten) { float value2 = Random.value; if (value2 <= 0.15f * modifier || damageType == DamageType.GunShotted) { bool flag3 = false; foreach (Condition condition3 in conditions) { if (condition3 == Condition.Bleeding) { flag3 = true; } } if (!flag3) { conditions.Add(Condition.Bleeding); Diversity.mls.LogInfo((object)("Player just received condition:" + Condition.Bleeding)); } } } if (damageType == DamageType.Mauled) { float value3 = Random.value; if (value3 <= 0.15f * modifier) { bool flag4 = false; foreach (Condition condition4 in conditions) { if (condition4 == Condition.FracturedArm) { flag4 = true; } } if (!flag4) { conditions.Add(Condition.FracturedArm); Diversity.mls.LogInfo((object)("Player just received condition:" + Condition.FracturedArm)); } if (flag4 && value3 <= 0.05f) { bool flag5 = false; foreach (Condition condition5 in conditions) { if (condition5 == Condition.BrokenArm) { flag5 = true; } } if (!flag5) { conditions.Remove(Condition.FracturedArm); Diversity.mls.LogInfo((object)("Player just lost condition:" + Condition.FracturedArm)); conditions.Add(Condition.BrokenArm); Diversity.mls.LogInfo((object)("Player just received condition:" + Condition.BrokenArm)); } } } } if (damageType == DamageType.Gas) { float value4 = Random.value; if (value4 <= 0.15f * modifier) { bool flag6 = false; foreach (Condition condition6 in conditions) { if (condition6 == Condition.Blindness) { flag6 = true; } } if (!flag6) { conditions.Add(Condition.Blindness); Diversity.mls.LogInfo((object)("Player just received condition:" + Condition.Blindness)); } } } if (damageType != DamageType.Concussed) { return; } float value5 = Random.value; if (!(value5 <= 0.35f * modifier)) { return; } bool flag7 = false; foreach (Condition condition7 in conditions) { if (condition7 == Condition.Concussed) { flag7 = true; } } if (!flag7) { conditions.Add(Condition.Concussed); Diversity.mls.LogInfo((object)("Player just received condition:" + Condition.Concussed)); } } public void CheckConditions(PlayerControllerB player) { //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Unknown result type (might be due to invalid IL or missing references) if (!Configuration.playerConditions.Value || !player.AllowPlayerDeath()) { return; } using List<Condition>.Enumerator enumerator = conditions.GetEnumerator(); while (enumerator.MoveNext()) { switch (enumerator.Current) { case Condition.FracturedLeg: if (((NetworkBehaviour)player).IsOwner) { player.jumpForce = 10f; } break; case Condition.BrokenLeg: if (((NetworkBehaviour)player).IsOwner) { player.playerBodyAnimator.SetBool("Limp", true); player.jumpForce = 9f; } break; case Condition.FracturedArm: if ((Object)(object)player.currentlyHeldObject != (Object)null) { GrabbableObject currentlyHeldObject2 = player.currentlyHeldObject; if (((NetworkBehaviour)player).IsOwner) { Item itemProperties3 = currentlyHeldObject2.itemProperties; if (itemProperties3.weight > 25f) { player.DiscardHeldObject(false, (NetworkObject)null, default(Vector3), true); } } } else { if (!((Object)(object)player.currentlyHeldObjectServer != (Object)null)) { break; } GrabbableObject currentlyHeldObjectServer2 = player.currentlyHeldObjectServer; if (((NetworkBehaviour)player).IsOwner) { Item itemProperties4 = currentlyHeldObjectServer2.itemProperties; if (itemProperties4.weight > 25f) { player.DiscardHeldObject(false, (NetworkObject)null, default(Vector3), true); } } } break; case Condition.BrokenArm: if ((Object)(object)player.currentlyHeldObject != (Object)null) { GrabbableObject currentlyHeldObject = player.currentlyHeldObject; if (((NetworkBehaviour)player).IsOwner) { Item itemProperties = currentlyHeldObject.itemProperties; if (itemProperties.weight > 15f) { player.DiscardHeldObject(false, (NetworkObject)null, default(Vector3), true); } } } else { if (!((Object)(object)player.currentlyHeldObjectServer != (Object)null)) { break; } GrabbableObject currentlyHeldObjectServer = player.currentlyHeldObjectServer; if (((NetworkBehaviour)player).IsOwner) { Item itemProperties2 = currentlyHeldObjectServer.itemProperties; if (itemProperties2.weight > 15f) { player.DiscardHeldObject(false, (NetworkObject)null, default(Vector3), true); } } } break; case Condition.Bleeding: if (((NetworkBehaviour)player).IsOwner) { player.healthRegenerateTimer = 1f; player.bleedingHeavily = true; } break; case Condition.Blindness: { if (!((NetworkBehaviour)player).IsOwner) { break; } PlayerControllerB localPlayerController2 = StartOfRound.Instance.localPlayerController; if (Object.op_Implicit((Object)(object)localPlayerController2) && (localPlayerController2.playerSteamId == player.playerSteamId || localPlayerController2.actualClientId == player.actualClientId)) { HUDManagerRevamp component2 = ((Component)HUDManager.Instance).gameObject.GetComponent<HUDManagerRevamp>(); if (!Object.op_Implicit((Object)(object)component2)) { return; } component2.blindnessIntensity = 1f; } break; } case Condition.Concussed: { if (!((NetworkBehaviour)player).IsOwner) { break; } PlayerControllerB localPlayerController = StartOfRound.Instance.localPlayerController; if (Object.op_Implicit((Object)(object)localPlayerController) && (localPlayerController.playerSteamId == player.playerSteamId || localPlayerController.actualClientId == player.actualClientId)) { HUDManagerRevamp component = ((Component)HUDManager.Instance).gameObject.GetComponent<HUDManagerRevamp>(); if (!Object.op_Implicit((Object)(object)component)) { return; } component.concussedIntensity = 1f; } break; } } } } private void Update() { if (Object.op_Implicit((Object)(object)lastLight)) { if (!isHaunted) { if (!unfinished) { if (timeElapsed != 1f) { timeElapsed = 1f - timeElapsed; } else { timeElapsed = 0f; } unfinished = true; } if (lastID == 0) { lastLight.intensity = Mathf.Lerp(100f, 486.8536f, timeElapsed / 1f); } else if (lastID == 1) { lastLight.intensity = Mathf.Lerp(50f, 397.9603f, timeElapsed / 1f); } timeElapsed += Time.deltaTime; } if (isHaunted) { if (unfinished) { if (timeElapsed != 1f) { timeElapsed = 1f - timeElapsed; } else { timeElapsed = 0f; } unfinished = false; } if (lastID == 0) { lastLight.intensity = Mathf.Lerp(486.8536f, 100f, timeElapsed / 1f); } else if (lastID == 1) { lastLight.intensity = Mathf.Lerp(397.9603f, 50f, timeElapsed / 1f); } timeElapsed += Time.deltaTime; } if (timeElapsed >= 1f) { timeElapsed = 1f; } } PlayerControllerB component = ((Component)this).gameObject.GetComponent<PlayerControllerB>(); GrabbableObject[] itemSlots = component.ItemSlots; foreach (GrabbableObject val in itemSlots) { if ((Object)(object)val != (Object)null) { FlashlightRevamp component2 = ((Component)val).gameObject.GetComponent<FlashlightRevamp>(); if (Object.op_Implicit((Object)(object)component2)) { component2.haunted = isHaunted; } } } } } } namespace Diversity.Patches { [HarmonyPatch(typeof(BaboonBirdAI))] internal class BaboonBirdAIPatch { [HarmonyPatch(typeof(BaboonBirdAI), "OnCollideWithPlayer")] [HarmonyPrefix] private static void OnCollideWithPlayer(BaboonBirdAI __instance, Collider other) { if (__instance.timeSinceHitting < 0.5f) { return; } PlayerControllerB val = ((EnemyAI)__instance).MeetsStandardPlayerCollisionConditions(other, ((EnemyAI)__instance).inSpecialAnimation || __instance.doingKillAnimation, false); if ((Object)(object)val != (Object)null) { PlayerRevamp component = ((Component)val).gameObject.GetComponent<PlayerRevamp>(); if (Object.op_Implicit((Object)(object)component)) { component.ApplyConditions(DamageType.Bitten, 1f + (1f - (float)(val.health / 100))); } } } } [HarmonyPatch(typeof(BlobAI))] internal class BlobAIPatch { [HarmonyPatch(typeof(BlobAI), "OnCollideWithPlayer")] [HarmonyPrefix] private static void OnCollideWithPlayer(BlobAI __instance, Collider other) { if (__instance.timeSinceHittingLocalPlayer < 0.25f || (__instance.tamedTimer > 0f && __instance.angeredTimer < 0f)) { return; } PlayerControllerB val = ((EnemyAI)__instance).MeetsStandardPlayerCollisionConditions(other, false, false); if ((Object)(object)val != (Object)null) { PlayerRevamp component = ((Component)val).gameObject.GetComponent<PlayerRevamp>(); if (Object.op_Implicit((Object)(object)component)) { component.ApplyConditions(DamageType.Burned, 1f + (1f - (float)(val.health / 100))); } } } } [HarmonyPatch(typeof(BreakerBox))] internal class BreakerBoxPatch : MonoBehaviour { [HarmonyPatch(typeof(BreakerBox), "SwitchBreaker")] [HarmonyPostfix] public static void SwitchBreaker(BreakerBox __instance) { //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) int num = 3; DiversityBehaviour component = ((Component)__instance.roundManager).gameObject.GetComponent<DiversityBehaviour>(); if (Object.op_Implicit((Object)(object)component)) { num = component.anger; } Diversity.mls.LogInfo((object)("angerMax: " + num)); if (!Configuration.brakenAnger.Value || !__instance.isPowerOn) { return; } FlowermanAI[] array = (FlowermanAI[])(object)Object.FindObjectsOfType(typeof(FlowermanAI)); if (!Configuration.brakenRevamp.Value) { return; } FlowermanAI[] array2 = array; foreach (FlowermanAI val in array2) { BrakenRevamp component2 = ((Component)val).gameObject.GetComponent<BrakenRevamp>(); if (!Object.op_Implicit((Object)(object)component2)) { break; } if (component2.angerLevel < num) { component2.angerLevel++; } PlayerControllerB[] allPlayerScripts = __instance.roundManager.playersManager.allPlayerScripts; float num2 = 100f; PlayerControllerB val2 = null; PlayerControllerB[] array3 = allPlayerScripts; foreach (PlayerControllerB val3 in array3) { if ((Object)(object)val3 != (Object)null && Vector3.Distance(((Component)__instance).gameObject.transform.position, ((Component)val3).gameObject.transform.position) < num2) { num2 = Vector3.Distance(((Component)__instance).gameObject.transform.position, ((Component)val3).gameObject.transform.position); val2 = val3; } } if ((Object)(object)val2 != (Object)null) { Diversity.mls.LogInfo((object)("Closest player from breaker box is: " + ((Object)((Component)val2).gameObject).name)); } component2.CheckAnger(__instance.roundManager, val2); } } } [HarmonyPatch(typeof(CentipedeAI))] internal class CentipedeAIPatch { [HarmonyPatch(typeof(CentipedeAI), "Start")] [HarmonyPrefix] public static void Start(CentipedeAI __instance) { if (Configuration.centipedeRevamp.Value) { CentipedeRevamp component = ((Component)__instance).gameObject.GetComponent<CentipedeRevamp>(); if (!Object.op_Implicit((Object)(object)component)) { ((Component)__instance).gameObject.AddComponent<CentipedeRevamp>(); Diversity.mls.LogInfo((object)("Added CentipedeRevamp to: " + ((Object)((Component)__instance).gameObject).name)); } } } [HarmonyPatch(typeof(CentipedeAI), "DamagePlayerOnIntervals")] [HarmonyPrefix] private static void DamagePlayerOnIntervals(CentipedeAI __instance) { if (__instance.damagePlayerInterval <= 0f && !__instance.inDroppingOffPlayerAnim && !(((EnemyAI)__instance).stunNormalizedTimer > 0f) && (StartOfRound.Instance.connectedPlayersAmount > 0 || __instance.clingingToPlayer.health > 15 || __instance.singlePlayerSecondChanceGiven) && (Object)(object)__instance.clingingToPlayer != (Object)null) { PlayerRevamp component = ((Component)__instance.clingingToPlayer).gameObject.GetComponent<PlayerRevamp>(); if (Object.op_Implicit((Object)(object)component)) { component.ApplyConditions(DamageType.Mauled, 1f + (1f - (float)(__instance.clingingToPlayer.health / 100))); } } } } [HarmonyPatch(typeof(CrawlerAI))] internal class CrawlerAIPatch { private static CrawlerRevamp crawler; [HarmonyPatch(typeof(CrawlerAI), "HitEnemy")] [HarmonyPrefix] public static void Slow(CrawlerAI __instance) { if (Configuration.crawlerRevamp.Value) { crawler = ((Component)__instance).GetComponent<CrawlerRevamp>(); if (Object.op_Implicit((Object)(object)crawler) && !crawler.onCooldown) { crawler.hasBeenhit = true; crawler.onCooldown = true; crawler.previousAgentSpeed = ((EnemyAI)__instance).agent.speed; crawler.previousAgentAcceleration = ((EnemyAI)__instance).agent.acceleration; crawler.currentAgentSpeed = ((EnemyAI)__instance).agent.speed; crawler.currentAgentAcceleration = ((EnemyAI)__instance).agent.acceleration; Diversity.mls.LogInfo((object)"Crawler hit!"); } } } [HarmonyPatch(typeof(CrawlerAI), "Start")] [HarmonyPrefix] public static void Start(CrawlerAI __instance) { if (Configuration.crawlerRevamp.Value) { crawler = ((Component)__instance).gameObject.GetComponent<CrawlerRevamp>(); if (!Object.op_Implicit((Object)(object)crawler)) { ((Component)__instance).gameObject.AddComponent<CrawlerRevamp>(); Diversity.mls.LogInfo((object)("Added CrawlerRevamp to: " + ((Object)((Component)__instance).gameObject).name)); } } } [HarmonyPatch(typeof(CrawlerAI), "OnCollideWithPlayer")] [HarmonyPrefix] private static void OnCollideWithPlayer(CrawlerAI __instance, Collider other) { if (__instance.timeSinceHittingPlayer < 0.65f) { return; } PlayerControllerB val = ((EnemyAI)__instance).MeetsStandardPlayerCollisionConditions(other, false, false); if ((Object)(object)val != (Object)null) { PlayerRevamp component = ((Component)val).gameObject.GetComponent<PlayerRevamp>(); if (Object.op_Implicit((Object)(object)component)) { component.ApplyConditions(DamageType.Bitten, 1f + (1f - (float)(val.health / 100))); } } } } [HarmonyPatch(typeof(DressGirlAI))] internal class DressGirlAIPatch { [HarmonyPatch(typeof(DressGirlAI), "Start")] [HarmonyPrefix] private static void Start(DressGirlAI __instance) { if (Configuration.dressGirlRevamp.Value) { DressGirlRevamp component = ((Component)__instance).gameObject.GetComponent<DressGirlRevamp>(); if (!Object.op_Implicit((Object)(object)component)) { ((Component)__instance).gameObject.AddComponent<DressGirlRevamp>(); Diversity.mls.LogInfo((object)("Added DressGirlRevamp to: " + ((Object)((Component)__instance).gameObject).name)); } } } [HarmonyPatch(typeof(DressGirlAI), "Update")] [HarmonyPostfix] private static void Update(DressGirlAI __instance) { if (Configuration.dressGirlRevamp.Value) { DressGirlRevamp component = ((Component)__instance).gameObject.GetComponent<DressGirlRevamp>(); if (Object.op_Implicit((Object)(object)component)) { component.timeElapsed += Time.deltaTime; component.TryWalkieTalkie(__instance.hauntingPlayer); } } } } [HarmonyPatch(typeof(FlashlightItem))] public class FlashlightPatch : MonoBehaviour { private static bool wasHaunted; private static float timeElapsed; [HarmonyPatch(typeof(FlashlightItem), "Update")] [HarmonyPostfix] private static void Update(FlashlightItem __instance) { if (!Configuration.brakenRevamp.Value) { return; } FlashlightRevamp component = ((Component)__instance).gameObject.GetComponent<FlashlightRevamp>(); if (!Object.op_Implicit((Object)(object)component)) { return; } if (component.haunted) { if (!wasHaunted) { wasHaunted = true; } __instance.flashlightBulb.intensity = component.currentIntensity; timeElapsed = 0f; } else { timeElapsed += Time.deltaTime; if (timeElapsed >= 1f) { wasHaunted = false; } } } [HarmonyPatch(typeof(FlashlightItem), "Start")] [HarmonyPrefix] public static void Start(FlashlightItem __instance) { if (Configuration.brakenRevamp.Value) { FlashlightRevamp component = ((Component)__instance).gameObject.GetComponent<FlashlightRevamp>(); Rigidbody component2 = ((Component)__instance).gameObject.GetComponent<Rigidbody>(); if (!Object.op_Implicit((Object)(object)component)) { ((Component)__instance).gameObject.AddComponent<FlashlightRevamp>(); Diversity.mls.LogInfo((object)("Added FlashlightRevamp to: " + ((Object)((Component)__instance).gameObject).name)); } if (!Object.op_Implicit((Object)(object)component2)) { Rigidbody val = ((Component)__instance).gameObject.AddComponent<Rigidbody>(); val.isKinematic = true; Diversity.mls.LogInfo((object)("Added Rigidbody to: " + ((Object)((Component)__instance).gameObject).name)); } } } } [HarmonyPatch(typeof(FlowermanAI))] internal class FlowermanAIPatch { [HarmonyPatch(typeof(FlowermanAI), "Start")] [HarmonyPrefix] public static void Start(FlowermanAI __instance) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_0142: Unknown result type (might be due to invalid IL or missing references) if (Configuration.brakenRevamp.Value) { BrakenRevamp component = ((Component)__instance).gameObject.GetComponent<BrakenRevamp>(); SphereCollider component2 = ((Component)__instance).gameObject.GetComponent<SphereCollider>(); GameObject val = new GameObject("CreatureSpeech"); AudioSource val2 = val.AddComponent<AudioSource>(); val2.loop = false; ((Behaviour)val2).enabled = true; val2.playOnAwake = false; val2.volume = 1f; val2.spatialBlend = 0f; val2.clip = Content.MainAssets.LoadAsset<AudioClip>("Assets/custom/diversity/bracken/you're next.mp3"); val.transform.SetParent(((Component)__instance).gameObject.transform); Diversity.mls.LogInfo((object)("Added CreatureSpeech to: " + ((Object)((Component)__instance).gameObject).name)); if (!Object.op_Implicit((Object)(object)component)) { ((Component)__instance).gameObject.AddComponent<BrakenRevamp>(); Diversity.mls.LogInfo((object)("Added BrakenRevamp to: " + ((Object)((Component)__instance).gameObject).name)); } if (!Object.op_Implicit((Object)(object)component2)) { GameObject gameObject = ((Component)__instance).gameObject; SphereCollider val3 = gameObject.AddComponent<SphereCollider>(); val3.radius = Configuration.brakenRange.Value; val3.center = new Vector3(0f, 1.6f, 0f); ((Collider)val3).isTrigger = true; Diversity.mls.LogInfo((object)("Added SphereCollider to: " + ((Object)gameObject).name)); } } } [HarmonyPatch(typeof(FlowermanAI), "killAnimation")] [HarmonyPostfix] private static void killAnimation(FlowermanAI __instance) { if (!Configuration.brakenRevamp.Value || !((Object)(object)((EnemyAI)__instance).inSpecialAnimationWithPlayer != (Object)null)) { return; } GameObject gameObject = ((Component)((Component)__instance).gameObject.transform.Find("CreatureSpeech")).gameObject; if (Object.op_Implicit((Object)(object)gameObject)) { AudioSource component = gameObject.GetComponent<AudioSource>(); BrakenRevamp component2 = ((Component)__instance).gameObject.GetComponent<BrakenRevamp>(); if (Object.op_Implicit((Object)(object)component2)) { component2.TransmitWalkie(component.clip); } } } } [HarmonyPatch(typeof(HoarderBugAI))] internal class HoarderBugAIPatch { [HarmonyPatch(typeof(HoarderBugAI), "OnCollideWithPlayer")] [HarmonyPrefix] private static void OnCollideWithPlayer(HoarderBugAI __instance, Collider other) { if (!__instance.inChase || __instance.timeSinceHittingPlayer < 0.5f) { return; } PlayerControllerB val = ((EnemyAI)__instance).MeetsStandardPlayerCollisionConditions(other, false, false); if ((Object)(object)val != (Object)null) { PlayerRevamp component = ((Component)val).gameObject.GetComponent<PlayerRevamp>(); if (Object.op_Implicit((Object)(object)component)) { component.ApplyConditions(DamageType.Mauled, 1f + (1f - (float)(val.health / 100))); } } } } [HarmonyPatch(typeof(HUDManager))] public class HUDPatch { public static TextMeshProUGUI tipText; public static Image holderBar; public static Image clickBar; private static readonly string text = "Free from head : [E]"; private static readonly Color color = Color32.op_Implicit(new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue)); [HarmonyPatch("Start")] [HarmonyPostfix] private static void Start(ref HUDManager __instance) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Expected O, but got Unknown //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Expected O, but got Unknown //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("InteractText"); val.AddComponent<RectTransform>(); TextMeshProUGUI val2 = val.AddComponent<TextMeshProUGUI>(); RectTransform rectTransform = ((TMP_Text)val2).rectTransform; ((Transform)rectTransform).SetParent(((TMP_Text)__instance.signalTranslatorText).transform, false); Rect rect = rectTransform.rect; rectTransform.anchoredPosition = new Vector2((0f - ((Rect)(ref rect)).width) / 4f + 5f, -40f); GameObject val3 = new GameObject("InteractBarHolder"); val3.AddComponent<RectTransform>(); Image val4 = val3.AddComponent<Image>(); val4.sprite = Content.MainAssets.LoadAsset<Sprite>("Assets/custom/diversity/hud/holder.png"); RectTransform component = ((Component)val4).GetComponent<RectTransform>(); ((Transform)component).SetParent(((TMP_Text)__instance.signalTranslatorText).transform, false); component.sizeDelta = new Vector2(133.33333f, 20f); rect = rectTransform.rect; component.anchoredPosition = new Vector2((0f - ((Rect)(ref rect)).width) / 4f + 5f, -70f); ((Behaviour)val4).enabled = false; holderBar = val4; GameObject val5 = new GameObject("InteractBarHolder"); val5.AddComponent<RectTransform>(); Image val6 = val5.AddComponent<Image>(); val6.sprite = Content.MainAssets.LoadAsset<Sprite>("Assets/custom/diversity/hud/bar.png"); RectTransform component2 = ((Component)val6).GetComponent<RectTransform>(); ((Transform)component2).SetParent(((TMP_Text)__instance.signalTranslatorText).transform, false); component2.sizeDelta = new Vector2(133.33333f, 20f); rect = rectTransform.rect; component2.anchoredPosition = new Vector2((0f - ((Rect)(ref rect)).width) / 4f + 5f, -70f); ((Behaviour)val6).enabled = false; clickBar = val6; ((TMP_Text)val2).alignment = (TextAlignmentOptions)514; ((TMP_Text)val2).font = ((TMP_Text)__instance.controlTipLines[0]).font; ((TMP_Text)val2).fontSize = 16f; ((TMP_Text)val2).text = text; ((Graphic)val2).color = color; ((TMP_Text)val2).overflowMode = (TextOverflowModes)0; ((Behaviour)val2).enabled = false; tipText = val2; HUDManagerRevamp component3 = ((Component)__instance).gameObject.GetComponent<HUDManagerRevamp>(); if (!Object.op_Implicit((Object)(object)component3)) { ((Component)__instance).gameObject.AddComponent<HUDManagerRevamp>(); Diversity.mls.LogInfo((object)("Added HUDManagerRevamp to: " + ((Object)((Component)__instance).gameObject).name)); } } } [HarmonyPatch(typeof(LungProp))] internal class LungPropPatch { [HarmonyPatch(typeof(LungProp), "Start")] [HarmonyPrefix] private static void Start(LungProp __instance) { if (Configuration.brakenRevamp.Value) { LungPropRevamp component = ((Component)__instance).gameObject.GetComponent<LungPropRevamp>(); if (!Object.op_Implicit((Object)(object)component)) { ((Component)__instance).gameObject.AddComponent<LungPropRevamp>(); Diversity.mls.LogInfo((object)("Added LungPropRevamp to: " + ((Object)((Component)__instance).gameObject).name)); } } } [HarmonyPatch(typeof(LungProp), "DisconnectFromMachinery")] [HarmonyPostfix] private static void DisconnectFromMachinery(LungProp __instance) { if (Configuration.brakenRevamp.Value && Configuration.apparatusAnger.Value) { LungPropRevamp component = ((Component)__instance).gameObject.GetComponent<LungPropRevamp>(); if (Object.op_Implicit((Object)(object)component) && (Object)(object)((GrabbableObject)__instance).playerHeldBy != (Object)null) { component.AngerBracken(__instance.roundManager, ((GrabbableObject)__instance).playerHeldBy); } } } } [HarmonyPatch(typeof(PlayerControllerB))] public class PlayerControllerBPatch { public static Transform InteractorSource; private static float InteractRange = Configuration.interactRange.Value; public static PlayerControllerB player; private static CentipedeRevamp revamp; [HarmonyPatch(typeof(PlayerControllerB), "Start")] [HarmonyPrefix] public static void Start(PlayerControllerB __instance) { PlayerRevamp component = ((Component)__instance).gameObject.GetComponent<PlayerRevamp>(); if (!Object.op_Implicit((Object)(object)component)) { ((Component)__instance).gameObject.AddComponent<PlayerRevamp>(); Diversity.mls.LogInfo((object)("Added PlayerRevamp to: " + ((Object)((Component)__instance).gameObject).name)); } if (Configuration.fullDarkness.Value) { __instance.nightVision.intensity = 366.9317f * (1f - Configuration.fullDarknessIntensity.Value); } } [HarmonyPostfix] [HarmonyPatch(typeof(PlayerControllerB), "Update")] private static void Update(PlayerControllerB __instance) { //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_033f: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_0255: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)__instance.currentlyHeldObject != (Object)null && Object.op_Implicit((Object)(object)((Component)__instance.currentlyHeldObject).GetComponent<FlashlightItem>()) && Object.op_Implicit((Object)(object)((Component)__instance).gameObject.GetComponent<PlayerRevamp>())) { ((Component)__instance).gameObject.GetComponent<PlayerRevamp>().lastID = ((Component)__instance.currentlyHeldObject).GetComponent<FlashlightItem>().flashlightTypeID; } if (Configuration.centipedeRevamp.Value) { if (((NetworkBehaviour)__instance).IsOwner) { MovementActions movement = __instance.playerActions.Movement; if (((MovementActions)(ref movement)).Interact.WasPressedThisFrame()) { InteractorSource = ((Component)__instance.gameplayCamera).transform; Ray val = default(Ray); ((Ray)(ref val))..ctor(InteractorSource.position, InteractorSource.forward); RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(val, ref val2, InteractRange, LayerMask.GetMask(new string[4] { "Enemies", "Room", "Terrain", "Railing" }))) { Diversity.mls.LogInfo((object)("Interactor interacted with: " + ((Object)((Component)((RaycastHit)(ref val2)).transform).gameObject).name)); try { revamp = ((Component)((Component)((RaycastHit)(ref val2)).collider).transform.parent).gameObject.GetComponent<CentipedeRevamp>(); } catch (Exception) { } if (!Object.op_Implicit((Object)(object)revamp)) { return; } Diversity.mls.LogInfo((object)("Centipede clinging: " + revamp.clinging)); Diversity.mls.LogInfo((object)("Amount of click done: " + revamp.clicks)); if (revamp.clinging) { revamp.clicks++; float value = Random.value; if (value < (float)(Configuration.hurtChance.Value / 100)) { __instance.DamagePlayer(5, true, true, (CauseOfDeath)6, 0, false, default(Vector3)); } } } } } if (((NetworkBehaviour)__instance).IsOwner) { InteractorSource = ((Component)__instance.gameplayCamera).transform; Ray val3 = default(Ray); ((Ray)(ref val3))..ctor(InteractorSource.position, InteractorSource.forward); RaycastHit val4 = default(RaycastHit); if (Physics.Raycast(val3, ref val4, InteractRange, LayerMask.GetMask(new string[4] { "Enemies", "Room", "Terrain", "Railing" }))) { try { revamp = ((Component)((Component)((RaycastHit)(ref val4)).collider).transform.parent).gameObject.GetComponent<CentipedeRevamp>(); } catch (Exception) { } if (!Object.op_Implicit((Object)(object)revamp)) { return; } if (revamp.clinging) { ((Behaviour)HUDPatch.tipText).enabled = true; ((Behaviour)HUDPatch.holderBar).enabled = true; ((Behaviour)HUDPatch.clickBar).enabled = true; ((Graphic)HUDPatch.clickBar).rectTransform.sizeDelta = new Vector2((float)(200 / Configuration.clickAmount.Value * revamp.clicks) / 1.5f, 20f); } } else { ((Behaviour)HUDPatch.tipText).enabled = false; ((Behaviour)HUDPatch.holderBar).enabled = false; ((Behaviour)HUDPatch.clickBar).enabled = false; } } } if (Configuration.playerConditions.Value) { PlayerRevamp component = ((Component)__instance).gameObject.GetComponent<PlayerRevamp>(); if (Object.op_Implicit((Object)(object)component)) { component.CheckConditions(__instance); } } } [HarmonyPostfix] [HarmonyPatch(typeof(PlayerControllerB), "LateUpdate")] private static void LateUpdate(PlayerControllerB __instance) { PlayerRevamp component = ((Component)__instance).gameObject.GetComponent<PlayerRevamp>(); if (!Object.op_Implicit((Object)(object)component)) { return; } bool flag = false; bool flag2 = false; using (List<Condition>.Enumerator enumerator = component.conditions.GetEnumerator()) { while (enumerator.MoveNext()) { switch (enumerator.Current) { case Condition.FracturedLeg: flag = true; break; case Condition.BrokenLeg: flag2 = true; break; } } } float num = 1f; if (__instance.drunkness > 0.02f) { num *= Mathf.Abs(StartOfRound.Instance.drunknessSpeedEffect.Evaluate(__instance.drunkness) - 1.25f); } if (flag2) { if (__instance.isSprinting) { __instance.sprintMeter = Mathf.Clamp(__instance.sprintMeter - Time.deltaTime / (__instance.sprintTime / 1.5f) * __instance.carryWeight * num, 0f, 1f); } else if (__instance.isMovementHindered > 0) { if (__instance.isWalking) { __instance.sprintMeter = Mathf.Clamp(__instance.sprintMeter - Time.deltaTime / (__instance.sprintTime / 1.5f) * num * 0.5f, 0f, 1f); } } else if (!__instance.isWalking) { __instance.sprintMeter = Mathf.Clamp(__instance.sprintMeter + Time.deltaTime / (__instance.sprintTime / 1.5f + 4f) * num, 0f, 1f); } else { __instance.sprintMeter = Mathf.Clamp(__instance.sprintMeter + Time.deltaTime / (__instance.sprintTime / 1.5f + 9f) * num, 0f, 1f); } } else { if (!flag) { return; } if (__instance.isSprinting) { __instance.sprintMeter = Mathf.Clamp(__instance.sprintMeter - Time.deltaTime / (__instance.sprintTime / 1.2f) * __instance.carryWeight * num, 0f, 1f); } else if (__instance.isMovementHindered > 0) { if (__instance.isWalking) { __instance.sprintMeter = Mathf.Clamp(__instance.sprintMeter - Time.deltaTime / (__instance.sprintTime / 1.2f) * num * 0.5f, 0f, 1f); } } else if (!__instance.isWalking) { __instance.sprintMeter = Mathf.Clamp(__instance.sprintMeter + Time.deltaTime / (__instance.sprintTime / 1.2f + 4f) * num, 0f, 1f); } else { __instance.sprintMeter = Mathf.Clamp(__instance.sprintMeter + Time.deltaTime / (__instance.sprintTime / 1.2f + 9f) * num, 0f, 1f); } } } [HarmonyPatch(typeof(PlayerControllerB), "DamagePlayer")] [HarmonyPrefix] private static void DamagePlayer(PlayerControllerB __instance, int damageNumber, bool hasDamageSFX = true, bool callRPC = true, CauseOfDeath causeOfDeath = 0, int deathAnimation = 0, bool fallDamage = false, Vector3 force = default(Vector3)) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Invalid comparison between Unknown and I4 if (!Configuration.playerConditions.Value) { return; } PlayerRevamp component = ((Component)__instance).gameObject.GetComponent<PlayerRevamp>(); if (Object.op_Implicit((Object)(object)component)) { if ((int)causeOfDeath == 2) { component.ApplyConditions(DamageType.Falling, 1f + (1f - (float)(__instance.health / 100))); } else if ((int)causeOfDeath == 7) { component.ApplyConditions(DamageType.GunShotted, 1f + (1f - (float)(__instance.health / 100))); } } } } [HarmonyPatch(typeof(PufferAI))] internal class PufferAIPatch { [HarmonyPatch(typeof(PufferAI), "OnCollideWithPlayer")] [HarmonyPrefix] private static void OnCollideWithPlayer(PufferAI __instance, Collider other) { PlayerControllerB val = ((EnemyAI)__instance).MeetsStandardPlayerCollisionConditions(other, false, false); if ((Object)(object)val != (Object)null && __instance.timeSinceHittingPlayer > 1f) { PlayerRevamp component = ((Component)val).gameObject.GetComponent<PlayerRevamp>(); if (Object.op_Implicit((Object)(object)component)) { component.ApplyConditions(DamageType.Bitten, 1f + (1f - (float)(val.health / 100))); } } } [HarmonyPatch(typeof(PufferAI), "Start")] [HarmonyPrefix] private static void Start(PufferAI __instance) { GameObject smokePrefab = __instance.smokePrefab; SphereCollider component = smokePrefab.GetComponent<SphereCollider>(); if (!Object.op_Implicit((Object)(object)component)) { SphereCollider val = smokePrefab.AddComponent<SphereCollider>(); ((Collider)val).isTrigger = true; val.radius = 14f; Diversity.mls.LogInfo((object)("Added SphereCollider to: " + ((Object)smokePrefab).name)); } Rigidbody component2 = smokePrefab.GetComponent<Rigidbody>(); if (!Object.op_Implicit((Object)(object)component2)) { Rigidbody val2 = smokePrefab.AddComponent<Rigidbody>(); val2.isKinematic = true; Diversity.mls.LogInfo((object)("Added Rigidbody to: " + ((Object)smokePrefab).name)); } PufferSmokeRevamp component3 = smokePrefab.GetComponent<PufferSmokeRevamp>(); if (!Object.op_Implicit((Object)(object)component3)) { PufferSmokeRevamp pufferSmokeRevamp = smokePrefab.AddComponent<PufferSmokeRevamp>(); Diversity.mls.LogInfo((object)("Added PufferSmokeRevamp to: " + ((Object)smokePrefab).name)); } } } [HarmonyPatch(typeof(RadarBoosterItem), "Start")] internal class RadarBoosterItemPatch { [HarmonyPatch(typeof(RadarBoosterItem), "Start")] [HarmonyPostfix] public static void Start(RadarBoosterItem __instance) { if (!Object.op_Implicit((Object)(object)((Component)__instance).gameObject.GetComponent<SphereCollider>())) { SphereCollider val = ((Component)__instance).gameObject.AddComponent<SphereCollider>(); val.radius = 0.3f; ((Collider)val).isTrigger = true; Diversity.mls.LogInfo((object)("Added SphereCollider to the light of '" + ((Object)((Component)__instance).gameObject).name + "'")); } if (!Object.op_Implicit((Object)(object)((Component)__instance).gameObject.GetComponent<Rigidbody>())) { Rigidbody val2 = ((Component)__instance).gameObject.AddComponent<Rigidbody>(); val2.isKinematic = true; Diversity.mls.LogInfo((object)("Added Rigidbody to the light of '" + ((Object)((Component)__instance).gameObject).name + "'")); } } } [HarmonyPatch(typeof(RedLocustBees))] internal class RedLocustBeesPatch { [HarmonyPatch(typeof(RedLocustBees), "OnCollideWithPlayer")] [HarmonyPrefix] private static void OnCollideWithPlayer(RedLocustBees __instance, Collider other) { if (__instance.timeSinceHittingPlayer < 0.4f) { return; } PlayerControllerB val = ((EnemyAI)__instance).MeetsStandardPlayerCollisionConditions(other, false, false); if ((Object)(object)val != (Object)null && (val.health > 10 || !val.criticallyInjured)) { PlayerRevamp component = ((Component)val).gameObject.GetComponent<PlayerRevamp>(); if (Object.op_Implicit((Object)(object)component)) { component.ApplyConditions(DamageType.Electrified, 1f + (1f - (float)(val.health / 100))); } } } } [HarmonyPatch(typeof(RoundManager))] internal class RoundManagerPatch : MonoBehaviour { [HarmonyPatch(typeof(RoundManager), "Start")] [HarmonyPostfix] public static void Start(RoundManager __instance) { DiversityBehaviour component = ((Component)__instance).gameObject.GetComponent<DiversityBehaviour>(); if (!Object.op_Implicit((Object)(object)component)) { ((Component)__instance).gameObject.AddComponent<DiversityBehaviour>(); Diversity.mls.LogInfo((object)"Added DiversityBehaviour to the RoundManager."); } } [HarmonyPatch(typeof(RoundManager), "FinishGeneratingLevel")] [HarmonyPostfix] public static void FinishGeneratingLevel(RoundManager __instance) { //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Expected O, but got Unknown Light[] array = Object.FindObjectsOfType<Light>(); Light[] array2 = array; foreach (Light val in array2) { if (Object.op_Implicit((Object)(object)((Component)val).transform.parent) && (((Object)((Component)val).transform.parent).name.StartsWith("HangingLight") || ((Object)((Component)val).transform.parent).name.StartsWith("WallFixtureLight") || ((Object)((Component)val).transform.parent).name.StartsWith("MansionWallLamp") || ((Object)((Component)val).transform.parent).name.StartsWith("Chandelier"))) { GameObject gameObject = ((Component)val).gameObject; if (!Object.op_Implicit((Object)(object)gameObject.GetComponent<SphereCollider>())) { SphereCollider val2 = gameObject.AddComponent<SphereCollider>(); val2.radius = 0.3f; ((Collider)val2).isTrigger = true; Diversity.mls.LogInfo((object)("Added SphereCollider to the light of '" + ((Object)gameObject.transform.parent).name + "'")); } if (!Object.op_Implicit((Object)(object)gameObject.GetComponent<Rigidbody>())) { Rigidbody val3 = gameObject.AddComponent<Rigidbody>(); val3.isKinematic = true; Diversity.mls.LogInfo((object)("Added Rigidbody to the light of '" + ((Object)gameObject.transform.parent).name + "'")); } } } GameObject val4 = new GameObject("BrakenScreamAudio"); AudioSource val5 = val4.AddComponent<AudioSource>(); val5.loop = false; ((Behaviour)val5).enabled = false; val5.playOnAwake = true; val5.volume = 1f; val5.spatialBlend = 0f; val5.clip = Content.MainAssets.LoadAsset<AudioClip>("Assets/custom/diversity/bracken/brakenScream.mp3"); Object.Instantiate<GameObject>(val4); Diversity.mls.LogInfo((object)"Bracken scream audio created."); } } [HarmonyPatch(typeof(SandSpiderAI))] internal class SandSpiderAIPatch { private static SpiderRevamp spider; [HarmonyPatch(typeof(SandSpiderAI), "HitEnemy")] [HarmonyPrefix] public static void Slow(SandSpiderAI __instance) { spider = ((Component)__instance).GetComponent<SpiderRevamp>(); if (Object.op_Implicit((Object)(object)spider) && !spider.onCooldown) { spider.hasBeenhit = true; spider.onCooldown = true; spider.previousAgentSpeed = ((EnemyAI)__instance).agent.speed; spider.previousSpiderSpeed = __instance.spiderSpeed; spider.currentAgentSpeed = ((EnemyAI)__instance).agent.speed; spider.currentSpiderSpeed = __instance.spiderSpeed; Diversity.mls.LogInfo((object)"Spider hit!"); } } [HarmonyPatch(typeof(SandSpiderAI), "Start")] [HarmonyPrefix] public static void Start(SandSpiderAI __instance) { if (Configuration.spiderRevamp.Value) { spider = ((Component)__instance).gameObject.GetComponent<SpiderRevamp>(); if (!Object.op_Implicit((Object)(object)spider)) { ((Component)__instance).gameObject.AddComponent<SpiderRevamp>(); Diversity.mls.LogInfo((object)("Added SpiderRevamp to: " + ((Object)((Component)__instance).gameObject).name)); } } } [HarmonyPatch(typeof(SandSpiderAI), "OnCollideWithPlayer")] [HarmonyPrefix] private static void OnCollideWithPlayer(SandSpiderAI __instance, Collider other) { if (((EnemyAI)__instance).isEnemyDead || __instance.onWall) { return; } PlayerControllerB val = ((EnemyAI)__instance).MeetsStandardPlayerCollisionConditions(other, __instance.spoolingPlayerBody, false); if ((Object)(object)val != (Object)null && __instance.timeSinceHittingPlayer > 1f) { PlayerRevamp component = ((Component)val).gameObject.GetComponent<PlayerRevamp>(); if (Object.op_Implicit((Object)(object)component)) { component.ApplyConditions(DamageType.Mauled, 1f + (1f - (float)(val.health / 100))); } } } } [HarmonyPatch(typeof(SpringManAI))] internal class SpringManAIPatch { [HarmonyPatch(typeof(SpringManAI), "OnCollideWithPlayer")] [HarmonyPrefix] private static void OnCollideWithPlayer(SpringManAI __instance, Collider other) { if (__instance.stoppingMovement || ((EnemyAI)__instance).currentBehaviourStateIndex != 1 || __instance.timeSinceHittingPlayer >= 0f) { return; } PlayerControllerB val = ((EnemyAI)__instance).MeetsStandardPlayerCollisionConditions(other, false, false); if ((Object)(object)val != (Object)null) { PlayerRevamp component = ((Component)val).gameObject.GetComponent<PlayerRevamp>(); if (Object.op_Implicit((Object)(object)component)) { component.ApplyConditions(DamageType.Concussed, 1f + (1f - (float)(val.health / 100))); } } } } [HarmonyPatch(typeof(StartOfRound))] internal class StartOfRoundPatch { [HarmonyPatch(typeof(StartOfRound), "EndOfGame")] [HarmonyPrefix] private static void EndOfGame(StartOfRound __instance) { PlayerControllerB[] allPlayerScripts = __instance.allPlayerScripts; foreach (PlayerControllerB val in allPlayerScripts) { if ((Object)(object)val != (Object)null) { PlayerRevamp component = ((Component)val).gameObject.GetComponent<PlayerRevamp>(); if (!Object.op_Implicit((Object)(object)component)) { break; } component.conditions.Clear(); val.playerBodyAnimator.SetBool("Limp", false); val.jumpForce = 13f; val.bleedingHeavily = false; HUDManagerRevamp component2 = ((Component)HUDManager.Instance).gameObject.GetComponent<HUDManagerRevamp>(); if (!Object.op_Implicit((Object)(object)component2)) { break; } component2.blindnessIntensity = 0f; component2.concussedIntensity = 0f; } } } } [HarmonyPatch(typeof(SteamValveHazard))] internal class SteamValveHazardPatch { [HarmonyPatch(typeof(SteamValveHazard), "Start")] [HarmonyPrefix] private static void Start(SteamValveHazard __instance) { SteamLeakRevamp component = ((Component)__instance).gameObject.GetComponent<SteamLeakRevamp>(); if (!Object.op_Implicit((Object)(object)component)) { ((Component)__instance).gameObject.AddComponent<SteamLeakRevamp>(); Diversity.mls.LogInfo((object)("Added SteamLeakRevamp to: " + ((Object)((Component)__instance).gameObject).name)); } } [HarmonyPatch(typeof(SteamValveHazard), "Update")] [HarmonyPrefix] private static void Update(SteamValveHazard __instance) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) if (__instance.valveHasBurst && Vector3.Distance(((Component)GameNetworkManager.Instance.localPlayerController).transform.position, ((Component)__instance.valveAudio).transform.position) < 10f) { SteamLeakRevamp component = ((Component)__instance).gameObject.GetComponent<SteamLeakRevamp>(); if (Object.op_Implicit((Object)(object)component)) { component.TriggerBlind(GameNetworkManager.Instance.localPlayerController); } } } } } namespace Diversity.Monsters { public class BrakenRevamp : MonoBehaviour { private bool isColliding = false; public int angerLevel = 0; public float interval = 0f; public RoundManager roundM; private void Start() { roundM = RoundManager.Instance; } private void OnTriggerEnter(Collider col) { if (isColliding) { return; } isColliding = true; if (((Object)((Component)col).gameObject).name == "Light" || ((Object)((Component)col).gameObject).name.StartsWith("PoweredLightType")) { Diversity.mls.LogInfo((object)"Braken collided with a light!"); if (Object.op_Implicit((Object)(object)((Component)col).transform.parent) && Object.op_Implicit((Object)(object)((Component)((Component)col).transform.parent).GetComponent<Animator>())) { float value = Random.value; if (value < (float)(Configuration.flickerChance.Value / 100)) { ((MonoBehaviour)this).StartCoroutine(FlickerLight(((Component)col).GetComponent<SphereCollider>(), ((Component)((Component)col).transform.parent).GetComponent<Animator>())); } } } else if (((Object)((Component)col).gameObject).name == "PlayerPhysicsBox") { PlayerControllerB component = ((Component)((Component)col).transform.parent).GetComponent<PlayerControllerB>(); Diversity.mls.LogInfo((object)"Braken collided with a player!"); PlayerRevamp component2 = ((Component)component).gameObject.GetComponent<PlayerRevamp>(); if (Object.op_Implicit((Object)(object)component2)) { component2.isHaunted = true; } if (Object.op_Implicit((Object)(object)component.helmetLight)) { component2.lastLight = component.helmetLight; } if ((Object)(object)component.currentlyHeldObject != (Object)null) { if (Object.op_Implicit((Object)(object)((Component)component.currentlyHeldObject).GetComponent<FlashlightItem>())) { GameObject gameObject = ((Component)((Component)component.currentlyHeldObject).GetComponent<FlashlightItem>()).gameObject; FlashlightRevamp component3 = gameObject.GetComponent<FlashlightRevamp>(); if (Object.op_Implicit((Object)(object)component3)) { component3.haunted = true; } } } else if ((Object)(object)component.currentlyHeldObjectServer != (Object)null && Object.op_Implicit((Object)(object)((Component)component.currentlyHeldObjectServer).GetComponent<FlashlightItem>())) { GameObject gameObject2 = ((Component)((Component)component.currentlyHeldObjectServer).GetComponent<FlashlightItem>()).gameObject; FlashlightRevamp component4 = gameObject2.GetComponent<FlashlightRevamp>(); if (Object.op_Implicit((Object)(object)component4)) { component4.haunted = true; } } GrabbableObject[] itemSlots = component.ItemSlots; foreach (GrabbableObject val in itemSlots) { if ((Object)(object)val != (Object)null) { RadarBoosterItem component5 = ((Component)val).GetComponent<RadarBoosterItem>(); if (!Object.op_Implicit((Object)(object)component5)) { break; } if (component5.radarEnabled) { component5.EnableRadarBooster(false); } } } } else if (((Object)((Component)col).gameObject).name.StartsWith("RadarBoosterDevice")) { RadarBoosterItem component6 = ((Component)col).gameObject.GetComponent<RadarBoosterItem>(); if (Object.op_Implicit((Object)(object)component6) && component6.radarEnabled) { component6.EnableRadarBooster(false); } } } private void OnTriggerStay(Collider col) { if (((Object)((Component)col).gameObject).name == "PlayerPhysicsBox") { PlayerControllerB component = ((Component)((Component)col).transform.parent).GetComponent<PlayerControllerB>(); PlayerRevamp component2 = ((Component)component).gameObject.GetComponent<PlayerRevamp>(); if (Object.op_Implicit((Object)(object)component2)) { component2.isHaunted = true; } if (Object.op_Implicit((Object)(object)component.helmetLight)) { component2.lastLight = component.helmetLight; } if ((Object)(object)component.currentlyHeldObject != (Object)null) { if (Object.op_Implicit((Object)(object)((Component)component.currentlyHeldObject).GetComponent<FlashlightItem>())) { GameObject gameObject = ((Component)((Component)component.currentlyHeldObject).GetComponent<FlashlightItem>()).gameObject; FlashlightRevamp component3 = gameObject.GetComponent<FlashlightRevamp>(); if (Object.op_Implicit((Object)(object)component3)) { component3.haunted = true; } } } else if ((Object)(object)component.currentlyHeldObjectServer != (Object)null && Object.op_Implicit((Object)(object)((Component)component.currentlyHeldObjectServer).GetComponent<FlashlightItem>())) { GameObject gameObject2 = ((Component)((Component)component.currentlyHeldObjectServer).GetComponent<FlashlightItem>()).gameObject; FlashlightRevamp component4 = gameObject2.GetComponent<FlashlightRevamp>(); if (Object.op_Implicit((Object)(object)component4)) { component4.haunted = true; } } GrabbableObject[] itemSlots = component.ItemSlots; foreach (GrabbableObject val in itemSlots) { if ((Object)(object)val != (Object)null) { RadarBoosterItem component5 = ((Component)val).GetComponent<RadarBoosterItem>(); if (!Object.op_Implicit((Object)(object)component5)) { break; } if (component5.radarEnabled) { component5.EnableRadarBooster(false); } } } } else if (((Object)((Component)col).gameObject).name.StartsWith("RadarBoosterDevice")) { RadarBoosterItem component6 = ((Component)col).gameObject.GetComponent<RadarBoosterItem>(); if (Object.op_Implicit((Object)(object)component6) && component6.radarEnabled) { component6.EnableRadarBooster(false); } } } private void OnTriggerExit(Collider col) { if (!(((Object)((Component)col).gameObject).name == "PlayerPhysicsBox")) { return; } PlayerControllerB component = ((Component)((Component)col).transform.parent).GetComponent<PlayerControllerB>(); PlayerRevamp component2 = ((Component)component).gameObject.GetComponent<PlayerRevamp>(); if (Object.op_Implicit((Object)(object)component2)) { component2.isHaunted = false; } if (Object.op_Implicit((Object)(object)component.helmetLight)) { component2.lastLight = component.helmetLight; } if ((Object)(object)component.currentlyHeldObject != (Object)null) { if (Object.op_Implicit((Object)(object)((Component)component.currentlyHeldObject).GetComponent<FlashlightItem>())) { GameObject gameObject = ((Component)((Component)component.currentlyHeldObject).GetComponent<FlashlightItem>()).gameObject; FlashlightRevamp component3 = gameObject.GetComponent<FlashlightRevamp>(); if (Object.op_Implicit((Object)(object)component3)) { component3.haunted = false; } } } else if ((Object)(object)component.currentlyHeldObjectServer != (Object)null && Object.op_Implicit((Object)(object)((Component)component.currentlyHeldObjectServer).GetComponent<FlashlightItem>())) { GameObject gameObject2 = ((Component)((Component)component.currentlyHeldObjectServer).GetComponent<FlashlightItem>()).gameObject; FlashlightRevamp component4 = gameObject2.GetComponent<FlashlightRevamp>(); if (Object.op_Implicit((Object)(object)component4)) { component4.haunted = false; } } } public void CheckInterval() { interval = 0f; BreakerBox val = Object.FindObjectOfType<BreakerBox>(); float value = Random.value; if (value < (float)(Configuration.breakerChance.Value / 100)) { val.SetSwitchesOff(); val.SwitchBreaker(false); val.roundManager.SwitchPower(false); } } public void CheckAnger(RoundManager roundManager, PlayerControllerB player) { int num = 3; DiversityBehaviour component = ((Component)roundManager).gameObject.GetComponent<DiversityBehaviour>(); if (Object.op_Implicit((Object)(object)component)) { num = component.anger; } Diversity.mls.LogInfo((object)("angerMax: " + num)); if (angerLevel < num && angerLevel > 0) { ((MonoBehaviour)this).StartCoroutine(FlickerAllLights(roundManager)); } else { if (angerLevel != num) { return; } ((MonoBehaviour)this).StartCoroutine(MaxAnger(roundManager)); FlowermanAI component2 = ((Component)this).gameObject.GetComponent<FlowermanAI>(); if (!Object.op_Implicit((Object)(object)component2)) { return; } if (Configuration.chaseTriggerer.Value && (Object)(object)player != (Object)null) { ((EnemyAI)component2).SetMovingTowardsTargetPlayer(player); if (!component2.inKillAnimation && (Object)(object)((EnemyAI)component2).targetPlayer != (Object)(object)GameNetworkManager.Instance.localPlayerController) { ((EnemyAI)component2).ChangeOwnershipOfEnemy(player.actualClientId); } } component2.EnterAngerModeClientRpc(90f); component2.EnterAngerModeServerRpc(90f); } } public void TransmitWalkie(AudioClip clip) { WalkieTalkie[] walkies = Object.FindObjectsOfType<WalkieTalkie>(); ((MonoBehaviour)this).StartCoroutine(DelayVoice(walkies, clip)); } public IEnumerator DelayVoice(WalkieTalkie[] walkies, AudioClip clip) { int angerMax = 3; DiversityBehaviour bhv = Object.FindObjectOfType<DiversityBehaviour>(); if (Object.op_Implicit((Object)(object)bhv)) { angerMax = bhv.anger; } foreach (WalkieTalkie walkie in walkies) { if (angerLevel == angerMax && ((GrabbableObject)walkie).isBeingUsed) { yield return (object)new WaitForSeconds(2f); walkie.target.PlayOneShot(clip); Diversity.mls.LogInfo((object)"Transmiting audio."); } } } public IEnumerator PlayScream(AudioSource audio) { ((Behaviour)audio).enabled = true; yield return (object)new WaitForSeconds(7f); ((Behaviour)audio).enabled = false; } public IEnumerator MaxAnger(RoundManager roundManager) { yield return (object)new WaitForSeconds(Random.Range(0.5f, 1f)); GameObject[] objs = (GameObject[])(object)Object.FindObjectsOfType(typeof(GameObject)); GameObject[] array = objs; foreach (GameObject obj in array) { if (((Object)obj).name == "BrakenScreamAudio") { AudioSource audio = obj.GetComponent<AudioSource>(); if (Object.op_Implicit((Object)(object)audio)) { ((MonoBehaviour)this).StartCoroutine(PlayScream(audio)); } } } roundManager.powerOffPermanently = true; roundManager.SwitchPower(false); PlayerControllerB[] players = (PlayerControllerB[])(object)Object.FindObjectsOfType(typeof(PlayerControllerB)); PlayerControllerB[] array2 = players; foreach (PlayerControllerB player in array2) { player.JumpToFearLevel(0.9f, true); GrabbableObject[] items = player.ItemSlots; GrabbableObject[] array3 = items; foreach (GrabbableObject item in array3) { if ((Object)(object)item != (Object)null) { FlashlightRevamp flashlight = ((Component)item).gameObject.GetComponent<FlashlightRevamp>(); if (Object.op_Implicit((Object)(object)flashlight)) { ((MonoBehaviour)this).StartCoroutine(flashlight.Flicker()); } } } } HUDManager.Instance.ShakeCamera((ScreenShakeType)2); } public IEnumerator FlickerAllLights(RoundManager roundManager) { yield return (object)new WaitForSeconds(Random.Range(0.5f, 1f)); roundManager.FlickerLights(false, false); } public IEnumerator FlickerLight(SphereCollider col, Animator animator) { ((Collider)col).enabled = false; animator.SetBool("on", false); yield return (object)new WaitForSeconds(Random.Range(0.01f, 0.2f)); animator.SetBool("on", true); yield return (object)new WaitForSeconds(Random.Range(0.01f, 0.2f)); animator.SetBool("on", false); yield return (object)new WaitForSeconds(Random.Range(0.01f, 0.2f)); animator.SetBool("on", true); yield return (object)new WaitForSeconds(Random.Range(0.01f, 0.2f)); animator.SetBool("on", false); yield return (object)new WaitForSeconds(Random.Range(0.01f, 0.2f)); animator.SetBool("on", true); yield return (object)new WaitForSeconds(Random.Range(0.01f, 0.2f)); animator.SetBool("on", false); yield return (object)new WaitForSeconds(Random.Range(60f, 120f)); if (Object.op_Implicit((Object)(object)roundM) && !roundM.powerOffPermanently) { animator.SetBool("on", true); ((Collider)col).enabled = true; } } private void Update() { isColliding = false; interval += Time.deltaTime; if (interval >= 200f) { CheckInterval(); } } } public class CentipedeRevamp : MonoBehaviour { private CentipedeAI centipede; public bool clinging = false; public int clicks = 0; private void Start() { centipede = ((Component)this).gameObject.GetComponent<CentipedeAI>(); } private void Update() { if ((Object)(object)centipede.clingingToPlayer != (Object)null) { clinging = true; } else { clinging = false; } if (clicks >= Configuration.clickAmount.Value) { clicks = 0; clinging = false; centipede.StopClingingServerRpc(false); centipede.StopClingingClientRpc(false); } } } public class CrawlerRevamp : MonoBehaviour { private CrawlerAI crawler; private static float slowAmount = Configuration.crawlerSlowAmount.Value; private static float timeElapsed = 0f; private static float cooldown = 0f; public bool onCooldown = false; public bool hasBeenhit = false; public float previousAgentSpeed = 0f; public float previousAgentAcceleration = 0f; public float currentAgentSpeed = 0f; public float currentAgentAcceleration = 0f; private void Start() { crawler = ((Component)this).gameObject.GetComponent<CrawlerAI>(); } private void Update() { if (!Object.op_Implicit((Object)(object)crawler)) { return; } if (hasBeenhit) { if (timeElapsed < 2f) { currentAgentSpeed = Mathf.Lerp(currentAgentSpeed - currentAgentSpeed * slowAmount, previousAgentSpeed, timeElapsed / 2f); currentAgentAcceleration = Mathf.Lerp(currentAgentAcceleration - currentAgentAcceleration * slowAmount, previousAgentAcceleration + 5f, timeElapsed / 2f); timeElapsed += Time.deltaTime; } else { currentAgentSpeed = previousAgentSpeed; currentAgentAcceleration = previousAgentAcceleration; } if (currentAgentSpeed == previousAgentSpeed) { hasBeenhit = false; } ((EnemyAI)crawler).agent.speed = currentAgentSpeed; ((EnemyAI)crawler).agent.acceleration = currentAgentAcceleration; } if (onCooldown) { cooldown += Time.deltaTime; } if (onCooldown && cooldown > 2f && hasBeenhit) { Diversity.mls.LogInfo((object)"Crawler debuff hit is over."); hasBeenhit = false; timeElapsed = 0f; } if (onCooldown && cooldown > 3f) { Diversity.mls.LogInfo((object)"Crawler debuff cooldown is over."); onCooldown = false; cooldown = 0f; } } } public class DressGirlRevamp : MonoBehaviour { public List<AudioClip> audios = new List<AudioClip>(); public float timeElapsed = 0f; private void Start() { audios.Add(Content.MainAssets.LoadAsset<AudioClip>("Assets/custom/diversity/girl/humming/humming1.ogg")); audios.Add(Content.MainAssets.LoadAsset<AudioClip>("Assets/custom/diversity/girl/humming/humming2.ogg")); audios.Add(Content.MainAssets.LoadAsset<AudioClip>("Assets/custom/diversity/girl/laugh/laugh1.ogg")); audios.Add(Content.MainAssets.LoadAsset<AudioClip>("Assets/custom/diversity/girl/laugh/laugh2.ogg")); audios.Add(Content.MainAssets.LoadAsset<AudioClip>("Assets/custom/diversity/girl/laugh/laugh3.ogg")); audios.Add(Content.MainAssets.LoadAsset<AudioClip>("Assets/custom/diversity/girl/laugh/laugh4.ogg")); audios.Add(Content.MainAssets.LoadAsset<AudioClip>("Assets/custom/diversity/girl/voice/voice1.ogg")); audios.Add(Content.MainAssets.LoadAsset<AudioClip>("Assets/custom/diversity/girl/voice/voice2.ogg")); audios.Add(Content.MainAssets.LoadAsset<AudioClip>("Assets/custom/diversity/girl/voice/voice3.ogg")); audios.Add(Content.MainAssets.LoadAsset<AudioClip>("Assets/custom/diversity/girl/voice/voice4.ogg")); } public void TryWalkieTalkie(PlayerControllerB player) { if (!(timeElapsed >= Random.Range(45f, 180f) * Configuration.walkieTalkieFrequency.Value)) { return; } timeElapsed = 0f; if ((Object)(object)player == (Object)null) { return; } GrabbableObject[] itemSlots = player.ItemSlots; GrabbableObject[] array = itemSlots; foreach (GrabbableObject val in array) { if (!((Object)(object)val != (Object)null)) { continue; } WalkieTalkie component = ((Component)val).gameObject.GetComponent<WalkieTalkie>(); if (Object.op_Implicit((Object)(object)component) && ((GrabbableObject)component).isBeingUsed) { AudioClip val2 = audios[Random.Range(0, audios.Count)]; if (!Object.op_Implicit((Object)(object)val2)) { break; } component.target.PlayOneShot(val2); Diversity.mls.LogInfo((object)"Transmiting audio."); } } } } public class SpiderRevamp : MonoBehaviour { private SandSpiderAI spider; private static float slowAmount = Configuration.spiderSlowAmount.Value; private static float timeElapsed = 0f; private static float cooldown = 0f; public bool onCooldown = false; public bool hasBeenhit = false; public float previousAgentSpeed = 0f; public float previousSpiderSpeed = 0f; public float currentAgentSpeed = 0f; public float currentSpiderSpeed = 0f; private void Start() { spider = ((Component)this).gameObject.GetComponent<SandSpiderAI>(); } private void Update() { if (!Object.op_Implicit((Object)(object)spider)) { return; } if (hasBeenhit) { if (timeElapsed < 1f) { currentSpiderSpeed = Mathf.Lerp(currentSpiderSpeed - currentSpiderSpeed * slowAmount, previousSpiderSpeed, timeElapsed / 1f); currentAgentSpeed = Mathf.Lerp(currentAgentSpeed - currentAgentSpeed * slowAmount, previousAgentSpeed, timeElapsed / 1f); timeElapsed += Time.deltaTime; } else { currentSpiderSpeed = previousSpiderSpeed; currentAgentSpeed = previousAgentSpeed; } if (currentSpiderSpeed == previousSpiderSpeed) { hasBeenhit = false; } spider.spiderSpeed = currentSpiderSpeed; ((EnemyAI)spider).agent.speed = currentAgentSpeed; if (currentSpiderSpeed > 0f) { ((EnemyAI)spider).creatureAnimator.SetBool("moving", true); } else { ((EnemyAI)spider).creatureAnimator.SetBool("moving", false); } } if (onCooldown) { cooldown += Time.deltaTime; } if (onCooldown && cooldown > 1f && hasBeenhit) { Diversity.mls.LogInfo((object)"Spider debuff hit is over."); hasBeenhit = false; timeElapsed = 0f; } if (onCooldown && cooldown > 3f) { Diversity.mls.LogInfo((object)"Spider debuff cooldown is over."); onCooldown = false; cooldown = 0f; } } } } namespace Diversity.Misc { public class HUDManagerRevamp : MonoBehaviour { public Volume concussed; public Volume blindness; public float concussedIntensity = 0f; public float blindnessIntensity = 0f; private void Start() { concussed = ((Component)this).gameObject.AddComponent<Volume>(); concussed.profile = Content.MainAssets.LoadAsset<VolumeProfile>("Assets/custom/diversity/volumes/concussed.asset"); concussed.isGlobal = true; concussed.weight = 0f; concussed.sharedProfile = Content.MainAssets.LoadAsset<VolumeProfile>("Assets/custom/diversity/volumes/concussed.asset"); Diversity.mls.LogInfo((object)("Added Volume to: " + ((Object)((Component)this).gameObject).name)); blindness = ((Component)this).gameObject.AddComponent<Volume>(); blindness.profile = Content.MainAssets.LoadAsset<VolumeProfile>("Assets/custom/diversity/volumes/blind.asset"); blindness.isGlobal = true; blindness.weight = 0f; blindness.sharedProfile = Content.MainAssets.LoadAsset<VolumeProfile>("Assets/custom/diversity/volumes/blind.asset"); } private void Update() { concussed.weight = Mathf.Lerp(concussed.weight, concussedIntensity, 2f * Time.deltaTime); blindness.weight = Mathf.Lerp(blindness.weight, blindnessIntensity, 2f * Time.deltaTime); } } public class PufferSmokeRevamp : MonoBehaviour { private float timeElapsed = 0f; private void OnTriggerEnter(Collider col) { if (((Object)((Component)col).gameObject).name == "PlayerPhysicsBox") { Diversity.mls.LogInfo((object)("Smoke collided with: " + ((Object)((Component)col).gameObject).name)); } } private void OnTriggerStay(Collider col) { timeElapsed += Time.deltaTime; if (!(timeElapsed >= 1f)) { return; } timeElapsed = 0f; if (((Object)((Component)col).gameObject).name == "PlayerPhysicsBox") { GameObject gameObject = ((Component)((Component)col).transform.parent).gameObject; PlayerRevamp component = gameObject.GetComponent<PlayerRevamp>(); PlayerControllerB component2 = gameObject.GetComponent<PlayerControllerB>(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component2)) { component.ApplyConditions(DamageType.Gas, 1f + (1f - (float)(component2.health / 100))); } } } } public class SteamLeakRevamp : MonoBehaviour { public float timeElapsed = 0f; public void TriggerBlind(PlayerControllerB player) { timeElapsed += Time.deltaTime; if (timeElapsed >= 1f) { timeElapsed = 0f; PlayerRevamp component = ((Component)player).GetComponent<PlayerRevamp>(); if (Object.op_Implicit((Object)(object)component)) { component.ApplyConditions(DamageType.Gas, 1f + (1f - (float)(player.health / 100))); } } } } } namespace Diversity.Items { public class FlashlightRevamp : MonoBehaviour { public bool haunted = false; public int lastID = 0; public float currentIntensity = 0f; private bool wasHaunted = false; private bool flicker = false; private float timeElapsed = 0f; private FlashlightItem flashlight; private void Update() { flashlight = ((Component)this).gameObject.GetComponent<FlashlightItem>(); lastID = flashlight.flashlightTypeID; if (!flicker) { if (!haunted) { if (!wasHaunted) { if (timeElapsed != 1f) { timeElapsed = 1f - timeElapsed; } else { timeElapsed = 0f; } wasHaunted = true; } if (lastID == 0) { flashlight.flashlightBulb.intensity = Mathf.Lerp(100f, 486.8536f, timeElapsed / 1f); flashlight.flashlightBulb.range = Mathf.Lerp(10f, 55f, timeElapsed / 1f); currentIntensity = Mathf.Lerp(100f, 486.8536f, timeElapsed / 1f); } else if (lastID == 1) { flashlight.flashlightBulb.intensity = Mathf.Lerp(50f, 397.9603f, timeElapsed / 1f); flashlight.flashlightBulb.range = Mathf.Lerp(5f, 17f, timeElapsed / 1f); currentIntensity = Mathf.Lerp(50f, 397.9603f, timeElapsed / 1f); } timeElapsed += Time.deltaTime; if (timeElapsed >= 1f) { timeElapsed = 1f; } return; } if (wasHaunted) { if (timeElapsed != 1f) { timeElapsed = 1f - timeElapsed; } else { timeElapsed = 0f; } wasHaunted = false; } if (lastID == 0) { flashlight.flashlightBulb.intensity = Mathf.Lerp(486.8536f, 100f, timeElapsed / 1f); flashlight.flashlightBulb.range = Mathf.Lerp(55f, 10f, timeElapsed / 1f); currentIntensity = Mathf.Lerp(486.8536f, 100f, timeElapsed / 1f); } else if (lastID == 1) { flashlight.flashlightBulb.intensity = Mathf.Lerp(397.9603f, 50f, timeElapsed / 1f); flashlight.flashlightBulb.range = Mathf.Lerp(17f, 5f, timeElapsed / 1f); currentIntensity = Mathf.Lerp(397.9603f, 50f, timeElapsed / 1f); } timeElapsed += Time.deltaTime; if (timeElapsed >= 1f) { timeElapsed = 1f; } } else if (lastID == 0) { flashlight.flashlightBulb.intensity = Random.Range(0f, 486.8536f); } else if (lastID == 1) { flashlight.flashlightBulb.intensity = Random.Range(0f, 397.9603f); } } public IEnumerator Flicker() { flicker = true; yield return (object)new WaitForSeconds(1.75f); flicker = false; } } public class LungPropRevamp : MonoBehaviour { public void AngerBracken(RoundManager roundManager, PlayerControllerB player) { int angerLevel = 3; DiversityBehaviour component = ((Component)roundManager).gameObject.GetComponent<DiversityBehaviour>(); if (Object.op_Implicit((Object)(object)component)) { angerLevel = component.anger; } BrakenRevamp[] array = Object.FindObjectsOfType<BrakenRevamp>(); BrakenRevamp[] array2 = array; foreach (BrakenRevamp brakenRevamp in array2) { brakenRevamp.angerLevel = angerLevel; brakenRevamp.CheckAnger(roundManager, player); } } } }
BepInEx/plugins/kuba6000-LC_Masked_Fix/LC_Masked_Fix.dll
Decompiled 11 months agousing System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Logging; using HarmonyLib; using LC_MIMICFIX.Patches; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("LC_MIMICFIX")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("LC_MIMICFIX")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("52a8c306-f1df-46d3-a634-8db137e227d7")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace LC_MIMICFIX { [BepInPlugin("kuba6000.LC_MimicFixMod", "LC_Masked_Fix", "0.0.1")] public class LC_MimicFixMod : BaseUnityPlugin { private const string ModGUID = "kuba6000.LC_MimicFixMod"; private const string ModName = "LC_Masked_Fix"; private const string ModVersion = "0.0.1"; private readonly Harmony harmony = new Harmony("kuba6000.LC_MimicFixMod"); public static LC_MimicFixMod instance; internal ManualLogSource log; private void Awake() { instance = this; log = Logger.CreateLogSource("kuba6000.LC_MimicFixMod"); log.LogInfo((object)"Mimic Fix Awaken!"); log.LogInfo((object)"Patching MaskedPlayerEnemy"); harmony.PatchAll(typeof(LC_MimicFixMod)); harmony.PatchAll(typeof(MaskedPlayerEnemyPatch)); } } } namespace LC_MIMICFIX.Patches { [HarmonyPatch(typeof(MaskedPlayerEnemy))] internal class MaskedPlayerEnemyPatch { [HarmonyPatch("CancelSpecialAnimationWithPlayer")] [HarmonyPrefix] private static bool CancelSpecialAnimationWithPlayerPatch(MaskedPlayerEnemy __instance) { if ((Object)(object)((EnemyAI)__instance).inSpecialAnimationWithPlayer == (Object)(object)GameNetworkManager.Instance.localPlayerController) { LC_MimicFixMod.instance.log.LogInfo((object)"Removing biohazardDamage animation"); HUDManager.Instance.HUDAnimator.SetBool("biohazardDamage", false); HUDManager.Instance.HideHUD(true); HUDManager.Instance.HideHUD(false); } LC_MimicFixMod.instance.log.LogInfo((object)"Directly finishing kill animation"); __instance.FinishKillAnimation(false); return false; } } }
BepInEx/plugins/linkoid-DissonanceLagFix/Linkoid.Dissonance.LagFix.dll
Decompiled 11 months agousing System; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using Dissonance; using Microsoft.CodeAnalysis; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("Linkoid.Dissonance.LagFix")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Linkoid.Dissonance.LagFix")] [assembly: AssemblyCopyright("Copyright © linkoid 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("07f63a54-331c-49fa-870c-ee582bb74fd3")] [assembly: AssemblyFileVersion("1.0")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.8746.28325")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [module: UnverifiableCode] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [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 Linkoid.Dissonance.LagFix { [BepInPlugin("Linkoid.Dissonance.LagFix", "Dissonance Lag Fix", "1.0")] public sealed class DissonanceLagFixPlugin : BaseUnityPlugin { private void Awake() { Logs.SetLogLevel((LogCategory)1, (LogLevel)4); } } public static class PluginInfo { internal const string GUID = "Linkoid.Dissonance.LagFix"; internal const string NAME = "Dissonance Lag Fix"; internal const string VERSION = "1.0"; public static readonly string Guid = "Linkoid.Dissonance.LagFix"; public static readonly string Name = "Dissonance Lag Fix"; public static readonly string Version = "1.0"; } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { public IgnoresAccessChecksToAttribute(string assemblyName) { } } }
BepInEx/plugins/malco-Lategame_Upgrades/MoreShipUpgrades/MoreShipUpgrades.dll
Decompiled 11 months ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using GameNetcodeStuff; using HarmonyLib; using LethalLib.Modules; using MoreShipUpgrades.Managers; using MoreShipUpgrades.Misc; using MoreShipUpgrades.UpgradeComponents; using Newtonsoft.Json; using TMPro; using Unity.Netcode; using UnityEngine; using UnityEngine.AI; using UnityEngine.Events; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyVersion("0.0.0.0")] internal class <Module> { static <Module>() { } } namespace MoreShipUpgrades { [BepInPlugin("com.malco.lethalcompany.moreshipupgrades", "More Ship Upgrades", "2.8.0")] [BepInDependency("evaisa.lethallib", "0.6.0")] public class Plugin : BaseUnityPlugin { private readonly Harmony harmony = new Harmony("com.malco.lethalcompany.moreshipupgrades"); public static Plugin instance; public static ManualLogSource mls; private AudioClip itemBreak; private AudioClip buttonPressed; private AudioClip error; public static PluginConfig cfg { get; private set; } private void Awake() { //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Expected O, but got Unknown cfg = new PluginConfig(((BaseUnityPlugin)this).Config); cfg.InitBindings(); mls = Logger.CreateLogSource("More Ship Upgrades"); instance = this; Type[] types = Assembly.GetExecutingAssembly().GetTypes(); Type[] array = types; foreach (Type type in array) { MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); MethodInfo[] array2 = methods; foreach (MethodInfo methodInfo in array2) { object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false); if (customAttributes.Length != 0) { methodInfo.Invoke(null, null); } } } string text = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "shipupgrades"); AssetBundle bundle = AssetBundle.LoadFromFile(text); GameObject val = new GameObject("UpgradeBus"); val.AddComponent<UpgradeBus>(); UpgradeBus.instance.version = "2.8.0"; UpgradeBus.instance.UpgradeAssets = bundle; UpgradeBus.instance.internNames = AssetBundleHandler.GetInfoFromJSON("InternNames").Split(","); UpgradeBus.instance.internInterests = AssetBundleHandler.GetInfoFromJSON("InternInterests").Split(","); SetupModStore(ref bundle); SetupIntroScreen(ref bundle); SetupItems(); SetupPerks(); harmony.PatchAll(); mls.LogInfo((object)"LGU has been patched"); } public void sendModInfo() { foreach (KeyValuePair<string, PluginInfo> pluginInfo in Chainloader.PluginInfos) { if (pluginInfo.Value.Metadata.GUID.Contains("ModSync")) { try { List<string> list = new List<string> { "malco", "LateGameUpgrades" }; ((Component)pluginInfo.Value.Instance).BroadcastMessage("getModInfo", (object)list, (SendMessageOptions)1); break; } catch (Exception) { mls.LogInfo((object)"Failed to send info to ModSync, go yell at Minx"); break; } } } } private void SetupModStore(ref AssetBundle bundle) { GameObject val = AssetBundleHandler.TryLoadGameObjectAsset(ref bundle, "Assets/ShipUpgrades/LGUStore.prefab"); if (!((Object)(object)val == (Object)null)) { val.AddComponent<LGUStore>(); NetworkPrefabs.RegisterNetworkPrefab(val); UpgradeBus.instance.modStorePrefab = val; } } private void SetupIntroScreen(ref AssetBundle bundle) { UpgradeBus.instance.introScreen = AssetBundleHandler.TryLoadGameObjectAsset(ref bundle, "Assets/ShipUpgrades/IntroScreen.prefab"); if ((Object)(object)UpgradeBus.instance.introScreen != (Object)null) { UpgradeBus.instance.introScreen.AddComponent<IntroScreenScript>(); } } private void SetupItems() { SetupTeleporterButtons(); SetupNightVision(); SetupMedkit(); SetupPeeper(); SetupSamples(); SetupDivingKit(ref UpgradeBus.instance.UpgradeAssets); } private void SetupSamples() { foreach (string key in AssetBundleHandler.samplePaths.Keys) { Item itemObject = AssetBundleHandler.GetItemObject(key); SampleItem sampleItem = itemObject.spawnPrefab.AddComponent<SampleItem>(); ((GrabbableObject)sampleItem).grabbable = true; ((GrabbableObject)sampleItem).grabbableToEnemies = true; ((GrabbableObject)sampleItem).itemProperties = itemObject; NetworkPrefabs.RegisterNetworkPrefab(itemObject.spawnPrefab); UpgradeBus.instance.samplePrefabs.Add(key, itemObject.spawnPrefab); } } private void SetupTeleporterButtons() { itemBreak = AssetBundleHandler.GetAudioClip("Break"); error = AssetBundleHandler.GetAudioClip("Error"); buttonPressed = AssetBundleHandler.GetAudioClip("Button Press"); if (!((Object)(object)itemBreak == (Object)null) && !((Object)(object)error == (Object)null) && !((Object)(object)buttonPressed == (Object)null)) { SetupRegularTeleporterButton(); SetupAdvancedTeleporterButton(); } } private void SetupRegularTeleporterButton() { Item itemObject = AssetBundleHandler.GetItemObject("Portable Tele"); if (!((Object)(object)itemObject == (Object)null)) { itemObject.itemName = "Portable Tele"; itemObject.itemId = 492012; TPButtonScript tPButtonScript = itemObject.spawnPrefab.AddComponent<TPButtonScript>(); ((GrabbableObject)tPButtonScript).itemProperties = itemObject; ((GrabbableObject)tPButtonScript).grabbable = true; ((GrabbableObject)tPButtonScript).grabbableToEnemies = true; tPButtonScript.ItemBreak = itemBreak; ((GrabbableObject)tPButtonScript).useCooldown = 2f; tPButtonScript.error = error; tPButtonScript.buttonPress = buttonPressed; itemObject.creditsWorth = cfg.WEAK_TELE_PRICE; NetworkPrefabs.RegisterNetworkPrefab(itemObject.spawnPrefab); if (cfg.WEAK_TELE_ENABLED) { TerminalNode val = ScriptableObject.CreateInstance<TerminalNode>(); val.displayText = string.Format(AssetBundleHandler.GetInfoFromJSON("Portable Tele"), (int)(cfg.CHANCE_TO_BREAK * 100f)); Items.RegisterShopItem(itemObject, (TerminalNode)null, (TerminalNode)null, val, itemObject.creditsWorth); } } } private void SetupAdvancedTeleporterButton() { Item itemObject = AssetBundleHandler.GetItemObject("Advanced Portable Tele"); if (!((Object)(object)itemObject == (Object)null)) { itemObject.creditsWorth = cfg.ADVANCED_TELE_PRICE; itemObject.itemName = "Advanced Portable Tele"; itemObject.itemId = 492013; AdvTPButtonScript advTPButtonScript = itemObject.spawnPrefab.AddComponent<AdvTPButtonScript>(); ((GrabbableObject)advTPButtonScript).itemProperties = itemObject; ((GrabbableObject)advTPButtonScript).grabbable = true; ((GrabbableObject)advTPButtonScript).useCooldown = 2f; ((GrabbableObject)advTPButtonScript).grabbableToEnemies = true; advTPButtonScript.ItemBreak = itemBreak; advTPButtonScript.error = error; advTPButtonScript.buttonPress = buttonPressed; NetworkPrefabs.RegisterNetworkPrefab(itemObject.spawnPrefab); if (cfg.ADVANCED_TELE_ENABLED) { TerminalNode val = ScriptableObject.CreateInstance<TerminalNode>(); val.displayText = string.Format(AssetBundleHandler.GetInfoFromJSON("Advanced Portable Tele"), (int)(cfg.ADV_CHANCE_TO_BREAK * 100f)); Items.RegisterShopItem(itemObject, (TerminalNode)null, (TerminalNode)null, val, itemObject.creditsWorth); } } } private void SetupNightVision() { //IL_0048: Unknown result type (might be due to invalid IL or missing references) Item itemObject = AssetBundleHandler.GetItemObject("Night Vision"); if (!((Object)(object)itemObject == (Object)null)) { itemObject.creditsWorth = cfg.NIGHT_VISION_PRICE; itemObject.spawnPrefab.transform.localScale = new Vector3(0.3f, 0.3f, 0.3f); itemObject.itemId = 492014; NightVisionItemScript nightVisionItemScript = itemObject.spawnPrefab.AddComponent<NightVisionItemScript>(); ((GrabbableObject)nightVisionItemScript).itemProperties = itemObject; ((GrabbableObject)nightVisionItemScript).grabbable = true; ((GrabbableObject)nightVisionItemScript).useCooldown = 2f; ((GrabbableObject)nightVisionItemScript).grabbableToEnemies = true; NetworkPrefabs.RegisterNetworkPrefab(itemObject.spawnPrefab); if (cfg.NIGHT_VISION_ENABLED) { TerminalNode val = ScriptableObject.CreateInstance<TerminalNode>(); string arg = ((cfg.NIGHT_VISION_INDIVIDUAL || UpgradeBus.instance.cfg.SHARED_UPGRADES) ? "one" : "all"); string arg2 = (cfg.LOSE_NIGHT_VIS_ON_DEATH ? "be" : "not be"); val.displayText = string.Format(AssetBundleHandler.GetInfoFromJSON("Night Vision"), arg, arg2); Items.RegisterShopItem(itemObject, (TerminalNode)null, (TerminalNode)null, val, itemObject.creditsWorth); } } } private void SetupDivingKit(ref AssetBundle bundle) { Item val = AssetBundleHandler.TryLoadItemAsset(ref bundle, "Assets/ShipUpgrades/DivingKitItem.asset"); if (!((Object)(object)val == (Object)null)) { val.creditsWorth = cfg.DIVEKIT_PRICE; val.twoHanded = cfg.DIVEKIT_TWO_HANDED; val.weight = cfg.DIVEKIT_WEIGHT; val.itemSpawnsOnGround = true; DivingKitScript divingKitScript = val.spawnPrefab.AddComponent<DivingKitScript>(); ((GrabbableObject)divingKitScript).itemProperties = val; ((GrabbableObject)divingKitScript).grabbable = true; ((GrabbableObject)divingKitScript).grabbableToEnemies = true; NetworkPrefabs.RegisterNetworkPrefab(val.spawnPrefab); if (cfg.DIVEKIT_ENABLED) { TerminalNode val2 = ScriptableObject.CreateInstance<TerminalNode>(); string arg = (cfg.DIVEKIT_TWO_HANDED ? "two" : "one"); val2.displayText = $"DIVING KIT - ${cfg.DIVEKIT_PRICE}\n\nBreath underwater.\nWeights {Mathf.RoundToInt((val.weight - 1f) * 100f)} lbs and is {arg} handed.\n\n"; Items.RegisterShopItem(val, (TerminalNode)null, (TerminalNode)null, val2, val.creditsWorth); } } } private void SetupMedkit() { Item itemObject = AssetBundleHandler.GetItemObject("Medkit"); if (!((Object)(object)itemObject == (Object)null)) { itemObject.creditsWorth = cfg.MEDKIT_PRICE; itemObject.itemSpawnsOnGround = true; itemObject.itemId = 492016; MedkitScript medkitScript = itemObject.spawnPrefab.AddComponent<MedkitScript>(); ((GrabbableObject)medkitScript).itemProperties = itemObject; ((GrabbableObject)medkitScript).grabbable = true; ((GrabbableObject)medkitScript).useCooldown = 2f; ((GrabbableObject)medkitScript).grabbableToEnemies = true; medkitScript.error = error; medkitScript.use = buttonPressed; NetworkPrefabs.RegisterNetworkPrefab(itemObject.spawnPrefab); if (cfg.MEDKIT_ENABLED) { TerminalNode val = ScriptableObject.CreateInstance<TerminalNode>(); val.displayText = $"MEDKIT - ${cfg.MEDKIT_PRICE}\n\nLeft click to heal yourself for {cfg.MEDKIT_HEAL_VALUE} health.\nCan be used {cfg.MEDKIT_USES} times.\n"; Items.RegisterShopItem(itemObject, (TerminalNode)null, (TerminalNode)null, val, itemObject.creditsWorth); } } } private void SetupPeeper() { //IL_005f: Unknown result type (might be due to invalid IL or missing references) Item itemObject = AssetBundleHandler.GetItemObject("Peeper"); if (!((Object)(object)itemObject == (Object)null)) { itemObject.creditsWorth = cfg.PEEPER_PRICE; itemObject.twoHanded = false; itemObject.itemId = 492015; itemObject.twoHandedAnimation = false; itemObject.spawnPrefab.transform.localScale = new Vector3(0.3f, 0.3f, 0.3f); coilHeadItem coilHeadItem = itemObject.spawnPrefab.AddComponent<coilHeadItem>(); ((GrabbableObject)coilHeadItem).itemProperties = itemObject; ((GrabbableObject)coilHeadItem).grabbable = true; ((GrabbableObject)coilHeadItem).grabbableToEnemies = true; NetworkPrefabs.RegisterNetworkPrefab(itemObject.spawnPrefab); if (cfg.PEEPER_ENABLED) { TerminalNode val = ScriptableObject.CreateInstance<TerminalNode>(); val.displayText = "Looks at coil heads, don't lose it\n"; Items.RegisterShopItem(itemObject, (TerminalNode)null, (TerminalNode)null, val, itemObject.creditsWorth); } } } private void SetupPerks() { SetupBeekeeper(); SetupProteinPowder(); SetupBiggerLungs(); SetupRunningShoes(); SetupStrongLegs(); SetupMalwareBroadcaster(); SetupLightFooted(); SetupNightVisionBattery(); SetupDiscombobulator(); SetupBetterScanner(); SetupWalkieGPS(); SetupBackMuscles(); SetupInterns(); SetupPager(); SetupLightningRod(); SetupLocksmith(); SetupPlayerHealth(); SetupHunter(); } private void SetupBeekeeper() { SetupGenericPerk<beekeeperScript>("Beekeeper"); } private void SetupHunter() { SetupGenericPerk<hunterScript>("Hunter"); } private void SetupProteinPowder() { SetupGenericPerk<proteinPowderScript>(proteinPowderScript.UPGRADE_NAME); } private void SetupBiggerLungs() { SetupGenericPerk<biggerLungScript>("Bigger Lungs"); } private void SetupRunningShoes() { SetupGenericPerk<runningShoeScript>("Running Shoes"); } private void SetupStrongLegs() { SetupGenericPerk<strongLegsScript>("Strong Legs"); } private void SetupMalwareBroadcaster() { SetupGenericPerk<trapDestroyerScript>("Malware Broadcaster"); } private void SetupLightFooted() { SetupGenericPerk<lightFootedScript>("Light Footed"); } private void SetupNightVisionBattery() { SetupGenericPerk<nightVisionScript>("NV Headset Batteries"); } private void SetupDiscombobulator() { AudioClip audioClip = AssetBundleHandler.GetAudioClip("Flashbang"); if ((Object)(object)audioClip != (Object)null) { UpgradeBus.instance.flashNoise = audioClip; } SetupGenericPerk<terminalFlashScript>("Discombobulator"); } private void SetupBetterScanner() { SetupGenericPerk<strongerScannerScript>("Better Scanner"); } private void SetupWalkieGPS() { SetupGenericPerk<walkieScript>("Walkie GPS"); } private void SetupBackMuscles() { SetupGenericPerk<exoskeletonScript>("Back Muscles"); } private void SetupInterns() { SetupGenericPerk<defibScript>("Interns"); } private void SetupPager() { SetupGenericPerk<pagerScript>("Fast Encryption"); } private void SetupLightningRod() { SetupGenericPerk<lightningRodScript>(lightningRodScript.UPGRADE_NAME); } private void SetupLocksmith() { SetupGenericPerk<lockSmithScript>("Locksmith"); } private void SetupPlayerHealth() { SetupGenericPerk<playerHealthScript>(playerHealthScript.UPGRADE_NAME); } private void SetupGenericPerk<T>(string upgradeName) where T : Component { GameObject perkGameObject = AssetBundleHandler.GetPerkGameObject(upgradeName); if (Object.op_Implicit((Object)(object)perkGameObject)) { perkGameObject.AddComponent<T>(); NetworkPrefabs.RegisterNetworkPrefab(perkGameObject); } } } } namespace MoreShipUpgrades.UpgradeComponents { internal class AdvTPButtonScript : GrabbableObject { public AudioClip ItemBreak; public AudioClip error; public AudioClip buttonPress; private AudioSource audio; public override void Start() { ((GrabbableObject)this).Start(); audio = ((Component)this).GetComponent<AudioSource>(); } public override void DiscardItem() { base.playerHeldBy.activatingItem = false; ((GrabbableObject)this).DiscardItem(); } public override void ItemActivate(bool used, bool buttonDown = true) { ((GrabbableObject)this).ItemActivate(used, buttonDown); if (!Mouse.current.leftButton.isPressed) { return; } audio.PlayOneShot(buttonPress); if (!base.itemUsedUp) { ShipTeleporter[] array = Object.FindObjectsOfType<ShipTeleporter>(); ShipTeleporter val = null; ShipTeleporter[] array2 = array; foreach (ShipTeleporter val2 in array2) { if (!val2.isInverseTeleporter) { val = val2; break; } } if ((Object)(object)val == (Object)null) { audio.PlayOneShot(error); return; } int num = -1; for (int j = 0; j < StartOfRound.Instance.mapScreen.radarTargets.Count(); j++) { if ((Object)(object)((Component)StartOfRound.Instance.mapScreen.radarTargets[j].transform).gameObject.GetComponent<PlayerControllerB>() == (Object)(object)base.playerHeldBy) { num = j; } } if (num == -1) { StartOfRound.Instance.mapScreen.targetedPlayer = base.playerHeldBy; UpgradeBus.instance.TPButtonPressed = true; val.PressTeleportButtonOnLocalClient(); } else { StartOfRound.Instance.mapScreen.SwitchRadarTargetAndSync(num); ((MonoBehaviour)this).StartCoroutine(WaitToTP(val)); } } else { audio.PlayOneShot(error); } } private IEnumerator WaitToTP(ShipTeleporter tele) { yield return (object)new WaitForSeconds(0.15f); ReqUpdateTpDropStatusServerRpc(); tele.PressTeleportButtonOnLocalClient(); if (Random.Range(0f, 1f) < UpgradeBus.instance.cfg.ADV_CHANCE_TO_BREAK) { audio.PlayOneShot(ItemBreak); base.itemUsedUp = true; HUDManager.Instance.DisplayTip("TELEPORTER BROKE!", "The teleporter button has suffered irreparable damage and destroyed itself!", true, false, "LC_Tip1"); base.playerHeldBy.DespawnHeldObject(); } } [ServerRpc(RequireOwnership = false)] public void ReqUpdateTpDropStatusServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3988692149u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3988692149u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ChangeTPButtonPressedClientRpc(); } } } [ClientRpc] private void ChangeTPButtonPressedClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2793166939u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2793166939u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { UpgradeBus.instance.TPButtonPressed = true; } } } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_AdvTPButtonScript() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(3988692149u, new RpcReceiveHandler(__rpc_handler_3988692149)); NetworkManager.__rpc_func_table.Add(2793166939u, new RpcReceiveHandler(__rpc_handler_2793166939)); } private static void __rpc_handler_3988692149(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((AdvTPButtonScript)(object)target).ReqUpdateTpDropStatusServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2793166939(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)2; ((AdvTPButtonScript)(object)target).ChangeTPButtonPressedClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "AdvTPButtonScript"; } } internal class beekeeperScript : BaseUpgrade { private void Start() { Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject); Register(); } public override void Increment() { UpgradeBus.instance.beeLevel++; } public override void load() { UpgradeBus.instance.beekeeper = true; TextMeshProUGUI chatText = HUDManager.Instance.chatText; ((TMP_Text)chatText).text = ((TMP_Text)chatText).text + "\n<color=#FF0000>Beekeeper is active!</color>"; } public override void Register() { if (!UpgradeBus.instance.UpgradeObjects.ContainsKey("Beekeeper")) { UpgradeBus.instance.UpgradeObjects.Add("Beekeeper", ((Component)this).gameObject); } } public override void Unwind() { UpgradeBus.instance.beeLevel = 0; UpgradeBus.instance.beekeeper = false; TextMeshProUGUI chatText = HUDManager.Instance.chatText; ((TMP_Text)chatText).text = ((TMP_Text)chatText).text + "\n<color=#FF0000>Beekeeper has been disabled</color>"; } public static int CalculateBeeDamage(int damageNumber) { if (!UpgradeBus.instance.beekeeper) { return damageNumber; } return Mathf.Clamp((int)((float)damageNumber * (UpgradeBus.instance.cfg.BEEKEEPER_DAMAGE_MULTIPLIER - (float)UpgradeBus.instance.beeLevel * UpgradeBus.instance.cfg.BEEKEEPER_DAMAGE_MULTIPLIER_INCREMENT)), 0, damageNumber); } protected override void __initializeVariables() { base.__initializeVariables(); } protected internal override string __getTypeName() { return "beekeeperScript"; } } internal class biggerLungScript : BaseUpgrade { private void Start() { Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject); Register(); } public override void Increment() { UpgradeBus.instance.lungLevel++; PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; localPlayerController.sprintTime += UpgradeBus.instance.cfg.SPRINT_TIME_INCREMENT; } public override void load() { GameNetworkManager.Instance.localPlayerController.sprintTime = UpgradeBus.instance.cfg.SPRINT_TIME_INCREASE; UpgradeBus.instance.biggerLungs = true; TextMeshProUGUI chatText = HUDManager.Instance.chatText; ((TMP_Text)chatText).text = ((TMP_Text)chatText).text + "\n<color=#FF0000>Bigger Lungs is active!</color>"; float num = 0f; for (int i = 0; i < UpgradeBus.instance.lungLevel; i++) { num += UpgradeBus.instance.cfg.SPRINT_TIME_INCREMENT; } PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; localPlayerController.sprintTime += num; } public override void Unwind() { UpgradeBus.instance.biggerLungs = false; GameNetworkManager.Instance.localPlayerController.sprintTime = 11f; TextMeshProUGUI chatText = HUDManager.Instance.chatText; ((TMP_Text)chatText).text = ((TMP_Text)chatText).text + "\n<color=#FF0000>Bigger Lungs has been disabled.</color>"; } public override void Register() { if (!UpgradeBus.instance.UpgradeObjects.ContainsKey("Bigger Lungs")) { UpgradeBus.instance.UpgradeObjects.Add("Bigger Lungs", ((Component)this).gameObject); } } protected override void __initializeVariables() { base.__initializeVariables(); } protected internal override string __getTypeName() { return "biggerLungScript"; } } public class coilHeadItem : GrabbableObject { private bool Active; private bool audioInit; private Animator anim; public override void Start() { ((GrabbableObject)this).Start(); anim = ((Component)this).GetComponent<Animator>(); UpgradeBus.instance.coilHeadItems.Add(this); } public override void Update() { ((GrabbableObject)this).Update(); if (base.isHeld || base.isHeldByEnemy) { Active = false; anim.SetBool("Grounded", false); } else { Active = true; anim.SetBool("Grounded", true); } } public bool HasLineOfSightToPosition(Vector3 pos, int range = 60) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: 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) if (!Active) { return false; } float num = Vector3.Distance(((Component)this).transform.position, pos); return num < (float)range && !Physics.Linecast(((Component)this).transform.position, pos, StartOfRound.Instance.collidersRoomDefaultAndFoliage, (QueryTriggerInteraction)1); } public static bool HasLineOfSightToPeepers(Vector3 springPosition) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) foreach (coilHeadItem coilHeadItem in UpgradeBus.instance.coilHeadItems) { if ((Object)(object)coilHeadItem == (Object)null) { UpgradeBus.instance.coilHeadItems.Remove(coilHeadItem); } else if (coilHeadItem.HasLineOfSightToPosition(springPosition)) { return true; } } return false; } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected internal override string __getTypeName() { return "coilHeadItem"; } } public class defibScript : BaseUpgrade { private void Start() { Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject); Register(); UpgradeBus.instance.internScript = this; } public override void Register() { if (!UpgradeBus.instance.UpgradeObjects.ContainsKey("Interns")) { UpgradeBus.instance.UpgradeObjects.Add("Interns", ((Component)this).gameObject); } } [ServerRpc(RequireOwnership = false)] public void ReviveTargetedPlayerServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1556828106u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1556828106u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ReviveTargetedPlayerClientRpc(); Vector3 position = RoundManager.Instance.insideAINodes[Random.Range(0, RoundManager.Instance.insideAINodes.Length)].transform.position; position = RoundManager.Instance.GetRandomNavMeshPositionInRadiusSpherical(position, 10f, default(NavMeshHit)); NetworkBehaviourReference netRef = default(NetworkBehaviourReference); ((NetworkBehaviourReference)(ref netRef))..ctor((NetworkBehaviour)(object)StartOfRound.Instance.mapScreen.targetedPlayer); TelePlayerClientRpc(position, netRef); } } } [ClientRpc] private void TelePlayerClientRpc(Vector3 vector, NetworkBehaviourReference netRef) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(52528808u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref vector); ((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkBehaviourReference>(ref netRef, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 52528808u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { NetworkBehaviour val3 = default(NetworkBehaviour); ((NetworkBehaviourReference)(ref netRef)).TryGet(ref val3, (NetworkManager)null); if ((Object)(object)val3 != (Object)null) { ((Component)((Component)val3).transform).GetComponent<PlayerControllerB>().TeleportPlayer(vector, false, 0f, false, true); } } } [ClientRpc] private void ReviveTargetedPlayerClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1174848284u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1174848284u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } PlayerControllerB targetedPlayer = StartOfRound.Instance.mapScreen.targetedPlayer; int num = (UpgradeBus.instance.playerHPs.ContainsKey(targetedPlayer.playerSteamId) ? UpgradeBus.instance.playerHPs[targetedPlayer.playerSteamId] : 100); targetedPlayer.ResetPlayerBloodObjects(targetedPlayer.isPlayerDead); if (targetedPlayer.isPlayerDead || targetedPlayer.isPlayerControlled) { targetedPlayer.isClimbingLadder = false; targetedPlayer.ResetZAndXRotation(); ((Collider)targetedPlayer.thisController).enabled = true; targetedPlayer.health = num; targetedPlayer.disableLookInput = false; if (targetedPlayer.isPlayerDead) { targetedPlayer.isPlayerDead = false; targetedPlayer.isPlayerControlled = true; targetedPlayer.isInElevator = false; targetedPlayer.isInHangarShipRoom = false; targetedPlayer.isInsideFactory = true; targetedPlayer.wasInElevatorLastFrame = false; StartOfRound.Instance.SetPlayerObjectExtrapolate(false); targetedPlayer.setPositionOfDeadPlayer = false; ((Behaviour)targetedPlayer.helmetLight).enabled = false; targetedPlayer.Crouch(false); targetedPlayer.criticallyInjured = false; if ((Object)(object)targetedPlayer.playerBodyAnimator != (Object)null) { targetedPlayer.playerBodyAnimator.SetBool("Limp", false); } targetedPlayer.bleedingHeavily = false; targetedPlayer.activatingItem = false; targetedPlayer.twoHanded = false; targetedPlayer.inSpecialInteractAnimation = false; targetedPlayer.disableSyncInAnimation = false; targetedPlayer.inAnimationWithEnemy = null; targetedPlayer.holdingWalkieTalkie = false; targetedPlayer.speakingToWalkieTalkie = false; targetedPlayer.isSinking = false; targetedPlayer.isUnderwater = false; targetedPlayer.sinkingValue = 0f; targetedPlayer.statusEffectAudio.Stop(); targetedPlayer.DisableJetpackControlsLocally(); targetedPlayer.health = num; targetedPlayer.mapRadarDotAnimator.SetBool("dead", false); targetedPlayer.deadBody = null; if ((Object)(object)targetedPlayer == (Object)(object)GameNetworkManager.Instance.localPlayerController) { HUDManager.Instance.gasHelmetAnimator.SetBool("gasEmitting", false); targetedPlayer.hasBegunSpectating = false; HUDManager.Instance.RemoveSpectateUI(); HUDManager.Instance.gameOverAnimator.SetTrigger("revive"); targetedPlayer.hinderedMultiplier = 1f; targetedPlayer.isMovementHindered = 0; targetedPlayer.sourcesCausingSinking = 0; HUDManager.Instance.HideHUD(false); } } SoundManager.Instance.earsRingingTimer = 0f; targetedPlayer.voiceMuffledByEnemy = false; if ((Object)(object)targetedPlayer.currentVoiceChatIngameSettings == (Object)null) { StartOfRound.Instance.RefreshPlayerVoicePlaybackObjects(); } if ((Object)(object)targetedPlayer.currentVoiceChatIngameSettings != (Object)null) { if ((Object)(object)targetedPlayer.currentVoiceChatIngameSettings.voiceAudio == (Object)null) { targetedPlayer.currentVoiceChatIngameSettings.InitializeComponents(); } if ((Object)(object)targetedPlayer.currentVoiceChatIngameSettings.voiceAudio == (Object)null) { return; } ((Component)targetedPlayer.currentVoiceChatIngameSettings.voiceAudio).GetComponent<OccludeAudio>().overridingLowPass = false; } } StartOfRound instance = StartOfRound.Instance; instance.livingPlayers++; if ((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)(object)targetedPlayer) { targetedPlayer.bleedingHeavily = false; targetedPlayer.criticallyInjured = false; targetedPlayer.playerBodyAnimator.SetBool("Limp", false); targetedPlayer.health = num; HUDManager.Instance.UpdateHealthUI(num, false); targetedPlayer.spectatedPlayerScript = null; ((Behaviour)HUDManager.Instance.audioListenerLowPass).enabled = false; StartOfRound.Instance.SetSpectateCameraToGameOverMode(false, targetedPlayer); TimeOfDay.Instance.DisableAllWeather(false); StartOfRound.Instance.UpdatePlayerVoiceEffects(); ((Renderer)targetedPlayer.thisPlayerModel).enabled = true; } else { ((Renderer)targetedPlayer.thisPlayerModel).enabled = true; ((Renderer)targetedPlayer.thisPlayerModelLOD1).enabled = true; ((Renderer)targetedPlayer.thisPlayerModelLOD2).enabled = true; } } protected override void __initializeVariables() { base.__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_defibScript() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(1556828106u, new RpcReceiveHandler(__rpc_handler_1556828106)); NetworkManager.__rpc_func_table.Add(52528808u, new RpcReceiveHandler(__rpc_handler_52528808)); NetworkManager.__rpc_func_table.Add(1174848284u, new RpcReceiveHandler(__rpc_handler_1174848284)); } private static void __rpc_handler_1556828106(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((defibScript)(object)target).ReviveTargetedPlayerServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_52528808(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 vector = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref vector); NetworkBehaviourReference netRef = default(NetworkBehaviourReference); ((FastBufferReader)(ref reader)).ReadValueSafe<NetworkBehaviourReference>(ref netRef, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)2; ((defibScript)(object)target).TelePlayerClientRpc(vector, netRef); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1174848284(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)2; ((defibScript)(object)target).ReviveTargetedPlayerClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "defibScript"; } } internal class DivingKitScript : GrabbableObject { public override void Update() { if ((Object)(object)base.playerHeldBy != (Object)null && (Object)(object)base.playerHeldBy == (Object)(object)GameNetworkManager.Instance.localPlayerController) { StartOfRound.Instance.drowningTimer = 1f; } ((GrabbableObject)this).Update(); } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected internal override string __getTypeName() { return "DivingKitScript"; } } internal class exoskeletonScript : BaseUpgrade { private void Start() { Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject); Register(); } public override void Increment() { UpgradeBus.instance.backLevel++; UpdatePlayerWeight(); } public override void load() { UpgradeBus.instance.exoskeleton = true; TextMeshProUGUI chatText = HUDManager.Instance.chatText; ((TMP_Text)chatText).text = ((TMP_Text)chatText).text + "\n<color=#FF0000>Back Muscles is active!</color>"; UpdatePlayerWeight(); } public override void Unwind() { UpgradeBus.instance.exoskeleton = false; UpgradeBus.instance.backLevel = 0; TextMeshProUGUI chatText = HUDManager.Instance.chatText; ((TMP_Text)chatText).text = ((TMP_Text)chatText).text + "\n<color=#FF0000>Back Muscles has been disabled.</color>"; UpdatePlayerWeight(); } public override void Register() { if (!UpgradeBus.instance.UpgradeObjects.ContainsKey("Back Muscles")) { UpgradeBus.instance.UpgradeObjects.Add("Back Muscles", ((Component)this).gameObject); } } public static float CalculateWeight(float desiredValue, float minimumValue, float maximumValue) { float num = Mathf.Clamp(desiredValue, minimumValue, maximumValue); if (!UpgradeBus.instance.exoskeleton) { return num; } return num * (UpgradeBus.instance.cfg.CARRY_WEIGHT_REDUCTION - (float)UpgradeBus.instance.backLevel * UpgradeBus.instance.cfg.CARRY_WEIGHT_INCREMENT); } public static void UpdatePlayerWeight() { PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if (!UpgradeBus.instance.exoskeleton || localPlayerController.ItemSlots.Length == 0) { return; } UpgradeBus.instance.alteredWeight = 1f; for (int i = 0; i < localPlayerController.ItemSlots.Length; i++) { GrabbableObject val = localPlayerController.ItemSlots[i]; if ((Object)(object)val != (Object)null) { UpgradeBus.instance.alteredWeight += CalculateWeight(val.itemProperties.weight - 1f, 0f, 10f); } } localPlayerController.carryWeight = UpgradeBus.instance.alteredWeight; if (localPlayerController.carryWeight < 1f) { localPlayerController.carryWeight = 1f; } } protected override void __initializeVariables() { base.__initializeVariables(); } protected internal override string __getTypeName() { return "exoskeletonScript"; } } internal class hunterScript : BaseUpgrade { private static string[] lvl1 = new string[2] { "Hoarding bug", "Centipede" }; private static string[] lvl2 = new string[4] { "Bunker Spider", "Hoarding bug", "Centipede", "Baboon Hawk" }; private static string[] lvl3 = new string[7] { "Bunker Spider", "Hoarding bug", "Centipede", "Baboon Hawk", "Flowerman", "Crawler", "MouthDog" }; private static Dictionary<string, string> monsterNames = new Dictionary<string, string> { { "Hoarding bug", "Hoarding Bug" }, { "Centipede", "Snare Flea" }, { "Bunker Spider", "Bunker Spider" }, { "Baboon Hawk", "Baboon Hawk" }, { "Flowerman", "Bracken" }, { "Crawler", "Half/Thumper" }, { "MouthDog", "Eyeless Dog" } }; public static Dictionary<int, string[]> tiers = new Dictionary<int, string[]> { { 0, lvl1 }, { 1, lvl2 }, { 2, lvl3 } }; private void Start() { Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject); Register(); } public override void Increment() { UpgradeBus.instance.huntLevel++; } public override void load() { UpgradeBus.instance.hunter = true; TextMeshProUGUI chatText = HUDManager.Instance.chatText; ((TMP_Text)chatText).text = ((TMP_Text)chatText).text + "\n<color=#FF0000>Hunter is active!</color>"; } public override void Unwind() { UpgradeBus.instance.hunter = false; UpgradeBus.instance.huntLevel = 0; TextMeshProUGUI chatText = HUDManager.Instance.chatText; ((TMP_Text)chatText).text = ((TMP_Text)chatText).text + "\n<color=#FF0000>Hunter has been disabled.</color>"; } public override void Register() { if (!UpgradeBus.instance.UpgradeObjects.ContainsKey("Hunter")) { UpgradeBus.instance.UpgradeObjects.Add("Hunter", ((Component)this).gameObject); } } public static string GetHunterInfo(int level, int price) { string text = ((level == 1) ? string.Join(", ", tiers[level - 1]) : string.Join(", ", tiers[level - 1].Except(tiers[level - 2]).ToArray())); string text2 = ""; string[] array = text.Split(", "); foreach (string key in array) { text2 = text2 + monsterNames[key] + ", "; } text2 = text2.Substring(0, text2.Length - 2); text2 += "\n"; return string.Format(AssetBundleHandler.GetInfoFromJSON("Hunter"), level, price, text2); } protected override void __initializeVariables() { base.__initializeVariables(); } protected internal override string __getTypeName() { return "hunterScript"; } } internal class lightFootedScript : BaseUpgrade { private void Start() { Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject); Register(); } public override void Increment() { UpgradeBus.instance.lightLevel++; } public override void load() { UpgradeBus.instance.softSteps = true; TextMeshProUGUI chatText = HUDManager.Instance.chatText; ((TMP_Text)chatText).text = ((TMP_Text)chatText).text + "\n<color=#FF0000>Light Footed is active!</color>"; } public override void Unwind() { UpgradeBus.instance.softSteps = false; UpgradeBus.instance.lightLevel = 0; TextMeshProUGUI chatText = HUDManager.Instance.chatText; ((TMP_Text)chatText).text = ((TMP_Text)chatText).text + "\n<color=#FF0000>Light Footed has been disabled.</color>"; } public override void Register() { if (!UpgradeBus.instance.UpgradeObjects.ContainsKey("Light Footed")) { UpgradeBus.instance.UpgradeObjects.Add("Light Footed", ((Component)this).gameObject); } } protected override void __initializeVariables() { base.__initializeVariables(); } protected internal override string __getTypeName() { return "lightFootedScript"; } } internal class lightningRodScript : BaseUpgrade { public static string UPGRADE_NAME = "Lightning Rod"; public static lightningRodScript instance; public static string ENABLED_SECTION = $"Enable {UPGRADE_NAME} Upgrade"; public static bool ENABLED_DEFAULT = true; public static string ENABLED_DESCRIPTION = "A device which redirects lightning bolts to the ship."; public static string PRICE_SECTION = $"{UPGRADE_NAME} Price"; public static int PRICE_DEFAULT = 1000; public static string ACTIVE_SECTION = "Active on Purchase"; public static bool ACTIVE_DEFAULT = true; public static string ACTIVE_DESCRIPTION = $"If true: {UPGRADE_NAME} will be active on purchase."; private static string LOAD_COLOUR = "#FF0000"; private static string LOAD_MESSAGE = $"\n<color={LOAD_COLOUR}>{UPGRADE_NAME} is active!</color>"; private static string UNLOAD_COLOUR = LOAD_COLOUR; private static string UNLOAD_MESSAGE = $"\n<color={UNLOAD_COLOUR}>{UPGRADE_NAME} has been disabled</color>"; private static string ACCESS_DENIED_MESSAGE = $"You don't have access to this command yet. Purchase the '{UPGRADE_NAME}'.\n"; private static string TOGGLE_ON_MESSAGE = $"{UPGRADE_NAME} has been enabled. Lightning bolts will now be redirected to the ship.\n"; private static string TOGGLE_OFF_MESSAGE = $"{UPGRADE_NAME} has been disabled. Lightning bolts will no longer be redirected to the ship.\n"; public static string DIST_SECTION = "Effective Distance of lightning rod."; public static float DIST_DEFAULT = 175f; public static string DIST_DESCRIPTION = string.Format("The closer you are the more likely the rod will reroute lightning.", UPGRADE_NAME); public bool CanTryInterceptLightning { get; internal set; } public bool LightningIntercepted { get; internal set; } private void Awake() { instance = this; } private void Start() { Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject); UpgradeBus.instance.UpgradeObjects.Add(UPGRADE_NAME, ((Component)this).gameObject); } public override void Increment() { } public override void load() { UpgradeBus.instance.lightningRod = true; UpgradeBus.instance.lightningRodActive = UpgradeBus.instance.cfg.LIGHTNING_ROD_ACTIVE; TextMeshProUGUI chatText = HUDManager.Instance.chatText; ((TMP_Text)chatText).text = ((TMP_Text)chatText).text + LOAD_MESSAGE; } public override void Register() { if (!UpgradeBus.instance.UpgradeObjects.ContainsKey(UPGRADE_NAME)) { UpgradeBus.instance.UpgradeObjects.Add(UPGRADE_NAME, ((Component)this).gameObject); } } public override void Unwind() { UpgradeBus.instance.lightningRod = false; UpgradeBus.instance.lightningRodActive = false; TextMeshProUGUI chatText = HUDManager.Instance.chatText; ((TMP_Text)chatText).text = ((TMP_Text)chatText).text + UNLOAD_MESSAGE; } public static void TryInterceptLightning(ref StormyWeather __instance, ref GrabbableObject ___targetingMetalObject) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) if (!instance.CanTryInterceptLightning) { return; } instance.CanTryInterceptLightning = false; Terminal terminal = UpgradeBus.instance.GetTerminal(); float num = Vector3.Distance(((Component)___targetingMetalObject).transform.position, ((Component)terminal).transform.position); Plugin.mls.LogInfo((object)$"[{UPGRADE_NAME}] Distance from ship: {num}\n"); Plugin.mls.LogInfo((object)$"[{UPGRADE_NAME}] Effective distance of the lightning rod: {UpgradeBus.instance.cfg.LIGHTNING_ROD_DIST}"); if (!(num > UpgradeBus.instance.cfg.LIGHTNING_ROD_DIST)) { num /= UpgradeBus.instance.cfg.LIGHTNING_ROD_DIST; float num2 = 1f - num; float value = Random.value; Plugin.mls.LogInfo((object)$"[{UPGRADE_NAME}] Number to beat: {num2}"); Plugin.mls.LogInfo((object)$"[{UPGRADE_NAME}] Number: {value}"); if (value < num2) { Plugin.mls.LogInfo((object)$"[{UPGRADE_NAME}] Planning interception..."); __instance.staticElectricityParticle.Stop(); instance.LightningIntercepted = true; LGUStore.instance.CoordinateInterceptionClientRpc(); } } } public static void RerouteLightningBolt(ref Vector3 strikePosition, ref StormyWeather __instance) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) Plugin.mls.LogInfo((object)$"[{UPGRADE_NAME}] Intercepted Lightning Strike..."); Terminal terminal = UpgradeBus.instance.GetTerminal(); strikePosition = ((Component)terminal).transform.position; instance.LightningIntercepted = false; ((Component)__instance.staticElectricityParticle).gameObject.SetActive(true); } public static void ToggleLightningRod(ref TerminalNode __result) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected O, but got Unknown UpgradeBus.instance.lightningRodActive = !UpgradeBus.instance.lightningRodActive; TerminalNode val = new TerminalNode(); val.displayText = (UpgradeBus.instance.lightningRodActive ? TOGGLE_ON_MESSAGE : TOGGLE_OFF_MESSAGE); val.clearPreviousText = true; __result = val; } public static void AccessDeniedMessage(ref TerminalNode __result) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown TerminalNode val = new TerminalNode(); val.displayText = ACCESS_DENIED_MESSAGE; val.clearPreviousText = true; __result = val; } protected override void __initializeVariables() { base.__initializeVariables(); } protected internal override string __getTypeName() { return "lightningRodScript"; } } public class lockSmithScript : BaseUpgrade { private GameObject pin1; private GameObject pin2; private GameObject pin3; private GameObject pin4; private GameObject pin5; private List<GameObject> pins; private List<int> order = new List<int> { 0, 1, 2, 3, 4 }; private int currentPin = 0; public DoorLock currentDoor = null; private bool canPick = false; public int timesStruck; private void Start() { //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Expected O, but got Unknown //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Expected O, but got Unknown //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Expected O, but got Unknown //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Expected O, but got Unknown Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject); Register(); Transform child = ((Component)this).transform.GetChild(0).GetChild(0).GetChild(0); pin1 = ((Component)child.GetChild(0)).gameObject; pin2 = ((Component)child.GetChild(1)).gameObject; pin3 = ((Component)child.GetChild(2)).gameObject; pin4 = ((Component)child.GetChild(3)).gameObject; pin5 = ((Component)child.GetChild(4)).gameObject; ((UnityEvent)((Component)pin1.transform.GetChild(0)).GetComponent<Button>().onClick).AddListener((UnityAction)delegate { StrikePin(0); }); ((UnityEvent)((Component)pin2.transform.GetChild(0)).GetComponent<Button>().onClick).AddListener((UnityAction)delegate { StrikePin(1); }); ((UnityEvent)((Component)pin3.transform.GetChild(0)).GetComponent<Button>().onClick).AddListener((UnityAction)delegate { StrikePin(2); }); ((UnityEvent)((Component)pin4.transform.GetChild(0)).GetComponent<Button>().onClick).AddListener((UnityAction)delegate { StrikePin(3); }); ((UnityEvent)((Component)pin5.transform.GetChild(0)).GetComponent<Button>().onClick).AddListener((UnityAction)delegate { StrikePin(4); }); pins = new List<GameObject> { pin1, pin2, pin3, pin4, pin5 }; } public override void load() { UpgradeBus.instance.lockSmith = true; UpgradeBus.instance.lockScript = this; TextMeshProUGUI chatText = HUDManager.Instance.chatText; ((TMP_Text)chatText).text = ((TMP_Text)chatText).text + "\n<color=#FF0000>Locksmith is active!</color>"; } public override void Register() { if (!UpgradeBus.instance.UpgradeObjects.ContainsKey("Locksmith")) { UpgradeBus.instance.UpgradeObjects.Add("Locksmith", ((Component)this).gameObject); } } private void Update() { if (((ButtonControl)Keyboard.current[(Key)60]).wasPressedThisFrame && ((Component)((Component)this).transform.GetChild(0)).gameObject.activeInHierarchy) { ((Component)((Component)this).transform.GetChild(0)).gameObject.SetActive(false); Cursor.visible = false; Cursor.lockState = (CursorLockMode)1; } } public void BeginLockPick() { //IL_006c: 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_0092: Unknown result type (might be due to invalid IL or missing references) ((Component)((Component)this).transform.GetChild(0)).gameObject.SetActive(true); Cursor.visible = true; Cursor.lockState = (CursorLockMode)0; canPick = false; currentPin = 0; for (int i = 0; i < pins.Count; i++) { float num = Random.Range(40f, 90f); pins[i].transform.localPosition = new Vector3(pins[i].transform.localPosition.x, num, pins[i].transform.localPosition.z); } RandomizeListOrder(order); ((MonoBehaviour)this).StartCoroutine(CommunicateOrder(order)); } public override void Unwind() { UpgradeBus.instance.lockSmith = false; TextMeshProUGUI chatText = HUDManager.Instance.chatText; ((TMP_Text)chatText).text = ((TMP_Text)chatText).text + "\n<color=#FF0000>Locksmith has been disabled.</color>"; } public void StrikePin(int i) { //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0098: 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) if (!canPick) { return; } timesStruck++; if (i == order[currentPin]) { currentPin++; pins[i].transform.localPosition = new Vector3(pins[i].transform.localPosition.x, 35f, pins[i].transform.localPosition.z); if (currentPin == 5) { Cursor.visible = false; Cursor.lockState = (CursorLockMode)1; ((Component)((Component)this).transform.GetChild(0)).gameObject.SetActive(false); currentDoor.UnlockDoorSyncWithServer(); } RoundManager.Instance.PlayAudibleNoise(((Component)currentDoor).transform.position, 10f, 0.65f, timesStruck, false, 0); } else { BeginLockPick(); RoundManager.Instance.PlayAudibleNoise(((Component)currentDoor).transform.position, 30f, 0.65f, timesStruck, false, 0); } } private void RandomizeListOrder<T>(List<T> list) { int num = list.Count; Random random = new Random(); while (num > 1) { num--; int index = random.Next(num + 1); T value = list[index]; list[index] = list[num]; list[num] = value; } } private IEnumerator CommunicateOrder(List<int> lst) { yield return (object)new WaitForSeconds(0.75f); for (int i = 0; i < lst.Count; i++) { ((Graphic)pins[lst[i]].GetComponent<Image>()).color = Color.green; yield return (object)new WaitForSeconds(0.25f); ((Graphic)pins[lst[i]].GetComponent<Image>()).color = Color.white; } canPick = true; } protected override void __initializeVariables() { base.__initializeVariables(); } protected internal override string __getTypeName() { return "lockSmithScript"; } } internal class MedkitScript : GrabbableObject { public AudioClip error; public AudioClip use; private AudioSource audio; private int uses = 0; public override void Start() { audio = ((Component)this).GetComponent<AudioSource>(); ((GrabbableObject)this).Start(); } public override void DiscardItem() { base.playerHeldBy.activatingItem = false; ((GrabbableObject)this).DiscardItem(); } public override void ItemActivate(bool used, bool buttonDown = true) { //IL_0122: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).ItemActivate(used, buttonDown); if (base.itemUsedUp) { HUDManager.Instance.DisplayTip("NO MORE USES!", "This medkit doesn't have anymore supplies!", true, false, "LC_Tip1"); } else { if (!Mouse.current.leftButton.isPressed) { return; } int num = (UpgradeBus.instance.playerHPs.ContainsKey(base.playerHeldBy.playerSteamId) ? UpgradeBus.instance.playerHPs[base.playerHeldBy.playerSteamId] : 100); if (base.playerHeldBy.health >= num) { audio.PlayOneShot(error); Debug.Log((object)"LGU: Can't use medkit - full health"); return; } audio.PlayOneShot(use); uses++; int num2 = UpgradeBus.instance.cfg.MEDKIT_HEAL_VALUE; int num3 = base.playerHeldBy.health + num2; if (num3 > num) { num2 -= num3 - num; } base.playerHeldBy.DamagePlayer(-num2, false, true, (CauseOfDeath)0, 0, false, Vector3.zero); if (uses >= UpgradeBus.instance.cfg.MEDKIT_USES) { base.itemUsedUp = true; HUDManager.Instance.DisplayTip("NO MORE USES!", "This medkit doesn't have anymore supplies!", true, false, "LC_Tip1"); } if (base.playerHeldBy.health >= 20) { base.playerHeldBy.MakeCriticallyInjured(false); } } } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected internal override string __getTypeName() { return "MedkitScript"; } } internal class NightVisionItemScript : GrabbableObject { public override void DiscardItem() { base.playerHeldBy.activatingItem = false; ((GrabbableObject)this).DiscardItem(); } public override void ItemActivate(bool used, bool buttonDown = true) { ((GrabbableObject)this).ItemActivate(used, buttonDown); if (!Mouse.current.leftButton.isPressed) { return; } if (UpgradeBus.instance.nightVision) { TextMeshProUGUI chatText = HUDManager.Instance.chatText; ((TMP_Text)chatText).text = ((TMP_Text)chatText).text + "<color=#FF0000>Night vision is already active!</color>"; return; } if (!UpgradeBus.instance.IndividualUpgrades["NV Headset Batteries"]) { LGUStore.instance.EnableNightVisionServerRpc(); } else { UpgradeBus.instance.UpgradeObjects["NV Headset Batteries"].GetComponent<nightVisionScript>().EnableOnClient(); } base.playerHeldBy.DespawnHeldObject(); } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected internal override string __getTypeName() { return "NightVisionItemScript"; } } internal class nightVisionScript : BaseUpgrade { private float nightBattery; private float regen; private float drain; private Transform batteryBar; private PlayerControllerB client; private bool batteryExhaustion; private Key toggleKey; private void Start() { //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject); Register(); batteryBar = ((Component)((Component)this).transform.GetChild(0).GetChild(0)).transform; ((Component)((Component)this).transform.GetChild(0)).gameObject.SetActive(false); if (Enum.TryParse<Key>(UpgradeBus.instance.cfg.TOGGLE_NIGHT_VISION_KEY, out Key result)) { toggleKey = result; } else { toggleKey = (Key)53; } regen = UpgradeBus.instance.cfg.NIGHT_VIS_REGEN_SPEED; drain = UpgradeBus.instance.cfg.NIGHT_VIS_DRAIN_SPEED; } public override void Register() { if (!UpgradeBus.instance.UpgradeObjects.ContainsKey("NV Headset Batteries")) { UpgradeBus.instance.UpgradeObjects.Add("NV Headset Batteries", ((Component)this).gameObject); } } private void LateUpdate() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)client == (Object)null) { return; } if (((ButtonControl)Keyboard.current[toggleKey]).wasPressedThisFrame && !batteryExhaustion) { Toggle(); } float num = UpgradeBus.instance.cfg.NIGHT_BATTERY_MAX + (float)UpgradeBus.instance.nightVisionLevel * UpgradeBus.instance.cfg.NIGHT_VIS_BATTERY_INCREMENT; if (UpgradeBus.instance.nightVisionActive) { nightBattery -= Time.deltaTime * (UpgradeBus.instance.cfg.NIGHT_VIS_DRAIN_SPEED - (float)UpgradeBus.instance.nightVisionLevel * UpgradeBus.instance.cfg.NIGHT_VIS_DRAIN_INCREMENT); nightBattery = Mathf.Clamp(nightBattery, 0f, num); ((Component)batteryBar.parent).gameObject.SetActive(true); if (nightBattery <= 0f) { TurnOff(exhaust: true); } } else if (!batteryExhaustion) { nightBattery += Time.deltaTime * (UpgradeBus.instance.cfg.NIGHT_VIS_REGEN_SPEED + (float)UpgradeBus.instance.nightVisionLevel * UpgradeBus.instance.cfg.NIGHT_VIS_REGEN_INCREMENT); nightBattery = Mathf.Clamp(nightBattery, 0f, num); if (nightBattery >= num) { ((Component)batteryBar.parent).gameObject.SetActive(false); } else { ((Component)batteryBar.parent).gameObject.SetActive(true); } } if (client.isInsideFactory || UpgradeBus.instance.nightVisionActive) { ((Behaviour)client.nightVision).enabled = true; } else { ((Behaviour)client.nightVision).enabled = false; } float num2 = nightBattery / num; batteryBar.localScale = new Vector3(num2, 1f, 1f); } private void Toggle() { UpgradeBus.instance.nightVisionActive = !UpgradeBus.instance.nightVisionActive; if (UpgradeBus.instance.nightVisionActive) { TurnOn(); } else { TurnOff(); } regen = UpgradeBus.instance.cfg.NIGHT_VIS_REGEN_SPEED; drain = UpgradeBus.instance.cfg.NIGHT_VIS_DRAIN_SPEED; } private void TurnOff(bool exhaust = false) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) UpgradeBus.instance.nightVisionActive = false; client.nightVision.color = UpgradeBus.instance.nightVisColor; client.nightVision.range = UpgradeBus.instance.nightVisRange + (float)UpgradeBus.instance.nightVisionLevel * UpgradeBus.instance.cfg.NIGHT_VIS_RANGE_INCREMENT; client.nightVision.intensity = UpgradeBus.instance.nightVisIntensity + (float)UpgradeBus.instance.nightVisionLevel * UpgradeBus.instance.cfg.NIGHT_VIS_INTENSITY_INCREMENT; if (exhaust) { batteryExhaustion = true; ((MonoBehaviour)this).StartCoroutine(BatteryRecovery()); } } private void TurnOn() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) UpgradeBus.instance.nightVisColor = client.nightVision.color; UpgradeBus.instance.nightVisRange = client.nightVision.range; UpgradeBus.instance.nightVisIntensity = client.nightVision.intensity; client.nightVision.color = UpgradeBus.instance.cfg.NIGHT_VIS_COLOR; client.nightVision.range = UpgradeBus.instance.cfg.NIGHT_VIS_RANGE; client.nightVision.intensity = UpgradeBus.instance.cfg.NIGHT_VIS_INTENSITY; nightBattery -= UpgradeBus.instance.cfg.NIGHT_VIS_STARTUP; } private IEnumerator BatteryRecovery() { yield return (object)new WaitForSeconds(UpgradeBus.instance.cfg.NIGHT_VIS_EXHAUST); batteryExhaustion = false; } public override void Increment() { UpgradeBus.instance.nightVisionLevel++; LGUStore.instance.UpdateLGUSaveServerRpc(GameNetworkManager.Instance.localPlayerController.playerSteamId, JsonConvert.SerializeObject((object)new SaveInfo())); } public override void load() { EnableOnClient(save: false); } public override void Unwind() { UpgradeBus.instance.nightVision = false; UpgradeBus.instance.nightVisionLevel = 0; DisableOnClient(); TextMeshProUGUI chatText = HUDManager.Instance.chatText; ((TMP_Text)chatText).text = ((TMP_Text)chatText).text + "\n<color=#FF0000>NV Headset Batteries has been disabled.</color>"; } public void EnableOnClient(bool save = true) { if ((Object)(object)client == (Object)null) { client = GameNetworkManager.Instance.localPlayerController; } ((Component)((Component)this).transform.GetChild(0)).gameObject.SetActive(true); UpgradeBus.instance.nightVision = true; if (save) { LGUStore.instance.UpdateLGUSaveServerRpc(client.playerSteamId, JsonConvert.SerializeObject((object)new SaveInfo())); } TextMeshProUGUI chatText = HUDManager.Instance.chatText; ((TMP_Text)chatText).text = ((TMP_Text)chatText).text + "\n<color=#FF0000>Press " + UpgradeBus.instance.cfg.TOGGLE_NIGHT_VISION_KEY + " to toggle Night Vision!!!</color>"; } public void DisableOnClient() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) UpgradeBus.instance.nightVisionActive = false; client.nightVision.color = UpgradeBus.instance.nightVisColor; client.nightVision.range = UpgradeBus.instance.nightVisRange; client.nightVision.intensity = UpgradeBus.instance.nightVisIntensity; ((Component)((Component)this).transform.GetChild(0)).gameObject.SetActive(false); UpgradeBus.instance.nightVision = false; LGUStore.instance.UpdateLGUSaveServerRpc(client.playerSteamId, JsonConvert.SerializeObject((object)new SaveInfo())); client = null; } public static string GetNightVisionInfo(int level, int price) { if (level == 1) { float num = (UpgradeBus.instance.cfg.NIGHT_BATTERY_MAX - UpgradeBus.instance.cfg.NIGHT_BATTERY_MAX * UpgradeBus.instance.cfg.NIGHT_VIS_STARTUP) / UpgradeBus.instance.cfg.NIGHT_VIS_DRAIN_SPEED; float num2 = UpgradeBus.instance.cfg.NIGHT_BATTERY_MAX / UpgradeBus.instance.cfg.NIGHT_VIS_REGEN_SPEED; return string.Format(AssetBundleHandler.GetInfoFromJSON("NV Headset Batteries"), level, price, num, num2); } float num3 = Mathf.Clamp(UpgradeBus.instance.cfg.NIGHT_VIS_REGEN_SPEED + UpgradeBus.instance.cfg.NIGHT_VIS_REGEN_INCREMENT * (float)(level - 1), 0f, 1000f); float num4 = Mathf.Clamp(UpgradeBus.instance.cfg.NIGHT_VIS_DRAIN_SPEED - UpgradeBus.instance.cfg.NIGHT_VIS_DRAIN_INCREMENT * (float)(level - 1), 0f, 1000f); float num5 = UpgradeBus.instance.cfg.NIGHT_BATTERY_MAX + UpgradeBus.instance.cfg.NIGHT_VIS_BATTERY_INCREMENT * (float)(level - 1); string text = "infinite"; if (num4 != 0f) { text = ((num5 - num5 * UpgradeBus.instance.cfg.NIGHT_VIS_STARTUP) / num4).ToString("F2"); } string text2 = "infinite"; if (num3 != 0f) { text2 = (num5 / num3).ToString("F2"); } return string.Format(AssetBundleHandler.GetInfoFromJSON("NV Headset Batteries"), level, price, text, text2); } protected override void __initializeVariables() { base.__initializeVariables(); } protected internal override string __getTypeName() { return "nightVisionScript"; } } public class pagerScript : BaseUpgrade { private void Start() { Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject); Register(); } public override void load() { UpgradeBus.instance.pager = true; UpgradeBus.instance.pageScript = this; TextMeshProUGUI chatText = HUDManager.Instance.chatText; ((TMP_Text)chatText).text = ((TMP_Text)chatText).text + "\n<color=#FF0000>Fast Encryption is active!</color>"; } public override void Register() { if (!UpgradeBus.instance.UpgradeObjects.ContainsKey("Fast Encryption")) { UpgradeBus.instance.UpgradeObjects.Add("Fast Encryption", ((Component)this).gameObject); } } [ServerRpc(RequireOwnership = false)] public void ReqBroadcastChatServerRpc(string msg) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(797180313u, val, (RpcDelivery)0); bool flag = msg != null; ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(msg, false); } ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 797180313u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ReceiveChatClientRpc(msg); } } [ClientRpc] public void ReceiveChatClientRpc(string msg) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(58640511u, val, (RpcDelivery)0); bool flag = msg != null; ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(msg, false); } ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 58640511u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { SignalTranslator val3 = Object.FindObjectOfType<SignalTranslator>(); if ((Object)(object)val3 != (Object)null) { HUDManager.Instance.UIAudio.PlayOneShot(val3.startTransmissionSFX); } TextMeshProUGUI chatText = HUDManager.Instance.chatText; ((TMP_Text)chatText).text = ((TMP_Text)chatText).text + "\n<color=#FF0000>Terminal</color><color=#0000FF>:</color> <color=#FF00FF>" + msg + "</color>"; HUDManager.Instance.PingHUDElement(HUDManager.Instance.Chat, 4f, 1f, 0.2f); } } protected override void __initializeVariables() { base.__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_pagerScript() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(797180313u, new RpcReceiveHandler(__rpc_handler_797180313)); NetworkManager.__rpc_func_table.Add(58640511u, new RpcReceiveHandler(__rpc_handler_58640511)); } private static void __rpc_handler_797180313(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: 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_007b: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives)); string msg = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref msg, false); } target.__rpc_exec_stage = (__RpcExecStage)1; ((pagerScript)(object)target).ReqBroadcastChatServerRpc(msg); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_58640511(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: 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_007b: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives)); string msg = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref msg, false); } target.__rpc_exec_stage = (__RpcExecStage)2; ((pagerScript)(object)target).ReceiveChatClientRpc(msg); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "pagerScript"; } } internal class playerHealthScript : BaseUpgrade { public static string UPGRADE_NAME = "Stimpack"; private static int DEFAULT_HEALTH = 100; public static string ENABLED_SECTION = $"Enable {UPGRADE_NAME} Upgrade"; public static bool ENABLED_DEFAULT = true; public static string ENABLED_DESCRIPTION = "Increases player's health."; public static string PRICE_SECTION = $"{UPGRADE_NAME} Price"; public static int PRICE_DEFAULT = 600; public static string INDIVIDUAL_SECTION = "Individual Purchase"; public static bool INDIVIDUAL_DEFAULT = false; public static string INDIVIDUAL_DESCRIPTION = "If true: upgrade will apply only to the client that purchased it."; private static string LOAD_COLOUR = "#FF0000"; private static string LOAD_MESSAGE = $"\n<color={LOAD_COLOUR}>{UPGRADE_NAME} is active!</color>"; private static string UNLOAD_COLOUR = LOAD_COLOUR; private static string UNLOAD_MESSAGE = $"\n<color={UNLOAD_COLOUR}>{UPGRADE_NAME} has been disabled</color>"; public static string UPGRADE_PRICES_SECTION = "Price of each additional upgrade"; public static string UPGRADE_PRICES_DEFAULT = "300, 450, 600"; public static string ADDITIONAL_HEALTH_UNLOCK_SECTION = "Initial health boost"; public static int ADDITIONAL_HEALTH_UNLOCK_DEFAULT = 20; public static string ADDITIONAL_HEALTH_UNLOCK_DESCRIPTION = "Amount of health gained when unlocking the upgrade"; public static string ADDITIONAL_HEALTH_INCREMENT_SECTION = "Additional health boost"; public static int ADDITIONAL_HEALTH_INCREMENT_DEFAULT = 20; public static string ADDITIONAL_HEALTH_INCREMENT_DESCRIPTION = $"Every time {UPGRADE_NAME} is upgraded this value will be added to the value above."; private void Start() { Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject); UpgradeBus.instance.UpgradeObjects.Add(UPGRADE_NAME, ((Component)this).gameObject); } public override void Increment() { UpgradeBus.instance.playerHealthLevel++; LGUStore.instance.UpdatePlayerNewHealthsServerRpc(GameNetworkManager.Instance.localPlayerController.playerSteamId, DEFAULT_HEALTH + UpgradeBus.instance.cfg.PLAYER_HEALTH_ADDITIONAL_HEALTH_UNLOCK + UpgradeBus.instance.playerHealthLevel * UpgradeBus.instance.cfg.PLAYER_HEALTH_ADDITIONAL_HEALTH_INCREMENT); } public override void load() { UpgradeBus.instance.playerHealth = true; TextMeshProUGUI chatText = HUDManager.Instance.chatText; ((TMP_Text)chatText).text = ((TMP_Text)chatText).text + LOAD_MESSAGE; LGUStore.instance.UpdatePlayerNewHealthsServerRpc(GameNetworkManager.Instance.localPlayerController.playerSteamId, DEFAULT_HEALTH + UpgradeBus.instance.cfg.PLAYER_HEALTH_ADDITIONAL_HEALTH_UNLOCK + UpgradeBus.instance.playerHealthLevel * UpgradeBus.instance.cfg.PLAYER_HEALTH_ADDITIONAL_HEALTH_INCREMENT); } public override void Register() { if (!UpgradeBus.instance.UpgradeObjects.ContainsKey(UPGRADE_NAME)) { UpgradeBus.instance.UpgradeObjects.Add(UPGRADE_NAME, ((Component)this).gameObject); } } public override void Unwind() { UpgradeBus.instance.playerHealthLevel = 0; UpgradeBus.instance.playerHealth = false; TextMeshProUGUI chatText = HUDManager.Instance.chatText; ((TMP_Text)chatText).text = ((TMP_Text)chatText).text + UNLOAD_MESSAGE; LGUStore.instance.UpdatePlayerNewHealthsServerRpc(GameNetworkManager.Instance.localPlayerController.playerSteamId, 0); } public static void CheckAdditionalHealth(StartOfRound __instance) { PlayerControllerB[] allPlayerScripts = __instance.allPlayerScripts; PlayerControllerB[] array = allPlayerScripts; foreach (PlayerControllerB player in array) { UpdateMaxHealth(player); } } public static int CheckForAdditionalHealth() { if (UpgradeBus.instance.playerHPs.ContainsKey(GameNetworkManager.Instance.localPlayerController.playerSteamId)) { return UpgradeBus.instance.playerHPs[GameNetworkManager.Instance.localPlayerController.playerSteamId]; } return DEFAULT_HEALTH; } public static void UpdateMaxHealth(PlayerControllerB player) { if (UpgradeBus.instance.playerHPs.ContainsKey(player.playerSteamId)) { player.health = UpgradeBus.instance.playerHPs[player.playerSteamId]; } } protected override void __initializeVariables() { base.__initializeVariables(); } protected internal override string __getTypeName() { return "playerHealthScript"; } } internal class proteinPowderScript : BaseUpgrade { public static string UPGRADE_NAME = "Protein Powder"; private static int CRIT_DAMAGE_VALUE = 100; private static int DEFAULT_HIT_VALUE = 1; public static string ENABLED_SECTION = $"Enable {UPGRADE_NAME} Upgrade"; public static bool ENABLED_DEFAULT = true; public static string ENABLED_DESCRIPTION = "Do more damage with shovels"; public static string PRICE_SECTION = $"Price of {UPGRADE_NAME} Upgrade"; public static int PRICE_DEFAULT = 1000; public static string UNLOCK_FORCE_SECTION = "Initial additional hit force"; public static int UNLOCK_FORCE_DEFAULT = 1; public static string UNLOCK_FORCE_DESCRIPTION = "The value added to hit force on initial unlock."; public static string INCREMENT_FORCE_SECTION = "Additional hit force per level"; public static int INCREMENT_FORCE_DEFAULT = 1; public static string INCREMENT_FORCE_DESCRIPTION = "Every time protein powder is upgraded this value will be added to the value above."; public static string INDIVIDUAL_SECTION = "Individual Purchase"; public static bool INDIVIDUAL_DEFAULT = true; public static string INDIVIDUAL_DESCRIPTION = "If true: upgrade will apply only to the client that purchased it."; public static string PRICES_SECTION = "Price of each additional upgrade"; public static string PRICES_DEFAULT = "700"; public static string PRICES_DESCRIPTION = "Value must be seperated by commas EX: '123,321,222'"; public static string CRIT_CHANCE_SECTION = "Chance of dealing a crit which will instakill the enemy."; public static float CRIT_CHANCE_DEFAULT = 0.01f; public static string CRIT_CHANCE_DESCRIPTION = "This value is only valid when maxed out Protein Powder. Any previous levels will not apply crit."; private static string LOAD_COLOUR = "#FF0000"; private static string LOAD_MESSAGE = $"\n<color={LOAD_COLOUR}>{UPGRADE_NAME} is active!</color>"; private static string UNLOAD_COLOUR = LOAD_COLOUR; private static string UNLOAD_MESSAGE = $"\n<color={UNLOAD_COLOUR}>{UPGRADE_NAME} has been disabled</color>"; private void Start() { Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject); Register(); } public override void Increment() { UpgradeBus.instance.proteinLevel++; } public override void load() { UpgradeBus.instance.proteinPowder = true; TextMeshProUGUI chatText = HUDManager.Instance.chatText; ((TMP_Text)chatText).text = ((TMP_Text)chatText).text + LOAD_MESSAGE; } public override void Register() { if (!UpgradeBus.instance.UpgradeObjects.ContainsKey(UPGRADE_NAME)) { UpgradeBus.instance.UpgradeObjects.Add(UPGRADE_NAME, ((Component)this).gameObject); } } public override void Unwind() { UpgradeBus.instance.proteinLevel = 0; UpgradeBus.instance.proteinPowder = false; TextMeshProUGUI chatText = HUDManager.Instance.chatText; ((TMP_Text)chatText).text = ((TMP_Text)chatText).text + UNLOAD_MESSAGE; } public static int GetShovelHitForce() { return (!UpgradeBus.instance.proteinPowder) ? DEFAULT_HIT_VALUE : (TryToCritEnemy() ? CRIT_DAMAGE_VALUE : (UpgradeBus.instance.cfg.PROTEIN_INCREMENT * UpgradeBus.instance.proteinLevel + UpgradeBus.instance.cfg.PROTEIN_UNLOCK_FORCE + DEFAULT_HIT_VALUE)); } private static bool TryToCritEnemy() { Plugin.mls.LogInfo((object)$"Levels purchaseable for Protein Powder: {UpgradeBus.instance.cfg.PROTEIN_UPGRADE_PRICES.Split(',').Length}"); Plugin.mls.LogInfo((object)("Current level on Protein Powder: " + UpgradeBus.instance.proteinLevel)); if (UpgradeBus.instance.proteinLevel != UpgradeBus.instance.cfg.PROTEIN_UPGRADE_PRICES.Split(',').Length) { return false; } return Random.value < UpgradeBus.instance.cfg.PROTEIN_CRIT_CHANCE; } protected override void __initializeVariables() { base.__initializeVariables(); } protected internal override string __getTypeName() { return "proteinPowderScript"; } } internal class runningShoeScript : BaseUpgrade { private void Start() { Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject); Register(); } public override void Increment() { PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; localPlayerController.movementSpeed += UpgradeBus.instance.cfg.MOVEMENT_INCREMENT; UpgradeBus.instance.runningLevel++; } public override void Unwind() { UpgradeBus.instance.runningShoes = false; UpgradeBus.instance.runningLevel = 0; GameNetworkManager.Instance.localPlayerController.movementSpeed = 4.6f; TextMeshProUGUI chatText = HUDManager.Instance.chatText; ((TMP_Text)chatText).text = ((TMP_Text)chatText).text + "\n<color=#FF0000>Running Shoes has been disabled.</color>"; } public override void Register() { if (!UpgradeBus.instance.UpgradeObjects.ContainsKey("Running Shoes")) { UpgradeBus.instance.UpgradeObjects.Add("Running Shoes", ((Component)this).gameObject); } } public override void load() { UpgradeBus.instance.runningShoes = true; GameNetworkManager.Instance.localPlayerController.movementSpeed = UpgradeBus.instance.cfg.MOVEMENT_SPEED; TextMeshProUGUI chatText = HUDManager.Instance.chatText; ((TMP_Text)chatText).text = ((TMP_Text)chatText).text + "\n<color=#FF0000>Running Shoes is active!</color>"; float num = 0f; for (int i = 0; i < UpgradeBus.instance.runningLevel; i++) { num += UpgradeBus.instance.cfg.MOVEMENT_INCREMENT; } PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; localPlayerController.movementSpeed += num; } protected override void __initializeVariables() { base.__initializeVariables(); } protected internal override string __getTypeName() { return "runningShoeScript"; } } internal class SampleItem : PhysicsProp { public override void EquipItem() { ParticleSystem componentInChildren = ((Component)this).GetComponentInChildren<ParticleSystem>(); if ((Object)(object)componentInChildren != (Object)null) { componentInChildren.Play(); } ((GrabbableObject)this).EquipItem(); } public override void DiscardItem() { ParticleSystem componentInChildren = ((Component)this).GetComponentInChildren<ParticleSystem>(); if ((Object)(object)componentInChildren != (Object)null) { componentInChildren.Play(); } ((GrabbableObject)this).DiscardItem(); } public override void PocketItem() { ParticleSystem componentInChildren = ((Component)this).GetComponentInChildren<ParticleSystem>(); if ((Object)(object)componentInChildren != (Object)null) { componentInChildren.Stop(); componentInChildren.Clear(); } ((GrabbableObject)this).PocketItem(); } protected override void __initializeVariables() { ((PhysicsProp)this).__initializeVariables(); } protected internal override string __getTypeName() { return "SampleItem"; } } internal class strongerScannerScript : BaseUpgrade { private void Start() { Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject); Register(); } public override void Increment() { UpgradeBus.instance.scanLevel++; } public override void load() { UpgradeBus.instance.scannerUpgrade = true; TextMeshProUGUI chatText = HUDManager.Instance.chatText; ((TMP_Text)chatText).text = ((TMP_Text)chatText).text + "\n<color=#FF0000>Better Scanner is active!</color>"; } public override void Unwind() { UpgradeBus.instance.scannerUpgrade = false; UpgradeBus.instance.scanLevel = 0; TextMeshProUGUI chatText = HUDManager.Instance.chatText; ((TMP_Text)chatText).text = ((TMP_Text)chatText).text + "\n<color=#FF0000>Better Scanner has been disabled.</color>"; } public override void Register() { Debug.Log((object)"SLKDJF"); if (!UpgradeBus.instance.UpgradeObjects.ContainsKey("Better Scanner")) { UpgradeBus.instance.UpgradeObjects.Add("Better Scanner", ((Component)this).gameObject); } } public static void AddScannerNodeToValve(ref SteamValveHazard steamValveHazard) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) if (UpgradeBus.instance.scanLevel >= 0) { Plugin.mls.LogInfo((object)"Adding scan node to the steam valve"); GameObject val = Object.Instantiate<GameObject>(GameObject.Find("ScanNode"), ((Component)steamValveHazard).transform.position, Quaternion.Euler(Vector3.zero), ((Component)steamValveHazard).transform); ScanNodeProperties component = val.GetComponent<ScanNodeProperties>(); component.headerText = "Bursted Steam Valve"; component.subText = "Fix it to get rid of the steam"; component.nodeType = 0; component.creatureScanID = -1; } } public static void RemoveScannerNodeFromValve(ref SteamValveHazard steamValveHazard) { Object.Destroy((Object)(object)((Component)steamValveHazard).gameObject.GetComponentInChildren<ScanNodeProperties>()); } public static string GetBetterScannerInfo(int level, int price) { switch (level) { case 1: return string.Format(AssetBundleHandler.GetInfoFromJSON("Better Scanner1"), level, price, UpgradeBus.instance.cfg.NODE_DISTANCE_INCREASE, UpgradeBus.instance.cfg.SHIP_AND_ENTRANCE_DISTANCE_INCREASE); case 2: return string.Format(AssetBundleHandler.GetInfoFromJSON("Better Scanner2"), level, price); case 3: { string text = string.Format(AssetBundleHandler.GetInfoFromJSON("Better Scanner3"), level, price, UpgradeBus.instance.cfg.BETTER_SCANNER_ENEMIES ? " and enemies" : ""); return text + "hives and scrap command display the location of the most valuable hives and scrap on the map.\n"; } default: return ""; } } protected override void __initializeVariables() { base.__initializeVariables(); } protected internal override string __getTypeName() { return "strongerScannerScript"; } } internal class strongLegsScript : BaseUpgrade { private void Start() { Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject); Register(); } public override void Increment() { UpgradeBus.instance.legLevel++; } public override void Unwind() { UpgradeBus.instance.strongLegs = false; UpgradeBus.instance.legLevel = 0; GameNetworkManager.Instance.localPlayerController.jumpForce = 13f; TextMeshProUGUI chatText = HUDManager.Instance.chatText; ((TMP_Text)chatText).text = ((TMP_Text)chatText).text + "\n<color=#FF0000>Better Scanner has been disabled.</color>"; } public override void Register() { if (!UpgradeBus.instance.UpgradeObjects.ContainsKey("Strong Legs")) { UpgradeBus.instance.UpgradeObjects.Add("Strong Legs", ((Component)this).gameObject); } } public override void load() { UpgradeBus.instance.strongLegs = true; GameNetworkManager.Instance.localPlayerController.jumpForce = UpgradeBus.instance.cfg.JUMP_FORCE; TextMeshProUGUI chatText = HUDManager.Instance.chatText; ((TMP_Text)chatText).text = ((TMP_Text)chatText).text + "\n<color=#FF0000>Strong Legs is active!</color>"; float num = 0f; for (int i = 0; i < UpgradeBus.instance.legLevel; i++) { num += UpgradeBus.instance.cfg.JUMP_FORCE_INCREMENT; } PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; localPlayerController.jumpForce += num; } protected override void __initializeVariables() { base.__initializeVariables(); } protected internal override string __getTypeName() { return "strongLegsScript"; } } public class terminalFlashScript : BaseUpgrade { private void Start() { Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject); Register(); } public override void load() { UpgradeBus.instance.terminalFlash = true; UpgradeBus.instance.flashScript = this; TextMeshProUGUI chatText = HUDManager.Instance.chatText; ((TMP_Text)chatText).text = ((TMP_Text)chatText).text + "\n<color=#FF0000>Discombobulator is active!\nType 'cooldown' into the terminal for info!!!</color>"; } public override void Register() { if (!UpgradeBus.instance.UpgradeObjects.ContainsKey("Discombobulator")) { UpgradeBus.instance.UpgradeObjects.Add("Discombobulator", ((Component)this).gameObject); } } public override void Increment() { UpgradeBus.instance.discoLevel++; } public override void Unwind() { UpgradeBus.instance.terminalFlash = false; UpgradeBus.instance.discoLevel = 0; TextMeshProUGUI chatText = HUDManager.Instance.chatText; ((TMP_Text)chatText).text = ((TMP_Text)chatText).text + "\n<color=#FF0000>Discombobulator has been disabled.</color>"; } [ServerRpc(RequireOwnership = false)] public void PlayAudioAndUpdateCooldownServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1135781697u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1135781697u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { PlayAudioAndUpdateCooldownClientRpc(); } } } [ClientRpc] private void PlayAudioAndUpdateCooldownClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1412806528u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1412806528u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } Terminal component = GameObject.Find("TerminalScript").GetComponent<Terminal>(); component.terminalAudio.maxDistance = 100f; component.terminalAudio.PlayOneShot(UpgradeBus.instance.flashNoise); ((MonoBehaviour)this).StartCoroutine(ResetRange(component)); UpgradeBus.instance.flashCooldown = UpgradeBus.instance.cfg.DISCOMBOBULATOR_COOLDOWN; Collider[] array = Physics.OverlapSphere(((Component)component).transform.position, UpgradeBus.instance.cfg.DISCOMBOBULATOR_RADIUS, 524288); if (array.Length == 0) { return; } for (int i = 0; i < array.Length; i++) { EnemyAICollisionDetect component2 = ((Component)array[i]).GetComponent<EnemyAICollisionDetect>(); if ((Object)(object)component2 != (Object)null) { component2.mainScript.SetEnemyStunned(true, UpgradeBus.instance.cfg.DISCOMBOBULATOR_STUN_DURATION + UpgradeBus.instance.cfg.DISCOMBOBULATOR_INCREMENT * (float)UpgradeBus.instance.discoLevel, (PlayerControllerB)null); } } }
BepInEx/plugins/Midge-PushCompany/PushCompany/PushCompany.dll
Decompiled 11 months agousing System; using System.CodeDom.Compiler; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Globalization; using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using GameNetcodeStuff; using HarmonyLib; using Microsoft.CodeAnalysis; using PushCompany.Assets.Scripts; using PushCompany.Properties; using Unity.Netcode; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("PushCompany")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyDescription("Push your fellow crewmates with the interaction key! (E by default)")] [assembly: AssemblyFileVersion("1.2.0.0")] [assembly: AssemblyInformationalVersion("1.2.0")] [assembly: AssemblyProduct("PushCompany")] [assembly: AssemblyTitle("PushCompany")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.2.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] internal class <Module> { static <Module>() { NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy<float>(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable<float>(); } } namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [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 PushCompany { [BepInPlugin("PushCompany", "PushCompany", "1.2.0")] public class PushCompanyBase : BaseUnityPlugin { public static readonly Lazy<PushCompanyBase> Instance = new Lazy<PushCompanyBase>(() => new PushCompanyBase()); public static GameObject pushPrefab; public ManualLogSource mls; private readonly Harmony harmony = new Harmony("PushCompany"); public static ConfigEntry<float> config_PushCooldown; public static ConfigEntry<float> config_PushForce; public static ConfigEntry<float> config_PushRange; public static ConfigEntry<float> config_PushCost; private void Awake() { mls = Logger.CreateLogSource("PushCompany"); ConfigSetup(); LoadBundle(); harmony.PatchAll(typeof(PushCompanyBase)); harmony.PatchAll(typeof(PlayerControllerB_Patches)); harmony.PatchAll(typeof(NetworkHandler)); Type[] types = Assembly.GetExecutingAssembly().GetTypes(); Type[] array = types; foreach (Type type in array) { MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); MethodInfo[] array2 = methods; foreach (MethodInfo methodInfo in array2) { object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false); if (customAttributes.Length != 0) { methodInfo.Invoke(null, null); } } } mls.LogInfo((object)"PushCompany has initialized!"); } private void ConfigSetup() { config_PushCooldown = ((BaseUnityPlugin)this).Config.Bind<float>("Push Cooldown", "Value", 0.025f, "How long until the player can push again"); config_PushForce = ((BaseUnityPlugin)this).Config.Bind<float>("Push Force", "Value", 12.5f, "How strong the player pushes."); config_PushRange = ((BaseUnityPlugin)this).Config.Bind<float>("Push Range", "Value", 3f, "The distance the player is able to push."); config_PushCost = ((BaseUnityPlugin)this).Config.Bind<float>("Push Cost", "Value", 0.08f, "The energy cost of each push."); } private void LoadBundle() { AssetBundle val = AssetBundle.LoadFromMemory(Resources.pushcompany); if ((Object)(object)val == (Object)null) { throw new Exception("Failed to load Push Bundle!"); } pushPrefab = val.LoadAsset<GameObject>("Assets/Push.prefab"); if ((Object)(object)pushPrefab == (Object)null) { throw new Exception("Failed to load Push Prefab!"); } pushPrefab.AddComponent<PushComponent>(); } } public static class PluginInfo { public const string PLUGIN_GUID = "PushCompany"; public const string PLUGIN_NAME = "PushCompany"; public const string PLUGIN_VERSION = "1.2.0"; } } namespace PushCompany.Properties { [GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [DebuggerNonUserCode] [CompilerGenerated] internal class Resources { private static ResourceManager resourceMan; private static CultureInfo resourceCulture; [EditorBrowsable(EditorBrowsableState.Advanced)] internal static ResourceManager ResourceManager { get { if (resourceMan == null) { ResourceManager resourceManager = new ResourceManager("PushCompany.Properties.Resources", typeof(Resources).Assembly); resourceMan = resourceManager; } return resourceMan; } } [EditorBrowsable(EditorBrowsableState.Advanced)] internal static CultureInfo Culture { get { return resourceCulture; } set { resourceCulture = value; } } internal static byte[] AssetBundles { get { object @object = ResourceManager.GetObject("AssetBundles", resourceCulture); return (byte[])@object; } } internal static byte[] AssetBundles_manifest { get { object @object = ResourceManager.GetObject("AssetBundles.manifest", resourceCulture); return (byte[])@object; } } internal static byte[] AssetBundles1 { get { object @object = ResourceManager.GetObject("AssetBundles1", resourceCulture); return (byte[])@object; } } internal static byte[] AssetBundles2 { get { object @object = ResourceManager.GetObject("AssetBundles2", resourceCulture); return (byte[])@object; } } internal static byte[] pushcompany { get { object @object = ResourceManager.GetObject("pushcompany", resourceCulture); return (byte[])@object; } } internal static byte[] pushcompany_push { get { object @object = ResourceManager.GetObject("pushcompany.push", resourceCulture); return (byte[])@object; } } internal static byte[] pushcompany_push_manifest { get { object @object = ResourceManager.GetObject("pushcompany.push.manifest", resourceCulture); return (byte[])@object; } } internal static byte[] pushcompany_push1 { get { object @object = ResourceManager.GetObject("pushcompany.push1", resourceCulture); return (byte[])@object; } } internal Resources() { } } } namespace PushCompany.Assets.Scripts { [HarmonyPatch] public class NetworkHandler { private static GameObject pushObject; [HarmonyPrefix] [HarmonyPatch(typeof(GameNetworkManager), "Start")] private static void Init() { NetworkManager.Singleton.AddNetworkPrefab(PushCompanyBase.pushPrefab); } [HarmonyPostfix] [HarmonyPatch(typeof(StartOfRound), "Awake")] private static void SpawnNetworkPrefab() { try { if (NetworkManager.Singleton.IsServer) { pushObject = Object.Instantiate<GameObject>(PushCompanyBase.pushPrefab); pushObject.GetComponent<NetworkObject>().Spawn(true); } } catch { PushCompanyBase.Instance.Value.mls.LogError((object)"Failed to instantiate network prefab!"); } } } [HarmonyPatch(typeof(PlayerControllerB))] public static class PlayerControllerB_Patches { private static PushComponent pushComponent; [HarmonyPostfix] [HarmonyPatch(typeof(PlayerControllerB), "Update")] private static void Update(PlayerControllerB __instance) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) if (!((NetworkBehaviour)__instance).IsOwner) { return; } MovementActions movement = __instance.playerActions.Movement; if (((MovementActions)(ref movement)).Interact.WasPressedThisFrame()) { if ((Object)(object)pushComponent == (Object)null) { pushComponent = Object.FindObjectOfType<PushComponent>(); } if ((Object)(object)pushComponent != (Object)null) { pushComponent.PushServerRpc(((NetworkBehaviour)__instance).NetworkObjectId); } } } } public class PushComponent : NetworkBehaviour { private Dictionary<ulong, float> lastPushTimes = new Dictionary<ulong, float>(); private NetworkVariable<float> PushCooldown = new NetworkVariable<float>(0f, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); private NetworkVariable<float> PushRange = new NetworkVariable<float>(0f, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); private NetworkVariable<float> PushForce = new NetworkVariable<float>(0f, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); private NetworkVariable<float> PushCost = new NetworkVariable<float>(0f, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public override void OnNetworkSpawn() { if (((NetworkBehaviour)this).IsServer) { PushCooldown.Value = PushCompanyBase.config_PushCooldown.Value; PushRange.Value = PushCompanyBase.config_PushRange.Value; PushForce.Value = PushCompanyBase.config_PushForce.Value; PushCost.Value = PushCompanyBase.config_PushCost.Value; } } [ServerRpc(RequireOwnership = false)] public void PushServerRpc(ulong playerId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2433198804u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2433198804u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } if (lastPushTimes.TryGetValue(playerId, out var value)) { if (Time.time - value < PushCooldown.Value) { return; } } else { lastPushTimes.Add(playerId, 0f); } GameObject playerById = GetPlayerById(playerId); PlayerControllerB component = playerById.GetComponent<PlayerControllerB>(); Camera gameplayCamera = component.gameplayCamera; if (!CanPushPlayer(component)) { return; } int num = 1 << playerById.layer; Vector3 forward = ((Component)gameplayCamera).transform.forward; Vector3 normalized = ((Vector3)(ref forward)).normalized; RaycastHit[] array = Physics.RaycastAll(((Component)gameplayCamera).transform.position, normalized, PushRange.Value, num); RaycastHit[] array2 = array; for (int i = 0; i < array2.Length; i++) { RaycastHit val3 = array2[i]; if ((Object)(object)((Component)((RaycastHit)(ref val3)).transform).gameObject != (Object)(object)playerById) { PlayerControllerB component2 = ((Component)((RaycastHit)(ref val3)).transform).GetComponent<PlayerControllerB>(); if (!component2.inSpecialInteractAnimation) { PushClientRpc(((NetworkBehaviour)component).NetworkObjectId, ((NetworkBehaviour)component2).NetworkObjectId, normalized * PushForce.Value * Time.fixedDeltaTime); lastPushTimes[playerId] = Time.time; } break; } } } [ClientRpc] private void PushClientRpc(ulong pusherId, ulong playerId, Vector3 push) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3498116674u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, pusherId); BytePacker.WriteValueBitPacked(val2, playerId); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref push); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3498116674u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { GameObject playerById = GetPlayerById(playerId); PlayerControllerB component = playerById.GetComponent<PlayerControllerB>(); ((MonoBehaviour)this).StartCoroutine(SmoothMove(component.thisController, push)); component.movementAudio.PlayOneShot(StartOfRound.Instance.playerJumpSFX); GameObject playerById2 = GetPlayerById(pusherId); PlayerControllerB component2 = playerById2.GetComponent<PlayerControllerB>(); component2.sprintMeter = Mathf.Clamp(component2.sprintMeter - PushCost.Value, 0f, 1f); } } } public IEnumerator SmoothMove(CharacterController controller, Vector3 push) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) float force = PushForce.Value / 12.5f; float smoothTime = ((Vector3)(ref push)).magnitude / force; Vector3 targetPosition = ((Component)controller).transform.position + push; Vector3 val = targetPosition - ((Component)controller).transform.position; Vector3 direction = ((Vector3)(ref val)).normalized; float distance = Vector3.Distance(((Component)controller).transform.position, targetPosition); for (float currentTime = 0f; currentTime < smoothTime; currentTime += Time.fixedDeltaTime) { float currentDistance = distance * Mathf.Min(currentTime, smoothTime) / smoothTime; controller.Move(direction * currentDistance); yield return null; } } private bool CanPushPlayer(PlayerControllerB player) { return !player.quickMenuManager.isMenuOpen && !player.inSpecialInteractAnimation && !player.isTypingChat && !player.isExhausted; } private static GameObject GetPlayerById(ulong playerId) { if (NetworkManager.Singleton.SpawnManager.SpawnedObjects.TryGetValue(playerId, out var value)) { return ((Component)value).gameObject; } return null; } protected override void __initializeVariables() { if (PushCooldown == null) { throw new Exception("PushComponent.PushCooldown cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)PushCooldown).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)PushCooldown, "PushCooldown"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)PushCooldown); if (PushRange == null) { throw new Exception("PushComponent.PushRange cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)PushRange).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)PushRange, "PushRange"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)PushRange); if (PushForce == null) { throw new Exception("PushComponent.PushForce cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)PushForce).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)PushForce, "PushForce"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)PushForce); if (PushCost == null) { throw new Exception("PushComponent.PushCost cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)PushCost).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)PushCost, "PushCost"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)PushCost); ((NetworkBehaviour)this).__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_PushComponent() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(2433198804u, new RpcReceiveHandler(__rpc_handler_2433198804)); NetworkManager.__rpc_func_table.Add(3498116674u, new RpcReceiveHandler(__rpc_handler_3498116674)); } private static void __rpc_handler_2433198804(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong playerId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); target.__rpc_exec_stage = (__RpcExecStage)1; ((PushComponent)(object)target).PushServerRpc(playerId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3498116674(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong pusherId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref pusherId); ulong playerId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); Vector3 push = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref push); target.__rpc_exec_stage = (__RpcExecStage)2; ((PushComponent)(object)target).PushClientRpc(pusherId, playerId, push); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "PushComponent"; } } }
BepInEx/plugins/MMHOOK/MMHOOK_AmazingAssets.TerrainToMesh.dll
Decompiled 11 months ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections.Generic; using System.ComponentModel; using System.Globalization; using System.IO; using System.Reflection; using System.Text; using AmazingAssets.TerrainToMesh; using MonoMod.Cil; using MonoMod.RuntimeDetour.HookGen; using On; using On.AmazingAssets.TerrainToMesh; using UnityEngine; using UnityEngine.Rendering; [assembly: AssemblyVersion("0.0.0.0")] namespace On { public static class \u200f\u202b\u202b\u202c\u206d\u206e\u206e\u202b\u200d\u202b\u202d\u200e\u206f\u200b\u206a\u202d\u206e\u206d\u200b\u202b\u200d\u206f\u202e\u202b\u200c\u206c\u200b\u202c\u206e\u202d\u206e\u202d\u202a\u200e\u206c\u202d\u206c\u200b\u202c\u200f\u202e { [EditorBrowsable(EditorBrowsableState.Never)] public delegate object orig_\u206f\u202b\u200f\u206e\u206e\u202c\u202c\u206d\u206b\u206d\u206c\u206f\u202d\u200d\u206b\u200d\u202a\u206c\u200c\u206c\u206b\u200c\u200f\u202a\u202b\u200f\u202c\u206d\u200b\u202e\u202d\u206b\u206a\u200b\u200f\u206a\u200e\u200e\u200e\u202e(TerrainData P_0, bool P_1, bool P_2); [EditorBrowsable(EditorBrowsableState.Never)] public delegate object hook_\u206f\u202b\u200f\u206e\u206e\u202c\u202c\u206d\u206b\u206d\u206c\u206f\u202d\u200d\u206b\u200d\u202a\u206c\u200c\u206c\u206b\u200c\u200f\u202a\u202b\u200f\u202c\u206d\u200b\u202e\u202d\u206b\u206a\u200b\u200f\u206a\u200e\u200e\u200e\u202e(orig_\u206f\u202b\u200f\u206e\u206e\u202c\u202c\u206d\u206b\u206d\u206c\u206f\u202d\u200d\u206b\u200d\u202a\u206c\u200c\u206c\u206b\u200c\u200f\u202a\u202b\u200f\u202c\u206d\u200b\u202e\u202d\u206b\u206a\u200b\u200f\u206a\u200e\u200e\u200e\u202e orig, TerrainData P_1, bool P_2, bool P_3); public static event hook_\u206f\u202b\u200f\u206e\u206e\u202c\u202c\u206d\u206b\u206d\u206c\u206f\u202d\u200d\u206b\u200d\u202a\u206c\u200c\u206c\u206b\u200c\u200f\u202a\u202b\u200f\u202c\u206d\u200b\u202e\u202d\u206b\u206a\u200b\u200f\u206a\u200e\u200e\u200e\u202e \u206f\u202b\u200f\u206e\u206e\u202c\u202c\u206d\u206b\u206d\u206c\u206f\u202d\u200d\u206b\u200d\u202a\u206c\u200c\u206c\u206b\u200c\u200f\u202a\u202b\u200f\u202c\u206d\u200b\u202e\u202d\u206b\u206a\u200b\u200f\u206a\u200e\u200e\u200e\u202e { add { HookEndpointManager.Add<hook_\u206f\u202b\u200f\u206e\u206e\u202c\u202c\u206d\u206b\u206d\u206c\u206f\u202d\u200d\u206b\u200d\u202a\u206c\u200c\u206c\u206b\u200c\u200f\u202a\u202b\u200f\u202c\u206d\u200b\u202e\u202d\u206b\u206a\u200b\u200f\u206a\u200e\u200e\u200e\u202e>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_\u206f\u202b\u200f\u206e\u206e\u202c\u202c\u206d\u206b\u206d\u206c\u206f\u202d\u200d\u206b\u200d\u202a\u206c\u200c\u206c\u206b\u200c\u200f\u202a\u202b\u200f\u202c\u206d\u200b\u202e\u202d\u206b\u206a\u200b\u200f\u206a\u200e\u200e\u200e\u202e>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } } } namespace IL { public static class \u200f\u202b\u202b\u202c\u206d\u206e\u206e\u202b\u200d\u202b\u202d\u200e\u206f\u200b\u206a\u202d\u206e\u206d\u200b\u202b\u200d\u206f\u202e\u202b\u200c\u206c\u200b\u202c\u206e\u202d\u206e\u202d\u202a\u200e\u206c\u202d\u206c\u200b\u202c\u200f\u202e { public static event Manipulator \u206f\u202b\u200f\u206e\u206e\u202c\u202c\u206d\u206b\u206d\u206c\u206f\u202d\u200d\u206b\u200d\u202a\u206c\u200c\u206c\u206b\u200c\u200f\u202a\u202b\u200f\u202c\u206d\u200b\u202e\u202d\u206b\u206a\u200b\u200f\u206a\u200e\u200e\u200e\u202e { add { HookEndpointManager.Modify<On.\u200f\u202b\u202b\u202c\u206d\u206e\u206e\u202b\u200d\u202b\u202d\u200e\u206f\u200b\u206a\u202d\u206e\u206d\u200b\u202b\u200d\u206f\u202e\u202b\u200c\u206c\u200b\u202c\u206e\u202d\u206e\u202d\u202a\u200e\u206c\u202d\u206c\u200b\u202c\u200f\u202e.hook_\u206f\u202b\u200f\u206e\u206e\u202c\u202c\u206d\u206b\u206d\u206c\u206f\u202d\u200d\u206b\u200d\u202a\u206c\u200c\u206c\u206b\u200c\u200f\u202a\u202b\u200f\u202c\u206d\u200b\u202e\u202d\u206b\u206a\u200b\u200f\u206a\u200e\u200e\u200e\u202e>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.\u200f\u202b\u202b\u202c\u206d\u206e\u206e\u202b\u200d\u202b\u202d\u200e\u206f\u200b\u206a\u202d\u206e\u206d\u200b\u202b\u200d\u206f\u202e\u202b\u200c\u206c\u200b\u202c\u206e\u202d\u206e\u202d\u202a\u200e\u206c\u202d\u206c\u200b\u202c\u200f\u202e.hook_\u206f\u202b\u200f\u206e\u206e\u202c\u202c\u206d\u206b\u206d\u206c\u206f\u202d\u200d\u206b\u200d\u202a\u206c\u200c\u206c\u206b\u200c\u200f\u202a\u202b\u200f\u202c\u206d\u200b\u202e\u202d\u206b\u206a\u200b\u200f\u206a\u200e\u200e\u200e\u202e>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } } } namespace On { public static class \u200f\u202c\u202d\u202a\u206a\u200b\u200b\u202c\u200e\u200c\u200f\u206f\u200d\u200c\u206c\u206e\u200e\u206f\u206b\u206b\u202c\u200f\u206b\u200f\u200c\u206f\u200d\u202d\u206e\u206c\u202c\u200f\u202b\u202a\u200c\u202a\u202a\u206c\u200d\u206f\u202e { [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_ctor(object self, TerrainData P_1, bool P_2, bool P_3); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_ctor(orig_ctor orig, object self, TerrainData P_2, bool P_3, bool P_4); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_\u202a\u200c\u206b\u206f\u202d\u200d\u200b\u200d\u206e\u202a\u202c\u206e\u200c\u200e\u206a\u202e\u202c\u200e\u206d\u200c\u200e\u200c\u202d\u200f\u206b\u202b\u206b\u206c\u206b\u206f\u202c\u202a\u200b\u202a\u200b\u206e\u202a\u202b\u206e\u206b\u202e(Texture P_0, RenderTexture P_1, bool P_2); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_\u202a\u200c\u206b\u206f\u202d\u200d\u200b\u200d\u206e\u202a\u202c\u206e\u200c\u200e\u206a\u202e\u202c\u200e\u206d\u200c\u200e\u200c\u202d\u200f\u206b\u202b\u206b\u206c\u206b\u206f\u202c\u202a\u200b\u202a\u200b\u206e\u202a\u202b\u206e\u206b\u202e(orig_\u202a\u200c\u206b\u206f\u202d\u200d\u200b\u200d\u206e\u202a\u202c\u206e\u200c\u200e\u206a\u202e\u202c\u200e\u206d\u200c\u200e\u200c\u202d\u200f\u206b\u202b\u206b\u206c\u206b\u206f\u202c\u202a\u200b\u202a\u200b\u206e\u202a\u202b\u206e\u206b\u202e orig, Texture P_1, RenderTexture P_2, bool P_3); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_\u200c\u200b\u200b\u200e\u200b\u206d\u202e\u202c\u200b\u200e\u206b\u202b\u200e\u202e\u200b\u200f\u200f\u202e\u206f\u200e\u200c\u200f\u202c\u200f\u206a\u206a\u200c\u206d\u206b\u206d\u206c\u200f\u202a\u202a\u200c\u206d\u206e\u200f\u202b\u202a\u202e(Texture P_0, RenderTexture P_1, Material P_2, bool P_3, int P_4); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_\u200c\u200b\u200b\u200e\u200b\u206d\u202e\u202c\u200b\u200e\u206b\u202b\u200e\u202e\u200b\u200f\u200f\u202e\u206f\u200e\u200c\u200f\u202c\u200f\u206a\u206a\u200c\u206d\u206b\u206d\u206c\u200f\u202a\u202a\u200c\u206d\u206e\u200f\u202b\u202a\u202e(orig_\u200c\u200b\u200b\u200e\u200b\u206d\u202e\u202c\u200b\u200e\u206b\u202b\u200e\u202e\u200b\u200f\u200f\u202e\u206f\u200e\u200c\u200f\u202c\u200f\u206a\u206a\u200c\u206d\u206b\u206d\u206c\u200f\u202a\u202a\u200c\u206d\u206e\u200f\u202b\u202a\u202e orig, Texture P_1, RenderTexture P_2, Material P_3, bool P_4, int P_5); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Texture2D orig_\u206a\u202b\u202b\u200b\u200d\u200e\u202e\u206e\u206b\u206e\u202d\u200d\u202c\u206c\u202b\u200b\u200c\u202b\u202c\u202a\u206f\u206c\u206d\u200e\u206b\u202b\u200f\u200d\u200d\u206c\u206e\u206c\u200d\u206e\u206d\u206f\u206f\u200d\u206c\u202e(Color P_0, TextureFormat P_1, bool P_2); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Texture2D hook_\u206a\u202b\u202b\u200b\u200d\u200e\u202e\u206e\u206b\u206e\u202d\u200d\u202c\u206c\u202b\u200b\u200c\u202b\u202c\u202a\u206f\u206c\u206d\u200e\u206b\u202b\u200f\u200d\u200d\u206c\u206e\u206c\u200d\u206e\u206d\u206f\u206f\u200d\u206c\u202e(orig_\u206a\u202b\u202b\u200b\u200d\u200e\u202e\u206e\u206b\u206e\u202d\u200d\u202c\u206c\u202b\u200b\u200c\u202b\u202c\u202a\u206f\u206c\u206d\u200e\u206b\u202b\u200f\u200d\u200d\u206c\u206e\u206c\u200d\u206e\u206d\u206f\u206f\u200d\u206c\u202e orig, Color P_1, TextureFormat P_2, bool P_3); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Texture2D orig_\u206f\u206f\u206b\u200e\u202c\u206b\u202c\u200c\u200f\u200c\u202e\u206e\u200c\u202c\u206c\u202c\u202b\u206b\u200f\u202c\u202b\u206a\u200f\u206c\u206f\u200c\u200b\u202e\u206d\u202a\u206a\u206c\u206f\u206b\u206a\u206c\u206d\u202b\u206a\u202b\u202e(int P_0, int P_1); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Texture2D hook_\u206f\u206f\u206b\u200e\u202c\u206b\u202c\u200c\u200f\u200c\u202e\u206e\u200c\u202c\u206c\u202c\u202b\u206b\u200f\u202c\u202b\u206a\u200f\u206c\u206f\u200c\u200b\u202e\u206d\u202a\u206a\u206c\u206f\u206b\u206a\u206c\u206d\u202b\u206a\u202b\u202e(orig_\u206f\u206f\u206b\u200e\u202c\u206b\u202c\u200c\u200f\u200c\u202e\u206e\u200c\u202c\u206c\u202c\u202b\u206b\u200f\u202c\u202b\u206a\u200f\u206c\u206f\u200c\u200b\u202e\u206d\u202a\u206a\u206c\u206f\u206b\u206a\u206c\u206d\u202b\u206a\u202b\u202e orig, int P_1, int P_2); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_\u200c\u206a\u206e\u206f\u200f\u206f\u202a\u200e\u206c\u202e\u202a\u200f\u206e\u202b\u206f\u200e\u200d\u200b\u202c\u202b\u202c\u206b\u200c\u202c\u200d\u202d\u200d\u200e\u202b\u206f\u200f\u206e\u200f\u200b\u206e\u200b\u202b\u202b\u202a\u206d\u202e(RenderTexture P_0, TextureFormat P_1, ref Texture2D P_2, bool P_3); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_\u200c\u206a\u206e\u206f\u200f\u206f\u202a\u200e\u206c\u202e\u202a\u200f\u206e\u202b\u206f\u200e\u200d\u200b\u202c\u202b\u202c\u206b\u200c\u202c\u200d\u202d\u200d\u200e\u202b\u206f\u200f\u206e\u200f\u200b\u206e\u200b\u202b\u202b\u202a\u206d\u202e(orig_\u200c\u206a\u206e\u206f\u200f\u206f\u202a\u200e\u206c\u202e\u202a\u200f\u206e\u202b\u206f\u200e\u200d\u200b\u202c\u202b\u202c\u206b\u200c\u202c\u200d\u202d\u200d\u200e\u202b\u206f\u200f\u206e\u200f\u200b\u206e\u200b\u202b\u202b\u202a\u206d\u202e orig, RenderTexture P_1, TextureFormat P_2, ref Texture2D P_3, bool P_4); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Texture2D orig_\u202d\u200d\u202e\u200b\u202e\u200e\u206b\u206d\u200b\u200f\u206e\u200d\u200e\u200f\u202e\u202a\u202d\u202c\u200e\u200b\u206a\u206e\u202b\u206c\u206f\u206c\u206c\u202c\u202d\u202d\u202c\u200d\u200b\u200e\u200b\u200c\u202d\u200c\u200c\u206c\u202e(Texture2D P_0, bool P_1, int P_2, int P_3, int P_4, int P_5); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Texture2D hook_\u202d\u200d\u202e\u200b\u202e\u200e\u206b\u206d\u200b\u200f\u206e\u200d\u200e\u200f\u202e\u202a\u202d\u202c\u200e\u200b\u206a\u206e\u202b\u206c\u206f\u206c\u206c\u202c\u202d\u202d\u202c\u200d\u200b\u200e\u200b\u200c\u202d\u200c\u200c\u206c\u202e(orig_\u202d\u200d\u202e\u200b\u202e\u200e\u206b\u206d\u200b\u200f\u206e\u200d\u200e\u200f\u202e\u202a\u202d\u202c\u200e\u200b\u206a\u206e\u202b\u206c\u206f\u206c\u206c\u202c\u202d\u202d\u202c\u200d\u200b\u200e\u200b\u200c\u202d\u200c\u200c\u206c\u202e orig, Texture2D P_1, bool P_2, int P_3, int P_4, int P_5, int P_6); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Texture2D[] orig_\u206f\u202e\u202b\u202b\u200e\u202b\u206e\u202e\u202d\u200e\u206c\u202c\u206c\u206f\u200b\u200b\u200d\u206a\u206f\u206b\u202e\u206e\u202a\u202b\u206b\u206e\u206c\u206f\u202c\u200d\u202d\u202c\u202d\u206b\u200c\u202a\u200e\u206b\u200e\u206e\u202e(Texture2D[] P_0, bool P_1, int P_2, int P_3, int P_4, int P_5); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Texture2D[] hook_\u206f\u202e\u202b\u202b\u200e\u202b\u206e\u202e\u202d\u200e\u206c\u202c\u206c\u206f\u200b\u200b\u200d\u206a\u206f\u206b\u202e\u206e\u202a\u202b\u206b\u206e\u206c\u206f\u202c\u200d\u202d\u202c\u202d\u206b\u200c\u202a\u200e\u206b\u200e\u206e\u202e(orig_\u206f\u202e\u202b\u202b\u200e\u202b\u206e\u202e\u202d\u200e\u206c\u202c\u206c\u206f\u200b\u200b\u200d\u206a\u206f\u206b\u202e\u206e\u202a\u202b\u206b\u206e\u206c\u206f\u202c\u200d\u202d\u202c\u202d\u206b\u200c\u202a\u200e\u206b\u200e\u206e\u202e orig, Texture2D[] P_1, bool P_2, int P_3, int P_4, int P_5, int P_6); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Texture2D[] orig_\u206f\u206a\u206d\u202c\u202c\u206f\u206f\u200f\u206b\u202a\u206a\u200c\u202a\u202d\u206c\u206d\u206d\u200e\u206d\u200b\u200e\u200b\u202a\u200c\u202d\u200f\u202b\u200e\u206b\u202d\u200d\u202b\u200f\u200b\u200f\u206e\u206f\u206c\u206b\u206d\u202e(Texture2D P_0, bool P_1, int P_2, int P_3); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Texture2D[] hook_\u206f\u206a\u206d\u202c\u202c\u206f\u206f\u200f\u206b\u202a\u206a\u200c\u202a\u202d\u206c\u206d\u206d\u200e\u206d\u200b\u200e\u200b\u202a\u200c\u202d\u200f\u202b\u200e\u206b\u202d\u200d\u202b\u200f\u200b\u200f\u206e\u206f\u206c\u206b\u206d\u202e(orig_\u206f\u206a\u206d\u202c\u202c\u206f\u206f\u200f\u206b\u202a\u206a\u200c\u202a\u202d\u206c\u206d\u206d\u200e\u206d\u200b\u200e\u200b\u202a\u200c\u202d\u200f\u202b\u200e\u206b\u202d\u200d\u202b\u200f\u200b\u200f\u206e\u206f\u206c\u206b\u206d\u202e orig, Texture2D P_1, bool P_2, int P_3, int P_4); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Texture2D[] orig_\u206a\u206a\u202b\u202b\u200d\u200b\u206f\u200d\u200c\u206a\u206b\u200f\u206c\u202a\u206b\u202a\u200d\u206d\u200f\u206e\u202a\u200e\u206a\u206d\u206b\u200c\u202a\u206c\u206d\u200e\u200f\u206a\u202d\u200d\u202e\u200c\u206d\u202b\u200b\u206d\u202e(Texture2D[] P_0, bool P_1, int P_2, int P_3); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Texture2D[] hook_\u206a\u206a\u202b\u202b\u200d\u200b\u206f\u200d\u200c\u206a\u206b\u200f\u206c\u202a\u206b\u202a\u200d\u206d\u200f\u206e\u202a\u200e\u206a\u206d\u206b\u200c\u202a\u206c\u206d\u200e\u200f\u206a\u202d\u200d\u202e\u200c\u206d\u202b\u200b\u206d\u202e(orig_\u206a\u206a\u202b\u202b\u200d\u200b\u206f\u200d\u200c\u206a\u206b\u200f\u206c\u202a\u206b\u202a\u200d\u206d\u200f\u206e\u202a\u200e\u206a\u206d\u206b\u200c\u202a\u206c\u206d\u200e\u200f\u206a\u202d\u200d\u202e\u200c\u206d\u202b\u200b\u206d\u202e orig, Texture2D[] P_1, bool P_2, int P_3, int P_4); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Texture2D orig_\u206c\u202c\u206e\u200d\u206e\u200c\u202e\u200f\u200e\u200f\u202b\u200c\u200d\u206f\u202b\u206d\u206d\u206c\u200f\u206f\u202e\u200b\u206b\u200f\u202a\u200e\u202c\u202d\u202b\u206d\u206d\u200b\u202e\u202e\u202d\u202a\u206f\u202a\u202e\u200e\u202e(Texture2D P_0, bool P_1, int P_2, int P_3, int P_4, int P_5); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Texture2D hook_\u206c\u202c\u206e\u200d\u206e\u200c\u202e\u200f\u200e\u200f\u202b\u200c\u200d\u206f\u202b\u206d\u206d\u206c\u200f\u206f\u202e\u200b\u206b\u200f\u202a\u200e\u202c\u202d\u202b\u206d\u206d\u200b\u202e\u202e\u202d\u202a\u206f\u202a\u202e\u200e\u202e(orig_\u206c\u202c\u206e\u200d\u206e\u200c\u202e\u200f\u200e\u200f\u202b\u200c\u200d\u206f\u202b\u206d\u206d\u206c\u200f\u206f\u202e\u200b\u206b\u200f\u202a\u200e\u202c\u202d\u202b\u206d\u206d\u200b\u202e\u202e\u202d\u202a\u206f\u202a\u202e\u200e\u202e orig, Texture2D P_1, bool P_2, int P_3, int P_4, int P_5, int P_6); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_\u206f\u206b\u206c\u200b\u200b\u200e\u200f\u200c\u206a\u200d\u200d\u206e\u206b\u202c\u202d\u206a\u200c\u202e\u200d\u202d\u200b\u202b\u200c\u206a\u200d\u200c\u206f\u206e\u206e\u200d\u206e\u206b\u206f\u206a\u202a\u206e\u206c\u206c\u200f\u200c\u202e(TerrainData P_0, int P_1, out int P_2, out int P_3); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_\u206f\u206b\u206c\u200b\u200b\u200e\u200f\u200c\u206a\u200d\u200d\u206e\u206b\u202c\u202d\u206a\u200c\u202e\u200d\u202d\u200b\u202b\u200c\u206a\u200d\u200c\u206f\u206e\u206e\u200d\u206e\u206b\u206f\u206a\u202a\u206e\u206c\u206c\u200f\u200c\u202e(orig_\u206f\u206b\u206c\u200b\u200b\u200e\u200f\u200c\u206a\u200d\u200d\u206e\u206b\u202c\u202d\u206a\u200c\u202e\u200d\u202d\u200b\u202b\u200c\u206a\u200d\u200c\u206f\u206e\u206e\u200d\u206e\u206b\u206f\u206a\u202a\u206e\u206c\u206c\u200f\u200c\u202e orig, TerrainData P_1, int P_2, out int P_3, out int P_4); [EditorBrowsable(EditorBrowsableState.Never)] public delegate int orig_\u206a\u200e\u206a\u202a\u200d\u206f\u202b\u206d\u200f\u202b\u206c\u200b\u200e\u202d\u206e\u206e\u206a\u206e\u200d\u202a\u206e\u206b\u200f\u206c\u200b\u200e\u200d\u200b\u202d\u202d\u200c\u206e\u200d\u200e\u206d\u200d\u202e\u202d\u200f\u206b\u202e(int P_0); [EditorBrowsable(EditorBrowsableState.Never)] public delegate int hook_\u206a\u200e\u206a\u202a\u200d\u206f\u202b\u206d\u200f\u202b\u206c\u200b\u200e\u202d\u206e\u206e\u206a\u206e\u200d\u202a\u206e\u206b\u200f\u206c\u200b\u200e\u200d\u200b\u202d\u202d\u200c\u206e\u200d\u200e\u206d\u200d\u202e\u202d\u200f\u206b\u202e(orig_\u206a\u200e\u206a\u202a\u200d\u206f\u202b\u206d\u200f\u202b\u206c\u200b\u200e\u202d\u206e\u206e\u206a\u206e\u200d\u202a\u206e\u206b\u200f\u206c\u200b\u200e\u200d\u200b\u202d\u202d\u200c\u206e\u200d\u200e\u206d\u200d\u202e\u202d\u200f\u206b\u202e orig, int P_1); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_cctor(); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_cctor(orig_cctor orig); [EditorBrowsable(EditorBrowsableState.Never)] public delegate ColorSpace orig_\u206e\u202a\u200f\u206c\u206a\u206c\u200d\u200e\u206b\u200b\u200d\u206c\u202c\u202a\u202c\u200d\u202b\u206b\u200e\u206f\u206b\u200b\u200e\u202b\u206e\u200c\u200d\u206e\u202e\u200e\u202c\u200d\u206d\u200c\u200c\u202c\u200e\u202d\u202c\u206c\u202e(); [EditorBrowsable(EditorBrowsableState.Never)] public delegate ColorSpace hook_\u206e\u202a\u200f\u206c\u206a\u206c\u200d\u200e\u206b\u200b\u200d\u206c\u202c\u202a\u202c\u200d\u202b\u206b\u200e\u206f\u206b\u200b\u200e\u202b\u206e\u200c\u200d\u206e\u202e\u200e\u202c\u200d\u206d\u200c\u200c\u202c\u200e\u202d\u202c\u206c\u202e(orig_\u206e\u202a\u200f\u206c\u206a\u206c\u200d\u200e\u206b\u200b\u200d\u206c\u202c\u202a\u202c\u200d\u202b\u206b\u200e\u206f\u206b\u200b\u200e\u202b\u206e\u200c\u200d\u206e\u202e\u200e\u202c\u200d\u206d\u200c\u200c\u202c\u200e\u202d\u202c\u206c\u202e orig); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_\u206c\u202d\u206f\u206f\u200d\u202c\u206a\u202b\u202c\u206e\u206b\u206d\u200f\u206b\u202d\u206b\u202e\u202b\u200b\u200f\u206c\u206c\u200f\u202e\u202c\u200c\u206c\u202c\u200b\u206a\u200b\u200e\u202b\u206f\u200d\u200b\u200e\u202c\u206c\u202b\u202e(bool P_0); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_\u206c\u202d\u206f\u206f\u200d\u202c\u206a\u202b\u202c\u206e\u206b\u206d\u200f\u206b\u202d\u206b\u202e\u202b\u200b\u200f\u206c\u206c\u200f\u202e\u202c\u200c\u206c\u202c\u200b\u206a\u200b\u200e\u202b\u206f\u200d\u200b\u200e\u202c\u206c\u202b\u202e(orig_\u206c\u202d\u206f\u206f\u200d\u202c\u206a\u202b\u202c\u206e\u206b\u206d\u200f\u206b\u202d\u206b\u202e\u202b\u200b\u200f\u206c\u206c\u200f\u202e\u202c\u200c\u206c\u202c\u200b\u206a\u200b\u200e\u202b\u206f\u200d\u200b\u200e\u202c\u206c\u202b\u202e orig, bool P_1); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool orig_\u206c\u200b\u206c\u200b\u202d\u206a\u200e\u200b\u200f\u206e\u202b\u200e\u202a\u202a\u206c\u202c\u206f\u206b\u206c\u206a\u206c\u202a\u206a\u200b\u200b\u202e\u202c\u206e\u206d\u202c\u200c\u202a\u206a\u202d\u200d\u202b\u202c\u200d\u200c\u202b\u202e(Object P_0, Object P_1); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool hook_\u206c\u200b\u206c\u200b\u202d\u206a\u200e\u200b\u200f\u206e\u202b\u200e\u202a\u202a\u206c\u202c\u206f\u206b\u206c\u206a\u206c\u202a\u206a\u200b\u200b\u202e\u202c\u206e\u206d\u202c\u200c\u202a\u206a\u202d\u200d\u202b\u202c\u200d\u200c\u202b\u202e(orig_\u206c\u200b\u206c\u200b\u202d\u206a\u200e\u200b\u200f\u206e\u202b\u200e\u202a\u202a\u206c\u202c\u206f\u206b\u206c\u206a\u206c\u202a\u206a\u200b\u200b\u202e\u202c\u206e\u206d\u202c\u200c\u202a\u206a\u202d\u200d\u202b\u202c\u200d\u200c\u202b\u202e orig, Object P_1, Object P_2); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_\u206c\u200e\u202a\u206a\u200e\u206d\u206c\u202a\u206e\u200d\u200f\u206e\u200b\u200f\u202d\u206c\u200c\u206f\u206c\u202d\u206b\u200f\u200f\u202b\u206f\u200d\u206c\u202e\u206b\u202c\u202b\u200e\u200b\u202c\u206b\u200c\u202c\u200e\u206d\u202e(Texture P_0, RenderTexture P_1); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_\u206c\u200e\u202a\u206a\u200e\u206d\u206c\u202a\u206e\u200d\u200f\u206e\u200b\u200f\u202d\u206c\u200c\u206f\u206c\u202d\u206b\u200f\u200f\u202b\u206f\u200d\u206c\u202e\u206b\u202c\u202b\u200e\u200b\u202c\u206b\u200c\u202c\u200e\u206d\u202e(orig_\u206c\u200e\u202a\u206a\u200e\u206d\u206c\u202a\u206e\u200d\u200f\u206e\u200b\u200f\u202d\u206c\u200c\u206f\u206c\u202d\u206b\u200f\u200f\u202b\u206f\u200d\u206c\u202e\u206b\u202c\u202b\u200e\u200b\u202c\u206b\u200c\u202c\u200e\u206d\u202e orig, Texture P_1, RenderTexture P_2); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_\u200f\u206f\u206c\u200d\u200f\u200c\u206c\u200e\u202a\u202a\u206e\u206a\u200b\u202b\u206d\u206f\u206c\u202c\u206f\u200c\u202b\u200f\u206e\u206b\u202c\u206b\u206b\u200f\u206b\u202b\u200f\u200d\u200e\u206e\u206d\u206e\u200b\u200f\u206b\u206d\u202e(Texture P_0, RenderTexture P_1, Material P_2, int P_3); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_\u200f\u206f\u206c\u200d\u200f\u200c\u206c\u200e\u202a\u202a\u206e\u206a\u200b\u202b\u206d\u206f\u206c\u202c\u206f\u200c\u202b\u200f\u206e\u206b\u202c\u206b\u206b\u200f\u206b\u202b\u200f\u200d\u200e\u206e\u206d\u206e\u200b\u200f\u206b\u206d\u202e(orig_\u200f\u206f\u206c\u200d\u200f\u200c\u206c\u200e\u202a\u202a\u206e\u206a\u200b\u202b\u206d\u206f\u206c\u202c\u206f\u200c\u202b\u200f\u206e\u206b\u202c\u206b\u206b\u200f\u206b\u202b\u200f\u200d\u200e\u206e\u206d\u206e\u200b\u200f\u206b\u206d\u202e orig, Texture P_1, RenderTexture P_2, Material P_3, int P_4); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Texture2D orig_\u202b\u206b\u200d\u202e\u200e\u202c\u206f\u200b\u206e\u200f\u200f\u202d\u206a\u200e\u206f\u200e\u206c\u206d\u202a\u206a\u206e\u200e\u206d\u202a\u202c\u202e\u206b\u202a\u202e\u206e\u200b\u200d\u202b\u206b\u200b\u206f\u202c\u202b\u206d\u202d\u202e(int P_0, int P_1, TextureFormat P_2, bool P_3); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Texture2D hook_\u202b\u206b\u200d\u202e\u200e\u202c\u206f\u200b\u206e\u200f\u200f\u202d\u206a\u200e\u206f\u200e\u206c\u206d\u202a\u206a\u206e\u200e\u206d\u202a\u202c\u202e\u206b\u202a\u202e\u206e\u200b\u200d\u202b\u206b\u200b\u206f\u202c\u202b\u206d\u202d\u202e(orig_\u202b\u206b\u200d\u202e\u200e\u202c\u206f\u200b\u206e\u200f\u200f\u202d\u206a\u200e\u206f\u200e\u206c\u206d\u202a\u206a\u206e\u200e\u206d\u202a\u202c\u202e\u206b\u202a\u202e\u206e\u200b\u200d\u202b\u206b\u200b\u206f\u202c\u202b\u206d\u202d\u202e orig, int P_1, int P_2, TextureFormat P_3, bool P_4); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_\u202b\u202a\u202e\u206a\u202b\u202e\u200b\u206b\u200d\u200c\u206f\u200b\u202d\u206b\u200e\u202d\u206b\u200b\u206e\u206b\u202c\u202d\u206b\u206e\u206b\u202b\u202e\u202a\u200c\u200f\u202c\u206d\u202b\u202a\u200f\u202a\u202a\u206d\u202d\u206c\u202e(Texture2D P_0, Color[] P_1); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_\u202b\u202a\u202e\u206a\u202b\u202e\u200b\u206b\u200d\u200c\u206f\u200b\u202d\u206b\u200e\u202d\u206b\u200b\u206e\u206b\u202c\u202d\u206b\u206e\u206b\u202b\u202e\u202a\u200c\u200f\u202c\u206d\u202b\u202a\u200f\u202a\u202a\u206d\u202d\u206c\u202e(orig_\u202b\u202a\u202e\u206a\u202b\u202e\u200b\u206b\u200d\u200c\u206f\u200b\u202d\u206b\u200e\u202d\u206b\u200b\u206e\u206b\u202c\u202d\u206b\u206e\u206b\u202b\u202e\u202a\u200c\u200f\u202c\u206d\u202b\u202a\u200f\u202a\u202a\u206d\u202d\u206c\u202e orig, Texture2D P_1, Color[] P_2); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_\u202e\u202d\u206b\u206b\u206e\u200d\u200e\u200d\u202d\u202a\u206c\u206f\u206d\u202c\u200d\u206c\u202e\u200d\u202c\u206b\u202a\u206f\u206d\u202b\u200e\u202d\u200e\u202d\u206a\u200c\u202e\u206c\u202b\u200d\u200b\u206c\u200d\u206f\u206f\u202c\u202e(Texture2D P_0); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_\u202e\u202d\u206b\u206b\u206e\u200d\u200e\u200d\u202d\u202a\u206c\u206f\u206d\u202c\u200d\u206c\u202e\u200d\u202c\u206b\u202a\u206f\u206d\u202b\u200e\u202d\u200e\u202d\u206a\u200c\u202e\u206c\u202b\u200d\u200b\u206c\u200d\u206f\u206f\u202c\u202e(orig_\u202e\u202d\u206b\u206b\u206e\u200d\u200e\u200d\u202d\u202a\u206c\u206f\u206d\u202c\u200d\u206c\u202e\u200d\u202c\u206b\u202a\u206f\u206d\u202b\u200e\u202d\u200e\u202d\u206a\u200c\u202e\u206c\u202b\u200d\u200b\u206c\u200d\u206f\u206f\u202c\u202e orig, Texture2D P_1); [EditorBrowsable(EditorBrowsableState.Never)] public delegate RenderTexture orig_\u202c\u206a\u202e\u202d\u200c\u202e\u206a\u202c\u206b\u206e\u200b\u206c\u200d\u206a\u200e\u206a\u206b\u206a\u202d\u206a\u206e\u206b\u202a\u202a\u206b\u202d\u206f\u202b\u202b\u202d\u206c\u206d\u206c\u202d\u206c\u202a\u206b\u202c\u206c\u202b\u202e(int P_0, int P_1, int P_2); [EditorBrowsable(EditorBrowsableState.Never)] public delegate RenderTexture hook_\u202c\u206a\u202e\u202d\u200c\u202e\u206a\u202c\u206b\u206e\u200b\u206c\u200d\u206a\u200e\u206a\u206b\u206a\u202d\u206a\u206e\u206b\u202a\u202a\u206b\u202d\u206f\u202b\u202b\u202d\u206c\u206d\u206c\u202d\u206c\u202a\u206b\u202c\u206c\u202b\u202e(orig_\u202c\u206a\u202e\u202d\u200c\u202e\u206a\u202c\u206b\u206e\u200b\u206c\u200d\u206a\u200e\u206a\u206b\u206a\u202d\u206a\u206e\u206b\u202a\u202a\u206b\u202d\u206f\u202b\u202b\u202d\u206c\u206d\u206c\u202d\u206c\u202a\u206b\u202c\u206c\u202b\u202e orig, int P_1, int P_2, int P_3); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool orig_\u202a\u202d\u206c\u200b\u200e\u202c\u200d\u206d\u200e\u202c\u206a\u200c\u206f\u202d\u206e\u200d\u202a\u206f\u200b\u200c\u206b\u202c\u206f\u206b\u202d\u200f\u200f\u206b\u206d\u200f\u202e\u200f\u206d\u206d\u206e\u206f\u206f\u206b\u206c\u200e\u202e(RenderTexture P_0); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool hook_\u202a\u202d\u206c\u200b\u200e\u202c\u200d\u206d\u200e\u202c\u206a\u200c\u206f\u202d\u206e\u200d\u202a\u206f\u200b\u200c\u206b\u202c\u206f\u206b\u202d\u200f\u200f\u206b\u206d\u200f\u202e\u200f\u206d\u206d\u206e\u206f\u206f\u206b\u206c\u200e\u202e(orig_\u202a\u202d\u206c\u200b\u200e\u202c\u200d\u206d\u200e\u202c\u206a\u200c\u206f\u202d\u206e\u200d\u202a\u206f\u200b\u200c\u206b\u202c\u206f\u206b\u202d\u200f\u200f\u206b\u206d\u200f\u202e\u200f\u206d\u206d\u206e\u206f\u206f\u206b\u206c\u200e\u202e orig, RenderTexture P_1); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_\u202a\u200c\u206a\u202c\u200f\u202e\u202b\u200c\u206d\u202d\u200f\u200c\u206d\u206f\u206d\u200e\u206d\u202a\u200c\u202e\u202a\u206e\u206b\u206f\u206e\u202a\u206d\u202a\u200e\u206f\u206f\u202a\u206e\u202e\u200b\u202a\u202a\u202c\u202a\u206f\u202e(RenderTexture P_0); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_\u202a\u200c\u206a\u202c\u200f\u202e\u202b\u200c\u206d\u202d\u200f\u200c\u206d\u206f\u206d\u200e\u206d\u202a\u200c\u202e\u202a\u206e\u206b\u206f\u206e\u202a\u206d\u202a\u200e\u206f\u206f\u202a\u206e\u202e\u200b\u202a\u202a\u202c\u202a\u206f\u202e(orig_\u202a\u200c\u206a\u202c\u200f\u202e\u202b\u200c\u206d\u202d\u200f\u200c\u206d\u206f\u206d\u200e\u206d\u202a\u200c\u202e\u202a\u206e\u206b\u206f\u206e\u202a\u206d\u202a\u200e\u206f\u206f\u202a\u206e\u202e\u200b\u202a\u202a\u202c\u202a\u206f\u202e orig, RenderTexture P_1); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool orig_\u202b\u200d\u202a\u202d\u206b\u202c\u202d\u202c\u200e\u206b\u206a\u206a\u202e\u206e\u206b\u200d\u202e\u200e\u206e\u200f\u206a\u202e\u202a\u200f\u200c\u200e\u202e\u206e\u206e\u202a\u200c\u200b\u206c\u202e\u206d\u206f\u202c\u206f\u206e\u202a\u202e(); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool hook_\u202b\u200d\u202a\u202d\u206b\u202c\u202d\u202c\u200e\u206b\u206a\u206a\u202e\u206e\u206b\u200d\u202e\u200e\u206e\u200f\u206a\u202e\u202a\u200f\u200c\u200e\u202e\u206e\u206e\u202a\u200c\u200b\u206c\u202e\u206d\u206f\u202c\u206f\u206e\u202a\u202e(orig_\u202b\u200d\u202a\u202d\u206b\u202c\u202d\u202c\u200e\u206b\u206a\u206a\u202e\u206e\u206b\u200d\u202e\u200e\u206e\u200f\u206a\u202e\u202a\u200f\u200c\u200e\u202e\u206e\u206e\u202a\u200c\u200b\u206c\u202e\u206d\u206f\u202c\u206f\u206e\u202a\u202e orig); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_\u202c\u206f\u202b\u202b\u206b\u200c\u206d\u206d\u202e\u206c\u202c\u202d\u206e\u200b\u202c\u206f\u206c\u200e\u200e\u202b\u200f\u200d\u200c\u206b\u200b\u200d\u202e\u200c\u202a\u206a\u206e\u206e\u202a\u206e\u202e\u206c\u202d\u206e\u200b\u202e\u202e(Object P_0); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_\u202c\u206f\u202b\u202b\u206b\u200c\u206d\u206d\u202e\u206c\u202c\u202d\u206e\u200b\u202c\u206f\u206c\u200e\u200e\u202b\u200f\u200d\u200c\u206b\u200b\u200d\u202e\u200c\u202a\u206a\u206e\u206e\u202a\u206e\u202e\u206c\u202d\u206e\u200b\u202e\u202e(orig_\u202c\u206f\u202b\u202b\u206b\u200c\u206d\u206d\u202e\u206c\u202c\u202d\u206e\u200b\u202c\u206f\u206c\u200e\u200e\u202b\u200f\u200d\u200c\u206b\u200b\u200d\u202e\u200c\u202a\u206a\u206e\u206e\u202a\u206e\u202e\u206c\u202d\u206e\u200b\u202e\u202e orig, Object P_1); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_\u202b\u206b\u202a\u202a\u200f\u200f\u200c\u200f\u202c\u202d\u202a\u202c\u200c\u202a\u206f\u206b\u200f\u200e\u200f\u202a\u202b\u200b\u200c\u202c\u206e\u200f\u206e\u202a\u200c\u200e\u202c\u202a\u200b\u202d\u206d\u200e\u206f\u202c\u206e\u202e(Object P_0); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_\u202b\u206b\u202a\u202a\u200f\u200f\u200c\u200f\u202c\u202d\u202a\u202c\u200c\u202a\u206f\u206b\u200f\u200e\u200f\u202a\u202b\u200b\u200c\u202c\u206e\u200f\u206e\u202a\u200c\u200e\u202c\u202a\u200b\u202d\u206d\u200e\u206f\u202c\u206e\u202e(orig_\u202b\u206b\u202a\u202a\u200f\u200f\u200c\u200f\u202c\u202d\u202a\u202c\u200c\u202a\u206f\u206b\u200f\u200e\u200f\u202a\u202b\u200b\u200c\u202c\u206e\u200f\u206e\u202a\u200c\u200e\u202c\u202a\u200b\u202d\u206d\u200e\u206f\u202c\u206e\u202e orig, Object P_1); [EditorBrowsable(EditorBrowsableState.Never)] public delegate RenderTexture orig_\u202c\u206c\u200e\u200c\u200e\u206e\u206d\u206c\u206b\u202b\u200b\u206c\u206b\u206f\u202c\u202b\u202b\u200b\u202c\u200e\u206a\u202a\u202e\u202d\u206d\u202b\u202a\u206e\u202a\u206d\u202b\u206a\u206e\u200f\u206b\u202b\u200d\u206b\u200b\u206d\u202e(); [EditorBrowsable(EditorBrowsableState.Never)] public delegate RenderTexture hook_\u202c\u206c\u200e\u200c\u200e\u206e\u206d\u206c\u206b\u202b\u200b\u206c\u206b\u206f\u202c\u202b\u202b\u200b\u202c\u200e\u206a\u202a\u202e\u202d\u206d\u202b\u202a\u206e\u202a\u206d\u202b\u206a\u206e\u200f\u206b\u202b\u200d\u206b\u200b\u206d\u202e(orig_\u202c\u206c\u200e\u200c\u200e\u206e\u206d\u206c\u206b\u202b\u200b\u206c\u206b\u206f\u202c\u202b\u202b\u200b\u202c\u200e\u206a\u202a\u202e\u202d\u206d\u202b\u202a\u206e\u202a\u206d\u202b\u206a\u206e\u200f\u206b\u202b\u200d\u206b\u200b\u206d\u202e orig); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_\u206a\u206d\u200e\u206d\u202d\u206c\u202e\u202e\u200b\u200f\u202b\u206c\u206a\u206f\u206f\u200c\u200e\u200f\u200f\u200e\u206f\u202a\u202d\u200e\u202d\u200f\u206d\u206e\u202a\u206f\u200d\u202e\u206e\u202a\u206e\u200d\u200f\u206a\u200f\u206b\u202e(RenderTexture P_0); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_\u206a\u206d\u200e\u206d\u202d\u206c\u202e\u202e\u200b\u200f\u202b\u206c\u206a\u206f\u206f\u200c\u200e\u200f\u200f\u200e\u206f\u202a\u202d\u200e\u202d\u200f\u206d\u206e\u202a\u206f\u200d\u202e\u206e\u202a\u206e\u200d\u200f\u206a\u200f\u206b\u202e(orig_\u206a\u206d\u200e\u206d\u202d\u206c\u202e\u202e\u200b\u200f\u202b\u206c\u206a\u206f\u206f\u200c\u200e\u200f\u200f\u200e\u206f\u202a\u202d\u200e\u202d\u200f\u206d\u206e\u202a\u206f\u200d\u202e\u206e\u202a\u206e\u200d\u200f\u206a\u200f\u206b\u202e orig, RenderTexture P_1); [EditorBrowsable(EditorBrowsableState.Never)] public delegate int orig_\u206b\u200f\u206e\u200b\u206e\u200f\u206e\u206a\u200b\u200f\u206b\u206b\u206b\u202a\u200c\u206f\u200d\u200e\u202d\u202c\u206d\u206b\u202c\u202a\u200d\u206d\u206c\u202d\u202c\u202d\u202c\u206e\u200c\u202c\u202a\u200e\u206c\u206c\u200b\u202a\u202e(Texture P_0); [EditorBrowsable(EditorBrowsableState.Never)] public delegate int hook_\u206b\u200f\u206e\u200b\u206e\u200f\u206e\u206a\u200b\u200f\u206b\u206b\u206b\u202a\u200c\u206f\u200d\u200e\u202d\u202c\u206d\u206b\u202c\u202a\u200d\u206d\u206c\u202d\u202c\u202d\u202c\u206e\u200c\u202c\u202a\u200e\u206c\u206c\u200b\u202a\u202e(orig_\u206b\u200f\u206e\u200b\u206e\u200f\u206e\u206a\u200b\u200f\u206b\u206b\u206b\u202a\u200c\u206f\u200d\u200e\u202d\u202c\u206d\u206b\u202c\u202a\u200d\u206d\u206c\u202d\u202c\u202d\u202c\u206e\u200c\u202c\u202a\u200e\u206c\u206c\u200b\u202a\u202e orig, Texture P_1); [EditorBrowsable(EditorBrowsableState.Never)] public delegate int orig_\u206c\u202c\u202c\u206c\u200f\u202d\u200d\u200d\u206c\u206f\u202e\u206f\u202e\u206e\u206c\u202d\u202d\u206c\u200d\u202b\u200f\u200e\u200f\u202e\u206c\u200f\u200c\u202e\u202a\u200d\u206d\u206a\u202a\u206c\u206c\u206e\u202e\u200d\u206c\u206a\u202e(Texture P_0); [EditorBrowsable(EditorBrowsableState.Never)] public delegate int hook_\u206c\u202c\u202c\u206c\u200f\u202d\u200d\u200d\u206c\u206f\u202e\u206f\u202e\u206e\u206c\u202d\u202d\u206c\u200d\u202b\u200f\u200e\u200f\u202e\u206c\u200f\u200c\u202e\u202a\u200d\u206d\u206a\u202a\u206c\u206c\u206e\u202e\u200d\u206c\u206a\u202e(orig_\u206c\u202c\u202c\u206c\u200f\u202d\u200d\u200d\u206c\u206f\u202e\u206f\u202e\u206e\u206c\u202d\u202d\u206c\u200d\u202b\u200f\u200e\u200f\u202e\u206c\u200f\u200c\u202e\u202a\u200d\u206d\u206a\u202a\u206c\u206c\u206e\u202e\u200d\u206c\u206a\u202e orig, Texture P_1); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Texture2D orig_\u200e\u200e\u206a\u202b\u200f\u202c\u206d\u206f\u202e\u206d\u200d\u206d\u206c\u206c\u206b\u206d\u202d\u202e\u200c\u202e\u200b\u206c\u200d\u206d\u202d\u200c\u206e\u206c\u200c\u206a\u202e\u202c\u202b\u206d\u202c\u206f\u200e\u202e\u202b\u202e\u202e(int P_0, int P_1, TextureFormat P_2, bool P_3, bool P_4); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Texture2D hook_\u200e\u200e\u206a\u202b\u200f\u202c\u206d\u206f\u202e\u206d\u200d\u206d\u206c\u206c\u206b\u206d\u202d\u202e\u200c\u202e\u200b\u206c\u200d\u206d\u202d\u200c\u206e\u206c\u200c\u206a\u202e\u202c\u202b\u206d\u202c\u206f\u200e\u202e\u202b\u202e\u202e(orig_\u200e\u200e\u206a\u202b\u200f\u202c\u206d\u206f\u202e\u206d\u200d\u206d\u206c\u206c\u206b\u206d\u202d\u202e\u200c\u202e\u200b\u206c\u200d\u206d\u202d\u200c\u206e\u206c\u200c\u206a\u202e\u202c\u202b\u206d\u202c\u206f\u200e\u202e\u202b\u202e\u202e orig, int P_1, int P_2, TextureFormat P_3, bool P_4, bool P_5); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool orig_\u200f\u202a\u200b\u200f\u202c\u200c\u200e\u206a\u206a\u202e\u202c\u202b\u206d\u206a\u202c\u200b\u202c\u200f\u202c\u200d\u200f\u202e\u206e\u200c\u202d\u206f\u206c\u200b\u206a\u200b\u202a\u200c\u200c\u202b\u206f\u200c\u206c\u206e\u206d\u206f\u202e(Texture2D P_0, int P_1, int P_2, TextureFormat P_3, bool P_4); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool hook_\u200f\u202a\u200b\u200f\u202c\u200c\u200e\u206a\u206a\u202e\u202c\u202b\u206d\u206a\u202c\u200b\u202c\u200f\u202c\u200d\u200f\u202e\u206e\u200c\u202d\u206f\u206c\u200b\u206a\u200b\u202a\u200c\u200c\u202b\u206f\u200c\u206c\u206e\u206d\u206f\u202e(orig_\u200f\u202a\u200b\u200f\u202c\u200c\u200e\u206a\u206a\u202e\u202c\u202b\u206d\u206a\u202c\u200b\u202c\u200f\u202c\u200d\u200f\u202e\u206e\u200c\u202d\u206f\u206c\u200b\u206a\u200b\u202a\u200c\u200c\u202b\u206f\u200c\u206c\u206e\u206d\u206f\u202e orig, Texture2D P_1, int P_2, int P_3, TextureFormat P_4, bool P_5); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_\u202e\u202c\u206f\u202e\u202c\u206d\u200b\u202b\u206b\u200f\u202e\u206e\u200e\u200c\u202c\u206d\u206b\u206a\u206b\u200b\u200b\u206a\u206e\u206e\u202c\u200d\u206c\u206d\u200e\u200b\u200c\u202b\u206b\u206c\u200d\u206d\u206f\u200d\u206d\u206b\u202e(Texture2D P_0, Rect P_1, int P_2, int P_3); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_\u202e\u202c\u206f\u202e\u202c\u206d\u200b\u202b\u206b\u200f\u202e\u206e\u200e\u200c\u202c\u206d\u206b\u206a\u206b\u200b\u200b\u206a\u206e\u206e\u202c\u200d\u206c\u206d\u200e\u200b\u200c\u202b\u206b\u206c\u200d\u206d\u206f\u200d\u206d\u206b\u202e(orig_\u202e\u202c\u206f\u202e\u202c\u206d\u200b\u202b\u206b\u200f\u202e\u206e\u200e\u200c\u202c\u206d\u206b\u206a\u206b\u200b\u200b\u206a\u206e\u206e\u202c\u200d\u206c\u206d\u200e\u200b\u200c\u202b\u206b\u206c\u200d\u206d\u206f\u200d\u206d\u206b\u202e orig, Texture2D P_1, Rect P_2, int P_3, int P_4); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool orig_\u202c\u206c\u206b\u202c\u200d\u206e\u206f\u200c\u202b\u200e\u202a\u206e\u200e\u200e\u202a\u200e\u202c\u206a\u202e\u200d\u200c\u200d\u202b\u206a\u200d\u200e\u206d\u200d\u200f\u202c\u202a\u202e\u202c\u206c\u206b\u206f\u206b\u206b\u206f\u206f\u202e(); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool hook_\u202c\u206c\u206b\u202c\u200d\u206e\u206f\u200c\u202b\u200e\u202a\u206e\u200e\u200e\u202a\u200e\u202c\u206a\u202e\u200d\u200c\u200d\u202b\u206a\u200d\u200e\u206d\u200d\u200f\u202c\u202a\u202e\u202c\u206c\u206b\u206f\u206b\u206b\u206f\u206f\u202e(orig_\u202c\u206c\u206b\u202c\u200d\u206e\u206f\u200c\u202b\u200e\u202a\u206e\u200e\u200e\u202a\u200e\u202c\u206a\u202e\u200d\u200c\u200d\u202b\u206a\u200d\u200e\u206d\u200d\u200f\u202c\u202a\u202e\u202c\u206c\u206b\u206f\u206b\u206b\u206f\u206f\u202e orig); [EditorBrowsable(EditorBrowsableState.Never)] public delegate string orig_\u200f\u206c\u202e\u206a\u206a\u202d\u200e\u200d\u200c\u206c\u202d\u200e\u200c\u206d\u206a\u202a\u202c\u202a\u200e\u200b\u206a\u202a\u202d\u200e\u200c\u206e\u202a\u206b\u206e\u200c\u202d\u206c\u206d\u202c\u202e\u202b\u202e\u202b\u200f\u202b\u202e(string P_0, object P_1, object P_2); [EditorBrowsable(EditorBrowsableState.Never)] public delegate string hook_\u200f\u206c\u202e\u206a\u206a\u202d\u200e\u200d\u200c\u206c\u202d\u200e\u200c\u206d\u206a\u202a\u202c\u202a\u200e\u200b\u206a\u202a\u202d\u200e\u200c\u206e\u202a\u206b\u206e\u200c\u202d\u206c\u206d\u202c\u202e\u202b\u202e\u202b\u200f\u202b\u202e(orig_\u200f\u206c\u202e\u206a\u206a\u202d\u200e\u200d\u200c\u206c\u202d\u200e\u200c\u206d\u206a\u202a\u202c\u202a\u200e\u200b\u206a\u202a\u202d\u200e\u200c\u206e\u202a\u206b\u206e\u200c\u202d\u206c\u206d\u202c\u202e\u202b\u202e\u202b\u200f\u202b\u202e orig, string P_1, object P_2, object P_3); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Color[] orig_\u200d\u200e\u202c\u202c\u206b\u202a\u200b\u206f\u206d\u202c\u206b\u206f\u206f\u202e\u202e\u200d\u206c\u202a\u202a\u206f\u200d\u206c\u200d\u206d\u206a\u206e\u202d\u202a\u206d\u206d\u202c\u202a\u206f\u200d\u206f\u202e\u202a\u200b\u200e\u206f\u202e(Texture2D P_0, int P_1, int P_2, int P_3, int P_4); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Color[] hook_\u200d\u200e\u202c\u202c\u206b\u202a\u200b\u206f\u206d\u202c\u206b\u206f\u206f\u202e\u202e\u200d\u206c\u202a\u202a\u206f\u200d\u206c\u200d\u206d\u206a\u206e\u202d\u202a\u206d\u206d\u202c\u202a\u206f\u200d\u206f\u202e\u202a\u200b\u200e\u206f\u202e(orig_\u200d\u200e\u202c\u202c\u206b\u202a\u200b\u206f\u206d\u202c\u206b\u206f\u206f\u202e\u202e\u200d\u206c\u202a\u202a\u206f\u200d\u206c\u200d\u206d\u206a\u206e\u202d\u202a\u206d\u206d\u202c\u202a\u206f\u200d\u206f\u202e\u202a\u200b\u200e\u206f\u202e orig, Texture2D P_1, int P_2, int P_3, int P_4, int P_5); [EditorBrowsable(EditorBrowsableState.Never)] public delegate TextureFormat orig_\u200b\u206f\u206e\u200d\u206a\u202a\u206a\u206d\u206f\u200f\u200e\u202b\u202e\u200d\u202d\u200e\u202c\u206e\u200f\u200b\u202d\u202c\u202b\u200c\u202d\u206c\u200d\u202b\u206a\u200f\u206e\u202b\u202a\u200c\u206f\u206a\u200e\u202e\u202a\u200d\u202e(Texture2D P_0); [EditorBrowsable(EditorBrowsableState.Never)] public delegate TextureFormat hook_\u200b\u206f\u206e\u200d\u206a\u202a\u206a\u206d\u206f\u200f\u200e\u202b\u202e\u200d\u202d\u200e\u202c\u206e\u200f\u200b\u202d\u202c\u202b\u200c\u202d\u206c\u200d\u202b\u206a\u200f\u206e\u202b\u202a\u200c\u206f\u206a\u200e\u202e\u202a\u200d\u202e(orig_\u200b\u206f\u206e\u200d\u206a\u202a\u206a\u206d\u206f\u200f\u200e\u202b\u202e\u200d\u202d\u200e\u202c\u206e\u200f\u200b\u202d\u202c\u202b\u200c\u202d\u206c\u200d\u202b\u206a\u200f\u206e\u202b\u202a\u200c\u206f\u206a\u200e\u202e\u202a\u200d\u202e orig, Texture2D P_1); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_\u206d\u200d\u206b\u200c\u200e\u206b\u202e\u202e\u206d\u202e\u206c\u202d\u206d\u200e\u206b\u206a\u206f\u202b\u202a\u202c\u206a\u202e\u206a\u202c\u206a\u200e\u202b\u200c\u200c\u200e\u202a\u206f\u200b\u200b\u206f\u200f\u200c\u206a\u202c\u200d\u202e(Texture P_0, TextureWrapMode P_1); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_\u206d\u200d\u206b\u200c\u200e\u206b\u202e\u202e\u206d\u202e\u206c\u202d\u206d\u200e\u206b\u206a\u206f\u202b\u202a\u202c\u206a\u202e\u206a\u202c\u206a\u200e\u202b\u200c\u200c\u200e\u202a\u206f\u200b\u200b\u206f\u200f\u200c\u206a\u202c\u200d\u202e(orig_\u206d\u200d\u206b\u200c\u200e\u206b\u202e\u202e\u206d\u202e\u206c\u202d\u206d\u200e\u206b\u206a\u206f\u202b\u202a\u202c\u206a\u202e\u206a\u202c\u206a\u200e\u202b\u200c\u200c\u200e\u202a\u206f\u200b\u200b\u206f\u200f\u200c\u206a\u202c\u200d\u202e orig, Texture P_1, TextureWrapMode P_2); [EditorBrowsable(EditorBrowsableState.Never)] public delegate FilterMode orig_\u200e\u200e\u206f\u200c\u206d\u202c\u202d\u202b\u202e\u206c\u200d\u200e\u206a\u202e\u206c\u202c\u206e\u200b\u206d\u200b\u202d\u200f\u206a\u202d\u206e\u202b\u202c\u202c\u206f\u206e\u200d\u206d\u200d\u202d\u200d\u202c\u206a\u206f\u200d\u202a\u202e(Texture P_0); [EditorBrowsable(EditorBrowsableState.Never)] public delegate FilterMode hook_\u200e\u200e\u206f\u200c\u206d\u202c\u202d\u202b\u202e\u206c\u200d\u200e\u206a\u202e\u206c\u202c\u206e\u200b\u206d\u200b\u202d\u200f\u206a\u202d\u206e\u202b\u202c\u202c\u206f\u206e\u200d\u206d\u200d\u202d\u200d\u202c\u206a\u206f\u200d\u202a\u202e(orig_\u200e\u200e\u206f\u200c\u206d\u202c\u202d\u202b\u202e\u206c\u200d\u200e\u206a\u202e\u206c\u202c\u206e\u200b\u206d\u200b\u202d\u200f\u206a\u202d\u206e\u202b\u202c\u202c\u206f\u206e\u200d\u206d\u200d\u202d\u200d\u202c\u206a\u206f\u200d\u202a\u202e orig, Texture P_1); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_\u202c\u206d\u200f\u200c\u206e\u202c\u200b\u202b\u206f\u206a\u200c\u202e\u206a\u202b\u202a\u200b\u206f\u202b\u206b\u202a\u206c\u202b\u202e\u202b\u202e\u206b\u202d\u202b\u206c\u202d\u206c\u202a\u200f\u200e\u202d\u206a\u206f\u202b\u206d\u206a\u202e(Texture P_0, FilterMode P_1); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_\u202c\u206d\u200f\u200c\u206e\u202c\u200b\u202b\u206f\u206a\u200c\u202e\u206a\u202b\u202a\u200b\u206f\u202b\u206b\u202a\u206c\u202b\u202e\u202b\u202e\u206b\u202d\u202b\u206c\u202d\u206c\u202a\u200f\u200e\u202d\u206a\u206f\u202b\u206d\u206a\u202e(orig_\u202c\u206d\u200f\u200c\u206e\u202c\u200b\u202b\u206f\u206a\u200c\u202e\u206a\u202b\u202a\u200b\u206f\u202b\u206b\u202a\u206c\u202b\u202e\u202b\u202e\u206b\u202d\u202b\u206c\u202d\u206c\u202a\u200f\u200e\u202d\u206a\u206f\u202b\u206d\u206a\u202e orig, Texture P_1, FilterMode P_2); [EditorBrowsable(EditorBrowsableState.Never)] public delegate string orig_\u206e\u202e\u200f\u206b\u200e\u200c\u206d\u202a\u206b\u200d\u202e\u206a\u200c\u206e\u206f\u200e\u206e\u200d\u200d\u202d\u200c\u206f\u200c\u200b\u202d\u202a\u206f\u202b\u206e\u206c\u200b\u206b\u202d\u206b\u200f\u200b\u206b\u206b\u200e\u206d\u202e(Object P_0); [EditorBrowsable(EditorBrowsableState.Never)] public delegate string hook_\u206e\u202e\u200f\u206b\u200e\u200c\u206d\u202a\u206b\u200d\u202e\u206a\u200c\u206e\u206f\u200e\u206e\u200d\u200d\u202d\u200c\u206f\u200c\u200b\u202d\u202a\u206f\u202b\u206e\u206c\u200b\u206b\u202d\u206b\u200f\u200b\u206b\u206b\u200e\u206d\u202e(orig_\u206e\u202e\u200f\u206b\u200e\u200c\u206d\u202a\u206b\u200d\u202e\u206a\u200c\u206e\u206f\u200e\u206e\u200d\u200d\u202d\u200c\u206f\u200c\u200b\u202d\u202a\u206f\u202b\u206e\u206c\u200b\u206b\u202d\u206b\u200f\u200b\u206b\u206b\u200e\u206d\u202e orig, Object P_1); [EditorBrowsable(EditorBrowsableState.Never)] public delegate string orig_\u200c\u200f\u206d\u206b\u200d\u202e\u202c\u200f\u202b\u200f\u200f\u206b\u202a\u202a\u202d\u202b\u206e\u202e\u202d\u200e\u200f\u200d\u206b\u200f\u200c\u202e\u200b\u202c\u202c\u200e\u206f\u206e\u200d\u200b\u206e\u202c\u206d\u200e\u206a\u202e\u202e(string P_0, string P_1); [EditorBrowsable(EditorBrowsableState.Never)] public delegate string hook_\u200c\u200f\u206d\u206b\u200d\u202e\u202c\u200f\u202b\u200f\u200f\u206b\u202a\u202a\u202d\u202b\u206e\u202e\u202d\u200e\u200f\u200d\u206b\u200f\u200c\u202e\u200b\u202c\u202c\u200e\u206f\u206e\u200d\u200b\u206e\u202c\u206d\u200e\u206a\u202e\u202e(orig_\u200c\u200f\u206d\u206b\u200d\u202e\u202c\u200f\u202b\u200f\u200f\u206b\u202a\u202a\u202d\u202b\u206e\u202e\u202d\u200e\u200f\u200d\u206b\u200f\u200c\u202e\u200b\u202c\u202c\u200e\u206f\u206e\u200d\u200b\u206e\u202c\u206d\u200e\u206a\u202e\u202e orig, string P_1, string P_2); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_\u206e\u206b\u206b\u206b\u206c\u200b\u202e\u200e\u202b\u200d\u206b\u200c\u202b\u202c\u202c\u206f\u202a\u200e\u202e\u206c\u202c\u206b\u202c\u202c\u200b\u202a\u200b\u202c\u200d\u206c\u200b\u206d\u202e\u200e\u202d\u206d\u202b\u200d\u200c\u206b\u202e(Object P_0, string P_1); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_\u206e\u206b\u206b\u206b\u206c\u200b\u202e\u200e\u202b\u200d\u206b\u200c\u202b\u202c\u202c\u206f\u202a\u200e\u202e\u206c\u202c\u206b\u202c\u202c\u200b\u202a\u200b\u202c\u200d\u206c\u200b\u206d\u202e\u200e\u202d\u206d\u202b\u200d\u200c\u206b\u202e(orig_\u206e\u206b\u206b\u206b\u206c\u200b\u202e\u200e\u202b\u200d\u206b\u200c\u202b\u202c\u202c\u206f\u202a\u200e\u202e\u206c\u202c\u206b\u202c\u202c\u200b\u202a\u200b\u202c\u200d\u206c\u200b\u206d\u202e\u200e\u202d\u206d\u202b\u200d\u200c\u206b\u202e orig, Object P_1, string P_2); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Vector3 orig_\u202d\u200e\u200e\u200e\u200d\u206c\u200c\u206b\u200c\u200c\u202a\u202d\u202a\u200d\u206b\u200e\u206f\u202a\u206f\u206c\u202c\u206b\u206f\u206a\u202e\u200b\u206b\u202a\u202a\u206d\u202b\u206f\u206b\u200f\u200e\u200d\u202d\u200d\u202e\u200f\u202e(TerrainData P_0); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Vector3 hook_\u202d\u200e\u200e\u200e\u200d\u206c\u200c\u206b\u200c\u200c\u202a\u202d\u202a\u200d\u206b\u200e\u206f\u202a\u206f\u206c\u202c\u206b\u206f\u206a\u202e\u200b\u206b\u202a\u202a\u206d\u202b\u206f\u206b\u200f\u200e\u200d\u202d\u200d\u202e\u200f\u202e(orig_\u202d\u200e\u200e\u200e\u200d\u206c\u200c\u206b\u200c\u200c\u202a\u202d\u202a\u200d\u206b\u200e\u206f\u202a\u206f\u206c\u202c\u206b\u206f\u206a\u202e\u200b\u206b\u202a\u202a\u206d\u202b\u206f\u206b\u200f\u200e\u200d\u202d\u200d\u202e\u200f\u202e orig, TerrainData P_1); [EditorBrowsable(EditorBrowsableState.Never)] public delegate int orig_\u206e\u200c\u206b\u202e\u202b\u200f\u206c\u202a\u200b\u206b\u202b\u206c\u206b\u206e\u206e\u206e\u206c\u206c\u206b\u202b\u200c\u202a\u206a\u206d\u206a\u206b\u206d\u200e\u206c\u202e\u206e\u200e\u206a\u200e\u200c\u200b\u206b\u206f\u200d\u206e\u202e(); [EditorBrowsable(EditorBrowsableState.Never)] public delegate int hook_\u206e\u200c\u206b\u202e\u202b\u200f\u206c\u202a\u200b\u206b\u202b\u206c\u206b\u206e\u206e\u206e\u206c\u206c\u206b\u202b\u200c\u202a\u206a\u206d\u206a\u206b\u206d\u200e\u206c\u202e\u206e\u200e\u206a\u200e\u200c\u200b\u206b\u206f\u200d\u206e\u202e(orig_\u206e\u200c\u206b\u202e\u202b\u200f\u206c\u202a\u200b\u206b\u202b\u206c\u206b\u206e\u206e\u206e\u206c\u206c\u206b\u202b\u200c\u202a\u206a\u206d\u206a\u206b\u206d\u200e\u206c\u202e\u206e\u200e\u206a\u200e\u200c\u200b\u206b\u206f\u200d\u206e\u202e orig); public static class \u206b\u206a\u200c\u206b\u206a\u202a\u200d\u202a\u200f\u202b\u200b\u206b\u200d\u202c\u206c\u206c\u202a\u206e\u200c\u206d\u202a\u206b\u206c\u200e\u200c\u202b\u206e\u206e\u200b\u206f\u200f\u200e\u202e\u206b\u202d\u200f\u200b\u202a\u206d\u202c\u202e { [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_ctor(object self, TerrainData P_1, bool P_2, bool P_3); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_ctor(orig_ctor orig, object self, TerrainData P_2, bool P_3, bool P_4); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Texture2D[] orig_\u200d\u202d\u206a\u202d\u206e\u206e\u206e\u200f\u206c\u206c\u202a\u200f\u200f\u202a\u206a\u202e\u206f\u206f\u206c\u202e\u206c\u200c\u206b\u202e\u206a\u200f\u206b\u200c\u200f\u200d\u200e\u202b\u200f\u200c\u206c\u206d\u202c\u206f\u202a\u200e\u202e(object self, int P_1); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Texture2D[] hook_\u200d\u202d\u206a\u202d\u206e\u206e\u206e\u200f\u206c\u206c\u202a\u200f\u200f\u202a\u206a\u202e\u206f\u206f\u206c\u202e\u206c\u200c\u206b\u202e\u206a\u200f\u206b\u200c\u200f\u200d\u200e\u202b\u200f\u200c\u206c\u206d\u202c\u206f\u202a\u200e\u202e(orig_\u200d\u202d\u206a\u202d\u206e\u206e\u206e\u200f\u206c\u206c\u202a\u200f\u200f\u202a\u206a\u202e\u206f\u206f\u206c\u202e\u206c\u200c\u206b\u202e\u206a\u200f\u206b\u200c\u200f\u200d\u200e\u202b\u200f\u200c\u206c\u206d\u202c\u206f\u202a\u200e\u202e orig, object self, int P_2); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Texture2D[] orig_\u202b\u200f\u206d\u202b\u202e\u206b\u206c\u202d\u206d\u200e\u202c\u206d\u206f\u202b\u200f\u202a\u200c\u206c\u206e\u206b\u202c\u202c\u200b\u200c\u202c\u200f\u206c\u202a\u202b\u206c\u200d\u202c\u202b\u200c\u206b\u202b\u200f\u200b\u206c\u206e\u202e(object self, int P_1, int P_2, int P_3, int P_4, int P_5); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Texture2D[] hook_\u202b\u200f\u206d\u202b\u202e\u206b\u206c\u202d\u206d\u200e\u202c\u206d\u206f\u202b\u200f\u202a\u200c\u206c\u206e\u206b\u202c\u202c\u200b\u200c\u202c\u200f\u206c\u202a\u202b\u206c\u200d\u202c\u202b\u200c\u206b\u202b\u200f\u200b\u206c\u206e\u202e(orig_\u202b\u200f\u206d\u202b\u202e\u206b\u206c\u202d\u206d\u200e\u202c\u206d\u206f\u202b\u200f\u202a\u200c\u206c\u206e\u206b\u202c\u202c\u200b\u200c\u202c\u200f\u206c\u202a\u202b\u206c\u200d\u202c\u202b\u200c\u206b\u202b\u200f\u200b\u206c\u206e\u202e orig, object self, int P_2, int P_3, int P_4, int P_5, int P_6); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Texture2D[] orig_\u206e\u202e\u206d\u206f\u200c\u202d\u206d\u202d\u200b\u200b\u200c\u206c\u206f\u202d\u200b\u206e\u202d\u200c\u202a\u206b\u202e\u202c\u202a\u202e\u206c\u200b\u202c\u200d\u202b\u200e\u206a\u202e\u206f\u202e\u202b\u202d\u206e\u206d\u200c\u200d\u202e(object self, int P_1, int P_2, int P_3); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Texture2D[] hook_\u206e\u202e\u206d\u206f\u200c\u202d\u206d\u202d\u200b\u200b\u200c\u206c\u206f\u202d\u200b\u206e\u202d\u200c\u202a\u206b\u202e\u202c\u202a\u202e\u206c\u200b\u202c\u200d\u202b\u200e\u206a\u202e\u206f\u202e\u202b\u202d\u206e\u206d\u200c\u200d\u202e(orig_\u206e\u202e\u206d\u206f\u200c\u202d\u206d\u202d\u200b\u200b\u200c\u206c\u206f\u202d\u200b\u206e\u202d\u200c\u202a\u206b\u202e\u202c\u202a\u202e\u206c\u200b\u202c\u200d\u202b\u200e\u206a\u202e\u206f\u202e\u202b\u202d\u206e\u206d\u200c\u200d\u202e orig, object self, int P_2, int P_3, int P_4); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Texture2D orig_\u206e\u206e\u200e\u206d\u200d\u200d\u200b\u206f\u206f\u200b\u206b\u206c\u206c\u202a\u206e\u206e\u206d\u202e\u206f\u202d\u206c\u206b\u206f\u202d\u202a\u202b\u206d\u206d\u202d\u200d\u200f\u202e\u202e\u206b\u200d\u206c\u200e\u206a\u200f\u202a\u202e(object self, int P_1, bool P_2, bool P_3); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Texture2D hook_\u206e\u206e\u200e\u206d\u200d\u200d\u200b\u206f\u206f\u200b\u206b\u206c\u206c\u202a\u206e\u206e\u206d\u202e\u206f\u202d\u206c\u206b\u206f\u202d\u202a\u202b\u206d\u206d\u202d\u200d\u200f\u202e\u202e\u206b\u200d\u206c\u200e\u206a\u200f\u202a\u202e(orig_\u206e\u206e\u200e\u206d\u200d\u200d\u200b\u206f\u206f\u200b\u206b\u206c\u206c\u202a\u206e\u206e\u206d\u202e\u206f\u202d\u206c\u206b\u206f\u202d\u202a\u202b\u206d\u206d\u202d\u200d\u200f\u202e\u202e\u206b\u200d\u206c\u200e\u206a\u200f\u202a\u202e orig, object self, int P_2, bool P_3, bool P_4); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Texture2D orig_\u206d\u200c\u200d\u206c\u202a\u206c\u200e\u202b\u200d\u206e\u202b\u200d\u202a\u202d\u206b\u202b\u200b\u206a\u200f\u206d\u200f\u200f\u206a\u206b\u202a\u206c\u202a\u200e\u200e\u200e\u202c\u202b\u206e\u200c\u202d\u206b\u202e\u200b\u200b\u206f\u202e(object self, int P_1, bool P_2, bool P_3, int P_4, int P_5, int P_6, int P_7); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Texture2D hook_\u206d\u200c\u200d\u206c\u202a\u206c\u200e\u202b\u200d\u206e\u202b\u200d\u202a\u202d\u206b\u202b\u200b\u206a\u200f\u206d\u200f\u200f\u206a\u206b\u202a\u206c\u202a\u200e\u200e\u200e\u202c\u202b\u206e\u200c\u202d\u206b\u202e\u200b\u200b\u206f\u202e(orig_\u206d\u200c\u200d\u206c\u202a\u206c\u200e\u202b\u200d\u206e\u202b\u200d\u202a\u202d\u206b\u202b\u200b\u206a\u200f\u206d\u200f\u200f\u206a\u206b\u202a\u206c\u202a\u200e\u200e\u200e\u202c\u202b\u206e\u200c\u202d\u206b\u202e\u200b\u200b\u206f\u202e orig, object self, int P_2, bool P_3, bool P_4, int P_5, int P_6, int P_7, int P_8); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Texture2D[] orig_\u206c\u202d\u200c\u206d\u202d\u202c\u206a\u206a\u202e\u206d\u206c\u206e\u200b\u206d\u202c\u202b\u202d\u206a\u200c\u206f\u206a\u202e\u202d\u206f\u200f\u206b\u200f\u202e\u202d\u200c\u202a\u200f\u200b\u202d\u202a\u206c\u202c\u206c\u206b\u202a\u202e(object self, int P_1, bool P_2, bool P_3, int P_4, int P_5); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Texture2D[] hook_\u206c\u202d\u200c\u206d\u202d\u202c\u206a\u206a\u202e\u206d\u206c\u206e\u200b\u206d\u202c\u202b\u202d\u206a\u200c\u206f\u206a\u202e\u202d\u206f\u200f\u206b\u200f\u202e\u202d\u200c\u202a\u200f\u200b\u202d\u202a\u206c\u202c\u206c\u206b\u202a\u202e(orig_\u206c\u202d\u200c\u206d\u202d\u202c\u206a\u206a\u202e\u206d\u206c\u206e\u200b\u206d\u202c\u202b\u202d\u206a\u200c\u206f\u206a\u202e\u202d\u206f\u200f\u206b\u200f\u202e\u202d\u200c\u202a\u200f\u200b\u202d\u202a\u206c\u202c\u206c\u206b\u202a\u202e orig, object self, int P_2, bool P_3, bool P_4, int P_5, int P_6); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Texture2D orig_\u200f\u202a\u206e\u206e\u202d\u202c\u206d\u200d\u202b\u202b\u200c\u202b\u200e\u200b\u202b\u206b\u206e\u202d\u202c\u206e\u206f\u202a\u202c\u206f\u200b\u202e\u206c\u200e\u206c\u202a\u200c\u206c\u200e\u202d\u206d\u206e\u202c\u200c\u202d\u206c\u202e(object self, int P_1, bool P_2); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Texture2D hook_\u200f\u202a\u206e\u206e\u202d\u202c\u206d\u200d\u202b\u202b\u200c\u202b\u200e\u200b\u202b\u206b\u206e\u202d\u202c\u206e\u206f\u202a\u202c\u206f\u200b\u202e\u206c\u200e\u206c\u202a\u200c\u206c\u200e\u202d\u206d\u206e\u202c\u200c\u202d\u206c\u202e(orig_\u200f\u202a\u206e\u206e\u202d\u202c\u206d\u200d\u202b\u202b\u200c\u202b\u200e\u200b\u202b\u206b\u206e\u202d\u202c\u206e\u206f\u202a\u202c\u206f\u200b\u202e\u206c\u200e\u206c\u202a\u200c\u206c\u200e\u202d\u206d\u206e\u202c\u200c\u202d\u206c\u202e orig, object self, int P_2, bool P_3); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Texture2D orig_\u200d\u200b\u206a\u202b\u200f\u202b\u202c\u200c\u200e\u206d\u206c\u206d\u206b\u202a\u202d\u202b\u202d\u200d\u202a\u206c\u200d\u206d\u206a\u202d\u202e\u202b\u206c\u200b\u206f\u202e\u206e\u202e\u200d\u206a\u202b\u202a\u202d\u206a\u202e\u206a\u202e(object self, int P_1, bool P_2); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Texture2D hook_\u200d\u200b\u206a\u202b\u200f\u202b\u202c\u200c\u200e\u206d\u206c\u206d\u206b\u202a\u202d\u202b\u202d\u200d\u202a\u206c\u200d\u206d\u206a\u202d\u202e\u202b\u206c\u200b\u206f\u202e\u206e\u202e\u200d\u206a\u202b\u202a\u202d\u206a\u202e\u206a\u202e(orig_\u200d\u200b\u206a\u202b\u200f\u202b\u202c\u200c\u200e\u206d\u206c\u206d\u206b\u202a\u202d\u202b\u202d\u200d\u202a\u206c\u200d\u206d\u206a\u202d\u202e\u202b\u206c\u200b\u206f\u202e\u206e\u202e\u200d\u206a\u202b\u202a\u202d\u206a\u202e\u206a\u202e orig, object self, int P_2, bool P_3); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Texture2D orig_\u202e\u202e\u202c\u206e\u206c\u202d\u200e\u206e\u200c\u202c\u206b\u206a\u202a\u200f\u200d\u202c\u206c\u206c\u202d\u200e\u200e\u200f\u206a\u202c\u200f\u200b\u206b\u200d\u202d\u200c\u206d\u202e\u200c\u200d\u206a\u200e\u206b\u202d\u200d\u200e\u202e(object self, int P_1, bool P_2); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Texture2D hook_\u202e\u202e\u202c\u206e\u206c\u202d\u200e\u206e\u200c\u202c\u206b\u206a\u202a\u200f\u200d\u202c\u206c\u206c\u202d\u200e\u200e\u200f\u206a\u202c\u200f\u200b\u206b\u200d\u202d\u200c\u206d\u202e\u200c\u200d\u206a\u200e\u206b\u202d\u200d\u200e\u202e(orig_\u202e\u202e\u202c\u206e\u206c\u202d\u200e\u206e\u200c\u202c\u206b\u206a\u202a\u200f\u200d\u202c\u206c\u206c\u202d\u200e\u200e\u200f\u206a\u202c\u200f\u200b\u206b\u200d\u202d\u200c\u206d\u202e\u200c\u200d\u206a\u200e\u206b\u202d\u200d\u200e\u202e orig, object self, int P_2, bool P_3); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Texture2D orig_\u202e\u206e\u202d\u206e\u200b\u200e\u202b\u206c\u206f\u200c\u202c\u200d\u200c\u200f\u202a\u200c\u200c\u200f\u200b\u202e\u206e\u206e\u202e\u202b\u200d\u200c\u206e\u206a\u206a\u200c\u202c\u200b\u200b\u206f\u206f\u206b\u206c\u202b\u206e\u206c\u202e(object self, int P_1, bool P_2, int P_3, int P_4, int P_5, int P_6); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Texture2D hook_\u202e\u206e\u202d\u206e\u200b\u200e\u202b\u206c\u206f\u200c\u202c\u200d\u200c\u200f\u202a\u200c\u200c\u200f\u200b\u202e\u206e\u206e\u202e\u202b\u200d\u200c\u206e\u206a\u206a\u200c\u202c\u200b\u200b\u206f\u206f\u206b\u206c\u202b\u206e\u206c\u202e(orig_\u202e\u206e\u202d\u206e\u200b\u200e\u202b\u206c\u206f\u200c\u202c\u200d\u200c\u200f\u202a\u200c\u200c\u200f\u200b\u202e\u206e\u206e\u202e\u202b\u200d\u200c\u206e\u206a\u206a\u200c\u202c\u200b\u200b\u206f\u206f\u206b\u206c\u202b\u206e\u206c\u202e orig, object self, int P_2, bool P_3, int P_4, int P_5, int P_6, int P_7); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Texture2D[] orig_\u200f\u200c\u202e\u202c\u202c\u206c\u202c\u206e\u202e\u200d\u200b\u200d\u200f\u200f\u202b\u200e\u202e\u200e\u200f\u202d\u202d\u200f\u202a\u206d\u202a\u200b\u206c\u200b\u206c\u206c\u206e\u200e\u202e\u206a\u202d\u200b\u202c\u206a\u200f\u200d\u202e(object self, int P_1, bool P_2, int P_3, int P_4); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Texture2D[] hook_\u200f\u200c\u202e\u202c\u202c\u206c\u202c\u206e\u202e\u200d\u200b\u200d\u200f\u200f\u202b\u200e\u202e\u200e\u200f\u202d\u202d\u200f\u202a\u206d\u202a\u200b\u206c\u200b\u206c\u206c\u206e\u200e\u202e\u206a\u202d\u200b\u202c\u206a\u200f\u200d\u202e(orig_\u200f\u200c\u202e\u202c\u202c\u206c\u202c\u206e\u202e\u200d\u200b\u200d\u200f\u200f\u202b\u200e\u202e\u200e\u200f\u202d\u202d\u200f\u202a\u206d\u202a\u200b\u206c\u200b\u206c\u206c\u206e\u200e\u202e\u206a\u202d\u200b\u202c\u206a\u200f\u200d\u202e orig, object self, int P_2, bool P_3, int P_4, int P_5); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Texture2D orig_\u206b\u206e\u200b\u202c\u202a\u202b\u202d\u202a\u200d\u200f\u206b\u200f\u206b\u200f\u202b\u202d\u202a\u200f\u200e\u206a\u202c\u202e\u202a\u206c\u200d\u202a\u202a\u200f\u200d\u200f\u200c\u206a\u206e\u206e\u202b\u206e\u206b\u200f\u206d\u200c\u202e(object self, int P_1, bool P_2); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Texture2D hook_\u206b\u206e\u200b\u202c\u202a\u202b\u202d\u202a\u200d\u200f\u206b\u200f\u206b\u200f\u202b\u202d\u202a\u200f\u200e\u206a\u202c\u202e\u202a\u206c\u200d\u202a\u202a\u200f\u200d\u200f\u200c\u206a\u206e\u206e\u202b\u206e\u206b\u200f\u206d\u200c\u202e(orig_\u206b\u206e\u200b\u202c\u202a\u202b\u202d\u202a\u200d\u200f\u206b\u200f\u206b\u200f\u202b\u202d\u202a\u200f\u200e\u206a\u202c\u202e\u202a\u206c\u200d\u202a\u202a\u200f\u200d\u200f\u200c\u206a\u206e\u206e\u202b\u206e\u206b\u200f\u206d\u200c\u202e orig, object self, int P_2, bool P_3); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Texture2D orig_\u200c\u206e\u200e\u200d\u200b\u202e\u200f\u206e\u202c\u206a\u206f\u206c\u202b\u206d\u202c\u202e\u206e\u206e\u206a\u202d\u200f\u202d\u200f\u202d\u202a\u200d\u202d\u200e\u200b\u206a\u202c\u206d\u200c\u206d\u206e\u200c\u200d\u200c\u202d\u200f\u202e(object self, int P_1, bool P_2); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Texture2D hook_\u200c\u206e\u200e\u200d\u200b\u202e\u200f\u206e\u202c\u206a\u206f\u206c\u202b\u206d\u202c\u202e\u206e\u206e\u206a\u202d\u200f\u202d\u200f\u202d\u202a\u200d\u202d\u200e\u200b\u206a\u202c\u206d\u200c\u206d\u206e\u200c\u200d\u200c\u202d\u200f\u202e(orig_\u200c\u206e\u200e\u200d\u200b\u202e\u200f\u206e\u202c\u206a\u206f\u206c\u202b\u206d\u202c\u202e\u206e\u206e\u206a\u202d\u200f\u202d\u200f\u202d\u202a\u200d\u202d\u200e\u200b\u206a\u202c\u206d\u200c\u206d\u206e\u200c\u200d\u200c\u202d\u200f\u202e orig, object self, int P_2, bool P_3); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Texture2D orig_\u200d\u202c\u206b\u200e\u202b\u200b\u202d\u206c\u206f\u202c\u202d\u206a\u202e\u200b\u202b\u202e\u202a\u200f\u206a\u202a\u200c\u206a\u202d\u200c\u206b\u202b\u206c\u206c\u200b\u206c\u200f\u202e\u200f\u200e\u200f\u206e\u200e\u206d\u200f\u200e\u202e(object self, int P_1); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Texture2D hook_\u200d\u202c\u206b\u200e\u202b\u200b\u202d\u206c\u206f\u202c\u202d\u206a\u202e\u200b\u202b\u202e\u202a\u200f\u206a\u202a\u200c\u206a\u202d\u200c\u206b\u202b\u206c\u206c\u200b\u206c\u200f\u202e\u200f\u200e\u200f\u206e\u200e\u206d\u200f\u200e\u202e(orig_\u200d\u202c\u206b\u200e\u202b\u200b\u202d\u206c\u206f\u202c\u202d\u206a\u202e\u200b\u202b\u202e\u202a\u200f\u206a\u202a\u200c\u206a\u202d\u200c\u206b\u202b\u206c\u206c\u200b\u206c\u200f\u202e\u200f\u200e\u200f\u206e\u200e\u206d\u200f\u200e\u202e orig, object self, int P_2); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Texture2D orig_\u200c\u202c\u206d\u200e\u206f\u206a\u202d\u206a\u206e\u202c\u202b\u206d\u200c\u206f\u202c\u200c\u200f\u200c\u202d\u200f\u200b\u206b\u200f\u206b\u202a\u200d\u200e\u202c\u202b\u200e\u200e\u202b\u206e\u200b\u200e\u206c\u202a\u200f\u200d\u206a\u202e(object self, int P_1, int P_2, int P_3, int P_4, int P_5); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Texture2D hook_\u200c\u202c\u206d\u200e\u206f\u206a\u202d\u206a\u206e\u202c\u202b\u206d\u200c\u206f\u202c\u200c\u200f\u200c\u202d\u200f\u200b\u206b\u200f\u206b\u202a\u200d\u200e\u202c\u202b\u200e\u200e\u202b\u206e\u200b\u200e\u206c\u202a\u200f\u200d\u206a\u202e(orig_\u200c\u202c\u206d\u200e\u206f\u206a\u202d\u206a\u206e\u202c\u202b\u206d\u200c\u206f\u202c\u200c\u200f\u200c\u202d\u200f\u200b\u206b\u200f\u206b\u202a\u200d\u200e\u202c\u202b\u200e\u200e\u202b\u206e\u200b\u200e\u206c\u202a\u200f\u200d\u206a\u202e orig, object self, int P_2, int P_3, int P_4, int P_5, int P_6); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Texture2D[] orig_\u200e\u200f\u206f\u202d\u202e\u200d\u202b\u202d\u206d\u206b\u200b\u202d\u200e\u202a\u200b\u200b\u206d\u200e\u200b\u200c\u202e\u202c\u202d\u202a\u202c\u202e\u200e\u206a\u206d\u202e\u206f\u200d\u200e\u206c\u200c\u202c\u202b\u202c\u202c\u202b\u202e(object self, int P_1, int P_2, int P_3); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Texture2D[] hook_\u200e\u200f\u206f\u202d\u202e\u200d\u202b\u202d\u206d\u206b\u200b\u202d\u200e\u202a\u200b\u200b\u206d\u200e\u200b\u200c\u202e\u202c\u202d\u202a\u202c\u202e\u200e\u206a\u206d\u202e\u206f\u200d\u200e\u206c\u200c\u202c\u202b\u202c\u202c\u202b\u202e(orig_\u200e\u200f\u206f\u202d\u202e\u200d\u202b\u202d\u206d\u206b\u200b\u202d\u200e\u202a\u200b\u200b\u206d\u200e\u200b\u200c\u202e\u202c\u202d\u202a\u202c\u202e\u200e\u206a\u206d\u202e\u206f\u200d\u200e\u206c\u200c\u202c\u202b\u202c\u202c\u202b\u202e orig, object self, int P_2, int P_3, int P_4); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Vector2 orig_\u200b\u206a\u206b\u206c\u206b\u200d\u200f\u206d\u206d\u202a\u206f\u200b\u206c\u206f\u202b\u200c\u200b\u200c\u206e\u206a\u202d\u206d\u200d\u200c\u202a\u202b\u200b\u206e\u200d\u202d\u202c\u206a\u200d\u202e\u202b\u206f\u206d\u200b\u206c\u202e\u202e(object self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Vector2 hook_\u200b\u206a\u206b\u206c\u206b\u200d\u200f\u206d\u206d\u202a\u206f\u200b\u206c\u206f\u202b\u200c\u200b\u200c\u206e\u206a\u202d\u206d\u200d\u200c\u202a\u202b\u200b\u206e\u200d\u202d\u202c\u206a\u200d\u202e\u202b\u206f\u206d\u200b\u206c\u202e\u202e(orig_\u200b\u206a\u206b\u206c\u206b\u200d\u200f\u206d\u206d\u202a\u206f\u200b\u206c\u206f\u202b\u200c\u200b\u200c\u206e\u206a\u202d\u206d\u200d\u200c\u202a\u202b\u200b\u206e\u200d\u202d\u202c\u206a\u200d\u202e\u202b\u206f\u206d\u200b\u206c\u202e\u202e orig, object self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool orig_\u200c\u202a\u206b\u200d\u200f\u206e\u200c\u200c\u206e\u202a\u200b\u206b\u206a\u206d\u200c\u200c\u200b\u202b\u202e\u200f\u200f\u206f\u206b\u200d\u200b\u202d\u206c\u206d\u200f\u206a\u206f\u200f\u206b\u200c\u206f\u202e\u200d\u206f\u206d\u206d\u202e(Object P_0, Object P_1); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool hook_\u200c\u202a\u206b\u200d\u200f\u206e\u200c\u200c\u206e\u202a\u200b\u206b\u206a\u206d\u200c\u200c\u200b\u202b\u202e\u200f\u200f\u206f\u206b\u200d\u200b\u202d\u206c\u206d\u200f\u206a\u206f\u200f\u206b\u200c\u206f\u202e\u200d\u206f\u206d\u206d\u202e(orig_\u200c\u202a\u206b\u200d\u200f\u206e\u200c\u200c\u206e\u202a\u200b\u206b\u206a\u206d\u200c\u200c\u200b\u202b\u202e\u200f\u200f\u206f\u206b\u200d\u200b\u202d\u206c\u206d\u200f\u206a\u206f\u200f\u206b\u200c\u206f\u202e\u200d\u206f\u206d\u206d\u202e orig, Object P_1, Object P_2); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Texture2D[] orig_\u202c\u206c\u200c\u206f\u206f\u206e\u200b\u200d\u206b\u202b\u206c\u200c\u202b\u206b\u206e\u202b\u202d\u206c\u206a\u206d\u206b\u202b\u200d\u206d\u202d\u206c\u200f\u206f\u202c\u202d\u206d\u202a\u206e\u200e\u200b\u202e\u202b\u200b\u200b\u206c\u202e(TerrainData P_0); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Texture2D[] hook_\u202c\u206c\u200c\u206f\u206f\u206e\u200b\u200d\u206b\u202b\u206c\u200c\u202b\u206b\u206e\u202b\u202d\u206c\u206a\u206d\u206b\u202b\u200d\u206d\u202d\u206c\u200f\u206f\u202c\u202d\u206d\u202a\u206e\u200e\u200b\u202e\u202b\u200b\u200b\u206c\u202e(orig_\u202c\u206c\u200c\u206f\u206f\u206e\u200b\u200d\u206b\u202b\u206c\u200c\u202b\u206b\u206e\u202b\u202d\u206c\u206a\u206d\u206b\u202b\u200d\u206d\u202d\u206c\u200f\u206f\u202c\u202d\u206d\u202a\u206e\u200e\u200b\u202e\u202b\u200b\u200b\u206c\u202e orig, TerrainData P_1); [EditorBrowsable(EditorBrowsableState.Never)] public delegate string orig_\u200d\u202d\u206b\u206f\u206d\u200b\u202b\u202e\u206f\u200f\u200f\u202e\u200d\u200b\u200f\u202d\u206f\u206f\u206f\u206c\u206f\u206e\u200b\u202a\u200f\u206f\u206e\u206c\u200f\u206a\u200d\u202c\u202d\u202b\u206a\u200e\u200b\u206e\u206c\u202e\u202e(Object P_0); [EditorBrowsable(EditorBrowsableState.Never)] public delegate string hook_\u200d\u202d\u206b\u206f\u206d\u200b\u202b\u202e\u206f\u200f\u200f\u202e\u200d\u200b\u200f\u202d\u206f\u206f\u206f\u206c\u206f\u206e\u200b\u202a\u200f\u206f\u206e\u206c\u200f\u206a\u200d\u202c\u202d\u202b\u206a\u200e\u200b\u206e\u206c\u202e\u202e(orig_\u200d\u202d\u206b\u206f\u206d\u200b\u202b\u202e\u206f\u200f\u200f\u202e\u200d\u200b\u200f\u202d\u206f\u206f\u206f\u206c\u206f\u206e\u200b\u202a\u200f\u206f\u206e\u206c\u200f\u206a\u200d\u202c\u202d\u202b\u206a\u200e\u200b\u206e\u206c\u202e\u202e orig, Object P_1); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool orig_\u206b\u202c\u206e\u206c\u206f\u206d\u200d\u202c\u200e\u206b\u202a\u202d\u206b\u202c\u206d\u206b\u206a\u206a\u206a\u202b\u202c\u206a\u206a\u206d\u206d\u202c\u202d\u206f\u202c\u200b\u206c\u200f\u206a\u200e\u202b\u200c\u200e\u202c\u202c\u206e\u202e(string P_0); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool hook_\u206b\u202c\u206e\u206c\u206f\u206d\u200d\u202c\u200e\u206b\u202a\u202d\u206b\u202c\u206d\u206b\u206a\u206a\u206a\u202b\u202c\u206a\u206a\u206d\u206d\u202c\u202d\u206f\u202c\u200b\u206c\u200f\u206a\u200e\u202b\u200c\u200e\u202c\u202c\u206e\u202e(orig_\u206b\u202c\u206e\u206c\u206f\u206d\u200d\u202c\u200e\u206b\u202a\u202d\u206b\u202c\u206d\u206b\u206a\u206a\u206a\u202b\u202c\u206a\u206a\u206d\u206d\u202c\u202d\u206f\u202c\u200b\u206c\u200f\u206a\u200e\u202b\u200c\u200e\u202c\u202c\u206e\u202e orig, string P_1); [EditorBrowsable(EditorBrowsableState.Never)] public delegate string orig_\u200e\u206c\u202d\u202a\u206a\u202a\u202e\u206c\u202e\u206d\u200c\u206a\u200f\u206a\u206c\u202e\u200b\u202e\u200f\u200f\u200b\u202e\u200b\u202e\u202a\u200e\u200c\u202a\u200d\u202d\u206f\u206c\u200b\u200f\u200f\u206e\u206d\u200e\u206b\u206d\u202e(string P_0, string P_1, string P_2); [EditorBrowsable(EditorBrowsableState.Never)] public delegate string hook_\u200e\u206c\u202d\u202a\u206a\u202a\u202e\u206c\u202e\u206d\u200c\u206a\u200f\u206a\u206c\u202e\u200b\u202e\u200f\u200f\u200b\u202e\u200b\u202e\u202a\u200e\u200c\u202a\u200d\u202d\u206f\u206c\u200b\u200f\u200f\u206e\u206d\u200e\u206b\u206d\u202e(orig_\u200e\u206c\u202d\u202a\u206a\u202a\u202e\u206c\u202e\u206d\u200c\u206a\u200f\u206a\u206c\u202e\u200b\u202e\u200f\u200f\u200b\u202e\u200b\u202e\u202a\u200e\u200c\u202a\u200d\u202d\u206f\u206c\u200b\u200f\u200f\u206e\u206d\u200e\u206b\u206d\u202e orig, string P_1, string P_2, string P_3); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Shader orig_\u202b\u202b\u202e\u202c\u206e\u202c\u206e\u200e\u202b\u200c\u206d\u206d\u200c\u206d\u200b\u206a\u200f\u202a\u200f\u200e\u200e\u206e\u200e\u206d\u206a\u200d\u200e\u202d\u206f\u202a\u202e\u200b\u200e\u200e\u206c\u206b\u200e\u202b\u200f\u202d\u202e(string P_0); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Shader hook_\u202b\u202b\u202e\u202c\u206e\u202c\u206e\u200e\u202b\u200c\u206d\u206d\u200c\u206d\u200b\u206a\u200f\u202a\u200f\u200e\u200e\u206e\u200e\u206d\u206a\u200d\u200e\u202d\u206f\u202a\u202e\u200b\u200e\u200e\u206c\u206b\u200e\u202b\u200f\u202d\u202e(orig_\u202b\u202b\u202e\u202c\u206e\u202c\u206e\u200e\u202b\u200c\u206d\u206d\u200c\u206d\u200b\u206a\u200f\u202a\u200f\u200e\u200e\u206e\u200e\u206d\u206a\u200d\u200e\u202d\u206f\u202a\u202e\u200b\u200e\u200e\u206c\u206b\u200e\u202b\u200f\u202d\u202e orig, string P_1); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Material orig_\u206d\u206f\u202b\u206d\u202e\u206d\u202d\u202a\u200f\u202c\u200e\u206d\u200d\u202e\u200f\u206f\u200c\u202b\u202d\u206e\u202c\u206d\u200d\u206d\u202d\u200f\u202c\u206f\u202c\u202a\u206b\u206b\u206b\u202b\u202a\u206c\u200f\u206a\u206b\u206e\u202e(Shader P_0); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Material hook_\u206d\u206f\u202b\u206d\u202e\u206d\u202d\u202a\u200f\u202c\u200e\u206d\u200d\u202e\u200f\u206f\u200c\u202b\u202d\u206e\u202c\u206d\u200d\u206d\u202d\u200f\u202c\u206f\u202c\u202a\u206b\u206b\u206b\u202b\u202a\u206c\u200f\u206a\u206b\u206e\u202e(orig_\u206d\u206f\u202b\u206d\u202e\u206d\u202d\u202a\u200f\u202c\u200e\u206d\u200d\u202e\u200f\u206f\u200c\u202b\u202d\u206e\u202c\u206d\u200d\u206d\u202d\u200f\u202c\u206f\u202c\u202a\u206b\u206b\u206b\u202b\u202a\u206c\u200f\u206a\u206b\u206e\u202e orig, Shader P_1); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_\u200f\u202c\u202c\u200b\u200f\u202b\u202c\u202c\u202b\u200d\u202c\u202d\u206b\u202e\u206e\u200f\u202c\u200e\u200f\u206d\u206e\u202b\u200c\u202d\u200c\u206b\u202d\u202d\u202b\u206f\u206f\u202c\u206b\u202d\u202b\u200c\u206d\u206b\u206f\u206c\u202e(Material P_0, string P_1, float P_2); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_\u200f\u202c\u202c\u200b\u200f\u202b\u202c\u202c\u202b\u200d\u202c\u202d\u206b\u202e\u206e\u200f\u202c\u200e\u200f\u206d\u206e\u202b\u200c\u202d\u200c\u206b\u202d\u202d\u202b\u206f\u206f\u202c\u206b\u202d\u202b\u200c\u206d\u206b\u206f\u206c\u202e(orig_\u200f\u202c\u202c\u200b\u200f\u202b\u202c\u202c\u202b\u200d\u202c\u202d\u206b\u202e\u206e\u200f\u202c\u200e\u200f\u206d\u206e\u202b\u200c\u202d\u200c\u206b\u202d\u202d\u202b\u206f\u206f\u202c\u206b\u202d\u202b\u200c\u206d\u206b\u206f\u206c\u202e orig, Material P_1, string P_2, float P_3); [EditorBrowsable(EditorBrowsableState.Never)] public delegate int orig_\u206a\u206b\u202e\u206a\u200d\u200e\u200b\u202a\u206a\u206c\u202c\u200f\u202d\u206d\u202e\u202c\u202a\u202b\u200f\u202d\u206e\u206a\u206c\u206e\u206e\u202c\u202e\u206c\u200d\u200b\u202e\u202c\u206a\u202d\u200b\u200c\u206c\u206a\u202d\u202e(TerrainData P_0); [EditorBrowsable(EditorBrowsableState.Never)] public delegate int hook_\u206a\u206b\u202e\u206a\u200d\u200e\u200b\u202a\u206a\u206c\u202c\u200f\u202d\u206d\u202e\u202c\u202a\u202b\u200f\u202d\u206e\u206a\u206c\u206e\u206e\u202c\u202e\u206c\u200d\u200b\u202e\u202c\u206a\u202d\u200b\u200c\u206c\u206a\u202d\u202e(orig_\u206a\u206b\u202e\u206a\u200d\u200e\u200b\u202a\u206a\u206c\u202c\u200f\u202d\u206d\u202e\u202c\u202a\u202b\u200f\u202d\u206e\u206a\u206c\u206e\u206e\u202c\u202e\u206c\u200d\u200b\u202e\u202c\u206a\u202d\u200b\u200c\u206c\u206a\u202d\u202e orig, TerrainData P_1); [EditorBrowsable(EditorBrowsableState.Never)] public delegate RenderTexture orig_\u202b\u200c\u202c\u206c\u206a\u202a\u206c\u202b\u202d\u200c\u206d\u206f\u206b\u200e\u200b\u202b\u206e\u206b\u200d\u200c\u200f\u200b\u206d\u202d\u200d\u202a\u202d\u200f\u206c\u206b\u200d\u202b\u202a\u206d\u200d\u206b\u206d\u200f\u202a\u206b\u202e(int P_0, int P_1); [EditorBrowsable(EditorBrowsableState.Never)] public delegate RenderTexture hook_\u202b\u200c\u202c\u206c\u206a\u202a\u206c\u202b\u202d\u200c\u206d\u206f\u206b\u200e\u200b\u202b\u206e\u206b\u200d\u200c\u200f\u200b\u206d\u202d\u200d\u202a\u202d\u200f\u206c\u206b\u200d\u202b\u202a\u206d\u200d\u206b\u206d\u200f\u202a\u206b\u202e(orig_\u202b\u200c\u202c\u206c\u206a\u202a\u206c\u202b\u202d\u200c\u206d\u206f\u206b\u200e\u200b\u202b\u206e\u206b\u200d\u200c\u200f\u200b\u206d\u202d\u200d\u202a\u202d\u200f\u206c\u206b\u200d\u202b\u202a\u206d\u200d\u206b\u206d\u200f\u202a\u206b\u202e orig, int P_1, int P_2); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool orig_\u200c\u200b\u202e\u202c\u202c\u206e\u202c\u200c\u202e\u202a\u202d\u200d\u206e\u206a\u200e\u206b\u202b\u202a\u206b\u202c\u202e\u206d\u200d\u200c\u200d\u200f\u206c\u200c\u206d\u200b\u200c\u202e\u206b\u206b\u206f\u200e\u202c\u202a\u200e\u202e\u202e(RenderTexture P_0); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool hook_\u200c\u200b\u202e\u202c\u202c\u206e\u202c\u200c\u202e\u202a\u202d\u200d\u206e\u206a\u200e\u206b\u202b\u202a\u206b\u202c\u202e\u206d\u200d\u200c\u200d\u200f\u206c\u200c\u206d\u200b\u200c\u202e\u206b\u206b\u206f\u200e\u202c\u202a\u200e\u202e\u202e(orig_\u200c\u200b\u202e\u202c\u202c\u206e\u202c\u200c\u202e\u202a\u202d\u200d\u206e\u206a\u200e\u206b\u202b\u202a\u206b\u202c\u202e\u206d\u200d\u200c\u200d\u200f\u206c\u200c\u206d\u200b\u200c\u202e\u206b\u206b\u206f\u200e\u202c\u202a\u200e\u202e\u202e orig, RenderTexture P_1); [EditorBrowsable(EditorBrowsableState.Never)] public delegate TextureFormat orig_\u206e\u202e\u206c\u206a\u202e\u206f\u206f\u206a\u206e\u200c\u206b\u206b\u206c\u202a\u200f\u202e\u206f\u200f\u200d\u200e\u206e\u202c\u206d\u206f\u200d\u200e\u206c\u202c\u206b\u206a\u206d\u202e\u202e\u200f\u202b\u206c\u202a\u206f\u200b\u206e\u202e(Texture2D P_0); [EditorBrowsable(EditorBrowsableState.Never)] public delegate TextureFormat hook_\u206e\u202e\u206c\u206a\u202e\u206f\u206f\u206a\u206e\u200c\u206b\u206b\u206c\u202a\u200f\u202e\u206f\u200f\u200d\u200e\u206e\u202c\u206d\u206f\u200d\u200e\u206c\u202c\u206b\u206a\u206d\u202e\u202e\u200f\u202b\u206c\u202a\u206f\u200b\u206e\u202e(orig_\u206e\u202e\u206c\u206a\u202e\u206f\u206f\u206a\u206e\u200c\u206b\u206b\u206c\u202a\u200f\u202e\u206f\u200f\u200d\u200e\u206e\u202c\u206d\u206f\u200d\u200e\u206c\u202c\u206b\u206a\u206d\u202e\u202e\u200f\u202b\u206c\u202a\u206f\u200b\u206e\u202e orig, Texture2D P_1); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_\u206a\u200f\u200f\u202a\u206e\u202d\u202e\u206f\u200e\u200b\u200d\u200f\u206c\u202d\u206e\u206c\u202a\u202e\u206b\u200c\u206b\u206d\u202b\u202c\u206b\u200b\u202d\u206c\u200f\u202d\u202c\u202c\u202a\u206f\u200f\u206f\u202a\u200c\u202b\u200d\u202e(Texture P_0, TextureWrapMode P_1); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_\u206a\u200f\u200f\u202a\u206e\u202d\u202e\u206f\u200e\u200b\u200d\u200f\u206c\u202d\u206e\u206c\u202a\u202e\u206b\u200c\u206b\u206d\u202b\u202c\u206b\u200b\u202d\u206c\u200f\u202d\u202c\u202c\u202a\u206f\u200f\u206f\u202a\u200c\u202b\u200d\u202e(orig_\u206a\u200f\u200f\u202a\u206e\u202d\u202e\u206f\u200e\u200b\u200d\u200f\u206c\u202d\u206e\u206c\u202a\u202e\u206b\u200c\u206b\u206d\u202b\u202c\u206b\u200b\u202d\u206c\u200f\u202d\u202c\u202c\u202a\u206f\u200f\u206f\u202a\u200c\u202b\u200d\u202e orig, Texture P_1, TextureWrapMode P_2); [EditorBrowsable(EditorBrowsableState.Never)] public delegate string orig_\u200b\u206e\u202c\u200d\u200d\u200b\u206d\u200d\u202b\u200f\u202a\u200e\u206b\u206d\u206b\u202b\u200e\u206a\u200b\u200c\u202e\u202c\u206a\u200f\u200d\u206c\u200d\u206d\u202b\u200d\u202d\u206a\u202e\u206a\u206d\u206b\u200f\u200e\u200f\u206c\u202e(string P_0, string P_1); [EditorBrowsable(EditorBrowsableState.Never)] public delegate string hook_\u200b\u206e\u202c\u200d\u200d\u200b\u206d\u200d\u202b\u200f\u202a\u200e\u206b\u206d\u206b\u202b\u200e\u206a\u200b\u200c\u202e\u202c\u206a\u200f\u200d\u206c\u200d\u206d\u202b\u200d\u202d\u206a\u202e\u206a\u206d\u206b\u200f\u200e\u200f\u206c\u202e(orig_\u200b\u206e\u202c\u200d\u200d\u200b\u206d\u200d\u202b\u200f\u202a\u200e\u206b\u206d\u206b\u202b\u200e\u206a\u200b\u200c\u202e\u202c\u206a\u200f\u200d\u206c\u200d\u206d\u202b\u200d\u202d\u206a\u202e\u206a\u206d\u206b\u200f\u200e\u200f\u206c\u202e orig, string P_1, string P_2); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_\u202d\u206e\u200d\u200f\u202c\u200e\u206e\u200f\u206b\u202d\u200e\u202a\u200f\u202a\u202c\u202c\u206c\u200b\u200f\u206f\u206a\u206a\u206a\u202b\u206b\u206e\u206d\u200c\u202c\u200b\u200d\u206e\u202c\u200c\u200e\u200b\u202b\u200d\u206f\u200c\u202e(Object P_0, string P_1); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_\u202d\u206e\u200d\u200f\u202c\u200e\u206e\u200f\u206b\u202d\u200e\u202a\u200f\u202a\u202c\u202c\u206c\u200b\u200f\u206f\u206a\u206a\u206a\u202b\u206b\u206e\u206d\u200c\u202c\u200b\u200d\u206e\u202c\u200c\u200e\u200b\u202b\u200d\u206f\u200c\u202e(orig_\u202d\u206e\u200d\u200f\u202c\u200e\u206e\u200f\u206b\u202d\u200e\u202a\u200f\u202a\u202c\u202c\u206c\u200b\u200f\u206f\u206a\u206a\u206a\u202b\u206b\u206e\u206d\u200c\u202c\u200b\u200d\u206e\u202c\u200c\u200e\u200b\u202b\u200d\u206f\u200c\u202e orig, Object P_1, string P_2); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_\u200b\u206b\u202a\u206c\u206e\u202c\u200c\u202d\u206e\u206c\u200e\u200f\u200d\u202d\u200e\u206a\u202b\u206a\u202b\u202b\u206c\u200d\u206c\u206a\u200b\u202a\u202c\u206b\u206b\u200e\u200d\u206e\u206e\u206d\u202b\u206e\u206c\u206f\u200b\u202d\u202e(RenderTexture P_0); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_\u200b\u206b\u202a\u206c\u206e\u202c\u200c\u202d\u206e\u206c\u200e\u200f\u200d\u202d\u200e\u206a\u202b\u206a\u202b\u202b\u206c\u200d\u206c\u206a\u200b\u202a\u202c\u206b\u206b\u200e\u200d\u206e\u206e\u206d\u202b\u206e\u206c\u206f\u200b\u202d\u202e(orig_\u200b\u206b\u202a\u206c\u206e\u202c\u200c\u202d\u206e\u206c\u200e\u200f\u200d\u202d\u200e\u206a\u202b\u206a\u202b\u202b\u206c\u200d\u206c\u206a\u200b\u202a\u202c\u206b\u206b\u200e\u200d\u206e\u206e\u206d\u202b\u206e\u206c\u206f\u200b\u202d\u202e orig, RenderTexture P_1); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool orig_\u202e\u202d\u200e\u202e\u200b\u202b\u202a\u200c\u202b\u202a\u206d\u206a\u206b\u206d\u206a\u206a\u202c\u202c\u206d\u206b\u206e\u206e\u206f\u200d\u206a\u200d\u206c\u202c\u206a\u206f\u206c\u206a\u200e\u206d\u200f\u206f\u206a\u202a\u200f\u200e\u202e(); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool hook_\u202e\u202d\u200e\u202e\u200b\u202b\u202a\u200c\u202b\u202a\u206d\u206a\u206b\u206d\u206a\u206a\u202c\u202c\u206d\u206b\u206e\u206e\u206f\u200d\u206a\u200d\u206c\u202c\u206a\u206f\u206c\u206a\u200e\u206d\u200f\u206f\u206a\u202a\u200f\u200e\u202e(orig_\u202e\u202d\u200e\u202e\u200b\u202b\u202a\u200c\u202b\u202a\u206d\u206a\u206b\u206d\u206a\u206a\u202c\u202c\u206d\u206b\u206e\u206e\u206f\u200d\u206a\u200d\u206c\u202c\u206a\u206f\u206c\u206a\u200e\u206d\u200f\u206f\u206a\u202a\u200f\u200e\u202e orig); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_\u206b\u206f\u200e\u206e\u202c\u200d\u206a\u206d\u206c\u206e\u206e\u206d\u206a\u206f\u202a\u202c\u200f\u206a\u200d\u206f\u206e\u202a\u200d\u206d\u206b\u200e\u200d\u206b\u202c\u202e\u200e\u200d\u206f\u200e\u202d\u200e\u206f\u200c\u206d\u202d\u202e(Object P_0); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_\u206b\u206f\u200e\u206e\u202c\u200d\u206a\u206d\u206c\u206e\u206e\u206d\u206a\u206f\u202a\u202c\u200f\u206a\u200d\u206f\u206e\u202a\u200d\u206d\u206b\u200e\u200d\u206b\u202c\u202e\u200e\u200d\u206f\u200e\u202d\u200e\u206f\u200c\u206d\u202d\u202e(orig_\u206b\u206f\u200e\u206e\u202c\u200d\u206a\u206d\u206c\u206e\u206e\u206d\u206a\u206f\u202a\u202c\u200f\u206a\u200d\u206f\u206e\u202a\u200d\u206d\u206b\u200e\u200d\u206b\u202c\u202e\u200e\u200d\u206f\u200e\u202d\u200e\u206f\u200c\u206d\u202d\u202e orig, Object P_1); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_\u206b\u206e\u200e\u202a\u206f\u202e\u206f\u200e\u200f\u206c\u202e\u206d\u206c\u206c\u202b\u200c\u202b\u202e\u206b\u202d\u206a\u202a\u202b\u200b\u202d\u200d\u206e\u206f\u206b\u200f\u202e\u206d\u202e\u200f\u200b\u206e\u202c\u202c\u202a\u202c\u202e(Object P_0); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_\u206b\u206e\u200e\u202a\u206f\u202e\u206f\u200e\u200f\u206c\u202e\u206d\u206c\u206c\u202b\u200c\u202b\u202e\u206b\u202d\u206a\u202a\u202b\u200b\u202d\u200d\u206e\u206f\u206b\u200f\u202e\u206d\u202e\u200f\u200b\u206e\u202c\u202c\u202a\u202c\u202e(orig_\u206b\u206e\u200e\u202a\u206f\u202e\u206f\u200e\u200f\u206c\u202e\u206d\u206c\u206c\u202b\u200c\u202b\u202e\u206b\u202d\u206a\u202a\u202b\u200b\u202d\u200d\u206e\u206f\u206b\u200f\u202e\u206d\u202e\u200f\u200b\u206e\u202c\u202c\u202a\u202c\u202e orig, Object P_1); [EditorBrowsable(EditorBrowsableState.Never)] public delegate ColorSpace orig_\u206a\u202b\u202c\u200b\u206f\u202e\u200c\u206b\u200f\u202b\u206e\u206e\u200b\u202b\u202a\u206f\u202a\u202c\u206f\u200b\u206c\u200d\u206e\u200c\u202b\u202a\u206f\u206e\u200b\u200d\u202e\u200e\u202c\u206b\u200e\u206e\u202d\u206a\u202b\u200e\u202e(); [EditorBrowsable(EditorBrowsableState.Never)] public delegate ColorSpace hook_\u206a\u202b\u202c\u200b\u206f\u202e\u200c\u206b\u200f\u202b\u206e\u206e\u200b\u202b\u202a\u206f\u202a\u202c\u206f\u200b\u206c\u200d\u206e\u200c\u202b\u202a\u206f\u206e\u200b\u200d\u202e\u200e\u202c\u206b\u200e\u206e\u202d\u206a\u202b\u200e\u202e(orig_\u206a\u202b\u202c\u200b\u206f\u202e\u200c\u206b\u200f\u202b\u206e\u206e\u200b\u202b\u202a\u206f\u202a\u202c\u206f\u200b\u206c\u200d\u206e\u200c\u202b\u202a\u206f\u206e\u200b\u200d\u202e\u200e\u202c\u206b\u200e\u206e\u202d\u206a\u202b\u200e\u202e orig); [EditorBrowsable(EditorBrowsableState.Never)] public delegate RenderTexture orig_\u202d\u206b\u202d\u202d\u202c\u200f\u200c\u200e\u202d\u200b\u202c\u200b\u206e\u206c\u206d\u206c\u202e\u206b\u206a\u206e\u206a\u200d\u202c\u202b\u200d\u206d\u206f\u206c\u206b\u202b\u206c\u202e\u206e\u200b\u206a\u200f\u200f\u206f\u206a\u202a\u202e(TerrainData P_0); [EditorBrowsable(EditorBrowsableState.Never)] public delegate RenderTexture hook_\u202d\u206b\u202d\u202d\u202c\u200f\u200c\u200e\u202d\u200b\u202c\u200b\u206e\u206c\u206d\u206c\u202e\u206b\u206a\u206e\u206a\u200d\u202c\u202b\u200d\u206d\u206f\u206c\u206b\u202b\u206c\u202e\u206e\u200b\u206a\u200f\u200f\u206f\u206a\u202a\u202e(orig_\u202d\u206b\u202d\u202d\u202c\u200f\u200c\u200e\u202d\u200b\u202c\u200b\u206e\u206c\u206d\u206c\u202e\u206b\u206a\u206e\u206a\u200d\u202c\u202b\u200d\u206d\u206f\u206c\u206b\u202b\u206c\u202e\u206e\u200b\u206a\u200f\u200f\u206f\u206a\u202a\u202e orig, TerrainData P_1); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_\u206f\u200f\u206f\u200b\u206e\u202b\u202c\u206a\u200e\u200b\u200f\u206d\u206b\u200e\u200f\u200e\u206c\u202d\u206a\u206f\u200b\u200d\u206a\u206b\u206d\u202a\u202d\u206c\u206b\u206f\u202d\u200b\u200c\u202d\u202a\u206d\u206e\u206c\u202b\u202d\u202e(Material P_0, string P_1, Vector4 P_2); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_\u206f\u200f\u206f\u200b\u206e\u202b\u202c\u206a\u200e\u200b\u200f\u206d\u206b\u200e\u200f\u200e\u206c\u202d\u206a\u206f\u200b\u200d\u206a\u206b\u206d\u202a\u202d\u206c\u206b\u206f\u202d\u200b\u200c\u202d\u202a\u206d\u206e\u206c\u202b\u202d\u202e(orig_\u206f\u200f\u206f\u200b\u206e\u202b\u202c\u206a\u200e\u200b\u200f\u206d\u206b\u200e\u200f\u200e\u206c\u202d\u206a\u206f\u200b\u200d\u206a\u206b\u206d\u202a\u202d\u206c\u206b\u206f\u202d\u200b\u200c\u202d\u202a\u206d\u206e\u206c\u202b\u202d\u202e orig, Material P_1, string P_2, Vector4 P_3); [EditorBrowsable(EditorBrowsableState.Never)] public delegate int orig_\u206b\u206a\u200e\u202d\u206b\u202d\u200b\u202a\u206f\u200e\u200d\u202e\u206d\u200b\u206a\u202a\u200f\u202d\u206f\u202b\u202a\u200b\u206b\u200b\u200d\u200b\u202e\u202d\u206c\u206e\u202b\u202e\u202a\u200e\u202b\u200c\u202a\u200b\u200c\u206b\u202e(Texture P_0); [EditorBrowsable(EditorBrowsableState.Never)] public delegate int hook_\u206b\u206a\u200e\u202d\u206b\u202d\u200b\u202a\u206f\u200e\u200d\u202e\u206d\u200b\u206a\u202a\u200f\u202d\u206f\u202b\u202a\u200b\u206b\u200b\u200d\u200b\u202e\u202d\u206c\u206e\u202b\u202e\u202a\u200e\u202b\u200c\u202a\u200b\u200c\u206b\u202e(orig_\u206b\u206a\u200e\u202d\u206b\u202d\u200b\u202a\u206f\u200e\u200d\u202e\u206d\u200b\u206a\u202a\u200f\u202d\u206f\u202b\u202a\u200b\u206b\u200b\u200d\u200b\u202e\u202d\u206c\u206e\u202b\u202e\u202a\u200e\u202b\u200c\u202a\u200b\u200c\u206b\u202e orig, Texture P_1); [EditorBrowsable(EditorBrowsableState.Never)] public delegate RenderTextureFormat orig_\u206c\u206c\u200e\u202a\u202d\u202b\u206d\u202b\u202b\u200b\u200e\u202b\u202e\u200d\u200d\u202e\u206b\u206a\u206d\u206d\u206e\u200b\u200d\u206b\u202c\u200c\u202b\u202e\u202d\u202d\u206c\u200d\u200c\u202c\u202b\u200c\u200b\u206a\u202d\u202a\u202e(RenderTexture P_0); [EditorBrowsable(EditorBrowsableState.Never)] public delegate RenderTextureFormat hook_\u206c\u206c\u200e\u202a\u202d\u202b\u206d\u202b\u202b\u200b\u200e\u202b\u202e\u200d\u200d\u202e\u206b\u206a\u206d\u206d\u206e\u200b\u200d\u206b\u202c\u200c\u202b\u202e\u202d\u202d\u206c\u200d\u200c\u202c\u202b\u200c\u200b\u206a\u202d\u202a\u202e(orig_\u206c\u206c\u200e\u202a\u202d\u202b\u206d\u202b\u202b\u200b\u200e\u202b\u202e\u200d\u200d\u202e\u206b\u206a\u206d\u206d\u206e\u200b\u200d\u206b\u202c\u200c\u202b\u202e\u202d\u202d\u206c\u200d\u200c\u202c\u202b\u200c\u200b\u206a\u202d\u202a\u202e orig, RenderTexture P_1); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool orig_\u202e\u206b\u206b\u206c\u202c\u206b\u206e\u200f\u206f\u200c\u206b\u206a\u202d\u206c\u200c\u200f\u200f\u200f\u202a\u200b\u202c\u206f\u206d\u200d\u202a\u200f\u206a\u202e\u202e\u200f\u206b\u202e\u206a\u202d\u206d\u202b\u200e\u206a\u206d\u202b\u202e(RenderTextureFormat P_0); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool hook_\u202e\u206b\u206b\u206c\u202c\u206b\u206e\u200f\u206f\u200c\u206b\u206a\u202d\u206c\u200c\u200f\u200f\u200f\u202a\u200b\u202c\u206f\u206d\u200d\u202a\u200f\u206a\u202e\u202e\u200f\u206b\u202e\u206a\u202d\u206d\u202b\u200e\u206a\u206d\u202b\u202e(orig_\u202e\u206b\u206b\u206c\u202c\u206b\u206e\u200f\u206f\u200c\u206b\u206a\u202d\u206c\u200c\u200f\u200f\u200f\u202a\u200b\u202c\u206f\u206d\u200d\u202a\u200f\u206a\u202e\u202e\u200f\u206b\u202e\u206a\u202d\u206d\u202b\u200e\u206a\u206d\u202b\u202e orig, RenderTextureFormat P_1); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool orig_\u200b\u202d\u200c\u206c\u202e\u200f\u200e\u200d\u202b\u202d\u206c\u200f\u206b\u202c\u200d\u200f\u202c\u206f\u202c\u200d\u202a\u206f\u202b\u202d\u200e\u202e\u206e\u202c\u206f\u200d\u200f\u206e\u206c\u206d\u202d\u206a\u206f\u206e\u202c\u202d\u202e(TextureFormat P_0); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool hook_\u200b\u202d\u200c\u206c\u202e\u200f\u200e\u200d\u202b\u202d\u206c\u200f\u206b\u202c\u200d\u200f\u202c\u206f\u202c\u200d\u202a\u206f\u202b\u202d\u200e\u202e\u206e\u202c\u206f\u200d\u200f\u206e\u206c\u206d\u202d\u206a\u206f\u206e\u202c\u202d\u202e(orig_\u200b\u202d\u200c\u206c\u202e\u200f\u200e\u200d\u202b\u202d\u206c\u200f\u206b\u202c\u200d\u200f\u202c\u206f\u202c\u200d\u202a\u206f\u202b\u202d\u200e\u202e\u206e\u202c\u206f\u200d\u200f\u206e\u206c\u206d\u202d\u206a\u206f\u206e\u202c\u202d\u202e orig, TextureFormat P_1); [EditorBrowsable(EditorBrowsableState.Never)] public delegate RenderTexture orig_\u206b\u200b\u202c\u206a\u200b\u200d\u200e\u206c\u206c\u202c\u200e\u206d\u202a\u202c\u202a\u206a\u202d\u206b\u202d\u202c\u206b\u206d\u206c\u202d\u202c\u200e\u206e\u206b\u206e\u206b\u202a\u202a\u202a\u202e\u202d\u202c\u206f\u206f\u206f\u200d\u202e(int P_0, int P_1, int P_2, RenderTextureFormat P_3); [EditorBrowsable(EditorBrowsableState.Never)] public delegate RenderTexture hook_\u206b\u200b\u202c\u206a\u200b\u200d\u200e\u206c\u206c\u202c\u200e\u206d\u202a\u202c\u202a\u206a\u202d\u206b\u202d\u202c\u206b\u206d\u206c\u202d\u202c\u200e\u206e\u206b\u206e\u206b\u202a\u202a\u202a\u202e\u202d\u202c\u206f\u206f\u206f\u200d\u202e(orig_\u206b\u200b\u202c\u206a\u200b\u200d\u200e\u206c\u206c\u202c\u200e\u206d\u202a\u202c\u202a\u206a\u202d\u206b\u202d\u202c\u206b\u206d\u206c\u202d\u202c\u200e\u206e\u206b\u206e\u206b\u202a\u202a\u202a\u202e\u202d\u202c\u206f\u206f\u206f\u200d\u202e orig, int P_1, int P_2, int P_3, RenderTextureFormat P_4); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Texture orig_\u200b\u206a\u200e\u206d\u206f\u200f\u200c\u202c\u206a\u206f\u206c\u206f\u200f\u206e\u206c\u200d\u200c\u202c\u202b\u200d\u202a\u206c\u206c\u200c\u206c\u206c\u200b\u200f\u202a\u202d\u206c\u200d\u202e\u200e\u200d\u206e\u202c\u200d\u206b\u202e(TerrainData P_0); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Texture hook_\u200b\u206a\u200e\u206d\u206f\u200f\u200c\u202c\u206a\u206f\u206c\u206f\u200f\u206e\u206c\u200d\u200c\u202c\u202b\u200d\u202a\u206c\u206c\u200c\u206c\u206c\u200b\u200f\u202a\u202d\u206c\u200d\u202e\u200e\u200d\u206e\u202c\u200d\u206b\u202e(orig_\u200b\u206a\u200e\u206d\u206f\u200f\u200c\u202c\u206a\u206f\u206c\u206f\u200f\u206e\u206c\u200d\u200c\u202c\u202b\u200d\u202a\u206c\u206c\u200c\u206c\u206c\u200b\u200f\u202a\u202d\u206c\u200d\u202e\u200e\u200d\u206e\u202c\u200d\u206b\u202e orig, TerrainData P_1); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool orig_\u202c\u202d\u202c\u200f\u200e\u206f\u206c\u200f\u206d\u200d\u200d\u202b\u202d\u206d\u200f\u200d\u200d\u202e\u200b\u206d\u200c\u202c\u200e\u200c\u200d\u200e\u200e\u206d\u200f\u200d\u200d\u206c\u206d\u206c\u200c\u206e\u206e\u200f\u202c\u202a\u202e(TerrainData P_0); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool hook_\u202c\u202d\u202c\u200f\u200e\u206f\u206c\u200f\u206d\u200d\u200d\u202b\u202d\u206d\u200f\u200d\u200d\u202e\u200b\u206d\u200c\u202c\u200e\u200c\u200d\u200e\u200e\u206d\u200f\u200d\u200d\u206c\u206d\u206c\u200c\u206e\u206e\u200f\u202c\u202a\u202e(orig_\u202c\u202d\u202c\u200f\u200e\u206f\u206c\u200f\u206d\u200d\u200d\u202b\u202d\u206d\u200f\u200d\u200d\u202e\u200b\u206d\u200c\u202c\u200e\u200c\u200d\u200e\u200e\u206d\u200f\u200d\u200d\u206c\u206d\u206c\u200c\u206e\u206e\u200f\u202c\u202a\u202e orig, TerrainData P_1); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_\u200f\u206a\u200c\u206b\u200c\u202d\u200f\u206c\u200d\u200b\u206d\u200f\u202c\u200c\u200b\u202c\u206b\u206a\u206a\u202d\u202a\u200d\u206e\u202b\u206c\u206b\u202e\u206a\u202b\u206d\u200d\u200d\u206d\u206e\u206c\u200f\u202e\u200f\u200d\u206e\u202e(TerrainData P_0, bool P_1); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_\u200f\u206a\u200c\u206b\u200c\u202d\u200f\u206c\u200d\u200b\u206d\u200f\u202c\u200c\u200b\u202c\u206b\u206a\u206a\u202d\u202a\u200d\u206e\u202b\u206c\u206b\u202e\u206a\u202b\u206d\u200d\u200d\u206d\u206e\u206c\u200f\u202e\u200f\u200d\u206e\u202e(orig_\u200f\u206a\u200c\u206b\u200c\u202d\u200f\u206c\u200d\u200b\u206d\u200f\u202c\u200c\u200b\u202c\u206b\u206a\u206a\u202d\u202a\u200d\u206e\u202b\u206c\u206b\u202e\u206a\u202b\u206d\u200d\u200d\u206d\u206e\u206c\u200f\u202e\u200f\u200d\u206e\u202e orig, TerrainData P_1, bool P_2); [EditorBrowsable(EditorBrowsableState.Never)] public delegate RenderTexture orig_\u206b\u206d\u206b\u206d\u206c\u206d\u206d\u206d\u206e\u202a\u202b\u200b\u202d\u206e\u206e\u202e\u202c\u206e\u200b\u206f\u200b\u202d\u206a\u200f\u206b\u200c\u200c\u200e\u202c\u206f\u202e\u202d\u202c\u206d\u206a\u206a\u206e\u202e\u200c\u200f\u202e(int P_0, int P_1, int P_2); [EditorBrowsable(EditorBrowsableState.Never)] public delegate RenderTexture hook_\u206b\u206d\u206b\u206d\u206c\u206d\u206d\u206d\u206e\u202a\u202b\u200b\u202d\u206e\u206e\u202e\u202c\u206e\u200b\u206f\u200b\u202d\u206a\u200f\u206b\u200c\u200c\u200e\u202c\u206f\u202e\u202d\u202c\u206d\u206a\u206a\u206e\u202e\u200c\u200f\u202e(orig_\u206b\u206d\u206b\u206d\u206c\u206d\u206d\u206d\u206e\u202a\u202b\u200b\u202d\u206e\u206e\u202e\u202c\u206e\u200b\u206f\u200b\u202d\u206a\u200f\u206b\u200c\u200c\u200e\u202c\u206f\u202e\u202d\u202c\u206d\u206a\u206a\u206e\u202e\u200c\u200f\u202e orig, int P_1, int P_2, int P_3); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_\u202a\u200f\u202c\u206a\u206a\u200d\u206b\u200c\u202b\u206c\u206c\u200b\u200c\u206a\u200b\u202a\u202e\u202e\u200d\u206b\u202e\u206e\u202a\u202a\u202e\u200f\u202e\u200d\u206e\u202e\u200d\u202c\u200d\u202c\u202a\u200c\u202a\u202e\u200e\u200c\u202e(Texture P_0, RenderTexture P_1); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_\u202a\u200f\u202c\u206a\u206a\u200d\u206b\u200c\u202b\u206c\u206c\u200b\u200c\u206a\u200b\u202a\u202e\u202e\u200d\u206b\u202e\u206e\u202a\u202a\u202e\u200f\u202e\u200d\u206e\u202e\u200d\u202c\u200d\u202c\u202a\u200c\u202a\u202e\u200e\u200c\u202e(orig_\u202a\u200f\u202c\u206a\u206a\u200d\u206b\u200c\u202b\u206c\u206c\u200b\u200c\u206a\u200b\u202a\u202e\u202e\u200d\u206b\u202e\u206e\u202a\u202a\u202e\u200f\u202e\u200d\u206e\u202e\u200d\u202c\u200d\u202c\u202a\u200c\u202a\u202e\u200e\u200c\u202e orig, Texture P_1, RenderTexture P_2); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Color[] orig_\u200f\u206a\u206e\u202c\u202b\u206e\u200d\u206a\u200e\u202a\u206e\u200c\u206c\u206e\u200b\u200b\u200e\u202d\u206e\u200c\u206d\u202d\u200e\u200b\u202b\u200d\u202a\u200b\u202c\u202a\u200f\u206e\u202d\u206b\u200f\u206e\u206b\u202b\u202b\u206c\u202e(Texture2D P_0); [EditorBrowsable(EditorBrowsableState.Never)] public delegate Color[] hook_\u200f\u206a\u206e\u202c\u202b\u206e\u200d\u206a\u200e\u202a\u206e\u200c\u206c\u206e\u200b\u200b\u200e\u202d\u206e\u200c\u206d\u202d\u200e\u200b\u202b\u200d\u202a\u200b\u202c\u202a\u200f\u206e\u202d\u206b\u200f\u206e\u206b\u202b\u202b\u206c\u202e(orig_\u200f\u206a\u206e\u202c\u202b\u206e\u200d\u206a\u200e\u202a\u206e\u200c\u206c\u206e\u200b\u200b\u200e\u202d\u206e\u200c\u206d\u202d\u200e\u200b\u202b\u200d\u202a\u200b\u202c\u202a\u200f\u206e\u202d\u206b\u200f\u206e\u206b\u202b\u202b\u206c\u202e orig, Texture2D P_1); [EditorBrowsable(EditorBrowsableState.Never)] public delegate float orig_\u202e\u206d\u206c\u206a\u200c\u202b\u206c\u202a\u200f\u202c\u206c\u202b\u200b\u202e\u206f\u202d\u200b\u200f\u202a\u202b\u200f\u206c\u206c\u202c\u200b\u202d\u200c\u202d\u206d\u206b\u202d\u200c\u200b\u202c\u202d\u200e\u202e\u206e\u200e\u202d\u202e(IEnumerable<float> P_0); [EditorBrowsable(EditorBrowsableState.Never)] public delegate float hook_\u202e\u206d\u206c\u206a\u200c\u202b\u206c\u202a\u200f\u202c\u206c\u202b\u200b\u202e\u206f\u202d\u200b\u200f\u202a\u202b\u200f\u206c\u206c\u202c\u200b\u202d\u200c\u202d\u206d\u206b\u202d\u200c\u200b\u202c\u202d\u200e\u202e\u206e\u200e\u202d\u202e(orig_\u202e\u206d\u206c\u206a\u200c\u202b\u206c\u202a\u200f\u202c\u206c\u202b\u200b\u202e\u206f\u202d\u200b\u200f\u202a\u202b\u200f\u206c\u206c\u202c\u200b\u202d\u200c\u202d\u206d\u206b\u202d\u200c\u200b\u202c\u202d\u200e\u202e\u206e\u200e\u202d\u202e orig, IEnumerable<float> P_1); [EditorBrowsable(EditorBrowsableState.Never)] public delegate float orig_\u206c\u206b\u206c\u202a\u206e\u206a\u202e\u200f\u202d\u202e\u202b\u202e\u200c\u202e\u206d\u206c\u200d\u202b\u206a\u200b\u202a\u206b\u206a\u206c\u202c\u202d\u200d\u206b\u206d\u206f\u200d\u206b\u202e\u200c\u206f\u200f\u200f\u202d\u206d\u206e\u202e(IEnumerable<float> P_0); [EditorBrowsable(EditorBrowsableState.Never)] public delegate float hook_\u206c\u206b\u206c\u202a\u206e\u206a\u202e\u200f\u202d\u202e\u202b\u202e\u200c\u202e\u206d\u206c\u200d\u202b\u206a\u200b\u202a\u206b\u206a\u206c\u202c\u202d\u200d\u206b\u206d\u206f\u200d\u206b\u202e\u200c\u206f\u200f\u200f\u202d\u206d\u206e\u202e(orig_\u206c\u206b\u206c\u202a\u206e\u206a\u202e\u200f\u202d\u202e\u202b\u202e\u200c\u202e\u206d\u206c\u200d\u202b\u206a\u200b\u202a\u206b\u206a\u206c\u202c\u202d\u200d\u206b\u206d\u206f\u200d\u206b\u202e\u200c\u206f\u200f\u200f\u202d\u206d\u206e\u202e orig, IEnumerable<float> P_1); public static class \u206f\u202d\u200c\u206d\u200c\u200f\u206d\u206e\u202b\u200b\u202d\u206f\u206e\u200e\u206d\u206d\u206b\u206c\u206d\u200d\u202d\u202c\u200b\u206f\u200e\u202e\u206c\u206f\u202b\u202d\u206a\u200c\u202a\u200b\u200e\u206a\u200f\u200b\u200c\u202c\u202e { [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_cctor(); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_cctor(orig_cctor orig); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_ctor(object self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_ctor(orig_ctor orig, object self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate float orig_\u206b\u200e\u200d\u206f\u206e\u206f\u206a\u202a\u200b\u200d\u200e\u206f\u202c\u202e\u202e\u206d\u202e\u200e\u200c\u202a\u200c\u200d\u202d\u200f\u202d\u200b\u202d\u202d\u202e\u206b\u206f\u206d\u200d\u202a\u202d\u200f\u202d\u202c\u202d\u206b\u202e(object self, Color P_1); [EditorBrowsable(EditorBrowsableState.Never)] public delegate float hook_\u206b\u200e\u200d\u206f\u206e\u206f\u206a\u202a\u200b\u200d\u200e\u206f\u202c\u202e\u202e\u206d\u202e\u200e\u200c\u202a\u200c\u200d\u202d\u200f\u202d\u200b\u202d\u202d\u202e\u206b\u206f\u206d\u200d\u202a\u202d\u200f\u202d\u202c\u202d\u206b\u202e(orig_\u206b\u200e\u200d\u206f\u206e\u206f\u206a\u202a\u200b\u200d\u200e\u206f\u202c\u202e\u202e\u206d\u202e\u200e\u200c\u202a\u200c\u200d\u202d\u200f\u202d\u200b\u202d\u202d\u202e\u206b\u206f\u206d\u200d\u202a\u202d\u200f\u202d\u202c\u202d\u206b\u202e orig, object self, Color P_2); [EditorBrowsable(EditorBrowsableState.Never)] public delegate float orig_\u206d\u202d\u200c\u202e\u200c\u206b\u202d\u200c\u202a\u206b\u202d\u206c\u200e\u206b\u200b\u206c\u200e\u200c\u200f\u206c\u200d\u200d\u200b\u206a\u202d\u202d\u202
BepInEx/plugins/MMHOOK/MMHOOK_Assembly-CSharp.dll
Decompiled 11 months ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Reflection; using DigitalRuby.ThunderAndLightning; using Discord; using Dissonance; using Dissonance.Integrations.Unity_NFGO; using DunGen; using DunGen.Adapters; using DunGen.Analysis; using DunGen.Editor; using DunGen.Graph; using DunGen.Tags; using GameNetcodeStuff; using MonoMod.Cil; using MonoMod.RuntimeDetour.HookGen; using On; using On.DigitalRuby.ThunderAndLightning; using On.Dissonance.Integrations.Unity_NFGO; using On.DunGen; using On.DunGen.Adapters; using On.DunGen.Analysis; using On.DunGen.Editor; using On.DunGen.Graph; using On.DunGen.Tags; using On.GameNetcodeStuff; using On.__GEN; using Steamworks; using Steamworks.Data; using TMPro; using Unity.AI.Navigation; using Unity.Netcode; using UnityEngine; using UnityEngine.AI; using UnityEngine.InputSystem; using UnityEngine.Rendering; using UnityEngine.SceneManagement; using UnityEngine.UI; using UnityEngine.Video; [assembly: AssemblyVersion("0.0.0.0")] namespace On { public static class AlarmButton { [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_PushAlarmButton(AlarmButton self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_PushAlarmButton(orig_PushAlarmButton orig, AlarmButton self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_Update(AlarmButton self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_Update(orig_Update orig, AlarmButton self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_ctor(AlarmButton self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_ctor(orig_ctor orig, AlarmButton self); public static event hook_PushAlarmButton PushAlarmButton { add { HookEndpointManager.Add<hook_PushAlarmButton>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_PushAlarmButton>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_Update Update { add { HookEndpointManager.Add<hook_Update>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_Update>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_ctor ctor { add { HookEndpointManager.Add<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } } } namespace IL { public static class AlarmButton { public static event Manipulator PushAlarmButton { add { HookEndpointManager.Modify<On.AlarmButton.hook_PushAlarmButton>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.AlarmButton.hook_PushAlarmButton>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator Update { add { HookEndpointManager.Modify<On.AlarmButton.hook_Update>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.AlarmButton.hook_Update>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator ctor { add { HookEndpointManager.Modify<On.AlarmButton.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.AlarmButton.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } } } namespace On { public static class AnimatedItem { [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_Start(AnimatedItem self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_Start(orig_Start orig, AnimatedItem self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_EquipItem(AnimatedItem self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_EquipItem(orig_EquipItem orig, AnimatedItem self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_DiscardItem(AnimatedItem self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_DiscardItem(orig_DiscardItem orig, AnimatedItem self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_PocketItem(AnimatedItem self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_PocketItem(orig_PocketItem orig, AnimatedItem self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_Update(AnimatedItem self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_Update(orig_Update orig, AnimatedItem self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_ctor(AnimatedItem self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_ctor(orig_ctor orig, AnimatedItem self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig___initializeVariables(AnimatedItem self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook___initializeVariables(orig___initializeVariables orig, AnimatedItem self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate string orig___getTypeName(AnimatedItem self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate string hook___getTypeName(orig___getTypeName orig, AnimatedItem self); public static event hook_Start Start { add { HookEndpointManager.Add<hook_Start>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_Start>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_EquipItem EquipItem { add { HookEndpointManager.Add<hook_EquipItem>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_EquipItem>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_DiscardItem DiscardItem { add { HookEndpointManager.Add<hook_DiscardItem>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_DiscardItem>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_PocketItem PocketItem { add { HookEndpointManager.Add<hook_PocketItem>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_PocketItem>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_Update Update { add { HookEndpointManager.Add<hook_Update>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_Update>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_ctor ctor { add { HookEndpointManager.Add<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook___initializeVariables __initializeVariables { add { HookEndpointManager.Add<hook___initializeVariables>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook___initializeVariables>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook___getTypeName __getTypeName { add { HookEndpointManager.Add<hook___getTypeName>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook___getTypeName>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } } } namespace IL { public static class AnimatedItem { public static event Manipulator Start { add { HookEndpointManager.Modify<On.AnimatedItem.hook_Start>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.AnimatedItem.hook_Start>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator EquipItem { add { HookEndpointManager.Modify<On.AnimatedItem.hook_EquipItem>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.AnimatedItem.hook_EquipItem>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator DiscardItem { add { HookEndpointManager.Modify<On.AnimatedItem.hook_DiscardItem>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.AnimatedItem.hook_DiscardItem>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator PocketItem { add { HookEndpointManager.Modify<On.AnimatedItem.hook_PocketItem>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.AnimatedItem.hook_PocketItem>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator Update { add { HookEndpointManager.Modify<On.AnimatedItem.hook_Update>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.AnimatedItem.hook_Update>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator ctor { add { HookEndpointManager.Modify<On.AnimatedItem.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.AnimatedItem.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator __initializeVariables { add { HookEndpointManager.Modify<On.AnimatedItem.hook___initializeVariables>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.AnimatedItem.hook___initializeVariables>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator __getTypeName { add { HookEndpointManager.Modify<On.AnimatedItem.hook___getTypeName>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.AnimatedItem.hook___getTypeName>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } } } namespace On { public static class AnimatedTextureUV { [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_OnEnable(AnimatedTextureUV self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_OnEnable(orig_OnEnable orig, AnimatedTextureUV self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_OnDisable(AnimatedTextureUV self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_OnDisable(orig_OnDisable orig, AnimatedTextureUV self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate IEnumerator orig_AnimateUV(AnimatedTextureUV self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate IEnumerator hook_AnimateUV(orig_AnimateUV orig, AnimatedTextureUV self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_ctor(AnimatedTextureUV self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_ctor(orig_ctor orig, AnimatedTextureUV self); public static event hook_OnEnable OnEnable { add { HookEndpointManager.Add<hook_OnEnable>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_OnEnable>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_OnDisable OnDisable { add { HookEndpointManager.Add<hook_OnDisable>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_OnDisable>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_AnimateUV AnimateUV { add { HookEndpointManager.Add<hook_AnimateUV>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_AnimateUV>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_ctor ctor { add { HookEndpointManager.Add<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } } } namespace IL { public static class AnimatedTextureUV { public static event Manipulator OnEnable { add { HookEndpointManager.Modify<On.AnimatedTextureUV.hook_OnEnable>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.AnimatedTextureUV.hook_OnEnable>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator OnDisable { add { HookEndpointManager.Modify<On.AnimatedTextureUV.hook_OnDisable>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.AnimatedTextureUV.hook_OnDisable>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator AnimateUV { add { HookEndpointManager.Modify<On.AnimatedTextureUV.hook_AnimateUV>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.AnimatedTextureUV.hook_AnimateUV>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator ctor { add { HookEndpointManager.Modify<On.AnimatedTextureUV.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.AnimatedTextureUV.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } } } namespace On { public static class AnimationStopPoints { [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_SetAnimationStopPosition1(AnimationStopPoints self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_SetAnimationStopPosition1(orig_SetAnimationStopPosition1 orig, AnimationStopPoints self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_SetAnimationGo(AnimationStopPoints self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_SetAnimationGo(orig_SetAnimationGo orig, AnimationStopPoints self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_SetAnimationStopPosition2(AnimationStopPoints self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_SetAnimationStopPosition2(orig_SetAnimationStopPosition2 orig, AnimationStopPoints self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_ctor(AnimationStopPoints self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_ctor(orig_ctor orig, AnimationStopPoints self); public static event hook_SetAnimationStopPosition1 SetAnimationStopPosition1 { add { HookEndpointManager.Add<hook_SetAnimationStopPosition1>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_SetAnimationStopPosition1>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_SetAnimationGo SetAnimationGo { add { HookEndpointManager.Add<hook_SetAnimationGo>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_SetAnimationGo>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_SetAnimationStopPosition2 SetAnimationStopPosition2 { add { HookEndpointManager.Add<hook_SetAnimationStopPosition2>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_SetAnimationStopPosition2>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_ctor ctor { add { HookEndpointManager.Add<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } } } namespace IL { public static class AnimationStopPoints { public static event Manipulator SetAnimationStopPosition1 { add { HookEndpointManager.Modify<On.AnimationStopPoints.hook_SetAnimationStopPosition1>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.AnimationStopPoints.hook_SetAnimationStopPosition1>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator SetAnimationGo { add { HookEndpointManager.Modify<On.AnimationStopPoints.hook_SetAnimationGo>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.AnimationStopPoints.hook_SetAnimationGo>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator SetAnimationStopPosition2 { add { HookEndpointManager.Modify<On.AnimationStopPoints.hook_SetAnimationStopPosition2>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.AnimationStopPoints.hook_SetAnimationStopPosition2>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator ctor { add { HookEndpointManager.Modify<On.AnimationStopPoints.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.AnimationStopPoints.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } } } namespace On { public static class AudioReverbPresets { [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_ctor(AudioReverbPresets self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_ctor(orig_ctor orig, AudioReverbPresets self); public static event hook_ctor ctor { add { HookEndpointManager.Add<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } } } namespace IL { public static class AudioReverbPresets { public static event Manipulator ctor { add { HookEndpointManager.Modify<On.AudioReverbPresets.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.AudioReverbPresets.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } } } namespace On { public static class AutoParentToShip { [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_Awake(AutoParentToShip self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_Awake(orig_Awake orig, AutoParentToShip self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_LateUpdate(AutoParentToShip self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_LateUpdate(orig_LateUpdate orig, AutoParentToShip self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_StartSuckingOutOfShip(AutoParentToShip self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_StartSuckingOutOfShip(orig_StartSuckingOutOfShip orig, AutoParentToShip self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate IEnumerator orig_SuckObjectOutOfShip(AutoParentToShip self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate IEnumerator hook_SuckObjectOutOfShip(orig_SuckObjectOutOfShip orig, AutoParentToShip self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_MoveToOffset(AutoParentToShip self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_MoveToOffset(orig_MoveToOffset orig, AutoParentToShip self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_ctor(AutoParentToShip self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_ctor(orig_ctor orig, AutoParentToShip self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig___initializeVariables(AutoParentToShip self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook___initializeVariables(orig___initializeVariables orig, AutoParentToShip self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate string orig___getTypeName(AutoParentToShip self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate string hook___getTypeName(orig___getTypeName orig, AutoParentToShip self); public static event hook_Awake Awake { add { HookEndpointManager.Add<hook_Awake>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_Awake>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_LateUpdate LateUpdate { add { HookEndpointManager.Add<hook_LateUpdate>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_LateUpdate>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_StartSuckingOutOfShip StartSuckingOutOfShip { add { HookEndpointManager.Add<hook_StartSuckingOutOfShip>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_StartSuckingOutOfShip>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_SuckObjectOutOfShip SuckObjectOutOfShip { add { HookEndpointManager.Add<hook_SuckObjectOutOfShip>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_SuckObjectOutOfShip>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_MoveToOffset MoveToOffset { add { HookEndpointManager.Add<hook_MoveToOffset>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_MoveToOffset>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_ctor ctor { add { HookEndpointManager.Add<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook___initializeVariables __initializeVariables { add { HookEndpointManager.Add<hook___initializeVariables>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook___initializeVariables>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook___getTypeName __getTypeName { add { HookEndpointManager.Add<hook___getTypeName>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook___getTypeName>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } } } namespace IL { public static class AutoParentToShip { public static event Manipulator Awake { add { HookEndpointManager.Modify<On.AutoParentToShip.hook_Awake>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.AutoParentToShip.hook_Awake>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator LateUpdate { add { HookEndpointManager.Modify<On.AutoParentToShip.hook_LateUpdate>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.AutoParentToShip.hook_LateUpdate>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator StartSuckingOutOfShip { add { HookEndpointManager.Modify<On.AutoParentToShip.hook_StartSuckingOutOfShip>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.AutoParentToShip.hook_StartSuckingOutOfShip>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator SuckObjectOutOfShip { add { HookEndpointManager.Modify<On.AutoParentToShip.hook_SuckObjectOutOfShip>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.AutoParentToShip.hook_SuckObjectOutOfShip>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator MoveToOffset { add { HookEndpointManager.Modify<On.AutoParentToShip.hook_MoveToOffset>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.AutoParentToShip.hook_MoveToOffset>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator ctor { add { HookEndpointManager.Modify<On.AutoParentToShip.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.AutoParentToShip.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator __initializeVariables { add { HookEndpointManager.Modify<On.AutoParentToShip.hook___initializeVariables>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.AutoParentToShip.hook___initializeVariables>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator __getTypeName { add { HookEndpointManager.Modify<On.AutoParentToShip.hook___getTypeName>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.AutoParentToShip.hook___getTypeName>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } } } namespace On { public static class BaboonBirdAI { [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_Start(BaboonBirdAI self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_Start(orig_Start orig, BaboonBirdAI self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_SyncInitialValuesServerRpc(BaboonBirdAI self, int syncLeadershipLevel, Vector3 campPosition); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_SyncInitialValuesServerRpc(orig_SyncInitialValuesServerRpc orig, BaboonBirdAI self, int syncLeadershipLevel, Vector3 campPosition); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_SyncInitialValuesClientRpc(BaboonBirdAI self, int syncLeadershipLevel, Vector3 campPosition); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_SyncInitialValuesClientRpc(orig_SyncInitialValuesClientRpc orig, BaboonBirdAI self, int syncLeadershipLevel, Vector3 campPosition); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_LateUpdate(BaboonBirdAI self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_LateUpdate(orig_LateUpdate orig, BaboonBirdAI self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_OnCollideWithPlayer(BaboonBirdAI self, Collider other); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_OnCollideWithPlayer(orig_OnCollideWithPlayer orig, BaboonBirdAI self, Collider other); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_OnCollideWithEnemy(BaboonBirdAI self, Collider other, EnemyAI enemyScript); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_OnCollideWithEnemy(orig_OnCollideWithEnemy orig, BaboonBirdAI self, Collider other, EnemyAI enemyScript); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_HitEnemy(BaboonBirdAI self, int force, PlayerControllerB playerWhoHit, bool playHitSFX); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_HitEnemy(orig_HitEnemy orig, BaboonBirdAI self, int force, PlayerControllerB playerWhoHit, bool playHitSFX); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_KillEnemy(BaboonBirdAI self, bool destroy); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_KillEnemy(orig_KillEnemy orig, BaboonBirdAI self, bool destroy); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_StopKillAnimation(BaboonBirdAI self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_StopKillAnimation(orig_StopKillAnimation orig, BaboonBirdAI self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_StabPlayerDeathAnimServerRpc(BaboonBirdAI self, int playerObject); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_StabPlayerDeathAnimServerRpc(orig_StabPlayerDeathAnimServerRpc orig, BaboonBirdAI self, int playerObject); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_StabPlayerDeathAnimClientRpc(BaboonBirdAI self, int playerObject); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_StabPlayerDeathAnimClientRpc(orig_StabPlayerDeathAnimClientRpc orig, BaboonBirdAI self, int playerObject); [EditorBrowsable(EditorBrowsableState.Never)] public delegate IEnumerator orig_killPlayerAnimation(BaboonBirdAI self, int playerObject); [EditorBrowsable(EditorBrowsableState.Never)] public delegate IEnumerator hook_killPlayerAnimation(orig_killPlayerAnimation orig, BaboonBirdAI self, int playerObject); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_InteractWithScrap(BaboonBirdAI self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_InteractWithScrap(orig_InteractWithScrap orig, BaboonBirdAI self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool orig_CanGrabScrap(BaboonBirdAI self, GrabbableObject scrap); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool hook_CanGrabScrap(orig_CanGrabScrap orig, BaboonBirdAI self, GrabbableObject scrap); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_DropHeldItemAndSync(BaboonBirdAI self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_DropHeldItemAndSync(orig_DropHeldItemAndSync orig, BaboonBirdAI self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_DropScrapServerRpc(BaboonBirdAI self, NetworkObjectReference item, Vector3 targetFloorPosition, int clientWhoSentRPC); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_DropScrapServerRpc(orig_DropScrapServerRpc orig, BaboonBirdAI self, NetworkObjectReference item, Vector3 targetFloorPosition, int clientWhoSentRPC); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_DropScrapClientRpc(BaboonBirdAI self, NetworkObjectReference item, Vector3 targetFloorPosition, int clientWhoSentRPC); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_DropScrapClientRpc(orig_DropScrapClientRpc orig, BaboonBirdAI self, NetworkObjectReference item, Vector3 targetFloorPosition, int clientWhoSentRPC); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_DropScrap(BaboonBirdAI self, NetworkObject item, Vector3 targetFloorPosition); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_DropScrap(orig_DropScrap orig, BaboonBirdAI self, NetworkObject item, Vector3 targetFloorPosition); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_GrabItemAndSync(BaboonBirdAI self, NetworkObject item); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_GrabItemAndSync(orig_GrabItemAndSync orig, BaboonBirdAI self, NetworkObject item); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_GrabScrapServerRpc(BaboonBirdAI self, NetworkObjectReference item, int clientWhoSentRPC); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_GrabScrapServerRpc(orig_GrabScrapServerRpc orig, BaboonBirdAI self, NetworkObjectReference item, int clientWhoSentRPC); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_GrabScrapClientRpc(BaboonBirdAI self, NetworkObjectReference item, int clientWhoSentRPC); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_GrabScrapClientRpc(orig_GrabScrapClientRpc orig, BaboonBirdAI self, NetworkObjectReference item, int clientWhoSentRPC); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_GrabScrap(BaboonBirdAI self, NetworkObject item); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_GrabScrap(orig_GrabScrap orig, BaboonBirdAI self, NetworkObject item); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_ReachedNodeInSearch(BaboonBirdAI self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_ReachedNodeInSearch(orig_ReachedNodeInSearch orig, BaboonBirdAI self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_DoAIInterval(BaboonBirdAI self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_DoAIInterval(orig_DoAIInterval orig, BaboonBirdAI self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_StopFocusingThreat(BaboonBirdAI self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_StopFocusingThreat(orig_StopFocusingThreat orig, BaboonBirdAI self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_StopFocusingThreatServerRpc(BaboonBirdAI self, bool enterScoutingMode); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_StopFocusingThreatServerRpc(orig_StopFocusingThreatServerRpc orig, BaboonBirdAI self, bool enterScoutingMode); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_StopFocusingThreatClientRpc(BaboonBirdAI self, bool enterScoutingMode); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_StopFocusingThreatClientRpc(orig_StopFocusingThreatClientRpc orig, BaboonBirdAI self, bool enterScoutingMode); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_SetAggressiveMode(BaboonBirdAI self, int mode); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_SetAggressiveMode(orig_SetAggressiveMode orig, BaboonBirdAI self, int mode); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_SetAggressiveModeServerRpc(BaboonBirdAI self, int mode); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_SetAggressiveModeServerRpc(orig_SetAggressiveModeServerRpc orig, BaboonBirdAI self, int mode); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_SetAggressiveModeClientRpc(BaboonBirdAI self, int mode); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_SetAggressiveModeClientRpc(orig_SetAggressiveModeClientRpc orig, BaboonBirdAI self, int mode); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_SetThreatInView(BaboonBirdAI self, bool inView); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_SetThreatInView(orig_SetThreatInView orig, BaboonBirdAI self, bool inView); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_SetThreatInViewServerRpc(BaboonBirdAI self, bool inView); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_SetThreatInViewServerRpc(orig_SetThreatInViewServerRpc orig, BaboonBirdAI self, bool inView); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_SetThreatInViewClientRpc(BaboonBirdAI self, bool inView); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_SetThreatInViewClientRpc(orig_SetThreatInViewClientRpc orig, BaboonBirdAI self, bool inView); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_EnemyEnterRestModeServerRpc(BaboonBirdAI self, bool sleep, bool atCamp); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_EnemyEnterRestModeServerRpc(orig_EnemyEnterRestModeServerRpc orig, BaboonBirdAI self, bool sleep, bool atCamp); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_EnemyEnterRestModeClientRpc(BaboonBirdAI self, bool sleep, bool atCamp); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_EnemyEnterRestModeClientRpc(orig_EnemyEnterRestModeClientRpc orig, BaboonBirdAI self, bool sleep, bool atCamp); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_EnemyGetUpServerRpc(BaboonBirdAI self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_EnemyGetUpServerRpc(orig_EnemyGetUpServerRpc orig, BaboonBirdAI self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_EnemyGetUpClientRpc(BaboonBirdAI self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_EnemyGetUpClientRpc(orig_EnemyGetUpClientRpc orig, BaboonBirdAI self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_OnDrawGizmos(BaboonBirdAI self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_OnDrawGizmos(orig_OnDrawGizmos orig, BaboonBirdAI self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_DetectNoise(BaboonBirdAI self, Vector3 noisePosition, float noiseLoudness, int timesPlayedInOneSpot, int noiseID); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_DetectNoise(orig_DetectNoise orig, BaboonBirdAI self, Vector3 noisePosition, float noiseLoudness, int timesPlayedInOneSpot, int noiseID); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_AnimateLooking(BaboonBirdAI self, Vector3 lookAtPosition); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_AnimateLooking(orig_AnimateLooking orig, BaboonBirdAI self, Vector3 lookAtPosition); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_Update(BaboonBirdAI self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_Update(orig_Update orig, BaboonBirdAI self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate float orig_GetComfortableDistanceToThreat(BaboonBirdAI self, Threat focusedThreat); [EditorBrowsable(EditorBrowsableState.Never)] public delegate float hook_GetComfortableDistanceToThreat(orig_GetComfortableDistanceToThreat orig, BaboonBirdAI self, Threat focusedThreat); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_ReactToThreat(BaboonBirdAI self, Threat closestThreat); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_ReactToThreat(orig_ReactToThreat orig, BaboonBirdAI self, Threat closestThreat); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_StartFocusOnThreatServerRpc(BaboonBirdAI self, NetworkObjectReference netObject); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_StartFocusOnThreatServerRpc(orig_StartFocusOnThreatServerRpc orig, BaboonBirdAI self, NetworkObjectReference netObject); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_StartFocusOnThreatClientRpc(BaboonBirdAI self, NetworkObjectReference netObject); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_StartFocusOnThreatClientRpc(orig_StartFocusOnThreatClientRpc orig, BaboonBirdAI self, NetworkObjectReference netObject); [EditorBrowsable(EditorBrowsableState.Never)] public delegate float orig_ReactToOtherBaboonSighted(BaboonBirdAI self, BaboonBirdAI otherBaboon); [EditorBrowsable(EditorBrowsableState.Never)] public delegate float hook_ReactToOtherBaboonSighted(orig_ReactToOtherBaboonSighted orig, BaboonBirdAI self, BaboonBirdAI otherBaboon); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_DoLOSCheck(BaboonBirdAI self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_DoLOSCheck(orig_DoLOSCheck orig, BaboonBirdAI self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_PingBaboonInterest(BaboonBirdAI self, Vector3 interestPosition, int pingImportance); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_PingBaboonInterest(orig_PingBaboonInterest orig, BaboonBirdAI self, Vector3 interestPosition, int pingImportance); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_PingBirdInterestServerRpc(BaboonBirdAI self, Vector3 lookPosition, float timeToPeek); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_PingBirdInterestServerRpc(orig_PingBirdInterestServerRpc orig, BaboonBirdAI self, Vector3 lookPosition, float timeToPeek); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_PingBirdInterestClientRpc(BaboonBirdAI self, Vector3 lookPosition, float timeToPeek); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_PingBirdInterestClientRpc(orig_PingBirdInterestClientRpc orig, BaboonBirdAI self, Vector3 lookPosition, float timeToPeek); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_JoinScoutingGroup(BaboonBirdAI self, BaboonBirdAI otherBaboon); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_JoinScoutingGroup(orig_JoinScoutingGroup orig, BaboonBirdAI self, BaboonBirdAI otherBaboon); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_StartScoutingGroup(BaboonBirdAI self, BaboonBirdAI firstMember, bool syncWithClients); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_StartScoutingGroup(orig_StartScoutingGroup orig, BaboonBirdAI self, BaboonBirdAI firstMember, bool syncWithClients); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_LeaveCurrentScoutingGroup(BaboonBirdAI self, bool sync); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_LeaveCurrentScoutingGroup(orig_LeaveCurrentScoutingGroup orig, BaboonBirdAI self, bool sync); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_LeaveScoutingGroupServerRpc(BaboonBirdAI self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_LeaveScoutingGroupServerRpc(orig_LeaveScoutingGroupServerRpc orig, BaboonBirdAI self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_LeaveScoutingGroupClientRpc(BaboonBirdAI self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_LeaveScoutingGroupClientRpc(orig_LeaveScoutingGroupClientRpc orig, BaboonBirdAI self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_StartScoutingGroupServerRpc(BaboonBirdAI self, NetworkObjectReference leaderNetworkObject); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_StartScoutingGroupServerRpc(orig_StartScoutingGroupServerRpc orig, BaboonBirdAI self, NetworkObjectReference leaderNetworkObject); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_StartScoutingGroupClientRpc(BaboonBirdAI self, NetworkObjectReference leaderNetworkObject); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_StartScoutingGroupClientRpc(orig_StartScoutingGroupClientRpc orig, BaboonBirdAI self, NetworkObjectReference leaderNetworkObject); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_JoinScoutingGroupServerRpc(BaboonBirdAI self, NetworkObjectReference otherBaboonNetworkObject); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_JoinScoutingGroupServerRpc(orig_JoinScoutingGroupServerRpc orig, BaboonBirdAI self, NetworkObjectReference otherBaboonNetworkObject); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_JoinScoutingGroupClientRpc(BaboonBirdAI self, NetworkObjectReference otherBaboonNetworkObject); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_JoinScoutingGroupClientRpc(orig_JoinScoutingGroupClientRpc orig, BaboonBirdAI self, NetworkObjectReference otherBaboonNetworkObject); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_CallToOtherBaboon(BaboonBirdAI self, BaboonBirdAI otherBaboon); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_CallToOtherBaboon(orig_CallToOtherBaboon orig, BaboonBirdAI self, BaboonBirdAI otherBaboon); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_StartMiscAnimation(BaboonBirdAI self, int anim); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_StartMiscAnimation(orig_StartMiscAnimation orig, BaboonBirdAI self, int anim); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_StartMiscAnimationServerRpc(BaboonBirdAI self, int miscAnimationId); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_StartMiscAnimationServerRpc(orig_StartMiscAnimationServerRpc orig, BaboonBirdAI self, int miscAnimationId); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_StartMiscAnimationClientRpc(BaboonBirdAI self, int miscAnimationId); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_StartMiscAnimationClientRpc(orig_StartMiscAnimationClientRpc orig, BaboonBirdAI self, int miscAnimationId); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_CalculateAnimationDirection(BaboonBirdAI self, float maxSpeed); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_CalculateAnimationDirection(orig_CalculateAnimationDirection orig, BaboonBirdAI self, float maxSpeed); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_ctor(BaboonBirdAI self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_ctor(orig_ctor orig, BaboonBirdAI self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig___initializeVariables(BaboonBirdAI self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook___initializeVariables(orig___initializeVariables orig, BaboonBirdAI self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_InitializeRPCS_BaboonBirdAI(); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_InitializeRPCS_BaboonBirdAI(orig_InitializeRPCS_BaboonBirdAI orig); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig___rpc_handler_3452382367(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook___rpc_handler_3452382367(orig___rpc_handler_3452382367 orig, NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig___rpc_handler_3856685904(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook___rpc_handler_3856685904(orig___rpc_handler_3856685904 orig, NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig___rpc_handler_2476579270(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook___rpc_handler_2476579270(orig___rpc_handler_2476579270 orig, NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig___rpc_handler_3749667856(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook___rpc_handler_3749667856(orig___rpc_handler_3749667856 orig, NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig___rpc_handler_1418775270(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook___rpc_handler_1418775270(orig___rpc_handler_1418775270 orig, NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig___rpc_handler_1865475504(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook___rpc_handler_1865475504(orig___rpc_handler_1865475504 orig, NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig___rpc_handler_869682226(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook___rpc_handler_869682226(orig___rpc_handler_869682226 orig, NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig___rpc_handler_1564051222(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook___rpc_handler_1564051222(orig___rpc_handler_1564051222 orig, NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig___rpc_handler_1546030380(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook___rpc_handler_1546030380(orig___rpc_handler_1546030380 orig, NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig___rpc_handler_3360048400(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook___rpc_handler_3360048400(orig___rpc_handler_3360048400 orig, NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig___rpc_handler_443869275(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook___rpc_handler_443869275(orig___rpc_handler_443869275 orig, NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig___rpc_handler_1782649174(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook___rpc_handler_1782649174(orig___rpc_handler_1782649174 orig, NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig___rpc_handler_3428942850(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook___rpc_handler_3428942850(orig___rpc_handler_3428942850 orig, NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig___rpc_handler_2073937320(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook___rpc_handler_2073937320(orig___rpc_handler_2073937320 orig, NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig___rpc_handler_1806580287(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook___rpc_handler_1806580287(orig___rpc_handler_1806580287 orig, NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig___rpc_handler_1567928363(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook___rpc_handler_1567928363(orig___rpc_handler_1567928363 orig, NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig___rpc_handler_3614203845(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook___rpc_handler_3614203845(orig___rpc_handler_3614203845 orig, NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig___rpc_handler_1155909339(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook___rpc_handler_1155909339(orig___rpc_handler_1155909339 orig, NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig___rpc_handler_3933590138(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook___rpc_handler_3933590138(orig___rpc_handler_3933590138 orig, NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig___rpc_handler_991811456(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook___rpc_handler_991811456(orig___rpc_handler_991811456 orig, NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig___rpc_handler_1670979535(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook___rpc_handler_1670979535(orig___rpc_handler_1670979535 orig, NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig___rpc_handler_2348332192(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook___rpc_handler_2348332192(orig___rpc_handler_2348332192 orig, NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig___rpc_handler_2459653399(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook___rpc_handler_2459653399(orig___rpc_handler_2459653399 orig, NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig___rpc_handler_696889160(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook___rpc_handler_696889160(orig___rpc_handler_696889160 orig, NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig___rpc_handler_3367846835(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook___rpc_handler_3367846835(orig___rpc_handler_3367846835 orig, NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig___rpc_handler_1737299197(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook___rpc_handler_1737299197(orig___rpc_handler_1737299197 orig, NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig___rpc_handler_1775372234(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook___rpc_handler_1775372234(orig___rpc_handler_1775372234 orig, NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig___rpc_handler_1078565091(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook___rpc_handler_1078565091(orig___rpc_handler_1078565091 orig, NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig___rpc_handler_1580405641(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook___rpc_handler_1580405641(orig___rpc_handler_1580405641 orig, NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig___rpc_handler_3995026000(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook___rpc_handler_3995026000(orig___rpc_handler_3995026000 orig, NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams); [EditorBrowsable(EditorBrowsableState.Never)] public delegate string orig___getTypeName(BaboonBirdAI self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate string hook___getTypeName(orig___getTypeName orig, BaboonBirdAI self); public static event hook_Start Start { add { HookEndpointManager.Add<hook_Start>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_Start>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_SyncInitialValuesServerRpc SyncInitialValuesServerRpc { add { HookEndpointManager.Add<hook_SyncInitialValuesServerRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_SyncInitialValuesServerRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_SyncInitialValuesClientRpc SyncInitialValuesClientRpc { add { HookEndpointManager.Add<hook_SyncInitialValuesClientRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_SyncInitialValuesClientRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_LateUpdate LateUpdate { add { HookEndpointManager.Add<hook_LateUpdate>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_LateUpdate>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_OnCollideWithPlayer OnCollideWithPlayer { add { HookEndpointManager.Add<hook_OnCollideWithPlayer>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_OnCollideWithPlayer>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_OnCollideWithEnemy OnCollideWithEnemy { add { HookEndpointManager.Add<hook_OnCollideWithEnemy>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_OnCollideWithEnemy>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_HitEnemy HitEnemy { add { HookEndpointManager.Add<hook_HitEnemy>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_HitEnemy>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_KillEnemy KillEnemy { add { HookEndpointManager.Add<hook_KillEnemy>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_KillEnemy>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_StopKillAnimation StopKillAnimation { add { HookEndpointManager.Add<hook_StopKillAnimation>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_StopKillAnimation>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_StabPlayerDeathAnimServerRpc StabPlayerDeathAnimServerRpc { add { HookEndpointManager.Add<hook_StabPlayerDeathAnimServerRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_StabPlayerDeathAnimServerRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_StabPlayerDeathAnimClientRpc StabPlayerDeathAnimClientRpc { add { HookEndpointManager.Add<hook_StabPlayerDeathAnimClientRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_StabPlayerDeathAnimClientRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_killPlayerAnimation killPlayerAnimation { add { HookEndpointManager.Add<hook_killPlayerAnimation>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_killPlayerAnimation>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_InteractWithScrap InteractWithScrap { add { HookEndpointManager.Add<hook_InteractWithScrap>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_InteractWithScrap>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_CanGrabScrap CanGrabScrap { add { HookEndpointManager.Add<hook_CanGrabScrap>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_CanGrabScrap>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_DropHeldItemAndSync DropHeldItemAndSync { add { HookEndpointManager.Add<hook_DropHeldItemAndSync>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_DropHeldItemAndSync>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_DropScrapServerRpc DropScrapServerRpc { add { HookEndpointManager.Add<hook_DropScrapServerRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_DropScrapServerRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_DropScrapClientRpc DropScrapClientRpc { add { HookEndpointManager.Add<hook_DropScrapClientRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_DropScrapClientRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_DropScrap DropScrap { add { HookEndpointManager.Add<hook_DropScrap>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_DropScrap>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_GrabItemAndSync GrabItemAndSync { add { HookEndpointManager.Add<hook_GrabItemAndSync>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_GrabItemAndSync>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_GrabScrapServerRpc GrabScrapServerRpc { add { HookEndpointManager.Add<hook_GrabScrapServerRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_GrabScrapServerRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_GrabScrapClientRpc GrabScrapClientRpc { add { HookEndpointManager.Add<hook_GrabScrapClientRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_GrabScrapClientRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_GrabScrap GrabScrap { add { HookEndpointManager.Add<hook_GrabScrap>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_GrabScrap>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_ReachedNodeInSearch ReachedNodeInSearch { add { HookEndpointManager.Add<hook_ReachedNodeInSearch>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_ReachedNodeInSearch>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_DoAIInterval DoAIInterval { add { HookEndpointManager.Add<hook_DoAIInterval>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_DoAIInterval>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_StopFocusingThreat StopFocusingThreat { add { HookEndpointManager.Add<hook_StopFocusingThreat>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_StopFocusingThreat>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_StopFocusingThreatServerRpc StopFocusingThreatServerRpc { add { HookEndpointManager.Add<hook_StopFocusingThreatServerRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_StopFocusingThreatServerRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_StopFocusingThreatClientRpc StopFocusingThreatClientRpc { add { HookEndpointManager.Add<hook_StopFocusingThreatClientRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_StopFocusingThreatClientRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_SetAggressiveMode SetAggressiveMode { add { HookEndpointManager.Add<hook_SetAggressiveMode>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_SetAggressiveMode>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_SetAggressiveModeServerRpc SetAggressiveModeServerRpc { add { HookEndpointManager.Add<hook_SetAggressiveModeServerRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_SetAggressiveModeServerRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_SetAggressiveModeClientRpc SetAggressiveModeClientRpc { add { HookEndpointManager.Add<hook_SetAggressiveModeClientRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_SetAggressiveModeClientRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_SetThreatInView SetThreatInView { add { HookEndpointManager.Add<hook_SetThreatInView>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_SetThreatInView>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_SetThreatInViewServerRpc SetThreatInViewServerRpc { add { HookEndpointManager.Add<hook_SetThreatInViewServerRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_SetThreatInViewServerRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_SetThreatInViewClientRpc SetThreatInViewClientRpc { add { HookEndpointManager.Add<hook_SetThreatInViewClientRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_SetThreatInViewClientRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_EnemyEnterRestModeServerRpc EnemyEnterRestModeServerRpc { add { HookEndpointManager.Add<hook_EnemyEnterRestModeServerRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_EnemyEnterRestModeServerRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_EnemyEnterRestModeClientRpc EnemyEnterRestModeClientRpc { add { HookEndpointManager.Add<hook_EnemyEnterRestModeClientRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_EnemyEnterRestModeClientRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_EnemyGetUpServerRpc EnemyGetUpServerRpc { add { HookEndpointManager.Add<hook_EnemyGetUpServerRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_EnemyGetUpServerRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_EnemyGetUpClientRpc EnemyGetUpClientRpc { add { HookEndpointManager.Add<hook_EnemyGetUpClientRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_EnemyGetUpClientRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_OnDrawGizmos OnDrawGizmos { add { HookEndpointManager.Add<hook_OnDrawGizmos>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_OnDrawGizmos>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_DetectNoise DetectNoise { add { HookEndpointManager.Add<hook_DetectNoise>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_DetectNoise>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_AnimateLooking AnimateLooking { add { HookEndpointManager.Add<hook_AnimateLooking>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_AnimateLooking>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_Update Update { add { HookEndpointManager.Add<hook_Update>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_Update>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_GetComfortableDistanceToThreat GetComfortableDistanceToThreat { add { HookEndpointManager.Add<hook_GetComfortableDistanceToThreat>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_GetComfortableDistanceToThreat>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_ReactToThreat ReactToThreat { add { HookEndpointManager.Add<hook_ReactToThreat>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_ReactToThreat>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_StartFocusOnThreatServerRpc StartFocusOnThreatServerRpc { add { HookEndpointManager.Add<hook_StartFocusOnThreatServerRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_StartFocusOnThreatServerRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_StartFocusOnThreatClientRpc StartFocusOnThreatClientRpc { add { HookEndpointManager.Add<hook_StartFocusOnThreatClientRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_StartFocusOnThreatClientRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_ReactToOtherBaboonSighted ReactToOtherBaboonSighted { add { HookEndpointManager.Add<hook_ReactToOtherBaboonSighted>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_ReactToOtherBaboonSighted>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_DoLOSCheck DoLOSCheck { add { HookEndpointManager.Add<hook_DoLOSCheck>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_DoLOSCheck>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_PingBaboonInterest PingBaboonInterest { add { HookEndpointManager.Add<hook_PingBaboonInterest>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_PingBaboonInterest>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_PingBirdInterestServerRpc PingBirdInterestServerRpc { add { HookEndpointManager.Add<hook_PingBirdInterestServerRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_PingBirdInterestServerRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_PingBirdInterestClientRpc PingBirdInterestClientRpc { add { HookEndpointManager.Add<hook_PingBirdInterestClientRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_PingBirdInterestClientRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_JoinScoutingGroup JoinScoutingGroup { add { HookEndpointManager.Add<hook_JoinScoutingGroup>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_JoinScoutingGroup>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_StartScoutingGroup StartScoutingGroup { add { HookEndpointManager.Add<hook_StartScoutingGroup>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_StartScoutingGroup>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_LeaveCurrentScoutingGroup LeaveCurrentScoutingGroup { add { HookEndpointManager.Add<hook_LeaveCurrentScoutingGroup>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_LeaveCurrentScoutingGroup>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_LeaveScoutingGroupServerRpc LeaveScoutingGroupServerRpc { add { HookEndpointManager.Add<hook_LeaveScoutingGroupServerRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_LeaveScoutingGroupServerRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_LeaveScoutingGroupClientRpc LeaveScoutingGroupClientRpc { add { HookEndpointManager.Add<hook_LeaveScoutingGroupClientRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_LeaveScoutingGroupClientRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_StartScoutingGroupServerRpc StartScoutingGroupServerRpc { add { HookEndpointManager.Add<hook_StartScoutingGroupServerRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_StartScoutingGroupServerRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_StartScoutingGroupClientRpc StartScoutingGroupClientRpc { add { HookEndpointManager.Add<hook_StartScoutingGroupClientRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_StartScoutingGroupClientRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_JoinScoutingGroupServerRpc JoinScoutingGroupServerRpc { add { HookEndpointManager.Add<hook_JoinScoutingGroupServerRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_JoinScoutingGroupServerRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_JoinScoutingGroupClientRpc JoinScoutingGroupClientRpc { add { HookEndpointManager.Add<hook_JoinScoutingGroupClientRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_JoinScoutingGroupClientRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_CallToOtherBaboon CallToOtherBaboon { add { HookEndpointManager.Add<hook_CallToOtherBaboon>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_CallToOtherBaboon>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_StartMiscAnimation StartMiscAnimation { add { HookEndpointManager.Add<hook_StartMiscAnimation>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_StartMiscAnimation>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_StartMiscAnimationServerRpc StartMiscAnimationServerRpc { add { HookEndpointManager.Add<hook_StartMiscAnimationServerRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_StartMiscAnimationServerRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_StartMiscAnimationClientRpc StartMiscAnimationClientRpc { add { HookEndpointManager.Add<hook_StartMiscAnimationClientRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_StartMiscAnimationClientRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_CalculateAnimationDirection CalculateAnimationDirection { add { HookEndpointManager.Add<hook_CalculateAnimationDirection>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_CalculateAnimationDirection>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_ctor ctor { add { HookEndpointManager.Add<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook___initializeVariables __initializeVariables { add { HookEndpointManager.Add<hook___initializeVariables>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook___initializeVariables>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_InitializeRPCS_BaboonBirdAI InitializeRPCS_BaboonBirdAI { add { HookEndpointManager.Add<hook_InitializeRPCS_BaboonBirdAI>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_InitializeRPCS_BaboonBirdAI>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook___rpc_handler_3452382367 __rpc_handler_3452382367 { add { HookEndpointManager.Add<hook___rpc_handler_3452382367>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook___rpc_handler_3452382367>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook___rpc_handler_3856685904 __rpc_handler_3856685904 { add { HookEndpointManager.Add<hook___rpc_handler_3856685904>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook___rpc_handler_3856685904>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook___rpc_handler_2476579270 __rpc_handler_2476579270 { add { HookEndpointManager.Add<hook___rpc_handler_2476579270>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook___rpc_handler_2476579270>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook___rpc_handler_3749667856 __rpc_handler_3749667856 { add { HookEndpointManager.Add<hook___rpc_handler_3749667856>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook___rpc_handler_3749667856>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook___rpc_handler_1418775270 __rpc_handler_1418775270 { add { HookEndpointManager.Add<hook___rpc_handler_1418775270>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook___rpc_handler_1418775270>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook___rpc_handler_1865475504 __rpc_handler_1865475504 { add { HookEndpointManager.Add<hook___rpc_handler_1865475504>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook___rpc_handler_1865475504>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook___rpc_handler_869682226 __rpc_handler_869682226 { add { HookEndpointManager.Add<hook___rpc_handler_869682226>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook___rpc_handler_869682226>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook___rpc_handler_1564051222 __rpc_handler_1564051222 { add { HookEndpointManager.Add<hook___rpc_handler_1564051222>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook___rpc_handler_1564051222>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook___rpc_handler_1546030380 __rpc_handler_1546030380 { add { HookEndpointManager.Add<hook___rpc_handler_1546030380>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook___rpc_handler_1546030380>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook___rpc_handler_3360048400 __rpc_handler_3360048400 { add { HookEndpointManager.Add<hook___rpc_handler_3360048400>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook___rpc_handler_3360048400>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook___rpc_handler_443869275 __rpc_handler_443869275 { add { HookEndpointManager.Add<hook___rpc_handler_443869275>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook___rpc_handler_443869275>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook___rpc_handler_1782649174 __rpc_handler_1782649174 { add { HookEndpointManager.Add<hook___rpc_handler_1782649174>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook___rpc_handler_1782649174>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook___rpc_handler_3428942850 __rpc_handler_3428942850
BepInEx/plugins/MMHOOK/MMHOOK_ClientNetworkTransform.dll
Decompiled 11 months agousing System; using System.ComponentModel; using System.Reflection; using MonoMod.Cil; using MonoMod.RuntimeDetour.HookGen; using On; using On.Unity.Netcode.Samples; using On.__GEN; using Unity.Netcode.Samples; [assembly: AssemblyVersion("0.0.0.0")] namespace On { public static class UnitySourceGeneratedAssemblyMonoScriptTypes_v1 { [EditorBrowsable(EditorBrowsableState.Never)] public delegate ValueType orig_Get(); [EditorBrowsable(EditorBrowsableState.Never)] public delegate ValueType hook_Get(orig_Get orig); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_ctor(object self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_ctor(orig_ctor orig, object self); public static event hook_Get Get { add { HookEndpointManager.Add<hook_Get>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_Get>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_ctor ctor { add { HookEndpointManager.Add<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } } } namespace IL { public static class UnitySourceGeneratedAssemblyMonoScriptTypes_v1 { public static event Manipulator Get { add { HookEndpointManager.Modify<On.UnitySourceGeneratedAssemblyMonoScriptTypes_v1.hook_Get>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.UnitySourceGeneratedAssemblyMonoScriptTypes_v1.hook_Get>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator ctor { add { HookEndpointManager.Modify<On.UnitySourceGeneratedAssemblyMonoScriptTypes_v1.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.UnitySourceGeneratedAssemblyMonoScriptTypes_v1.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } } } namespace On.Unity.Netcode.Samples { public static class ClientNetworkTransform { [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_OnNetworkSpawn(ClientNetworkTransform self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_OnNetworkSpawn(orig_OnNetworkSpawn orig, ClientNetworkTransform self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_Update(ClientNetworkTransform self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_Update(orig_Update orig, ClientNetworkTransform self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_ctor(ClientNetworkTransform self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_ctor(orig_ctor orig, ClientNetworkTransform self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig___initializeVariables(ClientNetworkTransform self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook___initializeVariables(orig___initializeVariables orig, ClientNetworkTransform self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate string orig___getTypeName(ClientNetworkTransform self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate string hook___getTypeName(orig___getTypeName orig, ClientNetworkTransform self); public static event hook_OnNetworkSpawn OnNetworkSpawn { add { HookEndpointManager.Add<hook_OnNetworkSpawn>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_OnNetworkSpawn>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_Update Update { add { HookEndpointManager.Add<hook_Update>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_Update>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_ctor ctor { add { HookEndpointManager.Add<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook___initializeVariables __initializeVariables { add { HookEndpointManager.Add<hook___initializeVariables>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook___initializeVariables>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook___getTypeName __getTypeName { add { HookEndpointManager.Add<hook___getTypeName>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook___getTypeName>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } } } namespace IL.Unity.Netcode.Samples { public static class ClientNetworkTransform { public static event Manipulator OnNetworkSpawn { add { HookEndpointManager.Modify<On.Unity.Netcode.Samples.ClientNetworkTransform.hook_OnNetworkSpawn>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Unity.Netcode.Samples.ClientNetworkTransform.hook_OnNetworkSpawn>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator Update { add { HookEndpointManager.Modify<On.Unity.Netcode.Samples.ClientNetworkTransform.hook_Update>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Unity.Netcode.Samples.ClientNetworkTransform.hook_Update>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator ctor { add { HookEndpointManager.Modify<On.Unity.Netcode.Samples.ClientNetworkTransform.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Unity.Netcode.Samples.ClientNetworkTransform.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator __initializeVariables { add { HookEndpointManager.Modify<On.Unity.Netcode.Samples.ClientNetworkTransform.hook___initializeVariables>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Unity.Netcode.Samples.ClientNetworkTransform.hook___initializeVariables>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator __getTypeName { add { HookEndpointManager.Modify<On.Unity.Netcode.Samples.ClientNetworkTransform.hook___getTypeName>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Unity.Netcode.Samples.ClientNetworkTransform.hook___getTypeName>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } } } namespace On.__GEN { public static class NetworkVariableSerializationHelper { [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_InitializeSerialization(); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_InitializeSerialization(orig_InitializeSerialization orig); public static event hook_InitializeSerialization InitializeSerialization { add { HookEndpointManager.Add<hook_InitializeSerialization>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_InitializeSerialization>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } } } namespace IL.__GEN { public static class NetworkVariableSerializationHelper { public static event Manipulator InitializeSerialization { add { HookEndpointManager.Modify<On.__GEN.NetworkVariableSerializationHelper.hook_InitializeSerialization>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.__GEN.NetworkVariableSerializationHelper.hook_InitializeSerialization>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } } } namespace BepHookGen { public class size6144 { } }
BepInEx/plugins/MMHOOK/MMHOOK_DissonanceVoip.dll
Decompiled 11 months ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; using System.IO; using System.Reflection; using System.Runtime.InteropServices; using Dissonance; using Dissonance.Audio; using Dissonance.Audio.Capture; using Dissonance.Audio.Codecs; using Dissonance.Audio.Playback; using Dissonance.Config; using Dissonance.Datastructures; using Dissonance.Networking; using Dissonance.VAD; using MonoMod.Cil; using MonoMod.RuntimeDetour.HookGen; using NAudio.Wave; using On; using On.Dissonance; using On.Dissonance.Audio; using On.Dissonance.Audio.Capture; using On.Dissonance.Audio.Codecs; using On.Dissonance.Audio.Codecs.Identity; using On.Dissonance.Audio.Codecs.Opus; using On.Dissonance.Audio.Codecs.Silence; using On.Dissonance.Audio.Playback; using On.Dissonance.Config; using On.Dissonance.Datastructures; using On.Dissonance.Extensions; using On.Dissonance.Networking; using On.Dissonance.Networking.Client; using On.Dissonance.Threading; using On.NAudio.Dsp; using On.NAudio.Wave; using UnityEngine; [assembly: AssemblyVersion("0.0.0.0")] namespace On { public static class UnitySourceGeneratedAssemblyMonoScriptTypes_v1 { [EditorBrowsable(EditorBrowsableState.Never)] public delegate ValueType orig_Get(); [EditorBrowsable(EditorBrowsableState.Never)] public delegate ValueType hook_Get(orig_Get orig); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_ctor(object self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_ctor(orig_ctor orig, object self); public static event hook_Get Get { add { HookEndpointManager.Add<hook_Get>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_Get>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_ctor ctor { add { HookEndpointManager.Add<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } } } namespace IL { public static class UnitySourceGeneratedAssemblyMonoScriptTypes_v1 { public static event Manipulator Get { add { HookEndpointManager.Modify<On.UnitySourceGeneratedAssemblyMonoScriptTypes_v1.hook_Get>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.UnitySourceGeneratedAssemblyMonoScriptTypes_v1.hook_Get>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator ctor { add { HookEndpointManager.Modify<On.UnitySourceGeneratedAssemblyMonoScriptTypes_v1.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.UnitySourceGeneratedAssemblyMonoScriptTypes_v1.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } } } namespace On.NAudio.Dsp { public static class WdlResampler { [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_ctor(object self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_ctor(orig_ctor orig, object self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_SetMode(object self, bool interp, int filtercnt, bool sinc, int sinc_size, int sinc_interpsize); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_SetMode(orig_SetMode orig, object self, bool interp, int filtercnt, bool sinc, int sinc_size, int sinc_interpsize); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_SetFilterParms(object self, float filterpos, float filterq); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_SetFilterParms(orig_SetFilterParms orig, object self, float filterpos, float filterq); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_SetFeedMode(object self, bool wantInputDriven); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_SetFeedMode(orig_SetFeedMode orig, object self, bool wantInputDriven); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_Reset(object self, double fracpos); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_Reset(orig_Reset orig, object self, double fracpos); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_SetRates(object self, double rate_in, double rate_out); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_SetRates(orig_SetRates orig, object self, double rate_in, double rate_out); [EditorBrowsable(EditorBrowsableState.Never)] public delegate double orig_GetCurrentLatency(object self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate double hook_GetCurrentLatency(orig_GetCurrentLatency orig, object self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate int orig_ResamplePrepare(object self, int out_samples, int nch, out float[] inbuffer, out int inbufferOffset); [EditorBrowsable(EditorBrowsableState.Never)] public delegate int hook_ResamplePrepare(orig_ResamplePrepare orig, object self, int out_samples, int nch, out float[] inbuffer, out int inbufferOffset); [EditorBrowsable(EditorBrowsableState.Never)] public delegate int orig_ResampleOut(object self, float[] outBuffer, int outBufferIndex, int nsamples_in, int nsamples_out, int nch); [EditorBrowsable(EditorBrowsableState.Never)] public delegate int hook_ResampleOut(orig_ResampleOut orig, object self, float[] outBuffer, int outBufferIndex, int nsamples_in, int nsamples_out, int nch); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_BuildLowPass(object self, double filtpos); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_BuildLowPass(orig_BuildLowPass orig, object self, double filtpos); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_SincSample(object self, float[] outBuffer, int outBufferIndex, float[] inBuffer, int inBufferIndex, double fracpos, int nch, float[] filter, int filterIndex, int filtsz); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_SincSample(orig_SincSample orig, object self, float[] outBuffer, int outBufferIndex, float[] inBuffer, int inBufferIndex, double fracpos, int nch, float[] filter, int filterIndex, int filtsz); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_SincSample1(object self, float[] outBuffer, int outBufferIndex, float[] inBuffer, int inBufferIndex, double fracpos, float[] filter, int filterIndex, int filtsz); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_SincSample1(orig_SincSample1 orig, object self, float[] outBuffer, int outBufferIndex, float[] inBuffer, int inBufferIndex, double fracpos, float[] filter, int filterIndex, int filtsz); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_SincSample2(object self, float[] outptr, int outBufferIndex, float[] inBuffer, int inBufferIndex, double fracpos, float[] filter, int filterIndex, int filtsz); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_SincSample2(orig_SincSample2 orig, object self, float[] outptr, int outBufferIndex, float[] inBuffer, int inBufferIndex, double fracpos, float[] filter, int filterIndex, int filtsz); public static class WDL_Resampler_IIRFilter { [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_ctor(object self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_ctor(orig_ctor orig, object self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_Reset(object self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_Reset(orig_Reset orig, object self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_setParms(object self, double fpos, double Q); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_setParms(orig_setParms orig, object self, double fpos, double Q); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_Apply(object self, float[] inBuffer, int inIndex, float[] outBuffer, int outIndex, int ns, int span, int w); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_Apply(orig_Apply orig, object self, float[] inBuffer, int inIndex, float[] outBuffer, int outIndex, int ns, int span, int w); [EditorBrowsable(EditorBrowsableState.Never)] public delegate double orig_denormal_filter_float(object self, float x); [EditorBrowsable(EditorBrowsableState.Never)] public delegate double hook_denormal_filter_float(orig_denormal_filter_float orig, object self, float x); [EditorBrowsable(EditorBrowsableState.Never)] public delegate double orig_denormal_filter_double(object self, double x); [EditorBrowsable(EditorBrowsableState.Never)] public delegate double hook_denormal_filter_double(orig_denormal_filter_double orig, object self, double x); public static event hook_ctor ctor { add { HookEndpointManager.Add<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_Reset Reset { add { HookEndpointManager.Add<hook_Reset>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_Reset>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_setParms setParms { add { HookEndpointManager.Add<hook_setParms>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_setParms>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_Apply Apply { add { HookEndpointManager.Add<hook_Apply>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_Apply>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_denormal_filter_float denormal_filter_float { add { HookEndpointManager.Add<hook_denormal_filter_float>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_denormal_filter_float>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_denormal_filter_double denormal_filter_double { add { HookEndpointManager.Add<hook_denormal_filter_double>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_denormal_filter_double>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } } public static event hook_ctor ctor { add { HookEndpointManager.Add<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_SetMode SetMode { add { HookEndpointManager.Add<hook_SetMode>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_SetMode>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_SetFilterParms SetFilterParms { add { HookEndpointManager.Add<hook_SetFilterParms>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_SetFilterParms>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_SetFeedMode SetFeedMode { add { HookEndpointManager.Add<hook_SetFeedMode>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_SetFeedMode>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_Reset Reset { add { HookEndpointManager.Add<hook_Reset>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_Reset>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_SetRates SetRates { add { HookEndpointManager.Add<hook_SetRates>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_SetRates>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_GetCurrentLatency GetCurrentLatency { add { HookEndpointManager.Add<hook_GetCurrentLatency>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_GetCurrentLatency>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_ResamplePrepare ResamplePrepare { add { HookEndpointManager.Add<hook_ResamplePrepare>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_ResamplePrepare>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_ResampleOut ResampleOut { add { HookEndpointManager.Add<hook_ResampleOut>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_ResampleOut>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_BuildLowPass BuildLowPass { add { HookEndpointManager.Add<hook_BuildLowPass>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_BuildLowPass>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_SincSample SincSample { add { HookEndpointManager.Add<hook_SincSample>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_SincSample>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_SincSample1 SincSample1 { add { HookEndpointManager.Add<hook_SincSample1>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_SincSample1>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_SincSample2 SincSample2 { add { HookEndpointManager.Add<hook_SincSample2>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_SincSample2>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } } } namespace IL.NAudio.Dsp { public static class WdlResampler { public static class WDL_Resampler_IIRFilter { public static event Manipulator ctor { add { HookEndpointManager.Modify<On.NAudio.Dsp.WdlResampler.WDL_Resampler_IIRFilter.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.NAudio.Dsp.WdlResampler.WDL_Resampler_IIRFilter.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator Reset { add { HookEndpointManager.Modify<On.NAudio.Dsp.WdlResampler.WDL_Resampler_IIRFilter.hook_Reset>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.NAudio.Dsp.WdlResampler.WDL_Resampler_IIRFilter.hook_Reset>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator setParms { add { HookEndpointManager.Modify<On.NAudio.Dsp.WdlResampler.WDL_Resampler_IIRFilter.hook_setParms>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.NAudio.Dsp.WdlResampler.WDL_Resampler_IIRFilter.hook_setParms>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator Apply { add { HookEndpointManager.Modify<On.NAudio.Dsp.WdlResampler.WDL_Resampler_IIRFilter.hook_Apply>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.NAudio.Dsp.WdlResampler.WDL_Resampler_IIRFilter.hook_Apply>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator denormal_filter_float { add { HookEndpointManager.Modify<On.NAudio.Dsp.WdlResampler.WDL_Resampler_IIRFilter.hook_denormal_filter_float>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.NAudio.Dsp.WdlResampler.WDL_Resampler_IIRFilter.hook_denormal_filter_float>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator denormal_filter_double { add { HookEndpointManager.Modify<On.NAudio.Dsp.WdlResampler.WDL_Resampler_IIRFilter.hook_denormal_filter_double>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.NAudio.Dsp.WdlResampler.WDL_Resampler_IIRFilter.hook_denormal_filter_double>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } } public static event Manipulator ctor { add { HookEndpointManager.Modify<On.NAudio.Dsp.WdlResampler.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.NAudio.Dsp.WdlResampler.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator SetMode { add { HookEndpointManager.Modify<On.NAudio.Dsp.WdlResampler.hook_SetMode>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.NAudio.Dsp.WdlResampler.hook_SetMode>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator SetFilterParms { add { HookEndpointManager.Modify<On.NAudio.Dsp.WdlResampler.hook_SetFilterParms>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.NAudio.Dsp.WdlResampler.hook_SetFilterParms>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator SetFeedMode { add { HookEndpointManager.Modify<On.NAudio.Dsp.WdlResampler.hook_SetFeedMode>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.NAudio.Dsp.WdlResampler.hook_SetFeedMode>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator Reset { add { HookEndpointManager.Modify<On.NAudio.Dsp.WdlResampler.hook_Reset>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.NAudio.Dsp.WdlResampler.hook_Reset>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator SetRates { add { HookEndpointManager.Modify<On.NAudio.Dsp.WdlResampler.hook_SetRates>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.NAudio.Dsp.WdlResampler.hook_SetRates>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator GetCurrentLatency { add { HookEndpointManager.Modify<On.NAudio.Dsp.WdlResampler.hook_GetCurrentLatency>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.NAudio.Dsp.WdlResampler.hook_GetCurrentLatency>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator ResamplePrepare { add { HookEndpointManager.Modify<On.NAudio.Dsp.WdlResampler.hook_ResamplePrepare>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.NAudio.Dsp.WdlResampler.hook_ResamplePrepare>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator ResampleOut { add { HookEndpointManager.Modify<On.NAudio.Dsp.WdlResampler.hook_ResampleOut>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.NAudio.Dsp.WdlResampler.hook_ResampleOut>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator BuildLowPass { add { HookEndpointManager.Modify<On.NAudio.Dsp.WdlResampler.hook_BuildLowPass>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.NAudio.Dsp.WdlResampler.hook_BuildLowPass>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator SincSample { add { HookEndpointManager.Modify<On.NAudio.Dsp.WdlResampler.hook_SincSample>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.NAudio.Dsp.WdlResampler.hook_SincSample>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator SincSample1 { add { HookEndpointManager.Modify<On.NAudio.Dsp.WdlResampler.hook_SincSample1>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.NAudio.Dsp.WdlResampler.hook_SincSample1>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator SincSample2 { add { HookEndpointManager.Modify<On.NAudio.Dsp.WdlResampler.hook_SincSample2>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.NAudio.Dsp.WdlResampler.hook_SincSample2>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } } } namespace On.NAudio.Wave { public static class WaveFileWriter { [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_ctor_Stream_WaveFormat(Stream self, Stream outStream, WaveFormat format); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_ctor_Stream_WaveFormat(orig_ctor_Stream_WaveFormat orig, Stream self, Stream outStream, WaveFormat format); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_ctor_string_WaveFormat(Stream self, string filename, WaveFormat format); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_ctor_string_WaveFormat(orig_ctor_string_WaveFormat orig, Stream self, string filename, WaveFormat format); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_WriteDataChunkHeader(Stream self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_WriteDataChunkHeader(orig_WriteDataChunkHeader orig, Stream self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_CreateFactChunk(Stream self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_CreateFactChunk(orig_CreateFactChunk orig, Stream self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool orig_HasFactChunk(Stream self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool hook_HasFactChunk(orig_HasFactChunk orig, Stream self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate int orig_Read(Stream self, byte[] buffer, int offset, int count); [EditorBrowsable(EditorBrowsableState.Never)] public delegate int hook_Read(orig_Read orig, Stream self, byte[] buffer, int offset, int count); [EditorBrowsable(EditorBrowsableState.Never)] public delegate long orig_Seek(Stream self, long offset, SeekOrigin origin); [EditorBrowsable(EditorBrowsableState.Never)] public delegate long hook_Seek(orig_Seek orig, Stream self, long offset, SeekOrigin origin); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_SetLength(Stream self, long value); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_SetLength(orig_SetLength orig, Stream self, long value); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_Write(Stream self, byte[] data, int offset, int count); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_Write(orig_Write orig, Stream self, byte[] data, int offset, int count); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_WriteSample(Stream self, float sample); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_WriteSample(orig_WriteSample orig, Stream self, float sample); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_WriteSamples(Stream self, float[] samples, int offset, int count); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_WriteSamples(orig_WriteSamples orig, Stream self, float[] samples, int offset, int count); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_Flush(Stream self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_Flush(orig_Flush orig, Stream self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_Dispose(Stream self, bool disposing); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_Dispose(orig_Dispose orig, Stream self, bool disposing); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_UpdateHeader(Stream self, BinaryWriter writer); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_UpdateHeader(orig_UpdateHeader orig, Stream self, BinaryWriter writer); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_UpdateDataChunk(Stream self, BinaryWriter writer); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_UpdateDataChunk(orig_UpdateDataChunk orig, Stream self, BinaryWriter writer); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_UpdateRiffChunk(Stream self, BinaryWriter writer); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_UpdateRiffChunk(orig_UpdateRiffChunk orig, Stream self, BinaryWriter writer); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_UpdateFactChunk(Stream self, BinaryWriter writer); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_UpdateFactChunk(orig_UpdateFactChunk orig, Stream self, BinaryWriter writer); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_Finalize(Stream self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_Finalize(orig_Finalize orig, Stream self); public static event hook_ctor_Stream_WaveFormat ctor_Stream_WaveFormat { add { HookEndpointManager.Add<hook_ctor_Stream_WaveFormat>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_ctor_Stream_WaveFormat>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_ctor_string_WaveFormat ctor_string_WaveFormat { add { HookEndpointManager.Add<hook_ctor_string_WaveFormat>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_ctor_string_WaveFormat>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_WriteDataChunkHeader WriteDataChunkHeader { add { HookEndpointManager.Add<hook_WriteDataChunkHeader>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_WriteDataChunkHeader>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_CreateFactChunk CreateFactChunk { add { HookEndpointManager.Add<hook_CreateFactChunk>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_CreateFactChunk>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_HasFactChunk HasFactChunk { add { HookEndpointManager.Add<hook_HasFactChunk>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_HasFactChunk>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_Read Read { add { HookEndpointManager.Add<hook_Read>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_Read>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_Seek Seek { add { HookEndpointManager.Add<hook_Seek>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_Seek>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_SetLength SetLength { add { HookEndpointManager.Add<hook_SetLength>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_SetLength>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_Write Write { add { HookEndpointManager.Add<hook_Write>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_Write>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_WriteSample WriteSample { add { HookEndpointManager.Add<hook_WriteSample>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_WriteSample>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_WriteSamples WriteSamples { add { HookEndpointManager.Add<hook_WriteSamples>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_WriteSamples>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_Flush Flush { add { HookEndpointManager.Add<hook_Flush>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_Flush>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_Dispose Dispose { add { HookEndpointManager.Add<hook_Dispose>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_Dispose>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_UpdateHeader UpdateHeader { add { HookEndpointManager.Add<hook_UpdateHeader>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_UpdateHeader>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_UpdateDataChunk UpdateDataChunk { add { HookEndpointManager.Add<hook_UpdateDataChunk>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_UpdateDataChunk>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_UpdateRiffChunk UpdateRiffChunk { add { HookEndpointManager.Add<hook_UpdateRiffChunk>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_UpdateRiffChunk>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_UpdateFactChunk UpdateFactChunk { add { HookEndpointManager.Add<hook_UpdateFactChunk>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_UpdateFactChunk>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public new static event hook_Finalize Finalize { add { HookEndpointManager.Add<hook_Finalize>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_Finalize>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } } } namespace IL.NAudio.Wave { public static class WaveFileWriter { public static event Manipulator ctor_Stream_WaveFormat { add { HookEndpointManager.Modify<On.NAudio.Wave.WaveFileWriter.hook_ctor_Stream_WaveFormat>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.NAudio.Wave.WaveFileWriter.hook_ctor_Stream_WaveFormat>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator ctor_string_WaveFormat { add { HookEndpointManager.Modify<On.NAudio.Wave.WaveFileWriter.hook_ctor_string_WaveFormat>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.NAudio.Wave.WaveFileWriter.hook_ctor_string_WaveFormat>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator WriteDataChunkHeader { add { HookEndpointManager.Modify<On.NAudio.Wave.WaveFileWriter.hook_WriteDataChunkHeader>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.NAudio.Wave.WaveFileWriter.hook_WriteDataChunkHeader>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator CreateFactChunk { add { HookEndpointManager.Modify<On.NAudio.Wave.WaveFileWriter.hook_CreateFactChunk>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.NAudio.Wave.WaveFileWriter.hook_CreateFactChunk>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator HasFactChunk { add { HookEndpointManager.Modify<On.NAudio.Wave.WaveFileWriter.hook_HasFactChunk>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.NAudio.Wave.WaveFileWriter.hook_HasFactChunk>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator Read { add { HookEndpointManager.Modify<On.NAudio.Wave.WaveFileWriter.hook_Read>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.NAudio.Wave.WaveFileWriter.hook_Read>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator Seek { add { HookEndpointManager.Modify<On.NAudio.Wave.WaveFileWriter.hook_Seek>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.NAudio.Wave.WaveFileWriter.hook_Seek>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator SetLength { add { HookEndpointManager.Modify<On.NAudio.Wave.WaveFileWriter.hook_SetLength>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.NAudio.Wave.WaveFileWriter.hook_SetLength>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator Write { add { HookEndpointManager.Modify<On.NAudio.Wave.WaveFileWriter.hook_Write>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.NAudio.Wave.WaveFileWriter.hook_Write>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator WriteSample { add { HookEndpointManager.Modify<On.NAudio.Wave.WaveFileWriter.hook_WriteSample>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.NAudio.Wave.WaveFileWriter.hook_WriteSample>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator WriteSamples { add { HookEndpointManager.Modify<On.NAudio.Wave.WaveFileWriter.hook_WriteSamples>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.NAudio.Wave.WaveFileWriter.hook_WriteSamples>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator Flush { add { HookEndpointManager.Modify<On.NAudio.Wave.WaveFileWriter.hook_Flush>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.NAudio.Wave.WaveFileWriter.hook_Flush>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator Dispose { add { HookEndpointManager.Modify<On.NAudio.Wave.WaveFileWriter.hook_Dispose>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.NAudio.Wave.WaveFileWriter.hook_Dispose>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator UpdateHeader { add { HookEndpointManager.Modify<On.NAudio.Wave.WaveFileWriter.hook_UpdateHeader>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.NAudio.Wave.WaveFileWriter.hook_UpdateHeader>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator UpdateDataChunk { add { HookEndpointManager.Modify<On.NAudio.Wave.WaveFileWriter.hook_UpdateDataChunk>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.NAudio.Wave.WaveFileWriter.hook_UpdateDataChunk>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator UpdateRiffChunk { add { HookEndpointManager.Modify<On.NAudio.Wave.WaveFileWriter.hook_UpdateRiffChunk>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.NAudio.Wave.WaveFileWriter.hook_UpdateRiffChunk>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator UpdateFactChunk { add { HookEndpointManager.Modify<On.NAudio.Wave.WaveFileWriter.hook_UpdateFactChunk>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.NAudio.Wave.WaveFileWriter.hook_UpdateFactChunk>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public new static event Manipulator Finalize { add { HookEndpointManager.Modify<On.NAudio.Wave.WaveFileWriter.hook_Finalize>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.NAudio.Wave.WaveFileWriter.hook_Finalize>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } } } namespace On.NAudio.Wave { public static class WaveFormat { [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_ctor(WaveFormat self, int sampleRate, int channels); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_ctor(orig_ctor orig, WaveFormat self, int sampleRate, int channels); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool orig_Equals(WaveFormat self, WaveFormat other); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool hook_Equals(orig_Equals orig, WaveFormat self, WaveFormat other); [EditorBrowsable(EditorBrowsableState.Never)] public delegate int orig_GetHashCode(WaveFormat self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate int hook_GetHashCode(orig_GetHashCode orig, WaveFormat self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate string orig_ToString(WaveFormat self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate string hook_ToString(orig_ToString orig, WaveFormat self); public static event hook_ctor ctor { add { HookEndpointManager.Add<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public new static event hook_Equals Equals { add { HookEndpointManager.Add<hook_Equals>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_Equals>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public new static event hook_GetHashCode GetHashCode { add { HookEndpointManager.Add<hook_GetHashCode>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_GetHashCode>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public new static event hook_ToString ToString { add { HookEndpointManager.Add<hook_ToString>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_ToString>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } } } namespace IL.NAudio.Wave { public static class WaveFormat { public static event Manipulator ctor { add { HookEndpointManager.Modify<On.NAudio.Wave.WaveFormat.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.NAudio.Wave.WaveFormat.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public new static event Manipulator Equals { add { HookEndpointManager.Modify<On.NAudio.Wave.WaveFormat.hook_Equals>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.NAudio.Wave.WaveFormat.hook_Equals>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public new static event Manipulator GetHashCode { add { HookEndpointManager.Modify<On.NAudio.Wave.WaveFormat.hook_GetHashCode>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.NAudio.Wave.WaveFormat.hook_GetHashCode>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public new static event Manipulator ToString { add { HookEndpointManager.Modify<On.NAudio.Wave.WaveFormat.hook_ToString>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.NAudio.Wave.WaveFormat.hook_ToString>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } } } namespace On.Dissonance { public static class BaseCommsTrigger { [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_ctor(BaseCommsTrigger self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_ctor(orig_ctor orig, BaseCommsTrigger self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_Awake(BaseCommsTrigger self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_Awake(orig_Awake orig, BaseCommsTrigger self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_Start(BaseCommsTrigger self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_Start(orig_Start orig, BaseCommsTrigger self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_OnEnable(BaseCommsTrigger self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_OnEnable(orig_OnEnable orig, BaseCommsTrigger self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_Update(BaseCommsTrigger self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_Update(orig_Update orig, BaseCommsTrigger self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_OnDisable(BaseCommsTrigger self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_OnDisable(orig_OnDisable orig, BaseCommsTrigger self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_OnDestroy(BaseCommsTrigger self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_OnDestroy(orig_OnDestroy orig, BaseCommsTrigger self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_TokensModified(BaseCommsTrigger self, string token); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_TokensModified(orig_TokensModified orig, BaseCommsTrigger self, string token); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool orig_ContainsToken(BaseCommsTrigger self, string token); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool hook_ContainsToken(orig_ContainsToken orig, BaseCommsTrigger self, string token); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool orig_AddToken(BaseCommsTrigger self, string token); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool hook_AddToken(orig_AddToken orig, BaseCommsTrigger self, string token); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool orig_RemoveToken(BaseCommsTrigger self, string token); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool hook_RemoveToken(orig_RemoveToken orig, BaseCommsTrigger self, string token); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_ColliderTriggerChanged(BaseCommsTrigger self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_ColliderTriggerChanged(orig_ColliderTriggerChanged orig, BaseCommsTrigger self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_OnTriggerEnter2D(BaseCommsTrigger self, Collider2D other); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_OnTriggerEnter2D(orig_OnTriggerEnter2D orig, BaseCommsTrigger self, Collider2D other); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_OnTriggerExit2D(BaseCommsTrigger self, Collider2D other); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_OnTriggerExit2D(orig_OnTriggerExit2D orig, BaseCommsTrigger self, Collider2D other); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_OnTriggerEnter(BaseCommsTrigger self, Collider other); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_OnTriggerEnter(orig_OnTriggerEnter orig, BaseCommsTrigger self, Collider other); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_OnTriggerExit(BaseCommsTrigger self, Collider other); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_OnTriggerExit(orig_OnTriggerExit orig, BaseCommsTrigger self, Collider other); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool orig_ColliderTriggerFilter(BaseCommsTrigger self, Collider other); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool hook_ColliderTriggerFilter(orig_ColliderTriggerFilter orig, BaseCommsTrigger self, Collider other); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool orig_ColliderTriggerFilter2D(BaseCommsTrigger self, Collider2D other); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool hook_ColliderTriggerFilter2D(orig_ColliderTriggerFilter2D orig, BaseCommsTrigger self, Collider2D other); [EditorBrowsable(EditorBrowsableState.Never)] public delegate DissonanceComms orig_FindLocalVoiceComm(BaseCommsTrigger self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate DissonanceComms hook_FindLocalVoiceComm(orig_FindLocalVoiceComm orig, BaseCommsTrigger self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool orig_CheckVoiceComm(BaseCommsTrigger self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool hook_CheckVoiceComm(orig_CheckVoiceComm orig, BaseCommsTrigger self); public static event hook_ctor ctor { add { HookEndpointManager.Add<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_Awake Awake { add { HookEndpointManager.Add<hook_Awake>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_Awake>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_Start Start { add { HookEndpointManager.Add<hook_Start>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_Start>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_OnEnable OnEnable { add { HookEndpointManager.Add<hook_OnEnable>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_OnEnable>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_Update Update { add { HookEndpointManager.Add<hook_Update>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_Update>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_OnDisable OnDisable { add { HookEndpointManager.Add<hook_OnDisable>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_OnDisable>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_OnDestroy OnDestroy { add { HookEndpointManager.Add<hook_OnDestroy>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_OnDestroy>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_TokensModified TokensModified { add { HookEndpointManager.Add<hook_TokensModified>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_TokensModified>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_ContainsToken ContainsToken { add { HookEndpointManager.Add<hook_ContainsToken>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_ContainsToken>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_AddToken AddToken { add { HookEndpointManager.Add<hook_AddToken>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_AddToken>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_RemoveToken RemoveToken { add { HookEndpointManager.Add<hook_RemoveToken>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_RemoveToken>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_ColliderTriggerChanged ColliderTriggerChanged { add { HookEndpointManager.Add<hook_ColliderTriggerChanged>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_ColliderTriggerChanged>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_OnTriggerEnter2D OnTriggerEnter2D { add { HookEndpointManager.Add<hook_OnTriggerEnter2D>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_OnTriggerEnter2D>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_OnTriggerExit2D OnTriggerExit2D { add { HookEndpointManager.Add<hook_OnTriggerExit2D>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_OnTriggerExit2D>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_OnTriggerEnter OnTriggerEnter { add { HookEndpointManager.Add<hook_OnTriggerEnter>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_OnTriggerEnter>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_OnTriggerExit OnTriggerExit { add { HookEndpointManager.Add<hook_OnTriggerExit>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_OnTriggerExit>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_ColliderTriggerFilter ColliderTriggerFilter { add { HookEndpointManager.Add<hook_ColliderTriggerFilter>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_ColliderTriggerFilter>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_ColliderTriggerFilter2D ColliderTriggerFilter2D { add { HookEndpointManager.Add<hook_ColliderTriggerFilter2D>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_ColliderTriggerFilter2D>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_FindLocalVoiceComm FindLocalVoiceComm { add { HookEndpointManager.Add<hook_FindLocalVoiceComm>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_FindLocalVoiceComm>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_CheckVoiceComm CheckVoiceComm { add { HookEndpointManager.Add<hook_CheckVoiceComm>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_CheckVoiceComm>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } } } namespace IL.Dissonance { public static class BaseCommsTrigger { public static event Manipulator ctor { add { HookEndpointManager.Modify<On.Dissonance.BaseCommsTrigger.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Dissonance.BaseCommsTrigger.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator Awake { add { HookEndpointManager.Modify<On.Dissonance.BaseCommsTrigger.hook_Awake>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Dissonance.BaseCommsTrigger.hook_Awake>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator Start { add { HookEndpointManager.Modify<On.Dissonance.BaseCommsTrigger.hook_Start>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Dissonance.BaseCommsTrigger.hook_Start>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator OnEnable { add { HookEndpointManager.Modify<On.Dissonance.BaseCommsTrigger.hook_OnEnable>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Dissonance.BaseCommsTrigger.hook_OnEnable>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator Update { add { HookEndpointManager.Modify<On.Dissonance.BaseCommsTrigger.hook_Update>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Dissonance.BaseCommsTrigger.hook_Update>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator OnDisable { add { HookEndpointManager.Modify<On.Dissonance.BaseCommsTrigger.hook_OnDisable>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Dissonance.BaseCommsTrigger.hook_OnDisable>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator OnDestroy { add { HookEndpointManager.Modify<On.Dissonance.BaseCommsTrigger.hook_OnDestroy>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Dissonance.BaseCommsTrigger.hook_OnDestroy>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator TokensModified { add { HookEndpointManager.Modify<On.Dissonance.BaseCommsTrigger.hook_TokensModified>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Dissonance.BaseCommsTrigger.hook_TokensModified>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator ContainsToken { add { HookEndpointManager.Modify<On.Dissonance.BaseCommsTrigger.hook_ContainsToken>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Dissonance.BaseCommsTrigger.hook_ContainsToken>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator AddToken { add { HookEndpointManager.Modify<On.Dissonance.BaseCommsTrigger.hook_AddToken>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Dissonance.BaseCommsTrigger.hook_AddToken>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator RemoveToken { add { HookEndpointManager.Modify<On.Dissonance.BaseCommsTrigger.hook_RemoveToken>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Dissonance.BaseCommsTrigger.hook_RemoveToken>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator ColliderTriggerChanged { add { HookEndpointManager.Modify<On.Dissonance.BaseCommsTrigger.hook_ColliderTriggerChanged>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Dissonance.BaseCommsTrigger.hook_ColliderTriggerChanged>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator OnTriggerEnter2D { add { HookEndpointManager.Modify<On.Dissonance.BaseCommsTrigger.hook_OnTriggerEnter2D>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Dissonance.BaseCommsTrigger.hook_OnTriggerEnter2D>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator OnTriggerExit2D { add { HookEndpointManager.Modify<On.Dissonance.BaseCommsTrigger.hook_OnTriggerExit2D>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Dissonance.BaseCommsTrigger.hook_OnTriggerExit2D>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator OnTriggerEnter { add { HookEndpointManager.Modify<On.Dissonance.BaseCommsTrigger.hook_OnTriggerEnter>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Dissonance.BaseCommsTrigger.hook_OnTriggerEnter>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator OnTriggerExit { add { HookEndpointManager.Modify<On.Dissonance.BaseCommsTrigger.hook_OnTriggerExit>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Dissonance.BaseCommsTrigger.hook_OnTriggerExit>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator ColliderTriggerFilter { add { HookEndpointManager.Modify<On.Dissonance.BaseCommsTrigger.hook_ColliderTriggerFilter>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Dissonance.BaseCommsTrigger.hook_ColliderTriggerFilter>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator ColliderTriggerFilter2D { add { HookEndpointManager.Modify<On.Dissonance.BaseCommsTrigger.hook_ColliderTriggerFilter2D>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Dissonance.BaseCommsTrigger.hook_ColliderTriggerFilter2D>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator FindLocalVoiceComm { add { HookEndpointManager.Modify<On.Dissonance.BaseCommsTrigger.hook_FindLocalVoiceComm>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Dissonance.BaseCommsTrigger.hook_FindLocalVoiceComm>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator CheckVoiceComm { add { HookEndpointManager.Modify<On.Dissonance.BaseCommsTrigger.hook_CheckVoiceComm>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Dissonance.BaseCommsTrigger.hook_CheckVoiceComm>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } } } namespace On.Dissonance { public static class ChannelProperties { [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_ctor(ChannelProperties self, object defaultPriority); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_ctor(orig_ctor orig, ChannelProperties self, object defaultPriority); public static event hook_ctor ctor { add { HookEndpointManager.Add<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } } } namespace IL.Dissonance { public static class ChannelProperties { public static event Manipulator ctor { add { HookEndpointManager.Modify<On.Dissonance.ChannelProperties.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Dissonance.ChannelProperties.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } } } namespace On.Dissonance { public static class PlayerChannel { [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_ctor(ref PlayerChannel self, ushort subscriptionId, string playerId, PlayerChannels channels, ChannelProperties properties); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_ctor(orig_ctor orig, ref PlayerChannel self, ushort subscriptionId, string playerId, PlayerChannels channels, ChannelProperties properties); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_Dispose(ref PlayerChannel self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_Dispose(orig_Dispose orig, ref PlayerChannel self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_CheckValidProperties(ref PlayerChannel self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_CheckValidProperties(orig_CheckValidProperties orig, ref PlayerChannel self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool orig_Equals_PlayerChannel(ref PlayerChannel self, PlayerChannel other); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool hook_Equals_PlayerChannel(orig_Equals_PlayerChannel orig, ref PlayerChannel self, PlayerChannel other); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool orig_Equals_object(ref PlayerChannel self, object obj); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool hook_Equals_object(orig_Equals_object orig, ref PlayerChannel self, object obj); [EditorBrowsable(EditorBrowsableState.Never)] public delegate int orig_GetHashCode(ref PlayerChannel self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate int hook_GetHashCode(orig_GetHashCode orig, ref PlayerChannel self); public static event hook_ctor ctor { add { HookEndpointManager.Add<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_Dispose Dispose { add { HookEndpointManager.Add<hook_Dispose>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_Dispose>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_CheckValidProperties CheckValidProperties { add { HookEndpointManager.Add<hook_CheckValidProperties>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_CheckValidProperties>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_Equals_PlayerChannel Equals_PlayerChannel { add { HookEndpointManager.Add<hook_Equals_PlayerChannel>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_Equals_PlayerChannel>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_Equals_object Equals_object { add { HookEndpointManager.Add<hook_Equals_object>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_Equals_object>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public new static event hook_GetHashCode GetHashCode { add { HookEndpointManager.Add<hook_GetHashCode>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_GetHashCode>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } } } namespace IL.Dissonance { public static class PlayerChannel { public static event Manipulator ctor { add { HookEndpointManager.Modify<On.Dissonance.PlayerChannel.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Dissonance.PlayerChannel.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator Dispose { add { HookEndpointManager.Modify<On.Dissonance.PlayerChannel.hook_Dispose>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Dissonance.PlayerChannel.hook_Dispose>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator CheckValidProperties { add { HookEndpointManager.Modify<On.Dissonance.PlayerChannel.hook_CheckValidProperties>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Dissonance.PlayerChannel.hook_CheckValidProperties>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator Equals_PlayerChannel { add { HookEndpointManager.Modify<On.Dissonance.PlayerChannel.hook_Equals_PlayerChannel>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Dissonance.PlayerChannel.hook_Equals_PlayerChannel>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator Equals_object { add { HookEndpointManager.Modify<On.Dissonance.PlayerChannel.hook_Equals_object>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Dissonance.PlayerChannel.hook_Equals_object>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public new static event Manipulator GetHashCode { add { HookEndpointManager.Modify<On.Dissonance.PlayerChannel.hook_GetHashCode>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Dissonance.PlayerChannel.hook_GetHashCode>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } } } namespace On.Dissonance { public static class PlayerChannels { [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_ctor(PlayerChannels self, object priorityProvider); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_ctor(orig_ctor orig, PlayerChannels self, object priorityProvider); [EditorBrowsable(EditorBrowsableState.Never)] public delegate PlayerChannel orig_CreateChannel(PlayerChannels self, ushort subscriptionId, string channelId, ChannelProperties properties); [EditorBrowsable(EditorBrowsableState.Never)] public delegate PlayerChannel hook_CreateChannel(orig_CreateChannel orig, PlayerChannels self, ushort subscriptionId, string channelId, ChannelProperties properties); public static event hook_ctor ctor { add { HookEndpointManager.Add<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_CreateChannel CreateChannel { add { HookEndpointManager.Add<hook_CreateChannel>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_CreateChannel>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } } } namespace IL.Dissonance { public static class PlayerChannels { public static event Manipulator ctor { add { HookEndpointManager.Modify<On.Dissonance.PlayerChannels.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Dissonance.PlayerChannels.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator CreateChannel { add { HookEndpointManager.Modify<On.Dissonance.PlayerChannels.hook_CreateChannel>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Dissonance.PlayerChannels.hook_CreateChannel>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } } } namespace On.Dissonance { public static class RemoteChannel { [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_ctor(ref RemoteChannel self, string targetName, ChannelType type, PlaybackOptions options); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_ctor(orig_ctor orig, ref RemoteChannel self, string targetName, ChannelType type, PlaybackOptions options); public static event hook_ctor ctor { add { HookEndpointManager.Add<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } } } namespace IL.Dissonance { public static class RemoteChannel { public static event Manipulator ctor { add { HookEndpointManager.Modify<On.Dissonance.RemoteChannel.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Dissonance.RemoteChannel.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } } } namespace On.Dissonance { public static class RoomChannel { [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_ctor(ref RoomChannel self, ushort subscriptionId, string roomId, RoomChannels channels, ChannelProperties properties); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_ctor(orig_ctor orig, ref RoomChannel self, ushort subscriptionId, string roomId, RoomChannels channels, ChannelProperties properties); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_Dispose(ref RoomChannel self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_Dispose(orig_Dispose orig, ref RoomChannel self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_CheckValidProperties(ref RoomChannel self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_CheckValidProperties(orig_CheckValidProperties orig, ref RoomChannel self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool orig_Equals_RoomChannel(ref RoomChannel self, RoomChannel other); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool hook_Equals_RoomChannel(orig_Equals_RoomChannel orig, ref RoomChannel self, RoomChannel other); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool orig_Equals_object(ref RoomChannel self, object obj); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool hook_Equals_object(orig_Equals_object orig, ref RoomChannel self, object obj); [EditorBrowsable(EditorBrowsableState.Never)] public delegate int orig_GetHashCode(ref RoomChannel self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate int hook_GetHashCode(orig_GetHashCode orig, ref RoomChannel self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_cctor(); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_cctor(orig_cctor orig); public static event hook_ctor ctor { add { HookEndpointManager.Add<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_Dispose Dispose { add { HookEndpointManager.Add<hook_Dispose>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_Dispose>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_CheckValidProperties CheckValidProperties { add { HookEndpointManager.Add<hook_CheckValidProperties>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_CheckValidProperties>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_Equals_RoomChannel Equals_RoomChannel { add { HookEndpointManager.Add<hook_Equals_RoomChannel>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_Equals_RoomChannel>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_Equals_object Equals_object { add { HookEndpointManager.Add<hook_Equals_object>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_Equals_object>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public new static event hook_GetHashCode GetHashCode { add { HookEndpointManager.Add<hook_GetHashCode>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_GetHashCode>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_cctor cctor { add { HookEndpointManager.Add<hook_cctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_cctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } } } namespace IL.Dissonance { public static class RoomChannel { public static event Manipulator ctor { add { HookEndpointManager.Modify<On.Dissonance.RoomChannel.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Dissonance.RoomChannel.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator Dispose { add { HookEndpointManager.Modify<On.Dissonance.RoomChannel.hook_Dispose>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Dissonance.RoomChannel.hook_Dispose>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator CheckValidProperties { add { HookEndpointManager.Modify<On.Dissonance.RoomChannel.hook_CheckValidProperties>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Dissonance.RoomChannel.hook_CheckValidProperties>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator Equals_RoomChannel { add { HookEndpointManager.Modify<On.Dissonance.RoomChannel.hook_Equals_RoomChannel>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Dissonance.RoomChannel.hook_Equals_RoomChannel>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator Equals_object { add { HookEndpointManager.Modify<On.Dissonance.RoomChannel.hook_Equals_object>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Dissonance.RoomChannel.hook_Equals_object>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public new static event Manipulator GetHashCode { add { HookEndpointManager.Modify<On.Dissonance.RoomChannel.hook_GetHashCode>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Dissonance.RoomChannel.hook_GetHashCode>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator cctor { add { HookEndpointManager.Modify<On.Dissonance.RoomChannel.hook_cctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Dissonance.RoomChannel.hook_cctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } } } namespace On.Dissonance { public static class RoomChannels { [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_ctor(RoomChannels self, object priorityProvider); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_ctor(orig_ctor orig, RoomChannels self, object priorityProvider); [EditorBrowsable(EditorBrowsableState.Never)] public delegate RoomChannel orig_CreateChannel(RoomChannels self, ushort subscriptionId, string channelId, ChannelProperties properties); [EditorBrowsable(EditorBrowsableState.Never)] public delegate RoomChannel hook_CreateChannel(orig_CreateChannel orig, RoomChannels self, ushort subscriptionId, string channelId, ChannelProperties properties); public static event hook_ctor ctor { add { HookEndpointManager.Add<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_CreateChannel CreateChannel { add { HookEndpointManager.Add<hook_CreateChannel>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_CreateChannel>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } } } namespace IL.Dissonance { public static class RoomChannels { public static event Manipulator ctor { add { HookEndpointManager.Modify<On.Dissonance.RoomChannels.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Dissonance.RoomChannels.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator CreateChannel { add { HookEndpointManager.Modify<On.Dissonance.RoomChannels.hook_CreateChannel>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Dissonance.RoomChannels.hook_CreateChannel>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } } } namespace On.Dissonance { public static class CodecSettings { [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_ctor(ref CodecSettings self, Codec codec, uint frameSize, int sampleRate); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_ctor(orig_ctor orig, ref CodecSettings self, Codec codec, uint frameSize, int sampleRate); [EditorBrowsable(EditorBrowsableState.Never)] public delegate string orig_ToString(ref CodecSettings self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate string hook_ToString(orig_ToString orig, ref CodecSettings self); public static event hook_ctor ctor { add { HookEndpointManager.Add<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public new static event hook_ToString ToString { add { HookEndpointManager.Add<hook_ToString>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_ToString>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)
BepInEx/plugins/MMHOOK/MMHOOK_Facepunch Transport for Netcode for GameObjects.dll
Decompiled 11 months agousing System; using System.Collections; using System.ComponentModel; using System.Reflection; using MonoMod.Cil; using MonoMod.RuntimeDetour.HookGen; using Netcode.Transports.Facepunch; using On; using On.Netcode.Transports.Facepunch; using On.__GEN; using Steamworks.Data; using Unity.Netcode; [assembly: AssemblyVersion("0.0.0.0")] namespace On { public static class UnitySourceGeneratedAssemblyMonoScriptTypes_v1 { [EditorBrowsable(EditorBrowsableState.Never)] public delegate ValueType orig_Get(); [EditorBrowsable(EditorBrowsableState.Never)] public delegate ValueType hook_Get(orig_Get orig); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_ctor(object self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_ctor(orig_ctor orig, object self); public static event hook_Get Get { add { HookEndpointManager.Add<hook_Get>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_Get>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_ctor ctor { add { HookEndpointManager.Add<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } } } namespace IL { public static class UnitySourceGeneratedAssemblyMonoScriptTypes_v1 { public static event Manipulator Get { add { HookEndpointManager.Modify<On.UnitySourceGeneratedAssemblyMonoScriptTypes_v1.hook_Get>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.UnitySourceGeneratedAssemblyMonoScriptTypes_v1.hook_Get>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator ctor { add { HookEndpointManager.Modify<On.UnitySourceGeneratedAssemblyMonoScriptTypes_v1.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.UnitySourceGeneratedAssemblyMonoScriptTypes_v1.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } } } namespace On.Netcode.Transports.Facepunch { public static class FacepunchTransport { [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_Awake(FacepunchTransport self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_Awake(orig_Awake orig, FacepunchTransport self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_Update(FacepunchTransport self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_Update(orig_Update orig, FacepunchTransport self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_OnDestroy(FacepunchTransport self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_OnDestroy(orig_OnDestroy orig, FacepunchTransport self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_DisconnectLocalClient(FacepunchTransport self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_DisconnectLocalClient(orig_DisconnectLocalClient orig, FacepunchTransport self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_DisconnectRemoteClient(FacepunchTransport self, ulong clientId); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_DisconnectRemoteClient(orig_DisconnectRemoteClient orig, FacepunchTransport self, ulong clientId); [EditorBrowsable(EditorBrowsableState.Never)] public delegate ulong orig_GetCurrentRtt(FacepunchTransport self, ulong clientId); [EditorBrowsable(EditorBrowsableState.Never)] public delegate ulong hook_GetCurrentRtt(orig_GetCurrentRtt orig, FacepunchTransport self, ulong clientId); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_Initialize(FacepunchTransport self, NetworkManager networkManager); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_Initialize(orig_Initialize orig, FacepunchTransport self, NetworkManager networkManager); [EditorBrowsable(EditorBrowsableState.Never)] public delegate SendType orig_NetworkDeliveryToSendType(FacepunchTransport self, NetworkDelivery delivery); [EditorBrowsable(EditorBrowsableState.Never)] public delegate SendType hook_NetworkDeliveryToSendType(orig_NetworkDeliveryToSendType orig, FacepunchTransport self, NetworkDelivery delivery); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_Shutdown(FacepunchTransport self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_Shutdown(orig_Shutdown orig, FacepunchTransport self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_Send(FacepunchTransport self, ulong clientId, ArraySegment<byte> data, NetworkDelivery delivery); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_Send(orig_Send orig, FacepunchTransport self, ulong clientId, ArraySegment<byte> data, NetworkDelivery delivery); [EditorBrowsable(EditorBrowsableState.Never)] public delegate NetworkEvent orig_PollEvent(FacepunchTransport self, out ulong clientId, out ArraySegment<byte> payload, out float receiveTime); [EditorBrowsable(EditorBrowsableState.Never)] public delegate NetworkEvent hook_PollEvent(orig_PollEvent orig, FacepunchTransport self, out ulong clientId, out ArraySegment<byte> payload, out float receiveTime); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool orig_StartClient(FacepunchTransport self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool hook_StartClient(orig_StartClient orig, FacepunchTransport self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool orig_StartServer(FacepunchTransport self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool hook_StartServer(orig_StartServer orig, FacepunchTransport self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_EnsurePayloadCapacity(FacepunchTransport self, int size); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_EnsurePayloadCapacity(orig_EnsurePayloadCapacity orig, FacepunchTransport self, int size); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_Steamworks_IConnectionManager_OnConnecting(FacepunchTransport self, ConnectionInfo info); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_Steamworks_IConnectionManager_OnConnecting(orig_Steamworks_IConnectionManager_OnConnecting orig, FacepunchTransport self, ConnectionInfo info); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_Steamworks_IConnectionManager_OnConnected(FacepunchTransport self, ConnectionInfo info); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_Steamworks_IConnectionManager_OnConnected(orig_Steamworks_IConnectionManager_OnConnected orig, FacepunchTransport self, ConnectionInfo info); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_Steamworks_IConnectionManager_OnDisconnected(FacepunchTransport self, ConnectionInfo info); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_Steamworks_IConnectionManager_OnDisconnected(orig_Steamworks_IConnectionManager_OnDisconnected orig, FacepunchTransport self, ConnectionInfo info); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_Steamworks_IConnectionManager_OnMessage(FacepunchTransport self, IntPtr data, int size, long messageNum, long recvTime, int channel); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_Steamworks_IConnectionManager_OnMessage(orig_Steamworks_IConnectionManager_OnMessage orig, FacepunchTransport self, IntPtr data, int size, long messageNum, long recvTime, int channel); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_Steamworks_ISocketManager_OnConnecting(FacepunchTransport self, Connection connection, ConnectionInfo info); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_Steamworks_ISocketManager_OnConnecting(orig_Steamworks_ISocketManager_OnConnecting orig, FacepunchTransport self, Connection connection, ConnectionInfo info); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_Steamworks_ISocketManager_OnConnected(FacepunchTransport self, Connection connection, ConnectionInfo info); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_Steamworks_ISocketManager_OnConnected(orig_Steamworks_ISocketManager_OnConnected orig, FacepunchTransport self, Connection connection, ConnectionInfo info); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_Steamworks_ISocketManager_OnDisconnected(FacepunchTransport self, Connection connection, ConnectionInfo info); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_Steamworks_ISocketManager_OnDisconnected(orig_Steamworks_ISocketManager_OnDisconnected orig, FacepunchTransport self, Connection connection, ConnectionInfo info); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_Steamworks_ISocketManager_OnMessage(FacepunchTransport self, Connection connection, NetIdentity identity, IntPtr data, int size, long messageNum, long recvTime, int channel); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_Steamworks_ISocketManager_OnMessage(orig_Steamworks_ISocketManager_OnMessage orig, FacepunchTransport self, Connection connection, NetIdentity identity, IntPtr data, int size, long messageNum, long recvTime, int channel); [EditorBrowsable(EditorBrowsableState.Never)] public delegate IEnumerator orig_InitSteamworks(FacepunchTransport self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate IEnumerator hook_InitSteamworks(orig_InitSteamworks orig, FacepunchTransport self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_ctor(FacepunchTransport self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_ctor(orig_ctor orig, FacepunchTransport self); public static class Client { [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_ctor(object self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_ctor(orig_ctor orig, object self); public static event hook_ctor ctor { add { HookEndpointManager.Add<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } } public static event hook_Awake Awake { add { HookEndpointManager.Add<hook_Awake>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_Awake>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_Update Update { add { HookEndpointManager.Add<hook_Update>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_Update>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_OnDestroy OnDestroy { add { HookEndpointManager.Add<hook_OnDestroy>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_OnDestroy>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_DisconnectLocalClient DisconnectLocalClient { add { HookEndpointManager.Add<hook_DisconnectLocalClient>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_DisconnectLocalClient>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_DisconnectRemoteClient DisconnectRemoteClient { add { HookEndpointManager.Add<hook_DisconnectRemoteClient>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_DisconnectRemoteClient>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_GetCurrentRtt GetCurrentRtt { add { HookEndpointManager.Add<hook_GetCurrentRtt>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_GetCurrentRtt>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_Initialize Initialize { add { HookEndpointManager.Add<hook_Initialize>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_Initialize>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_NetworkDeliveryToSendType NetworkDeliveryToSendType { add { HookEndpointManager.Add<hook_NetworkDeliveryToSendType>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_NetworkDeliveryToSendType>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_Shutdown Shutdown { add { HookEndpointManager.Add<hook_Shutdown>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_Shutdown>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_Send Send { add { HookEndpointManager.Add<hook_Send>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_Send>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_PollEvent PollEvent { add { HookEndpointManager.Add<hook_PollEvent>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_PollEvent>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_StartClient StartClient { add { HookEndpointManager.Add<hook_StartClient>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_StartClient>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_StartServer StartServer { add { HookEndpointManager.Add<hook_StartServer>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_StartServer>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_EnsurePayloadCapacity EnsurePayloadCapacity { add { HookEndpointManager.Add<hook_EnsurePayloadCapacity>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_EnsurePayloadCapacity>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_Steamworks_IConnectionManager_OnConnecting Steamworks_IConnectionManager_OnConnecting { add { HookEndpointManager.Add<hook_Steamworks_IConnectionManager_OnConnecting>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_Steamworks_IConnectionManager_OnConnecting>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_Steamworks_IConnectionManager_OnConnected Steamworks_IConnectionManager_OnConnected { add { HookEndpointManager.Add<hook_Steamworks_IConnectionManager_OnConnected>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_Steamworks_IConnectionManager_OnConnected>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_Steamworks_IConnectionManager_OnDisconnected Steamworks_IConnectionManager_OnDisconnected { add { HookEndpointManager.Add<hook_Steamworks_IConnectionManager_OnDisconnected>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_Steamworks_IConnectionManager_OnDisconnected>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_Steamworks_IConnectionManager_OnMessage Steamworks_IConnectionManager_OnMessage { add { HookEndpointManager.Add<hook_Steamworks_IConnectionManager_OnMessage>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_Steamworks_IConnectionManager_OnMessage>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_Steamworks_ISocketManager_OnConnecting Steamworks_ISocketManager_OnConnecting { add { HookEndpointManager.Add<hook_Steamworks_ISocketManager_OnConnecting>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_Steamworks_ISocketManager_OnConnecting>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_Steamworks_ISocketManager_OnConnected Steamworks_ISocketManager_OnConnected { add { HookEndpointManager.Add<hook_Steamworks_ISocketManager_OnConnected>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_Steamworks_ISocketManager_OnConnected>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_Steamworks_ISocketManager_OnDisconnected Steamworks_ISocketManager_OnDisconnected { add { HookEndpointManager.Add<hook_Steamworks_ISocketManager_OnDisconnected>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_Steamworks_ISocketManager_OnDisconnected>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_Steamworks_ISocketManager_OnMessage Steamworks_ISocketManager_OnMessage { add { HookEndpointManager.Add<hook_Steamworks_ISocketManager_OnMessage>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_Steamworks_ISocketManager_OnMessage>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_InitSteamworks InitSteamworks { add { HookEndpointManager.Add<hook_InitSteamworks>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_InitSteamworks>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_ctor ctor { add { HookEndpointManager.Add<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } } } namespace IL.Netcode.Transports.Facepunch { public static class FacepunchTransport { public static class Client { public static event Manipulator ctor { add { HookEndpointManager.Modify<On.Netcode.Transports.Facepunch.FacepunchTransport.Client.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Netcode.Transports.Facepunch.FacepunchTransport.Client.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } } public static event Manipulator Awake { add { HookEndpointManager.Modify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_Awake>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_Awake>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator Update { add { HookEndpointManager.Modify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_Update>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_Update>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator OnDestroy { add { HookEndpointManager.Modify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_OnDestroy>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_OnDestroy>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator DisconnectLocalClient { add { HookEndpointManager.Modify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_DisconnectLocalClient>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_DisconnectLocalClient>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator DisconnectRemoteClient { add { HookEndpointManager.Modify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_DisconnectRemoteClient>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_DisconnectRemoteClient>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator GetCurrentRtt { add { HookEndpointManager.Modify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_GetCurrentRtt>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_GetCurrentRtt>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator Initialize { add { HookEndpointManager.Modify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_Initialize>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_Initialize>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator NetworkDeliveryToSendType { add { HookEndpointManager.Modify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_NetworkDeliveryToSendType>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_NetworkDeliveryToSendType>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator Shutdown { add { HookEndpointManager.Modify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_Shutdown>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_Shutdown>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator Send { add { HookEndpointManager.Modify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_Send>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_Send>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator PollEvent { add { HookEndpointManager.Modify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_PollEvent>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_PollEvent>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator StartClient { add { HookEndpointManager.Modify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_StartClient>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_StartClient>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator StartServer { add { HookEndpointManager.Modify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_StartServer>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_StartServer>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator EnsurePayloadCapacity { add { HookEndpointManager.Modify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_EnsurePayloadCapacity>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_EnsurePayloadCapacity>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator Steamworks_IConnectionManager_OnConnecting { add { HookEndpointManager.Modify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_Steamworks_IConnectionManager_OnConnecting>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_Steamworks_IConnectionManager_OnConnecting>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator Steamworks_IConnectionManager_OnConnected { add { HookEndpointManager.Modify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_Steamworks_IConnectionManager_OnConnected>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_Steamworks_IConnectionManager_OnConnected>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator Steamworks_IConnectionManager_OnDisconnected { add { HookEndpointManager.Modify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_Steamworks_IConnectionManager_OnDisconnected>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_Steamworks_IConnectionManager_OnDisconnected>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator Steamworks_IConnectionManager_OnMessage { add { HookEndpointManager.Modify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_Steamworks_IConnectionManager_OnMessage>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_Steamworks_IConnectionManager_OnMessage>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator Steamworks_ISocketManager_OnConnecting { add { HookEndpointManager.Modify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_Steamworks_ISocketManager_OnConnecting>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_Steamworks_ISocketManager_OnConnecting>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator Steamworks_ISocketManager_OnConnected { add { HookEndpointManager.Modify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_Steamworks_ISocketManager_OnConnected>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_Steamworks_ISocketManager_OnConnected>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator Steamworks_ISocketManager_OnDisconnected { add { HookEndpointManager.Modify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_Steamworks_ISocketManager_OnDisconnected>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_Steamworks_ISocketManager_OnDisconnected>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator Steamworks_ISocketManager_OnMessage { add { HookEndpointManager.Modify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_Steamworks_ISocketManager_OnMessage>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_Steamworks_ISocketManager_OnMessage>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator InitSteamworks { add { HookEndpointManager.Modify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_InitSteamworks>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_InitSteamworks>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator ctor { add { HookEndpointManager.Modify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } } } namespace On.Netcode.Transports.Facepunch { public static class ReadOnlyAttribute { [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_ctor(ReadOnlyAttribute self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_ctor(orig_ctor orig, ReadOnlyAttribute self); public static event hook_ctor ctor { add { HookEndpointManager.Add<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } } } namespace IL.Netcode.Transports.Facepunch { public static class ReadOnlyAttribute { public static event Manipulator ctor { add { HookEndpointManager.Modify<On.Netcode.Transports.Facepunch.ReadOnlyAttribute.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Netcode.Transports.Facepunch.ReadOnlyAttribute.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } } } namespace On.__GEN { public static class NetworkVariableSerializationHelper { [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_InitializeSerialization(); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_InitializeSerialization(orig_InitializeSerialization orig); public static event hook_InitializeSerialization InitializeSerialization { add { HookEndpointManager.Add<hook_InitializeSerialization>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_InitializeSerialization>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } } } namespace IL.__GEN { public static class NetworkVariableSerializationHelper { public static event Manipulator InitializeSerialization { add { HookEndpointManager.Modify<On.__GEN.NetworkVariableSerializationHelper.hook_InitializeSerialization>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.__GEN.NetworkVariableSerializationHelper.hook_InitializeSerialization>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } } } namespace BepHookGen { public class size14336 { } }
BepInEx/plugins/MMHOOK/MMHOOK_Facepunch.Steamworks.Win64.dll
Decompiled 11 months ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections.Generic; using System.ComponentModel; using System.IO; using System.Net; using System.Net.Sockets; using System.Reflection; using System.Runtime.InteropServices; using System.Threading; using System.Threading.Tasks; using MonoMod.Cil; using MonoMod.RuntimeDetour.HookGen; using On.Microsoft.CodeAnalysis; using On.Steamworks; using On.Steamworks.Data; using On.Steamworks.ServerList; using On.Steamworks.Ugc; using On.System.Runtime.CompilerServices; using Steamworks; using Steamworks.Data; using Steamworks.ServerList; using Steamworks.Ugc; [assembly: AssemblyVersion("0.0.0.0")] namespace On.Microsoft.CodeAnalysis { public static class EmbeddedAttribute { [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_ctor(Attribute self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_ctor(orig_ctor orig, Attribute self); public static event hook_ctor ctor { add { HookEndpointManager.Add<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } } } namespace IL.Microsoft.CodeAnalysis { public static class EmbeddedAttribute { public static event Manipulator ctor { add { HookEndpointManager.Modify<On.Microsoft.CodeAnalysis.EmbeddedAttribute.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Microsoft.CodeAnalysis.EmbeddedAttribute.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } } } namespace On.System.Runtime.CompilerServices { public static class IsReadOnlyAttribute { [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_ctor(Attribute self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_ctor(orig_ctor orig, Attribute self); public static event hook_ctor ctor { add { HookEndpointManager.Add<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } } } namespace IL.System.Runtime.CompilerServices { public static class IsReadOnlyAttribute { public static event Manipulator ctor { add { HookEndpointManager.Modify<On.System.Runtime.CompilerServices.IsReadOnlyAttribute.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.System.Runtime.CompilerServices.IsReadOnlyAttribute.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } } } namespace On.Steamworks { public static class AuthTicket { [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_Cancel(AuthTicket self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_Cancel(orig_Cancel orig, AuthTicket self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_Dispose(AuthTicket self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_Dispose(orig_Dispose orig, AuthTicket self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_ctor(AuthTicket self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_ctor(orig_ctor orig, AuthTicket self); public static event hook_Cancel Cancel { add { HookEndpointManager.Add<hook_Cancel>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_Cancel>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_Dispose Dispose { add { HookEndpointManager.Add<hook_Dispose>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_Dispose>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_ctor ctor { add { HookEndpointManager.Add<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } } } namespace IL.Steamworks { public static class AuthTicket { public static event Manipulator Cancel { add { HookEndpointManager.Modify<On.Steamworks.AuthTicket.hook_Cancel>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Steamworks.AuthTicket.hook_Cancel>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator Dispose { add { HookEndpointManager.Modify<On.Steamworks.AuthTicket.hook_Dispose>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Steamworks.AuthTicket.hook_Dispose>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator ctor { add { HookEndpointManager.Modify<On.Steamworks.AuthTicket.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Steamworks.AuthTicket.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } } } namespace On.Steamworks { public static class Dispatch { [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_SteamAPI_ManualDispatch_Init(); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_SteamAPI_ManualDispatch_Init(orig_SteamAPI_ManualDispatch_Init orig); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_SteamAPI_ManualDispatch_RunFrame(ValueType pipe); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_SteamAPI_ManualDispatch_RunFrame(orig_SteamAPI_ManualDispatch_RunFrame orig, ValueType pipe); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool orig_SteamAPI_ManualDispatch_GetNextCallback(ValueType pipe, [In][Out] ValueType msg); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool hook_SteamAPI_ManualDispatch_GetNextCallback(orig_SteamAPI_ManualDispatch_GetNextCallback orig, ValueType pipe, [In][Out] ValueType msg); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool orig_SteamAPI_ManualDispatch_FreeLastCallback(ValueType pipe); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool hook_SteamAPI_ManualDispatch_FreeLastCallback(orig_SteamAPI_ManualDispatch_FreeLastCallback orig, ValueType pipe); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_Init(); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_Init(orig_Init orig); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_Frame(ValueType pipe); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_Frame(orig_Frame orig, ValueType pipe); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_ProcessCallback(ValueType msg, bool isServer); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_ProcessCallback(orig_ProcessCallback orig, ValueType msg, bool isServer); [EditorBrowsable(EditorBrowsableState.Never)] public delegate string orig_CallbackToString(CallbackType type, IntPtr data, int expectedsize); [EditorBrowsable(EditorBrowsableState.Never)] public delegate string hook_CallbackToString(orig_CallbackToString orig, CallbackType type, IntPtr data, int expectedsize); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_ProcessResult(ValueType msg); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_ProcessResult(orig_ProcessResult orig, ValueType msg); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_LoopClientAsync(); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_LoopClientAsync(orig_LoopClientAsync orig); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_LoopServerAsync(); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_LoopServerAsync(orig_LoopServerAsync orig); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_ShutdownServer(); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_ShutdownServer(orig_ShutdownServer orig); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_ShutdownClient(); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_ShutdownClient(orig_ShutdownClient orig); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_cctor(); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_cctor(orig_cctor orig); public static event hook_SteamAPI_ManualDispatch_Init SteamAPI_ManualDispatch_Init { add { HookEndpointManager.Add<hook_SteamAPI_ManualDispatch_Init>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_SteamAPI_ManualDispatch_Init>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_SteamAPI_ManualDispatch_RunFrame SteamAPI_ManualDispatch_RunFrame { add { HookEndpointManager.Add<hook_SteamAPI_ManualDispatch_RunFrame>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_SteamAPI_ManualDispatch_RunFrame>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_SteamAPI_ManualDispatch_GetNextCallback SteamAPI_ManualDispatch_GetNextCallback { add { HookEndpointManager.Add<hook_SteamAPI_ManualDispatch_GetNextCallback>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_SteamAPI_ManualDispatch_GetNextCallback>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_SteamAPI_ManualDispatch_FreeLastCallback SteamAPI_ManualDispatch_FreeLastCallback { add { HookEndpointManager.Add<hook_SteamAPI_ManualDispatch_FreeLastCallback>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_SteamAPI_ManualDispatch_FreeLastCallback>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_Init Init { add { HookEndpointManager.Add<hook_Init>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_Init>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_Frame Frame { add { HookEndpointManager.Add<hook_Frame>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_Frame>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_ProcessCallback ProcessCallback { add { HookEndpointManager.Add<hook_ProcessCallback>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_ProcessCallback>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_CallbackToString CallbackToString { add { HookEndpointManager.Add<hook_CallbackToString>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_CallbackToString>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_ProcessResult ProcessResult { add { HookEndpointManager.Add<hook_ProcessResult>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_ProcessResult>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_LoopClientAsync LoopClientAsync { add { HookEndpointManager.Add<hook_LoopClientAsync>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_LoopClientAsync>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_LoopServerAsync LoopServerAsync { add { HookEndpointManager.Add<hook_LoopServerAsync>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_LoopServerAsync>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_ShutdownServer ShutdownServer { add { HookEndpointManager.Add<hook_ShutdownServer>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_ShutdownServer>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_ShutdownClient ShutdownClient { add { HookEndpointManager.Add<hook_ShutdownClient>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_ShutdownClient>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_cctor cctor { add { HookEndpointManager.Add<hook_cctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_cctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } } } namespace IL.Steamworks { public static class Dispatch { public static event Manipulator SteamAPI_ManualDispatch_Init { add { HookEndpointManager.Modify<On.Steamworks.Dispatch.hook_SteamAPI_ManualDispatch_Init>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Steamworks.Dispatch.hook_SteamAPI_ManualDispatch_Init>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator SteamAPI_ManualDispatch_RunFrame { add { HookEndpointManager.Modify<On.Steamworks.Dispatch.hook_SteamAPI_ManualDispatch_RunFrame>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Steamworks.Dispatch.hook_SteamAPI_ManualDispatch_RunFrame>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator SteamAPI_ManualDispatch_GetNextCallback { add { HookEndpointManager.Modify<On.Steamworks.Dispatch.hook_SteamAPI_ManualDispatch_GetNextCallback>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Steamworks.Dispatch.hook_SteamAPI_ManualDispatch_GetNextCallback>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator SteamAPI_ManualDispatch_FreeLastCallback { add { HookEndpointManager.Modify<On.Steamworks.Dispatch.hook_SteamAPI_ManualDispatch_FreeLastCallback>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Steamworks.Dispatch.hook_SteamAPI_ManualDispatch_FreeLastCallback>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator Init { add { HookEndpointManager.Modify<On.Steamworks.Dispatch.hook_Init>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Steamworks.Dispatch.hook_Init>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator Frame { add { HookEndpointManager.Modify<On.Steamworks.Dispatch.hook_Frame>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Steamworks.Dispatch.hook_Frame>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator ProcessCallback { add { HookEndpointManager.Modify<On.Steamworks.Dispatch.hook_ProcessCallback>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Steamworks.Dispatch.hook_ProcessCallback>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator CallbackToString { add { HookEndpointManager.Modify<On.Steamworks.Dispatch.hook_CallbackToString>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Steamworks.Dispatch.hook_CallbackToString>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator ProcessResult { add { HookEndpointManager.Modify<On.Steamworks.Dispatch.hook_ProcessResult>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Steamworks.Dispatch.hook_ProcessResult>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator LoopClientAsync { add { HookEndpointManager.Modify<On.Steamworks.Dispatch.hook_LoopClientAsync>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Steamworks.Dispatch.hook_LoopClientAsync>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator LoopServerAsync { add { HookEndpointManager.Modify<On.Steamworks.Dispatch.hook_LoopServerAsync>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Steamworks.Dispatch.hook_LoopServerAsync>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator ShutdownServer { add { HookEndpointManager.Modify<On.Steamworks.Dispatch.hook_ShutdownServer>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Steamworks.Dispatch.hook_ShutdownServer>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator ShutdownClient { add { HookEndpointManager.Modify<On.Steamworks.Dispatch.hook_ShutdownClient>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Steamworks.Dispatch.hook_ShutdownClient>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator cctor { add { HookEndpointManager.Modify<On.Steamworks.Dispatch.hook_cctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Steamworks.Dispatch.hook_cctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } } } namespace On.Steamworks { public static class SteamAPI { [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool orig_Init(); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool hook_Init(orig_Init orig); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_Shutdown(); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_Shutdown(orig_Shutdown orig); [EditorBrowsable(EditorBrowsableState.Never)] public delegate ValueType orig_GetHSteamPipe(); [EditorBrowsable(EditorBrowsableState.Never)] public delegate ValueType hook_GetHSteamPipe(orig_GetHSteamPipe orig); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool orig_RestartAppIfNecessary(uint unOwnAppID); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool hook_RestartAppIfNecessary(orig_RestartAppIfNecessary orig, uint unOwnAppID); public static class Native { [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool orig_SteamAPI_Init(); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool hook_SteamAPI_Init(orig_SteamAPI_Init orig); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_SteamAPI_Shutdown(); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_SteamAPI_Shutdown(orig_SteamAPI_Shutdown orig); [EditorBrowsable(EditorBrowsableState.Never)] public delegate ValueType orig_SteamAPI_GetHSteamPipe(); [EditorBrowsable(EditorBrowsableState.Never)] public delegate ValueType hook_SteamAPI_GetHSteamPipe(orig_SteamAPI_GetHSteamPipe orig); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool orig_SteamAPI_RestartAppIfNecessary(uint unOwnAppID); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool hook_SteamAPI_RestartAppIfNecessary(orig_SteamAPI_RestartAppIfNecessary orig, uint unOwnAppID); public static event hook_SteamAPI_Init SteamAPI_Init { add { HookEndpointManager.Add<hook_SteamAPI_Init>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_SteamAPI_Init>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_SteamAPI_Shutdown SteamAPI_Shutdown { add { HookEndpointManager.Add<hook_SteamAPI_Shutdown>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_SteamAPI_Shutdown>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_SteamAPI_GetHSteamPipe SteamAPI_GetHSteamPipe { add { HookEndpointManager.Add<hook_SteamAPI_GetHSteamPipe>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_SteamAPI_GetHSteamPipe>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_SteamAPI_RestartAppIfNecessary SteamAPI_RestartAppIfNecessary { add { HookEndpointManager.Add<hook_SteamAPI_RestartAppIfNecessary>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_SteamAPI_RestartAppIfNecessary>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } } public static event hook_Init Init { add { HookEndpointManager.Add<hook_Init>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_Init>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_Shutdown Shutdown { add { HookEndpointManager.Add<hook_Shutdown>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_Shutdown>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_GetHSteamPipe GetHSteamPipe { add { HookEndpointManager.Add<hook_GetHSteamPipe>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_GetHSteamPipe>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_RestartAppIfNecessary RestartAppIfNecessary { add { HookEndpointManager.Add<hook_RestartAppIfNecessary>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_RestartAppIfNecessary>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } } } namespace IL.Steamworks { public static class SteamAPI { public static class Native { public static event Manipulator SteamAPI_Init { add { HookEndpointManager.Modify<On.Steamworks.SteamAPI.Native.hook_SteamAPI_Init>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Steamworks.SteamAPI.Native.hook_SteamAPI_Init>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator SteamAPI_Shutdown { add { HookEndpointManager.Modify<On.Steamworks.SteamAPI.Native.hook_SteamAPI_Shutdown>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Steamworks.SteamAPI.Native.hook_SteamAPI_Shutdown>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator SteamAPI_GetHSteamPipe { add { HookEndpointManager.Modify<On.Steamworks.SteamAPI.Native.hook_SteamAPI_GetHSteamPipe>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Steamworks.SteamAPI.Native.hook_SteamAPI_GetHSteamPipe>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator SteamAPI_RestartAppIfNecessary { add { HookEndpointManager.Modify<On.Steamworks.SteamAPI.Native.hook_SteamAPI_RestartAppIfNecessary>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Steamworks.SteamAPI.Native.hook_SteamAPI_RestartAppIfNecessary>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } } public static event Manipulator Init { add { HookEndpointManager.Modify<On.Steamworks.SteamAPI.hook_Init>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Steamworks.SteamAPI.hook_Init>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator Shutdown { add { HookEndpointManager.Modify<On.Steamworks.SteamAPI.hook_Shutdown>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Steamworks.SteamAPI.hook_Shutdown>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator GetHSteamPipe { add { HookEndpointManager.Modify<On.Steamworks.SteamAPI.hook_GetHSteamPipe>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Steamworks.SteamAPI.hook_GetHSteamPipe>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator RestartAppIfNecessary { add { HookEndpointManager.Modify<On.Steamworks.SteamAPI.hook_RestartAppIfNecessary>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Steamworks.SteamAPI.hook_RestartAppIfNecessary>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } } } namespace On.Steamworks { public static class SteamGameServer { [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_RunCallbacks(); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_RunCallbacks(orig_RunCallbacks orig); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_Shutdown(); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_Shutdown(orig_Shutdown orig); [EditorBrowsable(EditorBrowsableState.Never)] public delegate ValueType orig_GetHSteamPipe(); [EditorBrowsable(EditorBrowsableState.Never)] public delegate ValueType hook_GetHSteamPipe(orig_GetHSteamPipe orig); public static class Native { [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_SteamGameServer_RunCallbacks(); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_SteamGameServer_RunCallbacks(orig_SteamGameServer_RunCallbacks orig); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_SteamGameServer_Shutdown(); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_SteamGameServer_Shutdown(orig_SteamGameServer_Shutdown orig); [EditorBrowsable(EditorBrowsableState.Never)] public delegate ValueType orig_SteamGameServer_GetHSteamPipe(); [EditorBrowsable(EditorBrowsableState.Never)] public delegate ValueType hook_SteamGameServer_GetHSteamPipe(orig_SteamGameServer_GetHSteamPipe orig); public static event hook_SteamGameServer_RunCallbacks SteamGameServer_RunCallbacks { add { HookEndpointManager.Add<hook_SteamGameServer_RunCallbacks>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_SteamGameServer_RunCallbacks>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_SteamGameServer_Shutdown SteamGameServer_Shutdown { add { HookEndpointManager.Add<hook_SteamGameServer_Shutdown>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_SteamGameServer_Shutdown>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_SteamGameServer_GetHSteamPipe SteamGameServer_GetHSteamPipe { add { HookEndpointManager.Add<hook_SteamGameServer_GetHSteamPipe>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_SteamGameServer_GetHSteamPipe>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } } public static event hook_RunCallbacks RunCallbacks { add { HookEndpointManager.Add<hook_RunCallbacks>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_RunCallbacks>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_Shutdown Shutdown { add { HookEndpointManager.Add<hook_Shutdown>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_Shutdown>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_GetHSteamPipe GetHSteamPipe { add { HookEndpointManager.Add<hook_GetHSteamPipe>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_GetHSteamPipe>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } } } namespace IL.Steamworks { public static class SteamGameServer { public static class Native { public static event Manipulator SteamGameServer_RunCallbacks { add { HookEndpointManager.Modify<On.Steamworks.SteamGameServer.Native.hook_SteamGameServer_RunCallbacks>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Steamworks.SteamGameServer.Native.hook_SteamGameServer_RunCallbacks>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator SteamGameServer_Shutdown { add { HookEndpointManager.Modify<On.Steamworks.SteamGameServer.Native.hook_SteamGameServer_Shutdown>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Steamworks.SteamGameServer.Native.hook_SteamGameServer_Shutdown>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator SteamGameServer_GetHSteamPipe { add { HookEndpointManager.Modify<On.Steamworks.SteamGameServer.Native.hook_SteamGameServer_GetHSteamPipe>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Steamworks.SteamGameServer.Native.hook_SteamGameServer_GetHSteamPipe>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } } public static event Manipulator RunCallbacks { add { HookEndpointManager.Modify<On.Steamworks.SteamGameServer.hook_RunCallbacks>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Steamworks.SteamGameServer.hook_RunCallbacks>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator Shutdown { add { HookEndpointManager.Modify<On.Steamworks.SteamGameServer.hook_Shutdown>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Steamworks.SteamGameServer.hook_Shutdown>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator GetHSteamPipe { add { HookEndpointManager.Modify<On.Steamworks.SteamGameServer.hook_GetHSteamPipe>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Steamworks.SteamGameServer.hook_GetHSteamPipe>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } } } namespace On.Steamworks { public static class SteamInternal { [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool orig_GameServer_Init(uint unIP, ushort usPort, ushort usGamePort, ushort usQueryPort, int eServerMode, string pchVersionString); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool hook_GameServer_Init(orig_GameServer_Init orig, uint unIP, ushort usPort, ushort usGamePort, ushort usQueryPort, int eServerMode, string pchVersionString); public static class Native { [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool orig_SteamInternal_GameServer_Init(uint unIP, ushort usPort, ushort usGamePort, ushort usQueryPort, int eServerMode, string pchVersionString); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool hook_SteamInternal_GameServer_Init(orig_SteamInternal_GameServer_Init orig, uint unIP, ushort usPort, ushort usGamePort, ushort usQueryPort, int eServerMode, string pchVersionString); public static event hook_SteamInternal_GameServer_Init SteamInternal_GameServer_Init { add { HookEndpointManager.Add<hook_SteamInternal_GameServer_Init>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_SteamInternal_GameServer_Init>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } } public static event hook_GameServer_Init GameServer_Init { add { HookEndpointManager.Add<hook_GameServer_Init>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_GameServer_Init>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } } } namespace IL.Steamworks { public static class SteamInternal { public static class Native { public static event Manipulator SteamInternal_GameServer_Init { add { HookEndpointManager.Modify<On.Steamworks.SteamInternal.Native.hook_SteamInternal_GameServer_Init>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Steamworks.SteamInternal.Native.hook_SteamInternal_GameServer_Init>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } } public static event Manipulator GameServer_Init { add { HookEndpointManager.Modify<On.Steamworks.SteamInternal.hook_GameServer_Init>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Steamworks.SteamInternal.hook_GameServer_Init>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } } } namespace On.Steamworks { public static class CallbackTypeFactory { [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_cctor(); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_cctor(orig_cctor orig); public static event hook_cctor cctor { add { HookEndpointManager.Add<hook_cctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_cctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } } } namespace IL.Steamworks { public static class CallbackTypeFactory { public static event Manipulator cctor { add { HookEndpointManager.Modify<On.Steamworks.CallbackTypeFactory.hook_cctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Steamworks.CallbackTypeFactory.hook_cctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } } } namespace On.Steamworks { public static class ISteamAppList { [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_ctor(object self, bool IsGameServer); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_ctor(orig_ctor orig, object self, bool IsGameServer); [EditorBrowsable(EditorBrowsableState.Never)] public delegate IntPtr orig_SteamAPI_SteamAppList_v001(); [EditorBrowsable(EditorBrowsableState.Never)] public delegate IntPtr hook_SteamAPI_SteamAppList_v001(orig_SteamAPI_SteamAppList_v001 orig); [EditorBrowsable(EditorBrowsableState.Never)] public delegate IntPtr orig_GetUserInterfacePointer(object self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate IntPtr hook_GetUserInterfacePointer(orig_GetUserInterfacePointer orig, object self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate uint orig__GetNumInstalledApps(IntPtr self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate uint hook__GetNumInstalledApps(orig__GetNumInstalledApps orig, IntPtr self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate uint orig_GetNumInstalledApps(object self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate uint hook_GetNumInstalledApps(orig_GetNumInstalledApps orig, object self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate uint orig__GetInstalledApps(IntPtr self, [In][Out] AppId[] pvecAppID, uint unMaxAppIDs); [EditorBrowsable(EditorBrowsableState.Never)] public delegate uint hook__GetInstalledApps(orig__GetInstalledApps orig, IntPtr self, [In][Out] AppId[] pvecAppID, uint unMaxAppIDs); [EditorBrowsable(EditorBrowsableState.Never)] public delegate uint orig_GetInstalledApps(object self, [In][Out] AppId[] pvecAppID, uint unMaxAppIDs); [EditorBrowsable(EditorBrowsableState.Never)] public delegate uint hook_GetInstalledApps(orig_GetInstalledApps orig, object self, [In][Out] AppId[] pvecAppID, uint unMaxAppIDs); [EditorBrowsable(EditorBrowsableState.Never)] public delegate int orig__GetAppName(IntPtr self, AppId nAppID, IntPtr pchName, int cchNameMax); [EditorBrowsable(EditorBrowsableState.Never)] public delegate int hook__GetAppName(orig__GetAppName orig, IntPtr self, AppId nAppID, IntPtr pchName, int cchNameMax); [EditorBrowsable(EditorBrowsableState.Never)] public delegate int orig_GetAppName(object self, AppId nAppID, out string pchName); [EditorBrowsable(EditorBrowsableState.Never)] public delegate int hook_GetAppName(orig_GetAppName orig, object self, AppId nAppID, out string pchName); [EditorBrowsable(EditorBrowsableState.Never)] public delegate int orig__GetAppInstallDir(IntPtr self, AppId nAppID, IntPtr pchDirectory, int cchNameMax); [EditorBrowsable(EditorBrowsableState.Never)] public delegate int hook__GetAppInstallDir(orig__GetAppInstallDir orig, IntPtr self, AppId nAppID, IntPtr pchDirectory, int cchNameMax); [EditorBrowsable(EditorBrowsableState.Never)] public delegate int orig_GetAppInstallDir(object self, AppId nAppID, out string pchDirectory); [EditorBrowsable(EditorBrowsableState.Never)] public delegate int hook_GetAppInstallDir(orig_GetAppInstallDir orig, object self, AppId nAppID, out string pchDirectory); [EditorBrowsable(EditorBrowsableState.Never)] public delegate int orig__GetAppBuildId(IntPtr self, AppId nAppID); [EditorBrowsable(EditorBrowsableState.Never)] public delegate int hook__GetAppBuildId(orig__GetAppBuildId orig, IntPtr self, AppId nAppID); [EditorBrowsable(EditorBrowsableState.Never)] public delegate int orig_GetAppBuildId(object self, AppId nAppID); [EditorBrowsable(EditorBrowsableState.Never)] public delegate int hook_GetAppBuildId(orig_GetAppBuildId orig, object self, AppId nAppID); public static event hook_ctor ctor { add { HookEndpointManager.Add<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_SteamAPI_SteamAppList_v001 SteamAPI_SteamAppList_v001 { add { HookEndpointManager.Add<hook_SteamAPI_SteamAppList_v001>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_SteamAPI_SteamAppList_v001>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_GetUserInterfacePointer GetUserInterfacePointer { add { HookEndpointManager.Add<hook_GetUserInterfacePointer>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_GetUserInterfacePointer>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook__GetNumInstalledApps _GetNumInstalledApps { add { HookEndpointManager.Add<hook__GetNumInstalledApps>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook__GetNumInstalledApps>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_GetNumInstalledApps GetNumInstalledApps { add { HookEndpointManager.Add<hook_GetNumInstalledApps>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_GetNumInstalledApps>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook__GetInstalledApps _GetInstalledApps { add { HookEndpointManager.Add<hook__GetInstalledApps>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook__GetInstalledApps>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_GetInstalledApps GetInstalledApps { add { HookEndpointManager.Add<hook_GetInstalledApps>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_GetInstalledApps>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook__GetAppName _GetAppName { add { HookEndpointManager.Add<hook__GetAppName>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook__GetAppName>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_GetAppName GetAppName { add { HookEndpointManager.Add<hook_GetAppName>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_GetAppName>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook__GetAppInstallDir _GetAppInstallDir { add { HookEndpointManager.Add<hook__GetAppInstallDir>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook__GetAppInstallDir>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_GetAppInstallDir GetAppInstallDir { add { HookEndpointManager.Add<hook_GetAppInstallDir>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_GetAppInstallDir>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook__GetAppBuildId _GetAppBuildId { add { HookEndpointManager.Add<hook__GetAppBuildId>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook__GetAppBuildId>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_GetAppBuildId GetAppBuildId { add { HookEndpointManager.Add<hook_GetAppBuildId>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_GetAppBuildId>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } } } namespace IL.Steamworks { public static class ISteamAppList { public static event Manipulator ctor { add { HookEndpointManager.Modify<On.Steamworks.ISteamAppList.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Steamworks.ISteamAppList.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator SteamAPI_SteamAppList_v001 { add { HookEndpointManager.Modify<On.Steamworks.ISteamAppList.hook_SteamAPI_SteamAppList_v001>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Steamworks.ISteamAppList.hook_SteamAPI_SteamAppList_v001>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator GetUserInterfacePointer { add { HookEndpointManager.Modify<On.Steamworks.ISteamAppList.hook_GetUserInterfacePointer>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Steamworks.ISteamAppList.hook_GetUserInterfacePointer>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator _GetNumInstalledApps { add { HookEndpointManager.Modify<On.Steamworks.ISteamAppList.hook__GetNumInstalledApps>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Steamworks.ISteamAppList.hook__GetNumInstalledApps>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator GetNumInstalledApps { add { HookEndpointManager.Modify<On.Steamworks.ISteamAppList.hook_GetNumInstalledApps>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Steamworks.ISteamAppList.hook_GetNumInstalledApps>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator _GetInstalledApps { add { HookEndpointManager.Modify<On.Steamworks.ISteamAppList.hook__GetInstalledApps>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Steamworks.ISteamAppList.hook__GetInstalledApps>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator GetInstalledApps { add { HookEndpointManager.Modify<On.Steamworks.ISteamAppList.hook_GetInstalledApps>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Steamworks.ISteamAppList.hook_GetInstalledApps>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator _GetAppName { add { HookEndpointManager.Modify<On.Steamworks.ISteamAppList.hook__GetAppName>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Steamworks.ISteamAppList.hook__GetAppName>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator GetAppName { add { HookEndpointManager.Modify<On.Steamworks.ISteamAppList.hook_GetAppName>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Steamworks.ISteamAppList.hook_GetAppName>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator _GetAppInstallDir { add { HookEndpointManager.Modify<On.Steamworks.ISteamAppList.hook__GetAppInstallDir>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Steamworks.ISteamAppList.hook__GetAppInstallDir>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator GetAppInstallDir { add { HookEndpointManager.Modify<On.Steamworks.ISteamAppList.hook_GetAppInstallDir>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Steamworks.ISteamAppList.hook_GetAppInstallDir>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator _GetAppBuildId { add { HookEndpointManager.Modify<On.Steamworks.ISteamAppList.hook__GetAppBuildId>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Steamworks.ISteamAppList.hook__GetAppBuildId>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } public static event Manipulator GetAppBuildId { add { HookEndpointManager.Modify<On.Steamworks.ISteamAppList.hook_GetAppBuildId>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } remove { HookEndpointManager.Unmodify<On.Steamworks.ISteamAppList.hook_GetAppBuildId>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value); } } } } namespace On.Steamworks { public static class ISteamApps { [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_ctor(object self, bool IsGameServer); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_ctor(orig_ctor orig, object self, bool IsGameServer); [EditorBrowsable(EditorBrowsableState.Never)] public delegate IntPtr orig_SteamAPI_SteamApps_v008(); [EditorBrowsable(EditorBrowsableState.Never)] public delegate IntPtr hook_SteamAPI_SteamApps_v008(orig_SteamAPI_SteamApps_v008 orig); [EditorBrowsable(EditorBrowsableState.Never)] public delegate IntPtr orig_GetUserInterfacePointer(object self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate IntPtr hook_GetUserInterfacePointer(orig_GetUserInterfacePointer orig, object self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate IntPtr orig_SteamAPI_SteamGameServerApps_v008(); [EditorBrowsable(EditorBrowsableState.Never)] public delegate IntPtr hook_SteamAPI_SteamGameServerApps_v008(orig_SteamAPI_SteamGameServerApps_v008 orig); [EditorBrowsable(EditorBrowsableState.Never)] public delegate IntPtr orig_GetServerInterfacePointer(object self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate IntPtr hook_GetServerInterfacePointer(orig_GetServerInterfacePointer orig, object self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool orig__BIsSubscribed(IntPtr self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool hook__BIsSubscribed(orig__BIsSubscribed orig, IntPtr self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool orig_BIsSubscribed(object self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool hook_BIsSubscribed(orig_BIsSubscribed orig, object self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool orig__BIsLowViolence(IntPtr self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool hook__BIsLowViolence(orig__BIsLowViolence orig, IntPtr self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool orig_BIsLowViolence(object self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool hook_BIsLowViolence(orig_BIsLowViolence orig, object self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool orig__BIsCybercafe(IntPtr self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool hook__BIsCybercafe(orig__BIsCybercafe orig, IntPtr self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool orig_BIsCybercafe(object self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool hook_BIsCybercafe(orig_BIsCybercafe orig, object self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool orig__BIsVACBanned(IntPtr self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool hook__BIsVACBanned(orig__BIsVACBanned orig, IntPtr self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool orig_BIsVACBanned(object self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool hook_BIsVACBanned(orig_BIsVACBanned orig, object self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate ValueType orig__GetCurrentGameLanguage(IntPtr self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate ValueType hook__GetCurrentGameLanguage(orig__GetCurrentGameLanguage orig, IntPtr self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate string orig_GetCurrentGameLanguage(object self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate string hook_GetCurrentGameLanguage(orig_GetCurrentGameLanguage orig, object self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate ValueType orig__GetAvailableGameLanguages(IntPtr self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate ValueType hook__GetAvailableGameLanguages(orig__GetAvailableGameLanguages orig, IntPtr self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate string orig_GetAvailableGameLanguages(object self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate string hook_GetAvailableGameLanguages(orig_GetAvailableGameLanguages orig, object self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool orig__BIsSubscribedApp(IntPtr self, AppId appID); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool hook__BIsSubscribedApp(orig__BIsSubscribedApp orig, IntPtr self, AppId appID); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool orig_BIsSubscribedApp(object self, AppId appID); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool hook_BIsSubscribedApp(orig_BIsSubscribedApp orig, object self, AppId appID); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool orig__BIsDlcInstalled(IntPtr self, AppId appID); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool hook__BIsDlcInstalled(orig__BIsDlcInstalled orig, IntPtr self, AppId appID); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool orig_BIsDlcInstalled(object self, AppId appID); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool hook_BIsDlcInstalled(orig_BIsDlcInstalled orig, object self, AppId appID); [EditorBrowsable(EditorBrowsableState.Never)] public delegate uint orig__GetEarliestPurchaseUnixTime(IntPtr self, AppId nAppID); [EditorBrowsable(EditorBrowsableState.Never)] public delegate uint hook__GetEarliestPurchaseUnixTime(orig__GetEarliestPurchaseUnixTime orig, IntPtr self, AppId nAppID); [EditorBrowsable(EditorBrowsableState.Never)] public delegate uint orig_GetEarliestPurchaseUnixTime(object self, AppId nAppID); [EditorBrowsable(EditorBrowsableState.Never)] public delegate uint hook_GetEarliestPurchaseUnixTime(orig_GetEarliestPurchaseUnixTime orig, object self, AppId nAppID); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool orig__BIsSubscribedFromFreeWeekend(IntPtr self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool hook__BIsSubscribedFromFreeWeekend(orig__BIsSubscribedFromFreeWeekend orig, IntPtr self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool orig_BIsSubscribedFromFreeWeekend(object self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool hook_BIsSubscribedFromFreeWeekend(orig_BIsSubscribedFromFreeWeekend orig, object self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate int orig__GetDLCCount(IntPtr self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate int hook__GetDLCCount(orig__GetDLCCount orig, IntPtr self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate int orig_GetDLCCount(object self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate int hook_GetDLCCount(orig_GetDLCCount orig, object self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool orig__BGetDLCDataByIndex(IntPtr self, int iDLC, ref AppId pAppID, ref bool pbAvailable, IntPtr pchName, int cchNameBufferSize); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool hook__BGetDLCDataByIndex(orig__BGetDLCDataByIndex orig, IntPtr self, int iDLC, ref AppId pAppID, ref bool pbAvailable, IntPtr pchName, int cchNameBufferSize); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool orig_BGetDLCDataByIndex(object self, int iDLC, ref AppId pAppID, ref bool pbAvailable, out string pchName); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool hook_BGetDLCDataByIndex(orig_BGetDLCDataByIndex orig, object self, int iDLC, ref AppId pAppID, ref bool pbAvailable, out string pchName); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig__InstallDLC(IntPtr self, AppId nAppID); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook__InstallDLC(orig__InstallDLC orig, IntPtr self, AppId nAppID); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_InstallDLC(object self, AppId nAppID); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_InstallDLC(orig_InstallDLC orig, object self, AppId nAppID); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig__UninstallDLC(IntPtr self, AppId nAppID); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook__UninstallDLC(orig__UninstallDLC orig, IntPtr self, AppId nAppID); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_UninstallDLC(object self, AppId nAppID); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_UninstallDLC(orig_UninstallDLC orig, object self, AppId nAppID); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig__RequestAppProofOfPurchaseKey(IntPtr self, AppId nAppID); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook__RequestAppProofOfPurchaseKey(orig__RequestAppProofOfPurchaseKey orig, IntPtr self, AppId nAppID); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_RequestAppProofOfPurchaseKey(object self, AppId nAppID); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_RequestAppProofOfPurchaseKey(orig_RequestAppProofOfPurchaseKey orig, object self, AppId nAppID); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool orig__GetCurrentBetaName(IntPtr self, IntPtr pchName, int cchNameBufferSize); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool hook__GetCurrentBetaName(orig__GetCurrentBetaName orig, IntPtr self, IntPtr pchName, int cchNameBufferSize); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool orig_GetCurrentBetaName(object self, out string pchName); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool hook_GetCurrentBetaName(orig_GetCurrentBetaName orig, object self, out string pchName); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool orig__MarkContentCorrupt(IntPtr self, bool bMissingFilesOnly); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool hook__MarkContentCorrupt(orig__MarkContentCorrupt orig, IntPtr self, bool bMissingFilesOnly); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool orig_MarkContentCorrupt(object self, bool bMissingFilesOnly); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool hook_MarkContentCorrupt(orig_MarkContentCorrupt orig, object self, bool bMissingFilesOnly); [EditorBrowsable(EditorBrowsableState.Never)] public delegate uint orig__GetInstalledDepots(IntPtr self, AppId appID, [In][Out] ValueType pvecDepots, uint cMaxDepots); [EditorBrowsable(EditorBrowsableState.Never)] public delegate uint hook__GetInstalledDepots(orig__GetInstalledDepots orig, IntPtr self, AppId appID, [In][Out] ValueType pvecDepots, uint cMaxDepots); [EditorBrowsable(EditorBrowsableState.Never)] public delegate uint orig_GetInstalledDepots(object self, AppId appID, [In][Out] ValueType pvecDepots, uint cMaxDepots); [EditorBrowsable(EditorBrowsableState.Never)] public delegate uint hook_GetInstalledDepots(orig_GetInstalledDepots orig, object self, AppId appID, [In][Out] ValueType pvecDepots, uint cMaxDepots); [EditorBrowsable(EditorBrowsableState.Never)] public delegate uint orig__GetAppInstallDir(IntPtr self, AppId appID, IntPtr pchFolder, uint cchFolderBufferSize); [EditorBrowsable(EditorBrowsableState.Never)] public delegate uint hook__GetAppInstallDir(orig__GetAppInstallDir orig, IntPtr self, AppId appID, IntPtr pchFolder, uint cchFolderBufferSize); [EditorBrowsable(EditorBrowsableState.Never)] public delegate uint orig_GetAppInstallDir(object self, AppId appID, out string pchFolder); [EditorBrowsable(EditorBrowsableState.Never)] public delegate uint hook_GetAppInstallDir(orig_GetAppInstallDir orig, object self, AppId appID, out string pchFolder); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool orig__BIsAppInstalled(IntPtr self, AppId appID); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool hook__BIsAppInstalled(orig__BIsAppInstalled orig, IntPtr self, AppId appID); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool orig_BIsAppInstalled(object self, AppId appID); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool hook_BIsAppInstalled(orig_BIsAppInstalled orig, object self, AppId appID); [EditorBrowsable(EditorBrowsableState.Never)] public delegate SteamId orig__GetAppOwner(IntPtr self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate SteamId hook__GetAppOwner(orig__GetAppOwner orig, IntPtr self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate SteamId orig_GetAppOwner(object self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate SteamId hook_GetAppOwner(orig_GetAppOwner orig, object self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate ValueType orig__GetLaunchQueryParam(IntPtr self, string pchKey); [EditorBrowsable(EditorBrowsableState.Never)] public delegate ValueType hook__GetLaunchQueryParam(orig__GetLaunchQueryParam orig, IntPtr self, string pchKey); [EditorBrowsable(EditorBrowsableState.Never)] public delegate string orig_GetLaunchQueryParam(object self, string pchKey); [EditorBrowsable(EditorBrowsableState.Never)] public delegate string hook_GetLaunchQueryParam(orig_GetLaunchQueryParam orig, object self, string pchKey); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool orig__GetDlcDownloadProgress(IntPtr self, AppId nAppID, ref ulong punBytesDownloaded, ref ulong punBytesTotal); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool hook__GetDlcDownloadProgress(orig__GetDlcDownloadProgress orig, IntPtr self, AppId nAppID, ref ulong punBytesDownloaded, ref ulong punBytesTotal); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool orig_GetDlcDownloadProgress(object self, AppId nAppID, ref ulong punBytesDownloaded, ref ulong punBytesTotal); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool hook_GetDlcDownloadProgress(orig_GetDlcDownloadProgress orig, object self, AppId nAppID, ref ulong punBytesDownloaded, ref ulong punBytesTotal); [EditorBrowsable(EditorBrowsableState.Never)] public delegate int orig__GetAppBuildId(IntPtr self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate int hook__GetAppBuildId(orig__GetAppBuildId orig, IntPtr self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate int orig_GetAppBuildId(object self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate int hook_GetAppBuildId(orig_GetAppBuildId orig, object self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig__RequestAllProofOfPurchaseKeys(IntPtr self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook__RequestAllProofOfPurchaseKeys(orig__RequestAllProofOfPurchaseKeys orig, IntPtr self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void orig_RequestAllProofOfPurchaseKeys(object self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate void hook_RequestAllProofOfPurchaseKeys(orig_RequestAllProofOfPurchaseKeys orig, object self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate ValueType orig__GetFileDetails(IntPtr self, string pszFileName); [EditorBrowsable(EditorBrowsableState.Never)] public delegate ValueType hook__GetFileDetails(orig__GetFileDetails orig, IntPtr self, string pszFileName); [EditorBrowsable(EditorBrowsableState.Never)] public delegate ValueType orig_GetFileDetails(object self, string pszFileName); [EditorBrowsable(EditorBrowsableState.Never)] public delegate ValueType hook_GetFileDetails(orig_GetFileDetails orig, object self, string pszFileName); [EditorBrowsable(EditorBrowsableState.Never)] public delegate int orig__GetLaunchCommandLine(IntPtr self, IntPtr pszCommandLine, int cubCommandLine); [EditorBrowsable(EditorBrowsableState.Never)] public delegate int hook__GetLaunchCommandLine(orig__GetLaunchCommandLine orig, IntPtr self, IntPtr pszCommandLine, int cubCommandLine); [EditorBrowsable(EditorBrowsableState.Never)] public delegate int orig_GetLaunchCommandLine(object self, out string pszCommandLine); [EditorBrowsable(EditorBrowsableState.Never)] public delegate int hook_GetLaunchCommandLine(orig_GetLaunchCommandLine orig, object self, out string pszCommandLine); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool orig__BIsSubscribedFromFamilySharing(IntPtr self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool hook__BIsSubscribedFromFamilySharing(orig__BIsSubscribedFromFamilySharing orig, IntPtr self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool orig_BIsSubscribedFromFamilySharing(object self); [EditorBrowsable(EditorBrowsableState.Never)] public delegate bool hook_BIsSubscribedFromFamilySharing(orig_BIsSubscribedFromFamilySharing orig, object self); public static event hook_ctor ctor { add { HookEndpointManager.Add<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_SteamAPI_SteamApps_v008 SteamAPI_SteamApps_v008 { add { HookEndpointManager.Add<hook_SteamAPI_SteamApps_v008>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_SteamAPI_SteamApps_v008>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_GetUserInterfacePointer GetUserInterfacePointer { add { HookEndpointManager.Add<hook_GetUserInterfacePointer>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_GetUserInterfacePointer>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_SteamAPI_SteamGameServerApps_v008 SteamAPI_SteamGameServerApps_v008 { add { HookEndpointManager.Add<hook_SteamAPI_SteamGameServerApps_v008>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_SteamAPI_SteamGameServerApps_v008>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_GetServerInterfacePointer GetServerInterfacePointer { add { HookEndpointManager.Add<hook_GetServerInterfacePointer>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_GetServerInterfacePointer>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook__BIsSubscribed _BIsSubscribed { add { HookEndpointManager.Add<hook__BIsSubscribed>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook__BIsSubscribed>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_BIsSubscribed BIsSubscribed { add { HookEndpointManager.Add<hook_BIsSubscribed>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_BIsSubscribed>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook__BIsLowViolence _BIsLowViolence { add { HookEndpointManager.Add<hook__BIsLowViolence>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook__BIsLowViolence>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_BIsLowViolence BIsLowViolence { add { HookEndpointManager.Add<hook_BIsLowViolence>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_BIsLowViolence>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook__BIsCybercafe _BIsCybercafe { add { HookEndpointManager.Add<hook__BIsCybercafe>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook__BIsCybercafe>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_BIsCybercafe BIsCybercafe { add { HookEndpointManager.Add<hook_BIsCybercafe>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_BIsCybercafe>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook__BIsVACBanned _BIsVACBanned { add { HookEndpointManager.Add<hook__BIsVACBanned>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook__BIsVACBanned>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_BIsVACBanned BIsVACBanned { add { HookEndpointManager.Add<hook_BIsVACBanned>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_BIsVACBanned>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook__GetCurrentGameLanguage _GetCurrentGameLanguage { add { HookEndpointManager.Add<hook__GetCurrentGameLanguage>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook__GetCurrentGameLanguage>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_GetCurrentGameLanguage GetCurrentGameLanguage { add { HookEndpointManager.Add<hook_GetCurrentGameLanguage>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_GetCurrentGameLanguage>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook__GetAvailableGameLanguages _GetAvailableGameLanguages { add { HookEndpointManager.Add<hook__GetAvailableGameLanguages>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook__GetAvailableGameLanguages>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_GetAvailableGameLanguages GetAvailableGameLanguages { add { HookEndpointManager.Add<hook_GetAvailableGameLanguages>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_GetAvailableGameLanguages>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook__BIsSubscribedApp _BIsSubscribedApp { add { HookEndpointManager.Add<hook__BIsSubscribedApp>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook__BIsSubscribedApp>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_BIsSubscribedApp BIsSubscribedApp { add { HookEndpointManager.Add<hook_BIsSubscribedApp>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_BIsSubscribedApp>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook__BIsDlcInstalled _BIsDlcInstalled { add { HookEndpointManager.Add<hook__BIsDlcInstalled>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook__BIsDlcInstalled>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_BIsDlcInstalled BIsDlcInstalled { add { HookEndpointManager.Add<hook_BIsDlcInstalled>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_BIsDlcInstalled>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook__GetEarliestPurchaseUnixTime _GetEarliestPurchaseUnixTime { add { HookEndpointManager.Add<hook__GetEarliestPurchaseUnixTime>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook__GetEarliestPurchaseUnixTime>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_GetEarliestPurchaseUnixTime GetEarliestPurchaseUnixTime { add { HookEndpointManager.Add<hook_GetEarliestPurchaseUnixTime>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_GetEarliestPurchaseUnixTime>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook__BIsSubscribedFromFreeWeekend _BIsSubscribedFromFreeWeekend { add { HookEndpointManager.Add<hook__BIsSubscribedFromFreeWeekend>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook__BIsSubscribedFromFreeWeekend>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_BIsSubscribedFromFreeWeekend BIsSubscribedFromFreeWeekend { add { HookEndpointManager.Add<hook_BIsSubscribedFromFreeWeekend>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_BIsSubscribedFromFreeWeekend>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook__GetDLCCount _GetDLCCount { add { HookEndpointManager.Add<hook__GetDLCCount>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook__GetDLCCount>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_GetDLCCount GetDLCCount { add { HookEndpointManager.Add<hook_GetDLCCount>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_GetDLCCount>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook__BGetDLCDataByIndex _BGetDLCDataByIndex { add { HookEndpointManager.Add<hook__BGetDLCDataByIndex>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook__BGetDLCDataByIndex>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_BGetDLCDataByIndex BGetDLCDataByIndex { add { HookEndpointManager.Add<hook_BGetDLCDataByIndex>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_BGetDLCDataByIndex>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook__InstallDLC _InstallDLC { add { HookEndpointManager.Add<hook__InstallDLC>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook__InstallDLC>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_InstallDLC InstallDLC { add { HookEndpointManager.Add<hook_InstallDLC>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_InstallDLC>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook__UninstallDLC _UninstallDLC { add { HookEndpointManager.Add<hook__UninstallDLC>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook__UninstallDLC>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_UninstallDLC UninstallDLC { add { HookEndpointManager.Add<hook_UninstallDLC>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_UninstallDLC>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook__RequestAppProofOfPurchaseKey _RequestAppProofOfPurchaseKey { add { HookEndpointManager.Add<hook__RequestAppProofOfPurchaseKey>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook__RequestAppProofOfPurchaseKey>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_RequestAppProofOfPurchaseKey RequestAppProofOfPurchaseKey { add { HookEndpointManager.Add<hook_RequestAppProofOfPurchaseKey>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_RequestAppProofOfPurchaseKey>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook__GetCurrentBetaName _GetCurrentBetaName { add { HookEndpointManager.Add<hook__GetCurrentBetaName>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook__GetCurrentBetaName>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_GetCurrentBetaName GetCurrentBetaName { add { HookEndpointManager.Add<hook_GetCurrentBetaName>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_GetCurrentBetaName>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook__MarkContentCorrupt _MarkContentCorrupt { add { HookEndpointManager.Add<hook__MarkContentCorrupt>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook__MarkContentCorrupt>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_MarkContentCorrupt MarkContentCorrupt { add { HookEndpointManager.Add<hook_MarkContentCorrupt>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_MarkContentCorrupt>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook__GetInstalledDepots _GetInstalledDepots { add { HookEndpointManager.Add<hook__GetInstalledDepots>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook__GetInstalledDepots>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_GetInstalledDepots GetInstalledDepots { add { HookEndpointManager.Add<hook_GetInstalledDepots>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_GetInstalledDepots>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook__GetAppInstallDir _GetAppInstallDir { add { HookEndpointManager.Add<hook__GetAppInstallDir>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook__GetAppInstallDir>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_GetAppInstallDir GetAppInstallDir { add { HookEndpointManager.Add<hook_GetAppInstallDir>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_GetAppInstallDir>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook__BIsAppInstalled _BIsAppInstalled { add { HookEndpointManager.Add<hook__BIsAppInstalled>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook__BIsAppInstalled>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_BIsAppInstalled BIsAppInstalled { add { HookEndpointManager.Add<hook_BIsAppInstalled>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_BIsAppInstalled>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook__GetAppOwner _GetAppOwner { add { HookEndpointManager.Add<hook__GetAppOwner>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook__GetAppOwner>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_GetAppOwner GetAppOwner { add { HookEndpointManager.Add<hook_GetAppOwner>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_GetAppOwner>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook__GetLaunchQueryParam _GetLaunchQueryParam { add { HookEndpointManager.Add<hook__GetLaunchQueryParam>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook__GetLaunchQueryParam>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_GetLaunchQueryParam GetLaunchQueryParam { add { HookEndpointManager.Add<hook_GetLaunchQueryParam>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_GetLaunchQueryParam>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook__GetDlcDownloadProgress _GetDlcDownloadProgress { add { HookEndpointManager.Add<hook__GetDlcDownloadProgress>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook__GetDlcDownloadProgress>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_GetDlcDownloadProgress GetDlcDownloadProgress { add { HookEndpointManager.Add<hook_GetDlcDownloadProgress>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_GetDlcDownloadProgress>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook__GetAppBuildId _GetAppBuildId { add { HookEndpointManager.Add<hook__GetAppBuildId>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook__GetAppBuildId>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook_GetAppBuildId GetAppBuildId { add { HookEndpointManager.Add<hook_GetAppBuildId>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook_GetAppBuildId>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } } public static event hook__RequestAllProofOfPurchaseKeys _RequestAllProofOfPurchaseKeys { add { HookEndpointManager.Add<hook__RequestAllProofOfPurchaseKeys>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value); } remove { HookEndpointManager.Remove<hook__RequestAllProofOfPurchaseKeys>(MethodBase.GetMethodFromHandle((Runt
BepInEx/plugins/Monkeytype-HidePlayerNames/HidePlayerNames.dll
Decompiled 11 months agousing System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Logging; using GameNetcodeStuff; using HarmonyLib; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("HidePlayerNames")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("HidePlayerNames")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("2b33fbb6-cfd0-478e-a9c4-8fadf0990b33")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyVersion("1.0.0.0")] namespace HidePlayerNames { [BepInPlugin("Miodec.HidePlayerNames", "Hide Player Names", "1.0.1")] public class HidePlayerNames : BaseUnityPlugin { private const string modGUID = "Miodec.HidePlayerNames"; private const string modName = "Hide Player Names"; private const string modVersion = "1.0.1"; private static HidePlayerNames Instance; internal ManualLogSource mls; private void Awake() { if ((Object)(object)Instance == (Object)null) { Instance = this; } mls = Logger.CreateLogSource("Miodec.HidePlayerNames"); Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), (string)null); } } } namespace HidePlayerNames.Patches { [HarmonyPatch(typeof(PlayerControllerB))] internal class PlayerControllerBPatch { [HarmonyPatch("ShowNameBillboard")] [HarmonyPrefix] public static bool ShowNameBillBoard() { return false; } } }
BepInEx/plugins/NiceHairs-NuclearLib/NuclearLib.dll
Decompiled 11 months agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Logging; using HarmonyLib; using NuclearLib.ModContent; using NuclearLib.Patches; using Unity.Netcode; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("NuclearLib")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("NuclearLib")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("0034b6e9-e4ca-48f1-8cf2-5f898fdd0ce1")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace NuclearLib { [BepInPlugin("niceh.NuclearLib", "NuclearLib", "1.0.1")] public class Plugin : BaseUnityPlugin { public const string GUID = "niceh.NuclearLib"; public const string Name = "NuclearLib"; private static Harmony _harmony; public static Plugin Instance { get; private set; } public static ManualLogSource Log { get; private set; } public static Dictionary<Type, List<Type>> ModBehaviours { get; private set; } = new Dictionary<Type, List<Type>>(); private void Awake() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown Instance = this; Log = ((BaseUnityPlugin)this).Logger; _harmony = new Harmony("niceh.NuclearLib"); _harmony.PatchAll(typeof(Patch_EnemyAI)); _harmony.PatchAll(typeof(Patch_GrabbableObject)); } public static void RegisterModBehaviour<T>(Type behaviourType) where T : ModBehaviour { if (ModBehaviours.TryGetValue(behaviourType, out var value)) { value.Add(typeof(T)); } else { ModBehaviours.Add(behaviourType, new List<Type> { typeof(T) }); } Log.LogInfo((object)("Registered ModBehaviour [" + typeof(T).FullName + "]")); ApplyPatch(behaviourType); } private static void ApplyPatch(Type type) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Expected O, but got Unknown //IL_0066: Expected O, but got Unknown MethodInfo highestBaseMethod = GetHighestBaseMethod(type, "Start"); if (highestBaseMethod != null && !IsMethodPatched(highestBaseMethod)) { _harmony.Patch((MethodBase)highestBaseMethod, new HarmonyMethod(typeof(Patch_NetworkBehaviour), "PreStart", new Type[1] { type }), new HarmonyMethod(typeof(Patch_NetworkBehaviour), "PostStart", new Type[1] { type }), (HarmonyMethod)null, (HarmonyMethod)null); } } private static MethodInfo GetHighestBaseMethod(Type type, string methodName) { MethodInfo result = null; while (type != null && type != typeof(object)) { MethodInfo method = type.GetMethod(methodName, BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public); if (method != null) { result = method; } type = type.BaseType; } return result; } private static bool IsMethodPatched(MethodInfo method) { Patches patchInfo = Harmony.GetPatchInfo((MethodBase)method); if (patchInfo == null) { return false; } if (!patchInfo.Prefixes.Any((Patch p) => p.owner == _harmony.Id)) { return patchInfo.Postfixes.Any((Patch p) => p.owner == _harmony.Id); } return true; } } } namespace NuclearLib.Patches { internal static class Patch_EnemyAI { [HarmonyPatch(typeof(EnemyAI), "DoAIInterval")] [HarmonyPrefix] private static void PreDoAIInterval(EnemyAI __instance) { ModAI[] components = ((Component)__instance).gameObject.GetComponents<ModAI>(); for (int i = 0; i < components.Length; i++) { components[i].PreAI(); } } [HarmonyPatch(typeof(EnemyAI), "DoAIInterval")] [HarmonyPostfix] private static void PostDoAIInterval(EnemyAI __instance) { ModAI[] components = ((Component)__instance).gameObject.GetComponents<ModAI>(); for (int i = 0; i < components.Length; i++) { components[i].PostAI(); } } } internal static class Patch_GrabbableObject { [HarmonyPatch(typeof(GrabbableObject), "ItemActivate")] [HarmonyPrefix] private static bool PreItemActivate(ExtensionLadderItem __instance, bool used, bool buttonDown) { bool flag = true; ModItem[] components = ((Component)__instance).gameObject.GetComponents<ModItem>(); foreach (ModItem modItem in components) { flag = flag && modItem.PreItemActivate(used, buttonDown); } return flag; } [HarmonyPatch(typeof(GrabbableObject), "ItemActivate")] [HarmonyPostfix] private static void PostItemActivate(ExtensionLadderItem __instance, bool used, bool buttonDown) { ModItem[] components = ((Component)__instance).gameObject.GetComponents<ModItem>(); for (int i = 0; i < components.Length; i++) { components[i].PreItemActivate(used, buttonDown); } } } internal static class Patch_NetworkBehaviour { private static void PreStart(NetworkBehaviour __instance) { foreach (KeyValuePair<Type, List<Type>> modBehaviour in Plugin.ModBehaviours) { if (!modBehaviour.Key.IsAssignableFrom(((object)__instance).GetType())) { continue; } foreach (Type item in modBehaviour.Value) { ModBehaviour obj = (ModBehaviour)(object)((Component)__instance).gameObject.AddComponent(item); obj.Original = __instance; obj.PreStart(); } } } private static void PostStart(NetworkBehaviour __instance) { ModBehaviour[] components = ((Component)__instance).gameObject.GetComponents<ModBehaviour>(); for (int i = 0; i < components.Length; i++) { components[i].PostStart(); } } } } namespace NuclearLib.ModContent { public class ModAI : ModBehaviour { public virtual void PreAI() { } public virtual void PostAI() { } } public class ModBehaviour : NetworkBehaviour { public NetworkBehaviour Original { get; set; } public virtual void PreStart() { } public virtual void PostStart() { } } public class ModItem : ModBehaviour { public virtual bool PreItemActivate(bool used, bool buttonDown) { return true; } public virtual void PostItemActivate(bool used, bool buttonDown) { } } }
BepInEx/plugins/NiceHairs-Symbiosis/Symbiosis.dll
Decompiled 11 months agousing System; using System.CodeDom.Compiler; using System.Collections; using System.ComponentModel; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using GameNetcodeStuff; using HarmonyLib; using NuclearLib; using NuclearLib.ModContent; using Symbiosis.Extensions; using Symbiosis.ModBehaviours; using Symbiosis.MonoBehaviours; using Symbiosis.Patches; using Symbiosis.Properties; using Symbiosis.Utils; using Unity.Netcode; using UnityEngine; using UnityEngine.AI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("Symbiosis")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Symbiosis")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("97f95e36-1154-479c-be65-4ef35b78018f")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyVersion("1.0.0.0")] internal class <Module> { static <Module>() { } } namespace Symbiosis { public static class Assets { public static GameObject FlyPrefab { get; set; } } public class ConfigManager { public class HoarderBugConfig { public bool ItemUse { get; set; } public int MinItemUseInterval { get; set; } public int MaxItemUseInterval { get; set; } public int ItemUnuseChance { get; set; } public bool Dispersion { get; set; } } public class StenchOfDeathConfig { public bool Flies { get; set; } } private ConfigFile _file; public HoarderBugConfig HoarderBug; public StenchOfDeathConfig StenchOfDeath; public ConfigManager() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown _file = new ConfigFile(Path.Combine(Paths.ConfigPath, "Symbiosis.cfg"), true); HoarderBug = new HoarderBugConfig(); HoarderBug.ItemUse = _file.Bind<bool>("HoarderBug", "ItemUse", true, "[Host & Client] Allows item use at random intervals.").Value; HoarderBug.MinItemUseInterval = _file.Bind<int>("HoarderBug", "MinItemUseInterval", 0, "Sets minimum interval for item use.").Value; HoarderBug.MaxItemUseInterval = _file.Bind<int>("HoarderBug", "MaxItemUseInterval", 20, "Sets maximum interval for item use.").Value; HoarderBug.ItemUnuseChance = _file.Bind<int>("HoarderBug", "ItemUnuseChance", 3, "1 in X chance to cease item use, e.g., stop spraying.").Value; HoarderBug.Dispersion = _file.Bind<bool>("HoarderBug", "Dispersion", true, "[Host] Enables dispersion after nest return.").Value; StenchOfDeath = new StenchOfDeathConfig(); StenchOfDeath.Flies = _file.Bind<bool>("StenchOfDeath", "Flies", true, "[Client] Toggle flies on dead bodies over time.").Value; } } [BepInPlugin("niceh.Symbiosis", "Symbiosis", "1.0.3")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { public const string GUID = "niceh.Symbiosis"; public const string Name = "Symbiosis"; public static Plugin Instance { get; private set; } public static ManualLogSource Log { get; private set; } public static ConfigManager ConfigManager { get; private set; } private void Awake() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown Instance = this; Log = ((BaseUnityPlugin)this).Logger; Log.LogInfo((object)"Patching..."); Harmony val = new Harmony("niceh.Symbiosis"); val.PatchAll(typeof(Patch_PlayerControllerB)); Log.LogInfo((object)"Finished patching!"); Log.LogInfo((object)"Registering ModBehaviours..."); Plugin.RegisterModBehaviour<Mod_HoarderBug>(typeof(HoarderBugAI)); Plugin.RegisterModBehaviour<Mod_ExtensionLadder>(typeof(ExtensionLadderItem)); Plugin.RegisterModBehaviour<Mod_StunGrenade>(typeof(StunGrenadeItem)); Log.LogInfo((object)"Finished registering ModBehaviours!"); Log.LogInfo((object)"Loading Config..."); ConfigManager = new ConfigManager(); Log.LogInfo((object)"Finished Loading Config!"); Log.LogInfo((object)"Loading Assets!"); AssetBundle val2 = AssetBundle.LoadFromMemory(Resources.symbiosis); Assets.FlyPrefab = val2.LoadAsset<GameObject>("assets/symbiosis/prefabs/stenchofdeath.prefab"); Log.LogInfo((object)"Finished Loading Assets!"); Type[] types = Assembly.GetExecutingAssembly().GetTypes(); Type[] array = types; foreach (Type type in array) { MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); MethodInfo[] array2 = methods; foreach (MethodInfo methodInfo in array2) { object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false); if (customAttributes.Length != 0) { methodInfo.Invoke(null, null); } } } } } } namespace Symbiosis.Utils { public static class Util_HoarderBug { public static HoarderBugAI FindHoarderBug(GrabbableObject item) { if ((Object)(object)item.playerHeldBy != (Object)null) { return null; } HoarderBugAI[] array = Object.FindObjectsByType<HoarderBugAI>((FindObjectsSortMode)0); HoarderBugAI[] array2 = array; foreach (HoarderBugAI val in array2) { if (val != null && val.heldItem != null && !((Object)(object)val.heldItem.itemGrabbableObject != (Object)(object)item)) { return val; } } return null; } public static float GetNestSize(HoarderBugAI hoarderBug) { HoarderBugAI[] source = Object.FindObjectsOfType<HoarderBugAI>(); return (float)source.Where((HoarderBugAI x) => x.nestPosition == hoarderBug.nestPosition).Count() * 0.5f + 1f; } } public static class Util_NavMesh { public static Vector3 GetRandomPointInArea(Vector3 center, float radius) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: 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_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000e: 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_0014: 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) Vector3 val = Random.insideUnitSphere * radius; val += center; NavMeshHit val2 = default(NavMeshHit); NavMesh.SamplePosition(val, ref val2, radius, -1); return ((NavMeshHit)(ref val2)).position; } } } namespace Symbiosis.Properties { [GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [DebuggerNonUserCode] [CompilerGenerated] internal class Resources { private static ResourceManager resourceMan; private static CultureInfo resourceCulture; [EditorBrowsable(EditorBrowsableState.Advanced)] internal static ResourceManager ResourceManager { get { if (resourceMan == null) { ResourceManager resourceManager = new ResourceManager("Symbiosis.Properties.Resources", typeof(Resources).Assembly); resourceMan = resourceManager; } return resourceMan; } } [EditorBrowsable(EditorBrowsableState.Advanced)] internal static CultureInfo Culture { get { return resourceCulture; } set { resourceCulture = value; } } internal static byte[] symbiosis { get { object @object = ResourceManager.GetObject("symbiosis", resourceCulture); return (byte[])@object; } } internal Resources() { } } } namespace Symbiosis.Extensions { public static class Extension_HoarderBugAI { public static readonly MethodInfo info_DropItem = typeof(HoarderBugAI).GetMethod("DropItem", BindingFlags.Instance | BindingFlags.NonPublic); public static readonly MethodInfo info_SetGoTowardsTargetObject = typeof(HoarderBugAI).GetMethod("SetGoTowardsTargetObject", BindingFlags.Instance | BindingFlags.NonPublic); public static readonly MethodInfo info_GrabTargetItemIfClose = typeof(HoarderBugAI).GetMethod("GrabTargetItemIfClose", BindingFlags.Instance | BindingFlags.NonPublic); public static readonly FieldInfo info_waitingAtNest = typeof(HoarderBugAI).GetField("waitingAtNest", BindingFlags.Instance | BindingFlags.NonPublic); public static readonly FieldInfo info_waitingAtNestTimer = typeof(HoarderBugAI).GetField("waitingAtNestTimer", BindingFlags.Instance | BindingFlags.NonPublic); public static readonly FieldInfo info_inReturnToNestMode = typeof(HoarderBugAI).GetField("inReturnToNestMode", BindingFlags.Instance | BindingFlags.NonPublic); public static bool GrabTargetItemIfClose(this HoarderBugAI bug) { return (bool)info_GrabTargetItemIfClose?.Invoke(bug, new object[0]); } public static void SetGoTowardsTargetObject(this HoarderBugAI bug, GameObject foundObject) { info_SetGoTowardsTargetObject?.Invoke(bug, new object[1] { foundObject }); } public static void DropItem(this HoarderBugAI bug, NetworkObject item, Vector3 targetFloorPosition, bool droppingInNest = true) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) info_DropItem?.Invoke(bug, new object[3] { item, targetFloorPosition, droppingInNest }); } public static void SetWaitingAtNest(this HoarderBugAI bug, bool value) { info_waitingAtNest?.SetValue(bug, value); } public static bool GetWaitingAtNest(this HoarderBugAI bug) { return (bool)info_waitingAtNest?.GetValue(bug); } public static void SetWaitingAtNestTimer(this HoarderBugAI bug, float value) { info_waitingAtNestTimer?.SetValue(bug, value); } public static float GetWaitingAtNestTimer(this HoarderBugAI bug) { return (float)info_waitingAtNestTimer?.GetValue(bug); } public static void SetInReturnToNestMode(this HoarderBugAI bug, bool value) { info_inReturnToNestMode?.SetValue(bug, value); } public static bool GetInReturnToNestMode(this HoarderBugAI bug) { return (bool)info_inReturnToNestMode?.GetValue(bug); } } public static class Extension_StunGrenadeItem { public static readonly FieldInfo info_pullPinCoroutine = typeof(StunGrenadeItem).GetField("pullPinCoroutine", BindingFlags.Instance | BindingFlags.NonPublic); public static void SetPullPinCoroutine(this StunGrenadeItem item, Coroutine coroutine) { info_pullPinCoroutine?.SetValue(item, coroutine); } public static Coroutine GetPullPinCoroutine(this StunGrenadeItem item) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown return (Coroutine)(info_pullPinCoroutine?.GetValue(item)); } public static IEnumerator NoPlayerPullPinAnimation(this StunGrenadeItem item) { item.inPullingPinAnimation = true; item.itemAnimator.SetTrigger("pullPin"); item.itemAudio.PlayOneShot(item.pullPinSFX); WalkieTalkie.TransmitOneShotAudio(item.itemAudio, item.pullPinSFX, 0.8f); yield return (object)new WaitForSeconds(1f); item.inPullingPinAnimation = false; item.pinPulled = true; ((GrabbableObject)item).itemUsedUp = true; } } } namespace Symbiosis.Patches { internal static class Patch_PlayerControllerB { [HarmonyPatch(typeof(PlayerControllerB), "SpawnDeadBody")] [HarmonyPostfix] private static void SpawnDeadBody(int playerId) { if (!Plugin.ConfigManager.StenchOfDeath.Flies) { return; } try { DeadBodyInfo[] array = Object.FindObjectsOfType<DeadBodyInfo>(); DeadBodyInfo[] array2 = array; foreach (DeadBodyInfo val in array2) { if (val.playerObjectId == playerId) { StenchOfDeath stenchOfDeath = ((Component)val).gameObject.AddComponent<StenchOfDeath>(); stenchOfDeath.Setup(((Component)val).gameObject); } } } catch (Exception ex) { Plugin.Log.LogError((object)ex); } } } } namespace Symbiosis.MonoBehaviours { public class StenchOfDeath : MonoBehaviour { private GameObject _flies; private GameObject _corpse; private float _timeSinceDeath; private float _timeSinceRotten; private EmissionModule _emissionModule; private AudioSource _audioSource; public bool BodyRotten { get; set; } public float Stench { get; set; } public void Update() { //IL_0083: Unknown result type (might be due to invalid IL or missing references) _timeSinceDeath += Time.deltaTime; if (_timeSinceDeath >= 60f && !BodyRotten) { BodyRotten = true; _timeSinceRotten = _timeSinceDeath; } if (BodyRotten && _timeSinceDeath - _timeSinceRotten <= 30f) { Stench = (_timeSinceDeath - _timeSinceRotten) / 30f; ((EmissionModule)(ref _emissionModule)).rateOverTime = MinMaxCurve.op_Implicit((float)(int)(Stench * 15f)); _audioSource.volume = Stench * 0.35f; } } public void Setup(GameObject corpse) { //IL_003d: 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_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) _flies = Object.Instantiate<GameObject>(Assets.FlyPrefab); _corpse = corpse; _flies.transform.parent = _corpse.transform; _flies.transform.localPosition = Vector3.zero; _flies.transform.localScale = Vector3.one; ParticleSystem component = _flies.GetComponent<ParticleSystem>(); _emissionModule = component.emission; ((EmissionModule)(ref _emissionModule)).rateOverTime = MinMaxCurve.op_Implicit(0f); component.Play(); _audioSource = _flies.GetComponent<AudioSource>(); _audioSource.volume = 0f; _audioSource.Play(); } } } namespace Symbiosis.ModBehaviours { public class Mod_HoarderBug : ModAI { private readonly Random _rand = new Random(); public override void PreStart() { NetworkBehaviour original = ((ModBehaviour)this).Original; HoarderBugAI val = (HoarderBugAI)(object)((original is HoarderBugAI) ? original : null); if (val != null && Plugin.ConfigManager.HoarderBug.ItemUse) { ((MonoBehaviour)val).StartCoroutine(HoarderBugUseItem()); } } public override void PostAI() { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) NetworkBehaviour original = ((ModBehaviour)this).Original; HoarderBugAI val = (HoarderBugAI)(object)((original is HoarderBugAI) ? original : null); if (val != null && !((EnemyAI)val).isEnemyDead && !StartOfRound.Instance.allPlayersDead && ((EnemyAI)val).currentBehaviourStateIndex == 1 && Plugin.ConfigManager.HoarderBug.Dispersion && val.GetWaitingAtNest() && Vector3.Distance(((Component)val).transform.position, val.nestPosition) <= 0.5f) { float nestSize = Util_HoarderBug.GetNestSize(val); Vector3 randomPointInArea = Util_NavMesh.GetRandomPointInArea(val.nestPosition, nestSize); if (((EnemyAI)val).SetDestinationToPosition(randomPointInArea, true)) { Plugin.Log.LogInfo((object)$"FOUND SPOT TO CHILL {Vector3.Distance(randomPointInArea, ((Component)val).transform.position)} UNITS AWAY FROM ME"); } } } private IEnumerator HoarderBugUseItem() { NetworkBehaviour original = ((ModBehaviour)this).Original; HoarderBugAI hoarder = (HoarderBugAI)(object)((original is HoarderBugAI) ? original : null); if (hoarder == null) { yield break; } while (((Behaviour)hoarder).isActiveAndEnabled) { try { if (!((EnemyAI)hoarder).inSpecialAnimation && !((EnemyAI)hoarder).isEnemyDead && !StartOfRound.Instance.allPlayersDead && hoarder.heldItem != null && (Object)(object)hoarder.heldItem.itemGrabbableObject != (Object)null) { ManualLogSource log = Plugin.Log; HoarderBugItem heldItem = hoarder.heldItem; log.LogInfo((object)("USING " + ((heldItem != null) ? ((Object)heldItem.itemGrabbableObject.itemProperties).name : null))); hoarder.heldItem.itemGrabbableObject.UseItemOnClient(_rand.Next(Plugin.ConfigManager.HoarderBug.ItemUnuseChance) != 0); } } catch (Exception ex) { Plugin.Log.LogError((object)ex); } yield return (object)new WaitForSeconds((float)_rand.Next(Plugin.ConfigManager.HoarderBug.MinItemUseInterval, Plugin.ConfigManager.HoarderBug.MaxItemUseInterval)); } } protected override void __initializeVariables() { ((ModAI)this).__initializeVariables(); } protected internal override string __getTypeName() { return "Mod_HoarderBug"; } } public class Mod_ExtensionLadder : ModItem { public override bool PreItemActivate(bool used, bool buttonDown) { //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) NetworkBehaviour original = ((ModBehaviour)this).Original; ExtensionLadderItem val = (ExtensionLadderItem)(object)((original is ExtensionLadderItem) ? original : null); if (val == null) { return true; } if ((Object)(object)((GrabbableObject)val).playerHeldBy != (Object)null) { return true; } Plugin.Log.LogInfo((object)"ITEM IS NOT HELD BY PLAYER"); if (!((NetworkBehaviour)val).IsOwner) { return true; } Plugin.Log.LogInfo((object)"ITEM IS OWNER"); HoarderBugAI val2 = Util_HoarderBug.FindHoarderBug((GrabbableObject)(object)val); if (val2 == null) { Plugin.Log.LogInfo((object)"NO BUG FOUND"); return false; } Plugin.Log.LogInfo((object)"DROPPING LADDER"); val2.DropItem(((Component)val).GetComponent<NetworkObject>(), ((GrabbableObject)val).GetItemFloorPosition(default(Vector3)), droppingInNest: false); return false; } protected override void __initializeVariables() { ((ModItem)this).__initializeVariables(); } protected internal override string __getTypeName() { return "Mod_ExtensionLadder"; } } public class Mod_StunGrenade : ModItem { public override bool PreItemActivate(bool used, bool buttonDown) { NetworkBehaviour original = ((ModBehaviour)this).Original; StunGrenadeItem val = (StunGrenadeItem)(object)((original is StunGrenadeItem) ? original : null); if (val == null) { return true; } if ((Object)(object)((GrabbableObject)val).playerHeldBy != (Object)null) { return true; } Plugin.Log.LogInfo((object)"ITEM IS NOT HELD BY PLAYER"); if (val.inPullingPinAnimation) { return false; } Plugin.Log.LogInfo((object)"ITEM IS NOT IN PULLING ANIMATION"); if (val.GetPullPinCoroutine() != null) { return false; } Plugin.Log.LogInfo((object)"ITEM HAS NO COROUTINE: STARTING NO PLAYER PULLING PIN ANIMATION"); val.SetPullPinCoroutine(((MonoBehaviour)val).StartCoroutine(val.NoPlayerPullPinAnimation())); return false; } protected override void __initializeVariables() { ((ModItem)this).__initializeVariables(); } protected internal override string __getTypeName() { return "Mod_StunGrenade"; } } }
BepInEx/plugins/notnotnotswipez-MoreCompany/MoreCompany.dll
Decompiled 11 months agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Text; using BepInEx; using BepInEx.Logging; using GameNetcodeStuff; using HarmonyLib; using MoreCompany.Cosmetics; using MoreCompany.Utils; using Steamworks; using Steamworks.Data; using TMPro; using Unity.Netcode; using UnityEngine; using UnityEngine.Audio; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.InputSystem; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("MoreCompany")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("MoreCompany")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("511a1e5e-0611-49f1-b60f-cec69c668fd8")] [assembly: AssemblyFileVersion("1.7.2")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.7.2.0")] namespace MoreCompany { [HarmonyPatch(typeof(AudioMixer), "SetFloat")] public static class AudioMixerSetFloatPatch { public static bool Prefix(string name, float value) { if (name.StartsWith("PlayerVolume") || name.StartsWith("PlayerPitch")) { string s = name.Replace("PlayerVolume", "").Replace("PlayerPitch", ""); int num = int.Parse(s); PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[num]; AudioSource currentVoiceChatAudioSource = val.currentVoiceChatAudioSource; if ((Object)(object)val != (Object)null && Object.op_Implicit((Object)(object)currentVoiceChatAudioSource)) { if (name.StartsWith("PlayerVolume")) { currentVoiceChatAudioSource.volume = value / 16f; } else if (name.StartsWith("PlayerPitch")) { currentVoiceChatAudioSource.pitch = value; } } return false; } return true; } } [HarmonyPatch(typeof(HUDManager), "AddTextToChatOnServer")] public static class SendChatToServerPatch { public static bool Prefix(HUDManager __instance, string chatMessage, int playerId = -1) { if (((NetworkBehaviour)StartOfRound.Instance).IsHost && chatMessage.StartsWith("/mc") && DebugCommandRegistry.commandEnabled) { string text = chatMessage.Replace("/mc ", ""); DebugCommandRegistry.HandleCommand(text.Split(new char[1] { ' ' })); return false; } if (chatMessage.StartsWith("[morecompanycosmetics]")) { ReflectionUtils.InvokeMethod(__instance, "AddPlayerChatMessageServerRpc", new object[2] { chatMessage, 99 }); return false; } return true; } } [HarmonyPatch(typeof(HUDManager), "AddPlayerChatMessageServerRpc")] public static class ServerReceiveMessagePatch { public static string previousDataMessage = ""; public static bool Prefix(HUDManager __instance, ref string chatMessage, int playerId) { NetworkManager networkManager = ((NetworkBehaviour)__instance).NetworkManager; if ((Object)(object)networkManager == (Object)null || !networkManager.IsListening) { return false; } if (chatMessage.StartsWith("[morecompanycosmetics]") && networkManager.IsServer) { previousDataMessage = chatMessage; chatMessage = "[replacewithdata]"; } return true; } } [HarmonyPatch(typeof(PlayerControllerB), "ConnectClientToPlayerObject")] public static class ConnectClientToPlayerObjectPatch { public static void Postfix(PlayerControllerB __instance) { string text = "[morecompanycosmetics]"; text = text + ";" + __instance.playerClientId; foreach (string locallySelectedCosmetic in CosmeticRegistry.locallySelectedCosmetics) { text = text + ";" + locallySelectedCosmetic; } HUDManager.Instance.AddTextToChatOnServer(text, -1); } } [HarmonyPatch(typeof(HUDManager), "AddChatMessage")] public static class AddChatMessagePatch { public static bool Prefix(HUDManager __instance, string chatMessage, string nameOfUserWhoTyped = "") { if (chatMessage.StartsWith("[replacewithdata]") || chatMessage.StartsWith("[morecompanycosmetics]")) { return false; } return true; } } [HarmonyPatch(typeof(HUDManager), "AddPlayerChatMessageClientRpc")] public static class ClientReceiveMessagePatch { public static bool ignoreSample; public static bool Prefix(HUDManager __instance, ref string chatMessage, int playerId) { NetworkManager networkManager = ((NetworkBehaviour)__instance).NetworkManager; if ((Object)(object)networkManager == (Object)null || !networkManager.IsListening) { return false; } if (networkManager.IsServer) { if (chatMessage.StartsWith("[replacewithdata]")) { chatMessage = ServerReceiveMessagePatch.previousDataMessage; HandleDataMessage(chatMessage); } else if (chatMessage.StartsWith("[morecompanycosmetics]")) { return false; } } else if (chatMessage.StartsWith("[morecompanycosmetics]")) { HandleDataMessage(chatMessage); } return true; } private static void HandleDataMessage(string chatMessage) { //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) if (ignoreSample) { return; } chatMessage = chatMessage.Replace("[morecompanycosmetics]", ""); string[] array = chatMessage.Split(new char[1] { ';' }); string text = array[1]; int num = int.Parse(text); CosmeticApplication component = ((Component)((Component)StartOfRound.Instance.allPlayerScripts[num]).transform.Find("ScavengerModel").Find("metarig")).gameObject.GetComponent<CosmeticApplication>(); if (Object.op_Implicit((Object)(object)component)) { component.ClearCosmetics(); Object.Destroy((Object)(object)component); } CosmeticApplication cosmeticApplication = ((Component)((Component)StartOfRound.Instance.allPlayerScripts[num]).transform.Find("ScavengerModel").Find("metarig")).gameObject.AddComponent<CosmeticApplication>(); cosmeticApplication.ClearCosmetics(); List<string> list = new List<string>(); string[] array2 = array; foreach (string text2 in array2) { if (!(text2 == text)) { list.Add(text2); if (MainClass.showCosmetics) { cosmeticApplication.ApplyCosmetic(text2, startEnabled: true); } } } if (num == StartOfRound.Instance.thisClientPlayerId) { cosmeticApplication.ClearCosmetics(); } foreach (CosmeticInstance spawnedCosmetic in cosmeticApplication.spawnedCosmetics) { Transform transform = ((Component)spawnedCosmetic).transform; transform.localScale *= 0.38f; } MainClass.playerIdsAndCosmetics.Remove(num); MainClass.playerIdsAndCosmetics.Add(num, list); if (!GameNetworkManager.Instance.isHostingGame || num == 0) { return; } ignoreSample = true; foreach (KeyValuePair<int, List<string>> playerIdsAndCosmetic in MainClass.playerIdsAndCosmetics) { string text3 = "[morecompanycosmetics]"; text3 = text3 + ";" + playerIdsAndCosmetic.Key; foreach (string item in playerIdsAndCosmetic.Value) { text3 = text3 + ";" + item; } HUDManager.Instance.AddTextToChatOnServer(text3, -1); } ignoreSample = false; } } public class DebugCommandRegistry { public static bool commandEnabled; public static void HandleCommand(string[] args) { //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_026f: Unknown result type (might be due to invalid IL or missing references) //IL_027a: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_0289: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Unknown result type (might be due to invalid IL or missing references) if (!commandEnabled) { return; } PlayerControllerB localPlayerController = StartOfRound.Instance.localPlayerController; switch (args[0]) { case "money": { int groupCredits = int.Parse(args[1]); Terminal val5 = Resources.FindObjectsOfTypeAll<Terminal>().First(); val5.groupCredits = groupCredits; break; } case "spawnscrap": { string text = ""; for (int i = 1; i < args.Length; i++) { text = text + args[i] + " "; } text = text.Trim(); Vector3 val = ((Component)localPlayerController).transform.position + ((Component)localPlayerController).transform.forward * 2f; SpawnableItemWithRarity val2 = null; foreach (SpawnableItemWithRarity item in StartOfRound.Instance.currentLevel.spawnableScrap) { if (item.spawnableItem.itemName.ToLower() == text.ToLower()) { val2 = item; break; } } GameObject val3 = Object.Instantiate<GameObject>(val2.spawnableItem.spawnPrefab, val, Quaternion.identity, (Transform)null); GrabbableObject component = val3.GetComponent<GrabbableObject>(); ((Component)component).transform.rotation = Quaternion.Euler(component.itemProperties.restingRotation); component.fallTime = 0f; NetworkObject component2 = val3.GetComponent<NetworkObject>(); component2.Spawn(false); break; } case "spawnenemy": { string text2 = ""; for (int j = 1; j < args.Length; j++) { text2 = text2 + args[j] + " "; } text2 = text2.Trim(); SpawnableEnemyWithRarity val4 = null; foreach (SpawnableEnemyWithRarity enemy in StartOfRound.Instance.currentLevel.Enemies) { if (enemy.enemyType.enemyName.ToLower() == text2.ToLower()) { val4 = enemy; break; } } RoundManager.Instance.SpawnEnemyGameObject(((Component)localPlayerController).transform.position + ((Component)localPlayerController).transform.forward * 2f, 0f, -1, val4.enemyType); break; } case "listall": MainClass.StaticLogger.LogInfo((object)"Spawnable scrap:"); foreach (SpawnableItemWithRarity item2 in StartOfRound.Instance.currentLevel.spawnableScrap) { MainClass.StaticLogger.LogInfo((object)item2.spawnableItem.itemName); } MainClass.StaticLogger.LogInfo((object)"Spawnable enemies:"); { foreach (SpawnableEnemyWithRarity enemy2 in StartOfRound.Instance.currentLevel.Enemies) { MainClass.StaticLogger.LogInfo((object)enemy2.enemyType.enemyName); } break; } } } } [HarmonyPatch(typeof(ForestGiantAI), "LookForPlayers")] public static class LookForPlayersForestGiantPatch { public static void Prefix(ForestGiantAI __instance) { if (__instance.playerStealthMeters.Length != MainClass.newPlayerCount) { __instance.playerStealthMeters = new float[MainClass.newPlayerCount]; for (int i = 0; i < MainClass.newPlayerCount; i++) { __instance.playerStealthMeters[i] = 0f; } } } } [HarmonyPatch(typeof(SpringManAI), "Update")] public static class SpringManAIUpdatePatch { public static bool Prefix(SpringManAI __instance, ref float ___timeSinceHittingPlayer, ref float ___stopAndGoMinimumInterval, ref bool ___wasOwnerLastFrame, ref bool ___stoppingMovement, ref float ___currentChaseSpeed, ref bool ___hasStopped, ref float ___currentAnimSpeed, ref float ___updateDestinationInterval, ref Vector3 ___tempVelocity, ref float ___targetYRotation, ref float ___setDestinationToPlayerInterval, ref float ___previousYRotation) { //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) UpdateBase((EnemyAI)(object)__instance, ref ___updateDestinationInterval, ref ___tempVelocity, ref ___targetYRotation, ref ___setDestinationToPlayerInterval, ref ___previousYRotation); if (((EnemyAI)__instance).isEnemyDead) { return false; } int currentBehaviourStateIndex = ((EnemyAI)__instance).currentBehaviourStateIndex; if (currentBehaviourStateIndex != 0 && currentBehaviourStateIndex == 1) { if (___timeSinceHittingPlayer >= 0f) { ___timeSinceHittingPlayer -= Time.deltaTime; } if (((NetworkBehaviour)__instance).IsOwner) { if (___stopAndGoMinimumInterval > 0f) { ___stopAndGoMinimumInterval -= Time.deltaTime; } if (!___wasOwnerLastFrame) { ___wasOwnerLastFrame = true; if (!___stoppingMovement && ___timeSinceHittingPlayer < 0.12f) { ((EnemyAI)__instance).agent.speed = ___currentChaseSpeed; } else { ((EnemyAI)__instance).agent.speed = 0f; } } bool flag = false; for (int i = 0; i < MainClass.newPlayerCount; i++) { if (((EnemyAI)__instance).PlayerIsTargetable(StartOfRound.Instance.allPlayerScripts[i], false, false) && StartOfRound.Instance.allPlayerScripts[i].HasLineOfSightToPosition(((Component)__instance).transform.position + Vector3.up * 1.6f, 68f, 60, -1f) && Vector3.Distance(((Component)StartOfRound.Instance.allPlayerScripts[i].gameplayCamera).transform.position, ((EnemyAI)__instance).eye.position) > 0.3f) { flag = true; } } if (((EnemyAI)__instance).stunNormalizedTimer > 0f) { flag = true; } if (flag != ___stoppingMovement && ___stopAndGoMinimumInterval <= 0f) { ___stopAndGoMinimumInterval = 0.15f; if (flag) { __instance.SetAnimationStopServerRpc(); } else { __instance.SetAnimationGoServerRpc(); } ___stoppingMovement = flag; } } if (___stoppingMovement) { if (__instance.animStopPoints.canAnimationStop) { if (!___hasStopped) { ___hasStopped = true; __instance.mainCollider.isTrigger = false; if (GameNetworkManager.Instance.localPlayerController.HasLineOfSightToPosition(((Component)__instance).transform.position, 70f, 25, -1f)) { float num = Vector3.Distance(((Component)__instance).transform.position, ((Component)GameNetworkManager.Instance.localPlayerController).transform.position); if (num < 4f) { GameNetworkManager.Instance.localPlayerController.JumpToFearLevel(0.9f, true); } else if (num < 9f) { GameNetworkManager.Instance.localPlayerController.JumpToFearLevel(0.4f, true); } } if (___currentAnimSpeed > 2f) { RoundManager.PlayRandomClip(((EnemyAI)__instance).creatureVoice, __instance.springNoises, false, 1f, 0); if (__instance.animStopPoints.animationPosition == 1) { ((EnemyAI)__instance).creatureAnimator.SetTrigger("springBoing"); } else { ((EnemyAI)__instance).creatureAnimator.SetTrigger("springBoingPosition2"); } } } ((EnemyAI)__instance).creatureAnimator.SetFloat("walkSpeed", 0f); ___currentAnimSpeed = 0f; if (((NetworkBehaviour)__instance).IsOwner) { ((EnemyAI)__instance).agent.speed = 0f; return false; } } } else { if (___hasStopped) { ___hasStopped = false; __instance.mainCollider.isTrigger = true; } ___currentAnimSpeed = Mathf.Lerp(___currentAnimSpeed, 6f, 5f * Time.deltaTime); ((EnemyAI)__instance).creatureAnimator.SetFloat("walkSpeed", ___currentAnimSpeed); if (((NetworkBehaviour)__instance).IsOwner) { ((EnemyAI)__instance).agent.speed = Mathf.Lerp(((EnemyAI)__instance).agent.speed, ___currentChaseSpeed, 4.5f * Time.deltaTime); } } } return false; } private static void UpdateBase(EnemyAI __instance, ref float updateDestinationInterval, ref Vector3 tempVelocity, ref float targetYRotation, ref float setDestinationToPlayerInterval, ref float previousYRotation) { //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0255: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_027e: Unknown result type (might be due to invalid IL or missing references) //IL_028e: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02ba: Unknown result type (might be due to invalid IL or missing references) //IL_0393: Unknown result type (might be due to invalid IL or missing references) //IL_03b3: Unknown result type (might be due to invalid IL or missing references) //IL_03bd: Unknown result type (might be due to invalid IL or missing references) //IL_03c2: Unknown result type (might be due to invalid IL or missing references) //IL_0364: Unknown result type (might be due to invalid IL or missing references) //IL_036e: Unknown result type (might be due to invalid IL or missing references) //IL_0379: Unknown result type (might be due to invalid IL or missing references) //IL_037e: Unknown result type (might be due to invalid IL or missing references) //IL_0425: Unknown result type (might be due to invalid IL or missing references) //IL_0454: Unknown result type (might be due to invalid IL or missing references) if (__instance.enemyType.isDaytimeEnemy && !__instance.daytimeEnemyLeaving) { ReflectionUtils.InvokeMethod(__instance, typeof(EnemyAI), "CheckTimeOfDayToLeave", null); } if (__instance.stunnedIndefinitely <= 0) { if ((double)__instance.stunNormalizedTimer >= 0.0) { __instance.stunNormalizedTimer -= Time.deltaTime / __instance.enemyType.stunTimeMultiplier; } else { __instance.stunnedByPlayer = null; if ((double)__instance.postStunInvincibilityTimer >= 0.0) { __instance.postStunInvincibilityTimer -= Time.deltaTime * 5f; } } } if (!__instance.ventAnimationFinished && (double)__instance.timeSinceSpawn < (double)__instance.exitVentAnimationTime + 0.004999999888241291 * (double)RoundManager.Instance.numberOfEnemiesInScene) { __instance.timeSinceSpawn += Time.deltaTime; if (!((NetworkBehaviour)__instance).IsOwner) { Vector3 serverPosition = __instance.serverPosition; if (__instance.serverPosition != Vector3.zero) { ((Component)__instance).transform.position = __instance.serverPosition; ((Component)__instance).transform.eulerAngles = new Vector3(((Component)__instance).transform.eulerAngles.x, targetYRotation, ((Component)__instance).transform.eulerAngles.z); } } else if ((double)updateDestinationInterval >= 0.0) { updateDestinationInterval -= Time.deltaTime; } else { __instance.SyncPositionToClients(); updateDestinationInterval = 0.1f; } return; } if (!__instance.ventAnimationFinished) { __instance.ventAnimationFinished = true; if ((Object)(object)__instance.creatureAnimator != (Object)null) { __instance.creatureAnimator.SetBool("inSpawningAnimation", false); } } if (!((NetworkBehaviour)__instance).IsOwner) { if (__instance.currentSearch.inProgress) { __instance.StopSearch(__instance.currentSearch, true); } __instance.SetClientCalculatingAI(false); if (!__instance.inSpecialAnimation) { ((Component)__instance).transform.position = Vector3.SmoothDamp(((Component)__instance).transform.position, __instance.serverPosition, ref tempVelocity, __instance.syncMovementSpeed); ((Component)__instance).transform.eulerAngles = new Vector3(((Component)__instance).transform.eulerAngles.x, Mathf.LerpAngle(((Component)__instance).transform.eulerAngles.y, targetYRotation, 15f * Time.deltaTime), ((Component)__instance).transform.eulerAngles.z); } __instance.timeSinceSpawn += Time.deltaTime; return; } if (__instance.isEnemyDead) { __instance.SetClientCalculatingAI(false); return; } if (!__instance.inSpecialAnimation) { __instance.SetClientCalculatingAI(true); } if (__instance.movingTowardsTargetPlayer && (Object)(object)__instance.targetPlayer != (Object)null) { if ((double)setDestinationToPlayerInterval <= 0.0) { setDestinationToPlayerInterval = 0.25f; __instance.destination = RoundManager.Instance.GetNavMeshPosition(((Component)__instance.targetPlayer).transform.position, RoundManager.Instance.navHit, 2.7f, -1); } else { __instance.destination = new Vector3(((Component)__instance.targetPlayer).transform.position.x, __instance.destination.y, ((Component)__instance.targetPlayer).transform.position.z); setDestinationToPlayerInterval -= Time.deltaTime; } } if (__instance.inSpecialAnimation) { return; } if ((double)updateDestinationInterval >= 0.0) { updateDestinationInterval -= Time.deltaTime; } else { __instance.DoAIInterval(); updateDestinationInterval = __instance.AIIntervalTime; } if (!((double)Mathf.Abs(previousYRotation - ((Component)__instance).transform.eulerAngles.y) <= 6.0)) { previousYRotation = ((Component)__instance).transform.eulerAngles.y; targetYRotation = previousYRotation; if (((NetworkBehaviour)__instance).IsServer) { ReflectionUtils.InvokeMethod(__instance, typeof(EnemyAI), "UpdateEnemyRotationClientRpc", new object[1] { (short)previousYRotation }); } else { ReflectionUtils.InvokeMethod(__instance, typeof(EnemyAI), "UpdateEnemyRotationServerRpc", new object[1] { (short)previousYRotation }); } } } } [HarmonyPatch(typeof(SpringManAI), "DoAIInterval")] public static class SpringManAIIntervalPatch { public static bool Prefix(SpringManAI __instance) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) if (((EnemyAI)__instance).moveTowardsDestination) { ((EnemyAI)__instance).agent.SetDestination(((EnemyAI)__instance).destination); } ((EnemyAI)__instance).SyncPositionToClients(); if (StartOfRound.Instance.allPlayersDead) { return false; } if (((EnemyAI)__instance).isEnemyDead) { return false; } switch (((EnemyAI)__instance).currentBehaviourStateIndex) { default: return false; case 1: if (__instance.searchForPlayers.inProgress) { ((EnemyAI)__instance).StopSearch(__instance.searchForPlayers, true); } if (((EnemyAI)__instance).TargetClosestPlayer(1.5f, false, 70f)) { PlayerControllerB fieldValue = ReflectionUtils.GetFieldValue<PlayerControllerB>(__instance, "previousTarget"); if ((Object)(object)fieldValue != (Object)(object)((EnemyAI)__instance).targetPlayer) { ReflectionUtils.SetFieldValue(__instance, "previousTarget", ((EnemyAI)__instance).targetPlayer); ((EnemyAI)__instance).ChangeOwnershipOfEnemy(((EnemyAI)__instance).targetPlayer.actualClientId); } ((EnemyAI)__instance).movingTowardsTargetPlayer = true; return false; } ((EnemyAI)__instance).SwitchToBehaviourState(0); ((EnemyAI)__instance).ChangeOwnershipOfEnemy(StartOfRound.Instance.allPlayerScripts[0].actualClientId); break; case 0: { if (!((NetworkBehaviour)__instance).IsServer) { ((EnemyAI)__instance).ChangeOwnershipOfEnemy(StartOfRound.Instance.allPlayerScripts[0].actualClientId); return false; } for (int i = 0; i < StartOfRound.Instance.allPlayerScripts.Length; i++) { if (((EnemyAI)__instance).PlayerIsTargetable(StartOfRound.Instance.allPlayerScripts[i], false, false) && !Physics.Linecast(((Component)__instance).transform.position + Vector3.up * 0.5f, ((Component)StartOfRound.Instance.allPlayerScripts[i].gameplayCamera).transform.position, StartOfRound.Instance.collidersAndRoomMaskAndDefault) && Vector3.Distance(((Component)__instance).transform.position, ((Component)StartOfRound.Instance.allPlayerScripts[i]).transform.position) < 30f) { ((EnemyAI)__instance).SwitchToBehaviourState(1); return false; } } if (!__instance.searchForPlayers.inProgress) { ((EnemyAI)__instance).movingTowardsTargetPlayer = false; ((EnemyAI)__instance).StartSearch(((Component)__instance).transform.position, __instance.searchForPlayers); return false; } break; } } return false; } } [HarmonyPatch(typeof(EnemyAI), "GetClosestPlayer")] public static class GetClosestPlayerPatch { public static bool Prefix(EnemyAI __instance, ref PlayerControllerB __result, bool requireLineOfSight = false, bool cannotBeInShip = false, bool cannotBeNearShip = false) { //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB val = null; __instance.mostOptimalDistance = 2000f; for (int i = 0; i < StartOfRound.Instance.allPlayerScripts.Length; i++) { if (!__instance.PlayerIsTargetable(StartOfRound.Instance.allPlayerScripts[i], cannotBeInShip, false)) { continue; } if (cannotBeNearShip) { if (StartOfRound.Instance.allPlayerScripts[i].isInElevator) { continue; } bool flag = false; for (int j = 0; j < RoundManager.Instance.spawnDenialPoints.Length; j++) { if (Vector3.Distance(RoundManager.Instance.spawnDenialPoints[j].transform.position, ((Component)StartOfRound.Instance.allPlayerScripts[i]).transform.position) < 10f) { flag = true; break; } } if (flag) { continue; } } if (!requireLineOfSight || !Physics.Linecast(((Component)__instance).transform.position, ((Component)StartOfRound.Instance.allPlayerScripts[i]).transform.position, 256)) { __instance.tempDist = Vector3.Distance(((Component)__instance).transform.position, ((Component)StartOfRound.Instance.allPlayerScripts[i]).transform.position); if (__instance.tempDist < __instance.mostOptimalDistance) { __instance.mostOptimalDistance = __instance.tempDist; val = StartOfRound.Instance.allPlayerScripts[i]; } } } __result = val; return false; } } [HarmonyPatch(typeof(EnemyAI), "GetAllPlayersInLineOfSight")] public static class GetAllPlayersInLineOfSightPatch { public static bool Prefix(EnemyAI __instance, ref PlayerControllerB[] __result, float width = 45f, int range = 60, Transform eyeObject = null, float proximityCheck = -1f, int layerMask = -1) { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Invalid comparison between Unknown and I4 //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) if (layerMask == -1) { layerMask = StartOfRound.Instance.collidersAndRoomMaskAndDefault; } if ((Object)(object)eyeObject == (Object)null) { eyeObject = __instance.eye; } if (__instance.enemyType.isOutsideEnemy && !__instance.enemyType.canSeeThroughFog && (int)TimeOfDay.Instance.currentLevelWeather == 3) { range = Mathf.Clamp(range, 0, 30); } List<PlayerControllerB> list = new List<PlayerControllerB>(MainClass.newPlayerCount); for (int i = 0; i < StartOfRound.Instance.allPlayerScripts.Length; i++) { if (!__instance.PlayerIsTargetable(StartOfRound.Instance.allPlayerScripts[i], false, false)) { continue; } Vector3 position = ((Component)StartOfRound.Instance.allPlayerScripts[i].gameplayCamera).transform.position; if (Vector3.Distance(__instance.eye.position, position) < (float)range && !Physics.Linecast(eyeObject.position, position, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1)) { Vector3 val = position - eyeObject.position; if (Vector3.Angle(eyeObject.forward, val) < width || Vector3.Distance(((Component)__instance).transform.position, ((Component)StartOfRound.Instance.allPlayerScripts[i]).transform.position) < proximityCheck) { list.Add(StartOfRound.Instance.allPlayerScripts[i]); } } } if (list.Count == MainClass.newPlayerCount) { __result = StartOfRound.Instance.allPlayerScripts; return false; } if (list.Count > 0) { __result = list.ToArray(); return false; } __result = null; return false; } } [HarmonyPatch(typeof(DressGirlAI), "ChoosePlayerToHaunt")] public static class DressGirlHauntPatch { public static bool Prefix(DressGirlAI __instance) { ReflectionUtils.SetFieldValue(__instance, "timesChoosingAPlayer", ReflectionUtils.GetFieldValue<int>(__instance, "timesChoosingAPlayer") + 1); if (ReflectionUtils.GetFieldValue<int>(__instance, "timesChoosingAPlayer") > 1) { __instance.timer = __instance.hauntInterval - 1f; } __instance.SFXVolumeLerpTo = 0f; ((EnemyAI)__instance).creatureVoice.Stop(); __instance.heartbeatMusic.volume = 0f; if (!ReflectionUtils.GetFieldValue<bool>(__instance, "initializedRandomSeed")) { ReflectionUtils.SetFieldValue(__instance, "ghostGirlRandom", new Random(StartOfRound.Instance.randomMapSeed + 158)); } float num = 0f; float num2 = 0f; int num3 = 0; int num4 = 0; for (int i = 0; i < MainClass.newPlayerCount; i++) { if (StartOfRound.Instance.gameStats.allPlayerStats[i].turnAmount > num3) { num3 = StartOfRound.Instance.gameStats.allPlayerStats[i].turnAmount; num4 = i; } if (StartOfRound.Instance.allPlayerScripts[i].insanityLevel > num) { num = StartOfRound.Instance.allPlayerScripts[i].insanityLevel; num2 = i; } } int[] array = new int[MainClass.newPlayerCount]; for (int j = 0; j < MainClass.newPlayerCount; j++) { if (!StartOfRound.Instance.allPlayerScripts[j].isPlayerControlled) { array[j] = 0; continue; } array[j] += 80; if (num2 == (float)j && num > 1f) { array[j] += 50; } if (num4 == j) { array[j] += 30; } if (!StartOfRound.Instance.allPlayerScripts[j].hasBeenCriticallyInjured) { array[j] += 10; } if ((Object)(object)StartOfRound.Instance.allPlayerScripts[j].currentlyHeldObjectServer != (Object)null && StartOfRound.Instance.allPlayerScripts[j].currentlyHeldObjectServer.scrapValue > 150) { array[j] += 30; } } __instance.hauntingPlayer = StartOfRound.Instance.allPlayerScripts[RoundManager.Instance.GetRandomWeightedIndex(array, ReflectionUtils.GetFieldValue<Random>(__instance, "ghostGirlRandom"))]; if (__instance.hauntingPlayer.isPlayerDead) { for (int k = 0; k < StartOfRound.Instance.allPlayerScripts.Length; k++) { if (!StartOfRound.Instance.allPlayerScripts[k].isPlayerDead) { __instance.hauntingPlayer = StartOfRound.Instance.allPlayerScripts[k]; break; } } } Debug.Log((object)$"Little girl: Haunting player with playerClientId: {__instance.hauntingPlayer.playerClientId}; actualClientId: {__instance.hauntingPlayer.actualClientId}"); ((EnemyAI)__instance).ChangeOwnershipOfEnemy(__instance.hauntingPlayer.actualClientId); __instance.hauntingLocalPlayer = (Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)(object)__instance.hauntingPlayer; if (ReflectionUtils.GetFieldValue<Coroutine>(__instance, "switchHauntedPlayerCoroutine") != null) { ((MonoBehaviour)__instance).StopCoroutine(ReflectionUtils.GetFieldValue<Coroutine>(__instance, "switchHauntedPlayerCoroutine")); } ReflectionUtils.SetFieldValue(__instance, "switchHauntedPlayerCoroutine", ((MonoBehaviour)__instance).StartCoroutine(ReflectionUtils.InvokeMethod<IEnumerator>(__instance, "setSwitchingHauntingPlayer", null))); return false; } } [HarmonyPatch(typeof(HUDManager), "AddChatMessage")] public static class HudChatPatch { public static void Prefix(HUDManager __instance, ref string chatMessage, string nameOfUserWhoTyped = "") { if (!(__instance.lastChatMessage == chatMessage)) { StringBuilder stringBuilder = new StringBuilder(chatMessage); for (int i = 0; i < MainClass.newPlayerCount; i++) { string oldValue = $"[playerNum{i}]"; string playerUsername = StartOfRound.Instance.allPlayerScripts[i].playerUsername; stringBuilder.Replace(oldValue, playerUsername); } chatMessage = stringBuilder.ToString(); } } } [HarmonyPatch(typeof(MenuManager), "Awake")] public static class MenuManagerLogoOverridePatch { public static void Postfix(MenuManager __instance) { //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) try { GameObject gameObject = ((Component)((Component)__instance).transform.parent).gameObject; GameObject gameObject2 = ((Component)gameObject.transform.Find("MenuContainer").Find("MainButtons").Find("HeaderImage")).gameObject; Image component = gameObject2.GetComponent<Image>(); MainClass.ReadSettingsFromFile(); component.sprite = Sprite.Create(MainClass.mainLogo, new Rect(0f, 0f, (float)((Texture)MainClass.mainLogo).width, (float)((Texture)MainClass.mainLogo).height), new Vector2(0.5f, 0.5f)); CosmeticRegistry.SpawnCosmeticGUI(); Transform val = gameObject.transform.Find("MenuContainer").Find("LobbyHostSettings").Find("Panel") .Find("LobbyHostOptions") .Find("OptionsNormal"); GameObject val2 = Object.Instantiate<GameObject>(MainClass.crewCountUI, val); RectTransform component2 = val2.GetComponent<RectTransform>(); ((Transform)component2).localPosition = new Vector3(96.9f, -70f, -6.7f); TMP_InputField inputField = ((Component)val2.transform.Find("InputField (TMP)")).GetComponent<TMP_InputField>(); inputField.characterLimit = 3; inputField.text = MainClass.newPlayerCount.ToString(); ((UnityEvent<string>)(object)inputField.onValueChanged).AddListener((UnityAction<string>)delegate(string s) { if (int.TryParse(s, out var result)) { MainClass.newPlayerCount = result; MainClass.newPlayerCount = Mathf.Clamp(MainClass.newPlayerCount, 1, MainClass.maxPlayerCount); inputField.text = MainClass.newPlayerCount.ToString(); MainClass.SaveSettingsToFile(); } else if (s.Length != 0) { inputField.text = MainClass.newPlayerCount.ToString(); inputField.caretPosition = 1; } }); } catch (Exception) { } } } [HarmonyPatch(typeof(QuickMenuManager), "AddUserToPlayerList")] public static class AddUserPlayerListPatch { public static bool Prefix(QuickMenuManager __instance, ulong steamId, string playerName, int playerObjectId) { QuickmenuVisualInjectPatch.PopulateQuickMenu(__instance); MainClass.EnablePlayerObjectsBasedOnConnected(); return false; } } [HarmonyPatch(typeof(QuickMenuManager), "RemoveUserFromPlayerList")] public static class RemoveUserPlayerListPatch { public static bool Prefix(QuickMenuManager __instance) { QuickmenuVisualInjectPatch.PopulateQuickMenu(__instance); return false; } } [HarmonyPatch(typeof(QuickMenuManager), "Update")] public static class QuickMenuUpdatePatch { public static bool Prefix(QuickMenuManager __instance) { return false; } } [HarmonyPatch(typeof(QuickMenuManager), "NonHostPlayerSlotsEnabled")] public static class QuickMenuDisplayPatch { public static bool Prefix(QuickMenuManager __instance, ref bool __result) { __result = true; return false; } } [HarmonyPatch(typeof(QuickMenuManager), "Start")] public static class QuickmenuVisualInjectPatch { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static UnityAction <>9__2_2; internal void <PopulateQuickMenu>b__2_2() { if (!GameNetworkManager.Instance.disableSteam) { } } } public static GameObject quickMenuScrollInstance; public static void Postfix(QuickMenuManager __instance) { //IL_0050: 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) GameObject gameObject = ((Component)__instance.playerListPanel.transform.Find("Image")).gameObject; GameObject val = Object.Instantiate<GameObject>(MainClass.quickMenuScrollParent); val.transform.SetParent(gameObject.transform); RectTransform component = val.GetComponent<RectTransform>(); ((Transform)component).localPosition = new Vector3(0f, -31.2f, 0f); ((Transform)component).localScale = Vector3.one; quickMenuScrollInstance = val; } public static void PopulateQuickMenu(QuickMenuManager __instance) { //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Expected O, but got Unknown //IL_02d8: Unknown result type (might be due to invalid IL or missing references) //IL_02dd: Unknown result type (might be due to invalid IL or missing references) //IL_02e3: Expected O, but got Unknown int childCount = quickMenuScrollInstance.transform.Find("Holder").childCount; List<GameObject> list = new List<GameObject>(); for (int i = 0; i < childCount; i++) { list.Add(((Component)quickMenuScrollInstance.transform.Find("Holder").GetChild(i)).gameObject); } foreach (GameObject item in list) { Object.Destroy((Object)(object)item); } if (!Object.op_Implicit((Object)(object)StartOfRound.Instance)) { return; } for (int j = 0; j < StartOfRound.Instance.allPlayerScripts.Length; j++) { PlayerControllerB playerScript = StartOfRound.Instance.allPlayerScripts[j]; if (!playerScript.isPlayerControlled && !playerScript.isPlayerDead) { continue; } GameObject val = Object.Instantiate<GameObject>(MainClass.playerEntry, quickMenuScrollInstance.transform.Find("Holder")); RectTransform component = val.GetComponent<RectTransform>(); ((Transform)component).localScale = Vector3.one; ((Transform)component).localPosition = new Vector3(0f, 0f - ((Transform)component).localPosition.y, 0f); TextMeshProUGUI component2 = ((Component)val.transform.Find("PlayerNameButton").Find("PName")).GetComponent<TextMeshProUGUI>(); ((TMP_Text)component2).text = playerScript.playerUsername; Slider playerVolume = ((Component)val.transform.Find("PlayerVolumeSlider")).GetComponent<Slider>(); int finalIndex = j; ((UnityEvent<float>)(object)playerVolume.onValueChanged).AddListener((UnityAction<float>)delegate(float f) { if (playerScript.isPlayerControlled || playerScript.isPlayerDead) { float num = f / playerVolume.maxValue + 1f; if (num <= -1f) { SoundManager.Instance.playerVoiceVolumes[finalIndex] = -70f; } else { SoundManager.Instance.playerVoiceVolumes[finalIndex] = num; } } }); if (StartOfRound.Instance.localPlayerController.playerClientId == playerScript.playerClientId) { ((Component)playerVolume).gameObject.SetActive(false); ((Component)val.transform.Find("Text (1)")).gameObject.SetActive(false); } Button component3 = ((Component)val.transform.Find("KickButton")).GetComponent<Button>(); ((UnityEvent)component3.onClick).AddListener((UnityAction)delegate { __instance.KickUserFromServer(finalIndex); }); if (!GameNetworkManager.Instance.isHostingGame) { ((Component)component3).gameObject.SetActive(false); } Button component4 = ((Component)val.transform.Find("ProfileIcon")).GetComponent<Button>(); ButtonClickedEvent onClick = component4.onClick; object obj = <>c.<>9__2_2; if (obj == null) { UnityAction val2 = delegate { if (!GameNetworkManager.Instance.disableSteam) { } }; <>c.<>9__2_2 = val2; obj = (object)val2; } ((UnityEvent)onClick).AddListener((UnityAction)obj); } } } [HarmonyPatch(typeof(HUDManager), "UpdateBoxesSpectateUI")] public static class SpectatorBoxUpdatePatch { public static void Postfix(HUDManager __instance) { //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) Dictionary<Animator, PlayerControllerB> fieldValue = ReflectionUtils.GetFieldValue<Dictionary<Animator, PlayerControllerB>>(__instance, "spectatingPlayerBoxes"); int num = -64; int num2 = 0; int num3 = 0; int num4 = -70; int num5 = 230; int num6 = 4; foreach (KeyValuePair<Animator, PlayerControllerB> item in fieldValue) { if (((Component)item.Key).gameObject.activeInHierarchy) { GameObject gameObject = ((Component)item.Key).gameObject; RectTransform component = gameObject.GetComponent<RectTransform>(); int num7 = (int)Math.Floor((double)num3 / (double)num6); int num8 = num3 % num6; int num9 = num8 * num4; int num10 = num7 * num5; component.anchoredPosition = Vector2.op_Implicit(new Vector3((float)(num + num10), (float)(num2 + num9), 0f)); num3++; } } } } [HarmonyPatch(typeof(HUDManager), "FillEndGameStats")] public static class HudFillEndGameFix { public static bool Prefix(HUDManager __instance, EndOfGameStats stats) { //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Invalid comparison between Unknown and I4 int num = 0; int num2 = 0; for (int i = 0; i < __instance.statsUIElements.playerNamesText.Length; i++) { PlayerControllerB val = __instance.playersManager.allPlayerScripts[i]; ((TMP_Text)__instance.statsUIElements.playerNamesText[i]).text = ""; ((Behaviour)__instance.statsUIElements.playerStates[i]).enabled = false; ((TMP_Text)__instance.statsUIElements.playerNotesText[i]).text = "Notes: \n"; if (val.disconnectedMidGame || val.isPlayerDead || val.isPlayerControlled) { if (val.isPlayerDead) { num++; } else if (val.isPlayerControlled) { num2++; } ((TMP_Text)__instance.statsUIElements.playerNamesText[i]).text = __instance.playersManager.allPlayerScripts[i].playerUsername; ((Behaviour)__instance.statsUIElements.playerStates[i]).enabled = true; if (__instance.playersManager.allPlayerScripts[i].isPlayerDead) { if ((int)__instance.playersManager.allPlayerScripts[i].causeOfDeath == 10) { __instance.statsUIElements.playerStates[i].sprite = __instance.statsUIElements.missingIcon; } else { __instance.statsUIElements.playerStates[i].sprite = __instance.statsUIElements.deceasedIcon; } } else { __instance.statsUIElements.playerStates[i].sprite = __instance.statsUIElements.aliveIcon; } for (int j = 0; j < 3 && j < stats.allPlayerStats[i].playerNotes.Count; j++) { TextMeshProUGUI val2 = __instance.statsUIElements.playerNotesText[i]; ((TMP_Text)val2).text = ((TMP_Text)val2).text + "* " + stats.allPlayerStats[i].playerNotes[j] + "\n"; } } else { ((TMP_Text)__instance.statsUIElements.playerNotesText[i]).text = ""; } } ((TMP_Text)__instance.statsUIElements.quotaNumerator).text = RoundManager.Instance.scrapCollectedInLevel.ToString(); ((TMP_Text)__instance.statsUIElements.quotaDenominator).text = RoundManager.Instance.totalScrapValueInLevel.ToString(); if (StartOfRound.Instance.allPlayersDead) { ((Behaviour)__instance.statsUIElements.allPlayersDeadOverlay).enabled = true; ((TMP_Text)__instance.statsUIElements.gradeLetter).text = "F"; return false; } ((Behaviour)__instance.statsUIElements.allPlayersDeadOverlay).enabled = false; int num3 = 0; float num4 = (float)RoundManager.Instance.scrapCollectedInLevel / RoundManager.Instance.totalScrapValueInLevel; if (num2 == StartOfRound.Instance.connectedPlayersAmount + 1) { num3++; } else if (num > 1) { num3--; } if (num4 >= 0.99f) { num3 += 2; } else if (num4 >= 0.6f) { num3++; } else if (num4 <= 0.25f) { num3--; } switch (num3) { case -1: ((TMP_Text)__instance.statsUIElements.gradeLetter).text = "D"; return false; case 0: ((TMP_Text)__instance.statsUIElements.gradeLetter).text = "C"; return false; case 1: ((TMP_Text)__instance.statsUIElements.gradeLetter).text = "B"; return false; case 2: ((TMP_Text)__instance.statsUIElements.gradeLetter).text = "A"; return false; case 3: ((TMP_Text)__instance.statsUIElements.gradeLetter).text = "S"; return false; default: return false; } } } [HarmonyPatch(typeof(HUDManager), "Start")] public static class HudStartPatch { public static void Postfix(HUDManager __instance) { //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) EndOfGameStatUIElements statsUIElements = __instance.statsUIElements; GameObject gameObject = ((Component)((Component)statsUIElements.playerNamesText[0]).gameObject.transform.parent).gameObject; GameObject gameObject2 = ((Component)gameObject.transform.parent.parent).gameObject; GameObject gameObject3 = ((Component)gameObject2.transform.Find("BGBoxes")).gameObject; gameObject2.transform.parent.Find("DeathScreen").SetSiblingIndex(3); gameObject3.transform.localScale = new Vector3(2.5f, 1f, 1f); MakePlayerHolder(4, gameObject, statsUIElements, new Vector3(426.9556f, -0.7932f, 0f)); MakePlayerHolder(5, gameObject, statsUIElements, new Vector3(426.9556f, -115.4483f, 0f)); MakePlayerHolder(6, gameObject, statsUIElements, new Vector3(-253.6783f, -115.4483f, 0f)); MakePlayerHolder(7, gameObject, statsUIElements, new Vector3(-253.6783f, -0.7932f, 0f)); for (int i = 8; i < MainClass.newPlayerCount; i++) { MakePlayerHolder(i, gameObject, statsUIElements, new Vector3(10000f, 10000f, 0f)); } } public static void MakePlayerHolder(int index, GameObject original, EndOfGameStatUIElements uiElements, Vector3 localPosition) { //IL_0049: 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_009f: Unknown result type (might be due to invalid IL or missing references) if (index + 1 <= MainClass.newPlayerCount) { GameObject val = Object.Instantiate<GameObject>(original); RectTransform component = val.GetComponent<RectTransform>(); RectTransform component2 = original.GetComponent<RectTransform>(); ((Transform)component).SetParent(((Transform)component2).parent); ((Transform)component).localScale = new Vector3(1f, 1f, 1f); ((Transform)component).localPosition = localPosition; GameObject gameObject = ((Component)val.transform.Find("PlayerName1")).gameObject; GameObject gameObject2 = ((Component)val.transform.Find("Notes")).gameObject; ((Transform)gameObject2.GetComponent<RectTransform>()).localPosition = new Vector3(-95.7222f, 43.3303f, 0f); GameObject gameObject3 = ((Component)val.transform.Find("Symbol")).gameObject; if (index >= uiElements.playerNamesText.Length) { Array.Resize(ref uiElements.playerNamesText, index + 1); Array.Resize(ref uiElements.playerStates, index + 1); Array.Resize(ref uiElements.playerNotesText, index + 1); } uiElements.playerNamesText[index] = gameObject.GetComponent<TextMeshProUGUI>(); uiElements.playerNotesText[index] = gameObject2.GetComponent<TextMeshProUGUI>(); uiElements.playerStates[index] = gameObject3.GetComponent<Image>(); } } } public static class PluginInformation { public const string PLUGIN_NAME = "MoreCompany"; public const string PLUGIN_VERSION = "1.7.2"; public const string PLUGIN_GUID = "me.swipez.melonloader.morecompany"; } [BepInPlugin("me.swipez.melonloader.morecompany", "MoreCompany", "1.7.2")] public class MainClass : BaseUnityPlugin { public static int newPlayerCount = 32; public static int maxPlayerCount = 50; public static bool showCosmetics = true; public static List<PlayerControllerB> notSupposedToExistPlayers = new List<PlayerControllerB>(); public static Texture2D mainLogo; public static GameObject quickMenuScrollParent; public static GameObject playerEntry; public static GameObject crewCountUI; public static GameObject cosmeticGUIInstance; public static GameObject cosmeticButton; public static ManualLogSource StaticLogger; public static Dictionary<int, List<string>> playerIdsAndCosmetics = new Dictionary<int, List<string>>(); public static string cosmeticSavePath = Application.persistentDataPath + "/morecompanycosmetics.txt"; public static string moreCompanySave = Application.persistentDataPath + "/morecompanysave.txt"; public static string dynamicCosmeticsPath = Paths.PluginPath + "/MoreCompanyCosmetics"; private void Awake() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown StaticLogger = ((BaseUnityPlugin)this).Logger; Harmony val = new Harmony("me.swipez.melonloader.morecompany"); try { val.PatchAll(); } catch (Exception ex) { StaticLogger.LogError((object)("Failed to patch: " + ex)); } ManualHarmonyPatches.ManualPatch(val); StaticLogger.LogInfo((object)"Loading MoreCompany..."); StaticLogger.LogInfo((object)("Checking: " + dynamicCosmeticsPath)); if (!Directory.Exists(dynamicCosmeticsPath)) { StaticLogger.LogInfo((object)"Creating cosmetics directory"); Directory.CreateDirectory(dynamicCosmeticsPath); } ReadSettingsFromFile(); ReadCosmeticsFromFile(); StaticLogger.LogInfo((object)"Read settings and cosmetics"); AssetBundle bundle = BundleUtilities.LoadBundleFromInternalAssembly("morecompany.assets", Assembly.GetExecutingAssembly()); AssetBundle val2 = BundleUtilities.LoadBundleFromInternalAssembly("morecompany.cosmetics", Assembly.GetExecutingAssembly()); CosmeticRegistry.LoadCosmeticsFromBundle(val2); val2.Unload(false); SteamFriends.OnGameLobbyJoinRequested += delegate(Lobby lobby, SteamId steamId) { newPlayerCount = ((Lobby)(ref lobby)).MaxMembers; }; SteamMatchmaking.OnLobbyEntered += delegate(Lobby lobby) { newPlayerCount = ((Lobby)(ref lobby)).MaxMembers; }; StaticLogger.LogInfo((object)"Loading USER COSMETICS..."); RecursiveCosmeticLoad(Paths.PluginPath); LoadAssets(bundle); StaticLogger.LogInfo((object)"Loaded MoreCompany FULLY"); } private void RecursiveCosmeticLoad(string directory) { string[] directories = Directory.GetDirectories(directory); foreach (string directory2 in directories) { RecursiveCosmeticLoad(directory2); } string[] files = Directory.GetFiles(directory); foreach (string text in files) { if (text.EndsWith(".cosmetics")) { AssetBundle val = AssetBundle.LoadFromFile(text); CosmeticRegistry.LoadCosmeticsFromBundle(val); val.Unload(false); } } } private void ReadCosmeticsFromFile() { if (File.Exists(cosmeticSavePath)) { string[] array = File.ReadAllLines(cosmeticSavePath); string[] array2 = array; foreach (string item in array2) { CosmeticRegistry.locallySelectedCosmetics.Add(item); } } } public static void WriteCosmeticsToFile() { string text = ""; foreach (string locallySelectedCosmetic in CosmeticRegistry.locallySelectedCosmetics) { text = text + locallySelectedCosmetic + "\n"; } File.WriteAllText(cosmeticSavePath, text); } public static void SaveSettingsToFile() { string text = ""; text = text + newPlayerCount + "\n"; text = text + showCosmetics + "\n"; File.WriteAllText(moreCompanySave, text); } public static void ReadSettingsFromFile() { if (File.Exists(moreCompanySave)) { string[] array = File.ReadAllLines(moreCompanySave); try { newPlayerCount = int.Parse(array[0]); showCosmetics = bool.Parse(array[1]); } catch (Exception) { StaticLogger.LogError((object)"Failed to read settings from file, resetting to default"); newPlayerCount = 32; showCosmetics = true; } } } private static void LoadAssets(AssetBundle bundle) { if (Object.op_Implicit((Object)(object)bundle)) { mainLogo = bundle.LoadPersistentAsset<Texture2D>("assets/morecompanyassets/morecompanytransparentred.png"); quickMenuScrollParent = bundle.LoadPersistentAsset<GameObject>("assets/morecompanyassets/quickmenuoverride.prefab"); playerEntry = bundle.LoadPersistentAsset<GameObject>("assets/morecompanyassets/playerlistslot.prefab"); cosmeticGUIInstance = bundle.LoadPersistentAsset<GameObject>("assets/morecompanyassets/testoverlay.prefab"); cosmeticButton = bundle.LoadPersistentAsset<GameObject>("assets/morecompanyassets/cosmeticinstance.prefab"); crewCountUI = bundle.LoadPersistentAsset<GameObject>("assets/morecompanyassets/crewcountfield.prefab"); bundle.Unload(false); } } public static void ResizePlayerCache(Dictionary<uint, Dictionary<int, NetworkObject>> ScenePlacedObjects) { //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Expected O, but got Unknown StartOfRound instance = StartOfRound.Instance; if (instance.allPlayerObjects.Length == newPlayerCount) { return; } playerIdsAndCosmetics.Clear(); uint num = 10000u; int num2 = newPlayerCount - instance.allPlayerObjects.Length; int num3 = instance.allPlayerObjects.Length; GameObject val = instance.allPlayerObjects[3]; for (int i = 0; i < num2; i++) { uint num4 = num + (uint)i; GameObject val2 = Object.Instantiate<GameObject>(val); NetworkObject component = val2.GetComponent<NetworkObject>(); ReflectionUtils.SetFieldValue(component, "GlobalObjectIdHash", num4); Scene scene = ((Component)component).gameObject.scene; int handle = ((Scene)(ref scene)).handle; uint num5 = num4; if (!ScenePlacedObjects.ContainsKey(num5)) { ScenePlacedObjects.Add(num5, new Dictionary<int, NetworkObject>()); } if (ScenePlacedObjects[num5].ContainsKey(handle)) { string arg = (((Object)(object)ScenePlacedObjects[num5][handle] != (Object)null) ? ((Object)ScenePlacedObjects[num5][handle]).name : "Null Entry"); throw new Exception(((Object)component).name + " tried to registered with ScenePlacedObjects which already contains " + string.Format("the same {0} value {1} for {2}!", "GlobalObjectIdHash", num5, arg)); } ScenePlacedObjects[num5].Add(handle, component); ((Object)val2).name = $"Player ({4 + i})"; val2.transform.parent = null; PlayerControllerB componentInChildren = val2.GetComponentInChildren<PlayerControllerB>(); notSupposedToExistPlayers.Add(componentInChildren); componentInChildren.playerClientId = (ulong)(4 + i); componentInChildren.isPlayerControlled = false; componentInChildren.isPlayerDead = false; componentInChildren.DropAllHeldItems(false, false); componentInChildren.TeleportPlayer(instance.notSpawnedPosition.position, false, 0f, false, true); UnlockableSuit.SwitchSuitForPlayer(componentInChildren, 0, false); Array.Resize(ref instance.allPlayerObjects, instance.allPlayerObjects.Length + 1); Array.Resize(ref instance.allPlayerScripts, instance.allPlayerScripts.Length + 1); Array.Resize(ref instance.gameStats.allPlayerStats, instance.gameStats.allPlayerStats.Length + 1); Array.Resize(ref instance.playerSpawnPositions, instance.playerSpawnPositions.Length + 1); instance.allPlayerObjects[num3 + i] = val2; instance.gameStats.allPlayerStats[num3 + i] = new PlayerStats(); instance.allPlayerScripts[num3 + i] = componentInChildren; instance.playerSpawnPositions[num3 + i] = instance.playerSpawnPositions[3]; } } public static void EnablePlayerObjectsBasedOnConnected() { int connectedPlayersAmount = StartOfRound.Instance.connectedPlayersAmount; PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; foreach (PlayerControllerB val in allPlayerScripts) { for (int j = 0; j < connectedPlayersAmount + 1; j++) { if (!val.isPlayerControlled) { ((Component)val).gameObject.SetActive(false); } else { ((Component)val).gameObject.SetActive(true); } } } } } [HarmonyPatch(typeof(PlayerControllerB), "SendNewPlayerValuesServerRpc")] public static class SendNewPlayerValuesServerRpcPatch { public static ulong lastId; public static void Prefix(PlayerControllerB __instance, ulong newPlayerSteamId) { NetworkManager networkManager = ((NetworkBehaviour)__instance).NetworkManager; if (!((Object)(object)networkManager == (Object)null) && networkManager.IsListening && networkManager.IsServer) { lastId = newPlayerSteamId; } } } [HarmonyPatch(typeof(PlayerControllerB), "SendNewPlayerValuesClientRpc")] public static class SendNewPlayerValuesClientRpcPatch { public static void Prefix(PlayerControllerB __instance, ref ulong[] playerSteamIds) { //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Expected O, but got Unknown NetworkManager networkManager = ((NetworkBehaviour)__instance).NetworkManager; if ((Object)(object)networkManager == (Object)null || !networkManager.IsListening) { return; } if (StartOfRound.Instance.mapScreen.radarTargets.Count != MainClass.newPlayerCount) { List<PlayerControllerB> useless = new List<PlayerControllerB>(); foreach (PlayerControllerB notSupposedToExistPlayer in MainClass.notSupposedToExistPlayers) { if (Object.op_Implicit((Object)(object)notSupposedToExistPlayer)) { StartOfRound.Instance.mapScreen.radarTargets.Add(new TransformAndName(((Component)notSupposedToExistPlayer).transform, notSupposedToExistPlayer.playerUsername, false)); } else { useless.Add(notSupposedToExistPlayer); } } MainClass.notSupposedToExistPlayers.RemoveAll((PlayerControllerB x) => useless.Contains(x)); } if (!networkManager.IsServer) { return; } List<ulong> list = new List<ulong>(); for (int i = 0; i < MainClass.newPlayerCount; i++) { if (i == (int)__instance.playerClientId) { list.Add(SendNewPlayerValuesServerRpcPatch.lastId); } else { list.Add(__instance.playersManager.allPlayerScripts[i].playerSteamId); } } playerSteamIds = list.ToArray(); } } public static class HUDManagerBullshitPatch { public static bool ManualPrefix(HUDManager __instance) { return false; } } [HarmonyPatch(typeof(StartOfRound), "SyncShipUnlockablesClientRpc")] public static class SyncShipUnlockablePatch { public static void Prefix(StartOfRound __instance, ref int[] playerSuitIDs, bool shipLightsOn, Vector3[] placeableObjectPositions, Vector3[] placeableObjectRotations, int[] placeableObjects, int[] storedItems, int[] scrapValues, int[] itemSaveData) { NetworkManager networkManager = ((NetworkBehaviour)__instance).NetworkManager; if (!((Object)(object)networkManager == (Object)null) && networkManager.IsListening && networkManager.IsServer) { int[] array = new int[MainClass.newPlayerCount]; for (int i = 0; i < MainClass.newPlayerCount; i++) { array[i] = __instance.allPlayerScripts[i].currentSuitID; } playerSuitIDs = array; } } } [HarmonyPatch(typeof(NetworkSceneManager), "PopulateScenePlacedObjects")] public static class ScenePlacedObjectsInitPatch { public static void Postfix(ref Dictionary<uint, Dictionary<int, NetworkObject>> ___ScenePlacedObjects) { MainClass.ResizePlayerCache(___ScenePlacedObjects); } } [HarmonyPatch(typeof(GameNetworkManager), "LobbyDataIsJoinable")] public static class LobbyDataJoinablePatch { public static bool Prefix(ref bool __result) { __result = true; return false; } } [HarmonyPatch(typeof(NetworkConnectionManager), "HandleConnectionApproval")] public static class ConnectionApprovalTest { public static void Prefix(ulong ownerClientId, ConnectionApprovalResponse response) { if (Object.op_Implicit((Object)(object)StartOfRound.Instance)) { if (StartOfRound.Instance.connectedPlayersAmount >= MainClass.newPlayerCount) { response.Approved = false; response.Reason = "Server is full"; } else { response.Approved = true; } } } } [HarmonyPatch(typeof(SteamMatchmaking), "CreateLobbyAsync")] public static class LobbyThingPatch { public static void Prefix(ref int maxMembers) { MainClass.ReadSettingsFromFile(); maxMembers = MainClass.newPlayerCount; } } public class ManualHarmonyPatches { public static void ManualPatch(Harmony HarmonyInstance) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Expected O, but got Unknown HarmonyInstance.Patch((MethodBase)AccessTools.Method(typeof(HUDManager), "SyncAllPlayerLevelsServerRpc", new Type[0], (Type[])null), new HarmonyMethod(typeof(HUDManagerBullshitPatch).GetMethod("ManualPrefix")), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } } public class MimicPatches { [HarmonyPatch(typeof(MaskedPlayerEnemy), "SetEnemyOutside")] public class MaskedPlayerEnemyOnEnablePatch { public static void Postfix(MaskedPlayerEnemy __instance) { //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)__instance.mimickingPlayer != (Object)null)) { return; } List<string> list = MainClass.playerIdsAndCosmetics[(int)__instance.mimickingPlayer.playerClientId]; Transform val = ((Component)__instance).transform.Find("ScavengerModel").Find("metarig"); CosmeticApplication component = ((Component)val).GetComponent<CosmeticApplication>(); if (Object.op_Implicit((Object)(object)component)) { component.ClearCosmetics(); Object.Destroy((Object)(object)component); } component = ((Component)val).gameObject.AddComponent<CosmeticApplication>(); foreach (string item in list) { component.ApplyCosmetic(item, startEnabled: true); } foreach (CosmeticInstance spawnedCosmetic in component.spawnedCosmetics) { Transform transform = ((Component)spawnedCosmetic).transform; transform.localScale *= 0.38f; } } } } public class ReflectionUtils { public static void InvokeMethod(object obj, string methodName, object[] parameters) { Type type = obj.GetType(); MethodInfo method = type.GetMethod(methodName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); method.Invoke(obj, parameters); } public static void InvokeMethod(object obj, Type forceType, string methodName, object[] parameters) { MethodInfo method = forceType.GetMethod(methodName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); method.Invoke(obj, parameters); } public static void SetPropertyValue(object obj, string propertyName, object value) { Type type = obj.GetType(); PropertyInfo property = type.GetProperty(propertyName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); property.SetValue(obj, value); } public static T InvokeMethod<T>(object obj, string methodName, object[] parameters) { Type type = obj.GetType(); MethodInfo method = type.GetMethod(methodName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); return (T)method.Invoke(obj, parameters); } public static T GetFieldValue<T>(object obj, string fieldName) { Type type = obj.GetType(); FieldInfo field = type.GetField(fieldName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); return (T)field.GetValue(obj); } public static void SetFieldValue(object obj, string fieldName, object value) { Type type = obj.GetType(); FieldInfo field = type.GetField(fieldName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); field.SetValue(obj, value); } } [HarmonyPatch(typeof(ShipTeleporter), "Awake")] public static class ShipTeleporterAwakePatch { public static void Postfix(ShipTeleporter __instance) { int[] array = new int[MainClass.newPlayerCount]; for (int i = 0; i < MainClass.newPlayerCount; i++) { array[i] = -1; } ReflectionUtils.SetFieldValue(__instance, "playersBeingTeleported", array); } } [HarmonyPatch(typeof(PlayerControllerB), "SpectateNextPlayer")] public static class SpectatePatches { public static bool Prefix(PlayerControllerB __instance) { //IL_00e5: Unknown result type (might be due to invalid IL or missing references) int num = 0; if ((Object)(object)__instance.spectatedPlayerScript != (Object)null) { num = (int)__instance.spectatedPlayerScript.playerClientId; } for (int i = 0; i < MainClass.newPlayerCount; i++) { num = (num + 1) % MainClass.newPlayerCount; if (!__instance.playersManager.allPlayerScripts[num].isPlayerDead && __instance.playersManager.allPlayerScripts[num].isPlayerControlled && (Object)(object)__instance.playersManager.allPlayerScripts[num] != (Object)(object)__instance) { __instance.spectatedPlayerScript = __instance.playersManager.allPlayerScripts[num]; __instance.SetSpectatedPlayerEffects(false); return false; } } if ((Object)(object)__instance.deadBody != (Object)null && ((Component)__instance.deadBody).gameObject.activeSelf) { __instance.spectateCameraPivot.position = __instance.deadBody.bodyParts[0].position; ReflectionUtils.InvokeMethod(__instance, "RaycastSpectateCameraAroundPivot", null); } StartOfRound.Instance.SetPlayerSafeInShip(); return false; } } [HarmonyPatch(typeof(SoundManager), "Start")] public static class SoundManagerStartPatch { public static void Postfix() { int num = MainClass.newPlayerCount - 4; int num2 = 4; for (int i = 0; i < num; i++) { Array.Resize(ref SoundManager.Instance.playerVoicePitches, SoundManager.Instance.playerVoicePitches.Length + 1); Array.Resize(ref SoundManager.Instance.playerVoicePitchTargets, SoundManager.Instance.playerVoicePitchTargets.Length + 1); Array.Resize(ref SoundManager.Instance.playerVoiceVolumes, SoundManager.Instance.playerVoiceVolumes.Length + 1); Array.Resize(ref SoundManager.Instance.playerVoicePitchLerpSpeed, SoundManager.Instance.playerVoicePitchLerpSpeed.Length + 1); Array.Resize(ref SoundManager.Instance.playerVoiceMixers, SoundManager.Instance.playerVoiceMixers.Length + 1); AudioMixerGroup val = ((IEnumerable<AudioMixerGroup>)Resources.FindObjectsOfTypeAll<AudioMixerGroup>()).FirstOrDefault((Func<AudioMixerGroup, bool>)((AudioMixerGroup x) => ((Object)x).name.Contains("Voice"))); SoundManager.Instance.playerVoicePitches[num2 + i] = 1f; SoundManager.Instance.playerVoicePitchTargets[num2 + i] = 1f; SoundManager.Instance.playerVoiceVolumes[num2 + i] = 0.5f; SoundManager.Instance.playerVoicePitchLerpSpeed[num2 + i] = 3f; SoundManager.Instance.playerVoiceMixers[num2 + i] = val; } } } [HarmonyPatch(typeof(StartOfRound), "GetPlayerSpawnPosition")] public static class SpawnPositionClampPatch { public static void Prefix(ref int playerNum, bool simpleTeleport = false) { if (playerNum > 3) { playerNum = 3; } } } [HarmonyPatch(typeof(StartOfRound), "OnClientConnect")] public static class OnClientConnectedPatch { public static bool Prefix(StartOfRound __instance, ulong clientId) { if (!((NetworkBehaviour)__instance).IsServer) { return false; } Debug.Log((object)"player connected"); Debug.Log((object)$"connected players #: {__instance.connectedPlayersAmount}"); try { List<int> list = __instance.ClientPlayerList.Values.ToList(); Debug.Log((object)$"Connecting new player on host; clientId: {clientId}"); int num = 0; for (int i = 1; i < MainClass.newPlayerCount; i++) { if (!list.Contains(i)) { num = i; break; } } __instance.allPlayerScripts[num].actualClientId = clientId; __instance.allPlayerObjects[num].GetComponent<NetworkObject>().ChangeOwnership(clientId); Debug.Log((object)$"New player assigned object id: {__instance.allPlayerObjects[num]}"); List<ulong> list2 = new List<ulong>(); for (int j = 0; j < __instance.allPlayerObjects.Length; j++) { NetworkObject component = __instance.allPlayerObjects[j].GetComponent<NetworkObject>(); if (!component.IsOwnedByServer) { list2.Add(component.OwnerClientId); } else if (j == 0) { list2.Add(NetworkManager.Singleton.LocalClientId); } else { list2.Add(999uL); } } int groupCredits = Object.FindObjectOfType<Terminal>().groupCredits; int profitQuota = TimeOfDay.Instance.profitQuota; int quotaFulfilled = TimeOfDay.Instance.quotaFulfilled; int num2 = (int)TimeOfDay.Instance.timeUntilDeadline; ReflectionUtils.InvokeMethod(__instance, "OnPlayerConnectedClientRpc", new object[10] { clientId, __instance.connectedPlayersAmount, list2.ToArray(), num, groupCredits, __instance.currentLevelID, profitQuota, num2, quotaFulfilled, __instance.randomMapSeed }); __instance.ClientPlayerList.Add(clientId, num); Debug.Log((object)$"client id connecting: {clientId} ; their corresponding player object id: {num}"); } catch (Exception arg) { Debug.LogError((object)$"Error occured in OnClientConnected! Shutting server down. clientId: {clientId}. Error: {arg}"); GameNetworkManager.Instance.disconnectionReasonMessage = "Error occured when a player attempted to join the server! Restart the application and please report the glitch!"; GameNetworkManager.Instance.Disconnect(); } return false; } } [HarmonyPatch(typeof(SteamLobbyManager), "LoadServerList")] public static class LoadServerListPatch { public static bool Prefix(SteamLobbyManager __instance) { OverrideMethod(__instance); return false; } private static async void OverrideMethod(SteamLobbyManager __instance) { if (GameNetworkManager.Instance.waitingForLobbyDataRefresh) { return; } ReflectionUtils.SetFieldValue(__instance, "refreshServerListTimer", 0f); ((TMP_Text)__instance.serverListBlankText).text = "Loading server list..."; ReflectionUtils.GetFieldValue<Lobby[]>(__instance, "currentLobbyList"); LobbySlot[] array = Object.FindObjectsOfType<LobbySlot>(); for (int i = 0; i < array.Length; i++) { Object.Destroy((Object)(object)((Component)array[i]).gameObject); } LobbyQuery val; switch (__instance.sortByDistanceSetting) { case 0: val = SteamMatchmaking.LobbyList; ((LobbyQuery)(ref val)).FilterDistanceClose(); break; case 1: val = SteamMatchmaking.LobbyList; ((LobbyQuery)(ref val)).FilterDistanceFar(); break; case 2: val = SteamMatchmaking.LobbyList; ((LobbyQuery)(ref val)).FilterDistanceWorldwide(); break; } Debug.Log((object)"Requested server list"); GameNetworkManager.Instance.waitingForLobbyDataRefresh = true; Lobby[] currentLobbyList; switch (__instance.sortByDistanceSetting) { case 0: val = SteamMatchmaking.LobbyList; val = ((LobbyQuery)(ref val)).FilterDistanceClose(); val = ((LobbyQuery)(ref val)).WithSlotsAvailable(1); val = ((LobbyQuery)(ref val)).WithKeyValue("vers", GameNetworkManager.Instance.gameVersionNum.ToString()); currentLobbyList = await ((LobbyQuery)(ref val)).RequestAsync(); break; case 1: val = SteamMatchmaking.LobbyList; val = ((LobbyQuery)(ref val)).FilterDistanceFar(); val = ((LobbyQuery)(ref val)).WithSlotsAvailable(1); val = ((LobbyQuery)(ref val)).WithKeyValue("vers", GameNetworkManager.Instance.gameVersionNum.ToString()); currentLobbyList = await ((LobbyQuery)(ref val)).RequestAsync(); break; default: val = SteamMatchmaking.LobbyList; val = ((LobbyQuery)(ref val)).FilterDistanceWorldwide(); val = ((LobbyQuery)(ref val)).WithSlotsAvailable(1); val = ((LobbyQuery)(ref val)).WithKeyValue("vers", GameNetworkManager.Instance.gameVersionNum.ToString()); currentLobbyList = await ((LobbyQuery)(ref val)).RequestAsync(); break; } GameNetworkManager.Instance.waitingForLobbyDataRefresh = false; if (currentLobbyList != null) { Debug.Log((object)"Got lobby list!"); ReflectionUtils.InvokeMethod(__instance, "DebugLogServerList", null); if (currentLobbyList.Length == 0) { ((TMP_Text)__instance.serverListBlankText).text = "No available servers to join."; } else { ((TMP_Text)__instance.serverListBlankText).text = ""; } ReflectionUtils.SetFieldValue(__instance, "lobbySlotPositionOffset", 0f); for (int j = 0; j < currentLobbyList.Length; j++) { Friend[] array2 = SteamFriends.GetBlocked().ToArray(); if (array2 != null) { for (int k = 0; k < array2.Length; k++) { Debug.Log((object)$"blocked user: {((Friend)(ref array2[k])).Name}; id: {array2[k].Id}"); if (((Lobby)(ref currentLobbyList[j])).IsOwnedBy(array2[k].Id)) { Debug.Log((object)("Hiding lobby by blocked user: " + ((Friend)(ref array2[k])).Name)); } } } else { Debug.Log((object)"Blocked users list is null"); } GameObject gameObject = Object.Instantiate<GameObject>(__instance.LobbySlotPrefab, __instance.levelListContainer); gameObject.GetComponent<RectTransform>().anchoredPosition = new Vector2(0f, 0f + ReflectionUtils.GetFieldValue<float>(__instance, "lobbySlotPositionOffset")); ReflectionUtils.SetFieldValue(__instance, "lobbySlotPositionOffset", ReflectionUtils.GetFieldValue<float>(__instance, "lobbySlotPositionOffset") - 42f); LobbySlot componentInChildren = gameObject.GetComponentInChildren<LobbySlot>(); ((TMP_Text)componentInChildren.LobbyName).text = ((Lobby)(ref currentLobbyList[j])).GetData("name"); ((TMP_Text)componentInChildren.playerCount).text = $"{((Lobby)(ref currentLobbyList[j])).MemberCount} / {((Lobby)(ref currentLobbyList[j])).MaxMembers}"; componentInChildren.lobbyId = ((Lobby)(ref currentLobbyList[j])).Id; componentInChildren.thisLobby = currentLobbyList[j]; ReflectionUtils.SetFieldValue(__instance, "currentLobbyList", currentLobbyList); } } else { Debug.Log((object)"Lobby list is null after request."); ((TMP_Text)__instance.serverListBlankText).text = "No available servers to join."; } } } [HarmonyPatch(typeof(GameNetworkManager), "Awake")] public static class GameNetworkAwakePatch { public static int originalVersion; public static void Postfix(GameNetworkManager __instance) { originalVersion = __instance.gameVersionNum; if (!AssemblyChecker.HasAssemblyLoaded("lc_api")) { __instance.gameVersionNum = 9999; } } } [HarmonyPatch(typeof(MenuManager), "Awake")] public static class MenuManagerVersionDisplayPatch { public static void Postfix(MenuManager __instance) { if ((Object)(object)GameNetworkManager.Instance != (Object)null && (Object)(object)__instance.versionNumberText != (Object)null) { ((TMP_Text)__instance.versionNumberText).text = $"v{GameNetworkAwakePatch.originalVersion} (MC)"; } } } } namespace MoreCompany.Utils { public class AssemblyChecker { public static bool HasAssemblyLoaded(string name) { Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); Assembly[] array = assemblies; foreach (Assembly assembly in array) { if (assembly.GetName().Name.ToLower().Equals(name)) { return true; } } return false; } } public class BundleUtilities { public static byte[] GetResourceBytes(string filename, Assembly assembly) { string[] manifestResourceNames = assembly.GetManifestResourceNames(); foreach (string text in manifestResourceNames) { if (!text.Contains(filename)) { continue; } using Stream stream = assembly.GetManifestResourceStream(text); if (stream == null) { return null; } byte[] array = new byte[stream.Length]; stream.Read(array, 0, array.Length); return array; } return null; } public static AssetBundle LoadBundleFromInternalAssembly(string filename, Assembly assembly) { return AssetBundle.LoadFromMemory(GetResourceBytes(filename, assembly)); } } public static class AssetBundleExtension { public static T LoadPersistentAsset<T>(this AssetBundle bundle, string name) where T : Object { Object val = bundle.LoadAsset(name); if (val != (Object)null) { val.hideFlags = (HideFlags)32; return (T)(object)val; } return default(T); } } } namespace MoreCompany.Cosmetics { public class CosmeticApplication : MonoBehaviour { public Transform head; public Transform hip; public Transform lowerArmRight; public Transform shinLeft; public Transform shinRight; public Transform chest; public List<CosmeticInstance> spawnedCosmetics = new List<CosmeticInstance>(); public void Awake() { head = ((Component)this).transform.Find("spine").Find("spine.001").Find("spine.002") .Find("spine.003") .Find("spine.004"); chest = ((Component)this).transform.Find("spine").Find("spine.001").Find("spine.002") .Find("spine.003"); lowerArmRight = ((Component)this).transform.Find("spine").Find("spine.001").Find("spine.002") .Find("spine.003") .Find("shoulder.R") .Find("arm.R_upper") .Find("arm.R_lower"); hip = ((Component)this).transform.Find("spine"); shinLeft = ((Component)this).transform.Find("spine").Find("thigh.L").Find("shin.L"); shinRight = ((Component)this).transform.Find("spine").Find("thigh.R").Find("shin.R"); RefreshAllCosmeticPositions(); } private void OnDisable() { foreach (CosmeticInstance spawnedCosmetic in spawnedCosmetics) { ((Component)spawnedCosmetic).gameObject.SetActive(false); } } private void OnEnable() { foreach (CosmeticInstance spawnedCosmetic in spawnedCosmetics) { ((Component)spawnedCosmetic).gameObject.SetActive(true); } } public void ClearCosmetics() { foreach (CosmeticInstance spawnedCosmetic in spawnedCosmetics) { Object.Destroy((Object)(object)((Component)spawnedCosmetic).gameObject); } spawnedCosmetics.Clear(); } public void ApplyCosmetic(string cosmeticId, bool startEnabled) { if (CosmeticRegistry.cosmeticInstances.ContainsKey(cosmeticId)) { CosmeticInstance cosmeticInstance = CosmeticRegistry.cosmeticInstances[cosmeticId]; GameObject val = Object.Instantiate<GameObject>(((Component)cosmeticInstance).gameObject); val.SetActive(startEnabled); CosmeticInstance component = val.GetComponent<CosmeticInstance>(); spawnedCosmetics.Add(component); if (startEnabled) { ParentCosmetic(component); } } } public void RefreshAllCosmeticPositions() { foreach (CosmeticInstance spawnedCosmetic in spawnedCosmetics) { ParentCosmetic(spawnedCosmetic); } } private void ParentCosmetic(CosmeticInstance cosmeticInstance) { //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) Transform val = null; switch (cosmeticInstance.cosmeticType) { case CosmeticType.HAT: val = head; break; case CosmeticType.R_LOWER_ARM: val = lowerArmRight; break; case CosmeticType.HIP: val = hip; break; case CosmeticType.L_SHIN: val = shinLeft; break; case CosmeticType.R_SHIN: val = shinRight; break; case CosmeticType.CHEST: val = chest; break; } ((Component)cosmeticInstance).transform.position = val.position; ((Component)cosmeticInstance).transform.rotation = val.rotation; ((Component)cosmeticInstance).transform.parent = val; } } public class CosmeticInstance : MonoBehaviour { public CosmeticType cosmeticType; public string cosmeticId; public Texture2D icon; } public class CosmeticGeneric { public virtual string gameObjectPath { get; } public virtual string cosmeticId { get; } public virtual string textureIconPath { get; } public CosmeticType cosmeticType { get; } public void LoadFromBundle(AssetBundle bundle) { GameObject val = bundle.LoadPersistentAsset<GameObject>(gameObjectPath); Texture2D icon = bundle.LoadPersistentAsset<Texture2D>(textureIconPath); CosmeticInstance cosmeticInstance = val.AddComponent<CosmeticInstance>(); cosmeticInstance.cosmeticId = cosmeticId; cosmeticInstance.icon = icon; cosmeticInstance.cosmeticType = cosmeticType; MainClass.StaticLogger.LogInfo((object)("Loaded cosmetic: " + cosmeticId + " from bundle: " + ((Object)bundle).name)); CosmeticRegistry.cosmeticInstances.Add(cosmeticId, cosmeticInstance); } } public enum CosmeticType { HAT, WRIST, CHEST, R_LOWER_ARM, HIP, L_SHIN, R_SHIN } public class CosmeticRegistry { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static UnityAction <>9__8_0; public static UnityAction <>9__8_1; internal void <SpawnCosmeticGUI>b__8_0() { MainClass.showCosmetics = true; MainClass.SaveSettingsToFile(); } internal void <SpawnCosmeticGUI>b__8_1() { MainClass.showCosmetics = false; MainClass.SaveSettingsToFile(); } } public static Dictionary<string, CosmeticInstance> cosmeticInstances = new Dictionary<string, CosmeticInstance>(); public static GameObject cosmeticGUI; private static GameObject displayGuy; private static CosmeticApplication cosmeticApplication; public static List<string> locallySelectedCosmetics = new List<string>(); public const float COSMETIC_PLAYER_SCALE_MULT = 0.38f; public static void LoadCosmeticsFromBundle(AssetBundle bundle) { string[] allAssetNames = bundle.GetAllAssetNames(); foreach (string text in allAssetNames) { if (text.EndsWith(".prefab")) { GameObject val = bundle.LoadPersistentAsset<GameObject>(text); CosmeticInstance component = val.GetComponent<CosmeticInstance>(); if (!((Object)(object)component == (Object)null)) { MainClass.StaticLogger.LogInfo((object)("Loaded cosmetic: " + component.cosmeticId + " from bundle")); cosmeticInstances.Add(component.cosmeticId, component); } } } } public static void LoadCosmeticsFromAssembly(Assembly assembly, AssetBundle bundle) { Type[] types = assembly.GetTypes(); foreach (Type type in types) { if (type.IsSubclassOf(typeof(CosmeticGeneric))) { CosmeticGeneric cosmeticGeneric = (CosmeticGeneric)type.GetConstructor(new Type[0]).Invoke(new object[0]); cosmeticGeneric.LoadFromBundle(bundle); } } } public static void SpawnCosmeticGUI() { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Expected O, but got Unknown //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Expected O, but got Unknown cosmeticGUI = Object.Instantiate<GameObject>(MainClass.cosmeticGUIInstance); ((Component)cosmeticGUI.transform.Find("Canvas").Find("GlobalScale")).transform.localScale = new Vector3(2f, 2f, 2f); displayGuy = ((Component)cosmeticGUI.transform.Find("Canvas").Find("GlobalScale").Find("CosmeticsScreen") .Find("ObjectHolder") .Find("ScavengerModel") .Find("metarig")).gameObject; cosmeticApplication = displayGuy.AddComponent<CosmeticApplication>(); GameObject gameObject = ((Component)cosmeticGUI.transform.Find("Canvas").Find("GlobalScale").Find("CosmeticsScreen") .Find("EnableButton")).gameObject; ButtonClickedEvent onClick = gameObject.GetComponent<Button>().onClick; object obj = <>c.<>9__8_0; if (obj == null) { UnityAction val = delegate { MainClass.showCosmetics = true; MainClass.SaveSettingsToFile(); }; <>c.<>9__8_0 = val; obj = (object)val; } ((UnityEvent)onClick).AddListener((UnityAction)obj); GameObject gameObject2 = ((Component)cosmeticGUI.transform.Find("Canvas").Find("GlobalScale").Find("CosmeticsScreen") .Find("DisableButton")).gameObject; ButtonClickedEvent onClick2 = gameObject2.GetComponent<Button>().onClick; object obj2 = <>c.<>9__8_1; if (obj2 == null) { UnityAction val2 = delegate { MainClass.showCosmetics = false; MainClass.SaveSettingsToFile(); }; <>c.<>9__8_1 = val2; obj2 = (object)val2; } ((UnityEvent)onClick2).AddListener((UnityAction)obj2); if (MainClass.showCosmetics) { gameObject.SetActive(false); gameObject2.SetActive(true); } else { gameObject.SetActive(true); gameObject2.SetActive(false); } PopulateCosmetics(); UpdateCosmeticsOnDisplayGuy(startEnabled: false); } public static void PopulateCosmetics() { //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Expected O, but got Unknown GameObject gameObject = ((Component)cosmeticGUI.transform.Find("Canvas").Find("GlobalScale").Find("CosmeticsScreen") .Find("CosmeticsHolder") .Find("Content")).gameObject; List<Transform> list = new List<Transform>(); for (int i = 0; i < gameObject.transform.childCount; i++) { list.Add(gameObject.transform.GetChild(i)); } foreach (Transform item in list) { Object.Destroy((Object)(object)((Component)item).gameObject); } foreach (KeyValuePair<string, CosmeticInstance> cosmeticInstance in cosmeticInstances) { GameObject val = Object.Instantiate<GameObject>(MainClass.cosmeticButton, gameObject.transform); val.transform.localScale = Vector3.one; GameObject disabledOverlay = ((Component)val.transform.Find("Deselected")).gameObject; disabledOverlay.SetActive(true); GameObject enabledOverlay = ((Component)val.transform.Find("Selected")).gameObject; enabledOverlay.SetActive(true); if (IsEquipped(cosmeticInstance.Value.cosmeticId)) { enabledOverlay.SetActive(true); disabledOverlay.SetActive(false); } else { enabledOverlay.SetActive(false); disabledOverlay.SetActive(true); } RawImage component = ((Component)val.transform.Find("Icon")).GetComponent<RawImage>(); component.texture = (Texture)(object)cosmeticInstance.Value.icon; Button component2 = val.GetComponent<Button>(); ((UnityEvent)component2.onClick).AddListener((UnityAction)delegate { ToggleCosmetic(cosmeticInstance.Value.cosmeticId); if (IsEquipped(cosmeticInstance.Value.cosmeticId)) { enabledOverlay.SetActive(true); disabledOverlay.SetActive(false); } else { enabledOverlay.SetActive(false); disabledOverlay.SetActive(true); } MainClass.WriteCosmeticsToFile(); UpdateCosmeticsOnDisplayGuy(startEnabled: true); }); } } private static Color HexToColor(string hex) { //IL_0003: 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_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) Color result = default(Color); ColorUtility.TryParseHtmlString(hex, ref result); return result; } public static void UpdateCosmeticsOnDisplayGuy(bool startEnabled) { cosmeticApplication.ClearCosmetics(); foreach (string locallySelectedCosmetic in locallySelectedCosmetics) { cosmeticApplication.ApplyCosmetic(locallySelectedCosmetic, startEnabled); } foreach (CosmeticInstance spawnedCosmetic in cosmeticApplication.spawnedCosmetics) { RecursiveLayerChange(((Component)spawnedCosmetic).transform, 5); } } private static void RecursiveLayerChange(Transform transform, int layer) { ((Component)transform).gameObject.layer = layer; for (int i = 0; i < transform.childCount; i++) { RecursiveLayerChange(transform.GetChild(i), layer); } } public static bool IsEquipped(string cosmeticId) { return locallySelectedCosmetics.Contains(cosmeticId); } public static void ToggleCosmetic(string cosmeticId) { if (locallySelectedCosmetics.Contains(cosmeticId)) { locallySelectedCosmetics.Remove(cosmeticId); } else { locallySelectedCosmetics.Add(cosmeticId); } } } } namespace MoreCompany.Behaviors { public class SpinDragger : MonoBehaviour, IPointerDownHandler, IEventSystemHandler, IPointerUpHandler { public float speed = 1f; private Vector2 lastMousePosition; private bool dragging = false; private Vector3 rotationalVelocity = Vector3.zero; public float dragSpeed = 1f; public float airDrag = 0.99f; public GameObject target; private void Update() { //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: 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) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) if (dragging) { Vector3 val = Vector2.op_Implicit(((InputControl<Vector2>)(object)((Pointer)Mouse.current).position).ReadValue() - lastMousePosition); rotationalVelocity += new Vector3(0f, 0f - val.x, 0f) * dragSpeed; lastMousePosition = ((InputControl<Vector2>)(object)((Pointer)Mouse.current).position).ReadValue(); } rotationalVelocity *= airDrag; target.transform.Rotate(rotationalVelocity * Time.deltaTime * speed, (Space)0); } public void OnPointerDown(PointerEventData eventData) { //IL_000c: 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) lastMousePosition = ((InputControl<Vector2>)(object)((Pointer)Mouse.current).position).ReadValue(); dragging = true; } public void OnPointerUp(PointerEventData eventData) { dragging = false; } } }
BepInEx/plugins/Ozone-BepInUtils/NicholaScott.BepInEx.Utils.dll
Decompiled 11 months agousing System; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("NicholaScott.BepInEx.Utils")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("NicholaScott.BepInEx.Utils")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("40BD9160-E0A3-402F-AE4F-059B39509F43")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyVersion("1.0.0.0")] namespace NicholaScott.BepInEx.Utils { [BepInPlugin("NicholaScott.BepInEx.Utils", "BepInUtils", "1.2.1")] public class BepInUtils : BaseUnityPlugin { public void Awake() { ((BaseUnityPlugin)this).Logger.LogInfo((object)"System loaded."); } } } namespace NicholaScott.BepInEx.Utils.Resources { public static class Extensions { public static byte[] ReadAllBytes(this Stream inStream) { if (inStream is MemoryStream memoryStream) { return memoryStream.ToArray(); } using MemoryStream memoryStream2 = new MemoryStream(); inStream.CopyTo(memoryStream2); return memoryStream2.ToArray(); } } } namespace NicholaScott.BepInEx.Utils.Patching { [AttributeUsage(AttributeTargets.Class)] public class Production : Attribute { } public static class Extensions { public static Harmony PatchAttribute<TAttr>(this Assembly sourceAssembly, string guid, Action<object> logMethod = null) where TAttr : Attribute { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown Harmony val = new Harmony(string.Join(".", guid, typeof(TAttr).Name)); foreach (Type item in from t in sourceAssembly.GetTypes() where t.IsClass && t.GetCustomAttributes(typeof(TAttr)).Any() select t) { int num = val.GetPatchedMethods().Count(); val.PatchAll(item); int num2 = val.GetPatchedMethods().Count(); int num3 = num2 - num; logMethod?.Invoke(string.Format("[{0}] Patched class {1}, containing {2} method{3}", typeof(TAttr).Name, item.Name, num3, (num3 > 1) ? "s." : ".")); } return val; } } } namespace NicholaScott.BepInEx.Utils.Instancing { public class AutoSingleton<TPrepare> where TPrepare : Object { private static TPrepare _instance; public static TPrepare Instance { get { if (!Object.op_Implicit((Object)(object)_instance)) { _instance = Object.FindObjectOfType<TPrepare>(); } return _instance; } } } public class CachedItem<TItem> { public delegate TItem InstanceLocator(); public delegate bool ItemNotNull(TItem item); private InstanceLocator locatorMethod; private ItemNotNull notNullMethod; private bool valueAssigned = false; private TItem value; public TItem Value { get { if (valueAssigned && (notNullMethod == null || notNullMethod(value))) { return value; } value = locatorMethod(); valueAssigned = notNullMethod == null || notNullMethod(value); return value; } } public CachedItem(InstanceLocator locator, ItemNotNull notNull = null) { locatorMethod = locator; notNullMethod = notNull; } public void ClearCache() { valueAssigned = false; } public static implicit operator TItem(CachedItem<TItem> item) { return item.Value; } } public class Singleton<TPrepare> { public static TPrepare Instance; public static ManualLogSource Logger { get { object? obj = typeof(BaseUnityPlugin).GetProperty("Logger", BindingFlags.Instance | BindingFlags.NonPublic)?.GetGetMethod(nonPublic: true)?.Invoke(Instance, Array.Empty<object>()); return (ManualLogSource)((obj is ManualLogSource) ? obj : null); } } } public class Singleton<TPrepare, TConfig> : Singleton<TPrepare> { public static TConfig Configuration; } } namespace NicholaScott.BepInEx.Utils.Configuration { [AttributeUsage(AttributeTargets.Field)] public class ConfigEntryDefinition : Attribute { public string Category; public string Name; public string Description; } public static class Extensions { public static TStruct BindStruct<TStruct>(this ConfigFile config, TStruct defaults) where TStruct : struct { //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Expected O, but got Unknown //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Expected O, but got Unknown object obj = new TStruct(); FieldInfo[] fields = typeof(TStruct).GetFields(); foreach (FieldInfo fieldInfo in fields) { ConfigEntryDefinition configEntryDefinition = fieldInfo.GetCustomAttribute<ConfigEntryDefinition>() ?? new ConfigEntryDefinition(); configEntryDefinition.Category = configEntryDefinition.Category ?? "General"; configEntryDefinition.Name = configEntryDefinition.Name ?? fieldInfo.Name; configEntryDefinition.Description = configEntryDefinition.Description ?? ""; object obj2 = ((typeof(ConfigFile).GetMethods()?.Where((MethodInfo m) => m.IsGenericMethod && m.Name.Contains("Bind") && m.GetParameters()[0].ParameterType == typeof(ConfigDefinition)).First())?.MakeGenericMethod(fieldInfo.FieldType))?.Invoke(config, new object[3] { (object)new ConfigDefinition(configEntryDefinition.Category, configEntryDefinition.Name), fieldInfo.GetValue(defaults), (object)new ConfigDescription(configEntryDefinition.Description, (AcceptableValueBase)null, Array.Empty<object>()) }); object obj3 = (obj2?.GetType().GetProperty("Value"))?.GetGetMethod().Invoke(obj2, null); fieldInfo.SetValue(obj, obj3 ?? fieldInfo.GetValue(defaults)); } return (TStruct)obj; } } }
BepInEx/plugins/Ozone-Glow_Steps/NicholaScott.LethalCompany.GlowSteps.dll
Decompiled 11 months agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using GameNetcodeStuff; using HarmonyLib; using NicholaScott.BepInEx.Utils.Configuration; using NicholaScott.BepInEx.Utils.Instancing; using NicholaScott.BepInEx.Utils.Patching; using NicholaScott.BepInEx.Utils.Resources; using NicholaScott.LethalCompany.GlowSteps.UnityScripts; using Unity.Netcode; using UnityEngine; using UnityEngine.Pool; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("NicholaScott.LethalCompany.GlowSteps")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("NicholaScott.LethalCompany.GlowSteps")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("F0F641E1-26A9-4BAE-8411-9D3681207A6F")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyVersion("1.0.0.0")] namespace NicholaScott.LethalCompany.GlowSteps { public class FootstepManager : MonoBehaviour { public readonly List<GlowingFootstep.Data> FootstepData = new List<GlowingFootstep.Data>(); public readonly FootstepPool PooledObjects = new FootstepPool(); private static Material _catwalkMaterial; public static Material CatwalkMaterial { get { if ((Object)(object)_catwalkMaterial == (Object)null) { GameObject obj = GameObject.Find("Environment/HangarShip/CatwalkShip"); object catwalkMaterial; if (obj == null) { catwalkMaterial = null; } else { Renderer component = obj.GetComponent<Renderer>(); catwalkMaterial = ((component != null) ? component.material : null); } _catwalkMaterial = (Material)catwalkMaterial; } return _catwalkMaterial; } } public void Start() { ((MonoBehaviour)this).InvokeRepeating("UpdateAllFootstepData", 1f, Singleton<GlowSteps, GlowSteps.Configuration>.Configuration.UpdateRate); } public void AddNewFootstep(GlowingFootstep.Data footstepData) { FootstepData.Add(footstepData); } public void UpdateAllFootstepData() { if ((Object)(object)CatwalkMaterial == (Object)null) { return; } for (int i = 0; i < FootstepData.Count; i++) { GlowingFootstep.Data data = FootstepData[i]; data.UpdateFootstepData(Singleton<GlowSteps, GlowSteps.Configuration>.Configuration.UpdateRate); if (data.IsEnabled && data.ShouldDraw) { data.Linked.SyncColorIntensity(data); } if (!data.IsEnabled && data.ShouldDraw) { GlowingFootstep glowingFootstep = ((ObjectPool<GlowingFootstep>)PooledObjects).Get(); data.IsEnabled = true; data.Linked = glowingFootstep; glowingFootstep.SyncAll(data); } if (data.IsEnabled && !data.ShouldDraw) { ((ObjectPool<GlowingFootstep>)PooledObjects).Release(data.Linked); data.IsEnabled = false; } FootstepData[i] = data; } FootstepData.RemoveAll((GlowingFootstep.Data d) => !d.IsEnabled && !d.ShouldDraw && d.TimeLeftAlive <= 0f); } } [Production] public static class FootstepPatcher { private static Dictionary<ulong, float> _leftFoots = new Dictionary<ulong, float>(); [HarmonyPatch(typeof(Terminal), "Start")] [HarmonyPostfix] public static void CreateFootstepManager(Terminal __instance) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Expected O, but got Unknown if (!((Object)(object)Singleton<GlowSteps>.Instance.footyManager != (Object)null)) { GameObject val = new GameObject("Footstep Manager", new Type[1] { typeof(FootstepManager) }); Singleton<GlowSteps>.Instance.footyManager = val.GetComponent<FootstepManager>(); Object.DontDestroyOnLoad((Object)(object)((Component)Singleton<GlowSteps>.Instance.footyManager).gameObject); } } [HarmonyPatch(typeof(PlayerControllerB), "PlayFootstepSound")] [HarmonyPrefix] public static void AddPositionToTracking(PlayerControllerB __instance) { //IL_00bf: 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_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) GlowSteps.Configuration configuration = Singleton<GlowSteps, GlowSteps.Configuration>.Configuration; int strength = ((!((NetworkBehaviour)__instance).IsOwner) ? 2 : (__instance.isSprinting ? 3 : ((__instance.isCrouching || __instance.isExhausted || __instance.isMovementHindered != 0) ? 1 : 2))); if ((!((NetworkBehaviour)__instance).IsOwner || __instance.isSprinting) && (__instance.isInsideFactory || !configuration.InFactory)) { if (!_leftFoots.ContainsKey(__instance.playerSteamId)) { _leftFoots.Add(__instance.playerSteamId, -1f); } float num = _leftFoots[__instance.playerSteamId]; Transform transform = ((Component)__instance).transform; Ray val = default(Ray); ((Ray)(ref val))..ctor(transform.position + transform.right * 0.2f * num, Vector3.down); RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(val, ref val2, 10f, LayerMask.GetMask(new string[3] { "Room", "Railing", "Default" }))) { Vector3 val3 = new Vector3((float)((__instance.playerSteamId & 0xFF0000) >> 16), (float)((__instance.playerSteamId & 0xFF00) >> 8), (float)(__instance.playerSteamId & 0xFF)) / 255f; GlowingFootstep.Data footstepData = new GlowingFootstep.Data { Color = (((NetworkBehaviour)__instance).IsOwner ? configuration.Color : val3), LeftFoot = (num <= 0f), Strength = strength, TimeLeftAlive = configuration.SecondsUntilFade, Position = ((RaycastHit)(ref val2)).point + new Vector3(0f, 0.001f, 0f), Rotation = Quaternion.LookRotation(((Component)__instance).transform.forward * -1f, ((RaycastHit)(ref val2)).normal) }; Singleton<GlowSteps>.Instance.footyManager.AddNewFootstep(footstepData); _leftFoots[__instance.playerSteamId] *= -1f; } } } } public class FootstepPool : ObjectPool<GlowingFootstep> { public FootstepPool() : base((Func<GlowingFootstep>)CreateNewFootstep, (Action<GlowingFootstep>)delegate(GlowingFootstep fs) { ((Component)fs).gameObject.SetActive(true); }, (Action<GlowingFootstep>)delegate(GlowingFootstep fs) { ((Component)fs).gameObject.SetActive(false); }, (Action<GlowingFootstep>)DestroyFootstep, true, 10, 10000) { } private static GlowingFootstep CreateNewFootstep() { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Expected O, but got Unknown Singleton<GlowSteps>.Logger.LogInfo((object)($"Creating new footstep object in pool. Object count {((ObjectPool<GlowingFootstep>)Singleton<GlowSteps>.Instance.footyManager.PooledObjects).CountAll} " + $"& active {((ObjectPool<GlowingFootstep>)Singleton<GlowSteps>.Instance.footyManager.PooledObjects).CountActive}")); GameObject val = new GameObject("Glow Step", new Type[1] { typeof(GlowingFootstep) }); val.transform.SetParent(((Component)Singleton<GlowSteps>.Instance.footyManager).transform); return val.GetComponent<GlowingFootstep>(); } private static void DestroyFootstep(GlowingFootstep footstep) { Singleton<GlowSteps>.Logger.LogInfo((object)($"Destroying footstep object in pool. Object count {((ObjectPool<GlowingFootstep>)Singleton<GlowSteps>.Instance.footyManager.PooledObjects).CountAll} " + $"& active {((ObjectPool<GlowingFootstep>)Singleton<GlowSteps>.Instance.footyManager.PooledObjects).CountActive}")); Object.Destroy((Object)(object)((Component)footstep).gameObject); } } [BepInDependency("NicholaScott.BepInEx.Utils", "1.2.0")] [BepInPlugin("NicholaScott.LethalCompany.GlowSteps", "Glow Steps", "1.1.2")] public class GlowSteps : BaseUnityPlugin { public struct Configuration { [ConfigEntryDefinition(Description = "The distance until footsteps are no longer visible.")] public float DistanceFalloff; public float SecondsUntilFade; [ConfigEntryDefinition(Description = "The rate to update footsteps. This should be kept <= 0.1")] public float UpdateRate; [ConfigEntryDefinition(Description = "Whether the footsteps show up only in the factory or outside as well.")] public bool InFactory; [ConfigEntryDefinition(Description = "Three normalized(0-1) numbers representing an RGB value.")] public Vector3 Color; } public readonly Dictionary<string, Texture2D> FootstepTexts = new Dictionary<string, Texture2D>(); public FootstepManager footyManager; public void Awake() { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) Singleton<GlowSteps>.Instance = this; Singleton<GlowSteps, Configuration>.Configuration = Extensions.BindStruct<Configuration>(((BaseUnityPlugin)this).Config, new Configuration { DistanceFalloff = 20f, SecondsUntilFade = 60f, InFactory = true, Color = new Vector3(0.1f, 1f, 0.1f), UpdateRate = 0.1f }); Vector2Int dimensions = default(Vector2Int); ((Vector2Int)(ref dimensions))..ctor(512, 512); LoadResource("LHeavy", dimensions); LoadResource("LMedium", dimensions); LoadResource("LLight", dimensions); LoadResource("RHeavy", dimensions); LoadResource("RMedium", dimensions); LoadResource("RLight", dimensions); Extensions.PatchAttribute<Production>(Assembly.GetExecutingAssembly(), ((BaseUnityPlugin)this).Info.Metadata.GUID, (Action<object>)((BaseUnityPlugin)this).Logger.LogInfo); } private void LoadResource(string resourceName, Vector2Int dimensions) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Expected O, but got Unknown Assembly executingAssembly = Assembly.GetExecutingAssembly(); string name = executingAssembly.GetName().Name + ".Images." + resourceName + ".png"; Texture2D val = new Texture2D(((Vector2Int)(ref dimensions)).x, ((Vector2Int)(ref dimensions)).y); ImageConversion.LoadImage(val, Extensions.ReadAllBytes(executingAssembly.GetManifestResourceStream(name))); FootstepTexts[resourceName] = val; } } } namespace NicholaScott.LethalCompany.GlowSteps.UnityScripts { public class GlowingFootstep : MonoBehaviour { public class Data : INetworkSerializable { public Vector3 Position; public Quaternion Rotation; public float TimeLeftAlive; public int Strength; public bool LeftFoot; public Vector3 Color; public bool ShouldDraw; public bool IsEnabled; public GlowingFootstep Linked; public float LastDistance; public void UpdateFootstepData(float delta) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)GameNetworkManager.Instance.localPlayerController != (Object)null) { LastDistance = Vector3.Distance(Position, GameNetworkManager.Instance.localPlayerController.playerEye.position); float distanceFalloff = Singleton<GlowSteps, GlowSteps.Configuration>.Configuration.DistanceFalloff; if (LastDistance <= distanceFalloff) { ShouldDraw = true; } if (LastDistance > distanceFalloff || TimeLeftAlive <= 0f) { ShouldDraw = false; } } else { ShouldDraw = false; } TimeLeftAlive -= delta; } public unsafe void NetworkSerialize<T>(BufferSerializer<T> serializer) where T : IReaderWriter { //IL_0027: 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_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) serializer.SerializeValue(ref Position); serializer.SerializeValue(ref Rotation); ((BufferSerializer<float>*)(&serializer))->SerializeValue<float>(ref TimeLeftAlive, default(ForPrimitives)); ((BufferSerializer<int>*)(&serializer))->SerializeValue<int>(ref Strength, default(ForPrimitives)); ((BufferSerializer<bool>*)(&serializer))->SerializeValue<bool>(ref LeftFoot, default(ForPrimitives)); serializer.SerializeValue(ref Color); } public static int SizeOf() { return 45; } } private Material _materialReference; private GameObject _subPlane; private static readonly int EmissiveExposureWeight = Shader.PropertyToID("_EmissiveExposureWeight"); private static readonly int EmissiveColorMode = Shader.PropertyToID("_EmissiveColorMode"); private static readonly int EmissiveColor = Shader.PropertyToID("_EmissiveColor"); private static readonly int BaseColorMap = Shader.PropertyToID("_BaseColorMap"); private static readonly int NormalMap = Shader.PropertyToID("_NormalMap"); private static readonly int MainTex = Shader.PropertyToID("_MainTex"); public void Awake() { //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) _materialReference = CreateNewMaterial(); _subPlane = GameObject.CreatePrimitive((PrimitiveType)4); _subPlane.GetComponent<Renderer>().material = _materialReference; _subPlane.GetComponent<Collider>().enabled = false; _subPlane.transform.SetParent(((Component)this).transform, false); _subPlane.transform.localScale = Vector3.one / 15f; } public void SyncAll(Data footstepData) { SyncTransform(footstepData); SyncMaterial(footstepData); SyncColorIntensity(footstepData); } private void SyncTransform(Data footstepData) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) Transform transform = ((Component)this).transform; transform.position = footstepData.Position; transform.rotation = footstepData.Rotation; } private void SyncMaterial(Data footstepData) { string key = (footstepData.LeftFoot ? "L" : "R") + ((footstepData.Strength >= 3) ? "Heavy" : ((footstepData.Strength >= 2) ? "Medium" : "Light")); Texture2D val = Singleton<GlowSteps>.Instance.FootstepTexts[key]; _materialReference.SetTexture(MainTex, (Texture)(object)val); _materialReference.SetTexture(BaseColorMap, (Texture)(object)val); } public void SyncColorIntensity(Data footstepData) { //IL_0091: 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) float num = Mathf.Clamp(footstepData.TimeLeftAlive, 0f, 30f) / 30f; GlowSteps.Configuration configuration = Singleton<GlowSteps, GlowSteps.Configuration>.Configuration; num = Mathf.Min(num, Mathf.Pow(Mathf.Clamp(2f - footstepData.LastDistance / configuration.DistanceFalloff, 0f, 1f), 4f)); _subPlane.GetComponent<Renderer>().material.SetVector(EmissiveColor, new Vector4(footstepData.Color.x, footstepData.Color.y, footstepData.Color.z, 1f) * num); } private static Material CreateNewMaterial() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) Material val = new Material(FootstepManager.CatwalkMaterial); val.SetTexture(NormalMap, (Texture)null); val.SetFloat(EmissiveColorMode, 1f); val.SetFloat(EmissiveExposureWeight, 1f); val.mainTextureScale = Vector2.one; val.color = Color.white; return val; } } }
BepInEx/plugins/RickArg-Helmet_Cameras/HelmetCamera.dll
Decompiled 11 months agousing System; using System.Collections; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using HarmonyLib; using UnityEngine; using UnityEngine.SceneManagement; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("HelmetCamera")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("HelmetCamera")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("b99c4d46-5f13-47b3-a5af-5e3f37772e77")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyVersion("1.0.0.0")] namespace HelmetCamera { [BepInPlugin("RickArg.lethalcompany.helmetcameras", "Helmet_Cameras", "2.1.5")] public class PluginInit : BaseUnityPlugin { public static Harmony _harmony; public static ConfigEntry<int> config_isHighQuality; public static ConfigEntry<int> config_renderDistance; public static ConfigEntry<int> config_cameraFps; private void Awake() { //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Expected O, but got Unknown config_isHighQuality = ((BaseUnityPlugin)this).Config.Bind<int>("MONITOR QUALITY", "monitorResolution", 0, "Low FPS affection. High Quality mode. 0 - vanilla (48x48), 1 - vanilla+ (128x128), 2 - mid quality (256x256), 3 - high quality (512x512), 4 - Very High Quality (1024x1024)"); config_renderDistance = ((BaseUnityPlugin)this).Config.Bind<int>("MONITOR QUALITY", "renderDistance", 20, "Low FPS affection. Render distance for helmet camera."); config_cameraFps = ((BaseUnityPlugin)this).Config.Bind<int>("MONITOR QUALITY", "cameraFps", 30, "Very high FPS affection. FPS for helmet camera. To increase YOUR fps, you should low cameraFps value."); _harmony = new Harmony("HelmetCamera"); _harmony.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin Helmet_Cameras is loaded with version 2.1.5!"); ((BaseUnityPlugin)this).Logger.LogInfo((object)"--------Helmet camera patch done.---------"); } } public static class PluginInfo { public const string PLUGIN_GUID = "RickArg.lethalcompany.helmetcameras"; public const string PLUGIN_NAME = "Helmet_Cameras"; public const string PLUGIN_VERSION = "2.1.5"; } public class Plugin : MonoBehaviour { private RenderTexture renderTexture; private bool isMonitorChanged = false; private GameObject helmetCameraNew; private bool isSceneLoaded = false; private bool isCoroutineStarted = false; private int currentTransformIndex; private int resolution = 0; private int renderDistance = 50; private float cameraFps = 30f; private float elapsed; private void Awake() { //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Expected O, but got Unknown //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Expected O, but got Unknown //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Expected O, but got Unknown //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Expected O, but got Unknown //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Expected O, but got Unknown resolution = PluginInit.config_isHighQuality.Value; renderDistance = PluginInit.config_renderDistance.Value; cameraFps = PluginInit.config_cameraFps.Value; switch (resolution) { case 0: renderTexture = new RenderTexture(48, 48, 24); break; case 1: renderTexture = new RenderTexture(128, 128, 24); break; case 2: renderTexture = new RenderTexture(256, 256, 24); break; case 3: renderTexture = new RenderTexture(512, 512, 24); break; case 4: renderTexture = new RenderTexture(1024, 1024, 24); break; } } public void Start() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) isCoroutineStarted = false; while ((Object)(object)helmetCameraNew == (Object)null) { helmetCameraNew = new GameObject("HelmetCamera"); } Scene activeScene = SceneManager.GetActiveScene(); if (((Scene)(ref activeScene)).name != "MainMenu") { activeScene = SceneManager.GetActiveScene(); if (((Scene)(ref activeScene)).name != "InitScene") { activeScene = SceneManager.GetActiveScene(); if (((Scene)(ref activeScene)).name != "InitSceneLaunchOptions") { isSceneLoaded = true; Debug.Log((object)"[HELMET_CAMERAS] Starting coroutine..."); ((MonoBehaviour)this).StartCoroutine(LoadSceneEnter()); return; } } } isSceneLoaded = false; isMonitorChanged = false; } private IEnumerator LoadSceneEnter() { Debug.Log((object)"[HELMET_CAMERAS] 5 seconds for init mode... Please wait..."); yield return (object)new WaitForSeconds(5f); isCoroutineStarted = true; if ((Object)(object)GameObject.Find("Environment/HangarShip/Cameras/ShipCamera") != (Object)null) { Debug.Log((object)"[HELMET_CAMERAS] Ship camera founded..."); if (!isMonitorChanged) { ((Renderer)GameObject.Find("Environment/HangarShip/ShipModels2b/MonitorWall/Cube").GetComponent<MeshRenderer>()).materials[2].mainTexture = ((Renderer)GameObject.Find("Environment/HangarShip/ShipModels2b/MonitorWall/Cube.001").GetComponent<MeshRenderer>()).materials[2].mainTexture; ((Renderer)GameObject.Find("Environment/HangarShip/ShipModels2b/MonitorWall/Cube.001").GetComponent<MeshRenderer>()).materials[2].mainTexture = (Texture)(object)renderTexture; helmetCameraNew.AddComponent<Camera>(); ((Behaviour)helmetCameraNew.GetComponent<Camera>()).enabled = false; helmetCameraNew.GetComponent<Camera>().targetTexture = renderTexture; helmetCameraNew.GetComponent<Camera>().cullingMask = 20649983; helmetCameraNew.GetComponent<Camera>().farClipPlane = renderDistance; helmetCameraNew.GetComponent<Camera>().nearClipPlane = 0.55f; isMonitorChanged = true; Debug.Log((object)"[HELMET_CAMERAS] Monitors were changed..."); Debug.Log((object)"[HELMET_CAMERAS] Turning off vanilla internal ship camera"); ((Behaviour)GameObject.Find("Environment/HangarShip/Cameras/ShipCamera").GetComponent<Camera>()).enabled = false; } } } public void Update() { //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0263: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) bool flag = isSceneLoaded && isCoroutineStarted; if (flag && StartOfRound.Instance.localPlayerController.isInHangarShipRoom) { helmetCameraNew.SetActive(true); elapsed += Time.deltaTime; if (elapsed > 1f / cameraFps) { elapsed = 0f; ((Behaviour)helmetCameraNew.GetComponent<Camera>()).enabled = true; } else { ((Behaviour)helmetCameraNew.GetComponent<Camera>()).enabled = false; } GameObject val = GameObject.Find("Environment/HangarShip/ShipModels2b/MonitorWall/Cube.001/CameraMonitorScript"); currentTransformIndex = val.GetComponent<ManualCameraRenderer>().targetTransformIndex; TransformAndName val2 = val.GetComponent<ManualCameraRenderer>().radarTargets[currentTransformIndex]; if (!val2.isNonPlayer) { try { helmetCameraNew.transform.SetPositionAndRotation(val2.transform.Find("ScavengerModel/metarig/CameraContainer/MainCamera/HelmetLights").position + new Vector3(0f, 0f, 0f), val2.transform.Find("ScavengerModel/metarig/CameraContainer/MainCamera/HelmetLights").rotation * Quaternion.Euler(0f, 0f, 0f)); DeadBodyInfo[] array = Object.FindObjectsOfType<DeadBodyInfo>(); for (int i = 0; i < array.Length; i++) { if (array[i].playerScript.playerUsername == val2.name) { helmetCameraNew.transform.SetPositionAndRotation(((Component)array[i]).gameObject.transform.Find("spine.001/spine.002/spine.003").position, ((Component)array[i]).gameObject.transform.Find("spine.001/spine.002/spine.003").rotation * Quaternion.Euler(0f, 0f, 0f)); } } return; } catch (NullReferenceException) { Debug.Log((object)"[HELMET_CAMERAS] ERROR NULL REFERENCE"); return; } } helmetCameraNew.transform.SetPositionAndRotation(val2.transform.position + new Vector3(0f, 1.6f, 0f), val2.transform.rotation * Quaternion.Euler(0f, -90f, 0f)); } else if (flag && !StartOfRound.Instance.localPlayerController.isInHangarShipRoom) { helmetCameraNew.SetActive(false); } } } } namespace HelmetCamera.Patches { [HarmonyPatch] internal class HelmetCamera { public static void InitCameras() { GameObject val = GameObject.Find("Environment/HangarShip/Cameras/ShipCamera"); val.AddComponent<Plugin>(); } [HarmonyPatch(typeof(StartOfRound), "Start")] [HarmonyPostfix] public static void InitCamera(ref ManualCameraRenderer __instance) { InitCameras(); } } }
BepInEx/plugins/RugbugRedfern-Skinwalkers/SkinwalkerMod.dll
Decompiled 11 months agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using Dissonance.Config; using HarmonyLib; using Unity.Netcode; using UnityEngine; using UnityEngine.Networking; using UnityEngine.SceneManagement; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("SkinwalkerMod")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("SkinwalkerMod")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("fd4979a2-cef0-46af-8bf8-97e630b11475")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyVersion("1.0.0.0")] internal class <Module> { static <Module>() { NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy<bool>(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable<bool>(); NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy<float>(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable<float>(); } } namespace SkinwalkerMod; [BepInPlugin("RugbugRedfern.SkinwalkerMod", "Skinwalker Mod", "1.0.8")] internal class PluginLoader : BaseUnityPlugin { private readonly Harmony harmony = new Harmony("RugbugRedfern.SkinwalkerMod"); private const string modGUID = "RugbugRedfern.SkinwalkerMod"; private const string modVersion = "1.0.8"; private static bool initialized; public static PluginLoader Instance { get; private set; } private void Awake() { //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Expected O, but got Unknown if (initialized) { return; } initialized = true; Instance = this; harmony.PatchAll(Assembly.GetExecutingAssembly()); Type[] types = Assembly.GetExecutingAssembly().GetTypes(); Type[] array = types; foreach (Type type in array) { MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); MethodInfo[] array2 = methods; foreach (MethodInfo methodInfo in array2) { object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false); if (customAttributes.Length != 0) { methodInfo.Invoke(null, null); } } } SkinwalkerLogger.Initialize("RugbugRedfern.SkinwalkerMod"); SkinwalkerLogger.Log("SKINWALKER MOD STARTING UP 1.0.8"); SkinwalkerConfig.InitConfig(); SceneManager.sceneLoaded += SkinwalkerNetworkManagerHandler.ClientConnectInitializer; GameObject val = new GameObject("Skinwalker Mod"); val.AddComponent<SkinwalkerModPersistent>(); ((Object)val).hideFlags = (HideFlags)61; Object.DontDestroyOnLoad((Object)(object)val); } public void BindConfig<T>(ref ConfigEntry<T> config, string section, string key, T defaultValue, string description = "") { config = ((BaseUnityPlugin)this).Config.Bind<T>(section, key, defaultValue, description); } } internal class SkinwalkerBehaviour : MonoBehaviour { private AudioSource audioSource; public const float PLAY_INTERVAL_MIN = 15f; public const float PLAY_INTERVAL_MAX = 40f; private const float MAX_DIST = 100f; private float nextTimeToPlayAudio; private EnemyAI ai; public void Initialize(EnemyAI ai) { this.ai = ai; audioSource = ai.creatureVoice; SetNextTime(); } private void Update() { //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) if (!(Time.time > nextTimeToPlayAudio)) { return; } SetNextTime(); float num = -1f; if (Object.op_Implicit((Object)(object)ai) && !ai.isEnemyDead) { if ((Object)(object)GameNetworkManager.Instance == (Object)null || (Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)null || (num = Vector3.Distance(((Component)GameNetworkManager.Instance.localPlayerController).transform.position, ((Component)this).transform.position)) < 100f) { AudioClip sample = SkinwalkerModPersistent.Instance.GetSample(); if (Object.op_Implicit((Object)(object)sample)) { SkinwalkerLogger.Log(((Object)this).name + " played voice line 1"); audioSource.PlayOneShot(sample); } else { SkinwalkerLogger.Log(((Object)this).name + " played voice line 0"); } } else { SkinwalkerLogger.Log(((Object)this).name + " played voice line no (too far away) " + num); } } else { SkinwalkerLogger.Log(((Object)this).name + " played voice line no (dead) EnemyAI: " + (object)ai); } } private void SetNextTime() { if (SkinwalkerNetworkManager.Instance.VoiceLineFrequency.Value <= 0f) { nextTimeToPlayAudio = Time.time + 100000000f; } else { nextTimeToPlayAudio = Time.time + Random.Range(15f, 40f) / SkinwalkerNetworkManager.Instance.VoiceLineFrequency.Value; } } private T CopyComponent<T>(T original, GameObject destination) where T : Component { Type type = ((object)original).GetType(); Component val = destination.AddComponent(type); FieldInfo[] fields = type.GetFields(); FieldInfo[] array = fields; foreach (FieldInfo fieldInfo in array) { fieldInfo.SetValue(val, fieldInfo.GetValue(original)); } return (T)(object)((val is T) ? val : null); } } internal class SkinwalkerConfig { public static ConfigEntry<bool> VoiceEnabled_BaboonHawk; public static ConfigEntry<bool> VoiceEnabled_Bracken; public static ConfigEntry<bool> VoiceEnabled_BunkerSpider; public static ConfigEntry<bool> VoiceEnabled_Centipede; public static ConfigEntry<bool> VoiceEnabled_CoilHead; public static ConfigEntry<bool> VoiceEnabled_EyelessDog; public static ConfigEntry<bool> VoiceEnabled_ForestGiant; public static ConfigEntry<bool> VoiceEnabled_GhostGirl; public static ConfigEntry<bool> VoiceEnabled_GiantWorm; public static ConfigEntry<bool> VoiceEnabled_HoardingBug; public static ConfigEntry<bool> VoiceEnabled_Hygrodere; public static ConfigEntry<bool> VoiceEnabled_Jester; public static ConfigEntry<bool> VoiceEnabled_Masked; public static ConfigEntry<bool> VoiceEnabled_Nutcracker; public static ConfigEntry<bool> VoiceEnabled_SporeLizard; public static ConfigEntry<bool> VoiceEnabled_Thumper; public static ConfigEntry<float> VoiceLineFrequency; public static void InitConfig() { PluginLoader.Instance.BindConfig(ref VoiceLineFrequency, "Voice Settings", "VoiceLineFrequency", 1f, "1 is the default, and voice lines will occur every " + 15f.ToString("0") + " to " + 40f.ToString("0") + " seconds per enemy. Setting this to 2 means they will occur twice as often, 0.5 means half as often, etc."); PluginLoader.Instance.BindConfig(ref VoiceEnabled_BaboonHawk, "Monster Voices", "Baboon Hawk", defaultValue: true); PluginLoader.Instance.BindConfig(ref VoiceEnabled_Bracken, "Monster Voices", "Bracken", defaultValue: true); PluginLoader.Instance.BindConfig(ref VoiceEnabled_BunkerSpider, "Monster Voices", "Bunker Spider", defaultValue: true); PluginLoader.Instance.BindConfig(ref VoiceEnabled_Centipede, "Monster Voices", "Centipede", defaultValue: true); PluginLoader.Instance.BindConfig(ref VoiceEnabled_CoilHead, "Monster Voices", "Coil Head", defaultValue: true); PluginLoader.Instance.BindConfig(ref VoiceEnabled_EyelessDog, "Monster Voices", "Eyeless Dog", defaultValue: true); PluginLoader.Instance.BindConfig(ref VoiceEnabled_ForestGiant, "Monster Voices", "Forest Giant", defaultValue: false); PluginLoader.Instance.BindConfig(ref VoiceEnabled_GhostGirl, "Monster Voices", "Ghost Girl", defaultValue: true); PluginLoader.Instance.BindConfig(ref VoiceEnabled_GiantWorm, "Monster Voices", "Giant Worm", defaultValue: false); PluginLoader.Instance.BindConfig(ref VoiceEnabled_HoardingBug, "Monster Voices", "Hoarding Bug", defaultValue: true); PluginLoader.Instance.BindConfig(ref VoiceEnabled_Hygrodere, "Monster Voices", "Hygrodere", defaultValue: false); PluginLoader.Instance.BindConfig(ref VoiceEnabled_Jester, "Monster Voices", "Jester", defaultValue: true); PluginLoader.Instance.BindConfig(ref VoiceEnabled_Masked, "Monster Voices", "Masked", defaultValue: true); PluginLoader.Instance.BindConfig(ref VoiceEnabled_Nutcracker, "Monster Voices", "Nutcracker", defaultValue: true); PluginLoader.Instance.BindConfig(ref VoiceEnabled_SporeLizard, "Monster Voices", "Spore Lizard", defaultValue: true); PluginLoader.Instance.BindConfig(ref VoiceEnabled_Thumper, "Monster Voices", "Thumper", defaultValue: true); SkinwalkerLogger.Log("VoiceEnabled_BaboonHawk" + $" VALUE LOADED FROM CONFIG: [{VoiceEnabled_BaboonHawk.Value}]"); SkinwalkerLogger.Log("VoiceEnabled_Bracken" + $" VALUE LOADED FROM CONFIG: [{VoiceEnabled_Bracken.Value}]"); SkinwalkerLogger.Log("VoiceEnabled_BunkerSpider" + $" VALUE LOADED FROM CONFIG: [{VoiceEnabled_BunkerSpider.Value}]"); SkinwalkerLogger.Log("VoiceEnabled_Centipede" + $" VALUE LOADED FROM CONFIG: [{VoiceEnabled_Centipede.Value}]"); SkinwalkerLogger.Log("VoiceEnabled_CoilHead" + $" VALUE LOADED FROM CONFIG: [{VoiceEnabled_CoilHead.Value}]"); SkinwalkerLogger.Log("VoiceEnabled_EyelessDog" + $" VALUE LOADED FROM CONFIG: [{VoiceEnabled_EyelessDog.Value}]"); SkinwalkerLogger.Log("VoiceEnabled_ForestGiant" + $" VALUE LOADED FROM CONFIG: [{VoiceEnabled_ForestGiant.Value}]"); SkinwalkerLogger.Log("VoiceEnabled_GhostGirl" + $" VALUE LOADED FROM CONFIG: [{VoiceEnabled_GhostGirl.Value}]"); SkinwalkerLogger.Log("VoiceEnabled_GiantWorm" + $" VALUE LOADED FROM CONFIG: [{VoiceEnabled_GiantWorm.Value}]"); SkinwalkerLogger.Log("VoiceEnabled_HoardingBug" + $" VALUE LOADED FROM CONFIG: [{VoiceEnabled_HoardingBug.Value}]"); SkinwalkerLogger.Log("VoiceEnabled_Hygrodere" + $" VALUE LOADED FROM CONFIG: [{VoiceEnabled_Hygrodere.Value}]"); SkinwalkerLogger.Log("VoiceEnabled_Jester" + $" VALUE LOADED FROM CONFIG: [{VoiceEnabled_Jester.Value}]"); SkinwalkerLogger.Log("VoiceEnabled_Masked" + $" VALUE LOADED FROM CONFIG: [{VoiceEnabled_Masked.Value}]"); SkinwalkerLogger.Log("VoiceEnabled_Nutcracker" + $" VALUE LOADED FROM CONFIG: [{VoiceEnabled_Nutcracker.Value}]"); SkinwalkerLogger.Log("VoiceEnabled_SporeLizard" + $" VALUE LOADED FROM CONFIG: [{VoiceEnabled_SporeLizard.Value}]"); SkinwalkerLogger.Log("VoiceEnabled_Thumper" + $" VALUE LOADED FROM CONFIG: [{VoiceEnabled_Thumper.Value}]"); SkinwalkerLogger.Log("VoiceLineFrequency" + $" VALUE LOADED FROM CONFIG: [{VoiceLineFrequency.Value}]"); } } internal static class SkinwalkerLogger { internal static ManualLogSource logSource; public static void Initialize(string modGUID) { logSource = Logger.CreateLogSource(modGUID); } public static void Log(object message) { logSource.LogInfo(message); } public static void LogError(object message) { logSource.LogError(message); } public static void LogWarning(object message) { logSource.LogWarning(message); } } public class SkinwalkerModPersistent : MonoBehaviour { private string audioFolder; private List<AudioClip> cachedAudio = new List<AudioClip>(); private float nextTimeToCheckFolder = 30f; private float nextTimeToCheckEnemies = 30f; private const float folderScanInterval = 8f; private const float enemyScanInterval = 5f; public static SkinwalkerModPersistent Instance { get; private set; } private void Awake() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) Instance = this; ((Component)this).transform.position = Vector3.zero; SkinwalkerLogger.Log("Skinwalker Mod Object Initialized"); audioFolder = Path.Combine(Application.dataPath, "..", "Dissonance_Diagnostics"); EnableRecording(); if (!Directory.Exists(audioFolder)) { Directory.CreateDirectory(audioFolder); } } private void Start() { try { if (Directory.Exists(audioFolder)) { Directory.Delete(audioFolder, recursive: true); } } catch (Exception message) { SkinwalkerLogger.Log(message); } } private void OnApplicationQuit() { DisableRecording(); } private void EnableRecording() { DebugSettings.Instance.EnablePlaybackDiagnostics = true; DebugSettings.Instance.RecordFinalAudio = true; } private void Update() { if (Time.realtimeSinceStartup > nextTimeToCheckFolder) { nextTimeToCheckFolder = Time.realtimeSinceStartup + 8f; if (!Directory.Exists(audioFolder)) { SkinwalkerLogger.Log("Audio folder not present. Don't worry about it, it will be created automatically when you play with friends. (" + audioFolder + ")"); return; } string[] files = Directory.GetFiles(audioFolder); SkinwalkerLogger.Log($"Got audio file paths ({files.Length})"); string[] array = files; foreach (string path in array) { ((MonoBehaviour)this).StartCoroutine(LoadWavFile(path, delegate(AudioClip audioClip) { cachedAudio.Add(audioClip); })); } } if (!(Time.realtimeSinceStartup > nextTimeToCheckEnemies)) { return; } nextTimeToCheckEnemies = Time.realtimeSinceStartup + 5f; EnemyAI[] array2 = Object.FindObjectsOfType<EnemyAI>(true); EnemyAI[] array3 = array2; SkinwalkerBehaviour skinwalkerBehaviour = default(SkinwalkerBehaviour); foreach (EnemyAI val in array3) { SkinwalkerLogger.Log("IsEnemyEnabled " + ((Object)val).name + " " + IsEnemyEnabled(val)); if (IsEnemyEnabled(val) && !((Component)val).TryGetComponent<SkinwalkerBehaviour>(ref skinwalkerBehaviour)) { ((Component)val).gameObject.AddComponent<SkinwalkerBehaviour>().Initialize(val); } } } private bool IsEnemyEnabled(EnemyAI enemy) { if ((Object)(object)enemy == (Object)null) { return false; } return ((Object)((Component)enemy).gameObject).name switch { "MaskedPlayerEnemy(Clone)" => SkinwalkerNetworkManager.Instance.VoiceEnabled_Masked.Value, "NutcrackerEnemy(Clone)" => SkinwalkerNetworkManager.Instance.VoiceEnabled_Nutcracker.Value, "BaboonHawkEnemy(Clone)" => SkinwalkerNetworkManager.Instance.VoiceEnabled_BaboonHawk.Value, "Flowerman(Clone)" => SkinwalkerNetworkManager.Instance.VoiceEnabled_Bracken.Value, "SandSpider(Clone)" => SkinwalkerNetworkManager.Instance.VoiceEnabled_BunkerSpider.Value, "RedLocustBees(Clone)" => false, "Centipede(Clone)" => SkinwalkerNetworkManager.Instance.VoiceEnabled_Centipede.Value, "SpringMan(Clone)" => SkinwalkerNetworkManager.Instance.VoiceEnabled_CoilHead.Value, "MouthDog(Clone)" => SkinwalkerNetworkManager.Instance.VoiceEnabled_EyelessDog.Value, "ForestGiant(Clone)" => SkinwalkerNetworkManager.Instance.VoiceEnabled_ForestGiant.Value, "DressGirl(Clone)" => SkinwalkerNetworkManager.Instance.VoiceEnabled_GhostGirl.Value, "SandWorm(Clone)" => SkinwalkerNetworkManager.Instance.VoiceEnabled_GiantWorm.Value, "HoarderBug(Clone)" => SkinwalkerNetworkManager.Instance.VoiceEnabled_HoardingBug.Value, "Blob(Clone)" => SkinwalkerNetworkManager.Instance.VoiceEnabled_Hygrodere.Value, "JesterEnemy(Clone)" => SkinwalkerNetworkManager.Instance.VoiceEnabled_Jester.Value, "PufferEnemy(Clone)" => SkinwalkerNetworkManager.Instance.VoiceEnabled_SporeLizard.Value, "Crawler(Clone)" => SkinwalkerNetworkManager.Instance.VoiceEnabled_Thumper.Value, "DocileLocustBees(Clone)" => false, "DoublewingedBird(Clone)" => false, _ => true, }; } internal IEnumerator LoadWavFile(string path, Action<AudioClip> callback) { UnityWebRequest www = UnityWebRequestMultimedia.GetAudioClip(path, (AudioType)20); try { yield return www.SendWebRequest(); if ((int)www.result == 1) { SkinwalkerLogger.Log("Loaded clip from path " + path); AudioClip audioClip = DownloadHandlerAudioClip.GetContent(www); if (audioClip.length > 0.9f) { callback(audioClip); } try { File.Delete(path); } catch (Exception e) { SkinwalkerLogger.LogWarning(e); } } } finally { ((IDisposable)www)?.Dispose(); } } private void DisableRecording() { DebugSettings.Instance.EnablePlaybackDiagnostics = false; DebugSettings.Instance.RecordFinalAudio = false; if (Directory.Exists(audioFolder)) { Directory.Delete(audioFolder, recursive: true); } } public AudioClip GetSample() { if (cachedAudio.Count > 0) { int index = Random.Range(0, cachedAudio.Count - 1); AudioClip result = cachedAudio[index]; cachedAudio.RemoveAt(index); return result; } while (cachedAudio.Count > 200) { cachedAudio.RemoveAt(0); } return null; } public void ClearCache() { cachedAudio.Clear(); } } internal static class SkinwalkerNetworkManagerHandler { internal static void ClientConnectInitializer(Scene sceneName, LoadSceneMode sceneEnum) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown if (((Scene)(ref sceneName)).name == "SampleSceneRelay") { GameObject val = new GameObject("SkinwalkerNetworkManager"); val.AddComponent<NetworkObject>(); val.AddComponent<SkinwalkerNetworkManager>(); Debug.Log((object)"Initialized SkinwalkerNetworkManager"); } } } internal class SkinwalkerNetworkManager : NetworkBehaviour { public NetworkVariable<bool> VoiceEnabled_BaboonHawk = new NetworkVariable<bool>(true, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable<bool> VoiceEnabled_Bracken = new NetworkVariable<bool>(true, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable<bool> VoiceEnabled_BunkerSpider = new NetworkVariable<bool>(true, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable<bool> VoiceEnabled_Centipede = new NetworkVariable<bool>(true, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable<bool> VoiceEnabled_CoilHead = new NetworkVariable<bool>(true, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable<bool> VoiceEnabled_EyelessDog = new NetworkVariable<bool>(true, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable<bool> VoiceEnabled_ForestGiant = new NetworkVariable<bool>(true, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable<bool> VoiceEnabled_GhostGirl = new NetworkVariable<bool>(true, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable<bool> VoiceEnabled_GiantWorm = new NetworkVariable<bool>(true, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable<bool> VoiceEnabled_HoardingBug = new NetworkVariable<bool>(true, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable<bool> VoiceEnabled_Hygrodere = new NetworkVariable<bool>(true, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable<bool> VoiceEnabled_Jester = new NetworkVariable<bool>(true, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable<bool> VoiceEnabled_Masked = new NetworkVariable<bool>(true, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable<bool> VoiceEnabled_Nutcracker = new NetworkVariable<bool>(true, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable<bool> VoiceEnabled_SporeLizard = new NetworkVariable<bool>(true, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable<bool> VoiceEnabled_Thumper = new NetworkVariable<bool>(true, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable<float> VoiceLineFrequency = new NetworkVariable<float>(1f, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public static SkinwalkerNetworkManager Instance { get; private set; } private void Awake() { Instance = this; if (GameNetworkManager.Instance.isHostingGame) { VoiceEnabled_BaboonHawk.Value = SkinwalkerConfig.VoiceEnabled_BaboonHawk.Value; VoiceEnabled_Bracken.Value = SkinwalkerConfig.VoiceEnabled_Bracken.Value; VoiceEnabled_BunkerSpider.Value = SkinwalkerConfig.VoiceEnabled_BunkerSpider.Value; VoiceEnabled_Centipede.Value = SkinwalkerConfig.VoiceEnabled_Centipede.Value; VoiceEnabled_CoilHead.Value = SkinwalkerConfig.VoiceEnabled_CoilHead.Value; VoiceEnabled_EyelessDog.Value = SkinwalkerConfig.VoiceEnabled_EyelessDog.Value; VoiceEnabled_ForestGiant.Value = SkinwalkerConfig.VoiceEnabled_ForestGiant.Value; VoiceEnabled_GhostGirl.Value = SkinwalkerConfig.VoiceEnabled_GhostGirl.Value; VoiceEnabled_GiantWorm.Value = SkinwalkerConfig.VoiceEnabled_GiantWorm.Value; VoiceEnabled_HoardingBug.Value = SkinwalkerConfig.VoiceEnabled_HoardingBug.Value; VoiceEnabled_Hygrodere.Value = SkinwalkerConfig.VoiceEnabled_Hygrodere.Value; VoiceEnabled_Jester.Value = SkinwalkerConfig.VoiceEnabled_Jester.Value; VoiceEnabled_Masked.Value = SkinwalkerConfig.VoiceEnabled_Masked.Value; VoiceEnabled_Nutcracker.Value = SkinwalkerConfig.VoiceEnabled_Nutcracker.Value; VoiceEnabled_SporeLizard.Value = SkinwalkerConfig.VoiceEnabled_SporeLizard.Value; VoiceEnabled_Thumper.Value = SkinwalkerConfig.VoiceEnabled_Thumper.Value; VoiceLineFrequency.Value = SkinwalkerConfig.VoiceLineFrequency.Value; SkinwalkerLogger.Log("HOST SENDING CONFIG TO CLIENTS"); } SkinwalkerLogger.Log("SkinwalkerNetworkManager Awake"); } public override void OnDestroy() { ((NetworkBehaviour)this).OnDestroy(); SkinwalkerLogger.Log("SkinwalkerNetworkManager OnDestroy"); SkinwalkerModPersistent.Instance?.ClearCache(); } protected override void __initializeVariables() { if (VoiceEnabled_BaboonHawk == null) { throw new Exception("SkinwalkerNetworkManager.VoiceEnabled_BaboonHawk cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)VoiceEnabled_BaboonHawk).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)VoiceEnabled_BaboonHawk, "VoiceEnabled_BaboonHawk"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)VoiceEnabled_BaboonHawk); if (VoiceEnabled_Bracken == null) { throw new Exception("SkinwalkerNetworkManager.VoiceEnabled_Bracken cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)VoiceEnabled_Bracken).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)VoiceEnabled_Bracken, "VoiceEnabled_Bracken"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)VoiceEnabled_Bracken); if (VoiceEnabled_BunkerSpider == null) { throw new Exception("SkinwalkerNetworkManager.VoiceEnabled_BunkerSpider cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)VoiceEnabled_BunkerSpider).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)VoiceEnabled_BunkerSpider, "VoiceEnabled_BunkerSpider"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)VoiceEnabled_BunkerSpider); if (VoiceEnabled_Centipede == null) { throw new Exception("SkinwalkerNetworkManager.VoiceEnabled_Centipede cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)VoiceEnabled_Centipede).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)VoiceEnabled_Centipede, "VoiceEnabled_Centipede"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)VoiceEnabled_Centipede); if (VoiceEnabled_CoilHead == null) { throw new Exception("SkinwalkerNetworkManager.VoiceEnabled_CoilHead cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)VoiceEnabled_CoilHead).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)VoiceEnabled_CoilHead, "VoiceEnabled_CoilHead"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)VoiceEnabled_CoilHead); if (VoiceEnabled_EyelessDog == null) { throw new Exception("SkinwalkerNetworkManager.VoiceEnabled_EyelessDog cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)VoiceEnabled_EyelessDog).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)VoiceEnabled_EyelessDog, "VoiceEnabled_EyelessDog"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)VoiceEnabled_EyelessDog); if (VoiceEnabled_ForestGiant == null) { throw new Exception("SkinwalkerNetworkManager.VoiceEnabled_ForestGiant cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)VoiceEnabled_ForestGiant).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)VoiceEnabled_ForestGiant, "VoiceEnabled_ForestGiant"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)VoiceEnabled_ForestGiant); if (VoiceEnabled_GhostGirl == null) { throw new Exception("SkinwalkerNetworkManager.VoiceEnabled_GhostGirl cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)VoiceEnabled_GhostGirl).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)VoiceEnabled_GhostGirl, "VoiceEnabled_GhostGirl"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)VoiceEnabled_GhostGirl); if (VoiceEnabled_GiantWorm == null) { throw new Exception("SkinwalkerNetworkManager.VoiceEnabled_GiantWorm cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)VoiceEnabled_GiantWorm).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)VoiceEnabled_GiantWorm, "VoiceEnabled_GiantWorm"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)VoiceEnabled_GiantWorm); if (VoiceEnabled_HoardingBug == null) { throw new Exception("SkinwalkerNetworkManager.VoiceEnabled_HoardingBug cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)VoiceEnabled_HoardingBug).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)VoiceEnabled_HoardingBug, "VoiceEnabled_HoardingBug"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)VoiceEnabled_HoardingBug); if (VoiceEnabled_Hygrodere == null) { throw new Exception("SkinwalkerNetworkManager.VoiceEnabled_Hygrodere cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)VoiceEnabled_Hygrodere).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)VoiceEnabled_Hygrodere, "VoiceEnabled_Hygrodere"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)VoiceEnabled_Hygrodere); if (VoiceEnabled_Jester == null) { throw new Exception("SkinwalkerNetworkManager.VoiceEnabled_Jester cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)VoiceEnabled_Jester).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)VoiceEnabled_Jester, "VoiceEnabled_Jester"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)VoiceEnabled_Jester); if (VoiceEnabled_Masked == null) { throw new Exception("SkinwalkerNetworkManager.VoiceEnabled_Masked cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)VoiceEnabled_Masked).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)VoiceEnabled_Masked, "VoiceEnabled_Masked"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)VoiceEnabled_Masked); if (VoiceEnabled_Nutcracker == null) { throw new Exception("SkinwalkerNetworkManager.VoiceEnabled_Nutcracker cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)VoiceEnabled_Nutcracker).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)VoiceEnabled_Nutcracker, "VoiceEnabled_Nutcracker"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)VoiceEnabled_Nutcracker); if (VoiceEnabled_SporeLizard == null) { throw new Exception("SkinwalkerNetworkManager.VoiceEnabled_SporeLizard cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)VoiceEnabled_SporeLizard).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)VoiceEnabled_SporeLizard, "VoiceEnabled_SporeLizard"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)VoiceEnabled_SporeLizard); if (VoiceEnabled_Thumper == null) { throw new Exception("SkinwalkerNetworkManager.VoiceEnabled_Thumper cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)VoiceEnabled_Thumper).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)VoiceEnabled_Thumper, "VoiceEnabled_Thumper"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)VoiceEnabled_Thumper); if (VoiceLineFrequency == null) { throw new Exception("SkinwalkerNetworkManager.VoiceLineFrequency cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)VoiceLineFrequency).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)VoiceLineFrequency, "VoiceLineFrequency"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)VoiceLineFrequency); ((NetworkBehaviour)this).__initializeVariables(); } protected internal override string __getTypeName() { return "SkinwalkerNetworkManager"; } }
BepInEx/plugins/Sligili-More_Emotes/MoreEmotes1.2.2.dll
Decompiled 11 months agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using GameNetcodeStuff; using HarmonyLib; using MoreEmotes.Patch; using Tools; using Unity.Netcode; using UnityEngine; using UnityEngine.Events; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; using UnityEngine.InputSystem.Utilities; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("FuckYouMod")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("FuckYouMod")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("5ecc2bf2-af12-4e83-a6f1-cf2eacbf3060")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace Tools { public class Reflection { public static object GetInstanceField(Type type, object instance, string fieldName) { BindingFlags bindingAttr = BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic; FieldInfo field = type.GetField(fieldName, bindingAttr); return field.GetValue(instance); } public static object CallMethod(object instance, string methodName, params object[] args) { MethodInfo method = instance.GetType().GetMethod(methodName, BindingFlags.Instance | BindingFlags.NonPublic); if (method != null) { return method.Invoke(instance, args); } return null; } } } namespace MoreEmotes { [BepInPlugin("MoreEmotes", "MoreEmotes-Sligili", "1.2.2")] public class FuckYouModInitialization : BaseUnityPlugin { private Harmony _harmony; private ConfigEntry<string> config_KeyWheel; private ConfigEntry<bool> config_InventoryCheck; private ConfigEntry<string> config_KeyEmote3; private ConfigEntry<string> config_KeyEmote4; private ConfigEntry<string> config_KeyEmote5; private ConfigEntry<string> config_KeyEmote6; private ConfigEntry<string> config_KeyEmote7; private ConfigEntry<string> config_KeyEmote8; private void Awake() { //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Expected O, but got Unknown ((BaseUnityPlugin)this).Logger.LogInfo((object)"MoreEmotes loaded"); EmotePatch.animationsBundle = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "MoreEmotes/animationsbundle")); EmotePatch.animatorBundle = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "MoreEmotes/animatorbundle")); EmotePatch.local = EmotePatch.animatorBundle.LoadAsset<RuntimeAnimatorController>("Assets/MoreEmotes/NEWmetarig.controller"); EmotePatch.others = EmotePatch.animatorBundle.LoadAsset<RuntimeAnimatorController>("Assets/MoreEmotes/NEWmetarigOtherPlayers.controller"); CustomAudioAnimationEvent.claps[0] = EmotePatch.animationsBundle.LoadAsset<AudioClip>("Assets/MoreEmotes/SingleClapEmote1.wav"); CustomAudioAnimationEvent.claps[1] = EmotePatch.animationsBundle.LoadAsset<AudioClip>("Assets/MoreEmotes/SingleClapEmote2.wav"); ConfigFile(); IncompatibilityAids(); _harmony = new Harmony("MoreEmotes"); _harmony.PatchAll(typeof(EmotePatch)); } private void IncompatibilityAids() { foreach (KeyValuePair<string, PluginInfo> pluginInfo in Chainloader.PluginInfos) { BepInPlugin metadata = pluginInfo.Value.Metadata; if (metadata.GUID.Equals("com.malco.lethalcompany.moreshipupgrades") || metadata.GUID.Equals("Stoneman.LethalProgression")) { EmotePatch.IncompatibleStuff = true; break; } } } private void ConfigFile() { EmotePatch.keybinds = new string[9]; config_KeyWheel = ((BaseUnityPlugin)this).Config.Bind<string>("EMOTE WHEEL", "Key", "v", (ConfigDescription)null); EmotePatch.wheelKeybind = config_KeyWheel.Value; config_InventoryCheck = ((BaseUnityPlugin)this).Config.Bind<bool>("OTHERS", "InventoryCheck", true, "Prevents some emotes from performing while holding any item/scrap"); EmotePatch.InvCheck = config_InventoryCheck.Value; config_KeyEmote3 = ((BaseUnityPlugin)this).Config.Bind<string>("QUICK EMOTES", "Middle Finger", "3", (ConfigDescription)null); EmotePatch.keybinds[2] = config_KeyEmote3.Value.Replace(" ", ""); config_KeyEmote4 = ((BaseUnityPlugin)this).Config.Bind<string>("QUICK EMOTES", "The Griddy", "6", (ConfigDescription)null); EmotePatch.keybinds[5] = config_KeyEmote4.Value.Replace(" ", ""); config_KeyEmote5 = ((BaseUnityPlugin)this).Config.Bind<string>("QUICK EMOTES", "Shy", "5", (ConfigDescription)null); EmotePatch.keybinds[4] = config_KeyEmote5.Value.Replace(" ", ""); config_KeyEmote6 = ((BaseUnityPlugin)this).Config.Bind<string>("QUICK EMOTES", "Clap", "4", (ConfigDescription)null); EmotePatch.keybinds[3] = config_KeyEmote6.Value.Replace(" ", ""); config_KeyEmote7 = ((BaseUnityPlugin)this).Config.Bind<string>("QUICK EMOTES", "Twerk", "7", (ConfigDescription)null); EmotePatch.keybinds[6] = config_KeyEmote7.Value.Replace(" ", ""); config_KeyEmote8 = ((BaseUnityPlugin)this).Config.Bind<string>("QUICK EMOTES", "Salute", "8", (ConfigDescription)null); EmotePatch.keybinds[7] = config_KeyEmote8.Value.Replace(" ", ""); } } public static class PluginInfo { public const string Guid = "MoreEmotes"; public const string Name = "MoreEmotes-Sligili"; public const string Ver = "1.2.2"; } } namespace MoreEmotes.Patch { internal class EmotePatch { public static AssetBundle animationsBundle; public static AssetBundle animatorBundle; public static string[] keybinds; public static string wheelKeybind; private static CallbackContext context; public static RuntimeAnimatorController local; public static RuntimeAnimatorController others; private static int currentEmoteID; private static float svMovSpeed; public static bool IncompatibleStuff; public static bool InvCheck; public static bool emoteWheelIsOpened; public static GameObject wheel; public static GameObject rebindmenu; public static GameObject btn; private static SelectionWheel selectionWheel; [HarmonyPatch(typeof(MenuManager), "Start")] [HarmonyPostfix] private static void MenuStart(MenuManager __instance) { GameObject val = animationsBundle.LoadAsset<GameObject>("Assets/MoreEmotes/Resources/MoreEmotesPanel.prefab"); GameObject val2 = animationsBundle.LoadAsset<GameObject>("Assets/MoreEmotes/Resources/MoreEmotesButton.prefab"); GameObject gameObject = ((Component)((Component)__instance).transform.parent).gameObject; GameObject gameObject2 = ((Component)((Component)gameObject.transform.Find("MenuContainer")).transform.Find("SettingsPanel")).gameObject; if ((Object)(object)btn != (Object)null) { Object.Destroy((Object)(object)btn.gameObject); } btn = Object.Instantiate<GameObject>(val2, gameObject2.transform); btn.transform.SetSiblingIndex(7); if ((Object)(object)rebindmenu != (Object)null) { Object.Destroy((Object)(object)rebindmenu.gameObject); } rebindmenu = Object.Instantiate<GameObject>(val, gameObject2.transform); RebindBtn.defaultKeys = keybinds; BasicToggle.configValueInv = InvCheck; if ((Object)(object)gameObject2.GetComponent<SetupEverything>() == (Object)null) { gameObject2.AddComponent<SetupEverything>(); } SetupEverything.configValue = InvCheck; } [HarmonyPatch(typeof(PlayerControllerB), "Start")] [HarmonyPostfix] private static void StartPostfix(PlayerControllerB __instance) { GameObject gameObject = ((Component)((Component)((Component)__instance).gameObject.transform.Find("ScavengerModel")).transform.Find("metarig")).gameObject; CustomAudioAnimationEvent customAudioAnimationEvent = gameObject.AddComponent<CustomAudioAnimationEvent>(); svMovSpeed = __instance.movementSpeed; customAudioAnimationEvent.player = __instance; if (Object.FindObjectsOfType(typeof(SelectionWheel)).Length == 0) { GameObject val = animationsBundle.LoadAsset<GameObject>("Assets/MoreEmotes/Resources/MoreEmotesMenu.prefab"); GameObject gameObject2 = ((Component)((Component)GameObject.Find("Systems").gameObject.transform.Find("UI")).gameObject.transform.Find("Canvas")).gameObject; GameObject val2 = animationsBundle.LoadAsset<GameObject>("Assets/MoreEmotes/Resources/MoreEmotesPanel.prefab"); GameObject val3 = animationsBundle.LoadAsset<GameObject>("Assets/MoreEmotes/Resources/MoreEmotesButton.prefab"); GameObject gameObject3 = ((Component)((Component)gameObject2.transform.Find("QuickMenu")).transform.Find("SettingsPanel")).gameObject; if ((Object)(object)btn != (Object)null) { Object.Destroy((Object)(object)btn.gameObject); } btn = Object.Instantiate<GameObject>(val3, gameObject3.transform); btn.transform.SetSiblingIndex(7); if ((Object)(object)rebindmenu != (Object)null) { Object.Destroy((Object)(object)rebindmenu.gameObject); } rebindmenu = Object.Instantiate<GameObject>(val2, gameObject3.transform); RebindBtn.defaultKeys = keybinds; BasicToggle.configValueInv = InvCheck; if ((Object)(object)wheel != (Object)null) { Object.Destroy((Object)(object)wheel.gameObject); } wheel = Object.Instantiate<GameObject>(val, gameObject2.transform); selectionWheel = wheel.AddComponent<SelectionWheel>(); SelectionWheel.emotes_Keybinds = new string[keybinds.Length + 1]; SelectionWheel.emotes_Keybinds = keybinds; if ((Object)(object)gameObject3.GetComponent<SetupEverything>() == (Object)null) { gameObject3.AddComponent<SetupEverything>(); } SetupEverything.configValue = InvCheck; } } [HarmonyPatch(typeof(PlayerControllerB), "Update")] [HarmonyPostfix] private static void UpdatePostfix(PlayerControllerB __instance) { //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) if (!__instance.isPlayerControlled || !((NetworkBehaviour)__instance).IsOwner) { __instance.playerBodyAnimator.runtimeAnimatorController = others; return; } if ((Object)(object)__instance.playerBodyAnimator != (Object)(object)local) { __instance.playerBodyAnimator.runtimeAnimatorController = local; } if (__instance.performingEmote) { currentEmoteID = __instance.playerBodyAnimator.GetInteger("emoteNumber"); } if (!IncompatibleStuff) { bool flag = (bool)Reflection.CallMethod(__instance, "CheckConditionsForEmote") && currentEmoteID == 6 && __instance.performingEmote; __instance.movementSpeed = (flag ? (svMovSpeed / 2f) : svMovSpeed); } if (!PlayerPrefs.HasKey("InvCheck")) { PlayerPrefs.SetInt("InvCheck", InvCheck ? 1 : 0); } else { InvCheck = PlayerPrefs.GetInt("InvCheck") == 1; } if (!PlayerPrefs.HasKey("Emote_Wheel")) { PlayerPrefs.SetString("Emote_Wheel", wheelKeybind); } if (InputControlExtensions.IsPressed(((InputControl)Keyboard.current)[PlayerPrefs.GetString("Emote_Wheel")], 0f) && !emoteWheelIsOpened && !__instance.isPlayerDead && !__instance.inTerminalMenu && !__instance.quickMenuManager.isMenuOpen) { emoteWheelIsOpened = true; Cursor.visible = true; Cursor.lockState = (CursorLockMode)2; wheel.SetActive(emoteWheelIsOpened); __instance.disableLookInput = true; } else if ((!InputControlExtensions.IsPressed(((InputControl)Keyboard.current)[PlayerPrefs.GetString("Emote_Wheel")], 0f) && emoteWheelIsOpened) || __instance.quickMenuManager.isMenuOpen) { if (!__instance.quickMenuManager.isMenuOpen || __instance.isPlayerDead) { int selectedEmoteID = selectionWheel.selectedEmoteID; if (selectedEmoteID <= 3 || selectedEmoteID == 6 || !InvCheck) { __instance.PerformEmote(context, selectedEmoteID); } else if (!__instance.isHoldingObject) { __instance.PerformEmote(context, selectedEmoteID); } Cursor.visible = false; Cursor.lockState = (CursorLockMode)1; } if (__instance.isPlayerDead && !__instance.quickMenuManager.isMenuOpen) { Cursor.visible = false; Cursor.lockState = (CursorLockMode)1; } __instance.disableLookInput = false; emoteWheelIsOpened = false; wheel.SetActive(emoteWheelIsOpened); } if (!emoteWheelIsOpened && !__instance.quickMenuManager.isMenuOpen) { EmoteInput(keybinds[2], needsEmptyHands: false, 3, __instance); EmoteInput(keybinds[3], needsEmptyHands: true, 4, __instance); EmoteInput(keybinds[4], needsEmptyHands: true, 5, __instance); EmoteInput(keybinds[5], needsEmptyHands: false, 6, __instance); EmoteInput(keybinds[6], needsEmptyHands: true, 7, __instance); EmoteInput(keybinds[7], needsEmptyHands: true, 8, __instance); } } private static void EmoteInput(string keyBind, bool needsEmptyHands, int emoteID, PlayerControllerB player) { //IL_00a7: Unknown result type (might be due to invalid IL or missing references) bool flag = PlayerPrefs.GetInt("InvCheck") == 1; Emotes emotes = (Emotes)emoteID; string text = emotes.ToString(); if (PlayerPrefs.HasKey(text)) { keyBind = PlayerPrefs.GetString(text); } else { PlayerPrefs.SetString(text, keyBind); } if (!keyBind.Equals(string.Empty) && InputControlExtensions.IsPressed(((InputControl)Keyboard.current)[keyBind], 0f) && (!player.isHoldingObject || !needsEmptyHands || !flag) && (!player.performingEmote || currentEmoteID != emoteID)) { Debug.Log((object)text); player.PerformEmote(context, emoteID); } } [HarmonyPatch(typeof(PlayerControllerB), "CheckConditionsForEmote")] [HarmonyPrefix] private static bool prefixCheckConditions(ref bool __result, PlayerControllerB __instance) { bool flag = (bool)Reflection.GetInstanceField(typeof(PlayerControllerB), __instance, "isJumping"); if (currentEmoteID == 6) { __result = !__instance.inSpecialInteractAnimation && !__instance.isPlayerDead && !flag && __instance.moveInputVector.x == 0f && !__instance.isSprinting && !__instance.isCrouching && !__instance.isClimbingLadder && !__instance.isGrabbingObjectAnimation && !__instance.inTerminalMenu && !__instance.isTypingChat; return false; } return true; } [HarmonyPatch(typeof(PlayerControllerB), "PerformEmote")] [HarmonyPrefix] private static void PerformEmotePrefix(CallbackContext context, int emoteID, PlayerControllerB __instance) { if ((emoteID >= 3 || emoteWheelIsOpened || ((CallbackContext)(ref context)).performed) && ((((NetworkBehaviour)__instance).IsOwner && __instance.isPlayerControlled && (!((NetworkBehaviour)__instance).IsServer || __instance.isHostPlayerObject)) || __instance.isTestingPlayer) && (bool)Reflection.CallMethod(__instance, "CheckConditionsForEmote") && !(__instance.timeSinceStartingEmote < 0.5f)) { __instance.timeSinceStartingEmote = 0f; __instance.performingEmote = true; __instance.playerBodyAnimator.SetInteger("emoteNumber", emoteID); __instance.StartPerformingEmoteServerRpc(); } } } public class CustomAudioAnimationEvent : MonoBehaviour { private Animator animator; private AudioSource SoundsSource; public static AudioClip[] claps = (AudioClip[])(object)new AudioClip[2]; public PlayerControllerB player; private void Start() { animator = ((Component)this).GetComponent<Animator>(); SoundsSource = player.movementAudio; } public void PlayClapSound() { //IL_0087: Unknown result type (might be due to invalid IL or missing references) if (player.performingEmote && (!((NetworkBehaviour)player).IsOwner || !player.isPlayerControlled || animator.GetInteger("emoteNumber") == 4)) { bool flag = player.isInHangarShipRoom && player.playersManager.hangarDoorsClosed; RoundManager.Instance.PlayAudibleNoise(((Component)player).transform.position, 22f, 0.6f, 0, flag, 6); SoundsSource.pitch = Random.Range(0.59f, 0.79f); SoundsSource.PlayOneShot(claps[Random.Range(0, claps.Length)]); } } public void PlayFootstepSound() { if (player.performingEmote && (!((NetworkBehaviour)player).IsOwner || !player.isPlayerControlled || animator.GetInteger("emoteNumber") == 6 || animator.GetInteger("emoteNumber") == 8) && ((Vector2)(ref player.moveInputVector)).sqrMagnitude == 0f) { player.PlayFootstepLocal(); player.PlayFootstepServer(); } } } public enum Emotes { Dance = 1, Point, Middle_Finger, Clap, Shy, The_Griddy, Twerk, Salute } public class SelectionWheel : MonoBehaviour { public RectTransform selectionBlock; public Text emoteInformation; public Text pageInformation; private int blocksNumber = 8; private int currentBlock = 1; public int pageNumber; public int selectedEmoteID; private float angle; private float pageCooldown = 0.1f; public GameObject[] Pages; private int cuadrante = 0; public string selectedEmoteName; public float wheelMovementOffset = 3.3f; public static string[] emotes_Keybinds; private Vector2 center; private void OnEnable() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) center = new Vector2((float)(Screen.width / 2), (float)(Screen.height / 2)); PlayerInput component = GameObject.Find("PlayerSettingsObject").GetComponent<PlayerInput>(); emotes_Keybinds[0] = InputActionRebindingExtensions.GetBindingDisplayString(component.currentActionMap.FindAction("Emote1", false), 0, (DisplayStringOptions)0); emotes_Keybinds[1] = InputActionRebindingExtensions.GetBindingDisplayString(component.currentActionMap.FindAction("Emote2", false), 0, (DisplayStringOptions)0); Cursor.visible = true; selectionBlock = ((Component)((Component)this).gameObject.transform.Find("SelectedEmote")).gameObject.GetComponent<RectTransform>(); GameObject gameObject = ((Component)((Component)this).gameObject.transform.Find("FunctionalContent")).gameObject; emoteInformation = ((Component)((Component)((Component)this).gameObject.transform.Find("Graphics")).gameObject.transform.Find("EmoteInfo")).GetComponent<Text>(); Pages = (GameObject[])(object)new GameObject[gameObject.transform.childCount]; pageInformation = ((Component)((Component)((Component)this).gameObject.transform.Find("Graphics")).gameObject.transform.Find("PageNumber")).GetComponent<Text>(); pageInformation.text = "Page " + Pages.Length + "/" + (pageNumber + 1); for (int i = 0; i < gameObject.transform.childCount; i++) { Pages[i] = ((Component)gameObject.transform.GetChild(i)).gameObject; } Mouse.current.WarpCursorPosition(center); } private void Update() { wheelSelection(); pageSelection(); selectedEmoteID = currentBlock + Mathf.RoundToInt((float)(blocksNumber / 4)) + blocksNumber * pageNumber; displayEmoteInfo(); } private void wheelSelection() { //IL_0002: 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_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) if (!(Vector2.Distance(center, ((InputControl<Vector2>)(object)((Pointer)Mouse.current).position).ReadValue()) < wheelMovementOffset)) { bool flag = ((InputControl<float>)(object)((Pointer)Mouse.current).position.x).ReadValue() > center.x; bool flag2 = ((InputControl<float>)(object)((Pointer)Mouse.current).position.y).ReadValue() > center.y; cuadrante = ((!flag) ? (flag2 ? 2 : 3) : (flag2 ? 1 : 4)); float num = (((InputControl<float>)(object)((Pointer)Mouse.current).position.y).ReadValue() - center.y) / (((InputControl<float>)(object)((Pointer)Mouse.current).position.x).ReadValue() - center.x); float num2 = 180 * (cuadrante - ((cuadrante <= 2) ? 1 : 2)); angle = Mathf.Atan(num) * (180f / (float)Math.PI) + num2; if (angle == 90f) { angle = 270f; } else if (angle == 270f) { angle = 90f; } float num3 = 360 / blocksNumber; currentBlock = Mathf.RoundToInt((angle - num3 * 1.5f) / num3); ((Transform)selectionBlock).localRotation = Quaternion.Euler(((Component)this).transform.rotation.z, ((Component)this).transform.rotation.y, num3 * (float)currentBlock); } } private void pageSelection() { pageInformation.text = "Page " + Pages.Length + "/" + (pageNumber + 1); if (pageCooldown > 0f) { pageCooldown -= Time.deltaTime; } else if (((InputControl<float>)(object)((Vector2Control)Mouse.current.scroll).y).ReadValue() != 0f) { GameObject[] pages = Pages; foreach (GameObject val in pages) { val.SetActive(false); } int num = ((((InputControl<float>)(object)((Vector2Control)Mouse.current.scroll).y).ReadValue() > 0f) ? 1 : (-1)); if (pageNumber + 1 > Pages.Length - 1 && num > 0) { pageNumber = 0; } else if (pageNumber - 1 < 0 && num < 0) { pageNumber = Pages.Length - 1; } else { pageNumber += num; } Pages[pageNumber].SetActive(true); pageCooldown = 0.1f; } } private void displayEmoteInfo() { string text = ((selectedEmoteID > emotes_Keybinds.Length) ? "" : emotes_Keybinds[selectedEmoteID - 1]); object obj; if (selectedEmoteID <= Enum.GetValues(typeof(Emotes)).Length) { Emotes emotes = (Emotes)selectedEmoteID; obj = emotes.ToString().Replace("_", " "); } else { obj = "EMPTY"; } string text2 = (string)obj; if (!PlayerPrefs.HasKey(text2.Replace(" ", "_"))) { PlayerPrefs.SetString(text2.Replace(" ", "_"), (selectedEmoteID > emotes_Keybinds.Length) ? "" : emotes_Keybinds[selectedEmoteID - 1]); } else { text = PlayerPrefs.GetString(text2.Replace(" ", "_")); } emoteInformation.text = text2 + "\n[" + text.ToUpper() + "]"; } } public class RebindBtn : MonoBehaviour { public string defaultKey; public static string[] defaultKeys; public string playerPrefs; public GameObject waitingForInput; public Text keyInfo; public Text description; private void Start() { //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Expected O, but got Unknown string text = ((Component)((Component)this).gameObject.transform.Find("Description")).GetComponent<Text>().text; try { int num = (int)(Emotes)Enum.Parse(typeof(Emotes), text.Replace(" ", "_")); defaultKey = defaultKeys[num - 1]; } catch { defaultKey = "V"; } playerPrefs = ((Component)((Component)this).gameObject.transform.Find("Description")).GetComponent<Text>().text.Replace(" ", "_"); ((Component)((Component)((Component)this).transform.parent).transform.Find("Delete")).gameObject.AddComponent<DeleteBtn>(); keyInfo = ((Component)((Component)this).transform.Find("InputText")).GetComponent<Text>(); waitingForInput = ((Component)((Component)this).transform.Find("wait")).gameObject; ((UnityEvent)((Component)this).GetComponent<Button>().onClick).AddListener(new UnityAction(GetKey)); if (!PlayerPrefs.HasKey(playerPrefs)) { PlayerPrefs.SetString(playerPrefs, defaultKey); } SetKeybind(PlayerPrefs.GetString(playerPrefs)); } public void SetKeybind(string key) { PlayerPrefs.SetString(playerPrefs, key); keyInfo.text = key; ((MonoBehaviour)this).StopAllCoroutines(); waitingForInput.SetActive(false); } public void GetKey() { waitingForInput.SetActive(true); ((MonoBehaviour)this).StartCoroutine(WaitForKey(delegate(string key) { SetKeybind(key); })); } private IEnumerator WaitForKey(Action<string> callback) { while (!((ButtonControl)Keyboard.current.anyKey).wasPressedThisFrame) { yield return (object)new WaitForEndOfFrame(); Observable.CallOnce<InputControl>(InputSystem.onAnyButtonPress, (Action<InputControl>)delegate(InputControl ctrl) { callback((ctrl.device == Keyboard.current) ? ctrl.name : defaultKey); }); } } } public class DeleteBtn : MonoBehaviour { private RebindBtn rebindBtn; private void Start() { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Expected O, but got Unknown rebindBtn = ((Component)((Component)((Component)this).transform.parent).transform.Find("Button")).GetComponent<RebindBtn>(); Button component = ((Component)this).GetComponent<Button>(); ((UnityEvent)component.onClick).AddListener(new UnityAction(deleteKey)); } public void deleteKey() { rebindBtn.SetKeybind(string.Empty); } } public class BasicToggle : MonoBehaviour { private Toggle tog; public static bool configValueInv; public string playerPrefs; private void Start() { tog = ((Component)this).GetComponent<Toggle>(); ((UnityEvent<bool>)(object)tog.onValueChanged).AddListener((UnityAction<bool>)SetNewValue); if (!PlayerPrefs.HasKey(playerPrefs)) { PlayerPrefs.SetInt(playerPrefs, configValueInv ? 1 : 0); } } public void SetNewValue(bool arg) { PlayerPrefs.SetInt(playerPrefs, tog.isOn ? 1 : 0); } } public class ButtonBasic : MonoBehaviour { public GameObject[] alternateActive = (GameObject[])(object)new GameObject[1]; private void Start() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown ((UnityEvent)((Component)this).GetComponent<Button>().onClick).AddListener(new UnityAction(onButtonTrigger)); if (((Object)((Component)this).gameObject).name.Equals("BackButton")) { alternateActive[0] = ((Component)((Component)this).transform.parent).gameObject; } if (((Object)((Component)this).gameObject).name.Equals("MoreEmotesButton(Clone)")) { alternateActive[0] = ((Component)((Component)((Component)this).transform.parent).gameObject.transform.Find("MoreEmotesPanel(Clone)")).gameObject; } } public void onButtonTrigger() { GameObject[] array = alternateActive; foreach (GameObject val in array) { val.SetActive((!val.activeInHierarchy) ? true : false); } } } public class SetupEverything : MonoBehaviour { private GameObject panel; public static bool configValue; private void Start() { panel = ((Component)((Component)this).transform.Find("MoreEmotesPanel(Clone)")).gameObject; ((Component)panel.transform.Find("Version")).GetComponent<Text>().text = "Sligili - 1.2.2"; if (!PlayerPrefs.HasKey("InvCheck")) { PlayerPrefs.SetInt("InvCheck", configValue ? 1 : 0); } SetupMenuButton(); BackButton(); KeybindButtons(); Others(); } private void SetupMenuButton() { GameObject gameObject = ((Component)((Component)this).transform.Find("MoreEmotesButton(Clone)")).gameObject; gameObject.AddComponent<ButtonBasic>(); } private void BackButton() { GameObject gameObject = ((Component)panel.transform.Find("BackButton")).gameObject; gameObject.AddComponent<ButtonBasic>(); } private void KeybindButtons() { GameObject gameObject = ((Component)panel.transform.Find("KeybindButtons")).gameObject; GameObject[] array = (GameObject[])(object)new GameObject[gameObject.transform.childCount]; for (int i = 0; i < gameObject.transform.childCount; i++) { array[i] = ((Component)gameObject.transform.GetChild(i)).gameObject; } GameObject[] array2 = array; foreach (GameObject val in array2) { ((Component)val.transform.Find("Button")).gameObject.AddComponent<RebindBtn>(); } } private void Others() { GameObject gameObject = ((Component)panel.transform.Find("Inv")).gameObject; gameObject.AddComponent<BasicToggle>(); BasicToggle basicToggle = gameObject.AddComponent<BasicToggle>(); basicToggle.playerPrefs = "InvCheck"; } } }
BepInEx/plugins/sunnobunno-LandMineFartReverb/LandMineFartReverb.dll
Decompiled 11 months agousing System; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Logging; using HarmonyLib; using LandMineFartReverb.Patches; using Microsoft.CodeAnalysis; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")] [assembly: AssemblyCompany("LandMineFartReverb")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("LandMineFartReverb")] [assembly: AssemblyTitle("LandMineFartReverb")] [assembly: AssemblyVersion("1.0.0.0")] 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; } } } namespace LandMineFartReverb { [BepInPlugin("sunnobunno.landminefartreverb", "Land Mine Fart Reverb", "1.0.2")] public class LandMineFartReverbBase : BaseUnityPlugin { private const string modGUID = "sunnobunno.landminefartreverb"; private const string modName = "Land Mine Fart Reverb"; private const string modVersion = "1.0.2"; private readonly Harmony harmony = new Harmony("sunnobunno.landminefartreverb"); private static LandMineFartReverbBase? Instance; internal ManualLogSource? mls; internal static AudioClip[]? newMineDetonate; internal static AudioClip[]? newMineDetonateFar; private void Awake() { if ((Object)(object)Instance == (Object)null) { Instance = this; } mls = Logger.CreateLogSource("sunnobunno.landminefartreverb"); mls.LogInfo((object)"sunnobunno.landminefartreverb is loading."); string location = ((BaseUnityPlugin)Instance).Info.Location; string text = "LandMineFartReverb.dll"; string text2 = location.TrimEnd(text.ToCharArray()); string text3 = text2 + "fartwithreverb"; AssetBundle val = AssetBundle.LoadFromFile(text3); if ((Object)(object)val == (Object)null) { mls.LogError((object)"Failed to load audio assets!"); return; } newMineDetonate = val.LoadAssetWithSubAssets<AudioClip>("Assets/fartwithreverb.mp3"); newMineDetonateFar = val.LoadAssetWithSubAssets<AudioClip>("Assets/fartwithreverb.mp3"); harmony.PatchAll(typeof(LandminePatch)); mls.LogInfo((object)"sunnobunno.landminefartreverb is loaded. Pee-yeww."); } } } namespace LandMineFartReverb.Patches { [HarmonyPatch(typeof(Landmine))] internal class LandminePatch { [HarmonyPatch("Start")] [HarmonyPostfix] public static void hoarderBugAudioPatch(ref AudioClip ___mineDetonate, ref AudioClip ___mineDetonateFar) { AudioClip val = LandMineFartReverbBase.newMineDetonate[0]; ___mineDetonate = val; AudioClip val2 = LandMineFartReverbBase.newMineDetonateFar[0]; ___mineDetonateFar = val2; } } }
BepInEx/plugins/Suskitech-AlwaysHearActiveWalkies/AlwaysHearWalkie.dll
Decompiled 11 months agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using GameNetcodeStuff; using HarmonyLib; using LCAlwaysHearWalkieMod.Patches; using Microsoft.CodeAnalysis; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("AlwaysHearWalkie")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.4.3.0")] [assembly: AssemblyInformationalVersion("1.4.3+b44d9dd67954bb9cf96dd2ba0e84393e7774a6a0")] [assembly: AssemblyProduct("Always Hear Active Walkies")] [assembly: AssemblyTitle("AlwaysHearWalkie")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.4.3.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [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 BepInEx5.PluginTemplate { [BepInPlugin("suskitech.LCAlwaysHearActiveWalkie", "LC Always Hear Active Walkies", "1.4.3")] public class LCAlwaysHearWalkieMod : BaseUnityPlugin { public static ManualLogSource Log; private const string modGUID = "suskitech.LCAlwaysHearActiveWalkie"; private const string modName = "LC Always Hear Active Walkies"; private const string modVersion = "1.4.3"; private readonly Harmony harmony = new Harmony("suskitech.LCAlwaysHearActiveWalkie"); private static LCAlwaysHearWalkieMod Instance; private void Awake() { if ((Object)(object)Instance == (Object)null) { Instance = this; } Log = Logger.CreateLogSource("suskitech.LCAlwaysHearActiveWalkie"); Log.LogInfo((object)"\\ /"); Log.LogInfo((object)"/|\\"); Log.LogInfo((object)" |----|"); Log.LogInfo((object)" |[__]| Always Hear Active Walkies"); Log.LogInfo((object)" |. .| Version 1.4.3 Loaded"); Log.LogInfo((object)" |____|"); harmony.PatchAll(typeof(LCAlwaysHearWalkieMod)); harmony.PatchAll(typeof(PlayerControllerBPatch)); harmony.PatchAll(typeof(WalkieTalkiePatch)); } } public static class MyPluginInfo { public const string PLUGIN_GUID = "AlwaysHearWalkie"; public const string PLUGIN_NAME = "Always Hear Active Walkies"; public const string PLUGIN_VERSION = "1.4.3"; } } namespace LCAlwaysHearWalkieMod.Patches { [HarmonyPatch(typeof(PlayerControllerB))] internal class PlayerControllerBPatch { private static float AudibleDistance = 20f; private static float throttleInterval = 0.35f; private static float throttle = 0f; private static float AverageDistanceToHeldWalkie = 2f; private static float WalkieRecordingRange = 20f; private static float PlayerToPlayerSpatialHearingRange = 20f; [HarmonyPatch("Update")] [HarmonyPostfix] private static void alwaysHearWalkieTalkiesPatch(ref bool ___holdingWalkieTalkie, ref PlayerControllerB __instance) { //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_0293: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02f8: Unknown result type (might be due to invalid IL or missing references) //IL_0303: Unknown result type (might be due to invalid IL or missing references) //IL_034d: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) throttle += Time.deltaTime; if (throttle < throttleInterval) { return; } throttle = 0f; if ((Object)(object)__instance == (Object)null || (Object)(object)GameNetworkManager.Instance == (Object)null || (Object)(object)__instance != (Object)(object)GameNetworkManager.Instance.localPlayerController || (Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)null) { return; } if (!GameNetworkManager.Instance.localPlayerController.isPlayerDead) { List<WalkieTalkie> list = new List<WalkieTalkie>(); List<WalkieTalkie> list2 = new List<WalkieTalkie>(); for (int i = 0; i < WalkieTalkie.allWalkieTalkies.Count; i++) { float num = Vector3.Distance(((Component)WalkieTalkie.allWalkieTalkies[i]).transform.position, ((Component)__instance).transform.position); if (num <= AudibleDistance) { if (((GrabbableObject)WalkieTalkie.allWalkieTalkies[i]).isBeingUsed) { list.Add(WalkieTalkie.allWalkieTalkies[i]); } } else { list2.Add(WalkieTalkie.allWalkieTalkies[i]); } } bool flag = list.Count > 0; if (flag != __instance.holdingWalkieTalkie) { ___holdingWalkieTalkie = flag; for (int j = 0; j < list2.Count; j++) { if (j < list.Count) { list2[j].thisAudio.Stop(); } } } if (!flag) { return; } } PlayerControllerB val = ((!GameNetworkManager.Instance.localPlayerController.isPlayerDead || !((Object)(object)GameNetworkManager.Instance.localPlayerController.spectatedPlayerScript != (Object)null)) ? GameNetworkManager.Instance.localPlayerController : GameNetworkManager.Instance.localPlayerController.spectatedPlayerScript); for (int k = 0; k < StartOfRound.Instance.allPlayerScripts.Length; k++) { PlayerControllerB val2 = StartOfRound.Instance.allPlayerScripts[k]; if ((!val2.isPlayerControlled && !val2.isPlayerDead) || (Object)(object)val2 == (Object)(object)GameNetworkManager.Instance.localPlayerController || val2.isPlayerDead || !val2.holdingWalkieTalkie) { continue; } float num2 = Vector3.Distance(((Component)val).transform.position, ((Component)val2).transform.position); float num3 = float.MaxValue; float num4 = float.MaxValue; for (int l = 0; l < WalkieTalkie.allWalkieTalkies.Count; l++) { if (!((GrabbableObject)WalkieTalkie.allWalkieTalkies[l]).isBeingUsed) { continue; } float num5 = Vector3.Distance(((Component)WalkieTalkie.allWalkieTalkies[l].target).transform.position, ((Component)val).transform.position); if (num5 < num4) { num4 = num5; } if (!WalkieTalkie.allWalkieTalkies[l].speakingIntoWalkieTalkie) { float num6 = Vector3.Distance(((Component)WalkieTalkie.allWalkieTalkies[l]).transform.position, ((Component)val2).transform.position); if (num6 < num3) { num3 = num6; } } } float num7 = Mathf.Min(1f - Mathf.InverseLerp(AverageDistanceToHeldWalkie, WalkieRecordingRange, num3), 1f - Mathf.InverseLerp(AverageDistanceToHeldWalkie, WalkieRecordingRange, num4)); float num8 = 1f - Mathf.InverseLerp(0f, PlayerToPlayerSpatialHearingRange, num2); val2.voicePlayerState.Volume = Mathf.Max(num7, num8); if (val2.speakingToWalkieTalkie && num7 > num8) { makePlayerSoundWalkieTalkie(val2); } else { makePlayerSoundSpatial(val2); } } } private static void makePlayerSoundWalkieTalkie(PlayerControllerB playerController) { AudioSource currentVoiceChatAudioSource = playerController.currentVoiceChatAudioSource; AudioLowPassFilter component = ((Component)currentVoiceChatAudioSource).GetComponent<AudioLowPassFilter>(); AudioHighPassFilter component2 = ((Component)currentVoiceChatAudioSource).GetComponent<AudioHighPassFilter>(); OccludeAudio component3 = ((Component)currentVoiceChatAudioSource).GetComponent<OccludeAudio>(); ((Behaviour)component2).enabled = true; ((Behaviour)component).enabled = true; component3.overridingLowPass = true; currentVoiceChatAudioSource.spatialBlend = 0f; playerController.currentVoiceChatIngameSettings.set2D = true; currentVoiceChatAudioSource.outputAudioMixerGroup = SoundManager.Instance.playerVoiceMixers[playerController.playerClientId]; currentVoiceChatAudioSource.bypassListenerEffects = false; currentVoiceChatAudioSource.bypassEffects = false; currentVoiceChatAudioSource.panStereo = (GameNetworkManager.Instance.localPlayerController.isPlayerDead ? 0f : 0.4f); component3.lowPassOverride = 4000f; component.lowpassResonanceQ = 3f; } private static void makePlayerSoundSpatial(PlayerControllerB playerController) { AudioSource currentVoiceChatAudioSource = playerController.currentVoiceChatAudioSource; AudioLowPassFilter component = ((Component)currentVoiceChatAudioSource).GetComponent<AudioLowPassFilter>(); AudioHighPassFilter component2 = ((Component)currentVoiceChatAudioSource).GetComponent<AudioHighPassFilter>(); OccludeAudio component3 = ((Component)currentVoiceChatAudioSource).GetComponent<OccludeAudio>(); ((Behaviour)component2).enabled = false; ((Behaviour)component).enabled = true; component3.overridingLowPass = playerController.voiceMuffledByEnemy; currentVoiceChatAudioSource.spatialBlend = 1f; playerController.currentVoiceChatIngameSettings.set2D = false; currentVoiceChatAudioSource.bypassListenerEffects = false; currentVoiceChatAudioSource.bypassEffects = false; currentVoiceChatAudioSource.outputAudioMixerGroup = SoundManager.Instance.playerVoiceMixers[playerController.playerClientId]; component.lowpassResonanceQ = 1f; } } [HarmonyPatch(typeof(WalkieTalkie))] internal class WalkieTalkiePatch { [HarmonyPatch("EnableWalkieTalkieListening")] [HarmonyPrefix] private static bool alwaysHearWalkieTalkiesEnableWalkieTalkieListeningPatch(bool enable) { if (!enable) { return false; } return true; } } }
BepInEx/plugins/tinyhoot-ShipLoot/ShipLoot/ShipLoot.dll
Decompiled 11 months agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using HarmonyLib; using TMPro; using UnityEngine; using UnityEngine.InputSystem; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("ShipLoot")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyProduct("ShipLoot")] [assembly: AssemblyCopyright("Copyright © tinyhoot 2023")] [assembly: ComVisible(false)] [assembly: AssemblyFileVersion("1.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace ShipLoot { [BepInPlugin("com.github.tinyhoot.ShipLoot", "ShipLoot", "1.0")] internal class ShipLoot : BaseUnityPlugin { public const string GUID = "com.github.tinyhoot.ShipLoot"; public const string NAME = "ShipLoot"; public const string VERSION = "1.0"; internal static ManualLogSource Log; private void Awake() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) Log = ((BaseUnityPlugin)this).Logger; new Harmony("com.github.tinyhoot.ShipLoot").PatchAll(Assembly.GetExecutingAssembly()); } } } namespace ShipLoot.Patches { [HarmonyPatch] internal class HudManagerPatcher { private static GameObject _totalCounter; private static TextMeshProUGUI _textMesh; private static float _displayTimeLeft; private const float DisplayTime = 5f; [HarmonyPrefix] [HarmonyPatch(typeof(HUDManager), "PingScan_performed")] private static void OnScan(HUDManager __instance, CallbackContext context) { if (!((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)null) && ((CallbackContext)(ref context)).performed && __instance.CanPlayerScan() && !(__instance.playerPingingScan > -0.5f) && (StartOfRound.Instance.inShipPhase || GameNetworkManager.Instance.localPlayerController.isInHangarShipRoom)) { if (!Object.op_Implicit((Object)(object)_totalCounter)) { CopyValueCounter(); } float num = CalculateLootValue(); ((TMP_Text)_textMesh).text = $"SHIP: ${num:F0}"; _displayTimeLeft = 5f; if (!_totalCounter.activeSelf) { ((MonoBehaviour)GameNetworkManager.Instance).StartCoroutine(ShipLootCoroutine()); } } } private static IEnumerator ShipLootCoroutine() { _totalCounter.SetActive(true); while (_displayTimeLeft > 0f) { float displayTimeLeft = _displayTimeLeft; _displayTimeLeft = 0f; yield return (object)new WaitForSeconds(displayTimeLeft); } _totalCounter.SetActive(false); } private static float CalculateLootValue() { List<GrabbableObject> list = (from obj in GameObject.Find("/Environment/HangarShip").GetComponentsInChildren<GrabbableObject>() where ((Object)obj).name != "ClipboardManual" && ((Object)obj).name != "StickyNoteItem" select obj).ToList(); ShipLoot.Log.LogDebug((object)"Calculating total ship scrap value."); CollectionExtensions.Do<GrabbableObject>((IEnumerable<GrabbableObject>)list, (Action<GrabbableObject>)delegate(GrabbableObject scrap) { ShipLoot.Log.LogDebug((object)$"{((Object)scrap).name} - ${scrap.scrapValue}"); }); return list.Sum((GrabbableObject scrap) => scrap.scrapValue); } private static void CopyValueCounter() { //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0087: 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) GameObject val = GameObject.Find("/Systems/UI/Canvas/IngamePlayerHUD/BottomMiddle/ValueCounter"); if (!Object.op_Implicit((Object)(object)val)) { ShipLoot.Log.LogError((object)"Failed to find ValueCounter object to copy!"); } _totalCounter = Object.Instantiate<GameObject>(val.gameObject, val.transform.parent, false); _totalCounter.transform.Translate(0f, 1f, 0f); Vector3 localPosition = _totalCounter.transform.localPosition; _totalCounter.transform.localPosition = new Vector3(localPosition.x + 50f, -50f, localPosition.z); _textMesh = _totalCounter.GetComponentInChildren<TextMeshProUGUI>(); } } }
BepInEx/plugins/TwinDimensionalProductions-CoilHeadStare/CoilHeadStare.dll
Decompiled 11 months agousing System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using GameNetcodeStuff; using HarmonyLib; using TDP.CoilHeadStare.Patch; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("CoilHeadStare")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("CoilHeadStare")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("9d96f0c2-6393-4d02-99d7-34538a0dad5c")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace TDP.CoilHeadStare { [BepInPlugin("TDP.CoilHeadStare", "CoilHeadStare", "1.0.3")] public class ModBase : BaseUnityPlugin { private const string modGUID = "TDP.CoilHeadStare"; private const string modName = "CoilHeadStare"; private const string modVersion = "1.0.3"; private Harmony harmony; internal static ModBase instance; internal ManualLogSource mls; public static ConfigEntry<float> config_timeUntilStare; public static ConfigEntry<float> config_maxStareDistance; public static ConfigEntry<float> config_turnHeadSpeed; private void Awake() { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown if ((Object)(object)instance == (Object)null) { instance = this; } else { Object.Destroy((Object)(object)this); } ConfigFile(); harmony = new Harmony("TDP.CoilHeadStare"); harmony.PatchAll(typeof(CoilHeadPatch)); mls = Logger.CreateLogSource("TDP.CoilHeadStare"); mls.LogInfo((object)"CoilHeadStare 1.0.3 loaded."); } private void ConfigFile() { config_timeUntilStare = ((BaseUnityPlugin)this).Config.Bind<float>("CoilHeadStare", "Time Until Stare", 8f, "Time between moving and looking at closest player (in seconds)"); config_maxStareDistance = ((BaseUnityPlugin)this).Config.Bind<float>("CoilHeadStare", "Max Stare Distance", 6f, "Coilhead will only stare at players closer than this (for reference: coilhead's height is ca. 4)"); config_turnHeadSpeed = ((BaseUnityPlugin)this).Config.Bind<float>("CoilHeadStare", "Head Turn Speed", 0.3f, "The speed at which the head turns towards the player"); Stare.timeUntilStare = config_timeUntilStare.Value; Stare.maxStareDistance = config_maxStareDistance.Value; Stare.turnHeadSpeed = config_turnHeadSpeed.Value; } private void ConfigureDoorControls() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_0041: 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) GameObject val = GameObject.Find("HangarDoorButtonPanel"); GameObject val2 = new GameObject("PlacementCollider"); val2.transform.SetParent(val.transform, false); BoxCollider val3 = val2.AddComponent<BoxCollider>(); val3.size = new Vector3(0.881444f, 0.147624f, 0.7243316f); val3.center = new Vector3(0.2525222f, 0.06033165f, -0.06168448f); PlaceableShipObject val4 = val2.AddComponent<PlaceableShipObject>(); val4.unlockableID = 1212; val4.parentObject = val.AddComponent<AutoParentToShip>(); val4.mainMesh = val.GetComponent<MeshFilter>(); val4.mainTransform = val.transform; val4.placeObjectCollider = (Collider)(object)val3; val4.yOffset = 0f; val4.AllowPlacementOnWalls = true; val2.AddComponent<AudioSource>(); } } } namespace TDP.CoilHeadStare.Patch { internal class CoilHeadPatch { [HarmonyPatch(typeof(EnemyAI), "Start")] [HarmonyPostfix] private static void StartPostFix(EnemyAI __instance) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown if (__instance is SpringManAI) { Debug.Log((object)"CoilHead found. Adding stare script."); Stare stare = ((Component)__instance).gameObject.AddComponent<Stare>(); stare.Initialize((SpringManAI)__instance); } } } public class Stare : MonoBehaviour { private SpringManAI coilHeadInstance; public static float timeUntilStare; public static float maxStareDistance; public static float turnHeadSpeed; private Transform head; private float timeSinceMoving; private bool isTurningHead; private PlayerControllerB stareTarget; public void Initialize(SpringManAI instance) { Debug.Log((object)"Initializing Stare on Coilhead."); coilHeadInstance = instance; head = ((Component)coilHeadInstance).transform.GetChild(0).GetChild(2).GetChild(0) .GetChild(0) .GetChild(0) .GetChild(0) .GetChild(0) .GetChild(2) .GetChild(0) .GetChild(0) .GetChild(1); if (((Object)head).name != "springBone.002_end") { Debug.LogError((object)"CoilHeadStare could not find head transform. Destroying script."); Object.Destroy((Object)(object)this); } } private void Update() { //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)coilHeadInstance == (Object)null) { return; } if ((Object)(object)head == (Object)null) { Debug.LogError((object)"CoilHeadStare head transform missing. Destroying script."); Object.Destroy((Object)(object)this); return; } if (!isTurningHead) { stareTarget = ((EnemyAI)coilHeadInstance).GetClosestPlayer(false, false, false); } if (!((Object)(object)stareTarget == (Object)null)) { Vector3 val = ((Component)stareTarget.gameplayCamera).transform.position - head.position; float num = Vector3.Distance(head.position, ((Component)((EnemyAI)coilHeadInstance).GetClosestPlayer(false, false, false)).transform.position); if ((double)((EnemyAI)coilHeadInstance).creatureAnimator.GetFloat("walkSpeed") > 0.01 || num > maxStareDistance || Vector3.Angle(head.forward, val) < 5f) { timeSinceMoving = 0f; } else { timeSinceMoving += Time.deltaTime; } if (timeSinceMoving > timeUntilStare) { isTurningHead = true; } else { isTurningHead = false; } if (isTurningHead) { head.forward = Vector3.RotateTowards(head.forward, val, turnHeadSpeed * Time.deltaTime, 0f); } } } } }
BepInEx/plugins/Venterok-HullBreaker_Company/HullBreakerCompany.dll
Decompiled 11 months agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using GameNetcodeStuff; using HarmonyLib; using HullBreakerCompany.Events; using HullBreakerCompany.Hull; using Microsoft.CodeAnalysis; using Unity.Netcode; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("HullBreakerCompany")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyDescription("Making it more challenging to work for the company")] [assembly: AssemblyFileVersion("1.3.10.0")] [assembly: AssemblyInformationalVersion("1.3.10")] [assembly: AssemblyProduct("HullBreakerCompany")] [assembly: AssemblyTitle("HullBreakerCompany")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.3.10.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [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 HullBreakerCompany { [BepInPlugin("HullBreakerCompany", "HullBreakerCompany", "1.3.10")] public class Plugin : BaseUnityPlugin { private static Dictionary<int, SelectableLevelState> _levelStates = new Dictionary<int, SelectableLevelState>(); private static bool _loaded; public static ManualLogSource Mls; public static bool OneForAllIsActive; public static bool BountyIsActive; public static int DaysPassed; public static float BunkerEnemyScale; public static float LandMineTurretScale; public static bool UseShortChatMessages; public static bool EnableEventMessages; public static bool UseHullBreakerLevelSettings; public static bool UseDefaultGameSettings; public static int MaxEnemyPowerCount; public static int MaxOutsideEnemyPowerCount; public static int MaxDaytimeEnemyPowerCount; public static int MinScrap; public static int MaxScrap; public static int MinTotalScrapValue; public static int MaxTotalScrapValue; public static bool ChangeQuotaValue; public static int QuotaIncrease; public static bool IncreaseEventCountPerDay; public static int EventCount; public static List<SpawnableItemWithRarity> NotModifiedSpawnableItemsWithRarity = new List<SpawnableItemWithRarity>(); public static string CurrentMessage = ""; public static Dictionary<string, Type> EnemyBase = new Dictionary<string, Type> { { "flowerman", typeof(FlowermanAI) }, { "hoarderbug", typeof(HoarderBugAI) }, { "springman", typeof(SpringManAI) }, { "crawler", typeof(CrawlerAI) }, { "sandspider", typeof(SandSpiderAI) }, { "jester", typeof(JesterAI) }, { "centipede", typeof(CentipedeAI) }, { "blobai", typeof(BlobAI) }, { "dressgirl", typeof(DressGirlAI) }, { "pufferenemy", typeof(PufferAI) }, { "eyelessdogs", typeof(MouthDogAI) }, { "forestgiant", typeof(ForestGiantAI) }, { "sandworm", typeof(SandWormAI) }, { "baboonbird", typeof(BaboonBirdAI) }, { "nutcrackerenemy", typeof(NutcrackerEnemyAI) }, { "maskedplayerenemy", typeof(MaskedPlayerEnemy) } }; public static List<HullEvent> EventDictionary = new List<HullEvent> { new FlowerManEvent(), new LandMineEvent(), new HoarderBugEvent(), new SpringManEvent(), new LizardsEvent(), new ArachnophobiaEvent(), new BeeEvent(), new SlimeEvent(), new DevochkaPizdecEvent(), new EnemyBountyEvent(), new OpenTheNoorEvent(), new OnAPowderKegEvent(), new OutSideEnemyDayEvent(), new HellEvent(), new NothingEvent(), new HackedTurretsEvent(), new BabkinPogrebEvent(), new HullBreakEvent(), new NutcrackerEvent() }; public static List<HullEvent> CurrentEvents = new List<HullEvent>(); private readonly Harmony _harmony = new Harmony("HULLBREAKER"); private void Awake() { Mls = Logger.CreateLogSource("HULLBREAKER 1.3.10"); Mls.LogInfo((object)"Ready to break hull; HullBreakerCompany"); _harmony.PatchAll(typeof(Plugin)); _harmony.PatchAll(typeof(EventsHandler)); if (!_loaded) { Initialize(); } } public void Start() { if (!_loaded) { Initialize(); } } public void OnDestroy() { if (!_loaded) { Initialize(); } } public void Initialize() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown ConfigManager.SetConfigValue(); GameObject val = new GameObject("HullManager"); Object.DontDestroyOnLoad((Object)(object)val); ((Object)val).hideFlags = (HideFlags)61; val.AddComponent<HullManager>(); Mls.LogInfo((object)"HullManager created"); CustomEventLoader.LoadCustomEvents(); _loaded = true; } [HarmonyPatch(typeof(RoundManager), "LoadNewLevel")] [HarmonyPrefix] private static bool ModifiedLoad(ref SelectableLevel newLevel) { //IL_03b7: Unknown result type (might be due to invalid IL or missing references) //IL_03bc: Unknown result type (might be due to invalid IL or missing references) //IL_03cd: Unknown result type (might be due to invalid IL or missing references) //IL_03d2: Unknown result type (might be due to invalid IL or missing references) //IL_03d7: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: Expected O, but got Unknown //IL_03f4: Unknown result type (might be due to invalid IL or missing references) //IL_03f9: Unknown result type (might be due to invalid IL or missing references) //IL_03fe: Unknown result type (might be due to invalid IL or missing references) //IL_0408: Expected O, but got Unknown //IL_048e: Unknown result type (might be due to invalid IL or missing references) //IL_0493: Unknown result type (might be due to invalid IL or missing references) //IL_0498: Unknown result type (might be due to invalid IL or missing references) //IL_04a2: Expected O, but got Unknown CurrentEvents.Clear(); Mls.LogInfo((object)("Client is host: " + ((NetworkBehaviour)RoundManager.Instance).IsHost)); if (!((NetworkBehaviour)RoundManager.Instance).IsHost) { return true; } CustomEventLoader.DebugLoadCustomEvents(); int levelID = newLevel.levelID; if (!_levelStates.ContainsKey(levelID)) { _levelStates[levelID] = new SelectableLevelState(newLevel); } else { _levelStates[levelID].RestoreState(newLevel); } if (newLevel.levelID == 3) { Mls.LogInfo((object)"Level is company, skipping"); CurrentMessage = "Events not found"; DaysPassed = 0; return true; } DaysPassed++; Mls.LogInfo((object)$"Days passed: {DaysPassed}"); BountyIsActive = false; OneForAllIsActive = false; ResetLevelUnits(newLevel); SelectableLevel val = newLevel; List<string> randomGameEvents = RandomSelector.GetRandomGameEvents(); Dictionary<Type, int> dictionary = new Dictionary<Type, int>(); Dictionary<Type, int> dictionary2 = new Dictionary<Type, int>(); dictionary.Clear(); NotModifiedSpawnableItemsWithRarity.Clear(); foreach (SpawnableItemWithRarity item in val.spawnableScrap) { NotModifiedSpawnableItemsWithRarity.Add(item); } if (EventCount != 0 && EnableEventMessages) { HUDManager.Instance.AddTextToChatOnServer("<color=red>NOTES ABOUT MOON:</color>\"", -1); } foreach (string gameEvent in randomGameEvents) { try { HullEvent hullEvent = EventDictionary.FirstOrDefault((HullEvent e) => e.ID() == gameEvent); if (hullEvent != null) { hullEvent.Execute(newLevel, dictionary, dictionary2); Mls.LogInfo((object)("Event: " + gameEvent)); UpdateRarity(newLevel.Enemies, dictionary); UpdateRarity(newLevel.OutsideEnemies, dictionary2); CurrentEvents.Add(hullEvent); } } catch (NullReferenceException ex) { Mls.LogError((object)$"NullReferenceException caught while processing event: {gameEvent}. Exception message: {ex.Message}. Caused : {ex.InnerException}"); } } HullManager.LogEnemyRarity(newLevel.Enemies, "⬛⬛⬛⬛⬛⬛ENEMIES RARITY⬛⬛⬛⬛⬛⬛"); HullManager.LogEnemyRarity(newLevel.DaytimeEnemies, "⬛⬛⬛⬛⬛⬛DAYTIME ENEMIES RARITY⬛⬛⬛⬛⬛⬛"); HullManager.LogEnemyRarity(newLevel.OutsideEnemies, "⬛⬛⬛⬛⬛⬛OUTSIDE ENEMIES RARITY⬛⬛⬛⬛⬛⬛"); if (!randomGameEvents.Contains("Bee")) { using IEnumerator<SpawnableEnemyWithRarity> enumerator3 = val.DaytimeEnemies.Where((SpawnableEnemyWithRarity unit) => (Object)(object)unit.enemyType.enemyPrefab.GetComponent<RedLocustBees>() != (Object)null).GetEnumerator(); if (enumerator3.MoveNext()) { SpawnableEnemyWithRarity current2 = enumerator3.Current; current2.rarity = 22; } } if (UseHullBreakerLevelSettings) { val.maxEnemyPowerCount += 16; val.maxOutsideEnemyPowerCount += 20; val.maxScrap += Random.Range(6, 24); val.maxTotalScrapValue += Random.Range(400, 800); val.daytimeEnemySpawnChanceThroughDay = new AnimationCurve((Keyframe[])(object)new Keyframe[2] { new Keyframe(0f, 5f), new Keyframe(0.5f, 5f) }); val.enemySpawnChanceThroughoutDay = new AnimationCurve((Keyframe[])(object)new Keyframe[1] { new Keyframe(0f, 256f) }); } else if (UseDefaultGameSettings) { Mls.LogInfo((object)"Default settings"); } else { val.maxEnemyPowerCount = MaxEnemyPowerCount; val.maxOutsideEnemyPowerCount = MaxOutsideEnemyPowerCount; val.maxDaytimeEnemyPowerCount = MaxDaytimeEnemyPowerCount; val.minScrap = MinScrap; val.maxScrap = MaxScrap; val.minTotalScrapValue = MinTotalScrapValue; val.maxTotalScrapValue = MaxTotalScrapValue; val.enemySpawnChanceThroughoutDay = new AnimationCurve((Keyframe[])(object)new Keyframe[1] { new Keyframe(0f, BunkerEnemyScale) }); } newLevel = val; CurrentMessage = "Events not found"; CurrentMessage = "<color=green>Notes about the <color=white>" + newLevel.PlanetName + ":\n\n"; foreach (HullEvent currentEvent in CurrentEvents) { CurrentMessage = CurrentMessage + "<color=orange>" + currentEvent.ID() + ": <color=white> " + currentEvent.GetMessage() + "\n\n"; } return true; } private static void UpdateRarity(List<SpawnableEnemyWithRarity> enemies, Dictionary<Type, int> componentRarity) { if (componentRarity.Count <= 0) { return; } foreach (SpawnableEnemyWithRarity unit in enemies) { foreach (KeyValuePair<Type, int> item in componentRarity) { if ((Object)(object)unit.enemyType.enemyPrefab.GetComponent(item.Key) == (Object)null) { continue; } if (enemies.Any((SpawnableEnemyWithRarity e) => (Object)(object)e.enemyType == (Object)(object)unit.enemyType)) { unit.rarity = item.Value; componentRarity.Remove(item.Key); } break; } } } public static void LevelUnits(SelectableLevel n, bool turret = false, bool landmine = false) { //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_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown Mls.LogInfo((object)$"Turret: {turret}, Landmine: {landmine}"); AnimationCurve numberToSpawn = new AnimationCurve((Keyframe[])(object)new Keyframe[2] { new Keyframe(0f, LandMineTurretScale), new Keyframe(1f, 25f) }); SpawnableMapObject[] spawnableMapObjects = n.spawnableMapObjects; foreach (SpawnableMapObject val in spawnableMapObjects) { Landmine componentInChildren = val.prefabToSpawn.GetComponentInChildren<Landmine>(); if ((Object)(object)componentInChildren != (Object)null) { val.numberToSpawn = numberToSpawn; } } } private static void ResetLevelUnits(SelectableLevel level) { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Expected O, but got Unknown SpawnableMapObject[] spawnableMapObjects = level.spawnableMapObjects; foreach (SpawnableMapObject val in spawnableMapObjects) { Landmine componentInChildren = val.prefabToSpawn.GetComponentInChildren<Landmine>(); if ((Object)(object)componentInChildren != (Object)null) { val.numberToSpawn = new AnimationCurve((Keyframe[])(object)new Keyframe[1] { new Keyframe(0f, 2.5f) }); } } } } public static class PluginInfo { public const string PLUGIN_GUID = "HullBreakerCompany"; public const string PLUGIN_NAME = "HullBreakerCompany"; public const string PLUGIN_VERSION = "1.3.10"; } } namespace HullBreakerCompany.Hull { public class ConfigManager { private static string _configPath = Path.Combine(Paths.ConfigPath, "HullBreakerCompany.cfg"); private static ConfigFile _configFile; public static T GetConfigValue<T>(string key, T defaultValue, string description = null) { EnsureConfigExists(); return _configFile.Bind<T>("Settings", key, defaultValue, description).Value; } public static void SetConfigValue() { Plugin.LandMineTurretScale = GetConfigValue("LandMineTurretScale", 64, "Should change amount of Landmines & Turrets when these events are active: (Landmine & Turret)"); Plugin.UseShortChatMessages = GetConfigValue("UseShortChatMessages", defaultValue: false, "Use short event message (one/two words), can add surprise effect & difficulty"); Plugin.EnableEventMessages = GetConfigValue("EnableEventMessages", defaultValue: true, "Enable chat event messages"); Plugin.UseHullBreakerLevelSettings = GetConfigValue("UseHullBreakerLevelSettings", defaultValue: true, "Use HullBreaker level settings, if false, use default level settings"); Plugin.UseDefaultGameSettings = GetConfigValue("UseDefaultLevelSettings", defaultValue: false, "Use default level settings, if false, you can change on one's own"); Plugin.ChangeQuotaValue = GetConfigValue("ChangeQuota", defaultValue: true, "Change quota"); Plugin.QuotaIncrease = GetConfigValue("IncreasedQuota", 256, "Increased quota"); Plugin.MaxEnemyPowerCount = GetConfigValue("MaxEnemyPowerCount", 10, "Max enemy power count"); Plugin.MaxOutsideEnemyPowerCount = GetConfigValue("MaxOutsideEnemyPowerCount", 10, "Max outside enemy power count"); Plugin.MaxDaytimeEnemyPowerCount = GetConfigValue("MaxDaytimeEnemyPowerCount", 20, "Max daytime enemy power count"); Plugin.MinScrap = GetConfigValue("MinScrap", 10, "Min scrap"); Plugin.MaxScrap = GetConfigValue("MaxScrap", 15, "Max scrap"); Plugin.MinTotalScrapValue = GetConfigValue("MinTotalScrapValue", 300, "Min total scrap value"); Plugin.MaxTotalScrapValue = GetConfigValue("MaxTotalScrapValue", 700, "Max total scrap value"); Plugin.BunkerEnemyScale = GetConfigValue("BunkerEnemyScale", 256, "Should change global bunker enemy spawn rate, not sure if its work"); Plugin.IncreaseEventCountPerDay = GetConfigValue("IncreaseEventCountPerDay", defaultValue: false, "The number of events will increase every day. Visit the company building to reset"); Plugin.EventCount = GetConfigValue("EventCount", 3, "The number of events that will be active at the same time"); } public static Dictionary<string, int> GetWeights() { EnsureConfigExists(); Dictionary<string, int> dictionary = new Dictionary<string, int>(); foreach (HullEvent item in Plugin.EventDictionary) { dictionary[item.ID()] = _configFile.Bind<int>("Weights", item.ID(), item.GetWeight(), item.GetDescription()).Value; } return dictionary; } private static void EnsureConfigExists() { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Expected O, but got Unknown if (_configFile == null) { if (!File.Exists(_configPath)) { CreateDefaultConfigFile(); } _configFile = new ConfigFile(_configPath, true); } } private static void CreateDefaultConfigFile() { using StreamWriter streamWriter = File.CreateText(_configPath); streamWriter.WriteLine("[Weights]"); foreach (HullEvent item in Plugin.EventDictionary) { streamWriter.WriteLine(item.ID() + "=" + item.GetWeight()); } } } public class CustomEventLoader { public static void LoadCustomEvents() { List<Dictionary<string, string>> list = LoadEventDataFromCfgFiles(); if (list.Count == 0) { return; } foreach (Dictionary<string, string> item in list) { CustomEvent customEvent = new CustomEvent(); customEvent.SetID(item["EventID"]); customEvent.SetWeight(int.Parse(item["EventWeight"])); customEvent.Rarity = int.Parse(item["EnemyRarity"]); if (item.ContainsKey("SpawnableEnemies")) { customEvent.EnemySpawnList = new HashSet<string>(item["SpawnableEnemies"].Split(',')).ToList(); } if (item.ContainsKey("SpawnableOutsideEnemies")) { customEvent.OutsideSpawnList = new HashSet<string>(item["SpawnableOutsideEnemies"].Split(',')).ToList(); } customEvent.SetMessage(item["InGameMessage"]); customEvent.SetShortMessage(item["InGameShortMessage"]); Plugin.EventDictionary.Add(customEvent); } } private static List<Dictionary<string, string>> LoadEventDataFromCfgFiles() { string text = Paths.BepInExRootPath + "\\HullEvents"; if (!Directory.Exists(text)) { Plugin.Mls.LogError((object)("Directory does not exist: " + text)); return new List<Dictionary<string, string>>(); } string[] files = Directory.GetFiles(text, "*.cfg"); List<Dictionary<string, string>> list = new List<Dictionary<string, string>>(); string[] array = files; foreach (string path in array) { string[] array2 = File.ReadAllLines(path); Dictionary<string, string> dictionary = new Dictionary<string, string>(); string[] array3 = array2; foreach (string text2 in array3) { if (!text2.StartsWith("[") && !string.IsNullOrWhiteSpace(text2)) { string[] array4 = text2.Split('='); if (array4.Length == 2) { string key = array4[0].Trim(); string value = array4[1].Trim(); dictionary[key] = value; } } } list.Add(dictionary); Plugin.Mls.LogInfo((object)("Loaded event: " + dictionary["EventID"])); } return list; } public static void AddEvent(HullEvent newEvent) { Plugin.Mls.LogInfo((object)("Adding new event" + newEvent.ID() + " to dictionary")); Plugin.EventDictionary.Add(newEvent); } public static void DebugLoadCustomEvents() { foreach (HullEvent item in Plugin.EventDictionary) { if (item is CustomEvent customEvent) { Plugin.Mls.LogInfo((object)("Event ID: " + customEvent.ID())); Plugin.Mls.LogInfo((object)("Spawnable Enemies: " + string.Join(", ", customEvent.EnemySpawnList))); Plugin.Mls.LogInfo((object)("Message: " + customEvent.GetMessage())); } } } } public abstract class EventsHandler { [HarmonyPostfix] [HarmonyPatch(typeof(EnemyAI), "KillEnemyServerRpc")] private static void EnemyBounty() { Plugin.Mls.LogInfo((object)$"Enemy killed, bounty is active: {Plugin.BountyIsActive}"); if (Plugin.BountyIsActive) { Terminal val = Object.FindObjectOfType<Terminal>(); val.groupCredits += 30; val.SyncGroupCreditsServerRpc(val.groupCredits, val.numberOfItemsInDropship); HullManager.SendChatEventMessage("<color=green>+60 credits</color>"); } } [HarmonyPostfix] [HarmonyPatch(typeof(PlayerControllerB), "KillPlayerClientRpc")] private static void OneForAll() { if (((NetworkBehaviour)RoundManager.Instance).IsHost) { Plugin.Mls.LogInfo((object)$"Player killed, one for all is active: {Plugin.OneForAllIsActive}"); if (Plugin.OneForAllIsActive) { Plugin.OneForAllIsActive = false; HullManager hullManager = Object.FindObjectOfType<HullManager>(); hullManager.timeOfDay.votedShipToLeaveEarlyThisRound = true; hullManager.timeOfDay.SetShipLeaveEarlyServerRpc(); HullManager.SendChatEventMessage("<color=red>One of the workers died, the ship will go into orbit in an hour</color>"); } } } [HarmonyPostfix] [HarmonyPatch(typeof(GameNetworkManager), "StartHost")] private static void ResetDayPassed() { Plugin.CurrentMessage = "Events not found"; Plugin.DaysPassed = 0; } } public abstract class HullEvent { public abstract string ID(); public virtual int GetWeight() { return 1; } public virtual string GetDescription() { return "Default description"; } public virtual string GetMessage() { return "Default message"; } public virtual string GetShortMessage() { return "Short message"; } public virtual void Execute(SelectableLevel level, Dictionary<Type, int> enemyComponentRarity, Dictionary<Type, int> outsideComponentRarity) { } } public class HullManager : MonoBehaviour { public TimeOfDay timeOfDay; public static HullManager Instance { get; private set; } public void Update() { if ((Object)(object)timeOfDay == (Object)null) { timeOfDay = Object.FindFirstObjectByType<TimeOfDay>(); } else if (Plugin.ChangeQuotaValue) { timeOfDay.quotaVariables.baseIncrease = Plugin.QuotaIncrease; } } private void Awake() { if ((Object)(object)Instance == (Object)null) { Instance = this; Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject); } else { Object.Destroy((Object)(object)((Component)this).gameObject); } } public void AddMoney(int amount) { Terminal val = Object.FindObjectOfType<Terminal>(); val.groupCredits += amount; val.SyncGroupCreditsServerRpc(val.groupCredits, val.numberOfItemsInDropship); } public void ExecuteAfterDelay(Action action, float delay) { ((MonoBehaviour)this).StartCoroutine(DelayedExecution(action, delay)); } private IEnumerator DelayedExecution(Action action, float delay) { yield return (object)new WaitForSeconds(delay); action(); } public static void SendChatEventMessage(HullEvent hullEvent) { if ((Object)(object)HUDManager.Instance != (Object)null && hullEvent != null && Plugin.EnableEventMessages) { HUDManager.Instance.AddTextToChatOnServer(Plugin.UseShortChatMessages ? hullEvent.GetShortMessage() : hullEvent.GetMessage(), -1); } } public static void SendChatEventMessage(string message) { if ((Object)(object)HUDManager.Instance != (Object)null && message != null && Plugin.EnableEventMessages) { HUDManager.Instance.AddTextToChatOnServer(message, -1); } } public static void LogEnemyRarity(List<SpawnableEnemyWithRarity> enemies, string title) { Plugin.Mls.LogInfo((object)""); Plugin.Mls.LogInfo((object)title); foreach (SpawnableEnemyWithRarity enemy in enemies) { Plugin.Mls.LogInfo((object)$"{((Object)enemy.enemyType.enemyPrefab).name} - {enemy.rarity}"); } } } public abstract class RandomSelector { private static Random _random = new Random(); public static List<string> GetRandomGameEvents() { int count = (Plugin.IncreaseEventCountPerDay ? Plugin.DaysPassed : Plugin.EventCount); return GetWeightedRandomGameEvents(ConfigManager.GetWeights(), count); } private static List<T> GetWeightedRandomGameEvents<T>(Dictionary<T, int> weights, int count) { int maxValue = weights.Where((KeyValuePair<T, int> x) => x.Value > 0).Sum((KeyValuePair<T, int> x) => x.Value); HashSet<T> hashSet = new HashSet<T>(); while (hashSet.Count < count) { int num = _random.Next(maxValue); foreach (KeyValuePair<T, int> weight in weights) { if (weight.Value != 0) { if (num < weight.Value) { hashSet.Add(weight.Key); break; } num -= weight.Value; } } } return hashSet.ToList(); } private static void Shuffle<T>(IList<T> list) { int num = list.Count; while (num > 1) { num--; int num2 = _random.Next(num + 1); int index = num2; int index2 = num; T value = list[num]; T value2 = list[num2]; list[index] = value; list[index2] = value2; } } } public class SelectableLevelState { public int MinScrap; public int MaxScrap; public int MinTotalScrapValue; public int MaxTotalScrapValue; public int MaxEnemyPowerCount = 8; public int MaxOutsideEnemyPowerCount = 15; public int MaxDaytimeEnemyPowerCount = 20; public AnimationCurve EnemySpawnChanceThroughoutDay; public AnimationCurve OutsideEnemySpawnChanceThroughDay; public AnimationCurve DaytimeEnemySpawnChanceThroughDay; public List<SpawnableEnemyWithRarity> EnemyList = new List<SpawnableEnemyWithRarity>(); public List<SpawnableEnemyWithRarity> OutsideEnemyList = new List<SpawnableEnemyWithRarity>(); public List<SpawnableEnemyWithRarity> DaytimeEnemyList = new List<SpawnableEnemyWithRarity>(); public SelectableLevelState(SelectableLevel level) { MinScrap = level.minScrap; MaxScrap = level.maxScrap; MinTotalScrapValue = level.minTotalScrapValue; MaxTotalScrapValue = level.maxTotalScrapValue; MaxEnemyPowerCount = level.maxEnemyPowerCount; MaxOutsideEnemyPowerCount = level.maxOutsideEnemyPowerCount; MaxDaytimeEnemyPowerCount = level.maxDaytimeEnemyPowerCount; EnemySpawnChanceThroughoutDay = level.enemySpawnChanceThroughoutDay; OutsideEnemySpawnChanceThroughDay = level.outsideEnemySpawnChanceThroughDay; DaytimeEnemySpawnChanceThroughDay = level.daytimeEnemySpawnChanceThroughDay; CloneEnemies(level.Enemies, EnemyList); CloneEnemies(level.OutsideEnemies, OutsideEnemyList); CloneEnemies(level.DaytimeEnemies, DaytimeEnemyList); } public void RestoreState(SelectableLevel level) { level.minScrap = MinScrap; level.maxScrap = MaxScrap; level.minTotalScrapValue = MinTotalScrapValue; level.maxTotalScrapValue = MaxTotalScrapValue; level.maxEnemyPowerCount = MaxEnemyPowerCount; level.maxOutsideEnemyPowerCount = MaxOutsideEnemyPowerCount; level.maxDaytimeEnemyPowerCount = MaxDaytimeEnemyPowerCount; level.enemySpawnChanceThroughoutDay = EnemySpawnChanceThroughoutDay; level.outsideEnemySpawnChanceThroughDay = OutsideEnemySpawnChanceThroughDay; level.daytimeEnemySpawnChanceThroughDay = DaytimeEnemySpawnChanceThroughDay; level.Enemies.Clear(); CloneEnemies(EnemyList, level.Enemies); level.OutsideEnemies.Clear(); CloneEnemies(OutsideEnemyList, level.OutsideEnemies); level.DaytimeEnemies.Clear(); CloneEnemies(DaytimeEnemyList, level.DaytimeEnemies); } private void CloneEnemies(List<SpawnableEnemyWithRarity> source, List<SpawnableEnemyWithRarity> destination) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: 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_0032: Expected O, but got Unknown foreach (SpawnableEnemyWithRarity item2 in source) { SpawnableEnemyWithRarity item = new SpawnableEnemyWithRarity { enemyType = item2.enemyType, rarity = item2.rarity }; destination.Add(item); } } } } namespace HullBreakerCompany.Events { public class ArachnophobiaEvent : HullEvent { public override string ID() { return "Arachnophobia"; } public override int GetWeight() { return 20; } public override string GetDescription() { return "Increased chance of spider spawning"; } public override string GetMessage() { return "<color=white>Possible habitat of spiders</color>"; } public override string GetShortMessage() { return "<color=white>ARACHNOPHOBIA</color>"; } public override void Execute(SelectableLevel level, Dictionary<Type, int> enemyComponentRarity, Dictionary<Type, int> outsideComponentRarity) { if (!level.Enemies.All((SpawnableEnemyWithRarity unit) => (Object)(object)unit.enemyType.enemyPrefab.GetComponent<DressGirlAI>() == (Object)null)) { enemyComponentRarity.Add(typeof(SandSpiderAI), 256); HullManager.SendChatEventMessage(this); } } } public class BabkinPogrebEvent : HullEvent { public override string ID() { return "BabkinPogreb"; } public override int GetWeight() { return 10; } public override string GetDescription() { return "Only jars of pickles spawn on the moon"; } public override string GetMessage() { return "<color=white>On the this moon, something strange happened with scrap...</color>"; } public override string GetShortMessage() { return "<color=white>ITEM MYSTERY</color>"; } public override void Execute(SelectableLevel level, Dictionary<Type, int> enemyComponentRarity, Dictionary<Type, int> outsideComponentRarity) { try { if ((Object)(object)HullManager.Instance == (Object)null) { Plugin.Mls.LogError((object)"HullManager.Instance is null"); return; } if ((Object)(object)level == (Object)null) { Plugin.Mls.LogError((object)"level is null"); return; } level.spawnableScrap.RemoveAll((SpawnableItemWithRarity item) => item.spawnableItem.itemName != "Jar of pickles"); if (level.spawnableScrap.Count == 0) { Plugin.Mls.LogError((object)"No jars of pickles found in spawnableScrap list!"); DelayedReturnList(level); return; } foreach (SpawnableItemWithRarity item in level.spawnableScrap.Where((SpawnableItemWithRarity item) => item.spawnableItem.itemName == "Jar of pickles")) { item.rarity = 100; } HullManager.Instance.ExecuteAfterDelay(delegate { DelayedReturnList(level); }, 12f); HullManager.SendChatEventMessage(this); } catch (ArgumentOutOfRangeException ex) { Plugin.Mls.LogError((object)("ArgumentOutOfRangeException caught in BabkinPogrebEvent.Execute: " + ex.Message)); } } private void DelayedReturnList(SelectableLevel level) { Plugin.Mls.LogInfo((object)"Resetting spawnable items..."); level.spawnableScrap.Clear(); foreach (SpawnableItemWithRarity item in Plugin.NotModifiedSpawnableItemsWithRarity) { level.spawnableScrap.Add(item); } } } public class BeeEvent : HullEvent { public override string ID() { return "Bee"; } public override int GetWeight() { return 30; } public override string GetDescription() { return "Increased chance of bee hives spawning"; } public override string GetMessage() { return "<color=white>Possibly a large amount of bee hives</color>"; } public override string GetShortMessage() { return "<color=white>ANNOYING BUZZING</color>"; } public override void Execute(SelectableLevel level, Dictionary<Type, int> enemyComponentRarity, Dictionary<Type, int> outsideComponentRarity) { using (IEnumerator<SpawnableEnemyWithRarity> enumerator = level.DaytimeEnemies.Where((SpawnableEnemyWithRarity unit) => (Object)(object)unit.enemyType.enemyPrefab.GetComponent<RedLocustBees>() != (Object)null).GetEnumerator()) { if (enumerator.MoveNext()) { SpawnableEnemyWithRarity current = enumerator.Current; current.rarity = 256; } } HullManager.SendChatEventMessage(this); } } public class CustomEvent : HullEvent { private string _id; private int _weight; private string _message; private string _shortMessage; public List<string> EnemySpawnList = new List<string>(); public List<string> OutsideSpawnList = new List<string>(); public int Rarity = 1; public override string ID() { return _id; } public void SetID(string value) { _id = value; } public void SetWeight(int value) { _weight = value; } public override int GetWeight() { return _weight; } public void SetMessage(string value) { _message = value; } public void SetShortMessage(string value) { _shortMessage = value; } public override string GetMessage() { return "<color=white>" + _message + "</color>"; } public override string GetShortMessage() { return "<color=white>" + _shortMessage + "</color>"; } public override void Execute(SelectableLevel level, Dictionary<Type, int> componentRarity, Dictionary<Type, int> outsideComponentRarity) { foreach (string item in EnemySpawnList.TakeWhile((string enemy) => enemy != "off")) { if (Plugin.EnemyBase.TryGetValue(item, out var value)) { componentRarity.Add(value, Rarity); } else { Plugin.Mls.LogError((object)("Enemy " + item + " not found in EnemyBase")); } } foreach (string item2 in OutsideSpawnList.TakeWhile((string enemy) => enemy != "off")) { if (Plugin.EnemyBase.TryGetValue(item2, out var value2)) { outsideComponentRarity.Add(value2, Rarity); } else { Plugin.Mls.LogError((object)("Enemy " + item2 + " not found in EnemyBase")); } } HullManager.SendChatEventMessage(Plugin.UseShortChatMessages ? GetShortMessage() : GetMessage()); } } public class DevochkaPizdecEvent : HullEvent { public override string ID() { return "DevochkaPizdec"; } public override int GetWeight() { return 5; } public override string GetDescription() { return "Increased chance of phantom girl spawn"; } public override string GetMessage() { return "<color=white>A lot of workers are going crazy here</color>"; } public override string GetShortMessage() { return "<color=white>COTARD SYNDROME</color>"; } public override void Execute(SelectableLevel level, Dictionary<Type, int> enemyComponentRarity, Dictionary<Type, int> outsideComponentRarity) { if (level.Enemies.Exists((SpawnableEnemyWithRarity enemy) => ((object)enemy).GetType() == typeof(DressGirlAI))) { enemyComponentRarity.Add(typeof(DressGirlAI), 32); HullManager.SendChatEventMessage(this); } } } public class EnemyBountyEvent : HullEvent { public override string ID() { return "EnemyBounty"; } public override int GetWeight() { return 50; } public override string GetDescription() { return "Company pays money for killing the enemies / 60 per enemy"; } public override string GetMessage() { return "<color=white>Company pays money for killing the enemies!</color>"; } public override string GetShortMessage() { return "<color=white>ENEMY BOUNTY</color>"; } public override void Execute(SelectableLevel level, Dictionary<Type, int> enemyComponentRarity, Dictionary<Type, int> outsideComponentRarity) { Plugin.BountyIsActive = true; HullManager.SendChatEventMessage(this); } } public class FlowerManEvent : HullEvent { public override string ID() { return "FlowerMan"; } public override int GetWeight() { return 20; } public override string GetDescription() { return "Increased chance of flowerman spawn"; } public override string GetMessage() { return "<color=white>So many eyes in the dark, carefully</color>"; } public override string GetShortMessage() { return "<color=white>WHITE EYES...</color>"; } public override void Execute(SelectableLevel level, Dictionary<Type, int> enemyComponentRarity, Dictionary<Type, int> outsideComponentRarity) { if (!level.Enemies.All((SpawnableEnemyWithRarity unit) => (Object)(object)unit.enemyType.enemyPrefab.GetComponent<FlowermanAI>() == (Object)null)) { enemyComponentRarity.Add(typeof(FlowermanAI), 256); HullManager.SendChatEventMessage(this); } } } public class HackedTurretsEvent : HullEvent { public override string ID() { return "HackedTurrets"; } public override int GetWeight() { return 10; } public override string GetDescription() { return "Turrets dont work on the moon"; } public override string GetMessage() { return "<color=white>The company's hackers have disabled all turrets on this moon, you can breathe easy</color>"; } public override string GetShortMessage() { return "<color=white>SYSTEM FAILURE</color>"; } public override void Execute(SelectableLevel level, Dictionary<Type, int> enemyComponentRarity, Dictionary<Type, int> outsideComponentRarity) { if ((Object)(object)HullManager.Instance == (Object)null) { Plugin.Mls.LogError((object)"HullManager.Instance is null"); return; } if ((Object)(object)level == (Object)null) { Plugin.Mls.LogError((object)"level is null"); return; } HullManager.Instance.ExecuteAfterDelay(delegate { HackTurrets(); }, 16f); HullManager.SendChatEventMessage(this); } private void HackTurrets() { Turret[] array = Object.FindObjectsOfType<Turret>(); Turret[] array2 = array; foreach (Turret val in array2) { val.ToggleTurretServerRpc(false); } } } public class HellEvent : HullEvent { public override string ID() { return "Hell"; } public override int GetWeight() { return 1; } public override string GetDescription() { return "Increased chance of spawning Jester and more enemies"; } public override string GetMessage() { return "<color=orange>It says here that there is total hell happening on the this moon</color>"; } public override string GetShortMessage() { return "<color=white>HELL</color>"; } public override void Execute(SelectableLevel level, Dictionary<Type, int> enemyComponentRarity, Dictionary<Type, int> outsideComponentRarity) { if (!level.Enemies.All((SpawnableEnemyWithRarity unit) => (Object)(object)unit.enemyType.enemyPrefab.GetComponent<JesterAI>() == (Object)null)) { enemyComponentRarity.Add(typeof(JesterAI), 64); HullManager.SendChatEventMessage(this); RoundManager.Instance.hourTimeBetweenEnemySpawnBatches = 1; HullManager.Instance.ExecuteAfterDelay(delegate { Hell(); }, 16f); } } private void Hell() { EnemyVent[] array = Object.FindObjectsOfType<EnemyVent>(); for (int i = 0; i < 8; i++) { if (array.Length != 0) { EnemyVent val = array[Random.Range(0, array.Length)]; RoundManager.Instance.SpawnEnemyFromVent(val); } } } } public class HoarderBugEvent : HullEvent { public override string ID() { return "HoarderBug"; } public override int GetWeight() { return 50; } public override string GetDescription() { return "Increased chance of hoarder bug spawn"; } public override string GetMessage() { return "<color=white>Keep an eye on the loot, Hoarding Bugs nearby</color>"; } public override string GetShortMessage() { return "<color=white>BUG INVASION</color>"; } public override void Execute(SelectableLevel level, Dictionary<Type, int> enemyComponentRarity, Dictionary<Type, int> outsideComponentRarity) { if (!level.Enemies.All((SpawnableEnemyWithRarity unit) => (Object)(object)unit.enemyType.enemyPrefab.GetComponent<HoarderBugAI>() == (Object)null)) { enemyComponentRarity.Add(typeof(HoarderBugAI), 512); HullManager.SendChatEventMessage(this); } } } public class HullBreakEvent : HullEvent { public override string ID() { return "HullBreak"; } public override int GetWeight() { return 5; } public override string GetDescription() { return "Getting money for visiting this moon"; } public override string GetMessage() { return "<color=green>Take a break, the company is sending money for visiting the moon</color>"; } public override string GetShortMessage() { return "<color=white>TAKE A BREAK</color>"; } public override void Execute(SelectableLevel level, Dictionary<Type, int> enemyComponentRarity, Dictionary<Type, int> outsideComponentRarity) { HullManager.Instance.AddMoney(120); HullManager.SendChatEventMessage(this); } } public class LandMineEvent : HullEvent { public override string ID() { return "LandMine"; } public override int GetWeight() { return 30; } public override string GetDescription() { return "Increased chance of landmines spawning"; } public override string GetMessage() { return "<color=white>Watch your step, there are a lot of landmines</color>"; } public override string GetShortMessage() { return "<color=white>LANDMINE</color>"; } public override void Execute(SelectableLevel level, Dictionary<Type, int> enemyComponentRarity, Dictionary<Type, int> outsideComponentRarity) { Plugin.LevelUnits(level, turret: false, landmine: true); HullManager.SendChatEventMessage(this); } } public class LizardsEvent : HullEvent { public override string ID() { return "Lizards"; } public override int GetWeight() { return 15; } public override string GetDescription() { return "Increased chance of puffers spawn"; } public override string GetMessage() { return "<color=white>Horrible smell from toxic lizards</color>"; } public override string GetShortMessage() { return "<color=white>LIZARDSSS</color>"; } public override void Execute(SelectableLevel level, Dictionary<Type, int> enemyComponentRarity, Dictionary<Type, int> outsideComponentRarity) { if (!level.Enemies.All((SpawnableEnemyWithRarity unit) => (Object)(object)unit.enemyType.enemyPrefab.GetComponent<PufferAI>() == (Object)null)) { enemyComponentRarity.Add(typeof(PufferAI), 64); HullManager.SendChatEventMessage(this); } } } public class NothingEvent : HullEvent { public override string ID() { return "Nothing"; } public override int GetWeight() { return 60; } public override string GetDescription() { return "Nothing happens"; } public override string GetMessage() { return "<color=white>---</color>"; } public override string GetShortMessage() { return "<color=white>---</color>"; } public override void Execute(SelectableLevel level, Dictionary<Type, int> enemyComponentRarity, Dictionary<Type, int> outsideComponentRarity) { HullManager.SendChatEventMessage(this); } } public class NutcrackerEvent : HullEvent { public override string ID() { return "Nutcracker"; } public override int GetWeight() { return 5; } public override string GetDescription() { return "Increased chance of NutCracker spawn"; } public override string GetMessage() { return "<color=white>NutCrackers detected in the area!</color>"; } public override string GetShortMessage() { return "<color=orange>NUTCRACKERS INCOMING</color>"; } public override void Execute(SelectableLevel level, Dictionary<Type, int> enemyComponentRarity, Dictionary<Type, int> outsideComponentRarity) { if (!level.Enemies.All((SpawnableEnemyWithRarity unit) => (Object)(object)unit.enemyType.enemyPrefab.GetComponent<NutcrackerEnemyAI>() == (Object)null)) { enemyComponentRarity.Add(typeof(NutcrackerEnemyAI), 64); HullManager.SendChatEventMessage(this); } } } public class OnAPowderKegEvent : HullEvent { public override string ID() { return "OnAPowderKeg"; } public override int GetWeight() { return 10; } public override string GetDescription() { return "Landmines can detonate at any time"; } public override string GetMessage() { return "<color=red>CAUTION,</color> <color=white>landmines can detonate at any time</color>"; } public override string GetShortMessage() { return "<color=red>ON A POWDER KEG</color>"; } public override void Execute(SelectableLevel level, Dictionary<Type, int> enemyComponentRarity, Dictionary<Type, int> outsideComponentRarity) { HullManager.Instance.ExecuteAfterDelay(delegate { DetonateLandMine(); }, Random.Range(30, 680)); HullManager.SendChatEventMessage(this); } private void DetonateLandMine() { Landmine[] array = Object.FindObjectsOfType<Landmine>(); Landmine[] array2 = array; foreach (Landmine val in array2) { val.ExplodeMineServerRpc(); } } } public class OneForAllEvent : HullEvent { public override string ID() { return "OneForAll"; } public override int GetWeight() { return 5; } public override string GetDescription() { return "The ship will fly into orbit in an hour if one of the workers dies"; } public override string GetMessage() { return "<color=white>The ship will fly into orbit in an hour if one of the workers dies</color>"; } public override string GetShortMessage() { return "<color=red>ONE FOR ALL!</color>"; } public override void Execute(SelectableLevel level, Dictionary<Type, int> enemyComponentRarity, Dictionary<Type, int> outsideComponentRarity) { Plugin.OneForAllIsActive = true; HullManager.SendChatEventMessage(this); } } public class OpenTheNoorEvent : HullEvent { public override string ID() { return "OpenTheNoor"; } public override int GetWeight() { return 15; } public override string GetDescription() { return "All big doors are locked in the level"; } public override string GetMessage() { return "<color=white>All big doors are locked in the level</color>"; } public override string GetShortMessage() { return "<color=white>OPEN THE NOOR...</color>"; } public override void Execute(SelectableLevel level, Dictionary<Type, int> enemyComponentRarity, Dictionary<Type, int> outsideComponentRarity) { if ((Object)(object)HullManager.Instance == (Object)null) { Plugin.Mls.LogError((object)"HullManager.Instance is null"); return; } if ((Object)(object)level == (Object)null) { Plugin.Mls.LogError((object)"level is null"); return; } HullManager.Instance.ExecuteAfterDelay(delegate { CloseBigDoors(); }, 16f); HullManager.SendChatEventMessage(this); } private void CloseBigDoors() { TerminalAccessibleObject[] array = Object.FindObjectsOfType<TerminalAccessibleObject>(); TerminalAccessibleObject[] array2 = array; foreach (TerminalAccessibleObject val in array2) { val.SetDoorOpenServerRpc(false); } } } public class OutSideEnemyDayEvent : HullEvent { public override string ID() { return "OutSideEnemyDay"; } public override int GetWeight() { return 3; } public override string GetDescription() { return "Increased amount of enemies on the surface during the daytime"; } public override string GetMessage() { return "<color=white>Increased amount of enemies on the surface during the daytime</color>"; } public override string GetShortMessage() { return "<color=red>SILENCE SEASON</color>"; } public override void Execute(SelectableLevel level, Dictionary<Type, int> enemyComponentRarity, Dictionary<Type, int> outsideComponentRarity) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown level.outsideEnemySpawnChanceThroughDay = new AnimationCurve((Keyframe[])(object)new Keyframe[1] { new Keyframe(0f, 512f) }); HullManager.SendChatEventMessage(this); } } public class SlimeEvent : HullEvent { public override string ID() { return "Slime"; } public override int GetWeight() { return 20; } public override string GetDescription() { return "Increased chance of slime spawn"; } public override string GetMessage() { return "<color=white>Inhabited with slime</color>"; } public override string GetShortMessage() { return "<color=white>SO SLIMY</color>"; } public override void Execute(SelectableLevel level, Dictionary<Type, int> enemyComponentRarity, Dictionary<Type, int> outsideComponentRarity) { if (!level.Enemies.All((SpawnableEnemyWithRarity unit) => (Object)(object)unit.enemyType.enemyPrefab.GetComponent<BlobAI>() == (Object)null)) { enemyComponentRarity.Add(typeof(BlobAI), 48); HullManager.SendChatEventMessage(this); } } } public class SpringManEvent : HullEvent { public override string ID() { return "SpringMan"; } public override int GetWeight() { return 10; } public override string GetDescription() { return "Increased chance of spring man spawning (coil-head)"; } public override string GetMessage() { return "<color=white>It's impossible not to look at them</color>"; } public override string GetShortMessage() { return "<color=white>SKULL COILS</color>"; } public override void Execute(SelectableLevel level, Dictionary<Type, int> enemyComponentRarity, Dictionary<Type, int> outsideComponentRarity) { if (!level.Enemies.All((SpawnableEnemyWithRarity unit) => (Object)(object)unit.enemyType.enemyPrefab.GetComponent<SpringManAI>() == (Object)null)) { enemyComponentRarity.Add(typeof(SpringManAI), 128); HullManager.SendChatEventMessage(this); } } } public class TurretEvent : HullEvent { public override string ID() { return "Turret"; } public override int GetWeight() { return 5; } public override string GetDescription() { return "Increased chance of turrets spawning"; } public override string GetMessage() { return "<color=white>Alert, turrets detected</color>"; } public override string GetShortMessage() { return "<color=white>TURRETS</color>"; } public override void Execute(SelectableLevel level, Dictionary<Type, int> enemyComponentRarity, Dictionary<Type, int> outsideComponentRarity) { Plugin.LevelUnits(level, turret: true); HullManager.SendChatEventMessage(this); } } }
BepInEx/plugins/x753-Mimics/Mimics.dll
Decompiled 11 months agousing System; using System.CodeDom.Compiler; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Globalization; using System.Linq; using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using DunGen; using GameNetcodeStuff; using HarmonyLib; using LethalCompanyMimics.Properties; using Unity.Netcode; using UnityEngine; using UnityEngine.Events; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = "")] [assembly: AssemblyCompany("Mimics")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyDescription("A mod that adds mimics to Lethal Company")] [assembly: AssemblyFileVersion("2.3.0.0")] [assembly: AssemblyInformationalVersion("2.3.0")] [assembly: AssemblyProduct("Mimics")] [assembly: AssemblyTitle("Mimics")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("2.3.0.0")] [module: UnverifiableCode] internal class <Module> { static <Module>() { NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy<bool>(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable<bool>(); } } namespace LethalCompanyMimics.Properties { [GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] [DebuggerNonUserCode] [CompilerGenerated] internal class Resources { private static ResourceManager resourceMan; private static CultureInfo resourceCulture; [EditorBrowsable(EditorBrowsableState.Advanced)] internal static ResourceManager ResourceManager { get { if (resourceMan == null) { ResourceManager resourceManager = new ResourceManager("LethalCompanyMimics.Properties.Resources", typeof(Resources).Assembly); resourceMan = resourceManager; } return resourceMan; } } [EditorBrowsable(EditorBrowsableState.Advanced)] internal static CultureInfo Culture { get { return resourceCulture; } set { resourceCulture = value; } } internal static byte[] mimicdoor { get { object @object = ResourceManager.GetObject("mimicdoor", resourceCulture); return (byte[])@object; } } internal Resources() { } } } namespace Mimics { [BepInPlugin("x753.Mimics", "Mimics", "2.3.0")] public class Mimics : BaseUnityPlugin { [HarmonyPatch(typeof(GameNetworkManager))] internal class GameNetworkManagerPatch { [HarmonyPatch("Start")] [HarmonyPostfix] private static void StartPatch() { ((Component)GameNetworkManager.Instance).GetComponent<NetworkManager>().AddNetworkPrefab(MimicNetworkerPrefab); } } [HarmonyPatch(typeof(StartOfRound))] internal class StartOfRoundPatch { [HarmonyPatch("Start")] [HarmonyPostfix] private static void StartPatch(ref StartOfRound __instance) { //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Expected O, but got Unknown //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Expected O, but got Unknown if (((NetworkBehaviour)__instance).IsServer && (Object)(object)MimicNetworker.Instance == (Object)null) { GameObject val = Object.Instantiate<GameObject>(MimicNetworkerPrefab); val.GetComponent<NetworkObject>().Spawn(true); MimicNetworker.SpawnWeight0.Value = SpawnRates[0]; MimicNetworker.SpawnWeight1.Value = SpawnRates[1]; MimicNetworker.SpawnWeight2.Value = SpawnRates[2]; MimicNetworker.SpawnWeight3.Value = SpawnRates[3]; MimicNetworker.SpawnWeight4.Value = SpawnRates[4]; MimicNetworker.SpawnWeightMax.Value = SpawnRates[5]; MimicNetworker.SpawnRateDynamic.Value = DynamicSpawnRate; Terminal val2 = Object.FindObjectOfType<Terminal>(); MimicCreatureID = val2.enemyFiles.Count; MimicFile.creatureFileID = MimicCreatureID; val2.enemyFiles.Add(MimicFile); TerminalKeyword val3 = val2.terminalNodes.allKeywords.First((TerminalKeyword keyword) => keyword.word == "info"); TerminalKeyword val4 = new TerminalKeyword { word = "mimics", isVerb = false, defaultVerb = val3 }; List<CompatibleNoun> list = val3.compatibleNouns.ToList(); list.Add(new CompatibleNoun { noun = val4, result = MimicFile }); val3.compatibleNouns = list.ToArray(); List<TerminalKeyword> list2 = val2.terminalNodes.allKeywords.ToList(); list2.Add(val4); val2.terminalNodes.allKeywords = list2.ToArray(); } } } [HarmonyPatch(typeof(RoundManager))] internal class RoundManagerPatch { [HarmonyPatch("SetExitIDs")] [HarmonyPostfix] private static void SetExitIDsPatch(ref RoundManager __instance, Vector3 mainEntrancePosition) { //IL_0528: Unknown result type (might be due to invalid IL or missing references) //IL_0539: Unknown result type (might be due to invalid IL or missing references) //IL_053e: Unknown result type (might be due to invalid IL or missing references) //IL_0543: Unknown result type (might be due to invalid IL or missing references) //IL_0548: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_028d: Unknown result type (might be due to invalid IL or missing references) //IL_0299: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_02ac: Unknown result type (might be due to invalid IL or missing references) //IL_0557: Unknown result type (might be due to invalid IL or missing references) //IL_055c: Unknown result type (might be due to invalid IL or missing references) //IL_055e: Unknown result type (might be due to invalid IL or missing references) //IL_0560: Unknown result type (might be due to invalid IL or missing references) //IL_0595: Unknown result type (might be due to invalid IL or missing references) //IL_05d6: Unknown result type (might be due to invalid IL or missing references) //IL_06b2: Unknown result type (might be due to invalid IL or missing references) //IL_06b7: Unknown result type (might be due to invalid IL or missing references) //IL_06bb: Unknown result type (might be due to invalid IL or missing references) //IL_06c7: Unknown result type (might be due to invalid IL or missing references) //IL_06cc: Unknown result type (might be due to invalid IL or missing references) //IL_06d0: Unknown result type (might be due to invalid IL or missing references) //IL_06d5: Unknown result type (might be due to invalid IL or missing references) //IL_032f: Unknown result type (might be due to invalid IL or missing references) //IL_0340: Unknown result type (might be due to invalid IL or missing references) //IL_0345: Unknown result type (might be due to invalid IL or missing references) //IL_034a: Unknown result type (might be due to invalid IL or missing references) //IL_034f: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_035e: Unknown result type (might be due to invalid IL or missing references) //IL_0363: Unknown result type (might be due to invalid IL or missing references) //IL_0369: Unknown result type (might be due to invalid IL or missing references) //IL_0371: Unknown result type (might be due to invalid IL or missing references) //IL_037a: Unknown result type (might be due to invalid IL or missing references) //IL_0384: Unknown result type (might be due to invalid IL or missing references) //IL_066d: Unknown result type (might be due to invalid IL or missing references) //IL_0406: Unknown result type (might be due to invalid IL or missing references) //IL_040e: Unknown result type (might be due to invalid IL or missing references) //IL_0417: Unknown result type (might be due to invalid IL or missing references) //IL_0421: Unknown result type (might be due to invalid IL or missing references) //IL_07c5: Unknown result type (might be due to invalid IL or missing references) //IL_07cf: Expected O, but got Unknown //IL_089e: Unknown result type (might be due to invalid IL or missing references) //IL_08c5: Unknown result type (might be due to invalid IL or missing references) //IL_083f: Unknown result type (might be due to invalid IL or missing references) //IL_0866: Unknown result type (might be due to invalid IL or missing references) //IL_0979: Unknown result type (might be due to invalid IL or missing references) //IL_09a0: Unknown result type (might be due to invalid IL or missing references) MimicDoor.allMimics = new List<MimicDoor>(); int num = 0; Dungeon currentDungeon = __instance.dungeonGenerator.Generator.CurrentDungeon; if (!((Object)currentDungeon.DungeonFlow).name.StartsWith("Level1") && !((Object)currentDungeon.DungeonFlow).name.StartsWith("Level2")) { return; } int num2 = 0; int[] array = new int[6] { MimicNetworker.SpawnWeight0.Value, MimicNetworker.SpawnWeight1.Value, MimicNetworker.SpawnWeight2.Value, MimicNetworker.SpawnWeight3.Value, MimicNetworker.SpawnWeight4.Value, MimicNetworker.SpawnWeightMax.Value }; int num3 = 0; int[] array2 = array; foreach (int num4 in array2) { num3 += num4; } Random random = new Random(StartOfRound.Instance.randomMapSeed + 753); int num5 = random.Next(0, num3); int num6 = 0; for (int j = 0; j < array.Length; j++) { if (num5 < array[j] + num6) { num2 = j; break; } num6 += array[j]; } if (num2 == 5) { num2 = 999; } EntranceTeleport[] array3 = Object.FindObjectsOfType<EntranceTeleport>(false); int num7 = (array3.Length - 2) / 2; if (MimicNetworker.SpawnRateDynamic.Value && num2 < num7 && num7 > 1) { num2 += random.Next(0, 2); } if (MimicNetworker.SpawnRateDynamic.Value && currentDungeon.AllTiles.Count > 100) { num2 += random.Next(0, 2); } List<Doorway> list = new List<Doorway>(); Bounds val2 = default(Bounds); foreach (Tile allTile in currentDungeon.AllTiles) { foreach (Doorway unusedDoorway in allTile.UnusedDoorways) { if (unusedDoorway.HasDoorPrefabInstance || (Object)(object)((Component)unusedDoorway).GetComponentInChildren<SpawnSyncedObject>(true) == (Object)null) { continue; } GameObject gameObject = ((Component)((Component)((Component)unusedDoorway).GetComponentInChildren<SpawnSyncedObject>(true)).transform.parent).gameObject; if (!((Object)gameObject).name.StartsWith("AlleyExitDoorContainer") || gameObject.activeSelf) { continue; } bool flag = false; Matrix4x4 val = Matrix4x4.TRS(((Component)unusedDoorway).transform.position, ((Component)unusedDoorway).transform.rotation, new Vector3(1f, 1f, 1f)); ((Bounds)(ref val2))..ctor(new Vector3(0f, 1.5f, 5.5f), new Vector3(2f, 6f, 8f)); ((Bounds)(ref val2)).center = ((Matrix4x4)(ref val)).MultiplyPoint3x4(((Bounds)(ref val2)).center); Collider[] array4 = Physics.OverlapBox(((Bounds)(ref val2)).center, ((Bounds)(ref val2)).extents, ((Component)unusedDoorway).transform.rotation, LayerMask.GetMask(new string[3] { "Room", "Railing", "MapHazards" })); Collider[] array5 = array4; int num8 = 0; if (num8 < array5.Length) { Collider val3 = array5[num8]; flag = true; } if (flag) { continue; } foreach (Tile allTile2 in currentDungeon.AllTiles) { if (!((Object)(object)allTile == (Object)(object)allTile2)) { Vector3 origin = ((Component)unusedDoorway).transform.position + 5f * ((Component)unusedDoorway).transform.forward; Bounds val4 = UnityUtil.CalculateProxyBounds(((Component)allTile2).gameObject, true, Vector3.up); Ray val5 = default(Ray); ((Ray)(ref val5)).origin = origin; ((Ray)(ref val5)).direction = Vector3.up; if (((Bounds)(ref val4)).IntersectRay(val5) && (((Object)allTile2).name.Contains("Catwalk") || ((Object)allTile2).name.Contains("LargeForkTile") || ((Object)allTile2).name.Contains("4x4BigStair") || ((Object)allTile2).name.Contains("ElevatorConnector") || (((Object)allTile2).name.Contains("StartRoom") && !((Object)allTile2).name.Contains("Manor")))) { flag = true; } val5 = default(Ray); ((Ray)(ref val5)).origin = origin; ((Ray)(ref val5)).direction = Vector3.down; if (((Bounds)(ref val4)).IntersectRay(val5) && (((Object)allTile2).name.Contains("MediumRoomHallway1B") || ((Object)allTile2).name.Contains("LargeForkTile") || ((Object)allTile2).name.Contains("4x4BigStair") || ((Object)allTile2).name.Contains("ElevatorConnector") || ((Object)allTile2).name.Contains("StartRoom"))) { flag = true; } } } if (!flag) { list.Add(unusedDoorway); } } } Shuffle(list, StartOfRound.Instance.randomMapSeed); List<Vector3> list2 = new List<Vector3>(); foreach (Doorway item in list) { if (num >= num2) { break; } bool flag2 = false; Vector3 val6 = ((Component)item).transform.position + 5f * ((Component)item).transform.forward; foreach (Vector3 item2 in list2) { if (Vector3.Distance(val6, item2) < 4f) { flag2 = true; break; } } if (flag2) { continue; } list2.Add(val6); GameObject gameObject2 = ((Component)((Component)((Component)item).GetComponentInChildren<SpawnSyncedObject>(true)).transform.parent).gameObject; GameObject val7 = Object.Instantiate<GameObject>(MimicPrefab, ((Component)item).transform); val7.transform.position = gameObject2.transform.position; MimicDoor component = val7.GetComponent<MimicDoor>(); component.scanNode.creatureScanID = MimicCreatureID; AudioSource[] componentsInChildren = val7.GetComponentsInChildren<AudioSource>(true); foreach (AudioSource val8 in componentsInChildren) { val8.volume = MimicVolume / 100f; val8.outputAudioMixerGroup = StartOfRound.Instance.ship3DAudio.outputAudioMixerGroup; } if (SpawnRates[5] == 9753 && num == 0) { val7.transform.position = new Vector3(-7f, 0f, -10f); } MimicDoor.allMimics.Add(component); component.mimicIndex = num; num++; GameObject gameObject3 = ((Component)((Component)item).transform.GetChild(0)).gameObject; gameObject3.SetActive(false); Bounds bounds = ((Collider)component.frameBox).bounds; Vector3 center = ((Bounds)(ref bounds)).center; bounds = ((Collider)component.frameBox).bounds; Collider[] array6 = Physics.OverlapBox(center, ((Bounds)(ref bounds)).extents, Quaternion.identity); foreach (Collider val9 in array6) { if (((Object)((Component)val9).gameObject).name.Contains("Shelf")) { ((Component)val9).gameObject.SetActive(false); } } Light componentInChildren = gameObject2.GetComponentInChildren<Light>(true); ((Component)componentInChildren).transform.parent.SetParent(val7.transform); MeshRenderer[] componentsInChildren2 = val7.GetComponentsInChildren<MeshRenderer>(); MeshRenderer[] array7 = componentsInChildren2; foreach (MeshRenderer val10 in array7) { Material[] materials = ((Renderer)val10).materials; foreach (Material val11 in materials) { val11.shader = ((Renderer)gameObject3.GetComponentInChildren<MeshRenderer>(true)).material.shader; val11.renderQueue = ((Renderer)gameObject3.GetComponentInChildren<MeshRenderer>(true)).material.renderQueue; } } component.interactTrigger.onInteract = new InteractEvent(); ((UnityEvent<PlayerControllerB>)(object)component.interactTrigger.onInteract).AddListener((UnityAction<PlayerControllerB>)component.TouchMimic); if (MimicPerfection) { continue; } component.interactTrigger.timeToHold = 0.9f; if (!ColorBlindMode) { if ((StartOfRound.Instance.randomMapSeed + num) % 2 == 0) { ((Renderer)val7.GetComponentsInChildren<MeshRenderer>()[0]).material.color = new Color(0.490566f, 0.1226415f, 0.1302275f); ((Renderer)val7.GetComponentsInChildren<MeshRenderer>()[1]).material.color = new Color(0.4339623f, 0.1043965f, 0.1150277f); componentInChildren.colorTemperature = 1250f; } else { ((Renderer)val7.GetComponentsInChildren<MeshRenderer>()[0]).material.color = new Color(0.5f, 0.1580188f, 0.1657038f); ((Renderer)val7.GetComponentsInChildren<MeshRenderer>()[1]).material.color = new Color(43f / 106f, 0.1358579f, 0.1393619f); componentInChildren.colorTemperature = 1300f; } } else if ((StartOfRound.Instance.randomMapSeed + num) % 2 == 0) { component.interactTrigger.timeToHold = 1.1f; } else { component.interactTrigger.timeToHold = 1f; } if (!EasyMode) { continue; } Random random2 = new Random(StartOfRound.Instance.randomMapSeed + num); switch (random2.Next(0, 4)) { case 0: if (!ColorBlindMode) { ((Renderer)val7.GetComponentsInChildren<MeshRenderer>()[0]).material.color = new Color(0.489f, 0.2415526f, 0.1479868f); ((Renderer)val7.GetComponentsInChildren<MeshRenderer>()[1]).material.color = new Color(0.489f, 0.2415526f, 0.1479868f); } else { component.interactTrigger.timeToHold = 1.5f; } break; case 1: component.interactTrigger.hoverTip = "Feed : [LMB]"; component.interactTrigger.holdTip = "Feed : [LMB]"; break; case 2: component.interactTrigger.hoverIcon = component.LostFingersIcon; break; case 3: component.interactTrigger.holdTip = "DIE : [LMB]"; component.interactTrigger.timeToHold = 0.5f; break; default: component.interactTrigger.hoverTip = "BUG, REPORT TO DEVELOPER"; break; } } } } [HarmonyPatch(typeof(SprayPaintItem))] internal class SprayPaintItemPatch { private static FieldInfo SprayHit = typeof(SprayPaintItem).GetField("sprayHit", BindingFlags.Instance | BindingFlags.NonPublic); [HarmonyPatch("SprayPaintClientRpc")] [HarmonyPostfix] private static void SprayPaintClientRpcPatch(SprayPaintItem __instance, Vector3 sprayPos, Vector3 sprayRot) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) RaycastHit val = (RaycastHit)SprayHit.GetValue(__instance); if ((Object)(object)((RaycastHit)(ref val)).collider != (Object)null && ((Object)((RaycastHit)(ref val)).collider).name == "MimicSprayCollider") { MimicDoor component = ((Component)((Component)((RaycastHit)(ref val)).collider).transform.parent.parent).GetComponent<MimicDoor>(); component.sprayCount++; if (component.sprayCount > 9) { MimicNetworker.Instance.MimicAddAnger(1, component.mimicIndex); } } } } [HarmonyPatch(typeof(LockPicker))] internal class LockPickerPatch { private static FieldInfo RayHit = typeof(LockPicker).GetField("hit", BindingFlags.Instance | BindingFlags.NonPublic); [HarmonyPatch("ItemActivate")] [HarmonyPostfix] private static void ItemActivatePatch(LockPicker __instance, bool used, bool buttonDown = true) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0024: 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) RaycastHit val = (RaycastHit)RayHit.GetValue(__instance); if (!((Object)(object)((GrabbableObject)__instance).playerHeldBy == (Object)null) && !((object)(RaycastHit)(ref val)).Equals((object)default(RaycastHit)) && !((Object)(object)((RaycastHit)(ref val)).transform.parent == (Object)null)) { Transform parent = ((RaycastHit)(ref val)).transform.parent; if (((Object)parent).name.StartsWith("MimicDoor")) { MimicNetworker.Instance.MimicLockPick(__instance, ((Component)parent).GetComponent<MimicDoor>().mimicIndex); } } } } private const string modGUID = "x753.Mimics"; private const string modName = "Mimics"; private const string modVersion = "2.3.0"; private readonly Harmony harmony = new Harmony("x753.Mimics"); private static Mimics Instance; public static GameObject MimicPrefab; public static GameObject MimicNetworkerPrefab; public static TerminalNode MimicFile; public static int MimicCreatureID; public static int[] SpawnRates; public static bool MimicPerfection; public static bool EasyMode; public static bool ColorBlindMode; public static float MimicVolume; public static bool DynamicSpawnRate; private void Awake() { AssetBundle val = AssetBundle.LoadFromMemory(Resources.mimicdoor); MimicPrefab = val.LoadAsset<GameObject>("Assets/MimicDoor.prefab"); MimicNetworkerPrefab = val.LoadAsset<GameObject>("Assets/MimicNetworker.prefab"); MimicFile = val.LoadAsset<TerminalNode>("Assets/MimicFile.asset"); if ((Object)(object)Instance == (Object)null) { Instance = this; } harmony.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin Mimics is loaded!"); SpawnRates = new int[6] { ((BaseUnityPlugin)this).Config.Bind<int>("Spawn Rate", "Zero Mimics", 23, "Weight of zero mimics spawning").Value, ((BaseUnityPlugin)this).Config.Bind<int>("Spawn Rate", "One Mimic", 69, "Weight of one mimic spawning").Value, ((BaseUnityPlugin)this).Config.Bind<int>("Spawn Rate", "Two Mimics", 7, "Weight of two mimics spawning").Value, ((BaseUnityPlugin)this).Config.Bind<int>("Spawn Rate", "Three Mimics", 1, "Weight of three mimics spawning").Value, ((BaseUnityPlugin)this).Config.Bind<int>("Spawn Rate", "Four Mimics", 0, "Weight of four mimics spawning").Value, ((BaseUnityPlugin)this).Config.Bind<int>("Spawn Rate", "Maximum Mimics", 0, "Weight of maximum mimics spawning").Value }; DynamicSpawnRate = ((BaseUnityPlugin)this).Config.Bind<bool>("Spawn Rate", "Dynamic Spawn Rate", true, "Increases mimic spawn rate based on dungeon size and the number of instances of the real thing.").Value; MimicPerfection = ((BaseUnityPlugin)this).Config.Bind<bool>("Difficulty", "Perfect Mimics", false, "Select this if you want mimics to be the exact same color as the real thing. Overrides all difficulty settings.").Value; EasyMode = ((BaseUnityPlugin)this).Config.Bind<bool>("Difficulty", "Easy Mode", false, "Each mimic will have one of several possible imperfections to help you tell if it's a mimic.").Value; ColorBlindMode = ((BaseUnityPlugin)this).Config.Bind<bool>("Difficulty", "Color Blind Mode", false, "Replaces all color differences with another way to differentiate mimics.").Value; MimicVolume = ((BaseUnityPlugin)this).Config.Bind<int>("General", "SFX Volume", 100, "Volume of the mimic's SFX (0-100)").Value; if (MimicVolume < 0f) { MimicVolume = 0f; } if (MimicVolume > 100f) { MimicVolume = 100f; } ((BaseUnityPlugin)this).Config.Bind<int>("Difficulty", "Difficulty Level", 0, "This is an old setting, ignore it."); ((BaseUnityPlugin)this).Config.Remove(((BaseUnityPlugin)this).Config["Difficulty", "Difficulty Level"].Definition); ((BaseUnityPlugin)this).Config.Bind<int>("Spawn Rate", "Five Mimics", 0, "This is an old setting, ignore it."); ((BaseUnityPlugin)this).Config.Remove(((BaseUnityPlugin)this).Config["Spawn Rate", "Five Mimics"].Definition); ((BaseUnityPlugin)this).Config.Save(); Type[] types = Assembly.GetExecutingAssembly().GetTypes(); Type[] array = types; foreach (Type type in array) { MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); MethodInfo[] array2 = methods; foreach (MethodInfo methodInfo in array2) { object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false); if (customAttributes.Length != 0) { methodInfo.Invoke(null, null); } } } } public static void Shuffle<T>(IList<T> list, int seed) { Random random = new Random(seed); int num = list.Count; while (num > 1) { num--; int index = random.Next(num + 1); T value = list[index]; list[index] = list[num]; list[num] = value; } } } public class MimicNetworker : NetworkBehaviour { public static MimicNetworker Instance; public static NetworkVariable<int> SpawnWeight0 = new NetworkVariable<int>(0, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public static NetworkVariable<int> SpawnWeight1 = new NetworkVariable<int>(0, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public static NetworkVariable<int> SpawnWeight2 = new NetworkVariable<int>(0, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public static NetworkVariable<int> SpawnWeight3 = new NetworkVariable<int>(0, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public static NetworkVariable<int> SpawnWeight4 = new NetworkVariable<int>(0, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public static NetworkVariable<int> SpawnWeightMax = new NetworkVariable<int>(0, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public static NetworkVariable<bool> SpawnRateDynamic = new NetworkVariable<bool>(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); private void Awake() { Instance = this; } public void MimicAttack(int playerId, int mimicIndex, bool ownerOnly = false) { if (((NetworkBehaviour)this).IsOwner) { Instance.MimicAttackClientRpc(playerId, mimicIndex); } else if (!ownerOnly) { Instance.MimicAttackServerRpc(playerId, mimicIndex); } } [ClientRpc] public void MimicAttackClientRpc(int playerId, int mimicIndex) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2885019175u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); BytePacker.WriteValueBitPacked(val2, mimicIndex); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2885019175u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { ((MonoBehaviour)this).StartCoroutine(MimicDoor.allMimics[mimicIndex].Attack(playerId)); } } } [ServerRpc(RequireOwnership = false)] public void MimicAttackServerRpc(int playerId, int mimicIndex) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1024971481u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); BytePacker.WriteValueBitPacked(val2, mimicIndex); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1024971481u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { Instance.MimicAttackClientRpc(playerId, mimicIndex); } } } public void MimicAddAnger(int amount, int mimicIndex) { if (((NetworkBehaviour)this).IsOwner) { Instance.MimicAddAngerClientRpc(amount, mimicIndex); } else { Instance.MimicAddAngerServerRpc(amount, mimicIndex); } } [ClientRpc] public void MimicAddAngerClientRpc(int amount, int mimicIndex) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1137632670u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, amount); BytePacker.WriteValueBitPacked(val2, mimicIndex); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1137632670u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { ((MonoBehaviour)this).StartCoroutine(MimicDoor.allMimics[mimicIndex].AddAnger(amount)); } } } [ServerRpc(RequireOwnership = false)] public void MimicAddAngerServerRpc(int amount, int mimicIndex) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(669208889u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, amount); BytePacker.WriteValueBitPacked(val2, mimicIndex); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 669208889u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { Instance.MimicAddAngerClientRpc(amount, mimicIndex); } } } public void MimicLockPick(LockPicker lockPicker, int mimicIndex, bool ownerOnly = false) { int playerId = (int)((GrabbableObject)lockPicker).playerHeldBy.playerClientId; if (((NetworkBehaviour)this).IsOwner) { Instance.MimicLockPickClientRpc(playerId, mimicIndex); } else if (!ownerOnly) { Instance.MimicLockPickServerRpc(playerId, mimicIndex); } } [ClientRpc] public void MimicLockPickClientRpc(int playerId, int mimicIndex) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3716888238u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); BytePacker.WriteValueBitPacked(val2, mimicIndex); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3716888238u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { ((MonoBehaviour)this).StartCoroutine(MimicDoor.allMimics[mimicIndex].MimicLockPick(playerId)); } } } [ServerRpc(RequireOwnership = false)] public void MimicLockPickServerRpc(int playerId, int mimicIndex) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1897916243u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); BytePacker.WriteValueBitPacked(val2, mimicIndex); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1897916243u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { Instance.MimicLockPickClientRpc(playerId, mimicIndex); } } } protected override void __initializeVariables() { if (SpawnWeight0 == null) { throw new Exception("MimicNetworker.SpawnWeight0 cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)SpawnWeight0).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)SpawnWeight0, "SpawnWeight0"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)SpawnWeight0); if (SpawnWeight1 == null) { throw new Exception("MimicNetworker.SpawnWeight1 cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)SpawnWeight1).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)SpawnWeight1, "SpawnWeight1"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)SpawnWeight1); if (SpawnWeight2 == null) { throw new Exception("MimicNetworker.SpawnWeight2 cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)SpawnWeight2).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)SpawnWeight2, "SpawnWeight2"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)SpawnWeight2); if (SpawnWeight3 == null) { throw new Exception("MimicNetworker.SpawnWeight3 cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)SpawnWeight3).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)SpawnWeight3, "SpawnWeight3"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)SpawnWeight3); if (SpawnWeight4 == null) { throw new Exception("MimicNetworker.SpawnWeight4 cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)SpawnWeight4).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)SpawnWeight4, "SpawnWeight4"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)SpawnWeight4); if (SpawnWeightMax == null) { throw new Exception("MimicNetworker.SpawnWeightMax cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)SpawnWeightMax).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)SpawnWeightMax, "SpawnWeightMax"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)SpawnWeightMax); if (SpawnRateDynamic == null) { throw new Exception("MimicNetworker.SpawnRateDynamic cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)SpawnRateDynamic).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)SpawnRateDynamic, "SpawnRateDynamic"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)SpawnRateDynamic); ((NetworkBehaviour)this).__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_MimicNetworker() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Expected O, but got Unknown //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Expected O, but got Unknown //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(2885019175u, new RpcReceiveHandler(__rpc_handler_2885019175)); NetworkManager.__rpc_func_table.Add(1024971481u, new RpcReceiveHandler(__rpc_handler_1024971481)); NetworkManager.__rpc_func_table.Add(1137632670u, new RpcReceiveHandler(__rpc_handler_1137632670)); NetworkManager.__rpc_func_table.Add(669208889u, new RpcReceiveHandler(__rpc_handler_669208889)); NetworkManager.__rpc_func_table.Add(3716888238u, new RpcReceiveHandler(__rpc_handler_3716888238)); NetworkManager.__rpc_func_table.Add(1897916243u, new RpcReceiveHandler(__rpc_handler_1897916243)); } private static void __rpc_handler_2885019175(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); int mimicIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref mimicIndex); target.__rpc_exec_stage = (__RpcExecStage)2; ((MimicNetworker)(object)target).MimicAttackClientRpc(playerId, mimicIndex); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1024971481(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); int mimicIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref mimicIndex); target.__rpc_exec_stage = (__RpcExecStage)1; ((MimicNetworker)(object)target).MimicAttackServerRpc(playerId, mimicIndex); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1137632670(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int amount = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref amount); int mimicIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref mimicIndex); target.__rpc_exec_stage = (__RpcExecStage)2; ((MimicNetworker)(object)target).MimicAddAngerClientRpc(amount, mimicIndex); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_669208889(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int amount = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref amount); int mimicIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref mimicIndex); target.__rpc_exec_stage = (__RpcExecStage)1; ((MimicNetworker)(object)target).MimicAddAngerServerRpc(amount, mimicIndex); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3716888238(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); int mimicIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref mimicIndex); target.__rpc_exec_stage = (__RpcExecStage)2; ((MimicNetworker)(object)target).MimicLockPickClientRpc(playerId, mimicIndex); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1897916243(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); int mimicIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref mimicIndex); target.__rpc_exec_stage = (__RpcExecStage)1; ((MimicNetworker)(object)target).MimicLockPickServerRpc(playerId, mimicIndex); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "MimicNetworker"; } } public class MimicDoor : MonoBehaviour { public GameObject playerTarget; public BoxCollider frameBox; public Sprite LostFingersIcon; public Animator mimicAnimator; public GameObject grabPoint; public InteractTrigger interactTrigger; public ScanNodeProperties scanNode; public int anger; public bool angering; public int sprayCount; private bool attacking; public static List<MimicDoor> allMimics; public int mimicIndex; private static MethodInfo RetractClaws = typeof(LockPicker).GetMethod("RetractClaws", BindingFlags.Instance | BindingFlags.NonPublic); public void TouchMimic(PlayerControllerB player) { if (!attacking) { MimicNetworker.Instance.MimicAttack((int)player.playerClientId, mimicIndex); } } public IEnumerator Attack(int playerId) { attacking = true; interactTrigger.interactable = false; PlayerControllerB player = StartOfRound.Instance.allPlayerScripts[playerId]; mimicAnimator.SetTrigger("Attack"); playerTarget.transform.position = ((Component)player).transform.position; yield return (object)new WaitForSeconds(0.1f); playerTarget.transform.position = ((Component)player).transform.position; yield return (object)new WaitForSeconds(0.1f); playerTarget.transform.position = ((Component)player).transform.position; yield return (object)new WaitForSeconds(0.1f); playerTarget.transform.position = ((Component)player).transform.position; yield return (object)new WaitForSeconds(0.1f); float num = Vector3.Distance(((Component)GameNetworkManager.Instance.localPlayerController).transform.position, ((Component)frameBox).transform.position); if (num < 8f) { HUDManager.Instance.ShakeCamera((ScreenShakeType)1); } else if (num < 14f) { HUDManager.Instance.ShakeCamera((ScreenShakeType)0); } yield return (object)new WaitForSeconds(0.2f); if (((NetworkBehaviour)player).IsOwner && Vector3.Distance(((Component)player).transform.position, ((Component)this).transform.position) < 8.75f) { player.KillPlayer(Vector3.zero, true, (CauseOfDeath)0, 0); } float startTime = Time.timeSinceLevelLoad; yield return (object)new WaitUntil((Func<bool>)(() => (Object)(object)player.deadBody != (Object)null || Time.timeSinceLevelLoad - startTime > 4f)); if ((Object)(object)player.deadBody != (Object)null) { player.deadBody.attachedTo = grabPoint.transform; player.deadBody.attachedLimb = player.deadBody.bodyParts[5]; player.deadBody.matchPositionExactly = true; for (int i = 0; i < player.deadBody.bodyParts.Length; i++) { ((Component)player.deadBody.bodyParts[i]).GetComponent<Collider>().excludeLayers = LayerMask.op_Implicit(-1); } } yield return (object)new WaitForSeconds(2f); if ((Object)(object)player.deadBody != (Object)null) { player.deadBody.attachedTo = null; player.deadBody.attachedLimb = null; player.deadBody.matchPositionExactly = false; ((Component)((Component)player.deadBody).transform.GetChild(0)).gameObject.SetActive(false); player.deadBody = null; } yield return (object)new WaitForSeconds(4.5f); attacking = false; interactTrigger.interactable = true; } public IEnumerator MimicLockPick(int playerId) { if (angering || attacking) { yield break; } LockPicker lockPicker = default(LockPicker); ref LockPicker reference = ref lockPicker; GrabbableObject currentlyHeldObjectServer = StartOfRound.Instance.allPlayerScripts[playerId].currentlyHeldObjectServer; reference = (LockPicker)(object)((currentlyHeldObjectServer is LockPicker) ? currentlyHeldObjectServer : null); if ((Object)(object)lockPicker == (Object)null) { yield break; } attacking = true; interactTrigger.interactable = false; AudioSource component = ((Component)lockPicker).GetComponent<AudioSource>(); component.PlayOneShot(lockPicker.placeLockPickerClips[Random.Range(0, lockPicker.placeLockPickerClips.Length)]); lockPicker.armsAnimator.SetBool("mounted", true); lockPicker.armsAnimator.SetBool("picking", true); component.Play(); component.pitch = Random.Range(0.94f, 1.06f); lockPicker.isOnDoor = true; lockPicker.isPickingLock = true; ((GrabbableObject)lockPicker).grabbable = false; if (((NetworkBehaviour)lockPicker).IsOwner) { ((GrabbableObject)lockPicker).playerHeldBy.DiscardHeldObject(true, ((NetworkBehaviour)MimicNetworker.Instance).NetworkObject, ((Component)this).transform.position + ((Component)this).transform.up * 1.5f - ((Component)this).transform.forward * 1.15f, true); } float startTime = Time.timeSinceLevelLoad; yield return (object)new WaitUntil((Func<bool>)(() => !((GrabbableObject)lockPicker).isHeld || Time.timeSinceLevelLoad - startTime > 10f)); ((Component)lockPicker).transform.localEulerAngles = new Vector3(((Component)this).transform.eulerAngles.x, ((Component)this).transform.eulerAngles.y + 90f, ((Component)this).transform.eulerAngles.z); yield return (object)new WaitForSeconds(5f); RetractClaws.Invoke(lockPicker, null); ((Component)lockPicker).transform.SetParent((Transform)null); ((GrabbableObject)lockPicker).startFallingPosition = ((Component)lockPicker).transform.position; ((GrabbableObject)lockPicker).FallToGround(false); ((GrabbableObject)lockPicker).grabbable = true; yield return (object)new WaitForSeconds(1f); anger = 3; attacking = false; interactTrigger.interactable = false; PlayerControllerB val = null; float num = 9999f; PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; foreach (PlayerControllerB val2 in allPlayerScripts) { float num2 = Vector3.Distance(((Component)this).transform.position, ((Component)val2).transform.position); if (num2 < num) { num = num2; val = val2; } } if ((Object)(object)val != (Object)null) { MimicNetworker.Instance.MimicAttackClientRpc((int)val.playerClientId, mimicIndex); } else { interactTrigger.interactable = true; } } public IEnumerator AddAnger(int amount) { if (angering || attacking) { yield break; } angering = true; anger += amount; if (anger == 1) { Sprite oldIcon2 = interactTrigger.hoverIcon; interactTrigger.hoverIcon = LostFingersIcon; mimicAnimator.SetTrigger("Growl"); yield return (object)new WaitForSeconds(2.75f); interactTrigger.hoverIcon = oldIcon2; sprayCount = 0; angering = false; yield break; } if (anger == 2) { interactTrigger.holdTip = "DIE : [LMB]"; interactTrigger.timeToHold = 0.25f; Sprite oldIcon2 = interactTrigger.hoverIcon; interactTrigger.hoverIcon = LostFingersIcon; mimicAnimator.SetTrigger("Growl"); yield return (object)new WaitForSeconds(2.75f); interactTrigger.hoverIcon = oldIcon2; sprayCount = 0; angering = false; yield break; } if (anger > 2) { PlayerControllerB val = null; float num = 9999f; PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; foreach (PlayerControllerB val2 in allPlayerScripts) { float num2 = Vector3.Distance(((Component)this).transform.position, ((Component)val2).transform.position); if (num2 < num) { num = num2; val = val2; } } if ((Object)(object)val != (Object)null) { MimicNetworker.Instance.MimicAttackClientRpc((int)val.playerClientId, mimicIndex); } } sprayCount = 0; angering = false; } } public class MimicCollider : MonoBehaviour, IHittable { public MimicDoor mimic; void IHittable.Hit(int force, Vector3 hitDirection, PlayerControllerB playerWhoHit = null, bool playHitSFX = false) { MimicNetworker.Instance.MimicAddAnger(force, mimic.mimicIndex); } } public class MimicListener : MonoBehaviour, INoiseListener { public MimicDoor mimic; private int tolerance = 100; void INoiseListener.DetectNoise(Vector3 noisePosition, float noiseLoudness, int timesPlayedInOneSpot, int noiseID) { //IL_0014: 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) if ((noiseLoudness >= 0.9f || noiseID == 101158) && Vector3.Distance(noisePosition, ((Component)mimic).transform.position) < 5f) { switch (noiseID) { case 75: tolerance--; break; case 5: tolerance -= 15; break; case 101158: tolerance -= 35; break; default: tolerance -= 30; break; } if (tolerance <= 0) { tolerance = 100; MimicNetworker.Instance.MimicAddAnger(1, mimic.mimicIndex); } } } } }