using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; 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.Configuration; using BepInEx.Logging; using Dawn; using GameNetcodeStuff; using HAI_laserweapons; using HAI_laserweapons.NetcodePatcher; using HarmonyLib; using LethalCompanyInputUtils.Api; using LethalSettings.UI; using LethalSettings.UI.Components; using Microsoft.CodeAnalysis; using TMPro; using Unity.Netcode; using UnityEngine; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; using UnityEngine.Rendering.HighDefinition; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("HAI_laserweapons")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("HAI_laserweapons")] [assembly: AssemblyCopyright("Copyright © 2025")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("f84ac08e-056e-4827-b673-6adedf739c23")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [module: NetcodePatchedAssembly] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [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] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [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; } } } public class HAI_LaserImpact : NetworkBehaviour { [Header("Components")] public ParticleSystem[] particleSystems = null; public AudioSource impactAudioSource = null; public DecalProjector decalProjector = null; [Header("Timeline Settings")] [SerializeField] private float coolingDuration = 20f; [SerializeField] private float sootDuration = 40f; [SerializeField] private float fadeDuration = 5f; [Header("Emission Settings (HDRP Decal)")] [SerializeField] private string emissiveColorProperty = "_EmissiveColor"; [SerializeField] private Color emissionBaseColor = new Color(1f, 1f, 1f); [SerializeField] private float startEmissionIntensity = 5f; [SerializeField] private float endEmissionIntensity = 0f; private Material decalMaterialInstance; private bool hasStartedFade = false; public void InitializeFromCode() { if (particleSystems == null || particleSystems.Length == 0) { particleSystems = ((Component)this).GetComponentsInChildren(true); } if ((Object)(object)impactAudioSource == (Object)null) { impactAudioSource = ((Component)this).GetComponentInChildren(true); } if ((Object)(object)decalProjector == (Object)null) { decalProjector = ((Component)this).GetComponentInChildren(true); } ManualLogSource mls = Plugin.mls; if (mls != null) { mls.LogInfo((object)$"[HAI_LaserImpact] InitializeFromCode отработал! Найдено партиклов: {particleSystems?.Length}"); } } public override void OnNetworkSpawn() { //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Expected O, but got Unknown //IL_011d: 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) ((NetworkBehaviour)this).OnNetworkSpawn(); if (particleSystems != null) { ParticleSystem[] array = particleSystems; foreach (ParticleSystem val in array) { if (val != null) { val.Play(); } } } if ((Object)(object)impactAudioSource != (Object)null) { impactAudioSource.pitch = Random.Range(0.9f, 1.15f); impactAudioSource.Play(); } if ((Object)(object)decalProjector == (Object)null) { decalProjector = ((Component)this).GetComponent(); } if ((Object)(object)decalProjector != (Object)null && (Object)(object)decalProjector.material != (Object)null) { decalMaterialInstance = new Material(decalProjector.material); decalProjector.material = decalMaterialInstance; decalProjector.fadeFactor = 1f; if (decalMaterialInstance.HasProperty(emissiveColorProperty)) { decalMaterialInstance.SetColor(emissiveColorProperty, emissionBaseColor * startEmissionIntensity); } } if (!hasStartedFade) { hasStartedFade = true; ((MonoBehaviour)this).StartCoroutine(FadeImpactRoutine()); } if (((NetworkBehaviour)this).IsServer) { float delay = coolingDuration + sootDuration + fadeDuration + 0.5f; ((MonoBehaviour)this).StartCoroutine(DespawnAfterDelay(delay)); } } private IEnumerator FadeImpactRoutine() { if ((Object)(object)decalProjector != (Object)null) { ((Component)decalProjector).transform.Rotate(0f, 0f, Random.Range(0f, 360f), (Space)1); } if (particleSystems != null) { ParticleSystem[] array = particleSystems; foreach (ParticleSystem ps in array) { if ((Object)(object)ps != (Object)null) { ps.Play(); } } } if ((Object)(object)impactAudioSource != (Object)null && (Object)(object)impactAudioSource.clip != (Object)null) { impactAudioSource.Play(); } bool hasProperty = false; if ((Object)(object)decalProjector != (Object)null && (Object)(object)decalProjector.material != (Object)null) { decalMaterialInstance = new Material(decalProjector.material); hasProperty = decalMaterialInstance.HasProperty(emissiveColorProperty); } float elapsed = 0f; while (elapsed < coolingDuration) { elapsed += Time.deltaTime; float percent = Mathf.Clamp01(elapsed / coolingDuration); float currentIntensity = Mathf.Lerp(startEmissionIntensity, endEmissionIntensity, percent); if (hasProperty) { decalMaterialInstance.SetColor(emissiveColorProperty, emissionBaseColor * currentIntensity); decalProjector.material = decalMaterialInstance; } yield return null; } if (hasProperty) { decalMaterialInstance.SetColor(emissiveColorProperty, emissionBaseColor * endEmissionIntensity); } decalProjector.material = decalMaterialInstance; yield return (object)new WaitForSeconds(sootDuration); elapsed = 0f; while (elapsed < fadeDuration) { elapsed += Time.deltaTime; float percent2 = Mathf.Clamp01(elapsed / fadeDuration); decalProjector.fadeFactor = Mathf.Lerp(1f, 0f, percent2); yield return null; } decalProjector.fadeFactor = 0f; } private IEnumerator DespawnAfterDelay(float delay) { yield return (object)new WaitForSeconds(delay); if ((Object)(object)((NetworkBehaviour)this).NetworkObject != (Object)null && ((NetworkBehaviour)this).NetworkObject.IsSpawned) { ((NetworkBehaviour)this).NetworkObject.Despawn(true); } } public override void OnNetworkDespawn() { ((NetworkBehaviour)this).OnNetworkDespawn(); if ((Object)(object)decalMaterialInstance != (Object)null) { Object.Destroy((Object)(object)decalMaterialInstance); decalMaterialInstance = null; } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { ((NetworkBehaviour)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "HAI_LaserImpact"; } } namespace HAI_laserweapons { [HarmonyPatch(typeof(Terminal))] public class CustomTerminalRegistry { private const string ManufacturerCommand = "hoplit"; private const string ManufacturerAlias = "hai"; private const string CatalogCommand = "laser"; private static bool IsMatch(string input, string target, int minChars = 2) { if (string.IsNullOrEmpty(input)) { return false; } if (input.Length < minChars && input != target) { return false; } return target.StartsWith(input); } [HarmonyPatch("Awake")] [HarmonyPostfix] public static void BuildCorporateNetwork(Terminal __instance) { TerminalKeyword val = ((IEnumerable)__instance.terminalNodes.allKeywords).FirstOrDefault((Func)((TerminalKeyword k) => k.word == "help")); if ((Object)(object)val != (Object)null && (Object)(object)val.specialKeywordResult != (Object)null) { string text = (Plugin.translateRussian ? "> КОРПОРАТИВНЫЕ СЕТИ\nДля доступа к каталогам введите `corporate`.\n" : "> CORPORATE NETWORKS\nTo access other companies catalogs type `corporate`.\n"); if (!val.specialKeywordResult.displayText.Contains("`corporate`")) { TerminalNode specialKeywordResult = val.specialKeywordResult; specialKeywordResult.displayText += text; } } TerminalKeyword orCreateKeyword = GetOrCreateKeyword(__instance, "corporate"); TerminalNode val2 = orCreateKeyword.specialKeywordResult; if ((Object)(object)val2 == (Object)null) { val2 = ScriptableObject.CreateInstance(); ((Object)val2).name = "CorporateNetworksNode"; val2.clearPreviousText = true; val2.displayText = (Plugin.translateRussian ? "==================================================\n ОБЪЕДИНЕННАЯ КОРПОРАТИВНАЯ БАЗА ДАННЫХ\n [ Введите `help` для выхода в общую систему ]\n==================================================\nВыберите производителя для просмотра продукции:\n\n" : "==================================================\n UNITED CORPORATE DATABASE\n [ Type `help` to exit to main system ]\n==================================================\nSelect a manufacturer to view products:\n\n"); orCreateKeyword.specialKeywordResult = val2; } string text2 = (Plugin.translateRussian ? "> Hoplit Armament Industries (введите `hoplit` или `hai`)\n" : "> Hoplit Armament Industries (type `hoplit` or `hai`)\n"); if (!val2.displayText.Contains("`hoplit`")) { TerminalNode obj = val2; obj.displayText += text2; } TerminalKeyword orCreateKeyword2 = GetOrCreateKeyword(__instance, "hoplit"); TerminalKeyword orCreateKeyword3 = GetOrCreateKeyword(__instance, "hai"); TerminalNode val3 = orCreateKeyword2.specialKeywordResult; if ((Object)(object)val3 == (Object)null) { val3 = ScriptableObject.CreateInstance(); ((Object)val3).name = "HoplitMainMenuNode"; val3.clearPreviousText = true; val3.displayText = (Plugin.translateRussian ? "==================================================\n HOPLIT ARMAMENT INDUSTRIES - ГЛАВНЫЙ ТЕРМИНАЛ\n [ Введите `help` для выхода в общую систему ]\n==================================================\nАвторизация успешна. Доступные каталоги:\n\n" : "==================================================\n HOPLIT ARMAMENT INDUSTRIES - MAIN TERMINAL\n [ Type `help` to exit to main system ]\n==================================================\nAuthorization successful. Available catalogs:\n\n"); orCreateKeyword2.specialKeywordResult = val3; orCreateKeyword3.specialKeywordResult = val3; } string text3 = (Plugin.translateRussian ? "> Лазерное энергооружие (введите `laser`)\n" : "> Laser energy weapons (type `laser`)\n"); if (!val3.displayText.Contains("`laser`")) { TerminalNode obj2 = val3; obj2.displayText += text3; } TerminalKeyword orCreateKeyword4 = GetOrCreateKeyword(__instance, "laser"); if ((Object)(object)orCreateKeyword4.specialKeywordResult == (Object)null) { TerminalNode val4 = ScriptableObject.CreateInstance(); ((Object)val4).name = "LaserCatalogueNode"; val4.clearPreviousText = true; string displayText = (Plugin.translateRussian ? ("==================================================\n H.A.I. - КАТАЛОГ: ЛАЗЕРНОЕ ОРУЖИЕ\n [ Введите `help` для выхода ]\n==================================================\nНадежные лазерные энергетические решения для любых угроз.\n\n[ БОЕПРИПАСЫ И ОБСЛУЖИВАНИЕ ]\n" + $"* Энергоячейка // {Plugin.lasercellPrice} $\n\n" + "[ КОМПАКТНОЕ ВООРУЖЕНИЕ ]\n" + $"* Пистолет // {Plugin.laserpistolPrice} $\n" + "--------------------------------------------------\nИНСТРУКЦИЯ ПО ЗАКАЗУ:\nПросто введите название (например: 'эмиттер' или 'карабин').\nТакже доступна команда 'info [название]'.\n==================================================\n\n") : ("==================================================\n H.A.I. - CATALOGUE: LASER WEAPONRY\n [ Type `help` to exit ]\n==================================================\nReliable laser energy solutions for any threats.\n\n[ AMMUNITION & MAINTENANCE ]\n" + $"* Energy Cell // ${Plugin.lasercellPrice}\n\n" + "[ COMPACT WEAPONRY ]\n" + $"* Pistol // ${Plugin.laserpistolPrice}\n" + "--------------------------------------------------\nORDER INSTRUCTIONS:\nJust type the name (e.g., 'emitter' or 'carbine').\nCommand 'info [name]' is also available.\n==================================================\n\n")); val4.displayText = displayText; orCreateKeyword4.specialKeywordResult = val4; } } private static TerminalKeyword GetOrCreateKeyword(Terminal terminal, string word) { TerminalKeyword val = ((IEnumerable)terminal.terminalNodes.allKeywords).FirstOrDefault((Func)((TerminalKeyword k) => k.word == word)); if ((Object)(object)val == (Object)null) { val = ScriptableObject.CreateInstance(); val.word = word; ((Object)val).name = word + "Keyword"; terminal.terminalNodes.allKeywords = CollectionExtensions.AddToArray(terminal.terminalNodes.allKeywords, val); } return val; } private static TerminalNode GetItemInfoNode(string targetEN) { return (TerminalNode)(targetEN switch { "Cell" => Plugin.lasercellAmmoItemShopInfo, "Emitter" => Plugin.laseremitterpistolShopInfo, "Pistol" => Plugin.laserpistolItemShopInfo, "Machinegun" => Plugin.lasersmgShopInfo, "Carbine" => Plugin.lasercarbineShopInfo, "Sniper" => Plugin.lasersniperShopInfo, _ => null, }); } [HarmonyPatch("TextPostProcess")] [HarmonyPostfix] public static void HideFromStandardStore(ref string __result, TerminalNode node) { if ((!((Object)(object)node != (Object)null) || ((Object)node).name == null || !((Object)node).name.StartsWith("LaserCatalogueNode")) && (!((Object)(object)node != (Object)null) || !node.isConfirmationNode) && !string.IsNullOrEmpty(__result) && __result.Contains("[H.A.I.]")) { string[] source = __result.Split('\n'); IEnumerable values = source.Where((string line) => !line.Contains("[H.A.I.]")); __result = string.Join("\n", values); } } [HarmonyPatch("ParsePlayerSentence")] [HarmonyPrefix] public static bool EnforceFolderLock(Terminal __instance, ref TerminalNode __result) { if ((Object)(object)__instance.currentNode == (Object)null || string.IsNullOrEmpty(((Object)__instance.currentNode).name)) { return true; } string name = ((Object)__instance.currentNode).name; bool flag = name.StartsWith("CorporateNetworksNode"); bool flag2 = name.StartsWith("HoplitMainMenuNode"); bool flag3 = name.StartsWith("LaserCatalogueNode"); bool flag4 = name.EndsWith("_Confirm"); string text = ""; text = ((__instance.textAdded < 0 || __instance.textAdded > __instance.screenText.text.Length) ? __instance.screenText.text : __instance.screenText.text.Substring(__instance.textAdded)); string[] array = text.Split(new char[2] { '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries); string text2 = ((array.Length != 0) ? array.Last() : ""); if (text2.Contains("===") || text2.Contains("[") || text2.Contains("]") || text2.Contains(">") || text2.Contains("H.A.I.")) { text2 = ""; } text2 = text2.Trim().ToLower(); string[] array2 = text2.Split(new char[1] { ' ' }, StringSplitOptions.RemoveEmptyEntries); if (array2.Length == 0) { return true; } string text3 = array2[0]; if (text3 == "addmoney") { __instance.groupCredits += 10000; __instance.SyncGroupCreditsServerRpc(__instance.groupCredits, __instance.numberOfItemsInDropship); TerminalNode val = ScriptableObject.CreateInstance(); val.clearPreviousText = true; val.displayText = (Plugin.translateRussian ? "> ВНИМАНИЕ: Активирован протокол финансирования H.A.I.\n> На баланс корабля зачислено 10,000 кредитов.\n\n" : "> WARNING: H.A.I. funding protocol activated.\n> 10,000 credits added to ship balance.\n\n"); __result = val; return false; } if (flag4) { bool flag5 = IsMatch(text3, "confirm", 1) || IsMatch(text3, "подтвердить", 1) || text3 == "y"; bool flag6 = IsMatch(text3, "deny", 1) || IsMatch(text3, "отменить", 1) || text3 == "n"; if (flag5) { CompatibleNoun val2 = __instance.currentNode.terminalOptions?.FirstOrDefault((Func)((CompatibleNoun opt) => opt.noun.word == "confirm")); if (val2 != null && (Object)(object)val2.result != (Object)null) { TerminalNode val3 = Object.Instantiate(val2.result); val3.buyItemIndex = __instance.currentNode.buyItemIndex; val3.itemCost = __instance.currentNode.itemCost; int num = __instance.currentNode.itemCost * __instance.playerDefinedAmount; val3.displayText = val3.displayText.Replace("[totalCost]", num.ToString()); val3.displayText = val3.displayText.Replace("[variableAmount]", __instance.playerDefinedAmount.ToString()); __result = val3; return false; } } else if (flag6) { string text4 = name.Replace("_Confirm", ""); TerminalNode val4 = null; TerminalKeyword[] allKeywords = __instance.terminalNodes.allKeywords; foreach (TerminalKeyword val5 in allKeywords) { if ((Object)(object)val5 != (Object)null && (Object)(object)val5.specialKeywordResult != (Object)null && ((Object)val5.specialKeywordResult).name == text4) { val4 = val5.specialKeywordResult; break; } } if ((Object)(object)val4 == (Object)null) { val4 = ((IEnumerable)__instance.terminalNodes.allKeywords).FirstOrDefault((Func)((TerminalKeyword k) => k.word == "laser"))?.specialKeywordResult; } if ((Object)(object)val4 != (Object)null) { __result = val4; return false; } } TerminalNode val6 = ScriptableObject.CreateInstance(); ((Object)val6).name = name; val6.clearPreviousText = true; val6.terminalOptions = __instance.currentNode.terminalOptions; val6.overrideOptions = __instance.currentNode.overrideOptions; val6.isConfirmationNode = true; val6.buyItemIndex = __instance.currentNode.buyItemIndex; val6.itemCost = __instance.currentNode.itemCost; string text5 = __instance.currentNode.displayText; if (text5.Contains("> ОШИБКА")) { text5 = text5.Substring(0, text5.IndexOf("> ОШИБКА")); } if (text5.Contains("> ERROR")) { text5 = text5.Substring(0, text5.IndexOf("> ERROR")); } string text6 = (Plugin.translateRussian ? "> ОШИБКА: Ожидается ответ 'confirm' (c) или 'deny' (d).\n\n" : "> ERROR: Expected response 'confirm' (c) or 'deny' (d).\n\n"); val6.displayText = text5 + text6; __result = val6; return false; } if (IsMatch(text3, "help")) { TerminalKeyword val7 = ((IEnumerable)__instance.terminalNodes.allKeywords).FirstOrDefault((Func)((TerminalKeyword k) => k.word == "help")); if ((Object)(object)val7 != (Object)null && (Object)(object)val7.specialKeywordResult != (Object)null) { __result = val7.specialKeywordResult; return false; } } if (IsMatch(text3, "corporate") || IsMatch(text3, "hoplit") || IsMatch(text3, "hai") || IsMatch(text3, "laser")) { string matchedWord = ""; if (IsMatch(text3, "corporate")) { matchedWord = "corporate"; } else if (IsMatch(text3, "hoplit")) { matchedWord = "hoplit"; } else if (IsMatch(text3, "hai")) { matchedWord = "hai"; } else if (IsMatch(text3, "laser")) { matchedWord = "laser"; } bool flag7 = false; if (matchedWord == "corporate") { flag7 = true; } else if (matchedWord == "hoplit" || matchedWord == "hai") { if (flag || (!flag && !flag2 && !flag3)) { flag7 = true; } } else if (matchedWord == "laser" && (flag2 || (!flag && !flag2 && !flag3))) { flag7 = true; } if (flag7) { TerminalKeyword val8 = ((IEnumerable)__instance.terminalNodes.allKeywords).FirstOrDefault((Func)((TerminalKeyword k) => k.word == matchedWord)); if ((Object)(object)val8 != (Object)null && (Object)(object)val8.specialKeywordResult != (Object)null) { __result = val8.specialKeywordResult; return false; } } } if (!flag && !flag2 && !flag3) { return true; } bool flag8 = false; string text7 = ""; if (flag) { flag8 = true; text7 = (Plugin.translateRussian ? ("> ОШИБКА ДОСТУПА: Корпорация '" + text3 + "' не найдена.\n> Введите `help` для выхода.\n\n") : ("> ACCESS ERROR: Corporation '" + text3 + "' not found.\n> Type `help` to exit.\n\n")); } else if (flag2) { flag8 = true; text7 = (Plugin.translateRussian ? ("> ОШИБКА ДОСТУПА: Каталог '" + text3 + "' отсутствует.\n> Введите `help` для выхода.\n\n") : ("> ACCESS ERROR: Catalog '" + text3 + "' missing.\n> Type `help` to exit.\n\n")); } else if (flag3) { bool flag9 = false; string input = text3; if (text3 == "buy" && array2.Length > 1) { input = array2[1]; } else if (text3 == "info") { flag9 = true; if (array2.Length > 1) { input = array2[1]; } } string text8 = ""; string value = ""; if (IsMatch(input, "cell") || IsMatch(input, "energy") || IsMatch(input, "ячейка") || IsMatch(input, "энерго", 4)) { text8 = "Cell"; value = "Энергоячейка"; } else if (IsMatch(input, "emitter") || IsMatch(input, "эмиттер")) { text8 = "Emitter"; value = "Эмиттер"; } else if (IsMatch(input, "pistol") || IsMatch(input, "пистолет")) { text8 = "Pistol"; value = "Пистолет"; } else if (IsMatch(input, "smg") || IsMatch(input, "machinegun", 3) || IsMatch(input, "пп")) { text8 = "Machinegun"; value = "ПП"; } else if (IsMatch(input, "carbine") || IsMatch(input, "карабин")) { text8 = "Carbine"; value = "Карабин"; } else if (IsMatch(input, "sniper") || IsMatch(input, "precision", 3) || IsMatch(input, "винтовка", 4)) { text8 = "Sniper"; value = "Винтовка"; } if (!string.IsNullOrEmpty(text8)) { TerminalNode itemInfoNode = GetItemInfoNode(text8); if (flag9) { if ((Object)(object)itemInfoNode != (Object)null) { TerminalNode val9 = ScriptableObject.CreateInstance(); ((Object)val9).name = name; val9.clearPreviousText = true; string text9 = (Plugin.translateRussian ? "\n[ Введите название предмета для покупки или `help` для выхода ]\n\n" : "\n[ Type item name to purchase or `help` to exit ]\n\n"); val9.displayText = itemInfoNode.displayText + text9; __result = val9; return false; } } else { int itemIndex = -1; for (int num3 = 0; num3 < __instance.buyableItemsList.Length; num3++) { if ((Object)(object)__instance.buyableItemsList[num3] != (Object)null) { string itemName = __instance.buyableItemsList[num3].itemName; if (itemName.Contains(text8) || itemName.Contains(value) || (text8 == "Machinegun" && itemName.Contains("SMG")) || (text8 == "Sniper" && itemName.Contains("Precision"))) { itemIndex = num3; break; } } } if (itemIndex != -1) { TerminalKeyword val10 = ((IEnumerable)__instance.terminalNodes.allKeywords).FirstOrDefault((Func)((TerminalKeyword k) => k.word == "buy")); if ((Object)(object)val10 != (Object)null && val10.compatibleNouns != null) { CompatibleNoun val11 = ((IEnumerable)val10.compatibleNouns).FirstOrDefault((Func)((CompatibleNoun n) => (Object)(object)n.result != (Object)null && n.result.buyItemIndex == itemIndex)); if (val11 != null && (Object)(object)val11.result != (Object)null) { int num4 = 1; if (array2.Length > 1 && int.TryParse(array2[^1], out var result)) { num4 = Mathf.Clamp(result, 1, 10); } __instance.playerDefinedAmount = num4; TerminalNode val12 = Object.Instantiate(val11.result); ((Object)val12).name = name + "_Confirm"; val12.buyItemIndex = itemIndex; int num5 = (val12.itemCost = __instance.buyableItemsList[itemIndex].creditsWorth); string itemName2 = __instance.buyableItemsList[itemIndex].itemName; string newValue = (num5 * num4).ToString(); val12.displayText = val12.displayText.Replace("[variableAmount]", num4.ToString()); val12.displayText = val12.displayText.Replace("[totalCost]", newValue); val12.displayText = val12.displayText.Replace("[itemName]", itemName2); if ((Object)(object)itemInfoNode != (Object)null) { string text10 = "==================================================\n"; val12.displayText = itemInfoNode.displayText + text10 + val12.displayText; } __result = val12; return false; } } } } } flag8 = true; text7 = (Plugin.translateRussian ? ("\n> ОШИБКА: Запрос '" + text3 + "' не распознан.\n> Введите название (`эмиттер`) или `info эмиттер`.\n> Введите `help` для выхода.\n\n") : ("\n> ERROR: Request '" + text3 + "' not recognized.\n> Type name (`emitter`) or `info emitter`.\n> Type `help` to exit.\n\n")); } if (flag8) { TerminalNode val13 = ScriptableObject.CreateInstance(); ((Object)val13).name = name; val13.clearPreviousText = true; string text11 = __instance.currentNode.displayText; if (text11.Contains("> ОШИБКА")) { text11 = text11.Substring(0, text11.IndexOf("> ОШИБКА")); } if (text11.Contains("> ACCESS ERROR")) { text11 = text11.Substring(0, text11.IndexOf("> ACCESS ERROR")); } if (text11.Contains("> ERROR")) { text11 = text11.Substring(0, text11.IndexOf("> ERROR")); } val13.displayText = text11 + text7; __result = val13; return false; } return true; } } public abstract class CustomWeaponBase : GrabbableObject { protected bool isCrouching; protected bool isJumping; protected bool isWalking; protected bool isSprinting; protected bool wasWeaponHold = false; protected AnimatorStateInfo currentStateInfo; protected float currentAnimationTime; private static MethodInfo pingScanMethod; protected virtual string HoldParameterName => "WeaponHold"; protected abstract RuntimeAnimatorController CustomPlayerAnimator { get; } protected abstract RuntimeAnimatorController CustomOtherPlayerAnimator { get; } private void OnWeaponScanPerformed(CallbackContext context) { //IL_0060: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)HUDManager.Instance == (Object)null)) { if (pingScanMethod == null) { pingScanMethod = typeof(HUDManager).GetMethod("PingScan_performed", BindingFlags.Instance | BindingFlags.NonPublic); } if (pingScanMethod != null) { pingScanMethod.Invoke(HUDManager.Instance, new object[1] { context }); } } } public override void EquipItem() { ((GrabbableObject)this).EquipItem(); if ((Object)(object)base.playerHeldBy != (Object)null && (Object)(object)base.playerHeldBy == (Object)(object)GameNetworkManager.Instance.localPlayerController) { Plugin.InputActionInstance.WeaponScanKey.performed -= OnWeaponScanPerformed; Plugin.InputActionInstance.WeaponScanKey.performed += OnWeaponScanPerformed; } } public override void PocketItem() { Plugin.InputActionInstance.WeaponScanKey.performed -= OnWeaponScanPerformed; ((GrabbableObject)this).PocketItem(); } public override void DiscardItem() { Plugin.InputActionInstance.WeaponScanKey.performed -= OnWeaponScanPerformed; ((GrabbableObject)this).DiscardItem(); } public override void OnDestroy() { ((GrabbableObject)this).OnDestroy(); Plugin.InputActionInstance.WeaponScanKey.performed -= OnWeaponScanPerformed; } protected RuntimeAnimatorController GetVanillaAnimator(PlayerControllerB player) { if ((Object)(object)player == (Object)null) { return null; } if ((Object)(object)player == (Object)(object)GameNetworkManager.Instance.localPlayerController) { return StartOfRound.Instance.localClientAnimatorController; } return StartOfRound.Instance.otherClientsAnimatorController; } protected static bool AnimatorHasParameter(Animator animator, string paramName) { if ((Object)(object)animator == (Object)null) { return false; } AnimatorControllerParameter[] parameters = animator.parameters; foreach (AnimatorControllerParameter val in parameters) { if (val.name == paramName) { return true; } } return false; } protected void SaveAnimatorStates(Animator animator) { //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) if (AnimatorHasParameter(animator, HoldParameterName)) { wasWeaponHold = animator.GetBool(HoldParameterName); } 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; } protected void RestoreAnimatorStates(Animator animator, bool isRestoringVanilla) { animator.SetBool("crouching", isCrouching); animator.SetBool("Jumping", isJumping); animator.SetBool("Walking", isWalking); animator.SetBool("Sprinting", isSprinting); if (!isRestoringVanilla && AnimatorHasParameter(animator, HoldParameterName)) { animator.SetBool(HoldParameterName, wasWeaponHold); } animator.Play(((AnimatorStateInfo)(ref currentStateInfo)).fullPathHash, 0, currentAnimationTime); } public void UpdateWeaponAnimator(PlayerControllerB player, Animator playerBodyAnimator, bool isDroppingWeapon) { if ((Object)(object)player == (Object)null || (Object)(object)playerBodyAnimator == (Object)null) { return; } if (!isDroppingWeapon) { RuntimeAnimatorController val = (((Object)(object)player == (Object)(object)GameNetworkManager.Instance.localPlayerController) ? CustomPlayerAnimator : CustomOtherPlayerAnimator); if ((Object)(object)playerBodyAnimator.runtimeAnimatorController != (Object)(object)val) { SaveAnimatorStates(playerBodyAnimator); playerBodyAnimator.runtimeAnimatorController = val; playerBodyAnimator.Update(0f); RestoreAnimatorStates(playerBodyAnimator, isRestoringVanilla: false); Plugin.mls.LogInfo((object)("Replaced Player Animator for " + ((Object)((Component)this).gameObject).name + "!")); } return; } bool flag = false; if (player.ItemSlots != null && player.currentItemSlot >= 0 && player.currentItemSlot < player.ItemSlots.Length) { GrabbableObject val2 = player.ItemSlots[player.currentItemSlot]; if ((Object)(object)val2 != (Object)null && val2 is CustomWeaponBase) { flag = true; } } if (flag) { Plugin.mls.LogInfo((object)"Skipping vanilla animator restore: switching directly to another custom weapon."); return; } RuntimeAnimatorController vanillaAnimator = GetVanillaAnimator(player); if ((Object)(object)vanillaAnimator != (Object)null && (Object)(object)playerBodyAnimator.runtimeAnimatorController != (Object)(object)vanillaAnimator) { SaveAnimatorStates(playerBodyAnimator); playerBodyAnimator.runtimeAnimatorController = vanillaAnimator; playerBodyAnimator.Update(0f); RestoreAnimatorStates(playerBodyAnimator, isRestoringVanilla: true); Plugin.mls.LogInfo((object)("Restored Original Animator after dropping " + ((Object)((Component)this).gameObject).name + "!")); } } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { ((GrabbableObject)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "CustomWeaponBase"; } } public class HAI_LaserCellItem : GrabbableObject { public int ammoType = 1000; public float currentBatteryCharge = 100f; private ScanNodeProperties scanNode; private bool scanNodeInitialized = false; public override void Start() { ((GrabbableObject)this).Start(); currentBatteryCharge = Mathf.Clamp(currentBatteryCharge, 0f, 100f); scanNode = ((Component)this).GetComponentInChildren(); if ((Object)(object)scanNode != (Object)null) { scanNodeInitialized = true; UpdateScanNodeText(); } if (base.itemProperties.toolTips == null || base.itemProperties.toolTips.Length < 2) { base.itemProperties.toolTips = new string[2] { "", "System Check" }; } if (base.itemProperties.toolTips.Length > 1) { base.itemProperties.toolTips[1] = GetChargeTooltip(); } Plugin.mls.LogInfo((object)$"Laser Cell Spawned - Ammo Type ID: {ammoType}"); } public override int GetItemDataToSave() { ((GrabbableObject)this).GetItemDataToSave(); currentBatteryCharge = Mathf.Clamp(currentBatteryCharge, 0f, 100f); return Mathf.RoundToInt(currentBatteryCharge * 100f); } public override void LoadItemSaveData(int saveData) { ((GrabbableObject)this).LoadItemSaveData(saveData); currentBatteryCharge = Mathf.Clamp((float)saveData / 100f, 0f, 100f); if (scanNodeInitialized) { UpdateScanNodeText(); } } private void UpdateScanNodeText() { if ((Object)(object)scanNode != (Object)null) { string arg = (Plugin.translateRussian ? "Боеприпас для лазерного оружия" : "Ammo for laser weapons"); string arg2 = (Plugin.translateRussian ? "Заряд" : "Charge"); scanNode.subText = $"{arg}\n{arg2}: {currentBatteryCharge:F1}%"; } } private string GetChargeTooltip() { string arg = (Plugin.translateRussian ? "Заряд батареи" : "Cell charge"); return $"{arg}: {currentBatteryCharge:F1}%"; } public override void Update() { ((GrabbableObject)this).Update(); if (scanNodeInitialized) { UpdateScanNodeText(); } if (!base.isHeld || !((Object)(object)base.playerHeldBy != (Object)null) || !((Object)(object)base.playerHeldBy == (Object)(object)GameNetworkManager.Instance.localPlayerController) || base.playerHeldBy.ItemSlots == null || base.playerHeldBy.currentItemSlot < 0 || base.playerHeldBy.currentItemSlot >= base.playerHeldBy.ItemSlots.Length || !((Object)(object)base.playerHeldBy.ItemSlots[base.playerHeldBy.currentItemSlot] == (Object)(object)this)) { return; } string chargeTooltip = GetChargeTooltip(); if ((Object)(object)HUDManager.Instance != (Object)null && HUDManager.Instance.controlTipLines != null) { if (HUDManager.Instance.controlTipLines.Length > 2) { ((TMP_Text)HUDManager.Instance.controlTipLines[2]).text = chargeTooltip; ((Behaviour)HUDManager.Instance.controlTipLines[2]).enabled = true; } else if (HUDManager.Instance.controlTipLines.Length > 1) { ((TMP_Text)HUDManager.Instance.controlTipLines[1]).text = chargeTooltip; ((Behaviour)HUDManager.Instance.controlTipLines[1]).enabled = true; } } } public override void EquipItem() { ((GrabbableObject)this).EquipItem(); } public override void DiscardItem() { ((GrabbableObject)this).DiscardItem(); } [ServerRpc(RequireOwnership = false)] public void UpdateBatteryChargeServerRpc(float newCharge) { //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) //IL_00dc: 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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3961940959u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref newCharge, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3961940959u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; currentBatteryCharge = newCharge; UpdateBatteryChargeClientRpc(newCharge); } } } [ClientRpc] public void UpdateBatteryChargeClientRpc(float newCharge) { //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) //IL_00dc: 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.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3704695492u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref newCharge, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3704695492u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; currentBatteryCharge = newCharge; if (scanNodeInitialized) { UpdateScanNodeText(); } if (base.itemProperties.toolTips != null && base.itemProperties.toolTips.Length > 1) { base.itemProperties.toolTips[1] = GetChargeTooltip(); } if (base.isHeld && (Object)(object)base.playerHeldBy != (Object)null && (Object)(object)base.playerHeldBy == (Object)(object)GameNetworkManager.Instance.localPlayerController && (Object)(object)base.playerHeldBy.ItemSlots[base.playerHeldBy.currentItemSlot] == (Object)(object)this) { ((GrabbableObject)this).SetControlTipsForItem(); } } } protected override void __initializeVariables() { ((GrabbableObject)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 ((NetworkBehaviour)this).__registerRpc(3961940959u, new RpcReceiveHandler(__rpc_handler_3961940959), "UpdateBatteryChargeServerRpc"); ((NetworkBehaviour)this).__registerRpc(3704695492u, new RpcReceiveHandler(__rpc_handler_3704695492), "UpdateBatteryChargeClientRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_3961940959(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) { float newCharge = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref newCharge, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((HAI_LaserCellItem)(object)target).UpdateBatteryChargeServerRpc(newCharge); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3704695492(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) { float newCharge = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref newCharge, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((HAI_LaserCellItem)(object)target).UpdateBatteryChargeClientRpc(newCharge); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "HAI_LaserCellItem"; } } public class HAI_LaserEmitterItem : CustomWeaponBase { private enum ActionType { None, Aim, Inspect, Other } [Header("Configuration")] public bool enableDebugTracers = true; public bool enablePositionDebug = false; public int gunCompatibleAmmoID = 1000; public float energyCostPerSecond = 2.5f; public float heatPerSecond = 15f; public float maxBeamDistance = 4f; public float triggerVolume = 0.2f; public float shootVolume = 3f; public float maxHissVolume = 1f; public float emitterLoopVolume = 0.2f; private float currentLoopVolume = 0f; [Header("Heat System")] public float coolingRate = 25f; public float overheatCoolingRate = 5f; public float heatWarningThreshold = 80f; [Header("Positioning Offsets")] private Vector3 firstPersonPos = new Vector3(0.125f, 0.109f, -0.016f); private Vector3 firstPersonRot = new Vector3(8.257f, 17.169f, -85.342f); private Vector3 thirdPersonPos = new Vector3(0.143f, 0.076f, 0.033f); private Vector3 thirdPersonRot = new Vector3(8.257f, 2.362f, -85.342f); [Header("States")] public bool isLoaded = false; public bool isLoading; public bool isUnloading; public bool isReloading; public bool isSwitchingMode; public bool cantFire; public bool isOverheated; public bool isModeSafe = true; public bool isFiringBeam = false; private bool localClientSendingFiringRPC = false; public bool isInspectingToggle = false; public bool isInspectingHold = false; private float nextShootTime = 0f; public float fireCooldown = 0.6f; private ScanNodeProperties scanNode; private bool scanNodeInitialized = false; public float currentBatteryCharge = 0f; public float currentHeatLevel = 0f; [Header("Aiming")] public bool isAiming = false; public float zoomDelay = 0.5f; private float aimStartTime = 0f; private bool localClientSendingAimRPC = false; private bool canZoom = false; [Header("Overheat State")] public bool isPlayingOverheatAnim = false; private Coroutine overheatAnimCoroutine; [Header("Door Breaching")] public float normalDoorMeltTime = 8f; public float bigDoorMeltTime = 16f; private static Dictionary doorMeltProgress = new Dictionary(); private GameObject targetedDoor = null; private ulong targetedDoorId = 0uL; private float targetedDoorMaxTime = 1f; private Texture2D breachProgressTexture; private Texture2D breachBgTexture; private Texture2D breachLineTexture; private GUIStyle breachTextStyle; [Header("Components")] public Animator gunAnimator; public AudioSource gunAudio; private AudioSource hissAudioSource; private AudioSource loopAudioSource; public Transform gunRayPoint; public LineRenderer laserBeam; public MeshRenderer laserCellInPistolMesh; public MeshRenderer laserCellInHandMesh; [Header("Audio Clips")] public AudioClip triggerClickSFX; public AudioClip batteryInsertSFX; public AudioClip batteryEjectSFX; public AudioClip modeSwitchSFX; public AudioClip overheatSFX; public AudioClip overheatBeepSFX; public AudioClip gunHissLoopSFX; public AudioClip dischargedBeepSFX; [Header("Audio Clips")] public List gunShootSFX = new List(); public AudioClip emitterLoopSFX; public AudioClip emitterEndSFX; private bool reloadHoldCompleted = false; private bool safetyHoldCompleted = false; private EnemyAI heldByEnemy; private bool localClientSendingSafetyRPC = false; private bool localClientSendingInspectToggleRPC = false; private bool localClientSendingInspectHoldRPC = false; private PlayerControllerB previousPlayerHeldBy; private float qPressTime = 0f; private bool qWasPressed = false; private float rPressTime = 0f; private bool rWasPressed = false; private float ePressTime = 0f; private bool eWasPressed = false; private const float HOLD_THRESHOLD = 0.5f; private const float ACTION_COOLDOWN = 0.5f; private float stopActionTime = 0f; private float lastBeepTime = 0f; private float lastDamageTime = 0f; private const float DAMAGE_TICK_RATE = 0.3f; private ActionType lastAction = ActionType.None; private float defaultFOV = 66f; private float zoomFOV = 50f; private float zoomSpeed = 15f; protected override RuntimeAnimatorController CustomPlayerAnimator => Plugin.playerAnimator; protected override RuntimeAnimatorController CustomOtherPlayerAnimator => Plugin.otherPlayerAnimator; protected override string HoldParameterName => "LaspistHold"; public override void Start() { ((GrabbableObject)this).Start(); if ((Object)(object)gunAnimator == (Object)null) { Plugin.mls.LogError((object)"АХТУНГ! Эмиттер не нашел свой Animator!"); } hissAudioSource = ((Component)this).gameObject.AddComponent(); hissAudioSource.spatialBlend = 1f; hissAudioSource.rolloffMode = (AudioRolloffMode)1; hissAudioSource.minDistance = 2f; hissAudioSource.maxDistance = 15f; hissAudioSource.loop = true; hissAudioSource.playOnAwake = false; if ((Object)(object)gunHissLoopSFX != (Object)null) { hissAudioSource.clip = gunHissLoopSFX; } loopAudioSource = ((Component)this).gameObject.AddComponent(); loopAudioSource.spatialBlend = 1f; loopAudioSource.rolloffMode = (AudioRolloffMode)1; loopAudioSource.minDistance = 2f; loopAudioSource.maxDistance = 15f; loopAudioSource.loop = true; loopAudioSource.playOnAwake = false; if ((Object)(object)emitterLoopSFX != (Object)null) { loopAudioSource.clip = emitterLoopSFX; } scanNode = ((Component)this).GetComponentInChildren(); if ((Object)(object)scanNode != (Object)null) { scanNodeInitialized = true; UpdateScanNodeText(); } if ((Object)(object)laserBeam != (Object)null) { ((Renderer)laserBeam).enabled = false; } if ((Object)(object)laserCellInPistolMesh != (Object)null) { ((Renderer)laserCellInPistolMesh).enabled = isLoaded; } if ((Object)(object)laserCellInHandMesh != (Object)null) { ((Renderer)laserCellInHandMesh).enabled = false; } currentBatteryCharge = Mathf.Clamp(currentBatteryCharge, 0f, 100f); currentHeatLevel = Mathf.Clamp(currentHeatLevel, 0f, 100f); InitializeSafetyState(); } public override void Update() { ((GrabbableObject)this).Update(); if (scanNodeInitialized) { UpdateScanNodeText(); } ProcessOverheatSystem(); ProcessContinuousFiring(); if ((Object)(object)loopAudioSource != (Object)null && (Object)(object)loopAudioSource.clip != (Object)null) { float num = 6.6666665f; if (isFiringBeam) { currentLoopVolume = Mathf.MoveTowards(currentLoopVolume, 1f, num * Time.deltaTime); if (!loopAudioSource.isPlaying && currentLoopVolume > 0f) { loopAudioSource.Play(); } } else { currentLoopVolume = Mathf.MoveTowards(currentLoopVolume, 0f, num * Time.deltaTime); if (currentLoopVolume <= 0f && loopAudioSource.isPlaying) { loopAudioSource.Stop(); } } loopAudioSource.volume = currentLoopVolume * emitterLoopVolume; } if (!((Object)(object)((GrabbableObject)this).playerHeldBy == (Object)null) && ((GrabbableObject)this).isHeld && !((GrabbableObject)this).isPocketed && !((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)(object)GameNetworkManager.Instance.localPlayerController) && !isPlayingOverheatAnim) { bool isPressed = Mouse.current.leftButton.isPressed; if (Plugin.InputActionInstance.WeaponReloadKey.IsPressed() || Plugin.InputActionInstance.InspectKey.IsPressed() || Plugin.InputActionInstance.WeaponFireModeKey.IsPressed()) { ForceStopFiring(); } else if (!isPressed && (isFiringBeam || ((Object)(object)gunAnimator != (Object)null && gunAnimator.GetBool("Shooting")))) { ForceStopFiring(); } HandleInspectInput(); HandleReloadInput(); HandleSafetyInput(); HandleAimInput(); HandleZoom(); } } public override void LateUpdate() { //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_014b: 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_0152: 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_0550: Unknown result type (might be due to invalid IL or missing references) //IL_0552: Unknown result type (might be due to invalid IL or missing references) //IL_055d: Unknown result type (might be due to invalid IL or missing references) //IL_055f: 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_053b: Unknown result type (might be due to invalid IL or missing references) //IL_0541: 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_0525: Unknown result type (might be due to invalid IL or missing references) //IL_0527: Unknown result type (might be due to invalid IL or missing references) //IL_052d: Unknown result type (might be due to invalid IL or missing references) //IL_052f: Unknown result type (might be due to invalid IL or missing references) if (!((GrabbableObject)this).isPocketed) { if (!isLoading && !isUnloading && !isReloading) { if ((Object)(object)laserCellInHandMesh != (Object)null && ((Renderer)laserCellInHandMesh).enabled) { ((Renderer)laserCellInHandMesh).enabled = false; } if ((Object)(object)laserCellInPistolMesh != (Object)null && ((Renderer)laserCellInPistolMesh).enabled != isLoaded) { ((Renderer)laserCellInPistolMesh).enabled = isLoaded; } } } else { if ((Object)(object)laserCellInHandMesh != (Object)null && ((Renderer)laserCellInHandMesh).enabled) { ((Renderer)laserCellInHandMesh).enabled = false; } if ((Object)(object)laserCellInPistolMesh != (Object)null && ((Renderer)laserCellInPistolMesh).enabled) { ((Renderer)laserCellInPistolMesh).enabled = false; } } if (((GrabbableObject)this).isHeld && (Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null) { bool flag = (Object)(object)((GrabbableObject)this).playerHeldBy == (Object)(object)GameNetworkManager.Instance.localPlayerController; Vector3 positionOffset = (flag ? firstPersonPos : thirdPersonPos); Vector3 rotationOffset = (flag ? firstPersonRot : thirdPersonRot); if (enablePositionDebug) { bool isPressed = ((ButtonControl)Keyboard.current.leftAltKey).isPressed; bool isPressed2 = ((ButtonControl)Keyboard.current.rightAltKey).isPressed; if (isPressed || isPressed2) { float num = 0.25f * Time.deltaTime; float num2 = 15f * Time.deltaTime; if (isPressed) { if (((ButtonControl)Keyboard.current.lKey).isPressed) { positionOffset.x += num; } if (((ButtonControl)Keyboard.current.jKey).isPressed) { positionOffset.x -= num; } if (((ButtonControl)Keyboard.current.oKey).isPressed) { positionOffset.y += num; } if (((ButtonControl)Keyboard.current.uKey).isPressed) { positionOffset.y -= num; } if (((ButtonControl)Keyboard.current.iKey).isPressed) { positionOffset.z += num; } if (((ButtonControl)Keyboard.current.kKey).isPressed) { positionOffset.z -= num; } } else if (isPressed2) { if (((ButtonControl)Keyboard.current.iKey).isPressed) { rotationOffset.x += num2; } if (((ButtonControl)Keyboard.current.kKey).isPressed) { rotationOffset.x -= num2; } if (((ButtonControl)Keyboard.current.lKey).isPressed) { rotationOffset.y += num2; } if (((ButtonControl)Keyboard.current.jKey).isPressed) { rotationOffset.y -= num2; } if (((ButtonControl)Keyboard.current.oKey).isPressed) { rotationOffset.z += num2; } if (((ButtonControl)Keyboard.current.uKey).isPressed) { rotationOffset.z -= num2; } } if (((ButtonControl)Keyboard.current.enterKey).wasPressedThisFrame) { CultureInfo invariantCulture = CultureInfo.InvariantCulture; string text = positionOffset.x.ToString("F3", invariantCulture); string text2 = positionOffset.y.ToString("F3", invariantCulture); string text3 = positionOffset.z.ToString("F3", invariantCulture); string text4 = rotationOffset.x.ToString("F3", invariantCulture); string text5 = rotationOffset.y.ToString("F3", invariantCulture); string text6 = rotationOffset.z.ToString("F3", invariantCulture); string text7 = (flag ? "1-Е ЛИЦО" : "3-Е ЛИЦО"); string text8 = (flag ? "firstPersonPos" : "thirdPersonPos"); string text9 = (flag ? "firstPersonRot" : "thirdPersonRot"); Plugin.mls.LogInfo((object)("====== ИДЕАЛЬНЫЕ КООРДИНАТЫ: " + text7 + " ======")); Plugin.mls.LogInfo((object)("private Vector3 " + text8 + " = new Vector3(" + text + "f, " + text2 + "f, " + text3 + "f);")); Plugin.mls.LogInfo((object)("private Vector3 " + text9 + " = new Vector3(" + text4 + "f, " + text5 + "f, " + text6 + "f);")); Plugin.mls.LogInfo((object)"=========================================="); } } if (flag) { firstPersonPos = positionOffset; firstPersonRot = rotationOffset; } else { thirdPersonPos = positionOffset; thirdPersonRot = rotationOffset; } } ((GrabbableObject)this).itemProperties.positionOffset = positionOffset; ((GrabbableObject)this).itemProperties.rotationOffset = rotationOffset; } ((GrabbableObject)this).LateUpdate(); } private void UpdateScanNodeText() { if ((Object)(object)scanNode != (Object)null) { string text = (Plugin.translateRussian ? "Лазерный Эмиттер" : "Laser Emitter"); string arg = (Plugin.translateRussian ? "Заряд" : "Charge"); if (isLoaded) { scanNode.subText = $"{text}\n{arg}: {currentBatteryCharge:F1}%"; return; } string text2 = (Plugin.translateRussian ? "БАТАРЕЯ ОТСУТСТВУЕТ" : "NO CELL INSERTED"); scanNode.subText = text + "\n" + text2; } } public override int GetItemDataToSave() { ((GrabbableObject)this).GetItemDataToSave(); int num = Mathf.RoundToInt(currentBatteryCharge * 100f); int num2 = Mathf.RoundToInt(currentHeatLevel * 100f); int num3 = (num << 16) | (num2 & 0xFFFF); if (isModeSafe) { num3 |= int.MinValue; } if (isLoaded) { num3 |= 0x40000000; } return num3; } public override void LoadItemSaveData(int saveData) { ((GrabbableObject)this).LoadItemSaveData(saveData); if (saveData != 0) { isModeSafe = (saveData & int.MinValue) != 0; isLoaded = (saveData & 0x40000000) != 0; int num = saveData & 0x3FFFFFFF; int num2 = (num >> 16) & 0xFFFF; int num3 = num & 0xFFFF; currentBatteryCharge = Mathf.Clamp((float)num2 / 100f, 0f, 100f); currentHeatLevel = Mathf.Clamp((float)num3 / 100f, 0f, 100f); if ((Object)(object)laserCellInPistolMesh != (Object)null) { ((Renderer)laserCellInPistolMesh).enabled = isLoaded; } InitializeSafetyState(); } } private bool CanPerformAction(ActionType attemptingAction) { if (Time.time < stopActionTime + 0.5f) { if (attemptingAction == ActionType.Aim && lastAction == ActionType.Aim) { return true; } if (attemptingAction == ActionType.Inspect && lastAction == ActionType.Inspect) { return true; } return false; } if (attemptingAction == ActionType.Aim && (isInspectingToggle || isInspectingHold)) { return false; } if (attemptingAction == ActionType.Inspect && isAiming) { return false; } if (attemptingAction == ActionType.Other && (isAiming || isInspectingToggle || isInspectingHold)) { return false; } return true; } public override void ItemActivate(bool used, bool buttonDown = true) { if (isSwitchingMode || isLoading || isUnloading || isReloading || isPlayingOverheatAnim) { return; } if (isInspectingToggle) { if (buttonDown) { ToggleInspectAndSync(); } } else { if (Time.time < stopActionTime + 0.5f || Plugin.InputActionInstance.InspectKey.IsPressed()) { return; } if (buttonDown) { if (!(Time.time < nextShootTime)) { nextShootTime = Time.time + fireCooldown; if ((Object)(object)gunAnimator != (Object)null) { gunAnimator.SetBool("Shooting", true); } if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null && (Object)(object)((GrabbableObject)this).playerHeldBy.playerBodyAnimator != (Object)null) { ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.SetBool("LasEmitShoot", true); } if ((Object)(object)triggerClickSFX != (Object)null) { gunAudio.PlayOneShot(triggerClickSFX, triggerVolume); } if (!isInspectingHold && !isModeSafe && !isOverheated && currentBatteryCharge > 0f) { SetFiringStateAndSync(fire: true); } } } else { ForceStopFiring(); } } } public override void ItemInteractLeftRight(bool right) { ((GrabbableObject)this).ItemInteractLeftRight(right); } public override void EquipItem() { //IL_006e: 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_0046: 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) ((GrabbableObject)this).itemProperties.disableHandsOnWall = true; base.EquipItem(); if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null) { if ((Object)(object)((GrabbableObject)this).playerHeldBy == (Object)(object)GameNetworkManager.Instance.localPlayerController) { ((Component)this).transform.localPosition = firstPersonPos; ((Component)this).transform.localEulerAngles = firstPersonRot; } else { ((Component)this).transform.localPosition = thirdPersonPos; ((Component)this).transform.localEulerAngles = thirdPersonRot; } } if ((Object)(object)laserCellInPistolMesh != (Object)null) { ((Renderer)laserCellInPistolMesh).enabled = isLoaded; } if ((Object)(object)laserCellInHandMesh != (Object)null) { ((Renderer)laserCellInHandMesh).enabled = false; } previousPlayerHeldBy = ((GrabbableObject)this).playerHeldBy; previousPlayerHeldBy.equippedUsableItemQE = true; UpdateWeaponAnimator(((GrabbableObject)this).playerHeldBy, ((GrabbableObject)this).playerHeldBy.playerBodyAnimator, isDroppingWeapon: false); if ((Object)(object)((GrabbableObject)this).playerHeldBy.playerBodyAnimator != (Object)null) { ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.SetBool("LaspistHold", true); ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.SetBool("LaspistSafety", isModeSafe); ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.SetTrigger("SwitchHoldAnimationTwoHanded"); } if ((Object)(object)gunAnimator != (Object)null) { gunAnimator.SetBool("SafetyMode", isModeSafe); } if ((Object)(object)((GrabbableObject)this).playerHeldBy == (Object)(object)GameNetworkManager.Instance.localPlayerController) { defaultFOV = ((GrabbableObject)this).playerHeldBy.gameplayCamera.fieldOfView; } isAiming = false; } public override void PocketItem() { SetFiringStateAndSync(fire: false); CleanUpOnDrop(); base.PocketItem(); } public override void DiscardItem() { SetFiringStateAndSync(fire: false); CleanUpOnDrop(); base.DiscardItem(); } private void CleanUpOnDrop() { if (isPlayingOverheatAnim) { if (overheatAnimCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(overheatAnimCoroutine); } isPlayingOverheatAnim = false; cantFire = false; if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null && (Object)(object)((GrabbableObject)this).playerHeldBy == (Object)(object)GameNetworkManager.Instance.localPlayerController) { ((GrabbableObject)this).playerHeldBy.isGrabbingObjectAnimation = false; } } if ((Object)(object)((GrabbableObject)this).playerHeldBy == (Object)(object)GameNetworkManager.Instance.localPlayerController && (Object)(object)((GrabbableObject)this).playerHeldBy.gameplayCamera != (Object)null) { ((GrabbableObject)this).playerHeldBy.gameplayCamera.fieldOfView = defaultFOV; } ResetInteractionState(); if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null) { UpdateWeaponAnimator(((GrabbableObject)this).playerHeldBy, ((GrabbableObject)this).playerHeldBy.playerBodyAnimator, isDroppingWeapon: true); } } public override void GrabItem() { ((GrabbableObject)this).GrabItem(); if ((Object)(object)laserCellInPistolMesh != (Object)null) { ((Renderer)laserCellInPistolMesh).enabled = isLoaded; } if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null) { UpdateWeaponAnimator(((GrabbableObject)this).playerHeldBy, ((GrabbableObject)this).playerHeldBy.playerBodyAnimator, isDroppingWeapon: false); } } public override void GrabItemFromEnemy(EnemyAI enemy) { ((GrabbableObject)this).GrabItemFromEnemy(enemy); if ((Object)(object)laserCellInPistolMesh != (Object)null) { ((Renderer)laserCellInPistolMesh).enabled = isLoaded; } heldByEnemy = enemy; } public override void DiscardItemFromEnemy() { ((GrabbableObject)this).DiscardItemFromEnemy(); if ((Object)(object)laserCellInPistolMesh != (Object)null) { ((Renderer)laserCellInPistolMesh).enabled = isLoaded; } heldByEnemy = null; } private void SetFiringStateAndSync(bool fire) { if (isFiringBeam != fire) { localClientSendingFiringRPC = true; SetFiringStateLocal(fire); SetFiringStateServerRpc(fire); } } [ServerRpc(RequireOwnership = false)] public void SetFiringStateServerRpc(bool fire) { //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) //IL_00dc: 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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1831832056u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref fire, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1831832056u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SetFiringStateClientRpc(fire); } } } [ClientRpc] public void SetFiringStateClientRpc(bool fire) { //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) //IL_00dc: 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.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2224198530u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref fire, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2224198530u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (localClientSendingFiringRPC) { localClientSendingFiringRPC = false; } else { SetFiringStateLocal(fire); } } } private void SetFiringStateLocal(bool fire) { isFiringBeam = fire; if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null && (Object)(object)((GrabbableObject)this).playerHeldBy.playerBodyAnimator != (Object)null) { ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.SetBool("LasEmitShoot", fire); } if ((Object)(object)gunAnimator != (Object)null) { gunAnimator.SetBool("Shooting", fire); } if ((Object)(object)laserBeam != (Object)null) { ((Renderer)laserBeam).enabled = fire; } if (fire) { if (gunShootSFX.Count > 0) { int index = Random.Range(0, gunShootSFX.Count); gunAudio.PlayOneShot(gunShootSFX[index], shootVolume); } return; } if ((Object)(object)emitterEndSFX != (Object)null) { gunAudio.PlayOneShot(emitterEndSFX); } if (((NetworkBehaviour)this).IsOwner) { UpdateBatteryChargeServerRpc(currentBatteryCharge); } } private void ProcessContinuousFiring() { if (!isFiringBeam) { return; } if (isModeSafe || isOverheated || currentBatteryCharge <= 0f || isReloading || isSwitchingMode || ((GrabbableObject)this).isPocketed || !((GrabbableObject)this).isHeld) { if (((NetworkBehaviour)this).IsOwner) { SetFiringStateAndSync(fire: false); } return; } float num = energyCostPerSecond * Time.deltaTime; currentBatteryCharge -= num; float num2 = heatPerSecond * Time.deltaTime; currentHeatLevel += num2; UpdateBeamVisuals(); if (((NetworkBehaviour)this).IsOwner) { if (currentBatteryCharge <= 0f) { currentBatteryCharge = 0f; SetFiringStateAndSync(fire: false); PlayDischargeBeepClientRpc(); } if (currentHeatLevel >= 100f) { currentHeatLevel = 100f; SetFiringStateAndSync(fire: false); TriggerOverheat(); } else if (currentHeatLevel >= heatWarningThreshold && (Object)(object)overheatBeepSFX != (Object)null && Time.time >= lastBeepTime + 3f) { gunAudio.PlayOneShot(overheatBeepSFX, triggerVolume * 0.75f); lastBeepTime = Time.time; } } } private void UpdateBeamVisuals() { //IL_0056: 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_0062: 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_00af: 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_00e5: 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_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_013f: 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) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_018d: 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_01b5: 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_019f: 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_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_07ed: Unknown result type (might be due to invalid IL or missing references) //IL_07fb: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_081f: Unknown result type (might be due to invalid IL or missing references) //IL_0818: Unknown result type (might be due to invalid IL or missing references) //IL_0824: Unknown result type (might be due to invalid IL or missing references) //IL_0827: Unknown result type (might be due to invalid IL or missing references) //IL_0828: Unknown result type (might be due to invalid IL or missing references) //IL_082a: Unknown result type (might be due to invalid IL or missing references) //IL_083b: 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_02e2: Unknown result type (might be due to invalid IL or missing references) //IL_02e4: Unknown result type (might be due to invalid IL or missing references) //IL_032c: Unknown result type (might be due to invalid IL or missing references) //IL_032e: Unknown result type (might be due to invalid IL or missing references) //IL_02f9: Unknown result type (might be due to invalid IL or missing references) //IL_02fd: Unknown result type (might be due to invalid IL or missing references) //IL_0343: Unknown result type (might be due to invalid IL or missing references) //IL_0347: Unknown result type (might be due to invalid IL or missing references) //IL_041f: 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_0469: Unknown result type (might be due to invalid IL or missing references) //IL_046b: Unknown result type (might be due to invalid IL or missing references) //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_043a: Unknown result type (might be due to invalid IL or missing references) //IL_0480: Unknown result type (might be due to invalid IL or missing references) //IL_0484: Unknown result type (might be due to invalid IL or missing references) //IL_0712: Unknown result type (might be due to invalid IL or missing references) //IL_0714: Unknown result type (might be due to invalid IL or missing references) //IL_071d: Unknown result type (might be due to invalid IL or missing references) //IL_0722: Unknown result type (might be due to invalid IL or missing references) //IL_0727: Unknown result type (might be due to invalid IL or missing references) //IL_0729: Unknown result type (might be due to invalid IL or missing references) //IL_072b: Unknown result type (might be due to invalid IL or missing references) //IL_0547: Unknown result type (might be due to invalid IL or missing references) //IL_0549: Unknown result type (might be due to invalid IL or missing references) //IL_0507: Unknown result type (might be due to invalid IL or missing references) //IL_0793: Unknown result type (might be due to invalid IL or missing references) //IL_0795: Unknown result type (might be due to invalid IL or missing references) //IL_073e: Unknown result type (might be due to invalid IL or missing references) //IL_0742: Unknown result type (might be due to invalid IL or missing references) //IL_05c1: Unknown result type (might be due to invalid IL or missing references) //IL_05c3: 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_0562: Unknown result type (might be due to invalid IL or missing references) //IL_07aa: Unknown result type (might be due to invalid IL or missing references) //IL_07ae: Unknown result type (might be due to invalid IL or missing references) //IL_05d8: Unknown result type (might be due to invalid IL or missing references) //IL_05eb: Unknown result type (might be due to invalid IL or missing references) //IL_0777: Unknown result type (might be due to invalid IL or missing references) //IL_077e: Unknown result type (might be due to invalid IL or missing references) //IL_0529: Unknown result type (might be due to invalid IL or missing references) //IL_052f: 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_06d2: Unknown result type (might be due to invalid IL or missing references) //IL_06c0: Unknown result type (might be due to invalid IL or missing references) //IL_06e7: Unknown result type (might be due to invalid IL or missing references) //IL_06eb: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)gunRayPoint == (Object)null) { return; } Transform val = (((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null) ? ((Component)((GrabbableObject)this).playerHeldBy).transform : (((Object)(object)heldByEnemy != (Object)null) ? ((Component)heldByEnemy).transform : null)); Vector3 position = gunRayPoint.position; Vector3 forward = gunRayPoint.forward; float num = maxBeamDistance; float num2 = 0.2f; float num3 = 0.2f; int num4 = (StartOfRound.Instance.collidersAndRoomMaskAndDefault | 0x200 | 8 | 0x80000 | 0x1000 | 0x100 | 0x200000) & -268435457; RaycastHit[] array = Physics.SphereCastAll(position, num3, forward, num, num4, (QueryTriggerInteraction)2); Array.Sort(array, (RaycastHit x, RaycastHit y) => ((RaycastHit)(ref x)).distance.CompareTo(((RaycastHit)(ref y)).distance)); Vector3 val2 = position + forward * num; bool flag = false; bool flag2 = false; List list = new List(); bool flag3 = Time.time - lastDamageTime >= 0.3f; targetedDoor = null; if (flag3 && ((NetworkBehaviour)this).IsOwner) { TryDamageBugsOnPlayer(((GrabbableObject)this).playerHeldBy, Plugin.laseremitterpistolMonsterDamage, forward); } RaycastHit[] array2 = array; IHittable val7 = default(IHittable); RaycastHit val9 = default(RaycastHit); for (int num5 = 0; num5 < array2.Length; num5++) { RaycastHit val3 = array2[num5]; GameObject gameObject = ((Component)((RaycastHit)(ref val3)).collider).gameObject; int layer = gameObject.layer; string name = ((Object)((RaycastHit)(ref val3)).collider).name; Vector3 val4 = ((((RaycastHit)(ref val3)).point != Vector3.zero) ? ((RaycastHit)(ref val3)).point : (position + forward * ((RaycastHit)(ref val3)).distance)); if (((Object)(object)val != (Object)null && ((Object)(object)((RaycastHit)(ref val3)).transform == (Object)(object)val || ((RaycastHit)(ref val3)).transform.IsChildOf(val))) || list.Contains(gameObject)) { continue; } list.Add(gameObject); if (layer == 28 || layer == 6 || layer == 12 || name.Contains("Stair") || name.Contains("Catwalk") || name.Contains("Rail") || name.Contains("Raiing")) { continue; } DoorLock normalDoor = gameObject.GetComponent() ?? gameObject.GetComponentInParent(); if ((Object)(object)normalDoor != (Object)null) { if (normalDoor.isLocked) { targetedDoor = ((Component)normalDoor).gameObject; ProcessDoorMelting(((NetworkBehaviour)normalDoor).NetworkObjectId, normalDoorMeltTime, flag3, delegate { normalDoor.UnlockDoorSyncWithServer(); }); val2 = val4; flag = true; if (enableDebugTracers && flag3) { CreateDebugBurnMark(val4, ((RaycastHit)(ref val3)).normal, ((RaycastHit)(ref val3)).transform); } break; } if (((RaycastHit)(ref val3)).collider.isTrigger) { continue; } val2 = val4; flag = true; if (enableDebugTracers && flag3) { CreateDebugBurnMark(val4, ((RaycastHit)(ref val3)).normal, ((RaycastHit)(ref val3)).transform); } break; } TerminalAccessibleObject bigDoor = gameObject.GetComponent() ?? gameObject.GetComponentInParent(); if ((Object)(object)bigDoor != (Object)null && bigDoor.isBigDoor) { FieldInfo field = typeof(TerminalAccessibleObject).GetField("isDoorOpen", BindingFlags.Instance | BindingFlags.NonPublic); if (!(field != null) || !(bool)field.GetValue(bigDoor)) { targetedDoor = ((Component)bigDoor).gameObject; ProcessDoorMelting(((NetworkBehaviour)bigDoor).NetworkObjectId, bigDoorMeltTime, flag3, delegate { bigDoor.SetDoorOpenServerRpc(true); }); val2 = val4; flag = true; if (enableDebugTracers && flag3) { CreateDebugBurnMark(val4, ((RaycastHit)(ref val3)).normal, ((RaycastHit)(ref val3)).transform); } break; } if (((RaycastHit)(ref val3)).collider.isTrigger) { continue; } val2 = val4; flag = true; if (enableDebugTracers && flag3) { CreateDebugBurnMark(val4, ((RaycastHit)(ref val3)).normal, ((RaycastHit)(ref val3)).transform); } break; } PlayerControllerB val5 = gameObject.GetComponent() ?? gameObject.GetComponentInParent(); if ((Object)(object)val5 != (Object)null) { if (!((Object)(object)val5 != (Object)(object)((GrabbableObject)this).playerHeldBy) || val5.isPlayerDead || val5.health <= 0) { continue; } if (flag3 && !TryDamageBugsOnPlayer(val5, Mathf.Max(1, Plugin.laseremitterpistolMonsterDamage), forward) && ((NetworkBehaviour)this).IsOwner) { val5.DamagePlayerFromOtherClientServerRpc(Plugin.laseremitterpistolPlayerDamage, forward * 10f, (int)((GrabbableObject)this).playerHeldBy.playerClientId); } val2 = val4; flag = true; if (enableDebugTracers && flag3) { CreateDebugVisualsSphere(val4, num3, Color.blue); } break; } Landmine val6 = gameObject.GetComponentInParent() ?? gameObject.GetComponentInChildren(); if ((Object)(object)val6 != (Object)null) { if (flag3 && ((NetworkBehaviour)this).IsOwner && !val6.hasExploded) { val6.ExplodeMineServerRpc(); } val2 = val4; flag = true; if (enableDebugTracers && flag3) { CreateDebugVisualsSphere(val4, num3, new Color(1f, 0.5f, 0f)); } break; } if (((Component)((RaycastHit)(ref val3)).collider).TryGetComponent(ref val7)) { EnemyAICollisionDetect component = ((Component)((RaycastHit)(ref val3)).collider).GetComponent(); if (!((Object)(object)component != (Object)null) || !((Object)(object)component.mainScript != (Object)null) || (!component.mainScript.isEnemyDead && component.mainScript.enemyHP > 0 && (!((Object)(object)heldByEnemy != (Object)null) || !((Object)(object)component.mainScript == (Object)(object)heldByEnemy)))) { if (flag3 && ((NetworkBehaviour)this).IsOwner) { val7.Hit(Mathf.Max(1, Plugin.laseremitterpistolMonsterDamage), forward, ((GrabbableObject)this).playerHeldBy, true, -1); } val2 = val4; flag = true; if (enableDebugTracers && flag3) { CreateDebugVisualsSphere(val4, num3, Color.red); } break; } } else { if (((RaycastHit)(ref val3)).collider.isTrigger) { continue; } Vector3 val8 = val4 + forward * (num2 + 0.01f); if (Physics.Linecast(val8, val4, ref val9, num4, (QueryTriggerInteraction)1)) { float num6 = Vector3.Distance(val4, ((RaycastHit)(ref val9)).point); if (num6 < num2) { num2 -= num6; flag2 = true; if (enableDebugTracers && flag3) { CreateDebugBurnMark(((RaycastHit)(ref val9)).point, ((RaycastHit)(ref val9)).normal, ((RaycastHit)(ref val9)).transform); } continue; } } val2 = val4; flag = true; if (enableDebugTracers && flag3) { CreateDebugBurnMark(val4, ((RaycastHit)(ref val3)).normal, ((RaycastHit)(ref val3)).transform); } break; } } if ((Object)(object)laserBeam != (Object)null) { laserBeam.SetPosition(0, position); laserBeam.SetPosition(1, val2); } if (enableDebugTracers && flag3) { Color col = (flag2 ? Color.yellow : Color.green); CreateDebugVisualsLine(position, val2, col); if (flag) { CreateDebugVisualsSphere(val2, num3, Color.yellow); } } if (flag3) { lastDamageTime = Time.time; } } private void ProcessDoorMelting(ulong doorId, float maxTime, bool isTick, Action onComplete) { targetedDoorId = doorId; targetedDoorMaxTime = maxTime; if (!((NetworkBehaviour)this).IsOwner) { return; } if (!doorMeltProgress.ContainsKey(doorId)) { doorMeltProgress[doorId] = 0f; } doorMeltProgress[doorId] += Time.deltaTime; if (isTick) { AddDoorMeltProgressServerRpc(doorId, 0.3f, ((GrabbableObject)this).playerHeldBy.playerClientId); } if (doorMeltProgress[doorId] >= maxTime) { onComplete?.Invoke(); doorMeltProgress[doorId] = 0f; targetedDoor = null; if ((Object)(object)triggerClickSFX != (Object)null) { gunAudio.PlayOneShot(triggerClickSFX, 1f); } } } [ServerRpc(RequireOwnership = false)] public void AddDoorMeltProgressServerRpc(ulong doorId, float amount, ulong senderId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: 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_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_0099: 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_00f6: 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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(829105579u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, doorId); ((FastBufferWriter)(ref val)).WriteValueSafe(ref amount, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val, senderId); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 829105579u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; AddDoorMeltProgressClientRpc(doorId, amount, senderId); } } } [ClientRpc] public void AddDoorMeltProgressClientRpc(ulong doorId, float amount, ulong senderId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: 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_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_0099: 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_00f6: 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.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3451129523u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, doorId); ((FastBufferWriter)(ref val)).WriteValueSafe(ref amount, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val, senderId); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3451129523u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!((Object)(object)GameNetworkManager.Instance.localPlayerController != (Object)null) || GameNetworkManager.Instance.localPlayerController.playerClientId != senderId) { if (!doorMeltProgress.ContainsKey(doorId)) { doorMeltProgress[doorId] = 0f; } doorMeltProgress[doorId] += amount; } } protected void OnGUI() { //IL_02b9: Unknown result type (might be due to invalid IL or missing references) //IL_02cb: Unknown result type (might be due to invalid IL or missing references) //IL_0302: Unknown result type (might be due to invalid IL or missing references) //IL_0328: 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_035c: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Expected O, but got Unknown //IL_039e: Unknown result type (might be due to invalid IL or missing references) //IL_03b0: 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) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Expected O, but got Unknown //IL_01b5: 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_01d9: Expected O, but got Unknown //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Expected O, but got Unknown //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Unknown result type (might be due to invalid IL or missing references) if (!isFiringBeam || !((Object)(object)targetedDoor != (Object)null) || !((NetworkBehaviour)this).IsOwner || !((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null) || !((Object)(object)((GrabbableObject)this).playerHeldBy == (Object)(object)GameNetworkManager.Instance.localPlayerController)) { return; } float num = (doorMeltProgress.ContainsKey(targetedDoorId) ? doorMeltProgress[targetedDoorId] : 0f); float num2 = Mathf.Clamp01(num / targetedDoorMaxTime); if (breachTextStyle == null) { breachTextStyle = new GUIStyle(); Font val = null; Font[] array = Resources.FindObjectsOfTypeAll(); foreach (Font val2 in array) { if (((Object)val2).name.Contains("3270") || ((Object)val2).name.Contains("brawl") || ((Object)val2).name.ToLower().Contains("pixel")) { val = val2; break; } } breachTextStyle.font = (((Object)(object)val != (Object)null) ? val : Resources.GetBuiltinResource("Arial.ttf")); breachTextStyle.alignment = (TextAnchor)4; breachTextStyle.fontSize = 52; breachTextStyle.fontStyle = (FontStyle)1; breachTextStyle.normal.textColor = new Color(0f, 0.9f, 1f, 0.7f); breachBgTexture = new Texture2D(1, 1); breachBgTexture.SetPixel(0, 0, new Color(0f, 0.1f, 0.25f, 0.25f)); breachBgTexture.Apply(); breachProgressTexture = new Texture2D(1, 1); breachProgressTexture.SetPixel(0, 0, new Color(0f, 0.5f, 1f, 0.4f)); breachProgressTexture.Apply(); breachLineTexture = new Texture2D(1, 2); breachLineTexture.SetPixel(0, 0, new Color(0f, 0f, 0f, 0.15f)); breachLineTexture.SetPixel(0, 1, new Color(0f, 0f, 0f, 0f)); ((Texture)breachLineTexture).filterMode = (FilterMode)0; ((Texture)breachLineTexture).wrapMode = (TextureWrapMode)0; breachLineTexture.Apply(); } float num3 = 900f; float num4 = 100f; float num5 = ((float)Screen.width - num3) / 2f; float num6 = (float)Screen.height - 450f; GUI.color = Color.white; GUI.DrawTexture(new Rect(num5, num6, num3, num4), (Texture)(object)breachBgTexture, (ScaleMode)0); float num7 = (num3 - 10f) * num2; GUI.DrawTexture(new Rect(num5 + 5f, num6 + 5f, num7, num4 - 10f), (Texture)(object)breachProgressTexture, (ScaleMode)0); GUI.color = new Color(1f, 1f, 1f, 0.4f); GUI.DrawTextureWithTexCoords(new Rect(num5, num6, num3, num4), (Texture)(object)breachLineTexture, new Rect(0f, 0f, 1f, num4 / 4f)); string text = (Plugin.translateRussian ? $"ПЛАВКА... {num2 * 100f:F0}%" : $"MELTING... {num2 * 100f:F0}%"); GUI.color = Color.white; GUI.Label(new Rect(num5, num6, num3, num4), text, breachTextStyle); } private void CreateDebugVisualsLine(Vector3 start, Vector3 end, Color col) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_002d: 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_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Expected O, but got Unknown //IL_0056: 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) GameObject val = new GameObject("DebugLaserLine"); LineRenderer val2 = val.AddComponent(); val2.startWidth = 0.01f; val2.endWidth = 0.01f; val2.SetPosition(0, start); val2.SetPosition(1, end); Material material = new Material(Shader.Find("Sprites/Default")); ((Renderer)val2).material = material; val2.startColor = col; val2.endColor = col; Object.Destroy((Object)(object)val, 2f); } private void CreateDebugVisualsSphere(Vector3 pos, float radius, Color col) { //IL_002d: 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_0046: 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_0077: Expected O, but got Unknown //IL_0086: Unknown result type (might be due to invalid IL or missing references) GameObject val = GameObject.CreatePrimitive((PrimitiveType)0); ((Object)val).name = "DebugHitSphere"; Collider val2 = default(Collider); if (val.TryGetComponent(ref val2)) { Object.Destroy((Object)(object)val2); } val.transform.position = pos; val.transform.localScale = Vector3.one * (radius * 2f); Renderer component = val.GetComponent(); if ((Object)(object)component != (Object)null) { Material material = new Material(Shader.Find("Sprites/Default")); component.material = material; component.material.color = col; } Object.Destroy((Object)(object)val, 2f); } private void CreateDebugBurnMark(Vector3 point, Vector3 normal, Transform parent) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_004e: 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_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_0070: 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_00a1: Expected O, but got Unknown //IL_00b7: Unknown result type (might be due to invalid IL or missing references) GameObject val = GameObject.CreatePrimitive((PrimitiveType)2); ((Object)val).name = "DebugBurnMark"; Collider val2 = default(Collider); if (val.TryGetComponent(ref val2)) { Object.Destroy((Object)(object)val2); } val.transform.localScale = new Vector3(0.5f, 0.005f, 0.5f); val.transform.position = point + normal * 0.02f; val.transform.rotation = Quaternion.FromToRotation(Vector3.up, normal); Renderer component = val.GetComponent(); if ((Object)(object)component != (Object)null) { Material val3 = new Material(Shader.Find("Sprites/Default")); val3.color = new Color(0f, 0.8f, 1f, 0.5f); component.material = val3; } if ((Object)(object)parent != (Object)null) { val.transform.SetParent(parent, true); } Object.Destroy((Object)(object)val, 10f); } [ClientRpc] public void PlayDischargeBeepClientRpc() { //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) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(344901897u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 344901897u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if ((Object)(object)gunAudio != (Object)null && (Object)(object)dischargedBeepSFX != (Object)null) { gunAudio.PlayOneShot(dischargedBeepSFX); } } } private void ForceStopFiring() { if ((Object)(object)gunAnimator != (Object)null && gunAnimator.GetBool("Shooting")) { gunAnimator.SetBool("Shooting", false); } if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null && (Object)(object)((GrabbableObject)this).playerHeldBy.playerBodyAnimator != (Object)null && ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.GetBool("LasEmitShoot")) { ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.SetBool("LasEmitShoot", false); } if (isFiringBeam) { SetFiringStateAndSync(fire: false); } } private void TriggerOverheat() { isOverheated = true; if ((Object)(object)overheatSFX != (Object)null) { gunAudio.PlayOneShot(overheatSFX, shootVolume * 0.75f); } TriggerOverheatServerRpc(); if (overheatAnimCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(overheatAnimCoroutine); } overheatAnimCoroutine = ((MonoBehaviour)this).StartCoroutine(OverheatReactionRoutine()); } [ServerRpc(RequireOwnership = false)] public void TriggerOverheatServerRpc() { //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)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(852786256u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 852786256u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; TriggerOverheatClientRpc(); } } } [ClientRpc] public void TriggerOverheatClientRpc() { //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) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1952551797u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1952551797u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsOwner) { isOverheated = true; if ((Object)(object)overheatSFX != (Object)null) { gunAudio.PlayOneShot(overheatSFX, shootVolume * 0.75f); } if (overheatAnimCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(overheatAnimCoroutine); } overheatAnimCoroutine = ((MonoBehaviour)this).StartCoroutine(OverheatReactionRoutine()); } } private void ProcessOverheatSystem() { if (currentHeatLevel <= 0f) { if ((Object)(object)hissAudioSource != (Object)null && hissAudioSource.isPlaying) { hissAudioSource.Stop(); } return; } if (!isFiringBeam) { float num = (isOverheated ? overheatCoolingRate : coolingRate); currentHeatLevel -= num * Time.deltaTime; } if ((Object)(object)hissAudioSource != (Object)null && (Object)(object)gunHissLoopSFX != (Object)null) { if (!hissAudioSource.isPlaying) { hissAudioSource.Play(); } float num2 = (isOverheated ? Mathf.Clamp01(currentHeatLevel / 100f) : Mathf.Clamp01((currentHeatLevel - 20f) / 80f)); hissAudioSource.volume = num2 * maxHissVolume; hissAudioSource.pitch = 0.8f + num2 * 0.4f; } if (currentHeatLevel <= 0f) { currentHeatLevel = 0f; if (isOverheated) { isOverheated = false; Plugin.mls.LogInfo((object)"Эмиттер полностью остыл, блокировка снята!"); } if ((Object)(object)hissAudioSource != (Object)null && hissAudioSource.isPlaying) { hissAudioSource.Stop(); } } } private IEnumerator OverheatReactionRoutine() { isPlayingOverheatAnim = true; cantFire = true; if (isAiming) { SetAim(aiming: false); } if (isInspectingHold || isInspectingToggle) { isInspectingHold = false; isInspectingToggle = false; if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null && (Object)(object)((GrabbableObject)this).playerHeldBy.playerBodyAnimator != (Object)null) { ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.SetBool("LaspistInspectToggle", false); } } if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null && (Object)(object)((GrabbableObject)this).playerHeldBy.playerBodyAnimator != (Object)null) { ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.SetTrigger("LaspistOverheat"); } if ((Object)(object)gunAnimator != (Object)null) { gunAnimator.SetTrigger("OverheatTrigger"); } if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null && (Object)(object)((GrabbableObject)this).playerHeldBy == (Object)(object)GameNetworkManager.Instance.localPlayerController) { ((GrabbableObject)this).playerHeldBy.isGrabbingObjectAnimation = true; } yield return (object)new WaitForSeconds(5f); isPlayingOverheatAnim = false; cantFire = false; if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null && (Object)(object)((GrabbableObject)this).playerHeldBy == (Object)(object)GameNetworkManager.Instance.localPlayerController) { ((GrabbableObject)this).playerHeldBy.isGrabbingObjectAnimation = false; } overheatAnimCoroutine = null; } private void HandleSafetyInput() { if (Plugin.InputActionInstance.WeaponFireModeKey.IsPressed()) { if (!eWasPressed) { ePressTime = Time.time; eWasPressed = true; safetyHoldCompleted = false; } else if (!safetyHoldCompleted && Time.time - ePressTime >= 0.5f) { if (!isReloading && !isSwitchingMode && !isFiringBeam && !cantFire && !isLoading && !isUnloading && CanPerformAction(ActionType.Other)) { ToggleSafetyAndSync(); } safetyHoldCompleted = true; } } else { eWasPressed = false; safetyHoldCompleted = false; } } private void HandleInspectInput() { if (!((GrabbableObject)this).isHeld || (Object)(object)((GrabbableObject)this).playerHeldBy == (Object)null || (Object)(object)((GrabbableObject)this).playerHeldBy != (Object)(object)GameNetworkManager.Instance.localPlayerController || (!isInspectingToggle && !CanPerformAction(ActionType.Inspect))) { return; } bool flag = Plugin.InputActionInstance.InspectKey.IsPressed(); if (flag && !qWasPressed) { qPressTime = Time.time; qWasPressed = true; } else if (!flag && qWasPressed && Time.time - qPressTime < 0.5f && !isInspectingHold) { if (!isReloading && !isSwitchingMode && !isInspectingHold) { ToggleInspectAndSync(); } qWasPressed = false; } else if (flag && qWasPressed && Time.time - qPressTime >= 0.5f && !isInspectingHold) { if (!isReloading && !isSwitchingMode && !isInspectingToggle) { HoldInspectAndSync(); qWasPressed = false; } } else if (!flag && qWasPressed) { qWasPressed = false; } } private void HandleReloadInput() { if (!CanPerformAction(ActionType.Inspect) || isInspectingToggle || isInspectingHold) { return; } if (Plugin.InputActionInstance.WeaponReloadKey.IsPressed()) { if (!rWasPressed) { rPressTime = Time.time; rWasPressed = true; reloadHoldCompleted = false; } else if (!reloadHoldCompleted && Time.time - rPressTime >= 0.5f && isLoaded && !isLoading && !isUnloading && !isReloading) { SetFiringStateAndSync(fire: false); UnloadingBatteryAction(); reloadHoldCompleted = true; } } else { if (!rWasPressed) { return; } if (!reloadHoldCompleted && !isLoading && !isUnloading && !isReloading) { SetFiringStateAndSync(fire: false); if (!isLoaded) { LoadingBatteryAction(); } else { TryReloadingBattery(); } } rWasPressed = false; reloadHoldCompleted = false; } } private void HandleAimInput() { if (isReloading || isSwitchingMode || isLoading || isUnloading || ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null && ((GrabbableObject)this).playerHeldBy.isSprinting)) { if (isAiming) { SetAim(aiming: false); lastAction = ActionType.Aim; stopActionTime = Time.time; } return; } bool flag = Plugin.InputActionInstance.WeaponAimKey.IsPressed(); if (flag && !isAiming) { if (!isFiringBeam && (!((Object)(object)gunAnimator != (Object)null) || !gunAnimator.GetBool("Shooting")) && CanPerformAction(ActionType.Aim)) { SetAim(aiming: true); } } else if (!flag && isAiming) { SetAim(aiming: false); lastAction = ActionType.Aim; stopActionTime = Time.time; } } private void LoadingBatteryAction() { int num = FindBestBatteryInInventory(); if (num != -1) { ((MonoBehaviour)this).StartCoroutine(LoadingBatteryAnimation(num)); } } private IEnumerator LoadingBatteryAnimation(int slot) { isLoading = true; cantFire = true; Transform rig = ((Component)this).transform.GetChild(1); if ((Object)(object)((GrabbableObject)this).playerHeldBy?.playerBodyAnimator != (Object)null) { ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.SetTrigger("LaspistInsertBattery"); } if ((Object)(object)gunAnimator != (Object)null) { gunAnimator.SetTrigger("LoadTrigger"); } gunAudio.PlayOneShot(batteryInsertSFX); if ((Object)(object)laserCellInPistolMesh != (Object)null) { ((Renderer)laserCellInPistolMesh).enabled = false; } if ((Object)(object)laserCellInHandMesh != (Object)null) { ((Renderer)laserCellInHandMesh).enabled = false; } StartLoadingAnimServerRpc(); yield return (object)new WaitForSeconds(53f / 60f); AttachBatteryToHand(((GrabbableObject)this).playerHeldBy); yield return (object)new WaitForSeconds(1.05f); if ((Object)(object)laserCellInPistolMesh != (Object)null) { ((Renderer)laserCellInPistolMesh).enabled = true; } if ((Object)(object)laserCellInHandMesh != (Object)null) { ((Renderer)laserCellInHandMesh).enabled = false; } yield return (object)new WaitForSeconds(1.8f); if ((Object)(object)laserCellInHandMesh != (Object)null) { ((Component)laserCellInHandMesh).transform.SetParent(rig); ((Component)laserCellInHandMesh).transform.localPosition = Vector3.zero; } LoadingBatteryServerRpc(slot); isLoading = false; cantFire = false; } [ServerRpc(RequireOwnership = false)] public void LoadingBatteryServerRpc(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_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)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2638102597u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, slot); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2638102597u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!isLoaded) { PlayerControllerB playerHeldBy = ((GrabbableObject)this).playerHeldBy; if (!((Object)(object)playerHeldBy == (Object)null) && playerHeldBy.ItemSlots[slot] is HAI_LaserCellItem { currentBatteryCharge: var newCharge }) { playerHeldBy.DestroyItemInSlot(slot); playerHeldBy.DestroyItemInSlotClientRpc(slot); LoadingBatteryClientRpc(newCharge); } } } [ClientRpc] public void LoadingBatteryClientRpc(float newCharge) { //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) //IL_00dc: 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.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3158490646u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref newCharge, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3158490646u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; currentBatteryCharge = newCharge; isLoaded = true; isLoading = false; cantFire = false; if ((Object)(object)laserCellInPistolMesh != (Object)null) { ((Renderer)laserCellInPistolMesh).enabled = true; } if (currentBatteryCharge < energyCostPerSecond && (Object)(object)gunAudio != (Object)null && (Object)(object)dischargedBeepSFX != (Object)null) { gunAudio.PlayOneShot(dischargedBeepSFX); } } } [ServerRpc(RequireOwnership = false)] public void StartLoadingAnimServerRpc() { //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)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1077490635u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1077490635u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; StartLoadingAnimClientRpc(); } } } [ClientRpc] public void StartLoadingAnimClientRpc() { //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) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3079963921u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3079963921u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!((GrabbableObject)this).isHeld || !((Object)(object)((GrabbableObject)this).playerHeldBy == (Object)(object)GameNetworkManager.Instance.localPlayerController)) { isLoading = true; if ((Object)(object)((GrabbableObject)this).playerHeldBy?.playerBodyAnimator != (Object)null) { ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.SetTrigger("LaspistInsertBattery"); } if ((Object)(object)gunAnimator != (Object)null) { gunAnimator.SetTrigger("LoadTrigger"); } gunAudio.PlayOneShot(batteryInsertSFX); if ((Object)(object)laserCellInPistolMesh != (Object)null) { ((Renderer)laserCellInPistolMesh).enabled = false; } ((MonoBehaviour)this).StartCoroutine(RemoteClientLoadVisuals()); } } private IEnumerator RemoteClientLoadVisuals() { yield return (object)new WaitForSeconds(53f / 60f); AttachBatteryToHand(((GrabbableObject)this).playerHeldBy); yield return (object)new WaitForSeconds(1.05f); if ((Object)(object)laserCellInHandMesh != (Object)null) { ((Renderer)laserCellInHandMesh).enabled = false; } if ((Object)(object)laserCellInPistolMesh != (Object)null) { ((Renderer)laserCellInPistolMesh).enabled = true; } yield return (object)new WaitForSeconds(1.8f); if ((Object)(object)laserCellInHandMesh != (Object)null) { ((Component)laserCellInHandMesh).transform.SetParent(((Component)this).transform.GetChild(1)); ((Component)laserCellInHandMesh).transform.localPosition = Vector3.zero; } isLoading = false; } private void UnloadingBatteryAction() { ((MonoBehaviour)this).StartCoroutine(UnloadingBatteryAnimation()); } private IEnumerator UnloadingBatteryAnimation() { isUnloading = true; cantFire = true; Transform rig = ((Component)this).transform.GetChild(1); if ((Object)(object)((GrabbableObject)this).playerHeldBy?.playerBodyAnimator != (Object)null) { ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.SetTrigger("LaspistEjectBattery"); } if ((Object)(object)gunAnimator != (Object)null) { gunAnimator.SetTrigger("UnloadTrigger"); } gunAudio.PlayOneShot(batteryEjectSFX); StartUnloadingAnimServerRpc(); yield return (object)new WaitForSeconds(2.4333334f); if ((Object)(object)laserCellInPistolMesh != (Object)null) { ((Renderer)laserCellInPistolMesh).enabled = false; } AttachBatteryToHand(((GrabbableObject)this).playerHeldBy); yield return (object)new WaitForSeconds(0.4f); if ((Object)(object)laserCellInHandMesh != (Object)null) { ((Renderer)laserCellInHandMesh).enabled = false; } UnloadingBatteryServerRpc(); if ((Object)(object)laserCellInHandMesh != (Object)null) { ((Component)laserCellInHandMesh).transform.SetParent(rig); ((Component)laserCellInHandMesh).transform.localPosition = Vector3.zero; ((Component)laserCellInHandMesh).transform.localRotation = Quaternion.identity; ((Component)laserCellInHandMesh).transform.localScale = new Vector3(1.4f, 1.4f, 1.4f); } yield return (object)new WaitForSeconds(0.5f); isUnloading = false; cantFire = false; lastAction = ActionType.Other; stopActionTime = Time.time; } [ServerRpc(RequireOwnership = false)] public void UnloadingBatteryServerRpc() { //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_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: 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_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0165: 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_0174: 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_020d: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: 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) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_0217: 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_02d8: Unknown result type (might be due to invalid IL or missing references) //IL_02e2: Unknown result type (might be due to invalid IL or missing references) //IL_02e7: Unknown result type (might be due to invalid IL or missing references) //IL_02f1: Unknown result type (might be due to invalid IL or missing references) //IL_02f6: Unknown result type (might be due to invalid IL or missing references) //IL_0331: 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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3652648494u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3652648494u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!isLoaded || (Object)(object)((GrabbableObject)this).playerHeldBy == (Object)null) { return; } float newCharge = currentBatteryCharge; currentBatteryCharge = 0f; isLoaded = false; int num = -1; for (int i = 0; i < ((GrabbableObject)this).playerHeldBy.ItemSlots.Length; i++) { if ((Object)(object)((GrabbableObject)this).playerHeldBy.ItemSlots[i] == (Object)null) { num = i; break; } } Vector3 val3; if (num != -1) { val3 = ((Component)((GrabbableObject)this).playerHeldBy).transform.position + Vector3.up * 500f; } else { Vector3 val4 = ((Component)((GrabbableObject)this).playerHeldBy).transform.position + Vector3.up * 1.2f; Vector3 val5 = val4 + ((Component)((GrabbableObject)this).playerHeldBy).transform.forward * 0.5f; RaycastHit val6 = default(RaycastHit); val3 = ((!Physics.Linecast(val4, val5, ref val6, StartOfRound.Instance.collidersAndRoomMaskAndDefault)) ? val5 : (((RaycastHit)(ref val6)).point - ((Component)((GrabbableObject)this).playerHeldBy).transform.forward * 0.05f)); } GameObject val7 = Object.Instantiate(Plugin.lasercellAmmoPrefab, val3, Quaternion.identity); HAI_LaserCellItem component = val7.GetComponent(); component.currentBatteryCharge = newCharge; val7.GetComponent().SpawnWithOwnership(((NetworkBehaviour)((GrabbableObject)this).playerHeldBy).OwnerClientId, false); component.UpdateBatteryChargeClientRpc(newCharge); if (num != -1) { PutBatteryInInventoryClientRpc(NetworkObjectReference.op_Implicit(val7.GetComponent()), num); } else { ((GrabbableObject)component).hasHitGround = false; ((GrabbableObject)component).isHeld = false; ((GrabbableObject)component).grabbable = true; ((GrabbableObject)component).fallTime = 0f; Rigidbody val8 = default(Rigidbody); if (((Component)component).TryGetComponent(ref val8)) { val8.isKinematic = false; val8.useGravity = true; val8.detectCollisions = true; val8.AddForce(((Component)((GrabbableObject)this).playerHeldBy).transform.forward * 4f + Vector3.up * 2f, (ForceMode)1); val8.AddTorque(new Vector3(Random.Range(-5f, 5f), Random.Range(-5f, 5f), Random.Range(-5f, 5f)), (ForceMode)1); } } UnloadingBatteryClientRpc(); } [ClientRpc] public void PutBatteryInInventoryClientRpc(NetworkObjectReference batteryRef, int slotIndex) { //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_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_008c: 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_00e9: 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.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2827028746u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref batteryRef, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val, slotIndex); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2827028746u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); if (((NetworkObjectReference)(ref batteryRef)).TryGet(ref val3, (NetworkManager)null)) { HAI_LaserCellItem component = ((Component)val3).GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null) { ((MonoBehaviour)this).StartCoroutine(DelayedPutInInventory(component, slotIndex)); } } } private IEnumerator DelayedPutInInventory(HAI_LaserCellItem batteryItem, int slotIndex) { yield return null; ((GrabbableObject)batteryItem).playerHeldBy = ((GrabbableObject)this).playerHeldBy; ((GrabbableObject)batteryItem).isHeld = false; ((GrabbableObject)batteryItem).isPocketed = true; ((GrabbableObject)batteryItem).heldByPlayerOnServer = true; ((GrabbableObject)this).playerHeldBy.ItemSlots[slotIndex] = (GrabbableObject)(object)batteryItem; ((GrabbableObject)batteryItem).EnableItemMeshes(false); ((GrabbableObject)batteryItem).EnablePhysics(false); Transform targetHolder = (((GrabbableObject)batteryItem).parentObject = (((Object)(object)((GrabbableObject)this).playerHeldBy == (Object)(object)GameNetworkManager.Instance.localPlayerController) ? ((GrabbableObject)this).playerHeldBy.localItemHolder : ((GrabbableObject)this).playerHeldBy.serverItemHolder)); ((Component)batteryItem).transform.SetParent(targetHolder); ((Component)batteryItem).transform.localPosition = Vector3.zero; ((Component)batteryItem).transform.localRotation = Quaternion.identity; if ((Object)(object)((GrabbableObject)this).playerHeldBy == (Object)(object)GameNetworkManager.Instance.localPlayerController && (Object)(object)HUDManager.Instance != (Object)null && slotIndex < HUDManager.Instance.itemSlotIcons.Length) { HUDManager.Instance.itemSlotIcons[slotIndex].sprite = ((GrabbableObject)batteryItem).itemProperties.itemIcon; ((Behaviour)HUDManager.Instance.itemSlotIcons[slotIndex]).enabled = true; } } [ClientRpc] public void UnloadingBatteryClientRpc() { //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) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3705859992u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3705859992u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; currentBatteryCharge = 0f; isLoaded = false; if ((Object)(object)laserCellInPistolMesh != (Object)null) { ((Renderer)laserCellInPistolMesh).enabled = false; } } } [ServerRpc(RequireOwnership = false)] public void StartUnloadingAnimServerRpc() { //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)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3107097041u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3107097041u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; StartUnloadingAnimClientRpc(); } } } [ClientRpc] public void StartUnloadingAnimClientRpc() { //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) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(817230436u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 817230436u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!((GrabbableObject)this).isHeld || !((Object)(object)((GrabbableObject)this).playerHeldBy == (Object)(object)GameNetworkManager.Instance.localPlayerController)) { isUnloading = true; if ((Object)(object)((GrabbableObject)this).playerHeldBy?.playerBodyAnimator != (Object)null) { ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.SetTrigger("LaspistEjectBattery"); } if ((Object)(object)gunAnimator != (Object)null) { gunAnimator.SetTrigger("UnloadTrigger"); } ((MonoBehaviour)this).StartCoroutine(RemoteClientUnloadVisuals()); } } private IEnumerator RemoteClientUnloadVisuals() { gunAudio.PlayOneShot(batteryEjectSFX); yield return (object)new WaitForSeconds(2.4333334f); if ((Object)(object)laserCellInPistolMesh != (Object)null) { ((Renderer)laserCellInPistolMesh).enabled = false; } AttachBatteryToHand(((GrabbableObject)this).playerHeldBy); yield return (object)new WaitForSeconds(0.4f); if ((Object)(object)laserCellInHandMesh != (Object)null) { ((Renderer)laserCellInHandMesh).enabled = false; } yield return (object)new WaitForSeconds(0.6f); isUnloading = false; } private void TryReloadingBattery() { int num = FindBestBatteryInInventory(); if (num != -1) { ((MonoBehaviour)this).StartCoroutine(ReloadingBatteryAnimation(num)); } } private IEnumerator ReloadingBatteryAnimation(int slot) { isReloading = true; cantFire = true; Transform rig = ((Component)this).transform.GetChild(1); if ((Object)(object)((GrabbableObject)this).playerHeldBy?.playerBodyAnimator != (Object)null) { ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.SetTrigger("LaspistReloadBattery"); } if ((Object)(object)gunAnimator != (Object)null) { gunAnimator.SetTrigger("ReloadTrigger"); } gunAudio.PlayOneShot(batteryEjectSFX); StartReloadingAnimServerRpc(); yield return (object)new WaitForSeconds(2.3833334f); gunAudio.PlayOneShot(batteryInsertSFX); yield return (object)new WaitForSeconds(7f / 60f); if ((Object)(object)laserCellInPistolMesh != (Object)null) { ((Renderer)laserCellInPistolMesh).enabled = false; } AttachBatteryToHand(((GrabbableObject)this).playerHeldBy); yield return (object)new WaitForSeconds(1.8166667f); if ((Object)(object)laserCellInPistolMesh != (Object)null) { ((Renderer)laserCellInPistolMesh).enabled = true; } if ((Object)(object)laserCellInHandMesh != (Object)null) { ((Renderer)laserCellInHandMesh).enabled = false; } SwapBatteryServerRpc(slot); yield return (object)new WaitForSeconds(0.5f); if ((Object)(object)laserCellInHandMesh != (Object)null) { ((Component)laserCellInHandMesh).transform.SetParent(rig); ((Component)laserCellInHandMesh).transform.localPosition = Vector3.zero; } isReloading = false; cantFire = false; lastAction = ActionType.Other; stopActionTime = Time.time; } [ServerRpc(RequireOwnership = false)] public void SwapBatteryServerRpc(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_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)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2900766496u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, slot); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2900766496u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB playerHeldBy = ((GrabbableObject)this).playerHeldBy; if (!((Object)(object)playerHeldBy == (Object)null) && playerHeldBy.ItemSlots[slot] is HAI_LaserCellItem hAI_LaserCellItem) { float newCharge = currentBatteryCharge; float newGunCharge = (currentBatteryCharge = hAI_LaserCellItem.currentBatteryCharge); hAI_LaserCellItem.UpdateBatteryChargeServerRpc(newCharge); SwapBatteryClientRpc(newGunCharge); } } } [ClientRpc] public void SwapBatteryClientRpc(float newGunCharge) { //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) //IL_00dc: 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.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1518497060u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref newGunCharge, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1518497060u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; currentBatteryCharge = newGunCharge; isLoaded = true; if ((Object)(object)laserCellInPistolMesh != (Object)null) { ((Renderer)laserCellInPistolMesh).enabled = true; } if (currentBatteryCharge < energyCostPerSecond && (Object)(object)gunAudio != (Object)null && (Object)(object)dischargedBeepSFX != (Object)null) { gunAudio.PlayOneShot(dischargedBeepSFX); } } } [ServerRpc(RequireOwnership = false)] public void StartReloadingAnimServerRpc() { //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)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1709149110u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1709149110u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; StartReloadingAnimClientRpc(); } } } [ClientRpc] public void StartReloadingAnimClientRpc() { //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) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1656169372u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1656169372u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!((GrabbableObject)this).isHeld || !((Object)(object)((GrabbableObject)this).playerHeldBy == (Object)(object)GameNetworkManager.Instance.localPlayerController)) { isReloading = true; if ((Object)(object)((GrabbableObject)this).playerHeldBy?.playerBodyAnimator != (Object)null) { ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.SetTrigger("LaspistReloadBattery"); } if ((Object)(object)gunAnimator != (Object)null) { gunAnimator.SetTrigger("ReloadTrigger"); } gunAudio.PlayOneShot(batteryEjectSFX); ((MonoBehaviour)this).StartCoroutine(RemoteClientReloadVisuals()); } } private IEnumerator RemoteClientReloadVisuals() { yield return (object)new WaitForSeconds(2.3833334f); gunAudio.PlayOneShot(batteryInsertSFX); yield return (object)new WaitForSeconds(7f / 60f); if ((Object)(object)laserCellInPistolMesh != (Object)null) { ((Renderer)laserCellInPistolMesh).enabled = false; } AttachBatteryToHand(((GrabbableObject)this).playerHeldBy); yield return (object)new WaitForSeconds(1.8166667f); if ((Object)(object)laserCellInPistolMesh != (Object)null) { ((Renderer)laserCellInPistolMesh).enabled = true; } if ((Object)(object)laserCellInHandMesh != (Object)null) { ((Renderer)laserCellInHandMesh).enabled = false; } yield return (object)new WaitForSeconds(0.5f); if ((Object)(object)laserCellInHandMesh != (Object)null) { ((Component)laserCellInHandMesh).transform.SetParent(((Component)this).transform.GetChild(1)); ((Component)laserCellInHandMesh).transform.localPosition = Vector3.zero; } isReloading = false; } private void ToggleSafetyAndSync() { if (!isFiringBeam && !isSwitchingMode && !isReloading && !isLoading && !isUnloading) { bool flag = !isModeSafe; SetSafetyLocal(flag); localClientSendingSafetyRPC = true; ToggleSafetyServerRpc(flag); } } [ServerRpc(RequireOwnership = false)] public void ToggleSafetyServerRpc(bool newMode) { //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) //IL_00dc: 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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2872808221u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref newMode, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2872808221u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ToggleSafetyClientRpc(newMode); } } } [ClientRpc] public void ToggleSafetyClientRpc(bool newMode) { //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) //IL_00dc: 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.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3150214201u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref newMode, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3150214201u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (localClientSendingSafetyRPC) { localClientSendingSafetyRPC = false; } else { SetSafetyLocal(newMode); } } } private void InitializeSafetyState() { if ((Object)(object)gunAnimator != (Object)null && CustomWeaponBase.AnimatorHasParameter(gunAnimator, "SafetyMode")) { gunAnimator.SetBool("SafetyMode", isModeSafe); } if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null && (Object)(object)((GrabbableObject)this).playerHeldBy.playerBodyAnimator != (Object)null) { Animator playerBodyAnimator = ((GrabbableObject)this).playerHeldBy.playerBodyAnimator; if (CustomWeaponBase.AnimatorHasParameter(playerBodyAnimator, "LaspistSafety")) { playerBodyAnimator.SetBool("LaspistSafety", isModeSafe); } } } private void SetSafetyLocal(bool on) { if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null && (Object)(object)((GrabbableObject)this).playerHeldBy.playerBodyAnimator != (Object)null) { Animator playerBodyAnimator = ((GrabbableObject)this).playerHeldBy.playerBodyAnimator; if (CustomWeaponBase.AnimatorHasParameter(playerBodyAnimator, "LaspistSafety")) { playerBodyAnimator.SetBool("LaspistSafety", on); } if (on && CustomWeaponBase.AnimatorHasParameter(playerBodyAnimator, "LaspistSaveOn")) { playerBodyAnimator.SetTrigger("LaspistSaveOn"); } else if (!on && CustomWeaponBase.AnimatorHasParameter(playerBodyAnimator, "LaspistSaveOff")) { playerBodyAnimator.SetTrigger("LaspistSaveOff"); } } ((MonoBehaviour)this).StopCoroutine("SafetyActionCoroutine"); ((MonoBehaviour)this).StartCoroutine(SafetyActionCoroutine(on)); } private IEnumerator SafetyActionCoroutine(bool on) { isSwitchingMode = true; if ((Object)(object)gunAnimator != (Object)null) { gunAnimator.SetBool("SafetyMode", on); } yield return (object)new WaitForSeconds(11f / 12f); isModeSafe = on; if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null) { ((GrabbableObject)this).playerHeldBy.itemAudio.PlayOneShot(modeSwitchSFX); } yield return (object)new WaitForSeconds(1.5f); isSwitchingMode = false; } private void ToggleInspectAndSync() { if (!((Object)(object)((GrabbableObject)this).playerHeldBy == (Object)null)) { isInspectingToggle = !isInspectingToggle; if (!isInspectingToggle) { lastAction = ActionType.Inspect; stopActionTime = Time.time + 0.7f; } else { stopActionTime = Time.time; } ToggleInspect(); localClientSendingInspectToggleRPC = true; ToggleInspectServerRpc(isInspectingToggle); } } [ServerRpc(RequireOwnership = false)] public void ToggleInspectServerRpc(bool inspecting) { //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) //IL_00dc: 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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2706187804u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref inspecting, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2706187804u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ToggleInspectClientRpc(inspecting); } } } [ClientRpc] public void ToggleInspectClientRpc(bool inspecting) { //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) //IL_00dc: 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.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1185022927u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref inspecting, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1185022927u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (localClientSendingInspectToggleRPC) { localClientSendingInspectToggleRPC = false; return; } isInspectingToggle = inspecting; ToggleInspect(); } } private void ToggleInspect() { if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null && (Object)(object)((GrabbableObject)this).playerHeldBy.playerBodyAnimator != (Object)null && (Object)(object)((GrabbableObject)this).playerHeldBy == (Object)(object)GameNetworkManager.Instance.localPlayerController) { ((MonoBehaviour)this).StartCoroutine(ToggleInspectDelay()); ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.SetBool("LaspistInspectToggle", isInspectingToggle); } } private IEnumerator ToggleInspectDelay() { cantFire = true; float delay = (isInspectingToggle ? 0.5f : 1.2f); yield return (object)new WaitForSeconds(delay); cantFire = false; } public void HoldInspectAndSync() { if (!((Object)(object)((GrabbableObject)this).playerHeldBy == (Object)null)) { isInspectingHold = true; HoldInspect(); localClientSendingInspectHoldRPC = true; HoldInspectServerRpc(inspecting: true); } } [ServerRpc(RequireOwnership = false)] public void HoldInspectServerRpc(bool inspecting) { //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) //IL_00dc: 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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2870168595u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref inspecting, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2870168595u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; HoldInspectClientRpc(inspecting); } } } [ClientRpc] public void HoldInspectClientRpc(bool inspecting) { //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) //IL_00dc: 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.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1437644834u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref inspecting, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1437644834u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (localClientSendingInspectHoldRPC) { localClientSendingInspectHoldRPC = false; return; } isInspectingHold = inspecting; HoldInspect(); } } private void HoldInspect() { if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null && (Object)(object)((GrabbableObject)this).playerHeldBy.playerBodyAnimator != (Object)null) { if ((Object)(object)((GrabbableObject)this).playerHeldBy == (Object)(object)GameNetworkManager.Instance.localPlayerController) { ((MonoBehaviour)this).StartCoroutine(HoldInspectDelay()); ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.SetTrigger("LaspistInspect"); } else { ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.Play("A_Laspist_InspectHold", -1, 0f); } } } private IEnumerator HoldInspectDelay() { yield return (object)new WaitForSeconds(6.75f); isInspectingHold = false; isSwitchingMode = false; cantFire = false; lastAction = ActionType.Inspect; stopActionTime = Time.time; } private void SetAim(bool aiming) { isAiming = aiming; if (aiming) { aimStartTime = Time.time; canZoom = false; } else { canZoom = false; } if ((Object)(object)((GrabbableObject)this).playerHeldBy.playerBodyAnimator != (Object)null) { ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.SetBool("LaspistAimToggle", aiming); } localClientSendingAimRPC = true; SetAimServerRpc(aiming); } [ServerRpc(RequireOwnership = false)] public void SetAimServerRpc(bool aiming) { //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) //IL_00dc: 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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(730939142u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref aiming, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 730939142u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SetAimClientRpc(aiming); } } } [ClientRpc] public void SetAimClientRpc(bool aiming) { //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) //IL_00dc: 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.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3947659800u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref aiming, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3947659800u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (localClientSendingAimRPC) { localClientSendingAimRPC = false; return; } isAiming = aiming; if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null && (Object)(object)((GrabbableObject)this).playerHeldBy.playerBodyAnimator != (Object)null) { ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.SetBool("LaspistAimToggle", aiming); } } private void HandleZoom() { if (!((Object)(object)((GrabbableObject)this).playerHeldBy == (Object)null) && !((Object)(object)((GrabbableObject)this).playerHeldBy.gameplayCamera == (Object)null)) { if (isAiming && !canZoom && Time.time - aimStartTime >= zoomDelay) { canZoom = true; } float fieldOfView = ((GrabbableObject)this).playerHeldBy.gameplayCamera.fieldOfView; float num = (canZoom ? zoomFOV : defaultFOV); if (canZoom || !(Mathf.Abs(fieldOfView - defaultFOV) < 0.1f)) { ((GrabbableObject)this).playerHeldBy.gameplayCamera.fieldOfView = Mathf.Lerp(fieldOfView, num, Time.deltaTime * zoomSpeed); } } } private void AttachBatteryToHand(PlayerControllerB player) { //IL_0108: 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_0152: 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_009d: 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) if (!((Object)(object)laserCellInHandMesh == (Object)null) && !((Object)(object)player == (Object)null)) { ((Renderer)laserCellInHandMesh).enabled = true; if ((Object)(object)player == (Object)(object)GameNetworkManager.Instance.localPlayerController) { ((Component)laserCellInHandMesh).transform.SetParent(player.leftHandItemTarget); ((Component)laserCellInHandMesh).transform.localPosition = new Vector3(0.04f, 0.09f, -0.1f); ((Component)laserCellInHandMesh).transform.localEulerAngles = new Vector3(355f, 160f, 60f); ((Component)laserCellInHandMesh).transform.localScale = new Vector3(1.4f, 1.4f, 1.4f); } else { Transform thirdPersonLeftHand = GetThirdPersonLeftHand(player); ((Component)laserCellInHandMesh).transform.SetParent(thirdPersonLeftHand); ((Component)laserCellInHandMesh).transform.localPosition = new Vector3(0f, 0.1f, -0.12f); ((Component)laserCellInHandMesh).transform.localEulerAngles = new Vector3(0f, 180f, 0f); ((Component)laserCellInHandMesh).transform.localScale = new Vector3(1.4f, 1.4f, 1.4f); } } } private Transform GetThirdPersonLeftHand(PlayerControllerB player) { if ((Object)(object)player == (Object)null || (Object)(object)player.playerBodyAnimator == (Object)null) { return null; } Transform val = FindChildRecursive(((Component)player.playerBodyAnimator).transform, "hand.L") ?? FindChildRecursive(((Component)player.playerBodyAnimator).transform, "Hand.L"); if ((Object)(object)val != (Object)null) { return val; } return player.serverItemHolder; } private Transform FindChildRecursive(Transform parent, string name) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown foreach (Transform item in parent) { Transform val = item; if (((Object)val).name == name) { return val; } Transform val2 = FindChildRecursive(val, name); if ((Object)(object)val2 != (Object)null) { return val2; } } return null; } [ServerRpc(RequireOwnership = false)] public void UpdateBatteryChargeServerRpc(float newCharge) { //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) //IL_00dc: 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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(4094774398u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref newCharge, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 4094774398u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; currentBatteryCharge = newCharge; UpdateBatteryChargeClientRpc(newCharge); } } } [ClientRpc] public void UpdateBatteryChargeClientRpc(float newCharge) { //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) //IL_00dc: 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.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(9465211u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref newCharge, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 9465211u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; currentBatteryCharge = newCharge; } } } private int FindBestBatteryInInventory() { int result = -1; float num = -1f; for (int i = 0; i < ((GrabbableObject)this).playerHeldBy.ItemSlots.Length; i++) { if (((GrabbableObject)this).playerHeldBy.ItemSlots[i] is HAI_LaserCellItem hAI_LaserCellItem && hAI_LaserCellItem.currentBatteryCharge > num) { num = hAI_LaserCellItem.currentBatteryCharge; result = i; } } return result; } private void ResetInteractionState() { //IL_01a5: Unknown result type (might be due to invalid IL or missing references) ((MonoBehaviour)this).StopAllCoroutines(); isReloading = false; isLoading = false; isUnloading = false; isSwitchingMode = false; cantFire = false; isFiringBeam = false; isInspectingToggle = false; isInspectingHold = false; if ((Object)(object)gunAnimator != (Object)null) { gunAnimator.ResetTrigger("LoadTrigger"); gunAnimator.ResetTrigger("UnloadTrigger"); gunAnimator.Rebind(); gunAnimator.SetBool("SafetyMode", isModeSafe); gunAnimator.SetBool("Shooting", false); } if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null && (Object)(object)((GrabbableObject)this).playerHeldBy.playerBodyAnimator != (Object)null) { ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.SetBool("LasEmitShoot", false); } if ((Object)(object)gunAudio != (Object)null) { gunAudio.Stop(); } if ((Object)(object)loopAudioSource != (Object)null) { loopAudioSource.Stop(); currentLoopVolume = 0f; } if ((Object)(object)laserBeam != (Object)null) { ((Renderer)laserBeam).enabled = false; } if ((Object)(object)laserCellInPistolMesh != (Object)null) { ((Renderer)laserCellInPistolMesh).enabled = isLoaded; } if ((Object)(object)laserCellInHandMesh != (Object)null) { ((Component)laserCellInHandMesh).transform.SetParent(((Component)this).transform); ((Component)laserCellInHandMesh).transform.localPosition = Vector3.zero; ((Renderer)laserCellInHandMesh).enabled = false; } } private bool TryDamageBugsOnPlayer(PlayerControllerB player, int damage, Vector3 direction) { bool result = false; CentipedeAI[] array = Object.FindObjectsByType((FindObjectsSortMode)0); CentipedeAI[] array2 = array; foreach (CentipedeAI val in array2) { if ((Object)(object)val.clingingToPlayer == (Object)(object)player) { if (((NetworkBehaviour)this).IsOwner) { ((EnemyAI)val).HitEnemy(damage, ((GrabbableObject)this).playerHeldBy, true, -1); } result = true; } } FlowerSnakeEnemy[] array3 = Object.FindObjectsByType((FindObjectsSortMode)0); FlowerSnakeEnemy[] array4 = array3; foreach (FlowerSnakeEnemy val2 in array4) { if ((Object)(object)val2.clingingToPlayer == (Object)(object)player) { if (((NetworkBehaviour)this).IsOwner) { ((EnemyAI)val2).HitEnemy(damage, ((GrabbableObject)this).playerHeldBy, true, -1); } result = true; } } return result; } protected override void __initializeVariables() { base.__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 //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Expected O, but got Unknown //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Expected O, but got Unknown //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Expected O, but got Unknown //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Expected O, but got Unknown //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Expected O, but got Unknown //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Expected O, but got Unknown //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Expected O, but got Unknown //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Expected O, but got Unknown //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Expected O, but got Unknown //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Expected O, but got Unknown //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Expected O, but got Unknown //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Expected O, but got Unknown //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Expected O, but got Unknown //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Expected O, but got Unknown //IL_0291: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Expected O, but got Unknown //IL_02ad: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: Expected O, but got Unknown //IL_02c9: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: Expected O, but got Unknown //IL_02e5: Unknown result type (might be due to invalid IL or missing references) //IL_02f4: Expected O, but got Unknown //IL_0301: Unknown result type (might be due to invalid IL or missing references) //IL_0310: Expected O, but got Unknown //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_032c: Expected O, but got Unknown //IL_0339: Unknown result type (might be due to invalid IL or missing references) //IL_0348: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1831832056u, new RpcReceiveHandler(__rpc_handler_1831832056), "SetFiringStateServerRpc"); ((NetworkBehaviour)this).__registerRpc(2224198530u, new RpcReceiveHandler(__rpc_handler_2224198530), "SetFiringStateClientRpc"); ((NetworkBehaviour)this).__registerRpc(829105579u, new RpcReceiveHandler(__rpc_handler_829105579), "AddDoorMeltProgressServerRpc"); ((NetworkBehaviour)this).__registerRpc(3451129523u, new RpcReceiveHandler(__rpc_handler_3451129523), "AddDoorMeltProgressClientRpc"); ((NetworkBehaviour)this).__registerRpc(344901897u, new RpcReceiveHandler(__rpc_handler_344901897), "PlayDischargeBeepClientRpc"); ((NetworkBehaviour)this).__registerRpc(852786256u, new RpcReceiveHandler(__rpc_handler_852786256), "TriggerOverheatServerRpc"); ((NetworkBehaviour)this).__registerRpc(1952551797u, new RpcReceiveHandler(__rpc_handler_1952551797), "TriggerOverheatClientRpc"); ((NetworkBehaviour)this).__registerRpc(2638102597u, new RpcReceiveHandler(__rpc_handler_2638102597), "LoadingBatteryServerRpc"); ((NetworkBehaviour)this).__registerRpc(3158490646u, new RpcReceiveHandler(__rpc_handler_3158490646), "LoadingBatteryClientRpc"); ((NetworkBehaviour)this).__registerRpc(1077490635u, new RpcReceiveHandler(__rpc_handler_1077490635), "StartLoadingAnimServerRpc"); ((NetworkBehaviour)this).__registerRpc(3079963921u, new RpcReceiveHandler(__rpc_handler_3079963921), "StartLoadingAnimClientRpc"); ((NetworkBehaviour)this).__registerRpc(3652648494u, new RpcReceiveHandler(__rpc_handler_3652648494), "UnloadingBatteryServerRpc"); ((NetworkBehaviour)this).__registerRpc(2827028746u, new RpcReceiveHandler(__rpc_handler_2827028746), "PutBatteryInInventoryClientRpc"); ((NetworkBehaviour)this).__registerRpc(3705859992u, new RpcReceiveHandler(__rpc_handler_3705859992), "UnloadingBatteryClientRpc"); ((NetworkBehaviour)this).__registerRpc(3107097041u, new RpcReceiveHandler(__rpc_handler_3107097041), "StartUnloadingAnimServerRpc"); ((NetworkBehaviour)this).__registerRpc(817230436u, new RpcReceiveHandler(__rpc_handler_817230436), "StartUnloadingAnimClientRpc"); ((NetworkBehaviour)this).__registerRpc(2900766496u, new RpcReceiveHandler(__rpc_handler_2900766496), "SwapBatteryServerRpc"); ((NetworkBehaviour)this).__registerRpc(1518497060u, new RpcReceiveHandler(__rpc_handler_1518497060), "SwapBatteryClientRpc"); ((NetworkBehaviour)this).__registerRpc(1709149110u, new RpcReceiveHandler(__rpc_handler_1709149110), "StartReloadingAnimServerRpc"); ((NetworkBehaviour)this).__registerRpc(1656169372u, new RpcReceiveHandler(__rpc_handler_1656169372), "StartReloadingAnimClientRpc"); ((NetworkBehaviour)this).__registerRpc(2872808221u, new RpcReceiveHandler(__rpc_handler_2872808221), "ToggleSafetyServerRpc"); ((NetworkBehaviour)this).__registerRpc(3150214201u, new RpcReceiveHandler(__rpc_handler_3150214201), "ToggleSafetyClientRpc"); ((NetworkBehaviour)this).__registerRpc(2706187804u, new RpcReceiveHandler(__rpc_handler_2706187804), "ToggleInspectServerRpc"); ((NetworkBehaviour)this).__registerRpc(1185022927u, new RpcReceiveHandler(__rpc_handler_1185022927), "ToggleInspectClientRpc"); ((NetworkBehaviour)this).__registerRpc(2870168595u, new RpcReceiveHandler(__rpc_handler_2870168595), "HoldInspectServerRpc"); ((NetworkBehaviour)this).__registerRpc(1437644834u, new RpcReceiveHandler(__rpc_handler_1437644834), "HoldInspectClientRpc"); ((NetworkBehaviour)this).__registerRpc(730939142u, new RpcReceiveHandler(__rpc_handler_730939142), "SetAimServerRpc"); ((NetworkBehaviour)this).__registerRpc(3947659800u, new RpcReceiveHandler(__rpc_handler_3947659800), "SetAimClientRpc"); ((NetworkBehaviour)this).__registerRpc(4094774398u, new RpcReceiveHandler(__rpc_handler_4094774398), "UpdateBatteryChargeServerRpc"); ((NetworkBehaviour)this).__registerRpc(9465211u, new RpcReceiveHandler(__rpc_handler_9465211), "UpdateBatteryChargeClientRpc"); base.__initializeRpcs(); } private static void __rpc_handler_1831832056(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 firingStateServerRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref firingStateServerRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((HAI_LaserEmitterItem)(object)target).SetFiringStateServerRpc(firingStateServerRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2224198530(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 firingStateClientRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref firingStateClientRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((HAI_LaserEmitterItem)(object)target).SetFiringStateClientRpc(firingStateClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_829105579(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: 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_0042: 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_005e: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong doorId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref doorId); float amount = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref amount, default(ForPrimitives)); ulong senderId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref senderId); target.__rpc_exec_stage = (__RpcExecStage)1; ((HAI_LaserEmitterItem)(object)target).AddDoorMeltProgressServerRpc(doorId, amount, senderId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3451129523(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: 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_0042: 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_005e: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong doorId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref doorId); float amount = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref amount, default(ForPrimitives)); ulong senderId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref senderId); target.__rpc_exec_stage = (__RpcExecStage)1; ((HAI_LaserEmitterItem)(object)target).AddDoorMeltProgressClientRpc(doorId, amount, senderId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_344901897(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; ((HAI_LaserEmitterItem)(object)target).PlayDischargeBeepClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_852786256(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; ((HAI_LaserEmitterItem)(object)target).TriggerOverheatServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1952551797(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; ((HAI_LaserEmitterItem)(object)target).TriggerOverheatClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2638102597(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)1; ((HAI_LaserEmitterItem)(object)target).LoadingBatteryServerRpc(slot); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3158490646(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) { float newCharge = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref newCharge, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((HAI_LaserEmitterItem)(object)target).LoadingBatteryClientRpc(newCharge); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1077490635(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; ((HAI_LaserEmitterItem)(object)target).StartLoadingAnimServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3079963921(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; ((HAI_LaserEmitterItem)(object)target).StartLoadingAnimClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3652648494(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; ((HAI_LaserEmitterItem)(object)target).UnloadingBatteryServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2827028746(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_003e: 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_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference batteryRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref batteryRef, default(ForNetworkSerializable)); int slotIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref slotIndex); target.__rpc_exec_stage = (__RpcExecStage)1; ((HAI_LaserEmitterItem)(object)target).PutBatteryInInventoryClientRpc(batteryRef, slotIndex); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3705859992(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; ((HAI_LaserEmitterItem)(object)target).UnloadingBatteryClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3107097041(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; ((HAI_LaserEmitterItem)(object)target).StartUnloadingAnimServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_817230436(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; ((HAI_LaserEmitterItem)(object)target).StartUnloadingAnimClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2900766496(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)1; ((HAI_LaserEmitterItem)(object)target).SwapBatteryServerRpc(slot); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1518497060(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) { float newGunCharge = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref newGunCharge, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((HAI_LaserEmitterItem)(object)target).SwapBatteryClientRpc(newGunCharge); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1709149110(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; ((HAI_LaserEmitterItem)(object)target).StartReloadingAnimServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1656169372(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; ((HAI_LaserEmitterItem)(object)target).StartReloadingAnimClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2872808221(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 newMode = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref newMode, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((HAI_LaserEmitterItem)(object)target).ToggleSafetyServerRpc(newMode); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3150214201(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 newMode = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref newMode, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((HAI_LaserEmitterItem)(object)target).ToggleSafetyClientRpc(newMode); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2706187804(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 inspecting = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref inspecting, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((HAI_LaserEmitterItem)(object)target).ToggleInspectServerRpc(inspecting); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1185022927(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 inspecting = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref inspecting, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((HAI_LaserEmitterItem)(object)target).ToggleInspectClientRpc(inspecting); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2870168595(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 inspecting = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref inspecting, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((HAI_LaserEmitterItem)(object)target).HoldInspectServerRpc(inspecting); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1437644834(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 inspecting = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref inspecting, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((HAI_LaserEmitterItem)(object)target).HoldInspectClientRpc(inspecting); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_730939142(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 aimServerRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref aimServerRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((HAI_LaserEmitterItem)(object)target).SetAimServerRpc(aimServerRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3947659800(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 aimClientRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref aimClientRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((HAI_LaserEmitterItem)(object)target).SetAimClientRpc(aimClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4094774398(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) { float newCharge = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref newCharge, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((HAI_LaserEmitterItem)(object)target).UpdateBatteryChargeServerRpc(newCharge); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_9465211(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) { float newCharge = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref newCharge, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((HAI_LaserEmitterItem)(object)target).UpdateBatteryChargeClientRpc(newCharge); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "HAI_LaserEmitterItem"; } } public class HAI_LaserPistolItem : CustomWeaponBase { private enum ActionType { None, Aim, Inspect, Other } [Header("Configuration")] public bool enableDebugTracers = false; public bool enablePositionDebug = false; public int gunCompatibleAmmoID = 1000; public float energyCostPerShot = 3.3f; public float triggerVolume = 0.2f; public float shootVolume = 3f; public float maxHissVolume = 1f; [Header("Heat System")] public float heatPerShot = 14.5f; public float coolingRate = 25f; public float overheatCoolingRate = 5f; public float heatWarningThreshold = 80f; [Header("Positioning Offsets")] private Vector3 firstPersonPos = new Vector3(0.125f, 0.109f, -0.016f); private Vector3 firstPersonRot = new Vector3(8.257f, 17.169f, -85.342f); private Vector3 thirdPersonPos = new Vector3(0.143f, 0.076f, 0.033f); private Vector3 thirdPersonRot = new Vector3(8.257f, 2.362f, -85.342f); [Header("States")] public bool isLoaded = false; public bool isLoading; public bool isUnloading; public bool isReloading; public bool isSwitchingMode; public bool cantFire; public bool isOverheated; public bool isModeSafe = true; public bool isFiring = false; public bool isInspectingToggle = false; public bool isInspectingHold = false; private Coroutine safetyLockCoroutine; private ScanNodeProperties scanNode; private bool scanNodeInitialized = false; public float currentBatteryCharge = 0f; public float currentHeatLevel = 0f; [Header("Aiming")] public bool isAiming = false; public float zoomDelay = 0.5f; private float aimStartTime = 0f; private bool localClientSendingAimRPC = false; private bool canZoom = false; [Header("Overheat State")] public bool isPlayingOverheatAnim = false; private Coroutine overheatAnimCoroutine; [Header("Components")] public Animator gunAnimator; public AudioSource gunAudio; public AudioSource laserBeamAudioSource; private AudioSource hissAudioSource; public Transform gunRayPoint; public MeshRenderer laserCellInPistolMesh; public MeshRenderer laserCellInHandMesh; [Header("Audio Clips")] public List gunShootSFX = new List(); public AudioClip batteryInsertSFX; public AudioClip batteryEjectSFX; public AudioClip modeSwitchSFX; public AudioClip TriggerClickSFX; public AudioClip overheatSFX; public AudioClip overheatBeepSFX; public AudioClip gunHissLoopSFX; public AudioClip dischargedBeepSFX; public AudioClip laserBeamLoopClip; [Header("Visuals")] public Renderer[] gunBodyRenderers; private Material[] gunMaterials; private Light heatPointLight; public ParticleSystem heatHazeParticles; public ParticleSystem overheatSparks; public ParticleSystem heatSteam1Particles; public ParticleSystem heatSteam2Particles; public LineRenderer laserBeamVFX; public GameObject frontMuzzleFlash; public GameObject sideMuzzleFlash; private bool reloadHoldCompleted = false; private bool safetyHoldCompleted = false; private EnemyAI heldByEnemy; private bool localClientSendingShootRPC; private bool localClientSendingSafetyRPC = false; private bool localClientSendingInspectToggleRPC = false; private bool localClientSendingInspectHoldRPC = false; private PlayerControllerB previousPlayerHeldBy; private RaycastHit[] hitColliders = (RaycastHit[])(object)new RaycastHit[10]; private float qPressTime = 0f; private bool qWasPressed = false; private float rPressTime = 0f; private bool rWasPressed = false; private float ePressTime = 0f; private bool eWasPressed = false; private const float HOLD_THRESHOLD = 0.5f; private const float ACTION_COOLDOWN = 0.5f; private float stopActionTime = 0f; private float lastBeepTime = 0f; private ActionType lastAction = ActionType.None; private float defaultFOV = 66f; private float zoomFOV = 50f; private float zoomSpeed = 15f; protected override RuntimeAnimatorController CustomPlayerAnimator => Plugin.playerAnimator; protected override RuntimeAnimatorController CustomOtherPlayerAnimator => Plugin.otherPlayerAnimator; protected override string HoldParameterName => "LaspistHold"; public override void Start() { //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Expected O, but got Unknown ((GrabbableObject)this).Start(); hissAudioSource = ((Component)this).gameObject.AddComponent(); hissAudioSource.spatialBlend = 1f; hissAudioSource.rolloffMode = (AudioRolloffMode)1; hissAudioSource.minDistance = 2f; hissAudioSource.maxDistance = 15f; hissAudioSource.loop = true; hissAudioSource.playOnAwake = false; if ((Object)(object)gunHissLoopSFX != (Object)null) { hissAudioSource.clip = gunHissLoopSFX; } scanNode = ((Component)this).GetComponentInChildren(); if ((Object)(object)scanNode != (Object)null) { scanNodeInitialized = true; UpdateScanNodeText(); } if ((Object)(object)laserCellInPistolMesh != (Object)null) { ((Renderer)laserCellInPistolMesh).enabled = isLoaded; } if ((Object)(object)laserCellInHandMesh != (Object)null) { ((Renderer)laserCellInHandMesh).enabled = false; } if ((Object)(object)laserBeamVFX != (Object)null) { ((Renderer)laserBeamVFX).enabled = false; } if ((Object)(object)frontMuzzleFlash != (Object)null) { frontMuzzleFlash.SetActive(false); } currentBatteryCharge = Mathf.Clamp(currentBatteryCharge, 0f, 100f); currentHeatLevel = Mathf.Clamp(currentHeatLevel, 0f, 100f); if (gunBodyRenderers != null && gunBodyRenderers.Length != 0) { gunMaterials = (Material[])(object)new Material[gunBodyRenderers.Length]; for (int i = 0; i < gunBodyRenderers.Length; i++) { if ((Object)(object)gunBodyRenderers[i] != (Object)null) { gunMaterials[i] = gunBodyRenderers[i].material; gunMaterials[i].EnableKeyword("_EMISSION"); } } } if ((Object)(object)gunRayPoint != (Object)null) { GameObject val = new GameObject("HeatPointLight"); val.transform.SetParent(gunRayPoint, false); heatPointLight = val.AddComponent(); heatPointLight.type = (LightType)2; heatPointLight.range = 0.75f; heatPointLight.intensity = 0f; heatPointLight.shadows = (LightShadows)0; } InitializeSafetyState(); } public override void Update() { ((GrabbableObject)this).Update(); if (scanNodeInitialized) { UpdateScanNodeText(); } ProcessOverheatSystem(); if (!((Object)(object)((GrabbableObject)this).playerHeldBy == (Object)null) && ((GrabbableObject)this).isHeld && !((GrabbableObject)this).isPocketed && !((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)(object)GameNetworkManager.Instance.localPlayerController) && !isPlayingOverheatAnim) { HandleInspectInput(); HandleReloadInput(); HandleSafetyInput(); HandleAimInput(); HandleZoom(); } } public override void LateUpdate() { //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_014b: 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_0152: 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_0550: Unknown result type (might be due to invalid IL or missing references) //IL_0552: Unknown result type (might be due to invalid IL or missing references) //IL_055d: Unknown result type (might be due to invalid IL or missing references) //IL_055f: 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_053b: Unknown result type (might be due to invalid IL or missing references) //IL_0541: 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_0525: Unknown result type (might be due to invalid IL or missing references) //IL_0527: Unknown result type (might be due to invalid IL or missing references) //IL_052d: Unknown result type (might be due to invalid IL or missing references) //IL_052f: Unknown result type (might be due to invalid IL or missing references) if (!((GrabbableObject)this).isPocketed) { if (!isLoading && !isUnloading && !isReloading) { if ((Object)(object)laserCellInHandMesh != (Object)null && ((Renderer)laserCellInHandMesh).enabled) { ((Renderer)laserCellInHandMesh).enabled = false; } if ((Object)(object)laserCellInPistolMesh != (Object)null && ((Renderer)laserCellInPistolMesh).enabled != isLoaded) { ((Renderer)laserCellInPistolMesh).enabled = isLoaded; } } } else { if ((Object)(object)laserCellInHandMesh != (Object)null && ((Renderer)laserCellInHandMesh).enabled) { ((Renderer)laserCellInHandMesh).enabled = false; } if ((Object)(object)laserCellInPistolMesh != (Object)null && ((Renderer)laserCellInPistolMesh).enabled) { ((Renderer)laserCellInPistolMesh).enabled = false; } } if (((GrabbableObject)this).isHeld && (Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null) { bool flag = (Object)(object)((GrabbableObject)this).playerHeldBy == (Object)(object)GameNetworkManager.Instance.localPlayerController; Vector3 positionOffset = (flag ? firstPersonPos : thirdPersonPos); Vector3 rotationOffset = (flag ? firstPersonRot : thirdPersonRot); if (enablePositionDebug) { bool isPressed = ((ButtonControl)Keyboard.current.leftAltKey).isPressed; bool isPressed2 = ((ButtonControl)Keyboard.current.rightAltKey).isPressed; if (isPressed || isPressed2) { float num = 0.25f * Time.deltaTime; float num2 = 15f * Time.deltaTime; if (isPressed) { if (((ButtonControl)Keyboard.current.lKey).isPressed) { positionOffset.x += num; } if (((ButtonControl)Keyboard.current.jKey).isPressed) { positionOffset.x -= num; } if (((ButtonControl)Keyboard.current.oKey).isPressed) { positionOffset.y += num; } if (((ButtonControl)Keyboard.current.uKey).isPressed) { positionOffset.y -= num; } if (((ButtonControl)Keyboard.current.iKey).isPressed) { positionOffset.z += num; } if (((ButtonControl)Keyboard.current.kKey).isPressed) { positionOffset.z -= num; } } else if (isPressed2) { if (((ButtonControl)Keyboard.current.iKey).isPressed) { rotationOffset.x += num2; } if (((ButtonControl)Keyboard.current.kKey).isPressed) { rotationOffset.x -= num2; } if (((ButtonControl)Keyboard.current.lKey).isPressed) { rotationOffset.y += num2; } if (((ButtonControl)Keyboard.current.jKey).isPressed) { rotationOffset.y -= num2; } if (((ButtonControl)Keyboard.current.oKey).isPressed) { rotationOffset.z += num2; } if (((ButtonControl)Keyboard.current.uKey).isPressed) { rotationOffset.z -= num2; } } if (((ButtonControl)Keyboard.current.enterKey).wasPressedThisFrame) { CultureInfo invariantCulture = CultureInfo.InvariantCulture; string text = positionOffset.x.ToString("F3", invariantCulture); string text2 = positionOffset.y.ToString("F3", invariantCulture); string text3 = positionOffset.z.ToString("F3", invariantCulture); string text4 = rotationOffset.x.ToString("F3", invariantCulture); string text5 = rotationOffset.y.ToString("F3", invariantCulture); string text6 = rotationOffset.z.ToString("F3", invariantCulture); string text7 = (flag ? "1-Е ЛИЦО" : "3-Е ЛИЦО"); string text8 = (flag ? "firstPersonPos" : "thirdPersonPos"); string text9 = (flag ? "firstPersonRot" : "thirdPersonRot"); Plugin.mls.LogInfo((object)("====== ИДЕАЛЬНЫЕ КООРДИНАТЫ: " + text7 + " ======")); Plugin.mls.LogInfo((object)("private Vector3 " + text8 + " = new Vector3(" + text + "f, " + text2 + "f, " + text3 + "f);")); Plugin.mls.LogInfo((object)("private Vector3 " + text9 + " = new Vector3(" + text4 + "f, " + text5 + "f, " + text6 + "f);")); Plugin.mls.LogInfo((object)"=========================================="); } } if (flag) { firstPersonPos = positionOffset; firstPersonRot = rotationOffset; } else { thirdPersonPos = positionOffset; thirdPersonRot = rotationOffset; } } ((GrabbableObject)this).itemProperties.positionOffset = positionOffset; ((GrabbableObject)this).itemProperties.rotationOffset = rotationOffset; } ((GrabbableObject)this).LateUpdate(); } private void UpdateScanNodeText() { if ((Object)(object)scanNode != (Object)null) { string text = (Plugin.translateRussian ? "Компактное лазерное оружие" : "Compact laser weapon"); string arg = (Plugin.translateRussian ? "Заряд" : "Charge"); if (isLoaded) { scanNode.subText = $"{text}\n{arg}: {currentBatteryCharge:F1}%"; return; } string text2 = (Plugin.translateRussian ? "БАТАРЕЯ ОТСУТСТВУЕТ" : "NO CELL INSERTED"); scanNode.subText = text + "\n" + text2; } } public override int GetItemDataToSave() { ((GrabbableObject)this).GetItemDataToSave(); int num = Mathf.RoundToInt(currentBatteryCharge * 100f); int num2 = Mathf.RoundToInt(currentHeatLevel * 100f); int num3 = (num << 16) | (num2 & 0xFFFF); if (isModeSafe) { num3 |= int.MinValue; } if (isLoaded) { num3 |= 0x40000000; } return num3; } public override void LoadItemSaveData(int saveData) { ((GrabbableObject)this).LoadItemSaveData(saveData); if (saveData != 0) { isModeSafe = (saveData & int.MinValue) != 0; isLoaded = (saveData & 0x40000000) != 0; int num = saveData & 0x3FFFFFFF; int num2 = (num >> 16) & 0xFFFF; int num3 = num & 0xFFFF; currentBatteryCharge = Mathf.Clamp((float)num2 / 100f, 0f, 100f); currentHeatLevel = Mathf.Clamp((float)num3 / 100f, 0f, 100f); if ((Object)(object)laserCellInPistolMesh != (Object)null) { ((Renderer)laserCellInPistolMesh).enabled = isLoaded; } InitializeSafetyState(); } } private bool CanPerformAction(ActionType attemptingAction) { if (Time.time < stopActionTime + 0.5f) { if (attemptingAction == ActionType.Aim && lastAction == ActionType.Aim) { return true; } if (attemptingAction == ActionType.Inspect && lastAction == ActionType.Inspect) { return true; } return false; } if (attemptingAction == ActionType.Aim && (isInspectingToggle || isInspectingHold)) { return false; } if (attemptingAction == ActionType.Inspect && isAiming) { return false; } if (attemptingAction == ActionType.Other && (isAiming || isInspectingToggle || isInspectingHold)) { return false; } return true; } public override void ItemActivate(bool used, bool buttonDown = true) { if (isSwitchingMode || isLoading || isUnloading || isReloading || isPlayingOverheatAnim) { return; } if (isInspectingToggle) { if (buttonDown) { ToggleInspectAndSync(); } } else if (!(Time.time < stopActionTime + 0.5f) && !Plugin.InputActionInstance.InspectKey.IsPressed() && buttonDown && !cantFire && !isInspectingHold && (Object)(object)((GrabbableObject)this).playerHeldBy == (Object)(object)GameNetworkManager.Instance.localPlayerController) { localClientSendingShootRPC = true; ShootGun(); ShootGunServerRpc(); } } public override void ItemInteractLeftRight(bool right) { ((GrabbableObject)this).ItemInteractLeftRight(right); } public override void EquipItem() { //IL_006e: 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_0046: 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) ((GrabbableObject)this).itemProperties.disableHandsOnWall = true; base.EquipItem(); if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null) { if ((Object)(object)((GrabbableObject)this).playerHeldBy == (Object)(object)GameNetworkManager.Instance.localPlayerController) { ((Component)this).transform.localPosition = firstPersonPos; ((Component)this).transform.localEulerAngles = firstPersonRot; } else { ((Component)this).transform.localPosition = thirdPersonPos; ((Component)this).transform.localEulerAngles = thirdPersonRot; } } if ((Object)(object)laserCellInPistolMesh != (Object)null) { ((Renderer)laserCellInPistolMesh).enabled = isLoaded; } if ((Object)(object)laserCellInHandMesh != (Object)null) { ((Renderer)laserCellInHandMesh).enabled = false; } previousPlayerHeldBy = ((GrabbableObject)this).playerHeldBy; previousPlayerHeldBy.equippedUsableItemQE = true; UpdateWeaponAnimator(((GrabbableObject)this).playerHeldBy, ((GrabbableObject)this).playerHeldBy.playerBodyAnimator, isDroppingWeapon: false); if ((Object)(object)((GrabbableObject)this).playerHeldBy.playerBodyAnimator != (Object)null) { ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.SetBool("LaspistHold", true); ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.SetBool("LaspistSafety", isModeSafe); ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.SetTrigger("SwitchHoldAnimationTwoHanded"); } if ((Object)(object)gunAnimator != (Object)null) { gunAnimator.SetBool("SafetyMode", isModeSafe); } if ((Object)(object)((GrabbableObject)this).playerHeldBy == (Object)(object)GameNetworkManager.Instance.localPlayerController) { defaultFOV = ((GrabbableObject)this).playerHeldBy.gameplayCamera.fieldOfView; } isAiming = false; } public override void PocketItem() { if (isPlayingOverheatAnim) { if (overheatAnimCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(overheatAnimCoroutine); } isPlayingOverheatAnim = false; cantFire = false; if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null && (Object)(object)((GrabbableObject)this).playerHeldBy == (Object)(object)GameNetworkManager.Instance.localPlayerController) { ((GrabbableObject)this).playerHeldBy.isGrabbingObjectAnimation = false; } } if ((Object)(object)((GrabbableObject)this).playerHeldBy == (Object)(object)GameNetworkManager.Instance.localPlayerController && (Object)(object)((GrabbableObject)this).playerHeldBy.gameplayCamera != (Object)null) { ((GrabbableObject)this).playerHeldBy.gameplayCamera.fieldOfView = defaultFOV; } ResetInteractionState(); if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null) { UpdateWeaponAnimator(((GrabbableObject)this).playerHeldBy, ((GrabbableObject)this).playerHeldBy.playerBodyAnimator, isDroppingWeapon: true); } base.PocketItem(); } public override void DiscardItem() { if (isPlayingOverheatAnim) { if (overheatAnimCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(overheatAnimCoroutine); } isPlayingOverheatAnim = false; cantFire = false; if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null && (Object)(object)((GrabbableObject)this).playerHeldBy == (Object)(object)GameNetworkManager.Instance.localPlayerController) { ((GrabbableObject)this).playerHeldBy.isGrabbingObjectAnimation = false; } } if ((Object)(object)((GrabbableObject)this).playerHeldBy == (Object)(object)GameNetworkManager.Instance.localPlayerController && (Object)(object)((GrabbableObject)this).playerHeldBy.gameplayCamera != (Object)null) { ((GrabbableObject)this).playerHeldBy.gameplayCamera.fieldOfView = defaultFOV; } ResetInteractionState(); if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null) { UpdateWeaponAnimator(((GrabbableObject)this).playerHeldBy, ((GrabbableObject)this).playerHeldBy.playerBodyAnimator, isDroppingWeapon: true); } base.DiscardItem(); } public override void GrabItem() { ((GrabbableObject)this).GrabItem(); if ((Object)(object)laserCellInPistolMesh != (Object)null) { ((Renderer)laserCellInPistolMesh).enabled = isLoaded; } if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null) { UpdateWeaponAnimator(((GrabbableObject)this).playerHeldBy, ((GrabbableObject)this).playerHeldBy.playerBodyAnimator, isDroppingWeapon: false); } } public override void GrabItemFromEnemy(EnemyAI enemy) { ((GrabbableObject)this).GrabItemFromEnemy(enemy); if ((Object)(object)laserCellInPistolMesh != (Object)null) { ((Renderer)laserCellInPistolMesh).enabled = isLoaded; } heldByEnemy = enemy; } public override void DiscardItemFromEnemy() { ((GrabbableObject)this).DiscardItemFromEnemy(); if ((Object)(object)laserCellInPistolMesh != (Object)null) { ((Renderer)laserCellInPistolMesh).enabled = isLoaded; } heldByEnemy = null; } private void HandleSafetyInput() { if (Plugin.InputActionInstance.WeaponFireModeKey.IsPressed()) { if (!eWasPressed) { ePressTime = Time.time; eWasPressed = true; safetyHoldCompleted = false; } else if (!safetyHoldCompleted && Time.time - ePressTime >= 0.5f) { if (!isReloading && !isSwitchingMode && !isFiring && !cantFire && !isLoading && !isUnloading && CanPerformAction(ActionType.Other)) { ToggleSafetyAndSync(); } safetyHoldCompleted = true; } } else { eWasPressed = false; safetyHoldCompleted = false; } } private void HandleInspectInput() { if (!((GrabbableObject)this).isHeld || (Object)(object)((GrabbableObject)this).playerHeldBy == (Object)null || (Object)(object)((GrabbableObject)this).playerHeldBy != (Object)(object)GameNetworkManager.Instance.localPlayerController || (!isInspectingToggle && !CanPerformAction(ActionType.Inspect))) { return; } bool flag = Plugin.InputActionInstance.InspectKey.IsPressed(); if (flag && !qWasPressed) { qPressTime = Time.time; qWasPressed = true; } else if (!flag && qWasPressed && Time.time - qPressTime < 0.5f && !isInspectingHold) { if (!isReloading && !isSwitchingMode && !isInspectingHold) { ToggleInspectAndSync(); } qWasPressed = false; } else if (flag && qWasPressed && Time.time - qPressTime >= 0.5f && !isInspectingHold) { if (!isReloading && !isSwitchingMode && !isInspectingToggle) { HoldInspectAndSync(); qWasPressed = false; } } else if (!flag && qWasPressed) { qWasPressed = false; } } private void HandleReloadInput() { if (!CanPerformAction(ActionType.Inspect) || isInspectingToggle || isInspectingHold) { return; } if (Plugin.InputActionInstance.WeaponReloadKey.IsPressed()) { if (!rWasPressed) { rPressTime = Time.time; rWasPressed = true; reloadHoldCompleted = false; } else if (!reloadHoldCompleted && Time.time - rPressTime >= 0.5f && isLoaded && !isLoading && !isUnloading && !isReloading) { UnloadingBatteryAction(); reloadHoldCompleted = true; } } else { if (!rWasPressed) { return; } if (!reloadHoldCompleted && !isLoading && !isUnloading && !isReloading) { if (!isLoaded) { LoadingBatteryAction(); } else { TryReloadingBattery(); } } rWasPressed = false; reloadHoldCompleted = false; } } private void HandleAimInput() { if (isReloading || isSwitchingMode || isLoading || isUnloading || ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null && ((GrabbableObject)this).playerHeldBy.isSprinting)) { if (isAiming) { SetAim(aiming: false); lastAction = ActionType.Aim; stopActionTime = Time.time; } return; } bool flag = Plugin.InputActionInstance.WeaponAimKey.IsPressed(); if (flag && !isAiming) { if (CanPerformAction(ActionType.Aim)) { SetAim(aiming: true); } } else if (!flag && isAiming) { SetAim(aiming: false); lastAction = ActionType.Aim; stopActionTime = Time.time; } } private void LoadingBatteryAction() { int num = FindBestBatteryInInventory(); if (num != -1) { ((MonoBehaviour)this).StartCoroutine(LoadingBatteryAnimation(num)); } } private IEnumerator LoadingBatteryAnimation(int slot) { isLoading = true; cantFire = true; Transform rig = ((Component)this).transform.GetChild(1); if ((Object)(object)((GrabbableObject)this).playerHeldBy?.playerBodyAnimator != (Object)null) { ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.SetTrigger("LaspistInsertBattery"); } if ((Object)(object)gunAnimator != (Object)null) { gunAnimator.SetTrigger("LoadTrigger"); } gunAudio.PlayOneShot(batteryInsertSFX); if ((Object)(object)laserCellInPistolMesh != (Object)null) { ((Renderer)laserCellInPistolMesh).enabled = false; } if ((Object)(object)laserCellInHandMesh != (Object)null) { ((Renderer)laserCellInHandMesh).enabled = false; } StartLoadingAnimServerRpc(); yield return (object)new WaitForSeconds(53f / 60f); AttachBatteryToHand(((GrabbableObject)this).playerHeldBy); yield return (object)new WaitForSeconds(1.05f); if ((Object)(object)laserCellInPistolMesh != (Object)null) { ((Renderer)laserCellInPistolMesh).enabled = true; } if ((Object)(object)laserCellInHandMesh != (Object)null) { ((Renderer)laserCellInHandMesh).enabled = false; } yield return (object)new WaitForSeconds(1.8f); if ((Object)(object)laserCellInHandMesh != (Object)null) { ((Component)laserCellInHandMesh).transform.SetParent(rig); ((Component)laserCellInHandMesh).transform.localPosition = Vector3.zero; } LoadingBatteryServerRpc(slot); isLoading = false; cantFire = false; } [ServerRpc(RequireOwnership = false)] public void LoadingBatteryServerRpc(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_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)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1938303309u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, slot); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1938303309u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!isLoaded) { PlayerControllerB playerHeldBy = ((GrabbableObject)this).playerHeldBy; if (!((Object)(object)playerHeldBy == (Object)null) && playerHeldBy.ItemSlots[slot] is HAI_LaserCellItem { currentBatteryCharge: var newCharge }) { playerHeldBy.DestroyItemInSlot(slot); playerHeldBy.DestroyItemInSlotClientRpc(slot); LoadingBatteryClientRpc(newCharge); } } } [ClientRpc] public void LoadingBatteryClientRpc(float newCharge) { //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) //IL_00dc: 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.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3712541605u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref newCharge, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3712541605u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; currentBatteryCharge = newCharge; isLoaded = true; isLoading = false; cantFire = false; if ((Object)(object)laserCellInPistolMesh != (Object)null) { ((Renderer)laserCellInPistolMesh).enabled = true; } if (currentBatteryCharge < energyCostPerShot && (Object)(object)gunAudio != (Object)null && (Object)(object)dischargedBeepSFX != (Object)null) { gunAudio.PlayOneShot(dischargedBeepSFX); } } } [ServerRpc(RequireOwnership = false)] public void StartLoadingAnimServerRpc() { //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)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(934035097u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 934035097u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; StartLoadingAnimClientRpc(); } } } [ClientRpc] public void StartLoadingAnimClientRpc() { //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) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1310277019u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1310277019u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!((GrabbableObject)this).isHeld || !((Object)(object)((GrabbableObject)this).playerHeldBy == (Object)(object)GameNetworkManager.Instance.localPlayerController)) { isLoading = true; if ((Object)(object)((GrabbableObject)this).playerHeldBy?.playerBodyAnimator != (Object)null) { ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.SetTrigger("LaspistInsertBattery"); } if ((Object)(object)gunAnimator != (Object)null) { gunAnimator.SetTrigger("LoadTrigger"); } gunAudio.PlayOneShot(batteryInsertSFX); if ((Object)(object)laserCellInPistolMesh != (Object)null) { ((Renderer)laserCellInPistolMesh).enabled = false; } ((MonoBehaviour)this).StartCoroutine(RemoteClientLoadVisuals()); } } private IEnumerator RemoteClientLoadVisuals() { yield return (object)new WaitForSeconds(53f / 60f); AttachBatteryToHand(((GrabbableObject)this).playerHeldBy); yield return (object)new WaitForSeconds(1.05f); if ((Object)(object)laserCellInHandMesh != (Object)null) { ((Renderer)laserCellInHandMesh).enabled = false; } if ((Object)(object)laserCellInPistolMesh != (Object)null) { ((Renderer)laserCellInPistolMesh).enabled = true; } yield return (object)new WaitForSeconds(1.8f); if ((Object)(object)laserCellInHandMesh != (Object)null) { ((Component)laserCellInHandMesh).transform.SetParent(((Component)this).transform.GetChild(1)); ((Component)laserCellInHandMesh).transform.localPosition = Vector3.zero; } isLoading = false; } private void UnloadingBatteryAction() { ((MonoBehaviour)this).StartCoroutine(UnloadingBatteryAnimation()); } private IEnumerator UnloadingBatteryAnimation() { isUnloading = true; cantFire = true; Transform rig = ((Component)this).transform.GetChild(1); if ((Object)(object)((GrabbableObject)this).playerHeldBy?.playerBodyAnimator != (Object)null) { ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.SetTrigger("LaspistEjectBattery"); } if ((Object)(object)gunAnimator != (Object)null) { gunAnimator.SetTrigger("UnloadTrigger"); } gunAudio.PlayOneShot(batteryEjectSFX); StartUnloadingAnimServerRpc(); yield return (object)new WaitForSeconds(2.4333334f); if ((Object)(object)laserCellInPistolMesh != (Object)null) { ((Renderer)laserCellInPistolMesh).enabled = false; } AttachBatteryToHand(((GrabbableObject)this).playerHeldBy); yield return (object)new WaitForSeconds(0.4f); if ((Object)(object)laserCellInHandMesh != (Object)null) { ((Renderer)laserCellInHandMesh).enabled = false; } UnloadingBatteryServerRpc(); if ((Object)(object)laserCellInHandMesh != (Object)null) { ((Component)laserCellInHandMesh).transform.SetParent(rig); ((Component)laserCellInHandMesh).transform.localPosition = Vector3.zero; ((Component)laserCellInHandMesh).transform.localRotation = Quaternion.identity; ((Component)laserCellInHandMesh).transform.localScale = new Vector3(1.4f, 1.4f, 1.4f); } yield return (object)new WaitForSeconds(0.5f); isUnloading = false; cantFire = false; lastAction = ActionType.Other; stopActionTime = Time.time; } [ServerRpc(RequireOwnership = false)] public void UnloadingBatteryServerRpc() { //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_018d: 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_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: 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_0161: 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_0170: 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_0212: 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_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_0203: 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_020d: 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_021d: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: Unknown result type (might be due to invalid IL or missing references) //IL_02ea: Unknown result type (might be due to invalid IL or missing references) //IL_02ef: Unknown result type (might be due to invalid IL or missing references) //IL_02f9: Unknown result type (might be due to invalid IL or missing references) //IL_02fe: Unknown result type (might be due to invalid IL or missing references) //IL_0339: 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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3874444791u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3874444791u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!isLoaded || (Object)(object)((GrabbableObject)this).playerHeldBy == (Object)null) { return; } float newCharge = currentBatteryCharge; currentBatteryCharge = 0f; isLoaded = false; int num = -1; for (int i = 0; i < ((GrabbableObject)this).playerHeldBy.ItemSlots.Length; i++) { if ((Object)(object)((GrabbableObject)this).playerHeldBy.ItemSlots[i] == (Object)null) { num = i; break; } } Vector3 val3; if (num != -1) { val3 = ((Component)((GrabbableObject)this).playerHeldBy).transform.position + Vector3.up * 500f; } else { Vector3 val4 = ((Component)((GrabbableObject)this).playerHeldBy).transform.position + Vector3.up * 1.2f; Vector3 val5 = val4 + ((Component)((GrabbableObject)this).playerHeldBy).transform.forward * 0.5f; RaycastHit val6 = default(RaycastHit); val3 = ((!Physics.Linecast(val4, val5, ref val6, StartOfRound.Instance.collidersAndRoomMaskAndDefault)) ? val5 : (((RaycastHit)(ref val6)).point - ((Component)((GrabbableObject)this).playerHeldBy).transform.forward * 0.05f)); } GameObject val7 = Object.Instantiate(Plugin.lasercellAmmoPrefab, val3, Quaternion.identity); HAI_LaserCellItem component = val7.GetComponent(); component.currentBatteryCharge = newCharge; val7.GetComponent().SpawnWithOwnership(((NetworkBehaviour)((GrabbableObject)this).playerHeldBy).OwnerClientId, false); component.UpdateBatteryChargeClientRpc(newCharge); if (num != -1) { PutBatteryInInventoryClientRpc(NetworkObjectReference.op_Implicit(val7.GetComponent()), num); } else { ((GrabbableObject)component).hasHitGround = false; ((GrabbableObject)component).isHeld = false; ((GrabbableObject)component).grabbable = true; ((GrabbableObject)component).fallTime = 0f; Rigidbody val8 = default(Rigidbody); if (((Component)component).TryGetComponent(ref val8)) { val8.isKinematic = false; val8.useGravity = true; val8.detectCollisions = true; val8.AddForce(((Component)((GrabbableObject)this).playerHeldBy).transform.forward * 4f + Vector3.up * 2f, (ForceMode)1); val8.AddTorque(new Vector3(Random.Range(-5f, 5f), Random.Range(-5f, 5f), Random.Range(-5f, 5f)), (ForceMode)1); } } UnloadingBatteryClientRpc(); } [ClientRpc] public void PutBatteryInInventoryClientRpc(NetworkObjectReference batteryRef, int slotIndex) { //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_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_008c: 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_00e9: 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.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(939315948u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref batteryRef, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val, slotIndex); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 939315948u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); if (((NetworkObjectReference)(ref batteryRef)).TryGet(ref val3, (NetworkManager)null)) { HAI_LaserCellItem component = ((Component)val3).GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null) { ((MonoBehaviour)this).StartCoroutine(DelayedPutInInventory(component, slotIndex)); } } } private IEnumerator DelayedPutInInventory(HAI_LaserCellItem batteryItem, int slotIndex) { yield return null; ((GrabbableObject)batteryItem).playerHeldBy = ((GrabbableObject)this).playerHeldBy; ((GrabbableObject)batteryItem).isHeld = false; ((GrabbableObject)batteryItem).isPocketed = true; ((GrabbableObject)batteryItem).heldByPlayerOnServer = true; ((GrabbableObject)this).playerHeldBy.ItemSlots[slotIndex] = (GrabbableObject)(object)batteryItem; ((GrabbableObject)batteryItem).EnableItemMeshes(false); ((GrabbableObject)batteryItem).EnablePhysics(false); Transform targetHolder = (((GrabbableObject)batteryItem).parentObject = (((Object)(object)((GrabbableObject)this).playerHeldBy == (Object)(object)GameNetworkManager.Instance.localPlayerController) ? ((GrabbableObject)this).playerHeldBy.localItemHolder : ((GrabbableObject)this).playerHeldBy.serverItemHolder)); ((Component)batteryItem).transform.SetParent(targetHolder); ((Component)batteryItem).transform.localPosition = Vector3.zero; ((Component)batteryItem).transform.localRotation = Quaternion.identity; if ((Object)(object)((GrabbableObject)this).playerHeldBy == (Object)(object)GameNetworkManager.Instance.localPlayerController && (Object)(object)HUDManager.Instance != (Object)null && slotIndex < HUDManager.Instance.itemSlotIcons.Length) { HUDManager.Instance.itemSlotIcons[slotIndex].sprite = ((GrabbableObject)batteryItem).itemProperties.itemIcon; ((Behaviour)HUDManager.Instance.itemSlotIcons[slotIndex]).enabled = true; } } [ClientRpc] public void UnloadingBatteryClientRpc() { //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) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1886824032u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1886824032u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; currentBatteryCharge = 0f; isLoaded = false; if ((Object)(object)laserCellInPistolMesh != (Object)null) { ((Renderer)laserCellInPistolMesh).enabled = false; } } } [ServerRpc(RequireOwnership = false)] public void StartUnloadingAnimServerRpc() { //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)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3034604027u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3034604027u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; StartUnloadingAnimClientRpc(); } } } [ClientRpc] public void StartUnloadingAnimClientRpc() { //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) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(782906883u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 782906883u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!((GrabbableObject)this).isHeld || !((Object)(object)((GrabbableObject)this).playerHeldBy == (Object)(object)GameNetworkManager.Instance.localPlayerController)) { isUnloading = true; if ((Object)(object)((GrabbableObject)this).playerHeldBy?.playerBodyAnimator != (Object)null) { ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.SetTrigger("LaspistEjectBattery"); } if ((Object)(object)gunAnimator != (Object)null) { gunAnimator.SetTrigger("UnloadTrigger"); } ((MonoBehaviour)this).StartCoroutine(RemoteClientUnloadVisuals()); } } private IEnumerator RemoteClientUnloadVisuals() { gunAudio.PlayOneShot(batteryEjectSFX); yield return (object)new WaitForSeconds(2.4333334f); if ((Object)(object)laserCellInPistolMesh != (Object)null) { ((Renderer)laserCellInPistolMesh).enabled = false; } AttachBatteryToHand(((GrabbableObject)this).playerHeldBy); yield return (object)new WaitForSeconds(0.4f); if ((Object)(object)laserCellInHandMesh != (Object)null) { ((Renderer)laserCellInHandMesh).enabled = false; } yield return (object)new WaitForSeconds(0.6f); isUnloading = false; } private void TryReloadingBattery() { int num = FindBestBatteryInInventory(); if (num != -1) { ((MonoBehaviour)this).StartCoroutine(ReloadingBatteryAnimation(num)); } } private IEnumerator ReloadingBatteryAnimation(int slot) { isReloading = true; cantFire = true; Transform rig = ((Component)this).transform.GetChild(1); if ((Object)(object)((GrabbableObject)this).playerHeldBy?.playerBodyAnimator != (Object)null) { ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.SetTrigger("LaspistReloadBattery"); } if ((Object)(object)gunAnimator != (Object)null) { gunAnimator.SetTrigger("ReloadTrigger"); } gunAudio.PlayOneShot(batteryEjectSFX); StartReloadingAnimServerRpc(); yield return (object)new WaitForSeconds(2.3833334f); gunAudio.PlayOneShot(batteryInsertSFX); yield return (object)new WaitForSeconds(7f / 60f); if ((Object)(object)laserCellInPistolMesh != (Object)null) { ((Renderer)laserCellInPistolMesh).enabled = false; } AttachBatteryToHand(((GrabbableObject)this).playerHeldBy); yield return (object)new WaitForSeconds(1.8166667f); if ((Object)(object)laserCellInPistolMesh != (Object)null) { ((Renderer)laserCellInPistolMesh).enabled = true; } if ((Object)(object)laserCellInHandMesh != (Object)null) { ((Renderer)laserCellInHandMesh).enabled = false; } SwapBatteryServerRpc(slot); yield return (object)new WaitForSeconds(0.5f); if ((Object)(object)laserCellInHandMesh != (Object)null) { ((Component)laserCellInHandMesh).transform.SetParent(rig); ((Component)laserCellInHandMesh).transform.localPosition = Vector3.zero; } isReloading = false; cantFire = false; lastAction = ActionType.Other; stopActionTime = Time.time; } [ServerRpc(RequireOwnership = false)] public void SwapBatteryServerRpc(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_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)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2099770589u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, slot); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2099770589u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB playerHeldBy = ((GrabbableObject)this).playerHeldBy; if (!((Object)(object)playerHeldBy == (Object)null) && playerHeldBy.ItemSlots[slot] is HAI_LaserCellItem hAI_LaserCellItem) { float newCharge = currentBatteryCharge; float newGunCharge = (currentBatteryCharge = hAI_LaserCellItem.currentBatteryCharge); hAI_LaserCellItem.UpdateBatteryChargeServerRpc(newCharge); SwapBatteryClientRpc(newGunCharge); } } } [ClientRpc] public void SwapBatteryClientRpc(float newGunCharge) { //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) //IL_00dc: 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.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2691986716u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref newGunCharge, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2691986716u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; currentBatteryCharge = newGunCharge; isLoaded = true; if ((Object)(object)laserCellInPistolMesh != (Object)null) { ((Renderer)laserCellInPistolMesh).enabled = true; } if (currentBatteryCharge < energyCostPerShot) { ((MonoBehaviour)this).StartCoroutine(PlayDelayedDischargeBeep(1.5f)); } } } [ServerRpc(RequireOwnership = false)] public void StartReloadingAnimServerRpc() { //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)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2397147515u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2397147515u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; StartReloadingAnimClientRpc(); } } } [ClientRpc] public void StartReloadingAnimClientRpc() { //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) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3061713370u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3061713370u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!((GrabbableObject)this).isHeld || !((Object)(object)((GrabbableObject)this).playerHeldBy == (Object)(object)GameNetworkManager.Instance.localPlayerController)) { isReloading = true; if ((Object)(object)((GrabbableObject)this).playerHeldBy?.playerBodyAnimator != (Object)null) { ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.SetTrigger("LaspistReloadBattery"); } if ((Object)(object)gunAnimator != (Object)null) { gunAnimator.SetTrigger("ReloadTrigger"); } gunAudio.PlayOneShot(batteryEjectSFX); ((MonoBehaviour)this).StartCoroutine(RemoteClientReloadVisuals()); } } private IEnumerator RemoteClientReloadVisuals() { yield return (object)new WaitForSeconds(2.3833334f); gunAudio.PlayOneShot(batteryInsertSFX); yield return (object)new WaitForSeconds(7f / 60f); if ((Object)(object)laserCellInPistolMesh != (Object)null) { ((Renderer)laserCellInPistolMesh).enabled = false; } AttachBatteryToHand(((GrabbableObject)this).playerHeldBy); yield return (object)new WaitForSeconds(1.8166667f); if ((Object)(object)laserCellInPistolMesh != (Object)null) { ((Renderer)laserCellInPistolMesh).enabled = true; } if ((Object)(object)laserCellInHandMesh != (Object)null) { ((Renderer)laserCellInHandMesh).enabled = false; } yield return (object)new WaitForSeconds(0.5f); if ((Object)(object)laserCellInHandMesh != (Object)null) { ((Component)laserCellInHandMesh).transform.SetParent(((Component)this).transform.GetChild(1)); ((Component)laserCellInHandMesh).transform.localPosition = Vector3.zero; } isReloading = false; } [ServerRpc(RequireOwnership = false)] public void ShootGunServerRpc() { //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) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(200801177u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 200801177u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; bool isRealShot = false; if (!isModeSafe && !isOverheated && currentBatteryCharge >= energyCostPerShot) { isRealShot = true; currentBatteryCharge -= energyCostPerShot; UpdateBatteryChargeClientRpc(currentBatteryCharge); if (currentBatteryCharge < energyCostPerShot) { PlayDischargeBeepClientRpc(); } } ShootGunClientRpc(isRealShot); } [ClientRpc] public void ShootGunClientRpc(bool isRealShot) { //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) //IL_00dc: 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.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(96360082u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref isRealShot, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 96360082u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (localClientSendingShootRPC) { localClientSendingShootRPC = false; return; } cantFire = false; isInspectingHold = false; isInspectingToggle = false; if ((Object)(object)gunAnimator != (Object)null) { gunAnimator.Update(0f); } ShootGun(isRealShot); } [ClientRpc] public void PlayDischargeBeepClientRpc() { //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)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1371484872u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1371484872u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ((MonoBehaviour)this).StartCoroutine(PlayDelayedDischargeBeep(0.2f)); } } } public void ShootGun(bool forceRealShot = false) { //IL_02a9: 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_0146: Unknown result type (might be due to invalid IL or missing references) if (isSwitchingMode || isReloading || cantFire || isInspectingToggle || isInspectingHold) { return; } bool flag = forceRealShot || (!isModeSafe && !isOverheated && currentBatteryCharge >= energyCostPerShot); if (safetyLockCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(safetyLockCoroutine); } safetyLockCoroutine = ((MonoBehaviour)this).StartCoroutine(IsShootDelay()); ((MonoBehaviour)this).StartCoroutine(FireDelay()); if (((GrabbableObject)this).isHeld && (Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null) { if ((Object)(object)((GrabbableObject)this).playerHeldBy == (Object)(object)GameNetworkManager.Instance.localPlayerController) { if (isAiming) { ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.SetTrigger("LaspistAimShoot"); ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.SetTrigger("LaspistShoot"); } else { ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.SetTrigger("LaspistShoot"); } } else { bool flag2 = false; for (int i = 0; i < ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.layerCount; i++) { AnimatorStateInfo currentAnimatorStateInfo = ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.GetCurrentAnimatorStateInfo(i); if (((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("A_LaspistShoot") || ((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("A_LaspistAimShoot")) { flag2 = true; break; } } if (flag2) { if (isAiming) { ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.Play("A_LaspistAimShoot", -1, 0f); } else { ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.Play("A_LaspistShoot", -1, 0f); } } else { if (isAiming) { ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.SetTrigger("LaspistAimShoot"); } ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.SetTrigger("LaspistShoot"); } } } gunAudio.PlayOneShot(TriggerClickSFX, triggerVolume); gunAnimator.SetTrigger("Shoot"); if (flag) { ApplyHeatPerShot(); int index = Random.Range(0, gunShootSFX.Count); gunAudio.PlayOneShot(gunShootSFX[index], shootVolume); if (((NetworkBehaviour)this).IsOwner) { TryDamageBugsOnPlayer(((GrabbableObject)this).playerHeldBy, Plugin.laserpistolMonsterDamage, gunRayPoint.forward); FireRaycastLogic(); } } } private void FireRaycastLogic() { //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_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0056: 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_0060: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: 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_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: 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_0134: 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) //IL_0140: 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_0149: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_059f: Unknown result type (might be due to invalid IL or missing references) //IL_05a4: Unknown result type (might be due to invalid IL or missing references) //IL_0586: Unknown result type (might be due to invalid IL or missing references) //IL_058b: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_05b9: Unknown result type (might be due to invalid IL or missing references) //IL_05ba: Unknown result type (might be due to invalid IL or missing references) //IL_05bc: 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_0419: Unknown result type (might be due to invalid IL or missing references) //IL_041b: Unknown result type (might be due to invalid IL or missing references) //IL_041c: 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_0407: Unknown result type (might be due to invalid IL or missing references) //IL_054d: Unknown result type (might be due to invalid IL or missing references) //IL_054f: Unknown result type (might be due to invalid IL or missing references) //IL_0551: Unknown result type (might be due to invalid IL or missing references) //IL_0552: 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_048e: Unknown result type (might be due to invalid IL or missing references) //IL_052a: Unknown result type (might be due to invalid IL or missing references) //IL_052c: Unknown result type (might be due to invalid IL or missing references) //IL_052e: Unknown result type (might be due to invalid IL or missing references) //IL_052f: Unknown result type (might be due to invalid IL or missing references) //IL_0534: Unknown result type (might be due to invalid IL or missing references) //IL_0329: Unknown result type (might be due to invalid IL or missing references) //IL_04d0: Unknown result type (might be due to invalid IL or missing references) //IL_04d2: Unknown result type (might be due to invalid IL or missing references) //IL_04d4: Unknown result type (might be due to invalid IL or missing references) //IL_04d5: Unknown result type (might be due to invalid IL or missing references) //IL_04da: Unknown result type (might be due to invalid IL or missing references) //IL_04b1: Unknown result type (might be due to invalid IL or missing references) //IL_04b7: Unknown result type (might be due to invalid IL or missing references) //IL_03c7: Unknown result type (might be due to invalid IL or missing references) //IL_03c9: Unknown result type (might be due to invalid IL or missing references) //IL_03cb: Unknown result type (might be due to invalid IL or missing references) //IL_03cc: Unknown result type (might be due to invalid IL or missing references) //IL_03d1: Unknown result type (might be due to invalid IL or missing references) Transform val = (((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null) ? ((Component)((GrabbableObject)this).playerHeldBy).transform : (((Object)(object)heldByEnemy != (Object)null) ? ((Component)heldByEnemy).transform : null)); Vector3 forward = gunRayPoint.forward; Vector3 val2 = gunRayPoint.position - forward * 0.2f; float num = 50f; float num2 = 0.2f; int num3 = (StartOfRound.Instance.collidersAndRoomMaskAndDefault | 0x200 | 8 | 0x80000 | 0x1000 | 0x100 | 0x200000) & -268435457; RaycastHit[] array = Physics.SphereCastAll(val2, num2, forward, num, num3, (QueryTriggerInteraction)2); Array.Sort(array, (RaycastHit x, RaycastHit y) => ((RaycastHit)(ref x)).distance.CompareTo(((RaycastHit)(ref y)).distance)); Vector3 val3 = gunRayPoint.position + forward * num; List list = new List(); HashSet hashSet = new HashSet(); RaycastHit[] array2 = array; IHittable val5 = default(IHittable); IHittable val6 = default(IHittable); for (int num4 = 0; num4 < array2.Length; num4++) { RaycastHit hit = array2[num4]; GameObject gameObject = ((Component)((RaycastHit)(ref hit)).collider).gameObject; int layer = gameObject.layer; Vector3 hitPoint = ((((RaycastHit)(ref hit)).point != Vector3.zero) ? ((RaycastHit)(ref hit)).point : (val2 + forward * ((RaycastHit)(ref hit)).distance)); if (((Object)(object)val != (Object)null && ((Object)(object)((RaycastHit)(ref hit)).transform == (Object)(object)val || ((RaycastHit)(ref hit)).transform.IsChildOf(val))) || list.Contains(gameObject)) { continue; } list.Add(gameObject); if (layer == 28 || layer == 6 || layer == 12 || ((Object)gameObject).name.Contains("Stair") || ((Object)gameObject).name.Contains("Catwalk") || ((Object)gameObject).name.Contains("Rail") || ((Object)gameObject).name.Contains("Raiing") || (Object)(object)gameObject.GetComponent() != (Object)null || (Object)(object)gameObject.GetComponentInParent() != (Object)null) { continue; } EnemyAI val4 = null; EnemyAICollisionDetect component = gameObject.GetComponent(); if ((Object)(object)component != (Object)null) { val4 = component.mainScript; } if ((Object)(object)val4 == (Object)null) { val4 = gameObject.GetComponentInParent(); } if ((Object)(object)val4 != (Object)null) { if (val4.isEnemyDead || val4.enemyHP <= 0) { continue; } bool flag = false; if (((Object)(object)heldByEnemy == (Object)null || (Object)(object)val4 != (Object)(object)heldByEnemy) && !hashSet.Contains(val4)) { int enemyHP = val4.enemyHP; if (((NetworkBehaviour)this).IsOwner) { if (gameObject.TryGetComponent(ref val5)) { val5.Hit(Mathf.Max(1, Plugin.laserpistolMonsterDamage), forward, ((GrabbableObject)this).playerHeldBy, true, -1); } else { val4.HitEnemy(Mathf.Max(1, Plugin.laserpistolMonsterDamage), ((GrabbableObject)this).playerHeldBy, true, -1); } } if (val4.enemyHP < enemyHP || val4.isEnemyDead) { hashSet.Add(val4); flag = true; } } bool flag2 = (Object)(object)gameObject.GetComponent() != (Object)null || (Object)(object)gameObject.GetComponentInChildren() != (Object)null; if (flag || flag2 || !((RaycastHit)(ref hit)).collider.isTrigger) { val3 = RegisterHitAndVisuals(hit, hitPoint, forward); break; } continue; } if (gameObject.TryGetComponent(ref val6)) { if (((NetworkBehaviour)this).IsOwner) { val6.Hit(Mathf.Max(1, Plugin.laserpistolMonsterDamage), forward, ((GrabbableObject)this).playerHeldBy, true, -1); } val3 = RegisterHitAndVisuals(hit, hitPoint, forward); break; } PlayerControllerB val7 = gameObject.GetComponent() ?? gameObject.GetComponentInParent(); if ((Object)(object)val7 != (Object)null) { if (!val7.isPlayerDead && val7.health > 0 && (Object)(object)val7 != (Object)(object)((GrabbableObject)this).playerHeldBy) { if (!TryDamageBugsOnPlayer(val7, Plugin.laserpistolMonsterDamage, forward) && ((NetworkBehaviour)this).IsOwner) { val7.DamagePlayerFromOtherClientServerRpc(Plugin.laserpistolPlayerDamage, forward * 10f, (int)((GrabbableObject)this).playerHeldBy.playerClientId); } val3 = RegisterHitAndVisuals(hit, hitPoint, forward); break; } continue; } Landmine val8 = gameObject.GetComponentInParent() ?? gameObject.GetComponentInChildren(); if ((Object)(object)val8 != (Object)null) { if (((NetworkBehaviour)this).IsOwner && !val8.hasExploded) { val8.ExplodeMineServerRpc(); } val3 = RegisterHitAndVisuals(hit, hitPoint, forward); break; } if (!((RaycastHit)(ref hit)).collider.isTrigger) { val3 = RegisterHitAndVisuals(hit, hitPoint, forward); break; } } if ((Object)(object)laserBeamVFX != (Object)null) { ((MonoBehaviour)this).StartCoroutine(ShootLaserVFX(gunRayPoint.position, val3)); } DrawLaserServerRpc(gunRayPoint.position, val3); if (enableDebugTracers) { CreateDebugVisualsLine(val2, val3, Color.green); } } private Vector3 RegisterHitAndVisuals(RaycastHit hit, Vector3 hitPoint, Vector3 direction) { //IL_000f: 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_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0028: 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_006c: 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_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_0058: 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) NetworkObject componentInParent = ((Component)((RaycastHit)(ref hit)).collider).GetComponentInParent(); SpawnImpactEffectServerRpc(hitPoint, ((RaycastHit)(ref hit)).normal, (NetworkObjectReference)(((Object)(object)componentInParent != (Object)null) ? NetworkObjectReference.op_Implicit(componentInParent) : default(NetworkObjectReference))); if (enableDebugTracers) { CreateDebugVisualsSphere(hitPoint, 0.2f, Color.red); CreateDebugBurnMark(hitPoint, ((RaycastHit)(ref hit)).normal, ((RaycastHit)(ref hit)).transform); } return hitPoint; } private void CreateDebugVisualsLine(Vector3 start, Vector3 end, Color col) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_002d: 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_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Expected O, but got Unknown //IL_0056: 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) GameObject val = new GameObject("DebugLaserLine"); LineRenderer val2 = val.AddComponent(); val2.startWidth = 0.01f; val2.endWidth = 0.01f; val2.SetPosition(0, start); val2.SetPosition(1, end); Material material = new Material(Shader.Find("Sprites/Default")); ((Renderer)val2).material = material; val2.startColor = col; val2.endColor = col; Object.Destroy((Object)(object)val, 2f); } private void CreateDebugVisualsSphere(Vector3 pos, float radius, Color col) { //IL_002d: 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_0046: 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_0077: Expected O, but got Unknown //IL_0086: Unknown result type (might be due to invalid IL or missing references) GameObject val = GameObject.CreatePrimitive((PrimitiveType)0); ((Object)val).name = "DebugHitSphere"; Collider val2 = default(Collider); if (val.TryGetComponent(ref val2)) { Object.Destroy((Object)(object)val2); } val.transform.position = pos; val.transform.localScale = Vector3.one * (radius * 2f); Renderer component = val.GetComponent(); if ((Object)(object)component != (Object)null) { Material material = new Material(Shader.Find("Sprites/Default")); component.material = material; component.material.color = col; } Object.Destroy((Object)(object)val, 2f); } private void CreateDebugBurnMark(Vector3 point, Vector3 normal, Transform parent) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_004e: 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_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_0070: 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_00a1: Expected O, but got Unknown //IL_00b7: Unknown result type (might be due to invalid IL or missing references) GameObject val = GameObject.CreatePrimitive((PrimitiveType)2); ((Object)val).name = "DebugBurnMark"; Collider val2 = default(Collider); if (val.TryGetComponent(ref val2)) { Object.Destroy((Object)(object)val2); } val.transform.localScale = new Vector3(0.5f, 0.005f, 0.5f); val.transform.position = point + normal * 0.02f; val.transform.rotation = Quaternion.FromToRotation(Vector3.up, normal); Renderer component = val.GetComponent(); if ((Object)(object)component != (Object)null) { Material val3 = new Material(Shader.Find("Sprites/Default")); val3.color = new Color(0f, 0.8f, 1f, 0.5f); component.material = val3; } if ((Object)(object)parent != (Object)null) { val.transform.SetParent(parent, true); } Object.Destroy((Object)(object)val, 10f); } [ServerRpc(RequireOwnership = false)] public void DrawLaserServerRpc(Vector3 exactStartPoint, Vector3 exactHitPoint) { //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_0096: 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_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: 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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2647427393u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref exactStartPoint); ((FastBufferWriter)(ref val)).WriteValueSafe(ref exactHitPoint); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2647427393u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; DrawLaserClientRpc(exactStartPoint, exactHitPoint); } } } [ClientRpc] public void DrawLaserClientRpc(Vector3 exactStartPoint, Vector3 exactHitPoint) { //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_0096: 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_0100: 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 = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1349518443u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref exactStartPoint); ((FastBufferWriter)(ref val)).WriteValueSafe(ref exactHitPoint); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1349518443u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsOwner && (Object)(object)laserBeamVFX != (Object)null) { ((MonoBehaviour)this).StartCoroutine(ShootLaserVFX(exactStartPoint, exactHitPoint)); } } } public IEnumerator FireDelay() { cantFire = true; yield return (object)new WaitForSeconds(0.15f); cantFire = false; } public IEnumerator IsShootDelay() { isFiring = true; yield return (object)new WaitForSeconds(0.6f); isFiring = false; safetyLockCoroutine = null; } [ServerRpc(RequireOwnership = false)] public void SpawnImpactEffectServerRpc(Vector3 hitPoint, Vector3 hitNormal, NetworkObjectReference parentNetObj) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: 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_0097: 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_00b1: 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_0123: 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_012a: 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_0134: 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) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013b: 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_0142: 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_018d: 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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3857618597u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref hitPoint); ((FastBufferWriter)(ref val)).WriteValueSafe(ref hitNormal); ((FastBufferWriter)(ref val)).WriteValueSafe(ref parentNetObj, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3857618597u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if ((Object)(object)Plugin.LaserImpactPrefab == (Object)null) { Plugin.mls.LogError((object)"[LaserPistol] КРИТИЧЕСКАЯ ОШИБКА: Plugin.LaserImpactPrefab равен NULL!"); return; } Vector3 val3 = hitPoint + hitNormal * 0.02f; Quaternion val4 = Quaternion.LookRotation(hitNormal); GameObject val5 = Object.Instantiate(Plugin.LaserImpactPrefab, val3, val4); NetworkObject component = val5.GetComponent(); if ((Object)(object)component != (Object)null) { component.Spawn(true); Plugin.mls.LogInfo((object)$"[LaserPistol] Префаб заспавнен. NetworkId: {component.NetworkObjectId}"); AttachImpactEffectClientRpc(NetworkObjectReference.op_Implicit(component), parentNetObj); } else { Plugin.mls.LogError((object)"[LaserPistol] На LaserImpactPrefab отсутствует NetworkObject!"); Object.Destroy((Object)(object)val5); } } [ClientRpc] public void AttachImpactEffectClientRpc(NetworkObjectReference impactNetObjRef, NetworkObjectReference parentNetObjRef) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: 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_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: 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)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(756661966u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref impactNetObjRef, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref parentNetObjRef, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 756661966u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); if (!((NetworkObjectReference)(ref impactNetObjRef)).TryGet(ref val3, (NetworkManager)null)) { return; } NetworkObject val4 = default(NetworkObject); if (((NetworkObjectReference)(ref parentNetObjRef)).TryGet(ref val4, (NetworkManager)null)) { Plugin.mls.LogInfo((object)("[LaserPistol Client] Попали в сетевой объект: " + ((Object)val4).name + ". Клеим декаль!")); HAI_LaserImpact component = ((Component)val3).GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)component.decalProjector != (Object)null) { Transform transform = ((Component)component.decalProjector).transform; transform.SetParent(((Component)val4).transform, true); } } else { Plugin.mls.LogInfo((object)"[LaserPistol Client] Попали в обычную стену/статичный объект. Оставляем декаль на месте."); } } private void ToggleSafetyAndSync() { if (!isFiring && !isSwitchingMode && !isReloading && !isLoading && !isUnloading) { bool flag = !isModeSafe; SetSafetyLocal(flag); localClientSendingSafetyRPC = true; ToggleSafetyServerRpc(flag); } } [ServerRpc(RequireOwnership = false)] public void ToggleSafetyServerRpc(bool newMode) { //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) //IL_00dc: 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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(490333044u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref newMode, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 490333044u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ToggleSafetyClientRpc(newMode); } } } [ClientRpc] public void ToggleSafetyClientRpc(bool newMode) { //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) //IL_00dc: 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.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2722774927u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref newMode, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2722774927u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (localClientSendingSafetyRPC) { localClientSendingSafetyRPC = false; } else { SetSafetyLocal(newMode); } } } private void InitializeSafetyState() { if ((Object)(object)gunAnimator != (Object)null && CustomWeaponBase.AnimatorHasParameter(gunAnimator, "SafetyMode")) { gunAnimator.SetBool("SafetyMode", isModeSafe); } if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null && (Object)(object)((GrabbableObject)this).playerHeldBy.playerBodyAnimator != (Object)null) { Animator playerBodyAnimator = ((GrabbableObject)this).playerHeldBy.playerBodyAnimator; if (CustomWeaponBase.AnimatorHasParameter(playerBodyAnimator, "LaspistSafety")) { playerBodyAnimator.SetBool("LaspistSafety", isModeSafe); } } } private void SetSafetyLocal(bool on) { if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null && (Object)(object)((GrabbableObject)this).playerHeldBy.playerBodyAnimator != (Object)null) { Animator playerBodyAnimator = ((GrabbableObject)this).playerHeldBy.playerBodyAnimator; if (CustomWeaponBase.AnimatorHasParameter(playerBodyAnimator, "LaspistSafety")) { playerBodyAnimator.SetBool("LaspistSafety", on); } if (on && CustomWeaponBase.AnimatorHasParameter(playerBodyAnimator, "LaspistSaveOn")) { playerBodyAnimator.SetTrigger("LaspistSaveOn"); } else if (!on && CustomWeaponBase.AnimatorHasParameter(playerBodyAnimator, "LaspistSaveOff")) { playerBodyAnimator.SetTrigger("LaspistSaveOff"); } } ((MonoBehaviour)this).StopCoroutine("SafetyActionCoroutine"); ((MonoBehaviour)this).StartCoroutine(SafetyActionCoroutine(on)); } private IEnumerator SafetyActionCoroutine(bool on) { isSwitchingMode = true; if ((Object)(object)gunAnimator != (Object)null) { gunAnimator.SetBool("SafetyMode", on); } yield return (object)new WaitForSeconds(11f / 12f); isModeSafe = on; if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null) { ((GrabbableObject)this).playerHeldBy.itemAudio.PlayOneShot(modeSwitchSFX); } yield return (object)new WaitForSeconds(1.5f); isSwitchingMode = false; } private void ToggleInspectAndSync() { if (!((Object)(object)((GrabbableObject)this).playerHeldBy == (Object)null)) { isInspectingToggle = !isInspectingToggle; if (!isInspectingToggle) { lastAction = ActionType.Inspect; stopActionTime = Time.time + 0.7f; } else { stopActionTime = Time.time; } ToggleInspect(); localClientSendingInspectToggleRPC = true; ToggleInspectServerRpc(isInspectingToggle); } } [ServerRpc(RequireOwnership = false)] public void ToggleInspectServerRpc(bool inspecting) { //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) //IL_00dc: 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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(380602742u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref inspecting, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 380602742u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ToggleInspectClientRpc(inspecting); } } } [ClientRpc] public void ToggleInspectClientRpc(bool inspecting) { //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) //IL_00dc: 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.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2086400445u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref inspecting, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2086400445u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (localClientSendingInspectToggleRPC) { localClientSendingInspectToggleRPC = false; return; } isInspectingToggle = inspecting; ToggleInspect(); } } private void ToggleInspect() { if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null && (Object)(object)((GrabbableObject)this).playerHeldBy.playerBodyAnimator != (Object)null && (Object)(object)((GrabbableObject)this).playerHeldBy == (Object)(object)GameNetworkManager.Instance.localPlayerController) { ((MonoBehaviour)this).StartCoroutine(ToggleInspectDelay()); ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.SetBool("LaspistInspectToggle", isInspectingToggle); } } private IEnumerator ToggleInspectDelay() { cantFire = true; float delay = (isInspectingToggle ? 0.5f : 1.2f); yield return (object)new WaitForSeconds(delay); cantFire = false; } public void HoldInspectAndSync() { if (!((Object)(object)((GrabbableObject)this).playerHeldBy == (Object)null)) { isInspectingHold = true; HoldInspect(); localClientSendingInspectHoldRPC = true; HoldInspectServerRpc(inspecting: true); } } [ServerRpc(RequireOwnership = false)] public void HoldInspectServerRpc(bool inspecting) { //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) //IL_00dc: 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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3690280308u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref inspecting, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3690280308u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; HoldInspectClientRpc(inspecting); } } } [ClientRpc] public void HoldInspectClientRpc(bool inspecting) { //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) //IL_00dc: 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.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3826700383u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref inspecting, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3826700383u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (localClientSendingInspectHoldRPC) { localClientSendingInspectHoldRPC = false; return; } isInspectingHold = inspecting; HoldInspect(); } } private void HoldInspect() { if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null && (Object)(object)((GrabbableObject)this).playerHeldBy.playerBodyAnimator != (Object)null) { if ((Object)(object)((GrabbableObject)this).playerHeldBy == (Object)(object)GameNetworkManager.Instance.localPlayerController) { ((MonoBehaviour)this).StartCoroutine(HoldInspectDelay()); ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.SetTrigger("LaspistInspect"); } else { ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.Play("A_Laspist_InspectHold", -1, 0f); } } } private IEnumerator HoldInspectDelay() { yield return (object)new WaitForSeconds(6.75f); isInspectingHold = false; isSwitchingMode = false; cantFire = false; lastAction = ActionType.Inspect; stopActionTime = Time.time; } private void SetAim(bool aiming) { isAiming = aiming; if (aiming) { aimStartTime = Time.time; canZoom = false; } else { canZoom = false; } if ((Object)(object)((GrabbableObject)this).playerHeldBy.playerBodyAnimator != (Object)null) { ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.SetBool("LaspistAimToggle", aiming); } localClientSendingAimRPC = true; SetAimServerRpc(aiming); } [ServerRpc(RequireOwnership = false)] public void SetAimServerRpc(bool aiming) { //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) //IL_00dc: 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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(94616030u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref aiming, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 94616030u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SetAimClientRpc(aiming); } } } [ClientRpc] public void SetAimClientRpc(bool aiming) { //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) //IL_00dc: 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.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1612565818u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref aiming, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1612565818u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (localClientSendingAimRPC) { localClientSendingAimRPC = false; return; } isAiming = aiming; if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null && (Object)(object)((GrabbableObject)this).playerHeldBy.playerBodyAnimator != (Object)null) { ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.SetBool("LaspistAimToggle", aiming); } } private void HandleZoom() { if (!((Object)(object)((GrabbableObject)this).playerHeldBy == (Object)null) && !((Object)(object)((GrabbableObject)this).playerHeldBy.gameplayCamera == (Object)null)) { if (isAiming && !canZoom && Time.time - aimStartTime >= zoomDelay) { canZoom = true; } float fieldOfView = ((GrabbableObject)this).playerHeldBy.gameplayCamera.fieldOfView; float num = (canZoom ? zoomFOV : defaultFOV); if (canZoom || !(Mathf.Abs(fieldOfView - defaultFOV) < 0.1f)) { ((GrabbableObject)this).playerHeldBy.gameplayCamera.fieldOfView = Mathf.Lerp(fieldOfView, num, Time.deltaTime * zoomSpeed); } } } private void ProcessOverheatSystem() { //IL_0218: 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_0289: Unknown result type (might be due to invalid IL or missing references) //IL_028b: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_0378: 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_03e1: Unknown result type (might be due to invalid IL or missing references) //IL_03cb: Unknown result type (might be due to invalid IL or missing references) //IL_0431: Unknown result type (might be due to invalid IL or missing references) //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_043a: Unknown result type (might be due to invalid IL or missing references) //IL_043f: Unknown result type (might be due to invalid IL or missing references) //IL_0594: Unknown result type (might be due to invalid IL or missing references) //IL_0508: Unknown result type (might be due to invalid IL or missing references) //IL_0526: Unknown result type (might be due to invalid IL or missing references) //IL_052b: 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_0565: Unknown result type (might be due to invalid IL or missing references) if (currentHeatLevel <= 0f) { if ((Object)(object)hissAudioSource != (Object)null && hissAudioSource.isPlaying) { hissAudioSource.Stop(); } return; } float num = (isOverheated ? overheatCoolingRate : coolingRate); currentHeatLevel -= num * Time.deltaTime; if ((Object)(object)hissAudioSource != (Object)null && (Object)(object)gunHissLoopSFX != (Object)null) { if (!hissAudioSource.isPlaying) { hissAudioSource.Play(); } float num2 = ((!isOverheated) ? Mathf.Clamp01((currentHeatLevel - 20f) / 80f) : Mathf.Clamp01(currentHeatLevel / 100f)); hissAudioSource.volume = num2 * maxHissVolume; hissAudioSource.pitch = 0.8f + num2 * 0.4f; } if (currentHeatLevel <= 0f) { currentHeatLevel = 0f; if (isOverheated) { isOverheated = false; Plugin.mls.LogInfo((object)"Пистолет полностью остыл, блокировка снята!"); } if ((Object)(object)hissAudioSource != (Object)null && hissAudioSource.isPlaying) { hissAudioSource.Stop(); } } if (gunMaterials == null) { return; } float num3 = currentHeatLevel / 100f; Color val = default(Color); ((Color)(ref val))..ctor(1f, 0.15f, 0.02f); float num4 = 150f; float num5 = Mathf.Pow(num3, 3f) * num4; for (int i = 0; i < gunMaterials.Length; i++) { if ((Object)(object)gunMaterials[i] != (Object)null) { gunMaterials[i].SetColor("_EmissiveColor", val * num5); } } if ((Object)(object)heatPointLight != (Object)null) { Color val2 = default(Color); ((Color)(ref val2))..ctor(0.8f, 0.1f, 0f); Color val3 = default(Color); ((Color)(ref val3))..ctor(1f, 0.8f, 0.4f); heatPointLight.color = Color.Lerp(val2, val3, num3); if (num3 > 0.3f) { float num6 = (num3 - 0.3f) / 0.3f; float num7 = 6f; heatPointLight.intensity = Mathf.Pow(num6, 2f) * num7; } else { heatPointLight.intensity = 0f; } } if ((Object)(object)heatHazeParticles != (Object)null) { if (num3 > 0.3f) { if (!heatHazeParticles.isPlaying) { heatHazeParticles.Play(); } } else if (heatHazeParticles.isPlaying) { heatHazeParticles.Stop(true, (ParticleSystemStopBehavior)1); } } if ((Object)(object)overheatSparks != (Object)null) { EmissionModule emission = overheatSparks.emission; if (num3 > 0.5f) { float num8 = (num3 - 0.5f) / 0.5f; float num9 = Mathf.Lerp(1f, 5f, num8); float num10 = Mathf.Lerp(2f, 10f, num8); ((EmissionModule)(ref emission)).rateOverTime = new MinMaxCurve(num9, num10); } else { ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(0f); } } ParticleSystem[] array = (ParticleSystem[])(object)new ParticleSystem[2] { heatSteam1Particles, heatSteam2Particles }; ParticleSystem[] array2 = array; foreach (ParticleSystem val4 in array2) { if (!((Object)(object)val4 != (Object)null)) { continue; } EmissionModule emission2 = val4.emission; MainModule main = val4.main; if (num3 > 0.2f) { if (!val4.isPlaying) { val4.Play(); } float num11 = (num3 - 0.2f) / 0.8f; float num12 = Mathf.Lerp(15f, 50f, num11); float num13 = Mathf.Lerp(0.4f, 0.9f, num11); float num14 = Mathf.Lerp(0.07f, 0.2f, num11); float num15 = Mathf.Lerp(0.2f, 0.8f, num11); if (isOverheated && currentHeatLevel > 85f) { num12 = 100f; num13 = 1.5f; num14 = 0.4f; num15 = 1f; } ((EmissionModule)(ref emission2)).rateOverTime = MinMaxCurve.op_Implicit(num12); ((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(new Color(1f, 1f, 1f, num15)); ((MainModule)(ref main)).startSpeed = new MinMaxCurve(num13 * 0.8f, num13 * 1.2f); ((MainModule)(ref main)).startSize = new MinMaxCurve(num14 * 0.8f, num14 * 1.2f); } else { if (val4.isPlaying) { val4.Stop(true, (ParticleSystemStopBehavior)1); } ((EmissionModule)(ref emission2)).rateOverTime = MinMaxCurve.op_Implicit(0f); } } } private void ApplyHeatPerShot() { currentHeatLevel += heatPerShot; if (currentHeatLevel >= 100f) { currentHeatLevel = 100f; isOverheated = true; if ((Object)(object)overheatSFX != (Object)null) { gunAudio.PlayOneShot(overheatSFX, shootVolume * 0.75f); } if (overheatAnimCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(overheatAnimCoroutine); } overheatAnimCoroutine = ((MonoBehaviour)this).StartCoroutine(OverheatReactionRoutine()); } else if (currentHeatLevel >= heatWarningThreshold && (Object)(object)overheatBeepSFX != (Object)null && Time.time >= lastBeepTime + 3f) { gunAudio.PlayOneShot(overheatBeepSFX, triggerVolume * 0.75f); lastBeepTime = Time.time; } } private IEnumerator OverheatReactionRoutine() { isPlayingOverheatAnim = true; cantFire = true; if (isAiming) { SetAim(aiming: false); } if (isInspectingHold || isInspectingToggle) { isInspectingHold = false; isInspectingToggle = false; if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null && (Object)(object)((GrabbableObject)this).playerHeldBy.playerBodyAnimator != (Object)null) { ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.SetBool("LaspistInspectToggle", false); } } if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null && (Object)(object)((GrabbableObject)this).playerHeldBy.playerBodyAnimator != (Object)null) { ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.SetTrigger("LaspistOverheat"); } if ((Object)(object)gunAnimator != (Object)null) { gunAnimator.SetTrigger("OverheatTrigger"); } if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null && (Object)(object)((GrabbableObject)this).playerHeldBy == (Object)(object)GameNetworkManager.Instance.localPlayerController) { ((GrabbableObject)this).playerHeldBy.isGrabbingObjectAnimation = true; } yield return (object)new WaitForSeconds(5f); isPlayingOverheatAnim = false; cantFire = false; if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null && (Object)(object)((GrabbableObject)this).playerHeldBy == (Object)(object)GameNetworkManager.Instance.localPlayerController) { ((GrabbableObject)this).playerHeldBy.isGrabbingObjectAnimation = false; } overheatAnimCoroutine = null; } private IEnumerator ShootLaserVFX(Vector3 startPoint, Vector3 endPoint) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)laserBeamVFX == (Object)null) { yield break; } GameObject tempLaserObj = Object.Instantiate(((Component)laserBeamVFX).gameObject); tempLaserObj.transform.SetParent((Transform)null, true); LineRenderer tempBeam = tempLaserObj.GetComponent(); float duration = 0.2f; float maxBeamWidth = 0.2f; float maxHdrIntensity = 3.5f; Color baseLaserColor = new Color(1f, 0.15f, 0.05f); Vector3 flashStart = (((Object)(object)gunRayPoint != (Object)null) ? gunRayPoint.position : startPoint); float totalBeamLength = Vector3.Distance(flashStart, endPoint); Vector3 val = endPoint - flashStart; Vector3 beamDirection = ((Vector3)(ref val)).normalized; tempBeam.useWorldSpace = true; tempBeam.positionCount = 2; ((Renderer)tempBeam).enabled = true; if ((Object)(object)((Renderer)tempBeam).material != (Object)null) { ((Renderer)tempBeam).material.EnableKeyword("_EMISSION"); ((Renderer)tempBeam).material.SetColor("_BaseColor", baseLaserColor); } if (beamDirection != Vector3.zero) { if ((Object)(object)frontMuzzleFlash != (Object)null) { frontMuzzleFlash.SetActive(true); frontMuzzleFlash.transform.LookAt(endPoint); } if ((Object)(object)sideMuzzleFlash != (Object)null) { sideMuzzleFlash.SetActive(true); } } int lightsCount = Mathf.Clamp(Mathf.RoundToInt(totalBeamLength / 1.5f), 1, 12); GameObject[] lightObjs = (GameObject[])(object)new GameObject[lightsCount]; Light[] lights = (Light[])(object)new Light[lightsCount]; for (int i = 0; i < lightsCount; i++) { lightObjs[i] = new GameObject($"LaserLight_Segment_{i}"); lights[i] = lightObjs[i].AddComponent(); lights[i].type = (LightType)2; lights[i].color = baseLaserColor; lights[i].range = 3.5f; lights[i].intensity = 100f; lights[i].shadows = (LightShadows)0; } GameObject tempAudioObj = null; AudioSource tempAudioSource = null; float startPitch = Random.Range(0.9f, 1.15f); if ((Object)(object)Plugin.laserBeamLoopClip != (Object)null) { tempAudioObj = new GameObject("TempLaserAudio_" + ((NetworkBehaviour)this).NetworkObjectId); tempAudioSource = tempAudioObj.AddComponent(); tempAudioSource.clip = Plugin.laserBeamLoopClip; tempAudioSource.spatialBlend = 1f; tempAudioSource.rolloffMode = (AudioRolloffMode)1; tempAudioSource.minDistance = 0.5f; tempAudioSource.maxDistance = 3f; tempAudioSource.loop = true; tempAudioSource.volume = 1f; tempAudioSource.pitch = startPitch; tempAudioSource.Play(); } Transform listenerTransform = null; if ((Object)(object)GameNetworkManager.Instance != (Object)null && (Object)(object)GameNetworkManager.Instance.localPlayerController != (Object)null) { listenerTransform = ((Component)GameNetworkManager.Instance.localPlayerController.gameplayCamera).transform; } float elapsed = 0f; while (elapsed < duration) { elapsed += Time.deltaTime; float percent = elapsed / duration; Vector3 currentStart = (((Object)(object)gunRayPoint != (Object)null) ? gunRayPoint.position : startPoint); Vector3 currentDirection; if (((NetworkBehaviour)this).IsOwner) { Vector3 val2; if (!((Object)(object)gunRayPoint != (Object)null)) { val = endPoint - currentStart; val2 = ((Vector3)(ref val)).normalized; } else { val2 = gunRayPoint.forward; } currentDirection = val2; } else { val = endPoint - currentStart; currentDirection = ((Vector3)(ref val)).normalized; } Vector3 currentEnd = currentStart + currentDirection * totalBeamLength; tempBeam.SetPosition(0, currentStart); tempBeam.SetPosition(1, currentEnd); float currentWidth = (tempBeam.startWidth = Mathf.Lerp(maxBeamWidth, 0f, percent)); tempBeam.endWidth = currentWidth; float currentIntensity = Mathf.Lerp(maxHdrIntensity, 0f, percent); Color currentColor = (tempBeam.endColor = (tempBeam.startColor = baseLaserColor * currentIntensity)); if ((Object)(object)((Renderer)tempBeam).material != (Object)null) { ((Renderer)tempBeam).material.SetColor("_EmissionColor", currentColor); } for (int j = 0; j < lightsCount; j++) { float fraction = ((float)j + 0.5f) / (float)lightsCount; if ((Object)(object)lightObjs[j] != (Object)null) { lightObjs[j].transform.position = Vector3.Lerp(currentStart, currentEnd, fraction); lights[j].intensity = Mathf.Lerp(100f, 0f, percent * 1.5f); } } if ((Object)(object)tempAudioObj != (Object)null && (Object)(object)listenerTransform != (Object)null) { Vector3 closestPoint = GetClosestPointOnSegment(currentStart, currentEnd, listenerTransform.position); tempAudioObj.transform.position = closestPoint; float timeLeft = duration - elapsed; if (timeLeft <= 0.08f) { float fadePercent = (tempAudioSource.volume = Mathf.Clamp01(timeLeft / 0.08f)); tempAudioSource.pitch = Mathf.Lerp(startPitch * 0.6f, startPitch, fadePercent); } } yield return null; } if ((Object)(object)frontMuzzleFlash != (Object)null) { frontMuzzleFlash.SetActive(false); } if ((Object)(object)sideMuzzleFlash != (Object)null) { sideMuzzleFlash.SetActive(false); } if ((Object)(object)tempAudioObj != (Object)null) { tempAudioSource.Stop(); Object.Destroy((Object)(object)tempAudioObj); } for (int k = 0; k < lightsCount; k++) { if ((Object)(object)lightObjs[k] != (Object)null) { Object.Destroy((Object)(object)lightObjs[k]); } } Object.Destroy((Object)(object)tempLaserObj); } private void AttachBatteryToHand(PlayerControllerB player) { //IL_0108: 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_0152: 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_009d: 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) if (!((Object)(object)laserCellInHandMesh == (Object)null) && !((Object)(object)player == (Object)null)) { ((Renderer)laserCellInHandMesh).enabled = true; if ((Object)(object)player == (Object)(object)GameNetworkManager.Instance.localPlayerController) { ((Component)laserCellInHandMesh).transform.SetParent(player.leftHandItemTarget); ((Component)laserCellInHandMesh).transform.localPosition = new Vector3(0.04f, 0.09f, -0.1f); ((Component)laserCellInHandMesh).transform.localEulerAngles = new Vector3(355f, 160f, 60f); ((Component)laserCellInHandMesh).transform.localScale = new Vector3(1.4f, 1.4f, 1.4f); } else { Transform thirdPersonLeftHand = GetThirdPersonLeftHand(player); ((Component)laserCellInHandMesh).transform.SetParent(thirdPersonLeftHand); ((Component)laserCellInHandMesh).transform.localPosition = new Vector3(0f, 0.1f, -0.12f); ((Component)laserCellInHandMesh).transform.localEulerAngles = new Vector3(0f, 180f, 0f); ((Component)laserCellInHandMesh).transform.localScale = new Vector3(1.4f, 1.4f, 1.4f); } } } private Transform GetThirdPersonLeftHand(PlayerControllerB player) { if ((Object)(object)player == (Object)null || (Object)(object)player.playerBodyAnimator == (Object)null) { return null; } Transform val = FindChildRecursive(((Component)player.playerBodyAnimator).transform, "hand.L") ?? FindChildRecursive(((Component)player.playerBodyAnimator).transform, "Hand.L"); if ((Object)(object)val != (Object)null) { return val; } return player.serverItemHolder; } private Transform FindChildRecursive(Transform parent, string name) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown foreach (Transform item in parent) { Transform val = item; if (((Object)val).name == name) { return val; } Transform val2 = FindChildRecursive(val, name); if ((Object)(object)val2 != (Object)null) { return val2; } } return null; } [ServerRpc(RequireOwnership = false)] public void UpdateBatteryChargeServerRpc(float newCharge) { //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) //IL_00dc: 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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3054963906u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref newCharge, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3054963906u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; currentBatteryCharge = newCharge; UpdateBatteryChargeClientRpc(newCharge); } } } [ClientRpc] public void UpdateBatteryChargeClientRpc(float newCharge) { //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) //IL_00dc: 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.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(690850587u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref newCharge, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 690850587u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; currentBatteryCharge = newCharge; } } } private Vector3 GetClosestPointOnSegment(Vector3 lineStart, Vector3 lineEnd, Vector3 point) { //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_0008: 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_001a: 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_0020: 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_0022: 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_0037: 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_003e: 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_0047: Unknown result type (might be due to invalid IL or missing references) Vector3 val = lineEnd - lineStart; float magnitude = ((Vector3)(ref val)).magnitude; ((Vector3)(ref val)).Normalize(); Vector3 val2 = point - lineStart; float num = Vector3.Dot(val2, val); num = Mathf.Clamp(num, 0f, magnitude); return lineStart + val * num; } private IEnumerator PlayDelayedDischargeBeep(float delay) { yield return (object)new WaitForSeconds(delay); if ((Object)(object)gunAudio != (Object)null && (Object)(object)dischargedBeepSFX != (Object)null) { gunAudio.PlayOneShot(dischargedBeepSFX); } } private int FindBestBatteryInInventory() { int result = -1; float num = -1f; for (int i = 0; i < ((GrabbableObject)this).playerHeldBy.ItemSlots.Length; i++) { if (((GrabbableObject)this).playerHeldBy.ItemSlots[i] is HAI_LaserCellItem hAI_LaserCellItem && hAI_LaserCellItem.currentBatteryCharge > num) { num = hAI_LaserCellItem.currentBatteryCharge; result = i; } } return result; } private void ResetInteractionState() { //IL_0119: Unknown result type (might be due to invalid IL or missing references) ((MonoBehaviour)this).StopAllCoroutines(); isReloading = false; isLoading = false; isUnloading = false; isSwitchingMode = false; cantFire = false; isFiring = false; isInspectingToggle = false; isInspectingHold = false; if ((Object)(object)gunAnimator != (Object)null) { gunAnimator.ResetTrigger("LoadTrigger"); gunAnimator.ResetTrigger("UnloadTrigger"); gunAnimator.ResetTrigger("Shoot"); gunAnimator.Rebind(); gunAnimator.SetBool("SafetyMode", isModeSafe); } if ((Object)(object)gunAudio != (Object)null) { gunAudio.Stop(); } if ((Object)(object)laserCellInPistolMesh != (Object)null) { ((Renderer)laserCellInPistolMesh).enabled = isLoaded; } if ((Object)(object)laserCellInHandMesh != (Object)null) { ((Component)laserCellInHandMesh).transform.SetParent(((Component)this).transform); ((Component)laserCellInHandMesh).transform.localPosition = Vector3.zero; ((Renderer)laserCellInHandMesh).enabled = false; } if ((Object)(object)frontMuzzleFlash != (Object)null) { frontMuzzleFlash.SetActive(false); } if ((Object)(object)sideMuzzleFlash != (Object)null) { sideMuzzleFlash.SetActive(false); } } private bool TryDamageBugsOnPlayer(PlayerControllerB player, int damage, Vector3 direction) { bool result = false; CentipedeAI[] array = Object.FindObjectsByType((FindObjectsSortMode)0); CentipedeAI[] array2 = array; foreach (CentipedeAI val in array2) { if ((Object)(object)val.clingingToPlayer == (Object)(object)player) { if (((NetworkBehaviour)this).IsOwner) { ((EnemyAI)val).HitEnemy(damage, ((GrabbableObject)this).playerHeldBy, true, -1); } result = true; } } FlowerSnakeEnemy[] array3 = Object.FindObjectsByType((FindObjectsSortMode)0); FlowerSnakeEnemy[] array4 = array3; foreach (FlowerSnakeEnemy val2 in array4) { if ((Object)(object)val2.clingingToPlayer == (Object)(object)player) { if (((NetworkBehaviour)this).IsOwner) { ((EnemyAI)val2).HitEnemy(damage, ((GrabbableObject)this).playerHeldBy, true, -1); } result = true; } } return result; } protected override void __initializeVariables() { base.__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 //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Expected O, but got Unknown //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Expected O, but got Unknown //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Expected O, but got Unknown //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Expected O, but got Unknown //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Expected O, but got Unknown //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Expected O, but got Unknown //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Expected O, but got Unknown //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Expected O, but got Unknown //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Expected O, but got Unknown //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Expected O, but got Unknown //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Expected O, but got Unknown //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Expected O, but got Unknown //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Expected O, but got Unknown //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Expected O, but got Unknown //IL_0291: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Expected O, but got Unknown //IL_02ad: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: Expected O, but got Unknown //IL_02c9: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: Expected O, but got Unknown //IL_02e5: Unknown result type (might be due to invalid IL or missing references) //IL_02f4: Expected O, but got Unknown //IL_0301: Unknown result type (might be due to invalid IL or missing references) //IL_0310: Expected O, but got Unknown //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_032c: Expected O, but got Unknown //IL_0339: Unknown result type (might be due to invalid IL or missing references) //IL_0348: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1938303309u, new RpcReceiveHandler(__rpc_handler_1938303309), "LoadingBatteryServerRpc"); ((NetworkBehaviour)this).__registerRpc(3712541605u, new RpcReceiveHandler(__rpc_handler_3712541605), "LoadingBatteryClientRpc"); ((NetworkBehaviour)this).__registerRpc(934035097u, new RpcReceiveHandler(__rpc_handler_934035097), "StartLoadingAnimServerRpc"); ((NetworkBehaviour)this).__registerRpc(1310277019u, new RpcReceiveHandler(__rpc_handler_1310277019), "StartLoadingAnimClientRpc"); ((NetworkBehaviour)this).__registerRpc(3874444791u, new RpcReceiveHandler(__rpc_handler_3874444791), "UnloadingBatteryServerRpc"); ((NetworkBehaviour)this).__registerRpc(939315948u, new RpcReceiveHandler(__rpc_handler_939315948), "PutBatteryInInventoryClientRpc"); ((NetworkBehaviour)this).__registerRpc(1886824032u, new RpcReceiveHandler(__rpc_handler_1886824032), "UnloadingBatteryClientRpc"); ((NetworkBehaviour)this).__registerRpc(3034604027u, new RpcReceiveHandler(__rpc_handler_3034604027), "StartUnloadingAnimServerRpc"); ((NetworkBehaviour)this).__registerRpc(782906883u, new RpcReceiveHandler(__rpc_handler_782906883), "StartUnloadingAnimClientRpc"); ((NetworkBehaviour)this).__registerRpc(2099770589u, new RpcReceiveHandler(__rpc_handler_2099770589), "SwapBatteryServerRpc"); ((NetworkBehaviour)this).__registerRpc(2691986716u, new RpcReceiveHandler(__rpc_handler_2691986716), "SwapBatteryClientRpc"); ((NetworkBehaviour)this).__registerRpc(2397147515u, new RpcReceiveHandler(__rpc_handler_2397147515), "StartReloadingAnimServerRpc"); ((NetworkBehaviour)this).__registerRpc(3061713370u, new RpcReceiveHandler(__rpc_handler_3061713370), "StartReloadingAnimClientRpc"); ((NetworkBehaviour)this).__registerRpc(200801177u, new RpcReceiveHandler(__rpc_handler_200801177), "ShootGunServerRpc"); ((NetworkBehaviour)this).__registerRpc(96360082u, new RpcReceiveHandler(__rpc_handler_96360082), "ShootGunClientRpc"); ((NetworkBehaviour)this).__registerRpc(1371484872u, new RpcReceiveHandler(__rpc_handler_1371484872), "PlayDischargeBeepClientRpc"); ((NetworkBehaviour)this).__registerRpc(2647427393u, new RpcReceiveHandler(__rpc_handler_2647427393), "DrawLaserServerRpc"); ((NetworkBehaviour)this).__registerRpc(1349518443u, new RpcReceiveHandler(__rpc_handler_1349518443), "DrawLaserClientRpc"); ((NetworkBehaviour)this).__registerRpc(3857618597u, new RpcReceiveHandler(__rpc_handler_3857618597), "SpawnImpactEffectServerRpc"); ((NetworkBehaviour)this).__registerRpc(756661966u, new RpcReceiveHandler(__rpc_handler_756661966), "AttachImpactEffectClientRpc"); ((NetworkBehaviour)this).__registerRpc(490333044u, new RpcReceiveHandler(__rpc_handler_490333044), "ToggleSafetyServerRpc"); ((NetworkBehaviour)this).__registerRpc(2722774927u, new RpcReceiveHandler(__rpc_handler_2722774927), "ToggleSafetyClientRpc"); ((NetworkBehaviour)this).__registerRpc(380602742u, new RpcReceiveHandler(__rpc_handler_380602742), "ToggleInspectServerRpc"); ((NetworkBehaviour)this).__registerRpc(2086400445u, new RpcReceiveHandler(__rpc_handler_2086400445), "ToggleInspectClientRpc"); ((NetworkBehaviour)this).__registerRpc(3690280308u, new RpcReceiveHandler(__rpc_handler_3690280308), "HoldInspectServerRpc"); ((NetworkBehaviour)this).__registerRpc(3826700383u, new RpcReceiveHandler(__rpc_handler_3826700383), "HoldInspectClientRpc"); ((NetworkBehaviour)this).__registerRpc(94616030u, new RpcReceiveHandler(__rpc_handler_94616030), "SetAimServerRpc"); ((NetworkBehaviour)this).__registerRpc(1612565818u, new RpcReceiveHandler(__rpc_handler_1612565818), "SetAimClientRpc"); ((NetworkBehaviour)this).__registerRpc(3054963906u, new RpcReceiveHandler(__rpc_handler_3054963906), "UpdateBatteryChargeServerRpc"); ((NetworkBehaviour)this).__registerRpc(690850587u, new RpcReceiveHandler(__rpc_handler_690850587), "UpdateBatteryChargeClientRpc"); base.__initializeRpcs(); } private static void __rpc_handler_1938303309(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)1; ((HAI_LaserPistolItem)(object)target).LoadingBatteryServerRpc(slot); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3712541605(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) { float newCharge = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref newCharge, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((HAI_LaserPistolItem)(object)target).LoadingBatteryClientRpc(newCharge); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_934035097(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; ((HAI_LaserPistolItem)(object)target).StartLoadingAnimServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1310277019(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; ((HAI_LaserPistolItem)(object)target).StartLoadingAnimClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3874444791(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; ((HAI_LaserPistolItem)(object)target).UnloadingBatteryServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_939315948(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_003e: 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_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference batteryRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref batteryRef, default(ForNetworkSerializable)); int slotIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref slotIndex); target.__rpc_exec_stage = (__RpcExecStage)1; ((HAI_LaserPistolItem)(object)target).PutBatteryInInventoryClientRpc(batteryRef, slotIndex); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1886824032(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; ((HAI_LaserPistolItem)(object)target).UnloadingBatteryClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3034604027(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; ((HAI_LaserPistolItem)(object)target).StartUnloadingAnimServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_782906883(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; ((HAI_LaserPistolItem)(object)target).StartUnloadingAnimClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2099770589(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)1; ((HAI_LaserPistolItem)(object)target).SwapBatteryServerRpc(slot); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2691986716(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) { float newGunCharge = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref newGunCharge, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((HAI_LaserPistolItem)(object)target).SwapBatteryClientRpc(newGunCharge); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2397147515(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; ((HAI_LaserPistolItem)(object)target).StartReloadingAnimServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3061713370(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; ((HAI_LaserPistolItem)(object)target).StartReloadingAnimClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_200801177(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; ((HAI_LaserPistolItem)(object)target).ShootGunServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_96360082(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 isRealShot = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref isRealShot, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((HAI_LaserPistolItem)(object)target).ShootGunClientRpc(isRealShot); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1371484872(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; ((HAI_LaserPistolItem)(object)target).PlayDischargeBeepClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2647427393(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004e: 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_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 exactStartPoint = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref exactStartPoint); Vector3 exactHitPoint = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref exactHitPoint); target.__rpc_exec_stage = (__RpcExecStage)1; ((HAI_LaserPistolItem)(object)target).DrawLaserServerRpc(exactStartPoint, exactHitPoint); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1349518443(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004e: 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_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 exactStartPoint = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref exactStartPoint); Vector3 exactHitPoint = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref exactHitPoint); target.__rpc_exec_stage = (__RpcExecStage)1; ((HAI_LaserPistolItem)(object)target).DrawLaserClientRpc(exactStartPoint, exactHitPoint); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3857618597(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0049: 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) //IL_0069: 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_0080: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 hitPoint = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref hitPoint); Vector3 hitNormal = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref hitNormal); NetworkObjectReference parentNetObj = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref parentNetObj, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((HAI_LaserPistolItem)(object)target).SpawnImpactEffectServerRpc(hitPoint, hitNormal, parentNetObj); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_756661966(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_004a: 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_005f: 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_006e: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference impactNetObjRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref impactNetObjRef, default(ForNetworkSerializable)); NetworkObjectReference parentNetObjRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref parentNetObjRef, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((HAI_LaserPistolItem)(object)target).AttachImpactEffectClientRpc(impactNetObjRef, parentNetObjRef); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_490333044(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 newMode = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref newMode, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((HAI_LaserPistolItem)(object)target).ToggleSafetyServerRpc(newMode); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2722774927(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 newMode = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref newMode, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((HAI_LaserPistolItem)(object)target).ToggleSafetyClientRpc(newMode); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_380602742(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 inspecting = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref inspecting, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((HAI_LaserPistolItem)(object)target).ToggleInspectServerRpc(inspecting); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2086400445(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 inspecting = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref inspecting, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((HAI_LaserPistolItem)(object)target).ToggleInspectClientRpc(inspecting); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3690280308(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 inspecting = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref inspecting, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((HAI_LaserPistolItem)(object)target).HoldInspectServerRpc(inspecting); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3826700383(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 inspecting = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref inspecting, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((HAI_LaserPistolItem)(object)target).HoldInspectClientRpc(inspecting); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_94616030(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 aimServerRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref aimServerRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((HAI_LaserPistolItem)(object)target).SetAimServerRpc(aimServerRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1612565818(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 aimClientRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref aimClientRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((HAI_LaserPistolItem)(object)target).SetAimClientRpc(aimClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3054963906(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) { float newCharge = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref newCharge, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((HAI_LaserPistolItem)(object)target).UpdateBatteryChargeServerRpc(newCharge); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_690850587(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) { float newCharge = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref newCharge, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((HAI_LaserPistolItem)(object)target).UpdateBatteryChargeClientRpc(newCharge); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "HAI_LaserPistolItem"; } } public class InputActions : LcInputActions { [HarmonyPatch(typeof(HUDManager), "PingScan_performed")] public static class BlockScanPatch { [HarmonyPrefix] public static bool Prefix(CallbackContext context) { if (((CallbackContext)(ref context)).control == null || !((CallbackContext)(ref context)).control.path.ToLower().Contains("rightbutton")) { return true; } PlayerControllerB val = GameNetworkManager.Instance?.localPlayerController; if ((Object)(object)val?.currentlyHeldObjectServer == (Object)null) { return true; } if (val.currentlyHeldObjectServer is CustomWeaponBase) { return false; } return true; } } [InputAction(/*Could not decode attribute arguments.*/)] public InputAction WeaponReloadKey { get; set; } [InputAction(/*Could not decode attribute arguments.*/)] public InputAction InspectKey { get; set; } [InputAction(/*Could not decode attribute arguments.*/)] public InputAction WeaponAimKey { get; set; } [InputAction(/*Could not decode attribute arguments.*/)] public InputAction WeaponFireModeKey { get; set; } [InputAction(/*Could not decode attribute arguments.*/)] public InputAction WeaponScanKey { get; set; } } [BepInPlugin("HAI_laserweapons", "H.A.I. Laser Weaponry Pack", "1.0.0.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { private const string modGUID = "HAI_laserweapons"; private const string modName = "H.A.I. Laser Weaponry Pack"; private const string modVersion = "1.0.0.0"; public static readonly NamespacedKey LaserCellKey = NamespacedKey.From("HAI_laserweapons", "laser_cell"); public static readonly NamespacedKey LaserPistolKey = NamespacedKey.From("HAI_laserweapons", "laser_pistol"); public static readonly NamespacedKey LaserEmitterPistolKey = NamespacedKey.From("HAI_laserweapons", "laser_emitter_pistol"); public static readonly NamespacedKey LaserSMGKey = NamespacedKey.From("HAI_laserweapons", "laser_smg"); public static readonly NamespacedKey LaserCarbineKey = NamespacedKey.From("HAI_laserweapons", "laser_carbine"); public static readonly NamespacedKey LaserSniperKey = NamespacedKey.From("HAI_laserweapons", "laser_precision_rifle"); private readonly Harmony harmony = new Harmony("HAI_laserweapons"); private static Plugin Instance; public static AssetBundle Bundle; public static ManualLogSource mls; internal static InputActions InputActionInstance = new InputActions(); public static bool translateRussian; public static GameObject LaserImpactPrefab; public static GameObject lasercellAmmoPrefab; public static GameObject laserheavycellAmmoPrefab; public static GameObject laseremitterpistolPrefab; public static GameObject laserpistolPrefab; public static GameObject lasersmgPrefab; public static GameObject lasercarbinePrefab; public static GameObject lasersniperPrefab; public static GameObject laserlmgPrefab; public static GameObject laserminigunPrefab; public static GameObject lasercannonPrefab; public static Item lasercellAmmoItem; public static Item laserheavycellAmmoItem; public static Item laseremitterpistolItem; public static Item laserpistolItem; public static Item lasersmgItem; public static Item lasercarbineItem; public static Item lasersniperItem; public static Item laserlmgItem; public static Item laserminigunItem; public static Item lasercannonItem; public static int lasercellRarity = 0; public static int lasercellPrice = 1250; public static int laserheavycellRarity; public static int laserheavycellPrice; public static int laseremitterpistolRarity = 0; public static int laseremitterpistolPrice = 2500; public static int laseremitterpistolPlayerDamage = 20; public static int laseremitterpistolMonsterDamage = 1; public static int laserpistolRarity = 0; public static int laserpistolPrice = 750; public static int laserpistolPlayerDamage = 60; public static int laserpistolMonsterDamage = 3; public static int lasersmgRarity = 0; public static int lasersmgPrice = 7000; public static int lasersmgPlayerDamage = 60; public static int lasersmgMonsterDamage = 3; public static int lasercarbineRarity = 0; public static int lasercarbinePrice = 10000; public static int lasercarbinePlayerDamage = 100; public static int lasercarbineMonsterDamage = 5; public static int lasersniperRarity = 0; public static int lasersniperPrice = 12000; public static int lasersniperPlayerDamage = 200; public static int lasersniperMonsterDamage = 10; public static int laserlmgRarity; public static int laserlmgPrice; public static int laserlmgPlayerDamage; public static int laserlmgMonsterDamage; public static int laserminigunRarity; public static int laserminigunPrice0; public static int laserminigunPlayerDamage; public static int laserminigunMonsterDamage; public static int lasercannonRarity; public static int lasercannonPrice; public static int lasercannonPlayerDamage; public static int lasercannonMonsterDamage; public static TerminalNode lasercellAmmoItemShopInfo; public static TerminalNode laserpistolItemShopInfo; public static TerminalNode laseremitterpistolShopInfo; public static TerminalNode lasersmgShopInfo; public static TerminalNode lasercarbineShopInfo; public static TerminalNode lasersniperShopInfo; public static AudioClip laserpistolUnload; public static AudioClip laserpistolLoad; public static AudioClip laserpistolSafeTrigger; public static AudioClip laserpistolOverheat; public static AudioClip laserweaponToggleFireMode; public static AudioClip laseremitterpistolLaserStart; public static AudioClip laseremitterpistolLaserLoop; public static AudioClip laseremitterpistolLaserEnd; public static AudioClip laserpistolShoot1; public static AudioClip laserpistolShoot2; public static AudioClip laserpistolShoot3; public static AudioClip laserweaponTrigger; public static AudioClip laserweaponOverheatBeep; public static AudioClip laserpistolOverheatLoop; public static AudioClip laserweaponDischargedBeep; public static AudioClip laserBeamLoopClip; public static RuntimeAnimatorController playerAnimator; public static RuntimeAnimatorController otherPlayerAnimator; public static string PluginDirectory; private void LoadAssets() { try { Bundle = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(PluginDirectory), "hai_laserweapons")); } catch (Exception ex) { mls.LogError((object)("Couldn't load asset bundle: " + ex.Message)); return; } try { LaserImpactPrefab = Bundle.LoadAsset("HAI_laserimpact.prefab"); lasercellAmmoPrefab = Bundle.LoadAsset("HAI_lasercell.prefab"); laserpistolPrefab = Bundle.LoadAsset("HAI_laserpistol.prefab"); laseremitterpistolPrefab = Bundle.LoadAsset("HAI_Laseremitterpistol.prefab"); lasersmgPrefab = Bundle.LoadAsset("HAI_LaserSMG.prefab"); lasercarbinePrefab = Bundle.LoadAsset("HAI_LaserCarbine.prefab"); lasersniperPrefab = Bundle.LoadAsset("HAI_LaserPrecisionRifle.prefab"); lasercellAmmoItem = Bundle.LoadAsset("HAI_Lasercell_item.asset"); laserpistolItem = Bundle.LoadAsset("HAI_Laserpistol_item.asset"); laseremitterpistolItem = Bundle.LoadAsset("HAI_Laseremitterpistol_item.asset"); lasersmgItem = Bundle.LoadAsset("HAI_LaserSMG_item.asset"); lasercarbineItem = Bundle.LoadAsset("HAI_LaserCarbine_item.asset"); lasersniperItem = Bundle.LoadAsset("HAI_LaserPrecisionRifle_item.asset"); playerAnimator = Bundle.LoadAsset("PlayerAnimator.controller"); otherPlayerAnimator = Bundle.LoadAsset("OtherPlayerAnimator.controller"); laserpistolOverheat = Bundle.LoadAsset("GunOverheat.wav"); laserweaponOverheatBeep = Bundle.LoadAsset("GunOverheatBeep.mp3"); laserpistolOverheatLoop = Bundle.LoadAsset("GunHissLoop.wav"); laserpistolUnload = Bundle.LoadAsset("PistolBatteryUnload.mp3"); laserpistolLoad = Bundle.LoadAsset("PistolBatteryLoad.mp3"); laserweaponDischargedBeep = Bundle.LoadAsset("DiscgargedBeeps.mp3"); laserweaponTrigger = Bundle.LoadAsset("WeaponTriggerClick.wav"); laserpistolSafeTrigger = Bundle.LoadAsset("SaveModeToggle.mp3"); laserpistolShoot1 = Bundle.LoadAsset("weapon_laser_pistol_1.ogg"); laserpistolShoot2 = Bundle.LoadAsset("weapon_laser_pistol_2.ogg"); laserpistolShoot3 = Bundle.LoadAsset("weapon_laser_pistol_3.ogg"); laseremitterpistolLaserLoop = Bundle.LoadAsset("LaserEmmiterLoop.wav"); laserBeamLoopClip = Bundle.LoadAsset("LaserLoop.wav"); lasercellAmmoItem.disallowUtilitySlot = true; laserpistolItem.disallowUtilitySlot = true; laseremitterpistolItem.disallowUtilitySlot = true; DawnLib.RegisterNetworkPrefab(LaserImpactPrefab); DawnLib.RegisterNetworkPrefab(lasercellAmmoPrefab); DawnLib.RegisterNetworkPrefab(laserpistolPrefab); DawnLib.RegisterNetworkPrefab(laseremitterpistolPrefab); DawnLib.RegisterNetworkPrefab(lasersmgPrefab); DawnLib.RegisterNetworkPrefab(lasercarbinePrefab); DawnLib.RegisterNetworkPrefab(lasersniperPrefab); if ((Object)(object)LaserImpactPrefab != (Object)null) { DawnLib.RegisterNetworkPrefab(LaserImpactPrefab); Transform transform = LaserImpactPrefab.transform; ParticleSystem[] array = (ParticleSystem[])(object)new ParticleSystem[4]; Transform obj = transform.Find("VFX_smokehite"); array[0] = ((obj != null) ? ((Component)obj).GetComponent() : null); Transform obj2 = transform.Find("VFX_hitflash"); array[1] = ((obj2 != null) ? ((Component)obj2).GetComponent() : null); Transform obj3 = transform.Find("VFX_sparks"); array[2] = ((obj3 != null) ? ((Component)obj3).GetComponent() : null); Transform obj4 = transform.Find("VFX_glow"); array[3] = ((obj4 != null) ? ((Component)obj4).GetComponent() : null); AudioSource component = ((Component)transform).GetComponent(); DecalProjector component2 = ((Component)transform).GetComponent(); HAI_LaserImpact hAI_LaserImpact = ((Component)transform).GetComponent(); if ((Object)(object)hAI_LaserImpact == (Object)null) { hAI_LaserImpact = ((Component)transform).gameObject.AddComponent(); } hAI_LaserImpact.InitializeFromCode(); mls.LogInfo((object)"Laser Impact Visual успешно настроен через код"); } if ((Object)(object)lasercellAmmoPrefab != (Object)null) { HAI_LaserCellItem hAI_LaserCellItem = lasercellAmmoItem.spawnPrefab.AddComponent(); ((GrabbableObject)hAI_LaserCellItem).grabbable = true; ((GrabbableObject)hAI_LaserCellItem).grabbableToEnemies = true; ((GrabbableObject)hAI_LaserCellItem).isInFactory = true; ((GrabbableObject)hAI_LaserCellItem).itemProperties = lasercellAmmoItem; hAI_LaserCellItem.ammoType = 5000; } if ((Object)(object)laserpistolPrefab != (Object)null) { HAI_LaserPistolItem hAI_LaserPistolItem = laserpistolItem.spawnPrefab.AddComponent(); ((GrabbableObject)hAI_LaserPistolItem).grabbable = true; ((GrabbableObject)hAI_LaserPistolItem).grabbableToEnemies = true; ((GrabbableObject)hAI_LaserPistolItem).isInFactory = true; ((GrabbableObject)hAI_LaserPistolItem).itemProperties = laserpistolItem; hAI_LaserPistolItem.gunCompatibleAmmoID = 5005; hAI_LaserPistolItem.gunAnimator = ((Component)hAI_LaserPistolItem).gameObject.GetComponent(); hAI_LaserPistolItem.gunAudio = ((Component)hAI_LaserPistolItem).gameObject.GetComponent(); hAI_LaserPistolItem.gunShootSFX.Add(laserpistolShoot1); hAI_LaserPistolItem.gunShootSFX.Add(laserpistolShoot2); hAI_LaserPistolItem.gunShootSFX.Add(laserpistolShoot3); hAI_LaserPistolItem.batteryInsertSFX = laserpistolLoad; hAI_LaserPistolItem.batteryEjectSFX = laserpistolUnload; hAI_LaserPistolItem.modeSwitchSFX = laserpistolSafeTrigger; hAI_LaserPistolItem.TriggerClickSFX = laserweaponTrigger; hAI_LaserPistolItem.overheatSFX = laserpistolOverheat; hAI_LaserPistolItem.overheatBeepSFX = laserweaponOverheatBeep; hAI_LaserPistolItem.gunHissLoopSFX = laserpistolOverheatLoop; hAI_LaserPistolItem.dischargedBeepSFX = laserweaponDischargedBeep; hAI_LaserPistolItem.gunRayPoint = ((Component)hAI_LaserPistolItem).gameObject.transform.GetChild(1); hAI_LaserPistolItem.gunBodyRenderers = (Renderer[])(object)new Renderer[3]; hAI_LaserPistolItem.gunBodyRenderers[0] = (Renderer)(object)((Component)((Component)hAI_LaserPistolItem).gameObject.transform.GetChild(2).GetChild(2)).GetComponent(); hAI_LaserPistolItem.gunBodyRenderers[1] = (Renderer)(object)((Component)((Component)hAI_LaserPistolItem).gameObject.transform.GetChild(2).GetChild(3)).GetComponent(); hAI_LaserPistolItem.gunBodyRenderers[2] = (Renderer)(object)((Component)((Component)hAI_LaserPistolItem).gameObject.transform.GetChild(2).GetChild(4)).GetComponent(); hAI_LaserPistolItem.laserCellInPistolMesh = ((Component)((Component)hAI_LaserPistolItem).gameObject.transform.GetChild(2).GetChild(0)).GetComponent(); hAI_LaserPistolItem.laserCellInHandMesh = ((Component)((Component)hAI_LaserPistolItem).gameObject.transform.GetChild(2).GetChild(1)).GetComponent(); hAI_LaserPistolItem.overheatSparks = ((Component)((Component)hAI_LaserPistolItem).transform.GetChild(2).GetChild(6).GetChild(1) .GetChild(1)).GetComponent(); hAI_LaserPistolItem.heatHazeParticles = ((Component)((Component)hAI_LaserPistolItem).transform.GetChild(2).GetChild(6).GetChild(1) .GetChild(0)).GetComponent(); hAI_LaserPistolItem.heatSteam1Particles = ((Component)((Component)hAI_LaserPistolItem).transform.GetChild(2).GetChild(6).GetChild(1) .GetChild(2)).GetComponent(); hAI_LaserPistolItem.heatSteam2Particles = ((Component)((Component)hAI_LaserPistolItem).transform.GetChild(2).GetChild(6).GetChild(1) .GetChild(3)).GetComponent(); hAI_LaserPistolItem.frontMuzzleFlash = ((Component)((Component)hAI_LaserPistolItem).transform.GetChild(2).GetChild(6).GetChild(0) .GetChild(0)).gameObject; hAI_LaserPistolItem.sideMuzzleFlash = ((Component)((Component)hAI_LaserPistolItem).transform.GetChild(2).GetChild(6).GetChild(0) .GetChild(1)).gameObject; hAI_LaserPistolItem.laserBeamVFX = ((Component)((Component)hAI_LaserPistolItem).transform.GetChild(2).GetChild(6).GetChild(0) .GetChild(2)).GetComponent(); hAI_LaserPistolItem.isLoaded = false; hAI_LaserPistolItem.currentBatteryCharge = 0f; if ((Object)(object)hAI_LaserPistolItem.laserCellInHandMesh != (Object)null) { ((Renderer)hAI_LaserPistolItem.laserCellInHandMesh).enabled = false; } } if ((Object)(object)laseremitterpistolPrefab != (Object)null) { HAI_LaserEmitterItem hAI_LaserEmitterItem = laseremitterpistolItem.spawnPrefab.AddComponent(); ((GrabbableObject)hAI_LaserEmitterItem).grabbable = true; ((GrabbableObject)hAI_LaserEmitterItem).grabbableToEnemies = true; ((GrabbableObject)hAI_LaserEmitterItem).isInFactory = true; ((GrabbableObject)hAI_LaserEmitterItem).itemProperties = laseremitterpistolItem; hAI_LaserEmitterItem.gunCompatibleAmmoID = 5005; hAI_LaserEmitterItem.gunAnimator = ((Component)hAI_LaserEmitterItem).gameObject.GetComponent(); hAI_LaserEmitterItem.gunAudio = ((Component)hAI_LaserEmitterItem).gameObject.GetComponent(); hAI_LaserEmitterItem.batteryInsertSFX = laserpistolLoad; hAI_LaserEmitterItem.batteryEjectSFX = laserpistolUnload; hAI_LaserEmitterItem.modeSwitchSFX = laserpistolSafeTrigger; hAI_LaserEmitterItem.overheatSFX = laserpistolOverheat; hAI_LaserEmitterItem.overheatBeepSFX = laserweaponOverheatBeep; hAI_LaserEmitterItem.gunHissLoopSFX = laserpistolOverheatLoop; hAI_LaserEmitterItem.dischargedBeepSFX = laserweaponDischargedBeep; hAI_LaserEmitterItem.triggerClickSFX = laserweaponTrigger; hAI_LaserEmitterItem.gunShootSFX.Add(laserpistolShoot1); hAI_LaserEmitterItem.gunShootSFX.Add(laserpistolShoot2); hAI_LaserEmitterItem.gunShootSFX.Add(laserpistolShoot3); hAI_LaserEmitterItem.emitterLoopSFX = laseremitterpistolLaserLoop; hAI_LaserEmitterItem.emitterEndSFX = laseremitterpistolLaserEnd; hAI_LaserEmitterItem.gunRayPoint = ((Component)hAI_LaserEmitterItem).gameObject.transform.GetChild(1); hAI_LaserEmitterItem.laserCellInPistolMesh = ((Component)((Component)hAI_LaserEmitterItem).gameObject.transform.GetChild(2).GetChild(0)).GetComponent(); hAI_LaserEmitterItem.laserCellInHandMesh = ((Component)((Component)hAI_LaserEmitterItem).gameObject.transform.GetChild(2).GetChild(1)).GetComponent(); hAI_LaserEmitterItem.isLoaded = false; hAI_LaserEmitterItem.currentBatteryCharge = 0f; if ((Object)(object)hAI_LaserEmitterItem.laserCellInHandMesh != (Object)null) { ((Renderer)hAI_LaserEmitterItem.laserCellInHandMesh).enabled = false; } } if ((Object)(object)lasersmgPrefab != (Object)null) { PhysicsProp val = lasersmgItem.spawnPrefab.AddComponent(); ((GrabbableObject)val).grabbable = true; ((GrabbableObject)val).grabbableToEnemies = true; ((GrabbableObject)val).isInFactory = true; ((GrabbableObject)val).itemProperties = lasersmgItem; } if ((Object)(object)lasercarbinePrefab != (Object)null) { PhysicsProp val2 = lasercarbineItem.spawnPrefab.AddComponent(); ((GrabbableObject)val2).grabbable = true; ((GrabbableObject)val2).grabbableToEnemies = true; ((GrabbableObject)val2).isInFactory = true; ((GrabbableObject)val2).itemProperties = lasercarbineItem; } if ((Object)(object)lasersniperPrefab != (Object)null) { PhysicsProp val3 = lasersniperItem.spawnPrefab.AddComponent(); ((GrabbableObject)val3).grabbable = true; ((GrabbableObject)val3).grabbableToEnemies = true; ((GrabbableObject)val3).isInFactory = true; ((GrabbableObject)val3).itemProperties = lasersniperItem; } mls.LogInfo((object)"Successfully loaded assets!"); } catch (Exception ex2) { mls.LogError((object)("Couldn't load assets: " + ex2.Message)); } } private void Awake() { if ((Object)(object)Instance == (Object)null) { Instance = this; } PluginDirectory = ((BaseUnityPlugin)this).Info.Location; mls = Logger.CreateLogSource("HAI_laserweapons"); mls.LogInfo((object)"H.A.I. Laser Weaponry Pack is starting..."); try { Type[] types = Assembly.GetExecutingAssembly().GetTypes(); Type[] array = types; foreach (Type type in array) { MethodInfo[] methods = type.GetMethods(BindingFlags.Static | BindingFlags.Public | 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); } } } } catch (Exception arg) { mls.LogError((object)$"Ошибка регистрации сети: {arg}"); } LoadAssets(); translateRussian = ((BaseUnityPlugin)this).Config.Bind("Translation", "Enable Russian", false, "Enable Russian language.").Value; RegisterModSettings(); CreateShopNodeStrings(); if (translateRussian) { Translate(); } if (lasercellPrice > -1) { DawnLib.DefineItem(LaserCellKey, lasercellAmmoItem, (Action)delegate(ItemInfoBuilder builder) { builder.DefineScrap((Action)delegate(ScrapBuilder scrap) { scrap.SetWeights((Action>)delegate(WeightTableBuilder weights) { weights.SetGlobalWeight(lasercellRarity); }); }).DefineShop((Action)delegate(ShopBuilder shop) { shop.OverrideCost(lasercellPrice).OverrideInfoNode(lasercellAmmoItemShopInfo); }); }); } if (laserpistolPrice > -1) { DawnLib.DefineItem(LaserPistolKey, laserpistolItem, (Action)delegate(ItemInfoBuilder builder) { builder.DefineScrap((Action)delegate(ScrapBuilder scrap) { scrap.SetWeights((Action>)delegate(WeightTableBuilder weights) { weights.SetGlobalWeight(laserpistolRarity); }); }).DefineShop((Action)delegate(ShopBuilder shop) { shop.OverrideCost(laserpistolPrice).OverrideInfoNode(laserpistolItemShopInfo); }); }); } if (laseremitterpistolPrice > -1) { DawnLib.DefineItem(LaserEmitterPistolKey, laseremitterpistolItem, (Action)delegate(ItemInfoBuilder builder) { builder.DefineScrap((Action)delegate(ScrapBuilder scrap) { scrap.SetWeights((Action>)delegate(WeightTableBuilder weights) { weights.SetGlobalWeight(laseremitterpistolRarity); }); }).DefineShop((Action)delegate(ShopBuilder shop) { shop.OverrideCost(laseremitterpistolPrice).OverrideInfoNode(laseremitterpistolShopInfo); }); }); } if (lasersmgPrice > -1) { DawnLib.DefineItem(LaserSMGKey, lasersmgItem, (Action)delegate(ItemInfoBuilder builder) { builder.DefineScrap((Action)delegate(ScrapBuilder scrap) { scrap.SetWeights((Action>)delegate(WeightTableBuilder weights) { weights.SetGlobalWeight(lasersmgRarity); }); }).DefineShop((Action)delegate(ShopBuilder shop) { shop.OverrideCost(lasersmgPrice).OverrideInfoNode(lasersmgShopInfo); }); }); } if (lasercarbinePrice > -1) { DawnLib.DefineItem(LaserCarbineKey, lasercarbineItem, (Action)delegate(ItemInfoBuilder builder) { builder.DefineScrap((Action)delegate(ScrapBuilder scrap) { scrap.SetWeights((Action>)delegate(WeightTableBuilder weights) { weights.SetGlobalWeight(lasercarbineRarity); }); }).DefineShop((Action)delegate(ShopBuilder shop) { shop.OverrideCost(lasercarbinePrice).OverrideInfoNode(lasercarbineShopInfo); }); }); } if (lasersniperPrice > -1) { DawnLib.DefineItem(LaserSniperKey, lasersniperItem, (Action)delegate(ItemInfoBuilder builder) { builder.DefineScrap((Action)delegate(ScrapBuilder scrap) { scrap.SetWeights((Action>)delegate(WeightTableBuilder weights) { weights.SetGlobalWeight(lasersniperRarity); }); }).DefineShop((Action)delegate(ShopBuilder shop) { shop.OverrideCost(lasersniperPrice).OverrideInfoNode(lasersniperShopInfo); }); }); } Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), (string)null); } private void RegisterModSettings() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0052: 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_0072: Expected O, but got Unknown try { ModSettingsConfig val = new ModSettingsConfig(); val.Name = "H.A.I. Laser Weaponry Pack"; val.Id = "HAI_laserweapons"; val.Version = "1.0.0.0"; val.Description = "Laser energy weaponry pack from Hoplit Armament Industries\nНабор лазерного энергооружия от Hoplit Armament Industries"; val.MenuComponents = (MenuComponent[])(object)new MenuComponent[1] { (MenuComponent)new ToggleComponent { Text = "Русский язык / Russian Language\nДля полного эффекта нужен перезапуск\nRestart to get full effect", Value = translateRussian, OnValueChanged = delegate(ToggleComponent self, bool value) { translateRussian = value; ((BaseUnityPlugin)this).Config.Bind("Translation", "Enable Russian", translateRussian, (ConfigDescription)null).Value = value; ((BaseUnityPlugin)this).Config.Save(); Translate(); CreateShopNodeStrings(); } } }; ModMenu.RegisterMod(val); } catch (Exception ex) { mls.LogError((object)("Failed to register mod settings: " + ex.Message)); } } private void Translate() { if ((Object)(object)lasercellAmmoItem?.spawnPrefab != (Object)null) { ScanNodeProperties componentInChildren = lasercellAmmoItem.spawnPrefab.GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { componentInChildren.headerText = (translateRussian ? "Лазерная Энергоячейка [H.A.I.]" : "Laser Energy Cell [H.A.I.]"); componentInChildren.subText = (translateRussian ? "Боеприпас для лазерного оружия H.A.I." : "Ammo for H.A.I. laser weapons"); } } if ((Object)(object)laserpistolItem?.spawnPrefab != (Object)null) { ScanNodeProperties componentInChildren2 = laserpistolItem.spawnPrefab.GetComponentInChildren(); if ((Object)(object)componentInChildren2 != (Object)null) { componentInChildren2.headerText = (translateRussian ? "Лазерный Пистолет [H.A.I.]" : "Laser Pistol [H.A.I.]"); componentInChildren2.subText = (translateRussian ? "Компактное лазерное оружие H.A.I." : "Compact H.A.I. laser weapon"); } } if ((Object)(object)laseremitterpistolItem?.spawnPrefab != (Object)null) { ScanNodeProperties componentInChildren3 = laseremitterpistolItem.spawnPrefab.GetComponentInChildren(); if ((Object)(object)componentInChildren3 != (Object)null) { componentInChildren3.headerText = (translateRussian ? "Лазерный Эмиттер-Пистолет [H.A.I.]" : "Laser Emitter Pistol [H.A.I.]"); componentInChildren3.subText = (translateRussian ? "Компактное лазерное оружие H.A.I." : "Compact H.A.I. laser weapon"); } } if ((Object)(object)lasersmgItem?.spawnPrefab != (Object)null) { ScanNodeProperties componentInChildren4 = lasersmgItem.spawnPrefab.GetComponentInChildren(); if ((Object)(object)componentInChildren4 != (Object)null) { componentInChildren4.headerText = (translateRussian ? "Лазерный ПП [H.A.I.]" : "Laser SMG [H.A.I.]"); componentInChildren4.subText = (translateRussian ? "Лазерное оружие H.A.I." : "H.A.I. laser weapon"); } } if ((Object)(object)lasercarbineItem?.spawnPrefab != (Object)null) { ScanNodeProperties componentInChildren5 = lasercarbineItem.spawnPrefab.GetComponentInChildren(); if ((Object)(object)componentInChildren5 != (Object)null) { componentInChildren5.headerText = (translateRussian ? "Лазерный Карабин [H.A.I.]" : "Laser Carbine [H.A.I.]"); componentInChildren5.subText = (translateRussian ? "Лазерное оружие H.A.I." : "H.A.I. laser weapon"); } } if ((Object)(object)lasersniperItem?.spawnPrefab != (Object)null) { ScanNodeProperties componentInChildren6 = lasersniperItem.spawnPrefab.GetComponentInChildren(); if ((Object)(object)componentInChildren6 != (Object)null) { componentInChildren6.headerText = (translateRussian ? "Лазерная Снайперка [H.A.I.]" : "Laser Precision Rifle [H.A.I.]"); componentInChildren6.subText = (translateRussian ? "Лазерное оружие H.A.I." : "H.A.I. laser weapon"); } } } private void CreateShopNodeStrings() { if (translateRussian) { lasercellAmmoItem.itemName = "Лазерная Энергоячейка [H.A.I.]"; laserpistolItem.itemName = "Лазерный Пистолет [H.A.I.]"; laseremitterpistolItem.itemName = "Лазерный Эмиттер [H.A.I.]"; lasersmgItem.itemName = "Лазерный ПП [H.A.I.]"; lasercarbineItem.itemName = "Лазерный Карабин [H.A.I.]"; lasersniperItem.itemName = "Лазерная Прицельная Винтовка [H.A.I.]"; if ((Object)(object)laserpistolItem != (Object)null) { if (laserpistolItem.toolTips == null || laserpistolItem.toolTips.Length < 2) { laserpistolItem.toolTips = new string[2]; } laserpistolItem.toolTips[0] = "Выстрел:[ЛКМ] Прицел:[ПКМ]\nПерекл режим:[Fзаж]"; laserpistolItem.toolTips[1] = "Зарядить/Перезар:[R] Изъять:[Rзаж]\nВид сбоку:[Q] Осмотр:[Qзаж]"; } if ((Object)(object)laseremitterpistolItem != (Object)null) { if (laseremitterpistolItem.toolTips == null || laseremitterpistolItem.toolTips.Length < 2) { laseremitterpistolItem.toolTips = new string[2]; } laseremitterpistolItem.toolTips[0] = "Выстрел:[ЛКМзаж] Прицел:[ПКМ]\nПерекл режим:[Fзаж]"; laseremitterpistolItem.toolTips[1] = "Зарядить/Перезар:[R] Изъять:[Rзаж]\nВид сбоку:[Q] Осмотр:[Qзаж]"; } } else { lasercellAmmoItem.itemName = "Laser Energy Cell [H.A.I.]"; laserpistolItem.itemName = "Laser Pistol [H.A.I.]"; laseremitterpistolItem.itemName = "Laser Emitter [H.A.I.]"; lasersmgItem.itemName = "Laser Small Machinegun [H.A.I.]"; lasercarbineItem.itemName = "Laser Assault Carbine [H.A.I.]"; lasersniperItem.itemName = "Laser Precision Rifle [H.A.I.]"; if ((Object)(object)laserpistolItem != (Object)null) { if (laserpistolItem.toolTips == null || laserpistolItem.toolTips.Length < 2) { laserpistolItem.toolTips = new string[2]; } laserpistolItem.toolTips[0] = "Fire:[LMB] Aim:[RMB]\nSwitch mode:[Fhld]"; laserpistolItem.toolTips[1] = "Load/Reload:[R] Eject:[Rhld]\nLook byside:[Q] Inspect:[Qhld]"; } if ((Object)(object)laseremitterpistolItem != (Object)null) { if (laseremitterpistolItem.toolTips == null || laseremitterpistolItem.toolTips.Length < 2) { laseremitterpistolItem.toolTips = new string[2]; } laseremitterpistolItem.toolTips[0] = "Fire:[LMBhld] Aim:[RMB]\nSwitch mode:[Fhld]"; laseremitterpistolItem.toolTips[1] = "Load/Reload:[R] Eject:[Rhld]\nLook byside:[Q] Inspect:[Qhld]"; } } lasercellAmmoItemShopInfo = NewTerminalNode("\nЗапитайте ваше лазерное вооружение!\nОни могут быть перезаряжены с помощью специального оборудования компании H.A.I.\n\nПартнёрская компания Hoplit Armament Industries благодарит вас за сотрудничество.\nЛюбые приобретённые предметы прибудут в течении часа к вашему местоположению.\n\n", "\nPower up your laser weaponry!\nIt can be recharged with Laser Energy Cell Charging Dock.\n\nHoplit Armament Industries partner company thanks you for your cooperation.\nAny purchased items will arrive hourly at your approximate location.\n\n"); laserpistolItemShopInfo = NewTerminalNode("Класс 'I' энергетического оружия, Лазерный Пистолет используется в качестве самообороны и дополнительного оружия.\nПоместите H.A.I. Лазерную Энергоячейку в разьём для питания, чтобы зарядить оружие.\n\nПартнёрская компания Hoplit Armament Industries благодарит вас за сотрудничество.\nЛюбые приобретённые предметы прибудут в течении часа к вашему местоположению.\n\n", "\n'I' Class of energy weapon, H.A.I. Laser Pistol used as self defence item or additional equipment.\nInsert the H.A.I. Laser Cell in power socket to power up the weapon.\n\nHoplit Armament Industries partner company thanks you for your cooperation.\nAny purchased items will arrive hourly at your approximate location.\n\n"); laseremitterpistolShopInfo = NewTerminalNode("Класс 'I' специализированного энергетического оружия, Лазерный Эмиттер использует короткий концентрированный поток света для точного поражения целей на близкой дистанции.\nПоместите H.A.I. Лазерную Энергоячейку в разьём для питания, чтобы зарядить оружие.\n\nПартнёрская компания Hoplit Armament Industries благодарит вас за сотрудничество.\nЛюбые приобретённые предметы прибудут в течении часа к вашему местоположению.\n\n", "\n'I' Class of specialized energy weapon, H.A.I. Laser Emitter uses a concentrated stream for precise target elimination.\nInsert the H.A.I. Laser Cell in power socket to power up the weapon.\n\nHoplit Armament Industries partner company thanks you for your cooperation.\nAny purchased items will arrive hourly at your approximate location.\n\n"); lasersmgShopInfo = NewTerminalNode("Класс 'I' энергетического оружия, Лазерный Пистолет-Пулемет отличается высокой скорострельностью, идеально подходящей для боя на средний дистанциях.\nПоместите H.A.I. Лазерную Энергоячейку в разьём для питания, чтобы зарядить оружие.\n\nПартнёрская компания Hoplit Armament Industries благодарит вас за сотрудничество.\nЛюбые приобретённые предметы прибудут в течении часа к вашему местоположению.\n\n", "\n'I' Class of energy weapon, H.A.I. Laser Submachine Gun features a high fire rate, perfect for mid quarters combat.\nInsert the H.A.I. Laser Cell in power socket to power up the weapon.\n\nHoplit Armament Industries partner company thanks you for your cooperation.\nAny purchased items will arrive hourly at your approximate location.\n\n"); lasercarbineShopInfo = NewTerminalNode("Класс 'I' энергетического оружия, Лазерный Карабин представляет собой надежную штурмовую винтовку для эффективного ведения подавляющего огня на средних и дальних дистанциях.\nПоместите H.A.I. Лазерную Энергоячейку в разьём для питания, чтобы зарядить оружие.\n\nПартнёрская компания Hoplit Armament Industries благодарит вас за сотрудничество.\nЛюбые приобретённые предметы прибудут в течении часа к вашему местоположению.\n\n", "\n'I' Class of energy weapon, H.A.I. Laser Carbine is a reliable assault rifle for effective medium-high range purge engagements.\nInsert the H.A.I. Laser Cell in power socket to power up the weapon.\n\nHoplit Armament Industries partner company thanks you for your cooperation.\nAny purchased items will arrive hourly at your approximate location.\n\n"); lasersniperShopInfo = NewTerminalNode("Класс 'I' энергетического оружия, Лазерная Прицельная Винтовка создана для точечного устранения крупных угроз на сверхдальних дистанциях.\nПоместите H.A.I. Лазерную Энергоячейку в разьём для питания, чтобы зарядить оружие.\n\nПартнёрская компания Hoplit Armament Industries благодарит вас за сотрудничество.\nЛюбые приобретённые предметы прибудут в течении часа к вашему местоположению.\n\n", "\n'I' Class of energy weapon, H.A.I. Laser Precision Rifle is designed for pinpoint elimination of major threats at extreme ranges.\nInsert the H.A.I. Laser Cell in power socket to power up the weapon.\n\nHoplit Armament Industries partner company thanks you for your cooperation.\nAny purchased items will arrive hourly at your approximate location.\n\n"); } public TerminalNode NewTerminalNode(string russian, string english) { TerminalNode val = ScriptableObject.CreateInstance(); val.displayText = (translateRussian ? russian : english); val.clearPreviousText = true; val.maxCharactersToType = 15; val.buyRerouteToMoon = -1; val.displayPlanetInfo = -1; val.shipUnlockableID = -1; val.creatureFileID = -1; val.storyLogFileID = -1; return val; } } } namespace __GEN { internal class NetworkVariableSerializationHelper { [RuntimeInitializeOnLoadMethod] internal static void InitializeSerialization() { } } } namespace HAI_laserweapons.NetcodePatcher { [AttributeUsage(AttributeTargets.Module)] internal class NetcodePatchedAssemblyAttribute : Attribute { } }