Decompiled source of EmployeeClasses v0.1.3
EmployeeClasses.dll
Decompiled 2 months ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Logging; using EmployeeClasses.GUI; using EmployeeClasses.Inputs; using EmployeeClasses.NetcodePatcher; using EmployeeClasses.Patches; using EmployeeClasses.Roles; using EmployeeClasses.Util; using GameNetcodeStuff; using HarmonyLib; using LethalCompanyInputUtils.Api; using TMPro; using Unity.Netcode; using UnityEngine; using UnityEngine.Events; using UnityEngine.InputSystem; using UnityEngine.Rendering.HighDefinition; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("EmployeeClasses")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("EmployeeClasses")] [assembly: AssemblyCopyright("Copyright © 2024")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("0ce88ebc-9cb4-47d2-8bb1-f10e6bcfb72e")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] [module: NetcodePatchedAssembly] internal class <Module> { static <Module>() { } } namespace EmployeeClasses { [BepInPlugin("Jade.EmployeeClasses", "EmployeeClasses", "0.1.3")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class ModBase : BaseUnityPlugin { private const string modGUID = "Jade.EmployeeClasses"; private const string modName = "EmployeeClasses"; private const string modVersion = "0.1.3"; private readonly Harmony harmony = new Harmony("Jade.EmployeeClasses"); public static ModBase Instance; public static ManualLogSource als; public static AssetBundle assets; internal static Keybinds keybinds; private void Awake() { if ((Object)(object)Instance == (Object)null) { Instance = this; } als = Logger.CreateLogSource("Jade.EmployeeClasses"); string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); assets = AssetBundle.LoadFromFile(Path.Combine(directoryName, "employeeclasses")); if ((Object)(object)assets == (Object)null) { als.LogError((object)"Failed to load custom assets."); } keybinds = new Keybinds(); SetupKeybindCallbacks(); Sounds.Awake(); harmony.PatchAll(typeof(ModBase)); harmony.PatchAll(typeof(RoleManager)); harmony.PatchAll(typeof(StartOfRoundPatch)); harmony.PatchAll(typeof(QuickMenuManagerPatch)); harmony.PatchAll(typeof(ShovelPatch)); harmony.PatchAll(typeof(HUDManagerPatch)); harmony.PatchAll(typeof(PlayerControllerBPAtch)); harmony.PatchAll(typeof(GameNetworkManagerPatch)); harmony.PatchAll(typeof(TimeOfDayPatch)); Type[] types = Assembly.GetExecutingAssembly().GetTypes(); Type[] array = types; foreach (Type type in array) { MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); MethodInfo[] array2 = methods; foreach (MethodInfo methodInfo in array2) { object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false); if (customAttributes.Length != 0) { methodInfo.Invoke(null, null); } } } als.LogInfo((object)":"); als.LogInfo((object)"EmployeeClasses has loaded!"); als.LogInfo((object)":"); } public void SetupKeybindCallbacks() { keybinds.SkillKey.canceled += OnSkillKeyReleased; keybinds.SkillKey.performed += OnSkillKeyPressed; } public void OnSkillKeyPressed(CallbackContext context) { RoleManager.Instance.PressSkill(); } public void OnSkillKeyReleased(CallbackContext context) { RoleManager.Instance.ReleaseSkill(); } public static void logOutput(string msg) { als.LogInfo((object)msg); } } } namespace EmployeeClasses.Util { public static class NetworkObjectExtensions { public static IEnumerator WaitUntilSpawned(this NetworkObject networkObject) { yield return (object)new WaitUntil((Func<bool>)(() => networkObject.IsSpawned)); } private static IEnumerator RunActionAfterSpawned(NetworkObject networkObject, Action action) { yield return networkObject.WaitUntilSpawned(); action(); } public static void OnSpawn(this NetworkObject networkObject, Action action) { ((MonoBehaviour)networkObject).StartCoroutine(RunActionAfterSpawned(networkObject, action)); } } internal class Sounds { public static AudioClip beaconSound; public static AudioClip reelSound; public static AudioClip swingSound; public static AudioClip kickSound; public static AudioClip harvestSound; public static AudioClip synthSound; public static AudioClip stimSound; public static AudioClip switchSound; public static AudioClip hackSound; public static AudioClip failSound; public static Dictionary<int, AudioClip> library; public static void Awake() { beaconSound = LoadClip("Beacon"); reelSound = LoadClip("KickReel"); swingSound = LoadClip("KickSwing"); kickSound = LoadClip("KickHit"); harvestSound = LoadClip("Harvest"); synthSound = LoadClip("Synthesize"); stimSound = LoadClip("Stim"); switchSound = LoadClip("Switch"); hackSound = LoadClip("Hacking"); failSound = LoadClip("HackFail"); library = new Dictionary<int, AudioClip> { { 0, beaconSound }, { 1, reelSound }, { 2, swingSound }, { 3, kickSound }, { 4, harvestSound }, { 5, synthSound }, { 6, stimSound }, { 7, switchSound }, { 8, hackSound }, { 9, failSound } }; } public static AudioClip LoadClip(string clip) { AudioClip val = ModBase.assets.LoadAsset<AudioClip>(clip); if ((Object)(object)val == (Object)null) { ModBase.als.LogError((object)"Trouble loading Beacon clip"); } return val; } public static void PlayClipFromSource(int clip, AudioSource source, float volume) { source.PlayOneShot(library[clip], volume); } } } namespace EmployeeClasses.Roles { public class Role { public string name; public List<RoleTag> tags; public string ability; public string description; public Role(string name, List<RoleTag> tags, string ability, string description) { this.name = name; this.tags = tags; this.ability = ability; this.description = description; } public Role(string name, List<RoleTag> tags, string description) { this.name = name; this.tags = tags; ability = null; this.description = description; } } internal class RoleManager : NetworkBehaviour { private const float KICK_COST = 0.4f; public string selectedRole; public List<RoleTag> tags; public string ability; public float maxSprintSpeed = 2.25f; public float weightPenalty = 1f; public float weightPenalty1H = 1f; public float weightPenalty2H = 1f; public float oxygenReserves = 1f; private float speedMultiplier = 1f; public float fallDamage = 1f; public int attackDamage = 1; public float footstepVolume = 1f; public float scanRange = 1f; private int maxHealth = 100; public bool scanWall = false; private int threatLevel = 0; public int weightPenaltyThreshhold = 0; public float bulletDamage = 0f; public float fogVisibility = 1f; public float sprintTime = 1f; public float sprintMeter = 1f; public float battery = 1f; public bool alwaysClock = false; public float sprintMultiplier = 0.5f; public float drowningTimer = 1f; public float extract = 0f; public int charges = 0; public bool freeCharge = true; public bool stimmed = false; private GameObject headlamp; private float abilityCooldown = 0f; private float duration = 0f; private bool active = false; private Coroutine abilityRoutine; private PlayerControllerB player; public float carryWeight; public static RoleManager Instance; public int playerID; private float holdTimer; private float second = 0f; private Image extractBar; private Image batteryBar; private Image chargeBar; private Dictionary<string, int> extractValues = new Dictionary<string, int> { { "Flowerman", 75 }, { "Crawler", 50 }, { "Hoarding bug", 30 }, { "Centipede", 20 }, { "Bunker Spider", 60 }, { "Puffer", 40 }, { "Nutcracker", 60 }, { "Masked", 50 }, { "Butler", 60 }, { "Clay Surgeon", 50 }, { "MouthDog", 100 }, { "ForestGiant", 100 }, { "Baboon hawk", 50 }, { "Bush Wolf", 50 }, { "Manticoil", 20 }, { "Tulip Snake", 20 } }; private Dictionary<LevelWeatherType, float> batteryRates = new Dictionary<LevelWeatherType, float> { { (LevelWeatherType)(-1), 0.09f }, { (LevelWeatherType)2, 0.1f }, { (LevelWeatherType)1, 0.07f }, { (LevelWeatherType)5, 0.2f }, { (LevelWeatherType)3, 0.05f }, { (LevelWeatherType)0, 0.08f } }; public void Awake() { } public void CreateHUD() { extractBar = ((Component)Object.Instantiate<GameObject>(ModBase.assets.LoadAsset<GameObject>("ExtractBar"), GameObject.Find("Systems/UI/Canvas/IngamePlayerHUD/TopLeftCorner").transform).transform.Find("Bar")).GetComponent<Image>(); ((Component)((Component)extractBar).transform.parent).gameObject.SetActive(false); chargeBar = ((Component)((Component)extractBar).transform.parent.Find("Charges")).GetComponent<Image>(); batteryBar = ((Component)Object.Instantiate<GameObject>(ModBase.assets.LoadAsset<GameObject>("BatteryBar"), GameObject.Find("Systems/UI/Canvas/IngamePlayerHUD/TopLeftCorner").transform).transform.Find("Bar")).GetComponent<Image>(); ((Component)((Component)batteryBar).transform.parent).gameObject.SetActive(false); } public void reset() { if ((Object)(object)headlamp != (Object)null) { DestroyHeadlamp(); } selectedRole = "Employee"; sprintMeter = 1f; maxSprintSpeed = 2.25f; maxHealth = 100; weightPenalty = 1f; weightPenalty1H = 1f; weightPenalty2H = 1f; oxygenReserves = 1f; speedMultiplier = 1f; fallDamage = 1f; attackDamage = 1; footstepVolume = 1f; scanRange = 1f; threatLevel = 0; weightPenaltyThreshhold = 0; bulletDamage = 1f; alwaysClock = false; scanWall = false; holdTimer = -1f; stimmed = false; sprintTime = 1f; fogVisibility = 1f; if (charges == 0) { charges = 1; } battery = 1f; } public void changeRole(Role role) { reset(); tags = role.tags; ability = ((role.ability == null) ? null : role.ability); selectedRole = role.name; RoleTag[] array = tags.ToArray(); foreach (RoleTag roleTag in array) { if (roleTag.Id == 0) { maxSprintSpeed *= roleTag.Power; } else if (roleTag.Id == 2) { maxHealth = (int)roleTag.Power; } else if (roleTag.Id == 3) { weightPenalty = roleTag.Power; } else if (roleTag.Id == 18) { weightPenalty1H = roleTag.Power; } else if (roleTag.Id == 19) { weightPenalty2H = roleTag.Power; } else if (roleTag.Id == 4) { oxygenReserves = roleTag.Power; } else if (roleTag.Id == 1) { speedMultiplier = roleTag.Power; } else if (roleTag.Id == 5) { fallDamage = roleTag.Power; } else if (roleTag.Id == 6) { attackDamage = (int)roleTag.Power; } else if (roleTag.Id == 7) { weightPenaltyThreshhold = (int)roleTag.Power; } else if (roleTag.Id == 8) { footstepVolume = roleTag.Power; } else if (roleTag.Id == 9) { scanRange = roleTag.Power; } else if (roleTag.Id == 10) { scanWall = true; } else if (roleTag.Id == 11) { threatLevel = (int)roleTag.Power; } else if (roleTag.Id == 12) { bulletDamage = roleTag.Power; } else if (roleTag.Id == 13) { alwaysClock = true; } else if (roleTag.Id == 14) { CreateHeadlamp(); } else if (roleTag.Id == 15) { sprintTime = roleTag.Power; } else if (roleTag.Id == 16) { fogVisibility = roleTag.Power; } } if (ability == "STIM") { ((Component)((Component)extractBar).transform.parent).gameObject.SetActive(true); } else { ((Component)((Component)extractBar).transform.parent).gameObject.SetActive(false); } } public void applyRole(PlayerControllerB instance) { instance.health = maxHealth; instance.movementSpeed = 4.6f * speedMultiplier; drowningTimer = oxygenReserves; abilityCooldown = 0f; duration = 0f; active = false; if (NetworkManager.Singleton.IsHost) { ApplyRoleClientRpc(playerID, footstepVolume, selectedRole); } else { ApplyRoleServerRpc(playerID, footstepVolume, selectedRole); } } [ServerRpc(RequireOwnership = false)] public void ApplyRoleServerRpc(int id, float footstepVolume, string role) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: 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_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2864087213u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, id); ((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref footstepVolume, default(ForPrimitives)); bool flag = role != null; ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(role, false); } ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2864087213u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ApplyRoleClientRpc(id, footstepVolume, role); } } [ClientRpc] public void ApplyRoleClientRpc(int id, float footstepVolume, string role) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: 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_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2721717499u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, id); ((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref footstepVolume, default(ForPrimitives)); bool flag = role != null; ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(role, false); } ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2721717499u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { PlayerControllerB val3 = StartOfRound.Instance.allPlayerScripts[id]; ((Component)val3).GetComponent<RoleManager>().footstepVolume = footstepVolume; ((Component)val3).GetComponent<RoleManager>().selectedRole = role; ((TMP_Text)val3.usernameBillboardText).text = val3.playerUsername + "\n[" + role + "]\n\n"; } } public void SyncRoles() { if (NetworkManager.Singleton.IsHost) { BroadcastRoleClientRpc(); } else { BroadcastRoleServerRpc(); } } [ServerRpc(RequireOwnership = false)] public void BroadcastRoleServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1105422478u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1105422478u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { BroadcastRoleClientRpc(); } } } [ClientRpc] public void BroadcastRoleClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3005978444u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3005978444u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { if (NetworkManager.Singleton.IsHost) { ApplyRoleClientRpc(playerID, footstepVolume, selectedRole); } else { ApplyRoleServerRpc(playerID, footstepVolume, selectedRole); } } } public void SyncClassObjects() { if (NetworkManager.Singleton.IsHost) { SyncClassObjectsClientRpc(); } else { SyncClassObjectsServerRpc(); } } [ServerRpc(RequireOwnership = false)] public void SyncClassObjectsServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(349131064u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 349131064u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { SyncClassObjectsClientRpc(); } } } [ClientRpc] public void SyncClassObjectsClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3316431406u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3316431406u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { if ((Object)(object)headlamp != (Object)null) { CreateHeadlamp(); } if (NetworkManager.Singleton.IsHost) { ApplyRoleClientRpc(playerID, footstepVolume, selectedRole); } else { ApplyRoleServerRpc(playerID, footstepVolume, selectedRole); } } } public static float GetScanRange(float range) { return range * Instance.scanRange; } public float GetFootstepVolume(float volume) { return volume * Instance.footstepVolume; } public static int GetThreatLevel() { return Instance.threatLevel; } public static int GetMaxHealth(int health) { return Instance.maxHealth; } public static float GetSprintMultiplier() { return Instance.sprintMultiplier; } public static float GetSprintMeter() { return Instance.sprintMeter; } public static float GetCarryWeight(float weight) { return Instance.carryWeight; } public void Revive() { if ((Object)(object)headlamp != (Object)null) { headlamp.SetActive(false); } player = StartOfRound.Instance.localPlayerController; EndSkill(); abilityCooldown = 0f; duration = 0f; active = false; extract = 0f; stimmed = false; battery = 1f; sprintMeter = 1f; if (!freeCharge && charges < 3) { charges++; } freeCharge = true; if (NetworkManager.Singleton.IsHost) { ApplyRoleClientRpc(playerID, footstepVolume, selectedRole); } else { ApplyRoleServerRpc(playerID, footstepVolume, selectedRole); } } public void Update() { if ((Object)(object)player == (Object)null && !((Object)(object)StartOfRound.Instance.localPlayerController == (Object)null)) { player = StartOfRound.Instance.localPlayerController; playerID = Array.IndexOf(StartOfRound.Instance.allPlayerScripts, player); } } public void UpdateIt() { //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_067f: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)StartOfRound.Instance.localPlayerController == (Object)null || RolesGUI.instance == null) { return; } second += Time.deltaTime; if (second >= 0.1f) { second = 0f; if (stimmed) { if ((double)player.drunkness < 0.1) { player.drunkness = 0.1f; } if (player.health <= maxHealth) { PlayerControllerB obj = player; obj.health += ((maxHealth < 100) ? 1 : (maxHealth / 100)); } if (player.health > maxHealth) { player.health = maxHealth; stimmed = false; } HUDManager.Instance.UpdateHealthUI(player.health, true); } } if ((ability == null && (Object)(object)headlamp == (Object)null) || ((!player.isPlayerControlled || StartOfRound.Instance.inShipPhase) && !NetworkManager.Singleton.IsHost)) { RolesGUI.instance.HideTip(); return; } List<string> list = new List<string>(); if (!player.isInsideFactory && battery < 1f) { battery += batteryRates[TimeOfDay.Instance.currentLevelWeather] * Time.deltaTime; if (battery > 1f) { battery = 1f; } } if ((Object)(object)headlamp != (Object)null && player.isPlayerControlled) { list.Add($"TOGGLE LAMP : [Press {InputActionRebindingExtensions.GetBindingDisplayString(ModBase.keybinds.SkillKey, (DisplayStringOptions)0, (string)null)[0]}]"); batteryBar.fillAmount = Mathf.Lerp(batteryBar.fillAmount, battery / 1f, Mathf.SmoothStep(0f, 1f, 0.1f)); if (headlamp.activeSelf) { battery -= 0.004f * Time.deltaTime; if (battery <= 0f) { SyncLamp(active: false); } } } HoldSkill(); if (duration <= 0f && ability != null) { if (abilityCooldown > -10f) { abilityCooldown -= Time.deltaTime * 1f; } if (abilityCooldown > 0f) { list.Add(((int)abilityCooldown).ToString() ?? ""); } else if (ability == "HACK") { if (holdTimer > 0.5f) { string text = Math.Round(3f - holdTimer, 2).ToString() ?? ""; if (text.Length < 4) { text += "0"; } list.Add("HACKING : " + text); } else if (HackAvailable()) { list.Add($"HACK : [Hold {InputActionRebindingExtensions.GetBindingDisplayString(ModBase.keybinds.SkillKey, (DisplayStringOptions)0, (string)null)[0]}]"); } } else if (ability == "STIM") { extractBar.fillAmount = Mathf.Lerp(extractBar.fillAmount, extract / 100f, Mathf.SmoothStep(0f, 1f, 0.1f)); chargeBar.fillAmount = (float)charges / 3f; if (HarvestAvailable()) { list.Add($"HARVEST : [Press {InputActionRebindingExtensions.GetBindingDisplayString(ModBase.keybinds.SkillKey, (DisplayStringOptions)0, (string)null)[0]}]"); } else if (SynthesizeAvailable() || StimAvailable()) { if (StimAvailable()) { if (StimmingTeam()) { list.Add($"STIM ALLY : [Press {InputActionRebindingExtensions.GetBindingDisplayString(ModBase.keybinds.SkillKey, (DisplayStringOptions)0, (string)null)[0]}]"); } else { list.Add($"STIM SELF : [Press {InputActionRebindingExtensions.GetBindingDisplayString(ModBase.keybinds.SkillKey, (DisplayStringOptions)0, (string)null)[0]}]"); } } if (SynthesizeAvailable()) { list.Add($"SYNTHESIZE : [Hold {InputActionRebindingExtensions.GetBindingDisplayString(ModBase.keybinds.SkillKey, (DisplayStringOptions)0, (string)null)[0]}]"); } } else { RolesGUI.instance.HideTip(); } } else if (abilityCooldown <= 0f && (!(ability == "KICK") || !(sprintMeter < 0.4f))) { list.Add(ability + $": [Press {InputActionRebindingExtensions.GetBindingDisplayString(ModBase.keybinds.SkillKey, (DisplayStringOptions)0, (string)null)[0]}]"); } string text2 = ""; foreach (string item in list) { text2 = text2 + item + "\n"; } RolesGUI.instance.ShowTip(text2, new Color(50f, 50f, 50f)); } else { UpdateSkill(); duration -= Time.deltaTime * 1f; if (duration <= 0f) { EndSkill(); } } } public void PressSkill() { if (player.inTerminalMenu || player.isTypingChat) { return; } if (holdTimer == -1f) { holdTimer = 0f; } if (abilityCooldown < 0f && player.isPlayerControlled && (!StartOfRound.Instance.inShipPhase || ((NetworkBehaviour)StartOfRound.Instance).IsHost) && ability == "KICK") { TriggerKick(); if (NetworkManager.Singleton.IsHost) { TriggerClientRpc(ability, playerID); } else { TriggerServerRpc(ability, playerID); } RolesGUI.instance.HideTip(); } } public void HoldSkill() { //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) if (player.inTerminalMenu || player.isTypingChat) { return; } if (holdTimer > -1f) { holdTimer += Time.deltaTime; } if (holdTimer < 0.5f) { return; } if (ability == "STIM" && SynthesizeAvailable()) { TriggerSynthesize(); } else if (ability == "HACK") { if (HackAvailable()) { RoundManager.Instance.PlayAudibleNoise(((Component)player).transform.position, 30f, 1f, 0, false, 0); if (holdTimer < 0.6f) { BeginHack(); holdTimer = 0.6f; return; } if (!(holdTimer > 3f)) { return; } TriggerHack(); } else if (holdTimer >= 0.6f) { StopItemAudio(playerID); PlayClipFromItemAudio(9, playerID, 0.3f); RoundManager.Instance.PlayAudibleNoise(((Component)player).transform.position, 30f, 1f, 0, false, 0); } } holdTimer = -2f; } public void ReleaseSkill() { //IL_00a2: Unknown result type (might be due to invalid IL or missing references) if (player.inTerminalMenu || player.isTypingChat) { return; } if (holdTimer == -2f) { holdTimer = -1f; return; } if (ability == "HACK" && holdTimer >= 0.6f) { StopItemAudio(playerID); PlayClipFromItemAudio(9, playerID, 0.3f); RoundManager.Instance.PlayAudibleNoise(((Component)player).transform.position, 30f, 1f, 0, false, 0); } holdTimer = -1f; if ((Object)(object)headlamp != (Object)null && player.isPlayerControlled && !player.inTerminalMenu) { SyncLamp(!headlamp.activeSelf); } if (!(abilityCooldown < 0f) || !player.isPlayerControlled || player.inTerminalMenu || (StartOfRound.Instance.inShipPhase && !((NetworkBehaviour)StartOfRound.Instance).IsHost)) { return; } if (ability == "STIM") { if (HarvestAvailable()) { TriggerHarvest(); } else { if (!StimAvailable()) { return; } TriggerStim(); } } else { if (!(ability == "BEACON")) { return; } TriggerBeacon(); } if (NetworkManager.Singleton.IsHost) { TriggerClientRpc(ability, playerID); } else { TriggerServerRpc(ability, playerID); } RolesGUI.instance.HideTip(); } [ServerRpc(RequireOwnership = false)] public void TriggerServerRpc(string ability, int playerID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2195629412u, val, (RpcDelivery)0); bool flag = ability != null; ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(ability, false); } BytePacker.WriteValueBitPacked(val2, playerID); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2195629412u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ModBase.als.LogInfo((object)"SRpc is working"); TriggerClientRpc(ability, playerID); } } [ClientRpc] public void TriggerClientRpc(string ability, int playerID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2883274883u, val, (RpcDelivery)0); bool flag = ability != null; ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(ability, false); } BytePacker.WriteValueBitPacked(val2, playerID); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2883274883u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { ModBase.als.LogInfo((object)"CRpc is working"); if (ability == "BEACON") { TriggerBeaconClient(playerID); } } } public void EndSkill() { if (abilityRoutine != null) { ((MonoBehaviour)player).StopCoroutine(abilityRoutine); } if (ability == "BEACON") { EndBeacon(); } else if (ability == "KICK") { EndKick(); } if (NetworkManager.Singleton.IsHost) { EndClientRpc(ability, playerID); } else { EndServerRpc(ability, playerID); } } [ServerRpc(RequireOwnership = false)] public void EndServerRpc(string ability, int playerID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1036914643u, val, (RpcDelivery)0); bool flag = ability != null; ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(ability, false); } BytePacker.WriteValueBitPacked(val2, playerID); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1036914643u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { EndClientRpc(ability, playerID); } } [ClientRpc] public void EndClientRpc(string ability, int playerID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1753155917u, val, (RpcDelivery)0); bool flag = ability != null; ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(ability, false); } BytePacker.WriteValueBitPacked(val2, playerID); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1753155917u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && ability == "BEACON") { EndBeaconClient(playerID); } } public void UpdateSkill() { if (ability == "BEACON") { UpdateBeacon(); } if (NetworkManager.Singleton.IsHost) { UpdateClientRpc(ability, playerID); } else { UpdateServerRpc(ability, playerID); } } [ServerRpc(RequireOwnership = false)] public void UpdateServerRpc(string ability, int playerID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3432153076u, val, (RpcDelivery)0); bool flag = ability != null; ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(ability, false); } BytePacker.WriteValueBitPacked(val2, playerID); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3432153076u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { UpdateClientRpc(ability, playerID); } } [ClientRpc] public void UpdateClientRpc(string ability, int playerID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(4094021596u, val, (RpcDelivery)0); bool flag = ability != null; ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(ability, false); } BytePacker.WriteValueBitPacked(val2, playerID); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4094021596u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && ability == "BEACON") { UpdateBeaconClient(playerID); } } public void PlayClipFromItemAudio(int clip, int playerID, float volume) { if (NetworkManager.Singleton.IsHost) { PlayClipFromItemAudioClientRpc(clip, playerID, volume); } else { PlayClipFromItemAudioServerRpc(clip, playerID, volume); } } [ServerRpc(RequireOwnership = false)] public void PlayClipFromItemAudioServerRpc(int clip, int playerID, float volume) { //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_007e: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3071970631u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, clip); BytePacker.WriteValueBitPacked(val2, playerID); ((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref volume, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3071970631u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { PlayClipFromItemAudioClientRpc(clip, playerID, volume); } } } [ClientRpc] public void PlayClipFromItemAudioClientRpc(int clip, int playerID, float volume) { //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_007e: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3165416742u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, clip); BytePacker.WriteValueBitPacked(val2, playerID); ((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref volume, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3165416742u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { Sounds.PlayClipFromSource(clip, StartOfRound.Instance.allPlayerScripts[playerID].itemAudio, volume); } } } public void StopItemAudio(int playerID) { if (NetworkManager.Singleton.IsHost) { StopItemAudioClientRpc(playerID); } else { StopItemAudioServerRpc(playerID); } } [ServerRpc(RequireOwnership = false)] public void StopItemAudioServerRpc(int playerID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3303086127u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerID); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3303086127u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { StopItemAudioClientRpc(playerID); } } } [ClientRpc] public void StopItemAudioClientRpc(int playerID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3785438024u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerID); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3785438024u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { StartOfRound.Instance.allPlayerScripts[playerID].itemAudio.Stop(); } } } public void DestroyEnemy(int id) { if (NetworkManager.Singleton.IsHost) { DestroyEnemyClientRpc(id); } else { DestroyEnemyServerRpc(id); } } [ServerRpc(RequireOwnership = false)] public void DestroyEnemyServerRpc(int id) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(143709668u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, id); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 143709668u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { DestroyEnemyClientRpc(id); } } } [ClientRpc] public void DestroyEnemyClientRpc(int id) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1883639957u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, id); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1883639957u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { Object.Destroy((Object)(object)((Component)RoundManager.Instance.SpawnedEnemies[id]).gameObject); } } } public void TriggerBeacon() { ModBase.logOutput("Beacon activated!"); duration = 5f; abilityCooldown = 60f; } public void TriggerBeaconClient(int playerID) { //IL_004d: Unknown result type (might be due to invalid IL or missing references) if (playerID != -1) { PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[playerID]; ((Component)((Component)val).transform.Find("BeaconLight")).gameObject.SetActive(true); PlayClipFromItemAudio(0, playerID, 1.2f); RoundManager.Instance.PlayAudibleNoise(((Component)val).transform.position, 80f, 3f, 0, false, 0); } } public void UpdateBeacon() { sprintMeter = 1f; } public void UpdateBeaconClient(int playerID) { //IL_0046: 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_00b2: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[playerID]; foreach (EnemyAI spawnedEnemy in RoundManager.Instance.SpawnedEnemies) { if (((Object)(object)spawnedEnemy.targetPlayer != (Object)(object)val || !spawnedEnemy.movingTowardsTargetPlayer) && Vector3.Distance(((Component)val).transform.position, ((Component)spawnedEnemy).transform.position) <= 70f) { ModBase.als.LogInfo((object)"target changed"); spawnedEnemy.targetPlayer = val; spawnedEnemy.movingTowardsTargetPlayer = true; } } RoundManager.Instance.PlayAudibleNoise(((Component)val).transform.position, 80f, 3f, 0, false, 0); } public void EndBeacon() { ModBase.logOutput("Beacon ended!"); } public void EndBeaconClient(int playerID) { PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[playerID]; ((Component)((Component)val).transform.Find("BeaconLight")).gameObject.SetActive(false); } public void TriggerKick() { if (!active && sprintMeter > 0.4f) { active = true; if (abilityRoutine != null) { ((MonoBehaviour)player).StopCoroutine(abilityRoutine); } abilityRoutine = ((MonoBehaviour)player).StartCoroutine(reelKick()); } } private IEnumerator reelKick() { player.activatingItem = true; player.twoHanded = true; player.playerBodyAnimator.ResetTrigger("shovelHit"); player.playerBodyAnimator.SetBool("reelingUp", true); PlayClipFromItemAudio(1, playerID, 1f); yield return (object)new WaitForSeconds(0.35f); if (!ModBase.keybinds.SkillKey.IsPressed()) { EndKick(); yield break; } ModBase.logOutput("pulled back"); yield return (object)new WaitUntil((Func<bool>)(() => !ModBase.keybinds.SkillKey.IsPressed())); ModBase.logOutput("released"); SwingKick(); yield return (object)new WaitForSeconds(0.13f); yield return (object)new WaitForEndOfFrame(); ModBase.logOutput("hit"); HitKick(); yield return (object)new WaitForSeconds(0.3f); ModBase.logOutput("done"); active = false; abilityRoutine = null; } private void SwingKick() { //IL_003d: Unknown result type (might be due to invalid IL or missing references) player.playerBodyAnimator.SetBool("reelingUp", false); PlayClipFromItemAudio(2, playerID, 1f); player.UpdateSpecialAnimationValue(true, (short)((Component)player).transform.localEulerAngles.y, 0.4f, false); } private void HitKick() { //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: 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_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_033e: 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_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_013c: 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_01c6: 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_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_026b: 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_021d: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_029a: Unknown result type (might be due to invalid IL or missing references) //IL_02be: Unknown result type (might be due to invalid IL or missing references) //IL_02e3: Unknown result type (might be due to invalid IL or missing references) //IL_02e9: Unknown result type (might be due to invalid IL or missing references) if (sprintMeter >= 0.4f) { sprintMeter -= 0.4f; } else { sprintMeter = 0f; } player.activatingItem = false; player.twoHanded = false; bool flag = false; bool flag2 = false; int num = -1; RaycastHit[] source = Physics.SphereCastAll(((Component)player.gameplayCamera).transform.position + ((Component)player.gameplayCamera).transform.right * -0.35f, 0.8f, ((Component)player.gameplayCamera).transform.forward, 1.5f, 11012424, (QueryTriggerInteraction)2); List<RaycastHit> list = source.OrderBy((RaycastHit x) => ((RaycastHit)(ref x)).distance).ToList(); IHittable val2 = default(IHittable); RaycastHit val3 = default(RaycastHit); for (int i = 0; i < list.Count; i++) { RaycastHit val = list[i]; if (((Component)((RaycastHit)(ref val)).transform).gameObject.layer != 8) { val = list[i]; if (((Component)((RaycastHit)(ref val)).transform).gameObject.layer != 11) { val = list[i]; if (!((Component)((RaycastHit)(ref val)).transform).TryGetComponent<IHittable>(ref val2)) { continue; } val = list[i]; if ((Object)(object)((RaycastHit)(ref val)).transform == (Object)(object)((Component)player).transform) { continue; } val = list[i]; if (!(((RaycastHit)(ref val)).point == Vector3.zero)) { Vector3 position = ((Component)player.gameplayCamera).transform.position; val = list[i]; if (Physics.Linecast(position, ((RaycastHit)(ref val)).point, ref val3, StartOfRound.Instance.collidersAndRoomMaskAndDefault)) { continue; } } flag = true; Vector3 forward = ((Component)player.gameplayCamera).transform.forward; val2.Hit(1, forward, player, true, 1); if (((object)val2).GetType() == typeof(EnemyAICollisionDetect)) { ((EnemyAICollisionDetect)val2).mainScript.SetEnemyStunned(true, 1f, (PlayerControllerB)null); if ((Object)(object)player.inAnimationWithEnemy == (Object)(object)((EnemyAICollisionDetect)val2).mainScript) { player.DamagePlayer(50, true, true, (CauseOfDeath)12, 0, false, default(Vector3)); } } flag2 = true; continue; } } flag = true; val = list[i]; string tag = ((Component)((RaycastHit)(ref val)).collider).gameObject.tag; for (int j = 0; j < StartOfRound.Instance.footstepSurfaces.Length; j++) { if (StartOfRound.Instance.footstepSurfaces[j].surfaceTag == tag) { num = j; break; } } } if (flag) { PlayClipFromItemAudio(3, playerID, 1f); Object.FindObjectOfType<RoundManager>().PlayAudibleNoise(((Component)player).transform.position, 17f, 0.8f, 0, false, 0); if (!flag2 && num != -1) { player.itemAudio.PlayOneShot(StartOfRound.Instance.footstepSurfaces[num].hitSurfaceSFX); WalkieTalkie.TransmitOneShotAudio(player.itemAudio, StartOfRound.Instance.footstepSurfaces[num].hitSurfaceSFX, 1f); } player.playerBodyAnimator.SetTrigger("shovelHit"); } if (flag2) { abilityCooldown = 0f; } } private void EndKick() { active = false; abilityRoutine = null; player.activatingItem = false; player.twoHanded = false; player.playerBodyAnimator.SetBool("reelingUp", false); } private bool HarvestAvailable() { return HarvestTargetExists() && player.isCrouching; } private bool SynthesizeAvailable() { return extract >= 50f && charges < 3; } private bool StimAvailable() { return charges > 0; } private bool StimmingTeam() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) RaycastHit[] array = Physics.RaycastAll(((Component)player.gameplayCamera).transform.position, ((Component)player.gameplayCamera).transform.forward, 5f, 11012424, (QueryTriggerInteraction)2); RaycastHit[] array2 = array; PlayerControllerB val2 = default(PlayerControllerB); for (int i = 0; i < array2.Length; i++) { RaycastHit val = array2[i]; if (((Component)((RaycastHit)(ref val)).transform).TryGetComponent<PlayerControllerB>(ref val2) && !((Object)(object)((RaycastHit)(ref val)).transform == (Object)(object)((Component)player).transform) && !val2.isPlayerDead) { return true; } } return false; } private bool HarvestTargetExists() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) RaycastHit[] array = Physics.RaycastAll(((Component)player.gameplayCamera).transform.position, ((Component)player.gameplayCamera).transform.forward, 2f, 11012424, (QueryTriggerInteraction)2); RaycastHit[] array2 = array; EnemyAICollisionDetect val2 = default(EnemyAICollisionDetect); for (int i = 0; i < array2.Length; i++) { RaycastHit val = array2[i]; if (((Component)((RaycastHit)(ref val)).transform).TryGetComponent<EnemyAICollisionDetect>(ref val2) && val2.mainScript.isEnemyDead) { return true; } } return false; } public void TriggerHarvest() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) RaycastHit[] array = Physics.RaycastAll(((Component)player.gameplayCamera).transform.position, ((Component)player.gameplayCamera).transform.forward, 2f, 11012424, (QueryTriggerInteraction)2); RaycastHit[] array2 = array; EnemyAICollisionDetect val2 = default(EnemyAICollisionDetect); for (int i = 0; i < array2.Length; i++) { RaycastHit val = array2[i]; if (((Component)((RaycastHit)(ref val)).transform).TryGetComponent<EnemyAICollisionDetect>(ref val2) && val2.mainScript.isEnemyDead) { extract += extractValues[val2.mainScript.enemyType.enemyName]; if (extract > 100f) { extract = 100f; } DestroyEnemy(Array.IndexOf(RoundManager.Instance.SpawnedEnemies.ToArray(), val2.mainScript)); PlayClipFromItemAudio(4, playerID, 1f); break; } } } public void TriggerSynthesize() { extract -= 50f; PlayClipFromItemAudio(5, playerID, 1f); charges++; } public void TriggerStim() { //IL_0052: 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_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) freeCharge = false; if (!StimmingTeam()) { charges--; SelfStimmed(); return; } charges--; int num = -1; RaycastHit[] source = Physics.RaycastAll(((Component)player.gameplayCamera).transform.position, ((Component)player.gameplayCamera).transform.forward, 5f, 11012424, (QueryTriggerInteraction)2); List<RaycastHit> list = source.OrderBy((RaycastHit x) => ((RaycastHit)(ref x)).distance).ToList(); PlayerControllerB val = default(PlayerControllerB); foreach (RaycastHit item in list) { RaycastHit current = item; if (((Component)((RaycastHit)(ref current)).transform).TryGetComponent<PlayerControllerB>(ref val) && !((Object)(object)((RaycastHit)(ref current)).transform == (Object)(object)((Component)player).transform) && !val.isPlayerDead) { num = Array.IndexOf(StartOfRound.Instance.allPlayerScripts, val); ModBase.als.LogInfo((object)("Found component on " + num)); break; } } if (num == -1) { charges++; } else if (NetworkManager.Singleton.IsHost) { TriggerStimClientRpc(num); } else { TriggerStimServerRpc(num); } } [ServerRpc(RequireOwnership = false)] public void TriggerStimServerRpc(int playerID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(778867420u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerID); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 778867420u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { TriggerStimClientRpc(playerID); } } } [ClientRpc] public void TriggerStimClientRpc(int id) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3666217866u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, id); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3666217866u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && id == Instance.playerID) { Instance.SelfStimmed(); } } } public void SelfStimmed() { PlayClipFromItemAudio(6, playerID, 1f); if (player.health >= maxHealth) { PlayerControllerB obj = player; obj.drunkness += 0.5f; } else { PlayerControllerB obj2 = player; obj2.drunkness += 0.2f; } sprintMeter += 0.2f; if (sprintMeter > 1f) { sprintMeter = 1f; } PlayerControllerB obj3 = player; obj3.health += (int)((float)maxHealth * 0.3f); if (player.health > maxHealth) { player.health = maxHealth; } player.criticallyInjured = false; stimmed = true; } private bool HackAvailable() { return HackTargetExists() && battery >= 0.15f && abilityCooldown <= 0f; } private bool HackTargetExists() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) RaycastHit[] source = Physics.RaycastAll(((Component)player.gameplayCamera).transform.position, ((Component)player.gameplayCamera).transform.forward, 6f, 1 << LayerMask.NameToLayer("MapHazards"), (QueryTriggerInteraction)2); List<RaycastHit> list = source.ToList(); list.AddRange(Physics.RaycastAll(((Component)player.gameplayCamera).transform.position, ((Component)player.gameplayCamera).transform.forward, 6f, 1 << LayerMask.NameToLayer("Default"), (QueryTriggerInteraction)2)); TerminalAccessibleObject val = default(TerminalAccessibleObject); foreach (RaycastHit item in list) { RaycastHit current = item; if (((Component)((RaycastHit)(ref current)).transform).TryGetComponent<TerminalAccessibleObject>(ref val) && !Physics.Linecast(((Component)player.gameplayCamera).transform.position, ((RaycastHit)(ref current)).point, StartOfRound.Instance.collidersAndRoomMask)) { return true; } } return false; } private void BeginHack() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) PlayClipFromItemAudio(8, playerID, 1f); RoundManager.Instance.PlayAudibleNoise(((Component)player).transform.position, 30f, 1f, 0, false, 0); } public void TriggerHack() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) RaycastHit[] source = Physics.RaycastAll(((Component)player.gameplayCamera).transform.position, ((Component)player.gameplayCamera).transform.forward, 6f, 1 << LayerMask.NameToLayer("Default"), (QueryTriggerInteraction)2); List<RaycastHit> list = source.ToList(); list.AddRange(Physics.RaycastAll(((Component)player.gameplayCamera).transform.position, ((Component)player.gameplayCamera).transform.forward, 6f, 1 << LayerMask.NameToLayer("MapHazards"), (QueryTriggerInteraction)2)); TerminalAccessibleObject val = default(TerminalAccessibleObject); foreach (RaycastHit item in list) { RaycastHit current = item; if (((Component)((RaycastHit)(ref current)).transform).TryGetComponent<TerminalAccessibleObject>(ref val)) { val.CallFunctionFromTerminal(); battery -= 0.15f; abilityCooldown = 5f; } } } public void DestroyHeadlamp() { if (NetworkManager.Singleton.IsHost) { DestroyHeadlampClientRpc(playerID); } else { DestroyHeadlampServerRpc(playerID); } } [ServerRpc(RequireOwnership = false)] public void DestroyHeadlampServerRpc(int playerID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(800891759u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerID); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 800891759u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { DestroyHeadlampClientRpc(playerID); } } } [ClientRpc] public void DestroyHeadlampClientRpc(int playerID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2934874275u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerID); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2934874275u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { PlayerControllerB val3 = StartOfRound.Instance.allPlayerScripts[playerID]; Object.Destroy((Object)(object)((Component)val3).GetComponent<RoleManager>().headlamp); ((Component)val3).GetComponent<RoleManager>().headlamp = null; if (playerID == this.playerID) { ((Component)((Component)batteryBar).transform.parent).gameObject.SetActive(false); } } } public void CreateHeadlamp() { if (NetworkManager.Singleton.IsHost) { CreateHeadlampClientRpc(playerID); } else { CreateHeadlampServerRpc(playerID); } } [ServerRpc(RequireOwnership = false)] public void CreateHeadlampServerRpc(int playerID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3113792946u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerID); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3113792946u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { CreateHeadlampClientRpc(playerID); } } } [ClientRpc] public void CreateHeadlampClientRpc(int playerID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1289725766u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerID); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1289725766u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } PlayerControllerB val3 = StartOfRound.Instance.allPlayerScripts[playerID]; if (!((Object)(object)((Component)val3).GetComponent<RoleManager>().headlamp != (Object)null)) { GameObject val4 = Object.Instantiate<GameObject>(ModBase.assets.LoadAsset<GameObject>("Headlamp")); ((Component)val3).GetComponent<RoleManager>().headlamp = val4; Light component = val4.GetComponent<Light>(); component.colorTemperature = 4677f; component.useColorTemperature = true; component.lightShadowCasterMode = (LightShadowCasterMode)2; component.cookie = (Texture)(object)Resources.Load<Texture2D>("flashlightCookie2 4"); val4.transform.parent = ((Component)val3).transform.Find("PlayerEye"); val4.transform.localPosition = new Vector3(-0.1f, 0.3f, 0f); val4.transform.rotation = new Quaternion(0f, 0f, 0f, 0f); val4.SetActive(false); if (playerID == this.playerID) { ((Component)((Component)batteryBar).transform.parent).gameObject.SetActive(true); } } } public void SyncLamp(bool active) { PlayClipFromItemAudio(7, playerID, 1f); if (NetworkManager.Singleton.IsHost) { SyncLampClientRpc(playerID, active); } else { SyncLampServerRpc(playerID, active); } } [ServerRpc(RequireOwnership = false)] public void SyncLampServerRpc(int playerID, bool active) { //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_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_00a4: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2118470815u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerID); ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref active, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2118470815u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { SyncLampClientRpc(playerID, active); } } } [ClientRpc] public void SyncLampClientRpc(int playerID, bool active) { //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_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_00a4: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3043169109u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerID); ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref active, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3043169109u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { PlayerControllerB val3 = StartOfRound.Instance.allPlayerScripts[playerID]; ((Component)val3).GetComponent<RoleManager>().headlamp.SetActive(active); } } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_RoleManager() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Expected O, but got Unknown //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Expected O, but got Unknown //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Expected O, but got Unknown //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Expected O, but got Unknown //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Expected O, but got Unknown //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Expected O, but got Unknown //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Expected O, but got Unknown //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Expected O, but got Unknown //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Expected O, but got Unknown //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Expected O, but got Unknown //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Expected O, but got Unknown //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Expected O, but got Unknown //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Expected O, but got Unknown //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Expected O, but got Unknown //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Expected O, but got Unknown //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Expected O, but got Unknown //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Expected O, but got Unknown //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Expected O, but got Unknown //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Expected O, but got Unknown //IL_0263: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Expected O, but got Unknown //IL_027e: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Expected O, but got Unknown //IL_0299: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Expected O, but got Unknown //IL_02b4: Unknown result type (might be due to invalid IL or missing references) //IL_02be: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(2864087213u, new RpcReceiveHandler(__rpc_handler_2864087213)); NetworkManager.__rpc_func_table.Add(2721717499u, new RpcReceiveHandler(__rpc_handler_2721717499)); NetworkManager.__rpc_func_table.Add(1105422478u, new RpcReceiveHandler(__rpc_handler_1105422478)); NetworkManager.__rpc_func_table.Add(3005978444u, new RpcReceiveHandler(__rpc_handler_3005978444)); NetworkManager.__rpc_func_table.Add(349131064u, new RpcReceiveHandler(__rpc_handler_349131064)); NetworkManager.__rpc_func_table.Add(3316431406u, new RpcReceiveHandler(__rpc_handler_3316431406)); NetworkManager.__rpc_func_table.Add(2195629412u, new RpcReceiveHandler(__rpc_handler_2195629412)); NetworkManager.__rpc_func_table.Add(2883274883u, new RpcReceiveHandler(__rpc_handler_2883274883)); NetworkManager.__rpc_func_table.Add(1036914643u, new RpcReceiveHandler(__rpc_handler_1036914643)); NetworkManager.__rpc_func_table.Add(1753155917u, new RpcReceiveHandler(__rpc_handler_1753155917)); NetworkManager.__rpc_func_table.Add(3432153076u, new RpcReceiveHandler(__rpc_handler_3432153076)); NetworkManager.__rpc_func_table.Add(4094021596u, new RpcReceiveHandler(__rpc_handler_4094021596)); NetworkManager.__rpc_func_table.Add(3071970631u, new RpcReceiveHandler(__rpc_handler_3071970631)); NetworkManager.__rpc_func_table.Add(3165416742u, new RpcReceiveHandler(__rpc_handler_3165416742)); NetworkManager.__rpc_func_table.Add(3303086127u, new RpcReceiveHandler(__rpc_handler_3303086127)); NetworkManager.__rpc_func_table.Add(3785438024u, new RpcReceiveHandler(__rpc_handler_3785438024)); NetworkManager.__rpc_func_table.Add(143709668u, new RpcReceiveHandler(__rpc_handler_143709668)); NetworkManager.__rpc_func_table.Add(1883639957u, new RpcReceiveHandler(__rpc_handler_1883639957)); NetworkManager.__rpc_func_table.Add(778867420u, new RpcReceiveHandler(__rpc_handler_778867420)); NetworkManager.__rpc_func_table.Add(3666217866u, new RpcReceiveHandler(__rpc_handler_3666217866)); NetworkManager.__rpc_func_table.Add(800891759u, new RpcReceiveHandler(__rpc_handler_800891759)); NetworkManager.__rpc_func_table.Add(2934874275u, new RpcReceiveHandler(__rpc_handler_2934874275)); NetworkManager.__rpc_func_table.Add(3113792946u, new RpcReceiveHandler(__rpc_handler_3113792946)); NetworkManager.__rpc_func_table.Add(1289725766u, new RpcReceiveHandler(__rpc_handler_1289725766)); NetworkManager.__rpc_func_table.Add(2118470815u, new RpcReceiveHandler(__rpc_handler_2118470815)); NetworkManager.__rpc_func_table.Add(3043169109u, new RpcReceiveHandler(__rpc_handler_3043169109)); } private static void __rpc_handler_2864087213(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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: 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_00ab: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int id = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref id); float num = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref num, default(ForPrimitives)); bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives)); string role = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref role, false); } target.__rpc_exec_stage = (__RpcExecStage)1; ((RoleManager)(object)target).ApplyRoleServerRpc(id, num, role); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2721717499(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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: 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_00ab: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int id = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref id); float num = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref num, default(ForPrimitives)); bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives)); string role = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref role, false); } target.__rpc_exec_stage = (__RpcExecStage)2; ((RoleManager)(object)target).ApplyRoleClientRpc(id, num, role); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1105422478(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; ((RoleManager)(object)target).BroadcastRoleServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3005978444(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)2; ((RoleManager)(object)target).BroadcastRoleClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_349131064(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; ((RoleManager)(object)target).SyncClassObjectsServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3316431406(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)2; ((RoleManager)(object)target).SyncClassObjectsClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2195629412(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_005b: 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_008c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives)); string text = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref text, false); } int num = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref num); target.__rpc_exec_stage = (__RpcExecStage)1; ((RoleManager)(object)target).TriggerServerRpc(text, num); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2883274883(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_005b: 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_008c: Unknown result type (might be due to invali