Please disclose if your mod was created primarily using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of Supercharger v1.3.0
com.github.zehsteam.Supercharger.dll
Decompiled 3 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 System.Text; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using GameNetcodeStuff; using HarmonyLib; using LethalConfig; using LethalConfig.ConfigItems; using LethalConfig.ConfigItems.Options; using Microsoft.CodeAnalysis; using Unity.Netcode; using UnityEngine; using com.github.zehsteam.Supercharger.Dependencies; using com.github.zehsteam.Supercharger.Helpers; using com.github.zehsteam.Supercharger.Managers; using com.github.zehsteam.Supercharger.MonoBehaviours; using com.github.zehsteam.Supercharger.NetcodePatcher; using com.github.zehsteam.Supercharger.Objects; using com.github.zehsteam.Supercharger.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("com.github.zehsteam.Supercharger")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyCopyright("Copyright © 2026 Zehs")] [assembly: AssemblyFileVersion("1.3.0.0")] [assembly: AssemblyInformationalVersion("1.3.0+78039d2620cb10dffa5b0d5c4c79efd5e893830b")] [assembly: AssemblyProduct("Supercharger")] [assembly: AssemblyTitle("com.github.zehsteam.Supercharger")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.3.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [module: NetcodePatchedAssembly] 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 com.github.zehsteam.Supercharger { internal static class Assets { public static AssetBundle AssetBundle { get; private set; } public static GameObject NetworkHandlerPrefab { get; private set; } public static GameObject SuperchargeStationPrefab { get; private set; } public static void Load() { string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); string text = "supercharger_assets"; string text2 = Path.Combine(directoryName, text); if (!File.Exists(text2)) { Logger.LogFatal("Failed to load assets. AssetBundle file could not be found at path \"" + text2 + "\". Make sure the \"" + text + "\" file is in the same folder as the mod's DLL file."); } else { AssetBundle val = AssetBundle.LoadFromFile(text2); if ((Object)(object)val == (Object)null) { Logger.LogFatal("Failed to load assets. AssetBundle is null."); } else { OnAssetBundleLoaded(val); } } } private static void OnAssetBundleLoaded(AssetBundle assetBundle) { AssetBundle = assetBundle; NetworkHandlerPrefab = LoadAsset<GameObject>("NetworkHandler", assetBundle); NetworkHandlerPrefab.AddComponent<PluginNetworkBehaviour>(); SuperchargeStationPrefab = LoadAsset<GameObject>("SuperchargeStation", assetBundle); } private static T LoadAsset<T>(string name, AssetBundle assetBundle) where T : Object { if (string.IsNullOrWhiteSpace(name)) { Logger.LogError("Failed to load asset of type \"" + typeof(T).Name + "\" from AssetBundle. Name is null or whitespace."); return default(T); } if ((Object)(object)assetBundle == (Object)null) { Logger.LogError("Failed to load asset of type \"" + typeof(T).Name + "\" with name \"" + name + "\" from AssetBundle. AssetBundle is null."); return default(T); } T val = assetBundle.LoadAsset<T>(name); if ((Object)(object)val == (Object)null) { Logger.LogError("Failed to load asset of type \"" + typeof(T).Name + "\" with name \"" + name + "\" from AssetBundle. No asset found with that type and name."); return default(T); } return val; } private static bool TryLoadAsset<T>(string name, AssetBundle assetBundle, out T asset) where T : Object { asset = LoadAsset<T>(name, assetBundle); return (Object)(object)asset != (Object)null; } } internal static class Logger { public static ManualLogSource ManualLogSource { get; private set; } public static void Initialize(ManualLogSource manualLogSource) { ManualLogSource = manualLogSource; } public static void LogDebug(object data) { Log((LogLevel)32, data); } public static void LogInfo(object data, bool extended = false) { Log((LogLevel)16, data, extended); } public static void LogMessage(object data, bool extended = false) { Log((LogLevel)8, data, extended); } public static void LogWarning(object data, bool extended = false) { Log((LogLevel)4, data, extended); } public static void LogError(object data, bool extended = false) { Log((LogLevel)2, data, extended); } public static void LogFatal(object data, bool extended = false) { Log((LogLevel)1, data, extended); } public static void Log(LogLevel logLevel, object data, bool extended = false) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) if (!extended || IsExtendedLoggingEnabled()) { ManualLogSource manualLogSource = ManualLogSource; if (manualLogSource != null) { manualLogSource.Log(logLevel, data); } } } public static bool IsExtendedLoggingEnabled() { return ConfigManager.ExtendedLogging?.Value ?? false; } } [BepInPlugin("com.github.zehsteam.Supercharger", "Supercharger", "1.3.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] internal class Plugin : BaseUnityPlugin { private readonly Harmony _harmony = new Harmony("com.github.zehsteam.Supercharger"); public static Plugin Instance { get; private set; } private void Awake() { Instance = this; Logger.Initialize(Logger.CreateLogSource("com.github.zehsteam.Supercharger")); Logger.LogInfo("Supercharger has awoken!"); _harmony.PatchAll(typeof(GameNetworkManagerPatch)); _harmony.PatchAll(typeof(StartOfRoundPatch)); _harmony.PatchAll(typeof(InteractTriggerPatch)); _harmony.PatchAll(typeof(ItemChargerPatch)); Assets.Load(); ConfigManager.Initialize(((BaseUnityPlugin)this).Config); NetcodePatcherAwake(); } private void NetcodePatcherAwake() { try { Assembly executingAssembly = Assembly.GetExecutingAssembly(); Type[] types = executingAssembly.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) { try { object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false); if (customAttributes.Length != 0) { try { methodInfo.Invoke(null, null); } catch (TargetInvocationException ex) { ((BaseUnityPlugin)this).Logger.LogWarning((object)("Failed to invoke method " + methodInfo.Name + ": " + ex.Message)); } } } catch (Exception ex2) { ((BaseUnityPlugin)this).Logger.LogWarning((object)("Error processing method " + methodInfo.Name + " in type " + type.Name + ": " + ex2.Message)); } } } } catch (Exception ex3) { ((BaseUnityPlugin)this).Logger.LogError((object)("An error occurred in NetcodePatcherAwake: " + ex3.Message)); } } } public static class MyPluginInfo { public const string PLUGIN_GUID = "com.github.zehsteam.Supercharger"; public const string PLUGIN_NAME = "Supercharger"; public const string PLUGIN_VERSION = "1.3.0"; } } namespace com.github.zehsteam.Supercharger.Patches { [HarmonyPatch(typeof(GameNetworkManager))] internal static class GameNetworkManagerPatch { [HarmonyPatch("Start")] [HarmonyPostfix] private static void StartPatch() { AddNetworkPrefabs(); } private static void AddNetworkPrefabs() { AddNetworkPrefab(Assets.NetworkHandlerPrefab); } private static void AddNetworkPrefab(GameObject prefab) { if ((Object)(object)prefab == (Object)null) { Logger.LogError("Failed to register network prefab. GameObject is null."); return; } NetworkManager.Singleton.AddNetworkPrefab(prefab); Logger.LogInfo("Registered \"" + ((Object)prefab).name + "\" network prefab."); } } [HarmonyPatch(typeof(InteractTrigger))] internal static class InteractTriggerPatch { [HarmonyPatch("specialInteractAnimation")] [HarmonyPostfix] private static void specialInteractAnimationPatch(InteractTrigger __instance) { if (TryGetSuperchargeStationBehaviour(__instance, out var superchargeStationBehaviour) && ShipHelper.IsShipSupercharger(superchargeStationBehaviour)) { superchargeStationBehaviour.TrySuperchargeNext(); } } private static bool TryGetSuperchargeStationBehaviour(InteractTrigger interactTrigger, out SuperchargeStationBehaviour superchargeStationBehaviour) { superchargeStationBehaviour = null; ItemCharger val = default(ItemCharger); if (!((Component)interactTrigger).TryGetComponent<ItemCharger>(ref val)) { return false; } superchargeStationBehaviour = ((Component)val.chargeStationAnimator).GetComponentInChildren<SuperchargeStationBehaviour>(); return (Object)(object)superchargeStationBehaviour != (Object)null; } } [HarmonyPatch(typeof(ItemCharger))] internal static class ItemChargerPatch { [HarmonyPatch("__initializeVariables")] [HarmonyPostfix] private static void InitializeVariablesPatch(ItemCharger __instance) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) Object.Instantiate<GameObject>(Assets.SuperchargeStationPrefab, Vector3.zero, Quaternion.identity, ((Component)__instance.chargeStationAnimator).transform); } [HarmonyPatch("ChargeItem")] [HarmonyPrefix] private static bool ChargeItemPatch(ref ItemCharger __instance, ref Coroutine ___chargeItemCoroutine) { SuperchargeStationBehaviour superchargeStationBehaviour = null; try { superchargeStationBehaviour = ((Component)((Component)__instance).transform.parent.parent).GetComponentInChildren<SuperchargeStationBehaviour>(); } catch { } if ((Object)(object)superchargeStationBehaviour == (Object)null) { return true; } if (!ShipHelper.IsShipSupercharger(superchargeStationBehaviour)) { return true; } if (!superchargeStationBehaviour.SuperchargeNext) { superchargeStationBehaviour.SetOriginalChargeStationValues(); return true; } PlayerControllerB localPlayerScript = PlayerUtils.GetLocalPlayerScript(); if ((Object)(object)localPlayerScript == (Object)null) { return true; } GrabbableObject currentlyHeldObjectServer = localPlayerScript.currentlyHeldObjectServer; if ((Object)(object)currentlyHeldObjectServer == (Object)null) { return true; } if (!currentlyHeldObjectServer.itemProperties.requiresBattery) { return true; } if (___chargeItemCoroutine != null) { ((MonoBehaviour)__instance).StopCoroutine(___chargeItemCoroutine); } superchargeStationBehaviour.SuperchargeItem(currentlyHeldObjectServer, localPlayerScript); return false; } [HarmonyPatch("chargeItemDelayed")] [HarmonyPrefix] private static void chargeItemDelayedPatch(ref GrabbableObject itemToCharge) { if (!((Object)(object)itemToCharge == (Object)null) && itemToCharge.insertedBattery != null && !itemToCharge.insertedBattery.empty && itemToCharge.insertedBattery.charge > 1f) { itemToCharge = null; } } } [HarmonyPatch(typeof(StartOfRound))] internal static class StartOfRoundPatch { [HarmonyPatch("Awake")] [HarmonyPostfix] private static void AwakePatch() { SpawnNetworkHandler(); } private static void SpawnNetworkHandler() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) if (NetworkUtils.IsServer) { GameObject val = Object.Instantiate<GameObject>(Assets.NetworkHandlerPrefab, Vector3.zero, Quaternion.identity); val.GetComponent<NetworkObject>().Spawn(false); } } [HarmonyPatch("OnClientConnect")] [HarmonyPrefix] private static void OnClientConnectPatch(ref ulong clientId) { if (NetworkUtils.IsServer) { SyncedConfigEntryBase.SendConfigsToClient(clientId); } } [HarmonyPatch("PowerSurgeShip")] [HarmonyPostfix] private static void PowerSurgeShipPatch() { ShipHelper.PowerSurgedShip = true; } } } namespace com.github.zehsteam.Supercharger.Objects { public class PlayerAnimatorStateHelper { private Animator _animator; private bool _isCrouching; private bool _isJumping; private bool _isWalking; private bool _isSprinting; private float _currentAnimationTime; private AnimatorStateInfo _currentStateInfo; private RuntimeAnimatorController _originalAnimatorController; public PlayerAnimatorStateHelper(Animator animator) { if (!((Object)(object)animator == (Object)null)) { _animator = animator; _originalAnimatorController = animator.runtimeAnimatorController; } } public void SaveAnimatorStates() { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_animator == (Object)null)) { _isCrouching = _animator.GetBool("crouching"); _isJumping = _animator.GetBool("Jumping"); _isWalking = _animator.GetBool("Walking"); _isSprinting = _animator.GetBool("Sprinting"); _currentStateInfo = _animator.GetCurrentAnimatorStateInfo(0); _currentAnimationTime = ((AnimatorStateInfo)(ref _currentStateInfo)).normalizedTime; } } public void RestoreAnimatorStates() { if (!((Object)(object)_animator == (Object)null)) { _animator.Play(((AnimatorStateInfo)(ref _currentStateInfo)).fullPathHash, 0, _currentAnimationTime); _animator.SetBool("crouching", _isCrouching); _animator.SetBool("Jumping", _isJumping); _animator.SetBool("Walking", _isWalking); _animator.SetBool("Sprinting", _isSprinting); } } public void RestoreOriginalAnimatorController() { if (!((Object)(object)_animator == (Object)null)) { _animator.runtimeAnimatorController = _originalAnimatorController; RestoreAnimatorStates(); } } public void SetAnimatorOverrideController(AnimatorOverrideController overrideController) { if (!((Object)(object)_animator == (Object)null)) { _animator.runtimeAnimatorController = (RuntimeAnimatorController)(object)overrideController; RestoreAnimatorStates(); } } public RuntimeAnimatorController GetOriginalAnimatorController() { return _originalAnimatorController; } } public class SyncedConfigEntry<T> : SyncedConfigEntryBase { private ConfigEntry<T> _configEntry; private T _serverValue; public T Value { get { return GetValue(); } set { SetValue(value); } } public override string Section => ((ConfigEntryBase)_configEntry).Definition.Section; public override string Key => ((ConfigEntryBase)_configEntry).Definition.Key; public event Action<T> SettingChanged; public SyncedConfigEntry(string section, string key, T defaultValue, string description, AcceptableValueBase acceptableValues = null, ConfigFile configFile = null) { SyncedConfigEntryBase.AddInstance(this); _configEntry = ConfigHelper.Bind(section, key, defaultValue, requiresRestart: false, description, acceptableValues, null, configFile); _configEntry.SettingChanged += SettingChangedInternal; } public T GetValue() { if (NetworkUtils.IsConnected && !NetworkUtils.IsServer) { return _serverValue; } return _configEntry.Value; } public void SetValue(T value) { if (!NetworkUtils.IsConnected || NetworkUtils.IsServer) { _configEntry.Value = value; } } private void SettingChangedInternal(object sender, EventArgs e) { if (NetworkUtils.IsConnected && NetworkUtils.IsServer) { this.SettingChanged?.Invoke(Value); SendConfigToClients(); } } private void SendConfigToClients() { //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 (NetworkUtils.IsConnected && NetworkUtils.IsServer) { PluginNetworkBehaviour.Instance?.SetSyncedConfigValueClientRpc(Section, Key, Value.ToString()); } } public override void SendConfigToClient(ulong clientId) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0035: 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) if (NetworkUtils.IsConnected && NetworkUtils.IsServer) { ClientRpcParams val = default(ClientRpcParams); val.Send = new ClientRpcSendParams { TargetClientIds = new <>z__ReadOnlySingleElementList<ulong>(clientId) }; ClientRpcParams clientRpcParams = val; PluginNetworkBehaviour.Instance?.SetSyncedConfigValueClientRpc(Section, Key, Value.ToString(), clientRpcParams); } } public override void SetValueFromServer(string value) { if (NetworkUtils.IsConnected && !NetworkUtils.IsServer) { if (!Utils.TryParseValue<T>(value, out var result)) { throw new InvalidOperationException($"Failed to parse value: \"{value}\" for type {typeof(T)}"); } _serverValue = result; Logger.LogInfo("Set synced config entry value from server. (Section: \"" + Section + "\", Key: \"" + Key + "\", Value: \"" + value + "\")", extended: true); this.SettingChanged?.Invoke(result); } } } public abstract class SyncedConfigEntryBase { private static readonly object _instancesLock = new object(); public static List<SyncedConfigEntryBase> Instances { get; private set; } = new List<SyncedConfigEntryBase>(); public abstract string Section { get; } public abstract string Key { get; } public static void AddInstance(SyncedConfigEntryBase instance) { lock (_instancesLock) { Instances.Add(instance); } } public static void RemoveInstance(SyncedConfigEntryBase instance) { lock (_instancesLock) { Instances.Remove(instance); } } public abstract void SendConfigToClient(ulong clientId); public abstract void SetValueFromServer(string value); public static void SendConfigsToClient(ulong clientId) { if (!NetworkUtils.IsConnected || !NetworkUtils.IsServer || NetworkUtils.IsLocalClientId(clientId)) { return; } foreach (SyncedConfigEntryBase instance in Instances) { instance.SendConfigToClient(clientId); } } public static void SetValueFromServer(string section, string key, string value) { if (NetworkUtils.IsConnected && !NetworkUtils.IsServer) { SyncedConfigEntryBase syncedConfigEntryBase = Instances.Find((SyncedConfigEntryBase x) => x.Section == section && x.Key == key); if (syncedConfigEntryBase == null) { Logger.LogWarning("No matching synced config entry found for section: \"" + section + "\", key: \"" + key + "\"", extended: true); } else { syncedConfigEntryBase.SetValueFromServer(value); } } } } } namespace com.github.zehsteam.Supercharger.MonoBehaviours { internal class PluginNetworkBehaviour : NetworkBehaviour { public static PluginNetworkBehaviour Instance { get; private set; } private void Awake() { if ((Object)(object)Instance != (Object)null && (Object)(object)Instance != (Object)(object)this) { Object.Destroy((Object)(object)((Component)this).gameObject); } else { Instance = this; } } public override void OnNetworkSpawn() { ((NetworkBehaviour)this).OnNetworkSpawn(); if ((Object)(object)Instance != (Object)null && (Object)(object)Instance != (Object)(object)this) { if (((NetworkBehaviour)this).IsServer) { ((NetworkBehaviour)this).NetworkObject.Despawn(true); } } else { Instance = this; } } [ClientRpc] public void SetSyncedConfigValueClientRpc(string section, string key, string value, ClientRpcParams clientRpcParams = default(ClientRpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0150: 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_017b: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: 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_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0136: 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.IsServer || networkManager.IsHost)) { FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1181108155u, clientRpcParams, (RpcDelivery)0); bool flag = section != null; ((FastBufferWriter)(ref val)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe(section, false); } bool flag2 = key != null; ((FastBufferWriter)(ref val)).WriteValueSafe<bool>(ref flag2, default(ForPrimitives)); if (flag2) { ((FastBufferWriter)(ref val)).WriteValueSafe(key, false); } bool flag3 = value != null; ((FastBufferWriter)(ref val)).WriteValueSafe<bool>(ref flag3, default(ForPrimitives)); if (flag3) { ((FastBufferWriter)(ref val)).WriteValueSafe(value, false); } ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1181108155u, clientRpcParams, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!NetworkUtils.IsServer) { SyncedConfigEntryBase.SetValueFromServer(section, key, value); } } } [ServerRpc(RequireOwnership = false)] public void SuperchargeItemServerRpc(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_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_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: 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(2871894807u, serverRpcParams, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2871894807u, serverRpcParams, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; ulong senderClientId = serverRpcParams.Receive.SenderClientId; if (((NetworkBehaviour)this).NetworkManager.ConnectedClients.ContainsKey(senderClientId)) { SuperchargeItemClientRpc(senderClientId); } } } [ClientRpc] public void SuperchargeItemClientRpc(ulong senderClientId) { //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_00ce: 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.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(847089641u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, senderClientId); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 847089641u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; if (!NetworkUtils.IsLocalClientId(senderClientId)) { PlayerControllerB playerScriptByClientId = PlayerUtils.GetPlayerScriptByClientId(senderClientId); if (ShipHelper.TryGetSuperchargeStationBehaviour(out var superchargeStationBehaviour)) { superchargeStationBehaviour.SuperchargeItemForOtherClient(playerScriptByClientId); } } } [ServerRpc(RequireOwnership = false)] public void SpawnExplosionServerRpc(Vector3 position, int damage, int enemyDamage, float range, ulong senderClientId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: 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_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_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: 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_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0116: 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(1307054941u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref position); BytePacker.WriteValueBitPacked(val2, damage); BytePacker.WriteValueBitPacked(val2, enemyDamage); ((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref range, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val2, senderClientId); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1307054941u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SpawnExplosionClientRpc(position, damage, enemyDamage, range, senderClientId); } } } [ClientRpc] public void SpawnExplosionClientRpc(Vector3 position, int damage, int enemyDamage, float range, ulong senderClientId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: 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_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_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: 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_0110: 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)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(4060816794u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref position); BytePacker.WriteValueBitPacked(val2, damage); BytePacker.WriteValueBitPacked(val2, enemyDamage); ((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref range, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val2, senderClientId); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4060816794u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB playerScriptByClientId = PlayerUtils.GetPlayerScriptByClientId(senderClientId); Utils.CreateExplosion(position, spawnExplosionEffect: true, damage, 0f, range, enemyDamage, (CauseOfDeath)3, playerScriptByClientId); } } } [ServerRpc(RequireOwnership = false)] public void PowerSurgeShipServerRpc() { //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_00c1: 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(1906784499u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1906784499u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; PowerSurgeShipClientRpc(); } } } [ClientRpc] public void PowerSurgeShipClientRpc() { //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_00c1: 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.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1633666871u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1633666871u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; StartOfRound.Instance.PowerSurgeShip(); } } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1181108155u, new RpcReceiveHandler(__rpc_handler_1181108155), "SetSyncedConfigValueClientRpc"); ((NetworkBehaviour)this).__registerRpc(2871894807u, new RpcReceiveHandler(__rpc_handler_2871894807), "SuperchargeItemServerRpc"); ((NetworkBehaviour)this).__registerRpc(847089641u, new RpcReceiveHandler(__rpc_handler_847089641), "SuperchargeItemClientRpc"); ((NetworkBehaviour)this).__registerRpc(1307054941u, new RpcReceiveHandler(__rpc_handler_1307054941), "SpawnExplosionServerRpc"); ((NetworkBehaviour)this).__registerRpc(4060816794u, new RpcReceiveHandler(__rpc_handler_4060816794), "SpawnExplosionClientRpc"); ((NetworkBehaviour)this).__registerRpc(1906784499u, new RpcReceiveHandler(__rpc_handler_1906784499), "PowerSurgeShipServerRpc"); ((NetworkBehaviour)this).__registerRpc(1633666871u, new RpcReceiveHandler(__rpc_handler_1633666871), "PowerSurgeShipClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_1181108155(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_0067: 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_009f: 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_00cb: 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_00db: 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_0101: 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 section = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref section, false); } bool flag2 = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag2, default(ForPrimitives)); string key = null; if (flag2) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref key, false); } bool flag3 = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag3, default(ForPrimitives)); string value = null; if (flag3) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref value, false); } ClientRpcParams client = rpcParams.Client; target.__rpc_exec_stage = (__RpcExecStage)1; ((PluginNetworkBehaviour)(object)target).SetSyncedConfigValueClientRpc(section, key, value, client); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2871894807(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_0033: 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_004d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ServerRpcParams server = rpcParams.Server; target.__rpc_exec_stage = (__RpcExecStage)1; ((PluginNetworkBehaviour)(object)target).SuperchargeItemServerRpc(server); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_847089641(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 senderClientId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref senderClientId); target.__rpc_exec_stage = (__RpcExecStage)1; ((PluginNetworkBehaviour)(object)target).SuperchargeItemClientRpc(senderClientId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1307054941(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0056: 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_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0078: 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_00a2: 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); int damage = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref damage); int enemyDamage = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref enemyDamage); float range = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref range, default(ForPrimitives)); ulong senderClientId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref senderClientId); target.__rpc_exec_stage = (__RpcExecStage)1; ((PluginNetworkBehaviour)(object)target).SpawnExplosionServerRpc(position, damage, enemyDamage, range, senderClientId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4060816794(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0056: 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_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0078: 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_00a2: 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); int damage = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref damage); int enemyDamage = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref enemyDamage); float range = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref range, default(ForPrimitives)); ulong senderClientId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref senderClientId); target.__rpc_exec_stage = (__RpcExecStage)1; ((PluginNetworkBehaviour)(object)target).SpawnExplosionClientRpc(position, damage, enemyDamage, range, senderClientId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1906784499(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; ((PluginNetworkBehaviour)(object)target).PowerSurgeShipServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1633666871(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; ((PluginNetworkBehaviour)(object)target).PowerSurgeShipClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "PluginNetworkBehaviour"; } } public class SuperchargeStationBehaviour : MonoBehaviour { [CompilerGenerated] private sealed class <SuperchargeItemAnimation>d__20 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public GrabbableObject grabbableObject; public PlayerControllerB playerScript; public SuperchargeStationBehaviour <>4__this; private bool <isLocalPlayer>5__2; private float <timePerIteration>5__3; private int <iterations>5__4; private int <i>5__5; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <SuperchargeItemAnimation>d__20(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_02e2: Unknown result type (might be due to invalid IL or missing references) //IL_02ec: Expected O, but got Unknown //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Expected O, but got Unknown //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Expected O, but got Unknown //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Expected O, but got Unknown //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02a9: Expected O, but got Unknown //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Unknown result type (might be due to invalid IL or missing references) int num = <>1__state; SuperchargeStationBehaviour superchargeStationBehaviour = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; if ((Object)(object)grabbableObject == (Object)null) { Logger.LogError("Failed to supercharge item. GrabbableObject is null."); return false; } if ((Object)(object)playerScript == (Object)null) { Logger.LogError("Failed to supercharge item. PlayerControllerB is null."); return false; } Logger.LogInfo("Player \"" + playerScript.playerUsername + "\" is supercharging \"" + grabbableObject.itemProperties.itemName + "\"", extended: true); <isLocalPlayer>5__2 = PlayerUtils.IsLocalPlayer(playerScript); superchargeStationBehaviour.SetCustomChargeStationValues(); superchargeStationBehaviour.OverridePlayerAnimator(playerScript); superchargeStationBehaviour._chargeStationAudio.PlayOneShot(superchargeStationBehaviour.ChargeItemSFX); <>2__current = (object)new WaitForSeconds(0.65f); <>1__state = 1; return true; case 1: { <>1__state = -1; superchargeStationBehaviour._chargeStationAnimator.SetTrigger("zap"); if (ConfigManager.Supercharger_FlickerShipLights.Value && ShipHelper.FlickerLightsOnLocalClient(3f, 0.15f, 0.4f)) { ShipHelper.SetLightSwitchInteractable(value: false); } if (<isLocalPlayer>5__2 && (Object)(object)grabbableObject != (Object)null) { grabbableObject.insertedBattery = new Battery(false, (float)ConfigManager.Supercharger_ItemChargeAmount.Value / 100f); grabbableObject.SyncBatteryServerRpc(ConfigManager.Supercharger_ItemChargeAmount.Value); } ((Component)superchargeStationBehaviour._chargeStationParticleSystem).gameObject.SetActive(true); float num2 = 2f; <timePerIteration>5__3 = 0.15f; <iterations>5__4 = Mathf.RoundToInt(num2 / <timePerIteration>5__3); <i>5__5 = 0; goto IL_020f; } case 2: <>1__state = -1; superchargeStationBehaviour._chargeStationParticleSystem.Stop(); superchargeStationBehaviour._chargeStationParticleSystem.Play(); <i>5__5++; goto IL_020f; case 3: <>1__state = -1; ((Component)superchargeStationBehaviour._chargeStationParticleSystem).gameObject.SetActive(false); superchargeStationBehaviour.SetPlayerAnimatorHoldAnimation(playerScript, grabbableObject); <>2__current = (object)new WaitForSeconds(0.35f); <>1__state = 4; return true; case 4: { <>1__state = -1; superchargeStationBehaviour.SetOriginalChargeStationValues(); superchargeStationBehaviour.ResetPlayerAnimator(playerScript, grabbableObject); ShipHelper.SetLightSwitchInteractable(value: true); Logger.LogInfo("Supercharge animation finished.", extended: true); return false; } IL_020f: if (<i>5__5 < <iterations>5__4) { <>2__current = (object)new WaitForSeconds(<timePerIteration>5__3); <>1__state = 2; return true; } if (<isLocalPlayer>5__2 && Utils.RollPercentChance(ConfigManager.Explosion_Chance.Value)) { Vector3 position = ((Component)grabbableObject).transform.position; int value = ConfigManager.Explosion_Damage.Value; int value2 = ConfigManager.Explosion_EnemyDamage.Value; float value3 = ConfigManager.Explosion_Range.Value; PluginNetworkBehaviour.Instance.SpawnExplosionServerRpc(position, value, value2, value3, NetworkUtils.GetLocalClientId()); if (ConfigManager.Explosion_TurnsOffShipLights.Value) { PluginNetworkBehaviour.Instance.PowerSurgeShipServerRpc(); } } <>2__current = (object)new WaitForSeconds(0.85f); <>1__state = 3; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [Header("SuperchargeStation")] [Space(5f)] public AudioClip ChargeItemSFX; public RuntimeAnimatorController ChargeStationAnimatorController; [Header("Player")] public AnimatorOverrideController PlayerAnimatorOverrideController; private InteractTrigger _interactTrigger; private AudioSource _chargeStationAudio; private Animator _chargeStationAnimator; private ParticleSystem _chargeStationParticleSystem; private RuntimeAnimatorController _originalChargeStationAnimatorController; private Dictionary<ulong, PlayerAnimatorStateHelper> _playerAnimatorStateHelpers = new Dictionary<ulong, PlayerAnimatorStateHelper>(); private Coroutine _superchargeItemAnimation; public bool SuperchargeNext { get; private set; } private void Awake() { if ((Object)(object)((Component)this).transform.parent == (Object)null) { Object.Destroy((Object)(object)((Component)this).gameObject); return; } _interactTrigger = ((Component)((Component)this).transform.parent).GetComponentInChildren<InteractTrigger>(); _chargeStationAudio = ((Component)((Component)this).transform.parent).GetComponentInChildren<AudioSource>(); _chargeStationAnimator = ((Component)((Component)this).transform.parent).GetComponent<Animator>(); _chargeStationParticleSystem = ((Component)((Component)this).transform.parent).GetComponentInChildren<ParticleSystem>(true); } private void Start() { _originalChargeStationAnimatorController = _chargeStationAnimator.runtimeAnimatorController; } public bool TrySuperchargeNext() { if (!AllowedToSupercharge()) { return false; } SuperchargeNext = Utils.RollPercentChance(ConfigManager.Supercharger_Chance.Value); if (SuperchargeNext) { SetCustomChargeStationValues(); } return SuperchargeNext; } public bool AllowedToSupercharge() { PlayerControllerB localPlayerScript = PlayerUtils.GetLocalPlayerScript(); if ((Object)(object)localPlayerScript == (Object)null) { return false; } if ((Object)(object)localPlayerScript.currentlyHeldObjectServer == (Object)null) { return false; } if (localPlayerScript.currentlyHeldObjectServer.insertedBattery == null) { return false; } float charge = localPlayerScript.currentlyHeldObjectServer.insertedBattery.charge; if (ConfigManager.Supercharger_OnlyWhenFullyCharged.Value && charge < 1f) { return false; } if (!ConfigManager.Supercharger_EnableInOrbit.Value && ShipHelper.IsInOrbit()) { return false; } return true; } public void SuperchargeItem(GrabbableObject grabbableObject, PlayerControllerB playerScript) { //IL_0007: 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) PluginNetworkBehaviour.Instance.SuperchargeItemServerRpc(); if (_superchargeItemAnimation != null) { ((MonoBehaviour)this).StopCoroutine(_superchargeItemAnimation); } SuperchargeNext = false; _superchargeItemAnimation = ((MonoBehaviour)this).StartCoroutine(SuperchargeItemAnimation(grabbableObject, playerScript)); } public void SuperchargeItemForOtherClient(PlayerControllerB playerScript) { GrabbableObject currentlyHeldObjectServer = playerScript.currentlyHeldObjectServer; if (_superchargeItemAnimation != null) { ((MonoBehaviour)this).StopCoroutine(_superchargeItemAnimation); } SuperchargeNext = false; _superchargeItemAnimation = ((MonoBehaviour)this).StartCoroutine(SuperchargeItemAnimation(currentlyHeldObjectServer, playerScript)); } [IteratorStateMachine(typeof(<SuperchargeItemAnimation>d__20))] private IEnumerator SuperchargeItemAnimation(GrabbableObject grabbableObject, PlayerControllerB playerScript) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <SuperchargeItemAnimation>d__20(0) { <>4__this = this, grabbableObject = grabbableObject, playerScript = playerScript }; } public void SetCustomChargeStationValues() { _interactTrigger.animationWaitTime = 3.75f; _chargeStationAnimator.runtimeAnimatorController = ChargeStationAnimatorController; } public void SetOriginalChargeStationValues() { _interactTrigger.animationWaitTime = 2f; _chargeStationAnimator.runtimeAnimatorController = _originalChargeStationAnimatorController; } private void OverridePlayerAnimator(PlayerControllerB playerScript) { ulong actualClientId = playerScript.actualClientId; if (!_playerAnimatorStateHelpers.ContainsKey(actualClientId)) { _playerAnimatorStateHelpers[actualClientId] = new PlayerAnimatorStateHelper(playerScript.playerBodyAnimator); } PlayerAnimatorStateHelper playerAnimatorStateHelper = _playerAnimatorStateHelpers[actualClientId]; playerAnimatorStateHelper.SaveAnimatorStates(); playerAnimatorStateHelper.SetAnimatorOverrideController(PlayerAnimatorOverrideController); Logger.LogInfo("Animator override set for player \"" + playerScript.playerUsername + "\"", extended: true); } private void ResetPlayerAnimator(PlayerControllerB playerScript, GrabbableObject grabbableObject) { ulong actualClientId = playerScript.actualClientId; if (_playerAnimatorStateHelpers.ContainsKey(actualClientId)) { PlayerAnimatorStateHelper playerAnimatorStateHelper = _playerAnimatorStateHelpers[actualClientId]; playerAnimatorStateHelper.SaveAnimatorStates(); playerAnimatorStateHelper.RestoreOriginalAnimatorController(); SetPlayerAnimatorHoldAnimation(playerScript, grabbableObject); Logger.LogInfo("Animator restored for player \"" + playerScript.playerUsername + "\"", extended: true); } } private void SetPlayerAnimatorHoldAnimation(PlayerControllerB playerScript, GrabbableObject grabbableObject) { Animator playerBodyAnimator = playerScript.playerBodyAnimator; playerBodyAnimator.SetBool("Grab", true); playerBodyAnimator.SetBool("GrabValidated", true); string grabAnim = grabbableObject.itemProperties.grabAnim; if (!string.IsNullOrEmpty(grabAnim)) { playerBodyAnimator.SetBool(grabAnim, true); } if (grabbableObject.itemProperties.twoHandedAnimation) { playerBodyAnimator.ResetTrigger("SwitchHoldAnimationTwoHanded"); playerBodyAnimator.SetTrigger("SwitchHoldAnimationTwoHanded"); } playerBodyAnimator.ResetTrigger("SwitchHoldAnimation"); playerBodyAnimator.SetTrigger("SwitchHoldAnimation"); playerBodyAnimator.Play("chooseHoldAnimation"); } } } namespace com.github.zehsteam.Supercharger.Managers { internal static class ConfigManager { public static ConfigFile ConfigFile { get; private set; } public static ConfigEntry<bool> ExtendedLogging { get; private set; } public static SyncedConfigEntry<float> Supercharger_Chance { get; private set; } public static SyncedConfigEntry<int> Supercharger_ItemChargeAmount { get; private set; } public static ConfigEntry<bool> Supercharger_FlickerShipLights { get; private set; } public static SyncedConfigEntry<bool> Supercharger_OnlyWhenFullyCharged { get; private set; } public static SyncedConfigEntry<bool> Supercharger_EnableInOrbit { get; private set; } public static SyncedConfigEntry<float> Explosion_Chance { get; private set; } public static SyncedConfigEntry<float> Explosion_Range { get; private set; } public static SyncedConfigEntry<int> Explosion_Damage { get; private set; } public static SyncedConfigEntry<int> Explosion_EnemyDamage { get; private set; } public static SyncedConfigEntry<bool> Explosion_TurnsOffShipLights { get; private set; } public static void Initialize(ConfigFile configFile) { ConfigFile = configFile; BindConfigs(); } private static void BindConfigs() { ConfigHelper.SkipAutoGen(); ExtendedLogging = ConfigHelper.Bind("General", "ExtendedLogging", defaultValue: false, requiresRestart: false, "Enable extended logging."); Supercharger_Chance = new SyncedConfigEntry<float>("Supercharger", "Chance", 45f, "The percent chance the ship's charging station will supercharge your item.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 100f)); Supercharger_ItemChargeAmount = new SyncedConfigEntry<int>("Supercharger", "ItemChargeAmount", 200, "The amount of charge an item will receive after being supercharged.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(100, 1000)); Supercharger_FlickerShipLights = ConfigHelper.Bind("Supercharger", "FlickerShipLights", defaultValue: true, requiresRestart: false, "If enabled, the ship's lights will flicker during a supercharge."); Supercharger_OnlyWhenFullyCharged = new SyncedConfigEntry<bool>("Supercharger", "OnlyWhenFullyCharged", defaultValue: false, "If enabled, the ship's charging station will only be able to supercharge when the item has a battery charge of 100 or more."); Supercharger_EnableInOrbit = new SyncedConfigEntry<bool>("Supercharger", "EnableInOrbit", defaultValue: false, "If enabled, the ship's charging station will be able to supercharge while in orbit."); Explosion_Chance = new SyncedConfigEntry<float>("Explosion", "Chance", 30f, "The percent chance your item will explode from supercharging.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 100f)); Explosion_Range = new SyncedConfigEntry<float>("Explosion", "Range", 4f, "The range of the explosion in meters.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 8f)); Explosion_Damage = new SyncedConfigEntry<int>("Explosion", "Damage", 40, "The amount of damage you will receive from an explosion.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 1000)); Explosion_EnemyDamage = new SyncedConfigEntry<int>("Explosion", "EnemyDamage", 2, "The amount of damage enemies will receive from an explosion.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100)); Explosion_TurnsOffShipLights = new SyncedConfigEntry<bool>("Explosion", "TurnsOffShipLights", defaultValue: true, "If enabled, the ship's lights will turn off after an explosion."); } } } namespace com.github.zehsteam.Supercharger.Helpers { internal static class ConfigHelper { public static void SkipAutoGen() { if (LethalConfigProxy.Enabled) { LethalConfigProxy.SkipAutoGen(); } } public static void AddButton(string section, string name, string description, string buttonText, Action callback) { if (LethalConfigProxy.Enabled) { LethalConfigProxy.AddButton(section, name, description, buttonText, callback); } } public static ConfigEntry<T> Bind<T>(string section, string key, T defaultValue, bool requiresRestart, string description, AcceptableValueBase acceptableValues = null, Action<T> settingChanged = null, ConfigFile configFile = null) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown if (configFile == null) { configFile = ((BaseUnityPlugin)Plugin.Instance).Config; } ConfigEntry<T> configEntry = ((acceptableValues == null) ? configFile.Bind<T>(section, key, defaultValue, description) : configFile.Bind<T>(section, key, defaultValue, new ConfigDescription(description, acceptableValues, Array.Empty<object>()))); if (settingChanged != null) { configEntry.SettingChanged += delegate { settingChanged?.Invoke(configEntry.Value); }; } if (LethalConfigProxy.Enabled) { LethalConfigProxy.AddConfig<T>(configEntry, requiresRestart); } return configEntry; } public static Dictionary<ConfigDefinition, string> GetOrphanedConfigEntries(ConfigFile configFile = null) { if (configFile == null) { configFile = ((BaseUnityPlugin)Plugin.Instance).Config; } PropertyInfo property = ((object)configFile).GetType().GetProperty("OrphanedEntries", BindingFlags.Instance | BindingFlags.NonPublic); return (Dictionary<ConfigDefinition, string>)property.GetValue(configFile, null); } public static void SetConfigEntryValue<T>(ConfigEntry<T> configEntry, string value) { if (typeof(T) == typeof(int) && int.TryParse(value, out var result)) { configEntry.Value = (T)(object)result; return; } if (typeof(T) == typeof(float) && float.TryParse(value, out var result2)) { configEntry.Value = (T)(object)result2; return; } if (typeof(T) == typeof(double) && double.TryParse(value, out var result3)) { configEntry.Value = (T)(object)result3; return; } if (typeof(T) == typeof(bool) && bool.TryParse(value, out var result4)) { configEntry.Value = (T)(object)result4; return; } if (typeof(T) == typeof(string)) { configEntry.Value = (T)(object)value; return; } throw new InvalidOperationException($"Unsupported type: {typeof(T)}"); } public static void ClearUnusedEntries(ConfigFile configFile = null) { if (configFile == null) { configFile = ((BaseUnityPlugin)Plugin.Instance).Config; } Dictionary<ConfigDefinition, string> orphanedConfigEntries = GetOrphanedConfigEntries(configFile); if (orphanedConfigEntries != null) { orphanedConfigEntries.Clear(); configFile.Save(); } } } internal static class NetworkUtils { public static bool IsConnected { get { NetworkManager singleton = NetworkManager.Singleton; if (singleton == null) { return false; } return singleton.IsConnectedClient; } } public static bool IsServer { get { NetworkManager singleton = NetworkManager.Singleton; if (singleton == null) { return false; } return singleton.IsServer; } } public static bool IsHost { get { NetworkManager singleton = NetworkManager.Singleton; if (singleton == null) { return false; } return singleton.IsHost; } } public static int ConnectedPlayerCount => GameNetworkManager.Instance?.connectedPlayers ?? 0; public static ulong GetLocalClientId() { return NetworkManager.Singleton.LocalClientId; } public static bool IsLocalClientId(ulong clientId) { return clientId == GetLocalClientId(); } } internal class PlayerUtils { public static PlayerControllerB GetLocalPlayerScript() { return GameNetworkManager.Instance?.localPlayerController; } public static bool IsLocalPlayer(PlayerControllerB playerScript) { return (Object)(object)playerScript == (Object)(object)GetLocalPlayerScript(); } public static PlayerControllerB GetPlayerScriptByClientId(ulong clientId) { return ((IEnumerable<PlayerControllerB>)StartOfRound.Instance.allPlayerScripts).FirstOrDefault((Func<PlayerControllerB, bool>)((PlayerControllerB x) => x.actualClientId == clientId)); } public static PlayerControllerB GetPlayerScriptByPlayerId(int playerId) { if (playerId < 0 || playerId > StartOfRound.Instance.allPlayerScripts.Length - 1) { return null; } return StartOfRound.Instance.allPlayerScripts[playerId]; } } internal class ShipHelper { [CompilerGenerated] private sealed class <FlickerLightsOnLocalClientAnimation>d__9 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public float minInterval; public float maxInterval; public float duration; private bool <previouslyPowerSurged>5__2; private float <timer>5__3; private float <intervalTimer>5__4; private float <interval>5__5; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <FlickerLightsOnLocalClientAnimation>d__9(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <previouslyPowerSurged>5__2 = PowerSurgedShip; if (PowerSurgedShip) { PowerSurgedShip = false; } <timer>5__3 = 0f; <intervalTimer>5__4 = 0f; <interval>5__5 = Random.Range(minInterval, maxInterval); break; case 1: <>1__state = -1; <timer>5__3 += Time.deltaTime; <intervalTimer>5__4 += Time.deltaTime; break; } if (<timer>5__3 < duration) { if (PowerSurgedShip && !<previouslyPowerSurged>5__2) { PowerSurgedShip = false; StartOfRound.Instance.shipRoomLights.SetShipLightsOnLocalClientOnly(false); return false; } if (<intervalTimer>5__4 >= <interval>5__5) { StartOfRound.Instance.shipRoomLights.ToggleShipLightsOnLocalClientOnly(); <interval>5__5 = Random.Range(minInterval, maxInterval); <intervalTimer>5__4 = 0f; } <>2__current = null; <>1__state = 1; return true; } if (PowerSurgedShip && !<previouslyPowerSurged>5__2) { PowerSurgedShip = false; StartOfRound.Instance.shipRoomLights.SetShipLightsOnLocalClientOnly(false); return false; } StartOfRound.Instance.shipRoomLights.SetShipLightsOnLocalClientOnly(true); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static bool PowerSurgedShip; private static Coroutine _flickerLightsOnLocalClientAnimation; public static bool IsInOrbit() { if ((Object)(object)StartOfRound.Instance == (Object)null) { return false; } return StartOfRound.Instance.inShipPhase; } public static bool IsShipSupercharger(SuperchargeStationBehaviour superchargeStationBehaviour) { if (TryGetSuperchargeStationBehaviour(out var superchargeStationBehaviour2)) { return (Object)(object)superchargeStationBehaviour == (Object)(object)superchargeStationBehaviour2; } return false; } public static bool TryGetSuperchargeStationBehaviour(out SuperchargeStationBehaviour superchargeStationBehaviour) { superchargeStationBehaviour = null; if (TryGetChargeStationGameObject(out var gameObject)) { superchargeStationBehaviour = gameObject.GetComponentInChildren<SuperchargeStationBehaviour>(); return (Object)(object)superchargeStationBehaviour != (Object)null; } return false; } private static bool TryGetChargeStationGameObject(out GameObject gameObject) { gameObject = null; try { gameObject = GameObject.Find("/Environment/HangarShip/ShipModels2b/ChargeStation"); } catch { return false; } return (Object)(object)gameObject != (Object)null; } public static void SetLightSwitchInteractable(bool value) { if (TryGetLightSwitchInteractTrigger(out var interactTrigger)) { interactTrigger.interactable = value; } } private static bool TryGetLightSwitchInteractTrigger(out InteractTrigger interactTrigger) { interactTrigger = null; GameObject val; try { val = GameObject.Find("/Environment/HangarShip/LightSwitchContainer"); } catch { return false; } interactTrigger = val.GetComponentInChildren<InteractTrigger>(); return (Object)(object)interactTrigger != (Object)null; } public static bool FlickerLightsOnLocalClient(float duration, float minInterval, float maxInterval) { if (!StartOfRound.Instance.shipRoomLights.areLightsOn) { return false; } if (_flickerLightsOnLocalClientAnimation != null) { ((MonoBehaviour)StartOfRound.Instance).StopCoroutine(_flickerLightsOnLocalClientAnimation); } _flickerLightsOnLocalClientAnimation = ((MonoBehaviour)StartOfRound.Instance).StartCoroutine(FlickerLightsOnLocalClientAnimation(duration, minInterval, maxInterval)); return true; } [IteratorStateMachine(typeof(<FlickerLightsOnLocalClientAnimation>d__9))] private static IEnumerator FlickerLightsOnLocalClientAnimation(float duration, float minInterval, float maxInterval) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <FlickerLightsOnLocalClientAnimation>d__9(0) { duration = duration, minInterval = minInterval, maxInterval = maxInterval }; } } internal class Utils { public static bool RollPercentChance(float percent) { if (percent <= 0f) { return false; } if (percent >= 100f) { return true; } return Random.value * 100f <= percent; } public static void LogAnimatorParameters(Animator animator) { //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Invalid comparison between Unknown and I4 //IL_00a7: 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_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Expected I4, but got Unknown StringBuilder stringBuilder = new StringBuilder(); int length = (from _ in animator.parameters select _.name into _ orderby _.Length descending select _).First().Length; AnimatorControllerParameter[] parameters = animator.parameters; foreach (AnimatorControllerParameter val in parameters) { if ((int)val.type != 9) { stringBuilder.AppendLine(("\"" + val.name + "\", ").PadRight(length + 3)); AnimatorControllerParameterType type = val.type; switch (type - 1) { case 0: stringBuilder.AppendLine($"Float: {animator.GetFloat(val.name)}"); break; case 2: stringBuilder.AppendLine($"Int: {animator.GetInteger(val.name)}"); break; case 3: stringBuilder.AppendLine($"Bool: {animator.GetBool(val.name)}"); break; } } } Logger.LogInfo("\n\n" + stringBuilder.ToString() + "\n", extended: true); } public static bool TryParseValue<T>(string value, out T result) { try { if (typeof(T) == typeof(int) && int.TryParse(value, out var result2)) { result = (T)(object)result2; return true; } if (typeof(T) == typeof(float) && float.TryParse(value, out var result3)) { result = (T)(object)result3; return true; } if (typeof(T) == typeof(double) && double.TryParse(value, out var result4)) { result = (T)(object)result4; return true; } if (typeof(T) == typeof(bool) && bool.TryParse(value, out var result5)) { result = (T)(object)result5; return true; } if (typeof(T) == typeof(string)) { result = (T)(object)value; return true; } } catch { } result = default(T); return false; } public static void CreateExplosion(Vector3 explosionPosition, bool spawnExplosionEffect = false, int damage = 80, float minDamageRange = 0f, float maxDamageRange = 6.4f, int enemyHitForce = 6, CauseOfDeath causeOfDeath = 3, PlayerControllerB attacker = null) { //IL_0080: 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_0055: 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_00b4: 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_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_0313: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: 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_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_033a: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: 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_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: 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_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: 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_01f1: 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) //IL_0197: 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) //IL_02b8: Unknown result type (might be due to invalid IL or missing references) //IL_02be: Unknown result type (might be due to invalid IL or missing references) Transform val = null; if ((Object)(object)RoundManager.Instance != (Object)null && (Object)(object)RoundManager.Instance.mapPropsContainer != (Object)null && (Object)(object)RoundManager.Instance.mapPropsContainer.transform != (Object)null) { val = RoundManager.Instance.mapPropsContainer.transform; } if (spawnExplosionEffect) { Object.Instantiate<GameObject>(StartOfRound.Instance.explosionPrefab, explosionPosition, Quaternion.Euler(-90f, 0f, 0f), val).SetActive(true); } float num = Vector3.Distance(((Component)PlayerUtils.GetLocalPlayerScript()).transform.position, explosionPosition); if (num < 14f) { HUDManager.Instance.ShakeCamera((ScreenShakeType)1); } else if (num < 25f) { HUDManager.Instance.ShakeCamera((ScreenShakeType)0); } Collider[] array = Physics.OverlapSphere(explosionPosition, maxDamageRange, 2621448, (QueryTriggerInteraction)2); PlayerControllerB val2 = null; Rigidbody val4 = default(Rigidbody); for (int i = 0; i < array.Length; i++) { float num2 = Vector3.Distance(explosionPosition, ((Component)array[i]).transform.position); if (num2 > 4f && Physics.Linecast(explosionPosition, ((Component)array[i]).transform.position + Vector3.up * 0.3f, 256, (QueryTriggerInteraction)1)) { continue; } Vector3 val3; if (((Component)array[i]).gameObject.layer == 3) { val2 = ((Component)array[i]).gameObject.GetComponent<PlayerControllerB>(); if ((Object)(object)val2 != (Object)null && ((NetworkBehaviour)val2).IsOwner) { float num3 = 1f - Mathf.Clamp01((num2 - minDamageRange) / (maxDamageRange - minDamageRange)); val3 = ((Component)val2).transform.position - explosionPosition; Vector3 normalized = ((Vector3)(ref val3)).normalized; if (((Component)val2).TryGetComponent<Rigidbody>(ref val4)) { val4.AddForce(normalized * 500f); } Vector3 val5 = Vector3.Normalize((((Component)val2).transform.position + Vector3.up * 0.75f - explosionPosition) * 100f) * 30f; val2.DamagePlayer((int)((float)damage * num3), true, true, causeOfDeath, 0, false, val5); } } else if (((Component)array[i]).gameObject.layer == 21) { Landmine componentInChildren = ((Component)array[i]).gameObject.GetComponentInChildren<Landmine>(); if ((Object)(object)componentInChildren != (Object)null && !componentInChildren.hasExploded && num2 < 6f) { Logger.LogInfo("Setting off other mine", extended: true); ((MonoBehaviour)componentInChildren).StartCoroutine(componentInChildren.TriggerOtherMineDelayed(componentInChildren)); } } else if (((Component)array[i]).gameObject.layer == 19) { EnemyAICollisionDetect componentInChildren2 = ((Component)array[i]).gameObject.GetComponentInChildren<EnemyAICollisionDetect>(); if ((Object)(object)componentInChildren2 != (Object)null && ((NetworkBehaviour)componentInChildren2.mainScript).IsOwner && num2 < 4.5f) { EnemyAI mainScript = componentInChildren2.mainScript; val3 = default(Vector3); mainScript.HitEnemyOnLocalClient(enemyHitForce, val3, attacker, false, -1); componentInChildren2.mainScript.HitFromExplosion(num2); } } } int num4 = ~LayerMask.GetMask(new string[1] { "Room" }); num4 = ~LayerMask.GetMask(new string[1] { "Colliders" }); array = Physics.OverlapSphere(explosionPosition, 10f, num4); Rigidbody val6 = default(Rigidbody); for (int j = 0; j < array.Length; j++) { if (((Component)array[j]).TryGetComponent<Rigidbody>(ref val6)) { val6.AddExplosionForce(70f, explosionPosition, 10f); } } } } } namespace com.github.zehsteam.Supercharger.Dependencies { internal static class LethalConfigProxy { public const string PLUGIN_GUID = "ainavt.lc.lethalconfig"; public static bool Enabled => Chainloader.PluginInfos.ContainsKey("ainavt.lc.lethalconfig"); [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void SkipAutoGen() { LethalConfigManager.SkipAutoGen(); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void AddConfig<T>(ConfigEntry<T> configEntry, bool requiresRestart = false) { //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Expected O, but got Unknown //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Expected O, but got Unknown //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0089: 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 AcceptableValueBase acceptableValues = ((ConfigEntryBase)configEntry).Description.AcceptableValues; if (acceptableValues != null) { if (acceptableValues is AcceptableValueRange<float> || acceptableValues is AcceptableValueRange<int>) { AddConfigSlider<T>(configEntry, requiresRestart); return; } if (acceptableValues is AcceptableValueList<string>) { AddConfigDropdown<T>(configEntry, requiresRestart); return; } } if (!(configEntry is ConfigEntry<string> val)) { if (!(configEntry is ConfigEntry<bool> val2)) { if (!(configEntry is ConfigEntry<float> val3)) { if (!(configEntry is ConfigEntry<int> val4)) { throw new NotSupportedException($"Unsupported type: {typeof(T)}"); } LethalConfigManager.AddConfigItem((BaseConfigItem)new IntInputFieldConfigItem(val4, requiresRestart)); } else { LethalConfigManager.AddConfigItem((BaseConfigItem)new FloatInputFieldConfigItem(val3, requiresRestart)); } } else { LethalConfigManager.AddConfigItem((BaseConfigItem)new BoolCheckBoxConfigItem(val2, requiresRestart)); } } else { LethalConfigManager.AddConfigItem((BaseConfigItem)new TextInputFieldConfigItem(val, requiresRestart)); } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void AddConfigSlider<T>(ConfigEntry<T> configEntry, bool requiresRestart = false) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown if (!(configEntry is ConfigEntry<float> val)) { if (!(configEntry is ConfigEntry<int> val2)) { throw new NotSupportedException($"Slider not supported for type: {typeof(T)}"); } LethalConfigManager.AddConfigItem((BaseConfigItem)new IntSliderConfigItem(val2, requiresRestart)); } else { LethalConfigManager.AddConfigItem((BaseConfigItem)new FloatSliderConfigItem(val, requiresRestart)); } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void AddConfigDropdown<T>(ConfigEntry<T> configEntry, bool requiresRestart = false) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown if (configEntry is ConfigEntry<string> val) { LethalConfigManager.AddConfigItem((BaseConfigItem)new TextDropDownConfigItem(val, requiresRestart)); return; } throw new NotSupportedException($"Dropdown not supported for type: {typeof(T)}"); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void AddButton(string section, string name, string description, string buttonText, Action callback) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown LethalConfigManager.AddConfigItem((BaseConfigItem)new GenericButtonConfigItem(section, name, description, buttonText, (GenericButtonHandler)delegate { callback?.Invoke(); })); } } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { public IgnoresAccessChecksToAttribute(string assemblyName) { } } } [CompilerGenerated] internal sealed class <>z__ReadOnlySingleElementList<T> : IEnumerable, ICollection, IList, IEnumerable<T>, IReadOnlyCollection<T>, IReadOnlyList<T>, ICollection<T>, IList<T> { private sealed class Enumerator : IDisposable, IEnumerator, IEnumerator<T> { object IEnumerator.Current => _item; T IEnumerator<T>.Current => _item; public Enumerator(T item) { _item = item; } bool IEnumerator.MoveNext() { if (!_moveNextCalled) { return _moveNextCalled = true; } return false; } void IEnumerator.Reset() { _moveNextCalled = false; } void IDisposable.Dispose() { } } int ICollection.Count => 1; bool ICollection.IsSynchronized => false; object ICollection.SyncRoot => this; object IList.this[int index] { get { if (index != 0) { throw new IndexOutOfRangeException(); } return _item; } set { throw new NotSupportedException(); } } bool IList.IsFixedSize => true; bool IList.IsReadOnly => true; int IReadOnlyCollection<T>.Count => 1; T IReadOnlyList<T>.this[int index] { get { if (index != 0) { throw new IndexOutOfRangeException(); } return _item; } } int ICollection<T>.Count => 1; bool ICollection<T>.IsReadOnly => true; T IList<T>.this[int index] { get { if (index != 0) { throw new IndexOutOfRangeException(); } return _item; } set { throw new NotSupportedException(); } } public <>z__ReadOnlySingleElementList(T item) { _item = item; } IEnumerator IEnumerable.GetEnumerator() { return new Enumerator(_item); } void ICollection.CopyTo(Array array, int index) { array.SetValue(_item, index); } int IList.Add(object value) { throw new NotSupportedException(); } void IList.Clear() { throw new NotSupportedException(); } bool IList.Contains(object value) { return EqualityComparer<T>.Default.Equals(_item, (T)value); } int IList.IndexOf(object value) { if (!EqualityComparer<T>.Default.Equals(_item, (T)value)) { return -1; } return 0; } void IList.Insert(int index, object value) { throw new NotSupportedException(); } void IList.Remove(object value) { throw new NotSupportedException(); } void IList.RemoveAt(int index) { throw new NotSupportedException(); } IEnumerator<T> IEnumerable<T>.GetEnumerator() { return new Enumerator(_item); } void ICollection<T>.Add(T item) { throw new NotSupportedException(); } void ICollection<T>.Clear() { throw new NotSupportedException(); } bool ICollection<T>.Contains(T item) { return EqualityComparer<T>.Default.Equals(_item, item); } void ICollection<T>.CopyTo(T[] array, int arrayIndex) { array[arrayIndex] = _item; } bool ICollection<T>.Remove(T item) { throw new NotSupportedException(); } int IList<T>.IndexOf(T item) { if (!EqualityComparer<T>.Default.Equals(_item, item)) { return -1; } return 0; } void IList<T>.Insert(int index, T item) { throw new NotSupportedException(); } void IList<T>.RemoveAt(int index) { throw new NotSupportedException(); } } namespace __GEN { internal class NetworkVariableSerializationHelper { [RuntimeInitializeOnLoadMethod] internal static void InitializeSerialization() { } } } namespace com.github.zehsteam.Supercharger.NetcodePatcher { [AttributeUsage(AttributeTargets.Module)] internal class NetcodePatchedAssemblyAttribute : Attribute { } }