using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Threading; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using Dawn; using GameNetcodeStuff; using HatLib.Tools; using IL; using IL.GameNetcodeStuff; using LethalCompanyInputUtils.Api; using LethalCompanyInputUtils.BindingPathEnums; using LethalThings.MonoBehaviours; using LethalThings.NetcodePatcher; using LethalThings.Patches; using Microsoft.CodeAnalysis; using Mono.Cecil.Cil; using MonoMod.Cil; using On; using On.GameNetcodeStuff; using TMPro; using Unity.Collections; using Unity.Netcode; using UnityEngine; using UnityEngine.AI; using UnityEngine.Events; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; using UnityEngine.InputSystem.Utilities; 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: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("LethalThings")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("0.11.0.0")] [assembly: AssemblyInformationalVersion("0.11.0")] [assembly: AssemblyProduct("LethalThings")] [assembly: AssemblyTitle("LethalThings")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.11.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [module: NetcodePatchedAssembly] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace LethalThings { public static class Content { public static void Init() { Item item = ((Registry)(object)LethalContent.Items)[Keys.RocketLauncher].Item; DawnLib.RegisterNetworkPrefab(item.spawnPrefab.GetComponent().MissilePrefab); Item item2 = ((Registry)(object)LethalContent.Items)[Keys.Flaregun].Item; DawnLib.RegisterNetworkPrefab(item2.spawnPrefab.GetComponent().ProjectilePrefab); Item item3 = ((Registry)(object)LethalContent.Items)[Keys.Dart].Item; DawnLib.RegisterNetworkPrefab(item3.spawnPrefab.GetComponent().ProjectilePrefab); } } public static class EXPLOOOOOOOOOOOSIONUtilities { private static readonly Collider[] ExplosionColliders = (Collider[])(object)new Collider[128]; public static void CreateExplosion(Vector3 explosionPosition, bool spawnExplosionEffect = false, int damage = 20, float minDamageRange = 0f, float maxDamageRange = 1f, int enemyHitForce = 6, CauseOfDeath causeOfDeath = (CauseOfDeath)3, PlayerControllerB attacker = null, string explosionName = null) { //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: 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_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_030b: Unknown result type (might be due to invalid IL or missing references) //IL_033f: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_029e: Unknown result type (might be due to invalid IL or missing references) if (spawnExplosionEffect) { RoundManager instance = RoundManager.Instance; object obj; if (instance == null) { obj = null; } else { GameObject mapPropsContainer = instance.mapPropsContainer; obj = ((mapPropsContainer != null) ? mapPropsContainer.transform : null); } Transform val = (Transform)obj; Object.Instantiate(StartOfRound.Instance.explosionPrefab, explosionPosition, Quaternion.Euler(-90f, 0f, 0f), val).SetActive(true); } float num = Vector3.Distance(((Component)GameNetworkManager.Instance.localPlayerController).transform.position, explosionPosition); if (num < 14f) { HUDManager.Instance.ShakeCamera((ScreenShakeType)1); } else if (num < 25f) { HUDManager.Instance.ShakeCamera((ScreenShakeType)0); } bool flag = false; int num2 = Physics.OverlapSphereNonAlloc(explosionPosition, maxDamageRange, ExplosionColliders, 2621448, (QueryTriggerInteraction)2); RaycastHit val3 = default(RaycastHit); for (int i = 0; i < num2; i++) { Collider val2 = ExplosionColliders[i]; float num3 = Vector3.Distance(explosionPosition, ((Component)val2).transform.position); if (Physics.Linecast(explosionPosition, ((Component)val2).transform.position + Vector3.up * 0.3f, ref val3, 1073742080, (QueryTriggerInteraction)1) && num3 > 4f) { continue; } if (((Component)val2).gameObject.layer == 3 && !flag) { PlayerControllerB component = ((Component)val2).gameObject.GetComponent(); if (component != null && ((NetworkBehaviour)component).IsOwner) { flag = true; float num4 = 1f - Mathf.Clamp01((num3 - minDamageRange) / (maxDamageRange - minDamageRange)); int num5 = (int)((float)damage * num4); component.DamagePlayer(num5, true, true, causeOfDeath, 0, false, default(Vector3)); if (!string.IsNullOrEmpty(explosionName)) { Log.Debug($"{explosionName} dealt {num5} damage to the local player."); } } } else if (((Component)val2).gameObject.layer == 21) { Landmine componentInChildren = ((Component)val2).gameObject.GetComponentInChildren(); if (componentInChildren != null && !componentInChildren.hasExploded && num3 < 6f) { ((MonoBehaviour)componentInChildren).StartCoroutine(componentInChildren.TriggerOtherMineDelayed(componentInChildren)); } } else { if (((Component)val2).gameObject.layer != 19) { continue; } EnemyAICollisionDetect componentInChildren2 = ((Component)val2).gameObject.GetComponentInChildren(); if (componentInChildren2 != null && ((NetworkBehaviour)componentInChildren2.mainScript).IsOwner && (double)num3 < 4.5) { EnemyAI mainScript = componentInChildren2.mainScript; mainScript.HitEnemyOnLocalClient(enemyHitForce, default(Vector3), attacker, false, -1); if (!string.IsNullOrEmpty(explosionName)) { Log.Debug($"{explosionName} hit enemy {mainScript.enemyType.enemyName} with force {enemyHitForce}"); } } } } int num6 = ~LayerMask.GetMask(new string[1] { "Colliders" }); num2 = Physics.OverlapSphereNonAlloc(explosionPosition, 10f, ExplosionColliders, num6); Rigidbody val4 = default(Rigidbody); for (int j = 0; j < num2; j++) { if (((Component)ExplosionColliders[j]).TryGetComponent(ref val4)) { val4.AddExplosionForce(70f, explosionPosition, 10f); } } } } public static class InputUtilsCompat { private static bool itemActionsSubscribed; public static InputAction LTUtilityBeltQuick1 => Keybinds.Instance.LTUtilityBeltQuick1; public static InputAction LTUtilityBeltQuick2 => Keybinds.Instance.LTUtilityBeltQuick2; public static InputAction LTUtilityBeltQuick3 => Keybinds.Instance.LTUtilityBeltQuick3; public static InputAction FlaregunReload => ItemKeybinds.Instance.FlaregunReload; public static InputAction HackingToolPower => ItemKeybinds.Instance.HackingToolPower; public static InputAction HackingToolMode => ItemKeybinds.Instance.HackingToolMode; public static InputAction PingerPower => ItemKeybinds.Instance.PingerPower; public static InputAction HandheldRadarPower => ItemKeybinds.Instance.HandheldRadarPower; public static InputAction RocketLauncherLaser => ItemKeybinds.Instance.RocketLauncherLaser; public static InputAction RocketLauncherReload => ItemKeybinds.Instance.RocketLauncherReload; public static void Init() { if (Keybinds.Instance == null) { Keybinds.Instance = new Keybinds(); } if (ItemKeybinds.Instance == null) { ItemKeybinds.Instance = new ItemKeybinds(); } if (!itemActionsSubscribed) { FlaregunReload.performed += ReloadFlaregun; HackingToolPower.performed += ToggleHackingToolPower; HackingToolMode.performed += ToggleHackingToolMode; PingerPower.performed += TogglePingerPower; HandheldRadarPower.performed += ToggleHandheldRadarPower; RocketLauncherLaser.performed += ToggleRocketLauncherLaser; RocketLauncherReload.performed += ReloadRocketLauncher; itemActionsSubscribed = true; } } public static string BindingText(InputAction action) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) if (action == null) { return "Unbound"; } string text = null; Enumerator enumerator = action.bindings.GetEnumerator(); try { while (enumerator.MoveNext()) { InputBinding current = enumerator.Current; if (((InputBinding)(ref current)).isComposite || ((InputBinding)(ref current)).isPartOfComposite || string.IsNullOrWhiteSpace(((InputBinding)(ref current)).effectivePath)) { continue; } string text2 = InputControlPath.ToHumanReadableString(((InputBinding)(ref current)).effectivePath, (HumanReadableStringOptions)2, (InputControl)null); if (!string.IsNullOrWhiteSpace(text2)) { string text3 = FormatBindingText(text2); if (((InputBinding)(ref current)).effectivePath.StartsWith("", StringComparison.Ordinal) || ((InputBinding)(ref current)).effectivePath.StartsWith("", StringComparison.Ordinal)) { return text3; } if (text == null) { text = text3; } } } } finally { ((IDisposable)enumerator/*cast due to .constrained prefix*/).Dispose(); } return text ?? "Unbound"; } private static string FormatBindingText(string bindingText) { if (1 == 0) { } string result; switch (bindingText) { case "Left Button": case "Left Click": result = "L.Click"; break; case "Right Button": case "Right Click": result = "R.Click"; break; case "Middle Button": case "Middle Click": result = "M.Click"; break; case "Left Arrow": result = "L.Arrow"; break; case "Right Arrow": result = "R.Arrow"; break; case "Up Arrow": result = "U.Arrow"; break; case "Down Arrow": result = "D.Arrow"; break; case "Left Shift": result = "L.Shift"; break; case "Right Shift": result = "R.Shift"; break; case "Left Ctrl": case "Left Control": result = "L.Ctrl"; break; case "Right Ctrl": case "Right Control": result = "R.Ctrl"; break; case "Left Alt": result = "L.Alt"; break; case "Right Alt": result = "R.Alt"; break; case "Escape": result = "Esc"; break; default: result = bindingText; break; } if (1 == 0) { } return result; } private static void ReloadFlaregun(CallbackContext _) { if (GameNetworkManager.Instance?.localPlayerController?.currentlyHeldObjectServer is ProjectileWeapon projectileWeapon) { ((GrabbableObject)projectileWeapon).ItemInteractLeftRight(false); } } private static void ToggleHackingToolPower(CallbackContext _) { if (GameNetworkManager.Instance?.localPlayerController?.currentlyHeldObjectServer is HackingTool hackingTool) { hackingTool.TogglePower(); } } private static void ToggleHackingToolMode(CallbackContext _) { if (GameNetworkManager.Instance?.localPlayerController?.currentlyHeldObjectServer is HackingTool hackingTool) { hackingTool.ToggleHackMode(); } } private static void TogglePingerPower(CallbackContext _) { if (GameNetworkManager.Instance?.localPlayerController?.currentlyHeldObjectServer is Pinger pinger) { ((GrabbableObject)pinger).ItemInteractLeftRight(false); } } private static void ToggleHandheldRadarPower(CallbackContext _) { if (GameNetworkManager.Instance?.localPlayerController?.currentlyHeldObjectServer is HandheldRadar handheldRadar) { ((GrabbableObject)handheldRadar).ItemInteractLeftRight(false); } } private static void ToggleRocketLauncherLaser(CallbackContext _) { if (GameNetworkManager.Instance?.localPlayerController?.currentlyHeldObjectServer is RocketLauncher rocketLauncher) { ((GrabbableObject)rocketLauncher).ItemInteractLeftRight(false); } } private static void ReloadRocketLauncher(CallbackContext _) { if (GameNetworkManager.Instance?.localPlayerController?.currentlyHeldObjectServer is RocketLauncher rocketLauncher) { rocketLauncher.Reload(); } } } public class Keybinds : LcInputActions { public static Keybinds Instance; [InputAction("", Name = "[LT] Utility Belt Quick 1")] public InputAction LTUtilityBeltQuick1 { get; set; } [InputAction("", Name = "[LT] Utility Belt Quick 2")] public InputAction LTUtilityBeltQuick2 { get; set; } [InputAction("", Name = "[LT] Utility Belt Quick 3")] public InputAction LTUtilityBeltQuick3 { get; set; } } public class ItemKeybinds : LcInputActions { public static ItemKeybinds Instance; public InputAction FlaregunReload => ((LcInputActions)this).Asset["flaregun_reload"]; public InputAction HackingToolPower => ((LcInputActions)this).Asset["hacking_tool_power_toggle"]; public InputAction HackingToolMode => ((LcInputActions)this).Asset["hacking_tool_mode_toggle"]; public InputAction PingerPower => ((LcInputActions)this).Asset["pinger_power"]; public InputAction HandheldRadarPower => ((LcInputActions)this).Asset["handheld_radar_power"]; public InputAction RocketLauncherLaser => ((LcInputActions)this).Asset["rocket_launcher_laser"]; public InputAction RocketLauncherReload => ((LcInputActions)this).Asset["rocket_launcher_reload"]; public override void CreateInputActions(in InputActionMapBuilder builder) { builder.NewActionBinding().WithActionId("flaregun_reload").WithActionType((InputActionType)1) .WithKeyboardControl((KeyboardControl)37) .WithBindingName("Flaregun Reload") .Finish(); builder.NewActionBinding().WithActionId("hacking_tool_power_toggle").WithActionType((InputActionType)1) .WithKeyboardControl((KeyboardControl)37) .WithBindingName("Hacking Tool Power Toggle") .Finish(); builder.NewActionBinding().WithActionId("hacking_tool_mode_toggle").WithActionType((InputActionType)1) .WithKeyboardControl((KeyboardControl)25) .WithBindingName("Hacking Tool Mode Toggle") .Finish(); builder.NewActionBinding().WithActionId("pinger_power").WithActionType((InputActionType)1) .WithKeyboardControl((KeyboardControl)37) .WithBindingName("Pinger Power") .Finish(); builder.NewActionBinding().WithActionId("handheld_radar_power").WithActionType((InputActionType)1) .WithKeyboardControl((KeyboardControl)37) .WithBindingName("Handheld Radar Power") .Finish(); builder.NewActionBinding().WithActionId("rocket_launcher_laser").WithActionType((InputActionType)1) .WithKeyboardControl((KeyboardControl)37) .WithBindingName("Rocket Launcher Laser") .Finish(); builder.NewActionBinding().WithActionId("rocket_launcher_reload").WithActionType((InputActionType)1) .WithKeyboardControl((KeyboardControl)38) .WithBindingName("Rocket Launcher Reload") .Finish(); } } public static class Keys { public const string Namespace = "lethalthings"; public static readonly NamespacedKey Flaregun = NamespacedKey.From("lethalthings", "flaregun"); public static readonly NamespacedKey RocketLauncher = NamespacedKey.From("lethalthings", "rocket_launcher"); public static readonly NamespacedKey Rocket = NamespacedKey.From("lethalthings", "rocket"); public static readonly NamespacedKey Dart = NamespacedKey.From("lethalthings", "dart"); public static readonly NamespacedKey CrystalCore = NamespacedKey.From("lethalthings", "crystal_core"); public static readonly NamespacedKey DaysSinceLastFatality = NamespacedKey.From("lethalthings", "days_since_last_fatality"); } public static class LethalThingsConfig { private const string DuskGuid = "HQ_Team.LethalThingsReloaded"; private static readonly DuskConfigInjector DuskConfig = new DuskConfigInjector("HQ_Team.LethalThingsReloaded"); public static ConfigEntry evilMaxwellChance; public static ConfigEntry maxwellPlayMusicDefault; public static ConfigEntry hackingToolConnectionTime; public static ConfigEntry hackingToolBattery; public static ConfigEntry hackingToolAnswerNumber; public static ConfigEntry hackingToolHackDistance; public static ConfigEntry hackingToolHackSpreadDistance; public static ConfigEntry hackingToolDoorCooldown; public static ConfigEntry hackingToolTurretDisableTime; public static ConfigEntry hackingToolSpikeDisableTime; public static ConfigEntry hackingToolLandmineExplodeOnHack; public static ConfigEntry hackingToolLandmineDisableTime; public static ConfigEntry handheldRadarBattery; public static ConfigEntry pingerMaxUses; public static ConfigEntry pingerDuration; public static ConfigEntry pingerRange; public static ConfigEntry preventForestGiantIgnition; public static ConfigEntry dartboardStartingDarts; public static ConfigEntry enableItemChargerShortCircuit; public static ConfigEntry itemChargerShortCircuitDamage; public static void Load() { evilMaxwellChance = Bind("Scrap", "MaxwellEvilChance", 10f, "Maxwell evil chance in percent. E.g. 10 = 10%"); maxwellPlayMusicDefault = Bind("Scrap", "MaxwellPlayMusicDefault", defaultValue: true, "Maxwell plays music by default."); hackingToolConnectionTime = Bind("Hacking Tool", "ConnectionTime", 8f, "Connect time in seconds."); hackingToolBattery = Bind("Hacking Tool", "Battery", 200f, "Battery capacity."); hackingToolAnswerNumber = Bind("Hacking Tool", "AnswerNumber", 8, "Numbers in the hack answer."); hackingToolHackDistance = Bind("Hacking Tool", "HackDistance", 15f, "Hack range."); hackingToolHackSpreadDistance = Bind("Hacking Tool", "HackSpreadDistance", 20f, "Hack area around the target."); hackingToolDoorCooldown = Bind("Hacking Tool", "DoorCooldown", 5f, "Door hack cooldown in seconds."); hackingToolTurretDisableTime = Bind("Hacking Tool", "TurretDisableTime", 15f, "Turret disable time in seconds."); hackingToolSpikeDisableTime = Bind("Hacking Tool", "SpikeDisableTime", 10f, "Spike trap disable time in seconds."); hackingToolLandmineExplodeOnHack = Bind("Hacking Tool", "LandmineExplodeOnHack", defaultValue: true, "Landmines explode when hacked."); hackingToolLandmineDisableTime = Bind("Hacking Tool", "LandmineDisableTime", 10f, "Landmine disable time in seconds."); handheldRadarBattery = Bind("Handheld Radar", "Battery", 200f, "Battery capacity."); pingerMaxUses = Bind("Pinger", "MaxUses", 11, "Pings from one full battery."); pingerDuration = Bind("Pinger", "PingDuration", 8f, "Ping marker time in seconds."); pingerRange = Bind("Pinger", "PingRange", 80f, "Ping range."); preventForestGiantIgnition = Bind("Flaregun", "PreventForestGiantIgnition", defaultValue: false, "If true, flares do not set Forest Giants on fire."); dartboardStartingDarts = Bind("Dartboard", "StartingDarts", 3, "Darts spawned when a dartboard is created. Maximum 14."); enableItemChargerShortCircuit = Bind("Misc", "EnableItemChargerShortCircuit", defaultValue: true, "Conductive items can short circuit the ship."); itemChargerShortCircuitDamage = Bind("Misc", "ItemChargerShortCircuitDamage", 20, "Damage from the item charger short circuit."); } private static ConfigEntry Bind(string section, string settingName, T defaultValue, string description) { ConfigEntry val = DuskConfig.Bind(section, settingName, defaultValue, description); return val ?? throw new InvalidOperationException("Dusk config entry '" + section + "/" + settingName + "' could not be created."); } } internal static class Log { internal static void Debug(string message) { Write((LogLevel)32, message); } internal static void Info(string message) { Write((LogLevel)16, message); } internal static void Warn(string message) { Write((LogLevel)4, message); } internal static void Error(string message) { Write((LogLevel)2, message); } internal static void Fatal(string message) { Write((LogLevel)1, message); } private static void Write(LogLevel logLevel, string message) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) Plugin.mls.Log(logLevel, (object)message); } } [BepInPlugin("HQ_Team.LethalThingsReloaded.Internals", "LethalThingsReloaded", "0.11.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { public const string ModGUID = "HQ_Team.LethalThingsReloaded.Internals"; public const string ModName = "LethalThingsReloaded"; public const string ModVersion = "0.11.0"; internal static ManualLogSource mls; private void Awake() { mls = ((BaseUnityPlugin)this).Logger; InitialiseNetworkSerialisation(); LethalThingsConfig.Load(); Content.Init(); LethalThings.Patches.Patches.Load(); InputUtilsCompat.Init(); Log.Info("LethalThingsReloaded loaded"); } private static void InitialiseNetworkSerialisation() { MethodInfo methodInfo = typeof(Plugin).Assembly.GetType("__GEN.NetworkVariableSerializationHelper")?.GetMethod("InitializeSerialization", BindingFlags.Static | BindingFlags.NonPublic); if (methodInfo == null) { Log.Fatal("Netcode serialization method was not found"); } else { methodInfo.Invoke(null, null); } } } public static class MyPluginInfo { public const string PLUGIN_GUID = "LethalThings"; public const string PLUGIN_NAME = "LethalThings"; public const string PLUGIN_VERSION = "0.11.0"; } } namespace LethalThings.Patches { public static class Patches { public static void Load() { PowerOutletStun.Load(); PouchyBeltPatch.Load(); ToyHammerPatch.Load(); HandheldRadar.Load(); HackingTool.Load(); FlareController.Init(); FatalitiesSign.Init(); Arson.Init(); ForcedPing.Init(); Cookie.Init(); RocketLauncherAmmo.Init(); } } public static class PouchyBeltPatch { [CompilerGenerated] private static class <>O { public static Manipulator <0>__PlayerControllerB_SwitchToItemSlotIL; public static hook_SetSpecialGrabAnimationBool <1>__PlayerControllerB_SetSpecialGrabAnimationBool; public static hook_SwitchToItemSlot <2>__PlayerControllerB_SwitchToItemSlot; public static Func <3>__SkipRemoteHudSlot; } private static readonly int GrabHash = Animator.StringToHash("Grab"); private static readonly int GrabValidatedHash = Animator.StringToHash("GrabValidated"); private static readonly int CancelHoldingHash = Animator.StringToHash("cancelHolding"); private static readonly int ThrowHash = Animator.StringToHash("Throw"); public static void Load() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Expected O, but got Unknown object obj = <>O.<0>__PlayerControllerB_SwitchToItemSlotIL; if (obj == null) { Manipulator val = PlayerControllerB_SwitchToItemSlotIL; <>O.<0>__PlayerControllerB_SwitchToItemSlotIL = val; obj = (object)val; } PlayerControllerB.SwitchToItemSlot += (Manipulator)obj; object obj2 = <>O.<1>__PlayerControllerB_SetSpecialGrabAnimationBool; if (obj2 == null) { hook_SetSpecialGrabAnimationBool val2 = PlayerControllerB_SetSpecialGrabAnimationBool; <>O.<1>__PlayerControllerB_SetSpecialGrabAnimationBool = val2; obj2 = (object)val2; } PlayerControllerB.SetSpecialGrabAnimationBool += (hook_SetSpecialGrabAnimationBool)obj2; object obj3 = <>O.<2>__PlayerControllerB_SwitchToItemSlot; if (obj3 == null) { hook_SwitchToItemSlot val3 = PlayerControllerB_SwitchToItemSlot; <>O.<2>__PlayerControllerB_SwitchToItemSlot = val3; obj3 = (object)val3; } PlayerControllerB.SwitchToItemSlot += (hook_SwitchToItemSlot)obj3; } private static void PlayerControllerB_SwitchToItemSlotIL(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0084: 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_0092: Expected O, but got Unknown //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); val.GotoNext((MoveType)0, new Func[3] { (Instruction instruction) => ILPatternMatchingExt.MatchLdarg(instruction, 0), (Instruction instruction) => ILPatternMatchingExt.MatchLdarg(instruction, 1), (Instruction instruction) => ILPatternMatchingExt.MatchStfld(instruction, "currentItemSlot") }); ILLabel val2 = val.MarkLabel(); ILCursor val3 = new ILCursor(il) { Index = 0 }; val3.Emit(OpCodes.Ldarg_0); val3.Emit(OpCodes.Ldarg_1); val3.EmitDelegate>((Func)SkipRemoteHudSlot); val3.Emit(OpCodes.Brtrue, (object)val2); } private static bool SkipRemoteHudSlot(PlayerControllerB player, int slot) { return !((NetworkBehaviour)player).IsOwner && slot != 50 && (slot >= HUDManager.Instance.itemSlotIconFrames.Length || slot >= HUDManager.Instance.itemSlotIcons.Length); } private static void PlayerControllerB_SetSpecialGrabAnimationBool(orig_SetSpecialGrabAnimationBool orig, PlayerControllerB self, bool setTrue, GrabbableObject currentItem) { if ((Object)(object)currentItem == (Object)null) { currentItem = self.currentlyGrabbingObject; } if (!(currentItem?.itemProperties.grabAnim == "none")) { orig.Invoke(self, setTrue, currentItem); } } private static void PlayerControllerB_SwitchToItemSlot(orig_SwitchToItemSlot orig, PlayerControllerB self, int slot, GrabbableObject fillSlotWithItem) { orig.Invoke(self, slot, fillSlotWithItem); if (self.currentlyHeldObjectServer is PouchyBelt pouchyBelt) { ((GrabbableObject)pouchyBelt).isPocketed = true; ((GrabbableObject)pouchyBelt).EnableItemMeshes(false); self.playerBodyAnimator.SetBool(GrabHash, false); self.playerBodyAnimator.SetBool(GrabValidatedHash, false); self.playerBodyAnimator.SetBool(CancelHoldingHash, true); self.playerBodyAnimator.ResetTrigger(ThrowHash); self.playerBodyAnimator.SetTrigger(ThrowHash); } } } public static class PowerOutletStun { [CompilerGenerated] private static class <>O { public static hook_ChargeItem <0>__ItemCharger_ChargeItem; public static hook_Update <1>__ItemCharger_Update; public static hook_Start <2>__StartOfRound_Start; public static hook_SetInstanceValuesBackToDefault <3>__GameNetworkManager_SetInstanceValuesBackToDefault; public static HandleNamedMessageDelegate <4>__ConductiveChargeRequested; public static HandleNamedMessageDelegate <5>__ConductiveChargeApproved; } private const string ChargeRequestMessage = "HQ_Team.LethalThingsReloaded.Internals.ConductiveChargeRequest"; private const string ShortCircuitMessage = "HQ_Team.LethalThingsReloaded.Internals.ConductiveShortCircuit"; private static readonly int ZapHash = Animator.StringToHash("zap"); private static readonly WaitForSeconds ShortCircuitDelay = new WaitForSeconds(0.75f); private static readonly Dictionary chargerCoroutines = new Dictionary(); public static void Load() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Expected O, but got Unknown //IL_0074: 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_007f: Expected O, but got Unknown object obj = <>O.<0>__ItemCharger_ChargeItem; if (obj == null) { hook_ChargeItem val = ItemCharger_ChargeItem; <>O.<0>__ItemCharger_ChargeItem = val; obj = (object)val; } ItemCharger.ChargeItem += (hook_ChargeItem)obj; object obj2 = <>O.<1>__ItemCharger_Update; if (obj2 == null) { hook_Update val2 = ItemCharger_Update; <>O.<1>__ItemCharger_Update = val2; obj2 = (object)val2; } ItemCharger.Update += (hook_Update)obj2; object obj3 = <>O.<2>__StartOfRound_Start; if (obj3 == null) { hook_Start val3 = StartOfRound_Start; <>O.<2>__StartOfRound_Start = val3; obj3 = (object)val3; } StartOfRound.Start += (hook_Start)obj3; object obj4 = <>O.<3>__GameNetworkManager_SetInstanceValuesBackToDefault; if (obj4 == null) { hook_SetInstanceValuesBackToDefault val4 = GameNetworkManager_SetInstanceValuesBackToDefault; <>O.<3>__GameNetworkManager_SetInstanceValuesBackToDefault = val4; obj4 = (object)val4; } GameNetworkManager.SetInstanceValuesBackToDefault += (hook_SetInstanceValuesBackToDefault)obj4; } private static void StartOfRound_Start(orig_Start orig, StartOfRound self) { //IL_0052: 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: Expected O, but got Unknown //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown orig.Invoke(self); NetworkManager.Singleton.CustomMessagingManager.UnregisterNamedMessageHandler("HQ_Team.LethalThingsReloaded.Internals.ConductiveChargeRequest"); NetworkManager.Singleton.CustomMessagingManager.UnregisterNamedMessageHandler("HQ_Team.LethalThingsReloaded.Internals.ConductiveShortCircuit"); CustomMessagingManager customMessagingManager = NetworkManager.Singleton.CustomMessagingManager; object obj = <>O.<4>__ConductiveChargeRequested; if (obj == null) { HandleNamedMessageDelegate val = ConductiveChargeRequested; <>O.<4>__ConductiveChargeRequested = val; obj = (object)val; } customMessagingManager.RegisterNamedMessageHandler("HQ_Team.LethalThingsReloaded.Internals.ConductiveChargeRequest", (HandleNamedMessageDelegate)obj); CustomMessagingManager customMessagingManager2 = NetworkManager.Singleton.CustomMessagingManager; object obj2 = <>O.<5>__ConductiveChargeApproved; if (obj2 == null) { HandleNamedMessageDelegate val2 = ConductiveChargeApproved; <>O.<5>__ConductiveChargeApproved = val2; obj2 = (object)val2; } customMessagingManager2.RegisterNamedMessageHandler("HQ_Team.LethalThingsReloaded.Internals.ConductiveShortCircuit", (HandleNamedMessageDelegate)obj2); Log.Info("Conductive charger messages registered"); } private static void GameNetworkManager_SetInstanceValuesBackToDefault(orig_SetInstanceValuesBackToDefault orig, GameNetworkManager self) { orig.Invoke(self); NetworkManager singleton = NetworkManager.Singleton; CustomMessagingManager val = ((singleton != null) ? singleton.CustomMessagingManager : null); if (val != null) { val.UnregisterNamedMessageHandler("HQ_Team.LethalThingsReloaded.Internals.ConductiveChargeRequest"); val.UnregisterNamedMessageHandler("HQ_Team.LethalThingsReloaded.Internals.ConductiveShortCircuit"); Log.Info("Conductive charger messages unregistered"); } chargerCoroutines.Clear(); } private unsafe static void ConductiveChargeRequested(ulong senderClientId, FastBufferReader reader) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003f: 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_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) if (!LethalThingsConfig.enableItemChargerShortCircuit.Value) { Log.Debug("Conductive charger request was rejected because short circuits are disabled"); return; } ulong num = default(ulong); ((FastBufferReader)(ref reader)).ReadValueSafe(ref num, default(ForPrimitives)); ulong key = default(ulong); ((FastBufferReader)(ref reader)).ReadValueSafe(ref key, default(ForPrimitives)); if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.Warn("Conductive charger request was rejected because the sender was not holding the item"); return; } PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[value]; GrabbableObject currentlyHeldObjectServer = val.currentlyHeldObjectServer; if (!((Object)(object)((currentlyHeldObjectServer != null) ? ((NetworkBehaviour)currentlyHeldObjectServer).NetworkObject : null) == (Object)null) && ((NetworkBehaviour)currentlyHeldObjectServer).NetworkObject.NetworkObjectId == num) { Item itemProperties = currentlyHeldObjectServer.itemProperties; if (itemProperties != null && itemProperties.isConductiveMetal && !currentlyHeldObjectServer.itemProperties.requiresBattery) { if (!NetworkManager.Singleton.SpawnManager.SpawnedObjects.TryGetValue(key, out var value2)) { Log.Warn("Conductive charger request was rejected because the charger was unavailable"); return; } ItemCharger componentInChildren = ((Component)value2).GetComponentInChildren(); int value3 = LethalThingsConfig.itemChargerShortCircuitDamage.Value; FastBufferWriter val2 = default(FastBufferWriter); ((FastBufferWriter)(ref val2))..ctor(16, (Allocator)2, -1); try { ((FastBufferWriter)(ref val2)).WriteValueSafe(ref key, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref value3, default(ForPrimitives)); NetworkManager.Singleton.CustomMessagingManager.SendNamedMessageToAll("HQ_Team.LethalThingsReloaded.Internals.ConductiveShortCircuit", val2, (NetworkDelivery)2); if (NetworkManager.Singleton.IsHost) { ShortCircuit(componentInChildren, value3); } Log.Debug("Conductive charger short circuit approved"); return; } finally { ((IDisposable)(*(FastBufferWriter*)(&val2))/*cast due to .constrained prefix*/).Dispose(); } } } Log.Warn("Conductive charger request was rejected because the sender was not holding the item"); } private static void ItemCharger_Update(orig_Update orig, ItemCharger self) { orig.Invoke(self); if (self.updateInterval == 0f) { GrabbableObject val = GameNetworkManager.Instance?.localPlayerController?.currentlyHeldObjectServer; if ((Object)(object)val != (Object)null && (val.itemProperties.requiresBattery || val.itemProperties.isConductiveMetal)) { self.triggerScript.interactable = true; } } } private unsafe static void ItemCharger_ChargeItem(orig_ChargeItem orig, ItemCharger self) { //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) GrabbableObject currentlyHeldObjectServer = GameNetworkManager.Instance.localPlayerController.currentlyHeldObjectServer; if (LethalThingsConfig.enableItemChargerShortCircuit.Value && currentlyHeldObjectServer != null && currentlyHeldObjectServer.itemProperties?.isConductiveMetal == true && !currentlyHeldObjectServer.itemProperties.requiresBattery) { NetworkManager singleton = NetworkManager.Singleton; CustomMessagingManager val = ((singleton != null) ? singleton.CustomMessagingManager : null); NetworkManager singleton2 = NetworkManager.Singleton; if (singleton2 != null && singleton2.IsListening && val != null && !((Object)(object)((NetworkBehaviour)currentlyHeldObjectServer).NetworkObject == (Object)null) && !((Object)(object)((NetworkBehaviour)self).NetworkObject == (Object)null)) { FastBufferWriter val2 = default(FastBufferWriter); ((FastBufferWriter)(ref val2))..ctor(16, (Allocator)2, -1); try { ulong networkObjectId = ((NetworkBehaviour)currentlyHeldObjectServer).NetworkObject.NetworkObjectId; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref networkObjectId, default(ForPrimitives)); networkObjectId = ((NetworkBehaviour)self).NetworkObject.NetworkObjectId; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref networkObjectId, default(ForPrimitives)); val.SendNamedMessage("HQ_Team.LethalThingsReloaded.Internals.ConductiveChargeRequest", 0uL, val2, (NetworkDelivery)2); Log.Debug("Conductive charger request sent"); return; } finally { ((IDisposable)(*(FastBufferWriter*)(&val2))/*cast due to .constrained prefix*/).Dispose(); } } Log.Warn("Conductive charger short circuit could not send its request"); } else { orig.Invoke(self); } } private static void ConductiveChargeApproved(ulong senderClientId, FastBufferReader reader) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) ulong key = default(ulong); ((FastBufferReader)(ref reader)).ReadValueSafe(ref key, default(ForPrimitives)); int damage = default(int); ((FastBufferReader)(ref reader)).ReadValueSafe(ref damage, default(ForPrimitives)); NetworkManager singleton = NetworkManager.Singleton; if (((singleton != null) ? singleton.SpawnManager : null) == null || !NetworkManager.Singleton.SpawnManager.SpawnedObjects.TryGetValue(key, out var value)) { Log.Warn("Conductive charger short circuit could not find the charger"); return; } ItemCharger componentInChildren = ((Component)value).GetComponentInChildren(); ShortCircuit(componentInChildren, damage); } private static void ShortCircuit(ItemCharger charger, int damage) { ulong networkObjectId = ((NetworkBehaviour)charger).NetworkObject.NetworkObjectId; if (chargerCoroutines.TryGetValue(networkObjectId, out var value)) { ((MonoBehaviour)charger).StopCoroutine(value); } chargerCoroutines[networkObjectId] = ((MonoBehaviour)charger).StartCoroutine(ShortCircuitDelayed(charger, damage)); } private static IEnumerator ShortCircuitDelayed(ItemCharger charger, int damage) { charger.zapAudio.Play(); yield return ShortCircuitDelay; charger.chargeStationAnimator.SetTrigger(ZapHash); Vector3 position = ((Component)charger.triggerScript).transform.position; EXPLOOOOOOOOOOOSIONUtilities.CreateExplosion(position, spawnExplosionEffect: false, damage, 0f, 5f, 3, (CauseOfDeath)11); StormyWeather stormyWeather = Object.FindFirstObjectByType((FindObjectsInactive)1); if ((Object)(object)stormyWeather == (Object)null) { Log.Error("Conductive charger short circuit could not find storm effects"); chargerCoroutines.Remove(((NetworkBehaviour)charger).NetworkObject.NetworkObjectId); yield break; } ParticleSystem particle = Object.Instantiate(stormyWeather.explosionEffectParticle, position + Vector3.up * 0.25f, Quaternion.identity); AudioSource audio = Object.Instantiate(stormyWeather.targetedStrikeAudio, position + Vector3.up * 0.5f, Quaternion.identity); particle.Play(); stormyWeather.PlayThunderEffects(position, audio); Object.Destroy((Object)(object)((Component)particle).gameObject, 5f); Object.Destroy((Object)(object)((Component)audio).gameObject, 5f); chargerCoroutines.Remove(((NetworkBehaviour)charger).NetworkObject.NetworkObjectId); } } internal static class ToyHammerPatch { [CompilerGenerated] private static class <>O { public static Manipulator <0>__Shovel_HitShovel; public static Func <1>__HitWithToyHammer; } public static void Load() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown object obj = <>O.<0>__Shovel_HitShovel; if (obj == null) { Manipulator val = Shovel_HitShovel; <>O.<0>__Shovel_HitShovel = val; obj = (object)val; } Shovel.HitShovel += (Manipulator)obj; } private static void Shovel_HitShovel(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); val.GotoNext((MoveType)0, new Func[1] { (Instruction instruction) => ILPatternMatchingExt.MatchCallOrCallvirt(instruction, "Hit") }); val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)HitWithToyHammer); val.Next.OpCode = OpCodes.Nop; val.Next.Operand = null; } private static bool HitWithToyHammer(IHittable hittable, int shovelHitForce, Vector3 hitDirection, PlayerControllerB playerWhoHit, bool playHitSFX, int hitID, Shovel shovel) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) if (!(shovel is ToyHammer toyHammer)) { return hittable.Hit(shovelHitForce, hitDirection, playerWhoHit, playHitSFX, hitID); } int num = ((Random.Range(0f, 100f) < toyHammer.hammerHitPercentage) ? toyHammer.hammerHitForce : shovelHitForce); return hittable.Hit(num, hitDirection, playerWhoHit, playHitSFX, hitID); } } } namespace LethalThings.MonoBehaviours { public class Arson : NoisemakerProp { [CompilerGenerated] private static class <>O { public static hook_CheckBoundsForPlayers <0>__ShowerTrigger_CheckBoundsForPlayers; } public bool isCleanable; public Item cleanArson; public float totalShowerTime = 5f; private static readonly List allArson = new List(); private readonly NetworkVariable cleanedScrapValue = new NetworkVariable(-1, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); private readonly NetworkVariable cleanedInElevator = new NetworkVariable(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); private readonly NetworkVariable cleanedInShipRoom = new NetworkVariable(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); private Random chompRandom; private BoxCollider itemCollider; private ShowerTrigger currentShower; private bool beingShowered; private bool cleaningComplete; private float showerTime; public static void Init() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown object obj = <>O.<0>__ShowerTrigger_CheckBoundsForPlayers; if (obj == null) { hook_CheckBoundsForPlayers val = ShowerTrigger_CheckBoundsForPlayers; <>O.<0>__ShowerTrigger_CheckBoundsForPlayers = val; obj = (object)val; } ShowerTrigger.CheckBoundsForPlayers += (hook_CheckBoundsForPlayers)obj; } private static void ShowerTrigger_CheckBoundsForPlayers(orig_CheckBoundsForPlayers orig, ShowerTrigger self) { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) bool flag = Time.realtimeSinceStartup - self.cleanInterval >= 1.5f; orig.Invoke(self); if (!flag) { return; } NetworkManager singleton = NetworkManager.Singleton; if (singleton == null || !singleton.IsServer) { return; } Bounds bounds = self.showerCollider.bounds; for (int i = 0; i < allArson.Count; i++) { Arson arson = allArson[i]; if (arson.isCleanable) { bool flag2 = (arson.beingShowered = !((GrabbableObject)arson).isHeld && ((Bounds)(ref bounds)).Intersects(((Collider)arson.itemCollider).bounds)); arson.currentShower = (flag2 ? self : null); if (!flag2) { arson.showerTime = 0f; } } } } public void Awake() { itemCollider = ((Component)this).GetComponent(); allArson.Add(this); } public override void OnNetworkSpawn() { ((NetworkBehaviour)this).OnNetworkSpawn(); NetworkVariable obj = cleanedScrapValue; obj.OnValueChanged = (OnValueChangedDelegate)(object)Delegate.Combine((Delegate?)(object)obj.OnValueChanged, (Delegate?)(object)new OnValueChangedDelegate(CleanedScrapValueChanged)); NetworkVariable obj2 = cleanedInElevator; obj2.OnValueChanged = (OnValueChangedDelegate)(object)Delegate.Combine((Delegate?)(object)obj2.OnValueChanged, (Delegate?)(object)new OnValueChangedDelegate(CleanedLocationChanged)); NetworkVariable obj3 = cleanedInShipRoom; obj3.OnValueChanged = (OnValueChangedDelegate)(object)Delegate.Combine((Delegate?)(object)obj3.OnValueChanged, (Delegate?)(object)new OnValueChangedDelegate(CleanedLocationChanged)); RefreshCleanedItem(); } public override void OnNetworkDespawn() { NetworkVariable obj = cleanedScrapValue; obj.OnValueChanged = (OnValueChangedDelegate)(object)Delegate.Remove((Delegate?)(object)obj.OnValueChanged, (Delegate?)(object)new OnValueChangedDelegate(CleanedScrapValueChanged)); NetworkVariable obj2 = cleanedInElevator; obj2.OnValueChanged = (OnValueChangedDelegate)(object)Delegate.Remove((Delegate?)(object)obj2.OnValueChanged, (Delegate?)(object)new OnValueChangedDelegate(CleanedLocationChanged)); NetworkVariable obj3 = cleanedInShipRoom; obj3.OnValueChanged = (OnValueChangedDelegate)(object)Delegate.Remove((Delegate?)(object)obj3.OnValueChanged, (Delegate?)(object)new OnValueChangedDelegate(CleanedLocationChanged)); ((NetworkBehaviour)this).OnNetworkDespawn(); } public override void Start() { ((NoisemakerProp)this).Start(); chompRandom = new Random(StartOfRound.Instance.randomMapSeed + 85); } public override void Update() { ((GrabbableObject)this).Update(); if (!((NetworkBehaviour)this).IsServer || !isCleanable || cleaningComplete) { return; } if (beingShowered && !((GrabbableObject)this).isHeld) { ShowerTrigger obj = currentShower; if (obj != null && obj.showerOn) { showerTime += Time.deltaTime; if (!(showerTime < totalShowerTime)) { cleaningComplete = true; ((MonoBehaviour)this).StartCoroutine(ReplaceAfterShower()); } return; } } beingShowered = false; currentShower = null; showerTime = 0f; } private IEnumerator ReplaceAfterShower() { GameObject cleanedObject = Object.Instantiate(cleanArson.spawnPrefab, ((Component)this).transform.position, ((Component)this).transform.rotation); Arson cleanedArson = cleanedObject.GetComponent(); int price = (int)((float)Random.Range(((GrabbableObject)cleanedArson).itemProperties.minValue, ((GrabbableObject)cleanedArson).itemProperties.maxValue) * RoundManager.Instance.scrapValueMultiplier); cleanedArson.cleanedInElevator.Value = ((GrabbableObject)this).isInElevator; cleanedArson.cleanedInShipRoom.Value = ((GrabbableObject)this).isInShipRoom; cleanedArson.cleanedScrapValue.Value = price; ((NetworkBehaviour)cleanedArson).NetworkObject.Spawn(false); Log.Debug("Dirty Arson replaced with Clean Arson"); yield return null; ((NetworkBehaviour)this).NetworkObject.Despawn(true); } public override void ItemActivate(bool used, bool buttonDown = true) { //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) ((NoisemakerProp)this).ItemActivate(used, buttonDown); if (!((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)null)) { int num = chompRandom.Next(0, base.noiseSFX.Length); chompRandom.Next((int)(base.minLoudness * 100f), (int)(base.maxLoudness * 100f)); chompRandom.Next((int)(base.minPitch * 100f), (int)(base.maxPitch * 100f)); if (((Object)base.noiseSFX[num]).name.Contains("chomp") && ((NetworkBehaviour)this).IsOwner) { ((GrabbableObject)this).playerHeldBy.DamagePlayer(30, true, true, (CauseOfDeath)6, 0, false, default(Vector3)); ((GrabbableObject)this).playerHeldBy.DiscardHeldObject(false, (NetworkObject)null, default(Vector3), true); } } } public override void OnDestroy() { allArson.Remove(this); ((GrabbableObject)this).OnDestroy(); } private void CleanedScrapValueChanged(int _, int __) { RefreshCleanedItem(); } private void CleanedLocationChanged(bool _, bool __) { RefreshCleanedItem(); } private void RefreshCleanedItem() { int value = cleanedScrapValue.Value; if (value >= 0) { ((GrabbableObject)this).SetScrapValue(value); ((GrabbableObject)this).isInElevator = cleanedInElevator.Value; ((GrabbableObject)this).isInShipRoom = cleanedInShipRoom.Value; Transform val = (((GrabbableObject)this).isInElevator ? StartOfRound.Instance.elevatorTransform : StartOfRound.Instance.propsContainer); ((Component)this).transform.SetParent(val, true); } } protected override void __initializeVariables() { if (cleanedScrapValue == null) { throw new Exception("Arson.cleanedScrapValue cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)cleanedScrapValue).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)cleanedScrapValue, "cleanedScrapValue"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)cleanedScrapValue); if (cleanedInElevator == null) { throw new Exception("Arson.cleanedInElevator cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)cleanedInElevator).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)cleanedInElevator, "cleanedInElevator"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)cleanedInElevator); if (cleanedInShipRoom == null) { throw new Exception("Arson.cleanedInShipRoom cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)cleanedInShipRoom).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)cleanedInShipRoom, "cleanedInShipRoom"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)cleanedInShipRoom); ((NoisemakerProp)this).__initializeVariables(); } protected override void __initializeRpcs() { ((NoisemakerProp)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "Arson"; } } public class Cookie : NoisemakerProp { [CompilerGenerated] private static class <>O { public static hook_RequireCooldown <0>__GrabbableObject_RequireCooldown; public static hook_ItemInteractLeftRightOnClient <1>__GrabbableObject_ItemInteractLeftRightOnClient; public static hook_UseItemBatteries <2>__GrabbableObject_UseItemBatteries; } private const float ExplodePercentage = 0.04f; private const float OooPennyPercentage = 0.2f; [SerializeField] private AudioClip[] cookieSpecialAudio; [SerializeField] private AnimationCurve itemFallCurve; [SerializeField] private AnimationCurve itemVerticalFallCurve; [SerializeField] private AnimationCurve itemVerticalFallCurveNoBounce; private bool beingThrown; private bool wasThrown; private bool waitingForLanding; private ulong throwingClientId; public static void Init() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Expected O, but got Unknown object obj = <>O.<0>__GrabbableObject_RequireCooldown; if (obj == null) { hook_RequireCooldown val = GrabbableObject_RequireCooldown; <>O.<0>__GrabbableObject_RequireCooldown = val; obj = (object)val; } GrabbableObject.RequireCooldown += (hook_RequireCooldown)obj; object obj2 = <>O.<1>__GrabbableObject_ItemInteractLeftRightOnClient; if (obj2 == null) { hook_ItemInteractLeftRightOnClient val2 = GrabbableObject_ItemInteractLeftRightOnClient; <>O.<1>__GrabbableObject_ItemInteractLeftRightOnClient = val2; obj2 = (object)val2; } GrabbableObject.ItemInteractLeftRightOnClient += (hook_ItemInteractLeftRightOnClient)obj2; object obj3 = <>O.<2>__GrabbableObject_UseItemBatteries; if (obj3 == null) { hook_UseItemBatteries val3 = GrabbableObject_UseItemBatteries; <>O.<2>__GrabbableObject_UseItemBatteries = val3; obj3 = (object)val3; } GrabbableObject.UseItemBatteries += (hook_UseItemBatteries)obj3; } private static bool GrabbableObject_UseItemBatteries(orig_UseItemBatteries orig, GrabbableObject self, bool isToggle, bool buttonDown) { if (self is Cookie { beingThrown: not false }) { return true; } return orig.Invoke(self, isToggle, buttonDown); } private static void GrabbableObject_ItemInteractLeftRightOnClient(orig_ItemInteractLeftRightOnClient orig, GrabbableObject self, bool right) { Cookie cookie = self as Cookie; if (cookie == null || right) { orig.Invoke(self, right); return; } cookie.beingThrown = true; orig.Invoke(self, right); cookie.beingThrown = false; } private static bool GrabbableObject_RequireCooldown(orig_RequireCooldown orig, GrabbableObject self) { if (self is Cookie { beingThrown: not false }) { return false; } return orig.Invoke(self); } public override void ItemInteractLeftRight(bool right) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).ItemInteractLeftRight(right); if (!right) { PlayCookieAudio(0); if (((NetworkBehaviour)this).IsOwner) { CookieThrownRpc(); wasThrown = true; ((GrabbableObject)this).playerHeldBy.DiscardHeldObject(true, (NetworkObject)null, CookieThrowDestination(), true); } } } public override void EquipItem() { ((GrabbableObject)this).EnableItemMeshes(true); ((GrabbableObject)this).playerHeldBy.equippedUsableItemQE = true; ((GrabbableObject)this).isPocketed = false; } public override void DiscardItem() { if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null) { ((GrabbableObject)this).playerHeldBy.equippedUsableItemQE = false; } ((GrabbableObject)this).DiscardItem(); } public override void PocketItem() { if (((NetworkBehaviour)this).IsOwner && (Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null) { ((GrabbableObject)this).playerHeldBy.equippedUsableItemQE = false; } ((GrabbableObject)this).PocketItem(); } public override void FallWithCurve() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0027: 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_005c: 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_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_0106: 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_0126: Unknown result type (might be due to invalid IL or missing references) Vector3 val = ((GrabbableObject)this).startFallingPosition - ((GrabbableObject)this).targetFloorPosition; float magnitude = ((Vector3)(ref val)).magnitude; ((Component)this).transform.rotation = Quaternion.Lerp(((Component)this).transform.rotation, Quaternion.Euler(((GrabbableObject)this).itemProperties.restingRotation.x, ((Component)this).transform.eulerAngles.y, ((GrabbableObject)this).itemProperties.restingRotation.z), 14f * Time.deltaTime / magnitude); ((Component)this).transform.localPosition = Vector3.Lerp(((GrabbableObject)this).startFallingPosition, ((GrabbableObject)this).targetFloorPosition, itemFallCurve.Evaluate(((GrabbableObject)this).fallTime)); ((Component)this).transform.localPosition = ((magnitude > 5f) ? Vector3.Lerp(new Vector3(((Component)this).transform.localPosition.x, ((GrabbableObject)this).startFallingPosition.y, ((Component)this).transform.localPosition.z), new Vector3(((Component)this).transform.localPosition.x, ((GrabbableObject)this).targetFloorPosition.y, ((Component)this).transform.localPosition.z), itemVerticalFallCurveNoBounce.Evaluate(((GrabbableObject)this).fallTime)) : Vector3.Lerp(new Vector3(((Component)this).transform.localPosition.x, ((GrabbableObject)this).startFallingPosition.y, ((Component)this).transform.localPosition.z), new Vector3(((Component)this).transform.localPosition.x, ((GrabbableObject)this).targetFloorPosition.y, ((Component)this).transform.localPosition.z), itemVerticalFallCurve.Evaluate(((GrabbableObject)this).fallTime))); ((GrabbableObject)this).fallTime = ((GrabbableObject)this).fallTime + Mathf.Abs(Time.deltaTime * 12f / magnitude); } public override void OnHitGround() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) if (wasThrown && ((NetworkBehaviour)this).IsOwner) { wasThrown = false; CookieLandedRpc(); } } [Rpc(/*Could not decode attribute arguments.*/)] private void CookieThrownRpc(RpcParams rpcParams = default(RpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: 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) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false, Delivery = (RpcDelivery)0 }; FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(138173801u, rpcParams, val, (SendTo)2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 138173801u, rpcParams, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ulong senderClientId = rpcParams.Receive.SenderClientId; if (StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value) && !((Object)(object)StartOfRound.Instance.allPlayerScripts[value].currentlyHeldObjectServer != (Object)(object)this)) { throwingClientId = senderClientId; waitingForLanding = true; } } } [Rpc(/*Could not decode attribute arguments.*/)] private void CookieLandedRpc(RpcParams rpcParams = default(RpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false, Delivery = (RpcDelivery)0 }; FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(186710038u, rpcParams, val, (SendTo)2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 186710038u, rpcParams, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (waitingForLanding && rpcParams.Receive.SenderClientId == throwingClientId) { waitingForLanding = false; if (Random.Range(0f, 1000f) / 1000f <= 0.04f) { Log.Debug("Cookie boom boom"); CookieResultRpc(exploded: true, throwingClientId); ((NetworkBehaviour)this).NetworkObject.Despawn(true); } else if (Random.Range(0f, 1000f) / 1000f <= 0.2f) { Log.Debug("Cookie played penny sound"); CookieResultRpc(exploded: false, throwingClientId); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void CookieResultRpc(bool exploded, ulong throwerClientId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0091: 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_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { Delivery = (RpcDelivery)0 }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(840131743u, val3, val, (SendTo)7, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref exploded, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val2, throwerClientId); ((NetworkBehaviour)this).__endSendRpc(ref val2, 840131743u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!exploded) { base.noiseAudio.Stop(); AudioSource noiseAudioFar = base.noiseAudioFar; if (noiseAudioFar != null) { noiseAudioFar.Stop(); } PlayCookieAudio(1); } else { int num = StartOfRound.Instance.ClientPlayerList[throwerClientId]; PlayerControllerB attacker = StartOfRound.Instance.allPlayerScripts[num]; EXPLOOOOOOOOOOOSIONUtilities.CreateExplosion(((Component)this).transform.position, spawnExplosionEffect: true, 20, 0f, 4f, 10, (CauseOfDeath)3, attacker); } } private void PlayCookieAudio(int index) { //IL_0047: Unknown result type (might be due to invalid IL or missing references) AudioClip val = cookieSpecialAudio[index]; base.noiseAudio.PlayOneShot(val); AudioSource noiseAudioFar = base.noiseAudioFar; if (noiseAudioFar != null) { noiseAudioFar.PlayOneShot(val); } WalkieTalkie.TransmitOneShotAudio(base.noiseAudio, val, 0.5f); RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, base.noiseRange, 0.5f, 0, ((GrabbableObject)this).isInElevator && StartOfRound.Instance.hangarDoorsClosed, 0); } private Vector3 CookieThrowDestination() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: 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_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) Ray val = default(Ray); ((Ray)(ref val))..ctor(((Component)((GrabbableObject)this).playerHeldBy.gameplayCamera).transform.position, ((Component)((GrabbableObject)this).playerHeldBy.gameplayCamera).transform.forward); RaycastHit val3 = default(RaycastHit); Vector3 val2 = ((!Physics.Raycast(val, ref val3, 12f, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1)) ? ((Ray)(ref val)).GetPoint(10f) : ((Ray)(ref val)).GetPoint(((RaycastHit)(ref val3)).distance - 0.05f)); ((Ray)(ref val))..ctor(val2, Vector3.down); return Physics.Raycast(val, ref val3, 30f, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1) ? (((RaycastHit)(ref val3)).point + Vector3.up * 0.05f) : ((Ray)(ref val)).GetPoint(30f); } protected override void __initializeVariables() { ((NoisemakerProp)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(138173801u, new RpcReceiveHandler(__rpc_handler_138173801), "CookieThrownRpc"); ((NetworkBehaviour)this).__registerRpc(186710038u, new RpcReceiveHandler(__rpc_handler_186710038), "CookieLandedRpc"); ((NetworkBehaviour)this).__registerRpc(840131743u, new RpcReceiveHandler(__rpc_handler_840131743), "CookieResultRpc"); ((NoisemakerProp)this).__initializeRpcs(); } private static void __rpc_handler_138173801(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { RpcParams ext = rpcParams.Ext; target.__rpc_exec_stage = (__RpcExecStage)1; ((Cookie)(object)target).CookieThrownRpc(ext); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_186710038(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { RpcParams ext = rpcParams.Ext; target.__rpc_exec_stage = (__RpcExecStage)1; ((Cookie)(object)target).CookieLandedRpc(ext); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_840131743(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool exploded = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref exploded, default(ForPrimitives)); ulong throwerClientId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref throwerClientId); target.__rpc_exec_stage = (__RpcExecStage)1; ((Cookie)(object)target).CookieResultRpc(exploded, throwerClientId); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "Cookie"; } } public class Dart : GrabbableObject { [SerializeField] private GameObject projectilePrefab; [SerializeField] private float throwForce = 10f; internal GameObject ProjectilePrefab => projectilePrefab; public override void ItemActivate(bool used, bool buttonDown = true) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).ItemActivate(used, buttonDown); if (buttonDown && ((NetworkBehaviour)this).IsOwner && !((Object)(object)base.playerHeldBy == (Object)null)) { PlayerControllerB playerHeldBy = base.playerHeldBy; Vector3 forward = ((Component)playerHeldBy.gameplayCamera).transform.forward; Vector3 normalized = ((Vector3)(ref forward)).normalized; ThrowDartServerRpc(((Component)this).transform.position, ((Component)this).transform.rotation, normalized); } } [Rpc(/*Could not decode attribute arguments.*/)] private void ThrowDartServerRpc(Vector3 launchPosition, Quaternion launchRotation, Vector3 direction, RpcParams rpcParams = default(RpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false, Delivery = (RpcDelivery)0 }; FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3493494647u, rpcParams, val, (SendTo)2, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref launchPosition); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref launchRotation); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref direction); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3493494647u, rpcParams, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ulong senderClientId = rpcParams.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.Warn("Dart throw was rejected"); return; } PlayerControllerB val3 = StartOfRound.Instance.allPlayerScripts[value]; int currentItemSlot = val3.currentItemSlot; if (val3 != null && !val3.isPlayerDead && !((Object)(object)val3.currentlyHeldObjectServer != (Object)(object)this) && currentItemSlot >= 0 && currentItemSlot < val3.ItemSlots.Length && !((Object)(object)val3.ItemSlots[currentItemSlot] != (Object)(object)this) && !(((Vector3)(ref direction)).sqrMagnitude < 0.99f)) { Vector3 val4 = launchPosition - ((Component)val3).transform.position; if (!(((Vector3)(ref val4)).sqrMagnitude > 16f)) { GameObject val5 = Object.Instantiate(projectilePrefab, launchPosition, launchRotation); NetworkObject component = val5.GetComponent(); component.SpawnWithOwnership(senderClientId, false); val5.GetComponent().Launch(launchPosition, launchRotation, ((Vector3)(ref direction)).normalized * throwForce, senderClientId, currentItemSlot); Log.Debug("Dart projectile spawned"); return; } } Log.Warn("Dart throw was rejected"); } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(3493494647u, new RpcReceiveHandler(__rpc_handler_3493494647), "ThrowDartServerRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_3493494647(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 launchPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref launchPosition); Quaternion launchRotation = default(Quaternion); ((FastBufferReader)(ref reader)).ReadValueSafe(ref launchRotation); Vector3 direction = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref direction); RpcParams ext = rpcParams.Ext; target.__rpc_exec_stage = (__RpcExecStage)1; ((Dart)(object)target).ThrowDartServerRpc(launchPosition, launchRotation, direction, ext); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "Dart"; } } public class DartboardInit : NetworkBehaviour { public Transform[] dartSpawns; private GameObject dartProjectilePrefab; private void Awake() { GameObject spawnPrefab = ((Registry)(object)LethalContent.Items)[Keys.Dart].Item.spawnPrefab; dartProjectilePrefab = spawnPrefab.GetComponent().ProjectilePrefab; if (!Object.op_Implicit((Object)(object)dartProjectilePrefab)) { Log.Error("Dartboard projectile prefab could not be found"); } } public override void OnNetworkSpawn() { ((NetworkBehaviour)this).OnNetworkSpawn(); if (((NetworkBehaviour)this).IsServer) { ((MonoBehaviour)this).StartCoroutine(SpawnStartingDarts()); } } private IEnumerator SpawnStartingDarts() { yield return null; List unusedSpawns = new List(); for (int i = 0; i < dartSpawns.Length; i++) { unusedSpawns.Add(i); } int existingDarts = Object.FindObjectsByType((FindObjectsInactive)0, (FindObjectsSortMode)0).Length; int spawnCount = Mathf.Clamp(LethalThingsConfig.dartboardStartingDarts.Value - existingDarts, 0, Mathf.Min(14, unusedSpawns.Count)); for (int j = 0; j < spawnCount; j++) { int choice = Random.Range(0, unusedSpawns.Count); int spawnIndex = unusedSpawns[choice]; unusedSpawns.RemoveAt(choice); Transform dartSpawn = dartSpawns[spawnIndex]; GameObject dartObject = Object.Instantiate(dartProjectilePrefab, dartSpawn.position, dartSpawn.rotation); NetworkObject dartNetworkObject = dartObject.GetComponent(); dartNetworkObject.Spawn(false); dartObject.GetComponent().SeatInDartboard(NetworkObjectReference.op_Implicit(((NetworkBehaviour)this).NetworkObject), spawnIndex); } Log.Debug($"Dartboard spawned {spawnCount} darts"); } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { ((NetworkBehaviour)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "DartboardInit"; } } public class DartProjectile : NetworkBehaviour { [SerializeField] private Transform dartTip; [SerializeField] private InteractTrigger pickupTrigger; [SerializeField] private AudioSource audioSource; [SerializeField] private AudioClip dartHitSound; [SerializeField] private float gravity = 9.8f; [SerializeField] private float hitRadius = 0.04f; [SerializeField] private float maximumFlightTime = 5f; private Collider pickupCollider; private readonly RaycastHit[] flightHits = (RaycastHit[])(object)new RaycastHit[16]; private readonly Collider[] surfaceHits = (Collider[])(object)new Collider[16]; private readonly NetworkVariable landedForClients = new NetworkVariable(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); private GameObject dartItemPrefab; private AudioClip dartGrabSound; private Vector3 velocity; private float flightEndsAt; private int stickMask; private int interactableObjectLayer; private int grabHash; private int grabInvalidatedHash; private int grabValidatedHash; private int cancelHoldingHash; private int getItemHash; private int throwHash; private bool flying; private bool launched; private bool landed; private bool claimed; private void Awake() { Item item = ((Registry)(object)LethalContent.Items)[Keys.Dart].Item; dartItemPrefab = item.spawnPrefab; dartGrabSound = item.grabSFX; stickMask = LayerMask.GetMask(new string[3] { "Default", "Room", "InteractableObject" }); interactableObjectLayer = LayerMask.NameToLayer("InteractableObject"); grabHash = Animator.StringToHash("Grab"); grabInvalidatedHash = Animator.StringToHash("GrabInvalidated"); grabValidatedHash = Animator.StringToHash("GrabValidated"); cancelHoldingHash = Animator.StringToHash("cancelHolding"); getItemHash = Animator.StringToHash("GetItem"); throwHash = Animator.StringToHash("Throw"); pickupCollider = ((Component)pickupTrigger).GetComponent(); ((UnityEvent)(object)pickupTrigger.onInteract).AddListener((UnityAction)PickUpDart); SetPickup(enabled: false); } public override void OnNetworkSpawn() { ((NetworkBehaviour)this).OnNetworkSpawn(); if (landedForClients.Value) { flying = false; landed = true; SetPickup(enabled: true); } } public void Launch(Vector3 position, Quaternion rotation, Vector3 launchVelocity, ulong playerClientId, int itemSlot) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)this).IsServer && !launched) { launched = true; LaunchClientRpc(position, rotation, launchVelocity, playerClientId, itemSlot); } } [Rpc(/*Could not decode attribute arguments.*/)] private void LaunchClientRpc(Vector3 position, Quaternion rotation, Vector3 launchVelocity, ulong playerClientId, int itemSlot) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { Delivery = (RpcDelivery)0 }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3021509621u, val3, val, (SendTo)7, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref position); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref rotation); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref launchVelocity); BytePacker.WriteValueBitPacked(val2, playerClientId); BytePacker.WriteValueBitPacked(val2, itemSlot); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3021509621u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; int num = StartOfRound.Instance.ClientPlayerList[playerClientId]; StartOfRound.Instance.allPlayerScripts[num].DestroyItemInSlot(itemSlot); ((Component)this).transform.SetParent((Transform)null, true); ((Component)this).transform.SetPositionAndRotation(position, rotation); velocity = launchVelocity; flightEndsAt = Time.time + maximumFlightTime; flying = true; landed = false; SetPickup(enabled: false); } } } private void Update() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004b: 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_0056: 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_0066: 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_0096: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: 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_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: 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) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) if (!flying) { return; } float deltaTime = Time.deltaTime; velocity += gravity * deltaTime * Vector3.down; Quaternion rotation = Quaternion.LookRotation(velocity); Vector3 val = velocity * deltaTime; ((Component)this).transform.rotation = rotation; RaycastHit val2 = default(RaycastHit); float num = float.MaxValue; if (((NetworkBehaviour)this).IsOwner) { int num2 = Physics.SphereCastNonAlloc(dartTip.position, hitRadius, ((Vector3)(ref val)).normalized, flightHits, ((Vector3)(ref val)).magnitude, stickMask, (QueryTriggerInteraction)2); for (int i = 0; i < num2; i++) { RaycastHit val3 = flightHits[i]; Collider collider = ((RaycastHit)(ref val3)).collider; if (Object.op_Implicit((Object)(object)collider) && !((Component)collider).transform.IsChildOf(((Component)this).transform) && !((Object)(object)((Component)collider).GetComponentInParent() != (Object)null) && !((Object)(object)((Component)collider).GetComponentInParent() != (Object)null) && (!collider.isTrigger || ((Component)collider).gameObject.layer == interactableObjectLayer) && !(((RaycastHit)(ref val3)).distance >= num)) { val2 = val3; num = ((RaycastHit)(ref val3)).distance; } } } if (Object.op_Implicit((Object)(object)((RaycastHit)(ref val2)).collider)) { Transform transform = ((Component)this).transform; transform.position += ((RaycastHit)(ref val2)).point - dartTip.position; flying = false; LandDartServerRpc(((Component)this).transform.position, ((Component)this).transform.rotation); return; } Transform transform2 = ((Component)this).transform; transform2.position += val; if (((NetworkBehaviour)this).IsOwner && Time.time >= flightEndsAt) { flying = false; LandDartServerRpc(((Component)this).transform.position, ((Component)this).transform.rotation); } } [Rpc(/*Could not decode attribute arguments.*/)] private void LandDartServerRpc(Vector3 position, Quaternion rotation, RpcParams rpcParams = default(RpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00db: 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_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0126: 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) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = true, Delivery = (RpcDelivery)0 }; FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3209618334u, rpcParams, val, (SendTo)2, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref position); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref rotation); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3209618334u, rpcParams, val, (SendTo)2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; if (launched && !landed && rpcParams.Receive.SenderClientId == ((NetworkBehaviour)this).OwnerClientId) { landed = true; landedForClients.Value = true; LandDartClientRpc(position, rotation); Log.Debug("Dart projectile landed."); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void LandDartClientRpc(Vector3 position, Quaternion rotation) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0196: 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) { RpcAttributeParams val = new RpcAttributeParams { Delivery = (RpcDelivery)0 }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3930692451u, val3, val, (SendTo)7, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref position); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref rotation); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3930692451u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; flying = false; landed = true; ((Component)this).transform.SetParent((Transform)null, true); ((Component)this).transform.SetPositionAndRotation(position, rotation); int num = Physics.OverlapSphereNonAlloc(dartTip.position, hitRadius * 2f, surfaceHits, stickMask, (QueryTriggerInteraction)2); Collider val4 = null; float num2 = float.MaxValue; for (int i = 0; i < num; i++) { Collider val5 = surfaceHits[i]; if (Object.op_Implicit((Object)(object)val5) && !((Component)val5).transform.IsChildOf(((Component)this).transform) && !((Object)(object)((Component)val5).GetComponentInParent() != (Object)null) && !((Object)(object)((Component)val5).GetComponentInParent() != (Object)null)) { Bounds bounds = val5.bounds; float num3 = ((Bounds)(ref bounds)).SqrDistance(dartTip.position); if (!(num3 >= num2)) { val4 = val5; num2 = num3; } } } if ((Object)(object)val4 != (Object)null) { ((Component)this).transform.SetParent(((Component)val4).transform, true); } SetPickup(enabled: true); if (Object.op_Implicit((Object)(object)audioSource) && Object.op_Implicit((Object)(object)dartHitSound)) { audioSource.PlayOneShot(dartHitSound); } } public void SeatInDartboard(NetworkObjectReference dartboardReference, int spawnIndex) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)this).IsServer) { launched = true; landed = true; landedForClients.Value = true; SeatInDartboardClientRpc(dartboardReference, spawnIndex); } } [Rpc(/*Could not decode attribute arguments.*/)] private void SeatInDartboardClientRpc(NetworkObjectReference dartboardReference, int spawnIndex) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0091: 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_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { Delivery = (RpcDelivery)0 }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2088052999u, val3, val, (SendTo)7, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref dartboardReference, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val2, spawnIndex); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2088052999u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val4 = default(NetworkObject); if (!((NetworkObjectReference)(ref dartboardReference)).TryGet(ref val4, (NetworkManager)null)) { Log.Error("Dartboard could not be found for a dart"); return; } Transform val5 = ((Component)val4).GetComponent().dartSpawns[spawnIndex]; ((Component)this).transform.SetParent(val5, true); ((Component)this).transform.SetPositionAndRotation(val5.position, val5.rotation); Transform transform = ((Component)this).transform; transform.position += val5.position - dartTip.position; flying = false; landed = true; SetPickup(enabled: true); } } private void PickUpDart(PlayerControllerB player) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)player == (Object)null) && !((Object)(object)player != (Object)(object)GameNetworkManager.Instance.localPlayerController)) { PickUpDartServerRpc(); } } [Rpc(/*Could not decode attribute arguments.*/)] private void PickUpDartServerRpc(RpcParams rpcParams = default(RpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: 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) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false, Delivery = (RpcDelivery)0 }; FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2736249222u, rpcParams, val, (SendTo)2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2736249222u, rpcParams, val, (SendTo)2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; if (!landed || claimed) { return; } ulong senderClientId = rpcParams.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { return; } PlayerControllerB val3 = StartOfRound.Instance.allPlayerScripts[value]; if (val3 == null || val3.isPlayerDead || !val3.isPlayerControlled) { return; } Vector3 val4 = ((Component)val3).transform.position - ((Component)this).transform.position; if (!(((Vector3)(ref val4)).sqrMagnitude > 16f)) { int currentItemSlot = val3.currentItemSlot; if (currentItemSlot >= 0 && currentItemSlot < val3.ItemSlots.Length && !((Object)(object)val3.ItemSlots[currentItemSlot] != (Object)null)) { claimed = true; GameObject val5 = Object.Instantiate(dartItemPrefab, val3.serverItemHolder.position, val3.serverItemHolder.rotation); NetworkObject component = val5.GetComponent(); val5.GetComponent().heldByPlayerOnServer = true; component.SpawnWithOwnership(senderClientId, false); ((MonoBehaviour)this).StartCoroutine(GiveDartAfterSpawn(component, senderClientId, currentItemSlot)); } } } private IEnumerator GiveDartAfterSpawn(NetworkObject itemNetworkObject, ulong playerClientId, int slot) { yield return null; GiveDartClientRpc(NetworkObjectReference.op_Implicit(itemNetworkObject), playerClientId, slot); ((NetworkBehaviour)this).NetworkObject.Despawn(true); Log.Debug("Dart projectile picked up"); } [Rpc(/*Could not decode attribute arguments.*/)] private void GiveDartClientRpc(NetworkObjectReference itemReference, ulong playerClientId, int slot) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_020e: 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) { RpcAttributeParams val = new RpcAttributeParams { Delivery = (RpcDelivery)0 }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1028083050u, val3, val, (SendTo)7, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref itemReference, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val2, playerClientId); BytePacker.WriteValueBitPacked(val2, slot); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1028083050u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val4 = default(NetworkObject); if (!((NetworkObjectReference)(ref itemReference)).TryGet(ref val4, (NetworkManager)null)) { Log.Error("Picked up dart item could not be found"); return; } int num = StartOfRound.Instance.ClientPlayerList[playerClientId]; PlayerControllerB val5 = StartOfRound.Instance.allPlayerScripts[num]; GrabbableObject component = ((Component)val4).GetComponent(); val5.ItemSlots[slot] = component; val5.currentItemSlot = slot; val5.currentlyHeldObjectServer = component; val5.isHoldingObject = true; val5.twoHanded = component.itemProperties.twoHanded; val5.twoHandedAnimation = component.itemProperties.twoHandedAnimation; val5.carryWeight = Mathf.Clamp(val5.carryWeight + (component.itemProperties.weight - 1f), 1f, 10f); component.playerHeldBy = val5; component.parentObject = (((NetworkBehaviour)val5).IsOwner ? val5.localItemHolder : val5.serverItemHolder); component.heldByPlayerOnServer = true; component.isHeld = true; component.isPocketed = false; component.hasHitGround = false; component.isInFactory = val5.isInsideFactory; component.EnablePhysics(false); ((Component)component).transform.SetPositionAndRotation(component.parentObject.position, component.parentObject.rotation); val5.SetItemInElevator(val5.isInHangarShipRoom, val5.isInElevator, component); component.GrabItem(); component.EquipItem(); if (Object.op_Implicit((Object)(object)dartGrabSound)) { val5.itemAudio.PlayOneShot(dartGrabSound, 1f); } val5.playerBodyAnimator.ResetTrigger(throwHash); val5.playerBodyAnimator.SetBool(grabHash, true); val5.playerBodyAnimator.SetBool(grabInvalidatedHash, false); val5.playerBodyAnimator.SetBool(grabValidatedHash, true); val5.playerBodyAnimator.SetBool(cancelHoldingHash, false); if (((NetworkBehaviour)val5).IsOwner) { HUDManager.Instance.itemSlotIcons[slot].sprite = component.itemProperties.itemIcon; ((Behaviour)HUDManager.Instance.itemSlotIcons[slot]).enabled = true; ((Component)HUDManager.Instance.itemSlotIconFrames[slot]).GetComponent().SetTrigger(getItemHash); StartOfRound.Instance.SendChangedWeightEvent(); } } private void SetPickup(bool enabled) { pickupTrigger.interactable = enabled; if (Object.op_Implicit((Object)(object)pickupCollider)) { pickupCollider.enabled = enabled; } } protected override void __initializeVariables() { if (landedForClients == null) { throw new Exception("DartProjectile.landedForClients cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)landedForClients).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)landedForClients, "landedForClients"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)landedForClients); ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(3021509621u, new RpcReceiveHandler(__rpc_handler_3021509621), "LaunchClientRpc"); ((NetworkBehaviour)this).__registerRpc(3209618334u, new RpcReceiveHandler(__rpc_handler_3209618334), "LandDartServerRpc"); ((NetworkBehaviour)this).__registerRpc(3930692451u, new RpcReceiveHandler(__rpc_handler_3930692451), "LandDartClientRpc"); ((NetworkBehaviour)this).__registerRpc(2088052999u, new RpcReceiveHandler(__rpc_handler_2088052999), "SeatInDartboardClientRpc"); ((NetworkBehaviour)this).__registerRpc(2736249222u, new RpcReceiveHandler(__rpc_handler_2736249222), "PickUpDartServerRpc"); ((NetworkBehaviour)this).__registerRpc(1028083050u, new RpcReceiveHandler(__rpc_handler_1028083050), "GiveDartClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_3021509621(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_004a: 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_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 position = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref position); Quaternion rotation = default(Quaternion); ((FastBufferReader)(ref reader)).ReadValueSafe(ref rotation); Vector3 launchVelocity = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref launchVelocity); ulong playerClientId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref playerClientId); int itemSlot = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref itemSlot); target.__rpc_exec_stage = (__RpcExecStage)1; ((DartProjectile)(object)target).LaunchClientRpc(position, rotation, launchVelocity, playerClientId, itemSlot); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3209618334(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 position = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref position); Quaternion rotation = default(Quaternion); ((FastBufferReader)(ref reader)).ReadValueSafe(ref rotation); RpcParams ext = rpcParams.Ext; target.__rpc_exec_stage = (__RpcExecStage)1; ((DartProjectile)(object)target).LandDartServerRpc(position, rotation, ext); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3930692451(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 position = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref position); Quaternion rotation = default(Quaternion); ((FastBufferReader)(ref reader)).ReadValueSafe(ref rotation); target.__rpc_exec_stage = (__RpcExecStage)1; ((DartProjectile)(object)target).LandDartClientRpc(position, rotation); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2088052999(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference dartboardReference = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref dartboardReference, default(ForNetworkSerializable)); int spawnIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref spawnIndex); target.__rpc_exec_stage = (__RpcExecStage)1; ((DartProjectile)(object)target).SeatInDartboardClientRpc(dartboardReference, spawnIndex); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2736249222(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { RpcParams ext = rpcParams.Ext; target.__rpc_exec_stage = (__RpcExecStage)1; ((DartProjectile)(object)target).PickUpDartServerRpc(ext); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1028083050(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference itemReference = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref itemReference, default(ForNetworkSerializable)); ulong playerClientId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref playerClientId); int slot = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref slot); target.__rpc_exec_stage = (__RpcExecStage)1; ((DartProjectile)(object)target).GiveDartClientRpc(itemReference, playerClientId, slot); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "DartProjectile"; } } public class Dingus : GrabbableObject { private static WaitForSeconds waitOneSecond; private static WaitForSeconds waitOneAndAHalfSeconds; private static WaitForSeconds waitTwoSeconds; [SerializeField] private AudioSource noiseAudio; [SerializeField] private AudioSource noiseAudioFar; [SerializeField] private AudioSource musicAudio; [SerializeField] private AudioSource musicAudioFar; [Space(3f)] [SerializeField] private AudioClip[] noiseSFX; [SerializeField] private AudioClip[] noiseSFXFar; [SerializeField] private AudioClip evilNoise; [Space(3f)] [SerializeField] private float noiseRange; [SerializeField] private float maxLoudness; [SerializeField] private float minLoudness; [SerializeField] private float minPitch; [SerializeField] private float maxPitch; [SerializeField] private Animator triggerAnimator; [SerializeField] private Animator danceAnimator; [SerializeField] private GameObject evilObject; private Random noisemakerRandom; private RoundManager roundManager; private int timesPlayedWithoutTurningOff; private float noiseInterval = 1f; private bool exploding; private bool hasLoadedIsEvil; private bool loadedIsEvil; private int dingusDanceHash; private int dingusIdleHash; private int playAnimHash; private int playingAnimationHash = -1; private readonly NetworkVariable isEvil = new NetworkVariable(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); private readonly NetworkVariable isPlayingMusic = new NetworkVariable(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); private readonly NetworkVariable evilStarted = new NetworkVariable(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public override int GetItemDataToSave() { return isEvil.Value ? 1 : 0; } public override void LoadItemSaveData(int saveData) { hasLoadedIsEvil = true; loadedIsEvil = saveData != 0; if (((NetworkBehaviour)this).IsSpawned && ((NetworkBehaviour)this).IsServer) { isEvil.Value = loadedIsEvil; } } public override void Start() { //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0071: 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_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Expected O, but got Unknown ((GrabbableObject)this).Start(); roundManager = RoundManager.Instance; noisemakerRandom = new Random(StartOfRound.Instance.randomMapSeed + 85); dingusDanceHash = Animator.StringToHash("dingusDance"); dingusIdleHash = Animator.StringToHash("dingusIdle"); playAnimHash = Animator.StringToHash("playAnim"); if (waitOneSecond == null) { waitOneSecond = new WaitForSeconds(1f); } if (waitOneAndAHalfSeconds == null) { waitOneAndAHalfSeconds = new WaitForSeconds(1.5f); } if (waitTwoSeconds == null) { waitTwoSeconds = new WaitForSeconds(2f); } } public override void OnNetworkSpawn() { ((NetworkBehaviour)this).OnNetworkSpawn(); if (((NetworkBehaviour)this).IsServer) { isPlayingMusic.Value = base.isInFactory && LethalThingsConfig.maxwellPlayMusicDefault.Value; } if (((NetworkBehaviour)this).IsHost) { if (hasLoadedIsEvil) { isEvil.Value = loadedIsEvil; } else if (!StartOfRound.Instance.inShipPhase) { isEvil.Value = Random.Range(0f, 100f) <= LethalThingsConfig.evilMaxwellChance.Value; } } } public override void ItemActivate(bool used, bool buttonDown = true) { //IL_0121: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).ItemActivate(used, buttonDown); if ((Object)(object)GameNetworkManager.Instance.localPlayerController != (Object)null) { int num = noisemakerRandom.Next(0, noiseSFX.Length); float num2 = (float)noisemakerRandom.Next((int)(minLoudness * 100f), (int)(maxLoudness * 100f)) / 100f; float pitch = (float)noisemakerRandom.Next((int)(minPitch * 100f), (int)(maxPitch * 100f)) / 100f; noiseAudio.pitch = pitch; noiseAudio.PlayOneShot(noiseSFX[num], num2); if ((Object)(object)noiseAudioFar != (Object)null) { noiseAudioFar.pitch = pitch; noiseAudioFar.PlayOneShot(noiseSFXFar[num], num2); } Animator obj = triggerAnimator; if (obj != null) { obj.SetTrigger(playAnimHash); } WalkieTalkie.TransmitOneShotAudio(noiseAudio, noiseSFX[num], num2); RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, noiseRange, num2, 0, base.isInElevator && StartOfRound.Instance.hangarDoorsClosed, 0); } } public override void DiscardItem() { if ((Object)(object)base.playerHeldBy != (Object)null) { base.playerHeldBy.equippedUsableItemQE = false; } base.isBeingUsed = false; ((GrabbableObject)this).DiscardItem(); } public override void EquipItem() { ((GrabbableObject)this).EquipItem(); base.playerHeldBy.equippedUsableItemQE = true; PlayDingusAnimation(dingusIdleHash); } public override void ItemInteractLeftRight(bool right) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).ItemInteractLeftRight(right); if (!right) { PlayerControllerB playerHeldBy = base.playerHeldBy; if (playerHeldBy != null && ((NetworkBehaviour)playerHeldBy).IsOwner) { ToggleMusicServerRpc(); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void ToggleMusicServerRpc(RpcParams rpcParams = default(RpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false, Delivery = (RpcDelivery)0 }; FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(639964626u, rpcParams, val, (SendTo)2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 639964626u, rpcParams, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (StartOfRound.Instance.ClientPlayerList.TryGetValue(rpcParams.Receive.SenderClientId, out var value) && !((Object)(object)StartOfRound.Instance.allPlayerScripts[value].currentlyHeldObjectServer != (Object)(object)this)) { isPlayingMusic.Value = !isPlayingMusic.Value; } } } public override void InteractItem() { ((GrabbableObject)this).InteractItem(); if (isEvil.Value && !exploding && !evilStarted.Value) { EvilMaxwellServerRpc(); } } [Rpc(/*Could not decode attribute arguments.*/)] private void EvilMaxwellServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false, Delivery = (RpcDelivery)0 }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1340351704u, val3, val, (SendTo)2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1340351704u, val3, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!evilStarted.Value) { evilStarted.Value = true; isPlayingMusic.Value = false; EvilMaxwellClientRpc(); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void EvilMaxwellClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { Delivery = (RpcDelivery)0 }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3386215095u, val3, val, (SendTo)7, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3386215095u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; exploding = true; timesPlayedWithoutTurningOff = 0; PlayDingusAnimation(dingusIdleHash); if (musicAudio.isPlaying) { musicAudio.Pause(); musicAudioFar.Pause(); } ((MonoBehaviour)this).StartCoroutine(EvilMaxwellMoment()); } } private IEnumerator EvilMaxwellMoment() { yield return waitOneSecond; noiseAudio.PlayOneShot(evilNoise, 1f); evilObject.SetActive(true); ((Renderer)base.mainObjectRenderer).enabled = false; AudioSource obj = noiseAudioFar; if (obj != null) { obj.PlayOneShot(evilNoise, 1f); } Animator obj2 = triggerAnimator; if (obj2 != null) { obj2.SetTrigger(playAnimHash); } WalkieTalkie.TransmitOneShotAudio(noiseAudio, evilNoise, 1f); RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, noiseRange, 1f, 0, base.isInElevator && StartOfRound.Instance.hangarDoorsClosed, 0); yield return waitOneAndAHalfSeconds; EXPLOOOOOOOOOOOSIONUtilities.CreateExplosion(((Component)this).transform.position, spawnExplosionEffect: true, 100, 0f, 6.4f, 6, (CauseOfDeath)3); Rigidbody[] componentsInChildren = evilObject.GetComponentsInChildren(); foreach (Rigidbody rb in componentsInChildren) { rb.isKinematic = false; rb.AddExplosionForce(1000f, evilObject.transform.position, 100f); } yield return waitTwoSeconds; if (((NetworkBehaviour)this).IsServer) { ((NetworkBehaviour)this).NetworkObject.Despawn(true); } } public override void Update() { //IL_011a: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).Update(); if (isEvil.Value) { base.grabbable = false; base.grabbableToEnemies = false; } if (!isPlayingMusic.Value || exploding) { timesPlayedWithoutTurningOff = 0; PlayDingusAnimation(dingusIdleHash); if (musicAudio.isPlaying) { musicAudio.Pause(); musicAudioFar.Pause(); } return; } if (!musicAudio.isPlaying) { musicAudio.Play(); musicAudioFar.Play(); } PlayDingusAnimation(base.isHeld ? dingusIdleHash : dingusDanceHash); if (noiseInterval > 0f) { noiseInterval -= Time.deltaTime; return; } noiseInterval = 1f; timesPlayedWithoutTurningOff++; roundManager.PlayAudibleNoise(((Component)this).transform.position, 16f, 0.9f, timesPlayedWithoutTurningOff, false, 5); } private void PlayDingusAnimation(int animationHash) { if (playingAnimationHash != animationHash) { playingAnimationHash = animationHash; danceAnimator.Play(animationHash); } } protected override void __initializeVariables() { if (isEvil == null) { throw new Exception("Dingus.isEvil cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)isEvil).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)isEvil, "isEvil"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)isEvil); if (isPlayingMusic == null) { throw new Exception("Dingus.isPlayingMusic cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)isPlayingMusic).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)isPlayingMusic, "isPlayingMusic"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)isPlayingMusic); if (evilStarted == null) { throw new Exception("Dingus.evilStarted cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)evilStarted).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)evilStarted, "evilStarted"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)evilStarted); ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(639964626u, new RpcReceiveHandler(__rpc_handler_639964626), "ToggleMusicServerRpc"); ((NetworkBehaviour)this).__registerRpc(1340351704u, new RpcReceiveHandler(__rpc_handler_1340351704), "EvilMaxwellServerRpc"); ((NetworkBehaviour)this).__registerRpc(3386215095u, new RpcReceiveHandler(__rpc_handler_3386215095), "EvilMaxwellClientRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_639964626(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { RpcParams ext = rpcParams.Ext; target.__rpc_exec_stage = (__RpcExecStage)1; ((Dingus)(object)target).ToggleMusicServerRpc(ext); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1340351704(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((Dingus)(object)target).EvilMaxwellServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3386215095(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((Dingus)(object)target).EvilMaxwellClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "Dingus"; } } public class FatalitiesSign : NetworkBehaviour { [CompilerGenerated] private static class <>O { public static hook_SaveGameValues <0>__GameNetworkManager_SaveGameValues; public static hook_ResetSavedGameValues <1>__GameNetworkManager_ResetSavedGameValues; public static hook_SetTimeAndPlanetToSavedSettings <2>__StartOfRound_SetTimeAndPlanetToSavedSettings; public static hook_ApplyPenalty <3>__HUDManager_ApplyPenalty; public static hook_PassTimeToNextDay <4>__StartOfRound_PassTimeToNextDay; } public static int DaysSinceLastFatality; private static bool wasJustUpdated; [SerializeField] private TextMeshProUGUI textMesh; [SerializeField] private TextMeshProUGUI textMeshBack; private readonly NetworkVariable daysSinceLastFatality = new NetworkVariable(0, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); private int displayedDaysSinceLastFatality = int.MinValue; public static void Init() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Expected O, but got Unknown //IL_0074: 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_007f: Expected O, but got Unknown //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Expected O, but got Unknown object obj = <>O.<0>__GameNetworkManager_SaveGameValues; if (obj == null) { hook_SaveGameValues val = GameNetworkManager_SaveGameValues; <>O.<0>__GameNetworkManager_SaveGameValues = val; obj = (object)val; } GameNetworkManager.SaveGameValues += (hook_SaveGameValues)obj; object obj2 = <>O.<1>__GameNetworkManager_ResetSavedGameValues; if (obj2 == null) { hook_ResetSavedGameValues val2 = GameNetworkManager_ResetSavedGameValues; <>O.<1>__GameNetworkManager_ResetSavedGameValues = val2; obj2 = (object)val2; } GameNetworkManager.ResetSavedGameValues += (hook_ResetSavedGameValues)obj2; object obj3 = <>O.<2>__StartOfRound_SetTimeAndPlanetToSavedSettings; if (obj3 == null) { hook_SetTimeAndPlanetToSavedSettings val3 = StartOfRound_SetTimeAndPlanetToSavedSettings; <>O.<2>__StartOfRound_SetTimeAndPlanetToSavedSettings = val3; obj3 = (object)val3; } StartOfRound.SetTimeAndPlanetToSavedSettings += (hook_SetTimeAndPlanetToSavedSettings)obj3; object obj4 = <>O.<3>__HUDManager_ApplyPenalty; if (obj4 == null) { hook_ApplyPenalty val4 = HUDManager_ApplyPenalty; <>O.<3>__HUDManager_ApplyPenalty = val4; obj4 = (object)val4; } HUDManager.ApplyPenalty += (hook_ApplyPenalty)obj4; object obj5 = <>O.<4>__StartOfRound_PassTimeToNextDay; if (obj5 == null) { hook_PassTimeToNextDay val5 = StartOfRound_PassTimeToNextDay; <>O.<4>__StartOfRound_PassTimeToNextDay = val5; obj5 = (object)val5; } StartOfRound.PassTimeToNextDay += (hook_PassTimeToNextDay)obj5; } private static void StartOfRound_PassTimeToNextDay(orig_PassTimeToNextDay orig, StartOfRound self, int connectedPlayersOnServer) { orig.Invoke(self, connectedPlayersOnServer); NetworkManager singleton = NetworkManager.Singleton; if (singleton != null && singleton.IsHost) { if (!wasJustUpdated) { DaysSinceLastFatality++; } wasJustUpdated = false; } } private static void HUDManager_ApplyPenalty(orig_ApplyPenalty orig, HUDManager self, int playersDead, int bodiesInsured) { NetworkManager singleton = NetworkManager.Singleton; if (singleton != null && singleton.IsHost && playersDead > 0) { DaysSinceLastFatality = 0; wasJustUpdated = true; } orig.Invoke(self, playersDead, bodiesInsured); } private static void StartOfRound_SetTimeAndPlanetToSavedSettings(orig_SetTimeAndPlanetToSavedSettings orig, StartOfRound self) { orig.Invoke(self); NetworkManager singleton = NetworkManager.Singleton; if (singleton != null && singleton.IsHost) { PersistentDataContainer currentContract = DawnLib.GetCurrentContract(); if (currentContract != null) { int num = default(int); DaysSinceLastFatality = (((DataContainer)currentContract).TryGet(Keys.DaysSinceLastFatality, ref num) ? num : 0); } } } private static void GameNetworkManager_ResetSavedGameValues(orig_ResetSavedGameValues orig, GameNetworkManager self) { orig.Invoke(self); DaysSinceLastFatality = 0; wasJustUpdated = false; NetworkManager singleton = NetworkManager.Singleton; if (singleton == null || !singleton.IsHost) { return; } PersistentDataContainer currentContract = DawnLib.GetCurrentContract(); if (currentContract == null) { return; } using (((DataContainer)currentContract).CreateEditContext()) { ((DataContainer)currentContract).Remove(Keys.DaysSinceLastFatality); } } private static void GameNetworkManager_SaveGameValues(orig_SaveGameValues orig, GameNetworkManager self) { orig.Invoke(self); NetworkManager singleton = NetworkManager.Singleton; if (singleton == null || !singleton.IsHost) { return; } PersistentDataContainer currentContract = DawnLib.GetCurrentContract(); if (currentContract == null) { return; } using (((DataContainer)currentContract).CreateEditContext()) { ((DataContainer)currentContract).Set(Keys.DaysSinceLastFatality, DaysSinceLastFatality); } } public void Update() { if (((NetworkBehaviour)this).IsServer && daysSinceLastFatality.Value != DaysSinceLastFatality) { daysSinceLastFatality.Value = DaysSinceLastFatality; } int value = daysSinceLastFatality.Value; if (displayedDaysSinceLastFatality != value) { displayedDaysSinceLastFatality = value; string text = value.ToString(); ((TMP_Text)textMesh).text = text; ((TMP_Text)textMeshBack).text = text; } } protected override void __initializeVariables() { if (daysSinceLastFatality == null) { throw new Exception("FatalitiesSign.daysSinceLastFatality cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)daysSinceLastFatality).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)daysSinceLastFatality, "daysSinceLastFatality"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)daysSinceLastFatality); ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { ((NetworkBehaviour)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "FatalitiesSign"; } } public class FishFriend : EnemyAI { private const int FleeBehaviour = 1; private const int RoamBehaviour = 2; private const int HoverBehaviour = 3; private const int MaxTamedLevel = 5; private const float PlayerEvadeDistance = 10f; private const float PlayerSpookDistance = 8f; private const float PlayerEvadeSpeed = 5.2f; private const float FavouritePlayerSpeedMultiplier = 2.2f; private const float TalkIntervalMax = 25f; private const float TalkIntervalMin = 7f; private const float PetSoundVolume = 1f; private const float RoamSpeed = 2f; private const float RoamStoppingDistance = 0.75f; private const float PlayerInvestigateInterval = 15f; private const float HoverDuration = 12f; private const float HoverChance = 0.5f; private const float HoverSpeed = 1.25f; private const float HoverStoppingDistance = 1f; private const float HoverDestinationRefreshDistance = 1.5f; private const float HoverDistance = 3.5f; private const float MinimumHoverDistance = 3f; private const float MaximumHoverDistance = 4f; private const float MinimumHoverAngleStep = 35f; private const float MaximumHoverAngleStep = 55f; private const float HoverSampleRadius = 0.75f; private const float HoverPointReachedDistance = 1.25f; private const float FleeDuration = 20f; private const float FleeSpeed = 6f; private const float FleeDestinationDistance = 20f; private const float FleeDestinationRefreshDistance = 8f; private const float FleeSampleRadius = 4f; private const float MinimumFleeDestinationDistance = 1f; private const float MinimumFleeSpeed = 1f; private const float StuckDuration = 0.75f; private const float PanicSpeedMultiplier = 3f; private static readonly int HurtHash = Animator.StringToHash("hurt"); private static readonly int KilledHash = Animator.StringToHash("killed"); private static readonly int NuzzleHash = Animator.StringToHash("nuzzle"); [SerializeField] private ParticleSystem loveParticles; [SerializeField] private ParticleSystem hateParticles; [SerializeField] private Animator animator; [SerializeField] private InteractTrigger petTrigger; [SerializeField] private AudioClip[] voices; [SerializeField] private AudioClip petHappy; [SerializeField] private Transform gemTransform; private PlayerControllerB favouritePlayer; private MonoBehaviour closestScary; private int tamedLevel; private bool gemDropped; private float hoverTime; private float nextTalkTime; private float playerInvestigateTimer; private float hoverDirection; private float fleeTime; private float stuckTime; private Vector3 hoveredPlayerPosition; private Vector3 panicDirection; private bool hasHoverDestination; private bool fleeingAfterHit; private bool panicking; public override void Start() { ((EnemyAI)this).Start(); base.movingTowardsTargetPlayer = false; petTrigger.interactable = true; playerInvestigateTimer = 15f; nextTalkTime = Random.Range(7f, 25f); } public override void DoAIInterval() { if (!((NetworkBehaviour)this).IsOwner || base.isEnemyDead || StartOfRound.Instance.livingPlayers == 0) { ((EnemyAI)this).DoAIInterval(); return; } MonoBehaviour val = FindScaryThing(); if (base.currentBehaviourStateIndex == 1) { if ((Object)(object)val != (Object)null) { closestScary = val; } } else if ((Object)(object)val != (Object)null) { BeginFlee(val); } switch (base.currentBehaviourStateIndex) { case 1: Flee(); break; case 3: Hover(); break; default: Roam(); break; } ((EnemyAI)this).DoAIInterval(); } private void Roam() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Invalid comparison between Unknown and I4 base.agent.speed = 2f; base.agent.stoppingDistance = 0.75f; int num; if (!((Object)(object)base.targetNode == (Object)null)) { Vector3 val = ((Component)this).transform.position - base.targetNode.position; num = ((((Vector3)(ref val)).sqrMagnitude < 4f) ? 1 : 0); } else { num = 1; } bool flag = (byte)num != 0; if (!flag && base.agent.isOnNavMesh && !base.agent.pathPending && (!base.agent.hasPath || (int)base.agent.pathStatus > 0)) { flag = true; } if (flag) { base.targetNode = base.allAINodes[Random.Range(0, base.allAINodes.Length)].transform; if (!((EnemyAI)this).SetDestinationToPosition(base.targetNode.position, true)) { base.targetNode = null; } } playerInvestigateTimer -= base.AIIntervalTime; if (playerInvestigateTimer > 0f) { return; } playerInvestigateTimer = 15f; if (((EnemyAI)this).TargetClosestPlayer(1.5f, true, 70f, false, false, true)) { if (Random.value <= 0.5f) { BeginHover(base.targetPlayer); } else { base.targetPlayer = null; } } } private void Hover() { //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)base.targetPlayer == (Object)null || !((EnemyAI)this).PlayerIsTargetable(base.targetPlayer, false, false, true)) { BeginRoam(); return; } hoverTime -= base.AIIntervalTime; if (hoverTime <= 0f) { BeginRoam(); return; } base.agent.speed = 1.25f; base.agent.stoppingDistance = 1f; Vector3 val = ((Component)base.targetPlayer).transform.position - hoveredPlayerPosition; bool flag = ((Vector3)(ref val)).sqrMagnitude > 2.25f; if (!(!hasHoverDestination || flag)) { val = ((Component)this).transform.position - base.destination; if (!(((Vector3)(ref val)).sqrMagnitude < 1.5625f)) { return; } } ChooseHoverDestination(); } private void Flee() { //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_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_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)closestScary == (Object)null) { BeginRoam(); return; } fleeTime -= base.AIIntervalTime; if (fleeTime <= 0f) { BeginRoam(); return; } base.agent.speed = (panicking ? 18f : (fleeingAfterHit ? 12f : 6f)); if (!panicking && base.agent.hasPath && !base.agent.pathPending && base.agent.remainingDistance > 8f) { Vector3 velocity = base.agent.velocity; if (((Vector3)(ref velocity)).sqrMagnitude < 1f) { stuckTime += base.AIIntervalTime; if (stuckTime >= 0.75f) { Vector3 val = ((Component)this).transform.position - ((Component)closestScary).transform.position; val.y = 0f; panicDirection = ((Vector3.Dot(((Component)this).transform.right, val) >= 0f) ? ((Component)this).transform.right : (-((Component)this).transform.right)); panicking = true; base.agent.speed = 18f; base.agent.ResetPath(); } goto IL_01a6; } } stuckTime = 0f; goto IL_01a6; IL_01a6: if (!base.agent.pathPending && (!base.agent.hasPath || (int)base.agent.pathStatus != 0 || base.agent.remainingDistance <= 8f)) { ChooseFleeDestination(); } } private MonoBehaviour FindScaryThing() { //IL_005c: 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_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) MonoBehaviour result = null; float num = float.MaxValue; Vector3 val; foreach (EnemyAI spawnedEnemy in RoundManager.Instance.SpawnedEnemies) { if (!((Object)(object)spawnedEnemy == (Object)null) && !((Object)(object)spawnedEnemy == (Object)(object)this) && !spawnedEnemy.isEnemyDead && spawnedEnemy is IVisibleThreat) { val = ((Component)spawnedEnemy).transform.position - ((Component)this).transform.position; float sqrMagnitude = ((Vector3)(ref val)).sqrMagnitude; if (sqrMagnitude < 64f && sqrMagnitude < num) { result = (MonoBehaviour)(object)spawnedEnemy; num = sqrMagnitude; } } } PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; foreach (PlayerControllerB val2 in allPlayerScripts) { if (!((EnemyAI)this).PlayerIsTargetable(val2, false, false, true)) { continue; } val = ((Component)val2).transform.position - ((Component)this).transform.position; float sqrMagnitude2 = ((Vector3)(ref val)).sqrMagnitude; float num2 = 5.2f; if ((Object)(object)val2 == (Object)(object)favouritePlayer) { num2 *= Mathf.Lerp(1f, 2.2f, (float)tamedLevel / 5f); } if (sqrMagnitude2 < 100f) { val = val2.thisController.velocity; if (((Vector3)(ref val)).sqrMagnitude > num2 * num2 && !(sqrMagnitude2 >= num)) { result = (MonoBehaviour)(object)val2; num = sqrMagnitude2; } } } return result; } private void BeginRoam() { base.targetPlayer = null; closestScary = null; hoverTime = 0f; hasHoverDestination = false; fleeingAfterHit = false; fleeTime = 0f; stuckTime = 0f; panicking = false; playerInvestigateTimer = 15f; base.targetNode = null; SwitchBehaviour(2); } private void BeginHover(PlayerControllerB player) { base.targetPlayer = player; closestScary = null; hoverTime = 12f; hasHoverDestination = false; hoverDirection = ((Random.value < 0.5f) ? (-1f) : 1f); base.targetNode = null; SwitchBehaviour(3); ChooseHoverDestination(); } private void BeginFlee(MonoBehaviour scaryThing, bool afterHit = false) { closestScary = scaryThing; base.targetPlayer = null; hoverTime = 0f; hasHoverDestination = false; fleeingAfterHit = afterHit; fleeTime = 20f; stuckTime = 0f; panicking = false; base.targetNode = null; SwitchBehaviour(1); base.moveTowardsDestination = false; if (base.agent.isOnNavMesh) { base.agent.autoBraking = false; base.agent.stoppingDistance = 0f; base.agent.ResetPath(); } ChooseFleeDestination(); } private void SwitchBehaviour(int behaviour) { if (base.currentBehaviourStateIndex != behaviour) { ((EnemyAI)this).SwitchToBehaviourState(behaviour); } } private void ChooseHoverDestination() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00da: 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_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Component)base.targetPlayer).transform.position; Vector3 val = ((Component)this).transform.position - position; val.y = 0f; if (((Vector3)(ref val)).sqrMagnitude < 0.01f) { val = ((Component)base.targetPlayer).transform.forward; val.y = 0f; } float num = Mathf.Atan2(val.z, val.x) * 57.29578f; if (((Vector3)(ref val)).sqrMagnitude >= 9f) { num += Random.Range(35f, 55f) * hoverDirection; } num *= MathF.PI / 180f; Vector3 val2 = position + new Vector3(Mathf.Cos(num), 0f, Mathf.Sin(num)) * 3.5f; NavMeshHit val3 = default(NavMeshHit); if (NavMesh.SamplePosition(val2, ref val3, 0.75f, base.agentMask)) { Vector3 val4 = ((NavMeshHit)(ref val3)).position - position; if (!(((Vector3)(ref val4)).sqrMagnitude < 9f)) { val4 = ((NavMeshHit)(ref val3)).position - position; if (!(((Vector3)(ref val4)).sqrMagnitude > 16f)) { base.destination = ((NavMeshHit)(ref val3)).position; base.moveTowardsDestination = true; base.movingTowardsTargetPlayer = false; hoveredPlayerPosition = position; hasHoverDestination = true; return; } } } hasHoverDestination = false; } private void ChooseFleeDestination() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0085: 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_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) Vector3 normalized; Vector3 position; if (panicking) { normalized = panicDirection; position = ((Component)this).transform.position; } else { Vector3 val = ((Component)this).transform.position - ((Component)closestScary).transform.position; val.y = 0f; if (((Vector3)(ref val)).sqrMagnitude < 0.01f) { val = -((Component)this).transform.forward; val.y = 0f; } normalized = ((Vector3)(ref val)).normalized; position = ((Component)closestScary).transform.position; } NavMeshHit val4 = default(NavMeshHit); for (int i = 0; i < 5; i++) { float num = ((i == 0) ? 0f : ((float)((i + 1) / 2) * 45f * ((i % 2 == 1) ? 1f : (-1f)))); Vector3 val2 = Quaternion.Euler(0f, num, 0f) * normalized; Vector3 val3 = position + val2 * 20f; if (NavMesh.SamplePosition(val3, ref val4, 4f, base.agentMask)) { Vector3 val5 = ((NavMeshHit)(ref val4)).position - ((Component)this).transform.position; if (!(((Vector3)(ref val5)).sqrMagnitude < 1f) && ((EnemyAI)this).SetDestinationToPosition(((NavMeshHit)(ref val4)).position, true)) { return; } } } if (!base.agent.hasPath) { base.moveTowardsDestination = false; } } public void WasPet(PlayerControllerB player) { if (!base.isEnemyDead) { ChangeLoveServerRpc(player.playerClientId, 1); } } [Rpc(/*Could not decode attribute arguments.*/)] private void ChangeLoveServerRpc(ulong playerID, int value) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false, Delivery = (RpcDelivery)0 }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2604459551u, val3, val, (SendTo)2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerID); BytePacker.WriteValueBitPacked(val2, value); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2604459551u, val3, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ChangeLoveClientRpc(playerID, value); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void ChangeLoveClientRpc(ulong playerID, int value) { //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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: 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_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { Delivery = (RpcDelivery)0 }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2591556175u, val3, val, (SendTo)7, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerID); BytePacker.WriteValueBitPacked(val2, value); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2591556175u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; tamedLevel = Mathf.Clamp(tamedLevel + value, 0, 5); PlayerControllerB val4 = StartOfRound.Instance.allPlayerScripts[playerID]; if (value > 0) { favouritePlayer = val4; animator.SetTrigger(NuzzleHash); base.creatureSFX.pitch = Random.Range(0.8f, 1.2f); base.creatureSFX.PlayOneShot(petHappy, 1f); WalkieTalkie.TransmitOneShotAudio(base.creatureVoice, petHappy, 1f); RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, 12f, 0.6f, 0, false, 911); loveParticles.Play(); if (((NetworkBehaviour)this).IsOwner) { BeginHover(val4); } } else { if ((Object)(object)favouritePlayer == (Object)(object)val4) { favouritePlayer = null; } hateParticles.Play(); } } public override void Update() { //IL_0062: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).Update(); if (!base.isEnemyDead) { nextTalkTime -= Time.deltaTime; if (!(nextTalkTime > 0f)) { RoundManager.PlayRandomClip(base.creatureVoice, voices, true, 1f, 0, 1000); RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, 12f, 0.6f, 0, false, 911); nextTalkTime = Random.Range(7f, 25f); } } } public override void KillEnemy(bool destroy = false) { animator.SetTrigger(KilledHash); petTrigger.interactable = false; ((Behaviour)petTrigger).enabled = false; DropGem(); ((EnemyAI)this).KillEnemy(destroy); } private void DropGem() { ((Component)gemTransform).gameObject.SetActive(false); ((Behaviour)((Component)this).GetComponentInChildren()).enabled = false; if (((NetworkBehaviour)this).IsOwner) { DropGemServerRpc(); } } [Rpc(/*Could not decode attribute arguments.*/)] private void DropGemServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = true, Delivery = (RpcDelivery)0 }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1037504907u, val3, val, (SendTo)2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1037504907u, val3, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!gemDropped) { Item item = ((Registry)(object)LethalContent.Items)[Keys.CrystalCore].Item; GameObject val4 = Object.Instantiate(item.spawnPrefab, ((Component)this).transform.position, Quaternion.identity, RoundManager.Instance.spawnedScrapContainer); GrabbableObject component = val4.GetComponent(); ((Component)component).transform.rotation = Quaternion.Euler(item.restingRotation); component.fallTime = 0f; int value = (component.scrapValue = (int)((float)RoundManager.Instance.AnomalyRandom.Next(item.minValue, item.maxValue) * RoundManager.Instance.scrapValueMultiplier)); NetworkObject component2 = val4.GetComponent(); component2.Spawn(false); SyncGemValueClientRpc(NetworkObjectReference.op_Implicit(component2), value); gemDropped = true; } } } [Rpc(/*Could not decode attribute arguments.*/)] private void SyncGemValueClientRpc(NetworkObjectReference crystalCore, int value) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0091: 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_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { Delivery = (RpcDelivery)0 }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3620251250u, val3, val, (SendTo)7, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref crystalCore, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val2, value); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3620251250u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val4 = default(NetworkObject); if (((NetworkObjectReference)(ref crystalCore)).TryGet(ref val4, (NetworkManager)null)) { ((Component)val4).GetComponent().SetScrapValue(value); RoundManager instance = RoundManager.Instance; instance.totalScrapValueInLevel += (float)value; } } } public override void HitEnemy(int force = 1, PlayerControllerB playerWhoHit = null, bool playHitSFX = false, int hitID = -1) { ((EnemyAI)this).HitEnemy(force, playerWhoHit, false, -1); if (base.isEnemyDead) { return; } base.enemyHP -= force; if (base.enemyHP <= 0 && ((NetworkBehaviour)this).IsOwner) { ((EnemyAI)this).KillEnemyOnOwnerClient(false); return; } if ((Object)(object)playerWhoHit != (Object)null) { ChangeLoveServerRpc(playerWhoHit.playerClientId, -1); if (((NetworkBehaviour)this).IsOwner) { BeginFlee((MonoBehaviour)(object)playerWhoHit, afterHit: true); } } animator.SetTrigger(HurtHash); } protected override void __initializeVariables() { ((EnemyAI)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2604459551u, new RpcReceiveHandler(__rpc_handler_2604459551), "ChangeLoveServerRpc"); ((NetworkBehaviour)this).__registerRpc(2591556175u, new RpcReceiveHandler(__rpc_handler_2591556175), "ChangeLoveClientRpc"); ((NetworkBehaviour)this).__registerRpc(1037504907u, new RpcReceiveHandler(__rpc_handler_1037504907), "DropGemServerRpc"); ((NetworkBehaviour)this).__registerRpc(3620251250u, new RpcReceiveHandler(__rpc_handler_3620251250), "SyncGemValueClientRpc"); ((EnemyAI)this).__initializeRpcs(); } private static void __rpc_handler_2604459551(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong playerID = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); int value = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref value); target.__rpc_exec_stage = (__RpcExecStage)1; ((FishFriend)(object)target).ChangeLoveServerRpc(playerID, value); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2591556175(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong playerID = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); int value = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref value); target.__rpc_exec_stage = (__RpcExecStage)1; ((FishFriend)(object)target).ChangeLoveClientRpc(playerID, value); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1037504907(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; ((FishFriend)(object)target).DropGemServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3620251250(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference crystalCore = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref crystalCore, default(ForNetworkSerializable)); int value = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref value); target.__rpc_exec_stage = (__RpcExecStage)1; ((FishFriend)(object)target).SyncGemValueClientRpc(crystalCore, value); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "FishFriend"; } } public class FlareController : NetworkBehaviour { [CompilerGenerated] private static class <>O { public static hook_NodeIsNotVisible <0>__HUDManager_NodeIsNotVisible; } private const float MinimumGravity = 1f; private const float MaximumGravity = 6f; private const float EnemyAttractionRate = 2f; private static WaitForSeconds flareDespawnDelay; [SerializeField] private float flareDuration = 20f; [SerializeField] private float burnoutTime = 5f; [SerializeField] private float attractRadius = 60f; [SerializeField] private ParticleSystem popSystem; [SerializeField] private AudioClip flarePopSound; [SerializeField] private AudioSource popAudioSource; private readonly HashSet attractedEnemies = new HashSet(); private readonly HashSet loggedAttractedEnemies = new HashSet(); private readonly HashSet hitEnemies = new HashSet(); private readonly HashSet hitPlayers = new HashSet(); private readonly HashSet ignitedForestGiants = new HashSet(); private readonly NetworkVariable currentBurnTime = new NetworkVariable(0f, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); private bool burntOut; private bool loggedAttractionScan; private bool loggedSurfaceContact; private float startIntensity; private float smokeRate; private float lastUpdateTime; private ParticleSystem flareParticles; private Light flareLight; private Rigidbody flareRigidbody; private MeshRenderer flareRenderer; private ScanNodeProperties scanNodeProperties; private HUDManager hudManager; private AudioSource fizzleAudioSource; public static void Init() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown if (flareDespawnDelay == null) { flareDespawnDelay = new WaitForSeconds(2f); } object obj = <>O.<0>__HUDManager_NodeIsNotVisible; if (obj == null) { hook_NodeIsNotVisible val = HUDManager_NodeIsNotVisible; <>O.<0>__HUDManager_NodeIsNotVisible = val; obj = (object)val; } HUDManager.NodeIsNotVisible += (hook_NodeIsNotVisible)obj; } private static bool HUDManager_NodeIsNotVisible(orig_NodeIsNotVisible orig, HUDManager self, ScanNodeProperties node, int elementIndex) { //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) object obj; if (node == null) { obj = null; } else { Transform transform = ((Component)node).transform; if (transform == null) { obj = null; } else { Transform parent = transform.parent; obj = ((parent != null) ? ((Component)parent).GetComponent() : null); } } FlareController flareController = (FlareController)obj; if (flareController == null || flareController.burntOut) { return orig.Invoke(self, node, elementIndex); } PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; Vector3 val = localPlayerController.gameplayCamera.WorldToViewportPoint(((Component)node).transform.position); if (Vector3.Distance(((Component)node).transform.position, ((Component)localPlayerController).transform.position) > (float)node.maxRange || val.x < 0f || val.x > 1f || val.y < 0f || val.y > 1f || val.z <= 0f) { return orig.Invoke(self, node, elementIndex); } if (!self.nodesOnScreen.Contains(node)) { self.nodesOnScreen.Add(node); } return false; } private void Awake() { //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_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_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) flareParticles = ((Component)this).GetComponentInChildren(); flareLight = ((Component)this).GetComponentInChildren(); flareRenderer = ((Component)this).GetComponentInChildren(); flareRigidbody = ((Component)this).GetComponent(); scanNodeProperties = ((Component)this).GetComponentInChildren(); hudManager = HUDManager.Instance; startIntensity = flareLight.intensity; EmissionModule emission = flareParticles.emission; MinMaxCurve rateOverTime = ((EmissionModule)(ref emission)).rateOverTime; smokeRate = ((MinMaxCurve)(ref rateOverTime)).constant; flareRigidbody.useGravity = false; AudioSource[] components = ((Component)this).GetComponents(); foreach (AudioSource val in components) { if (val.loop) { fizzleAudioSource = val; break; } } if (Vector3.Distance(((Component)scanNodeProperties).transform.position, ((Component)GameNetworkManager.Instance.localPlayerController).transform.position) <= (float)scanNodeProperties.maxRange) { if (!hudManager.nodesOnScreen.Contains(scanNodeProperties)) { hudManager.nodesOnScreen.Add(scanNodeProperties); } hudManager.AssignNodeToUIElement(scanNodeProperties); } } public override void OnNetworkSpawn() { ((NetworkBehaviour)this).OnNetworkSpawn(); Log.Debug($"Flare spawned with an attraction radius of {attractRadius:0.#} metres"); if (((NetworkBehaviour)this).IsServer) { currentBurnTime.Value = flareDuration; } } private void OnCollisionEnter(Collision other) { if (((NetworkBehaviour)this).IsServer) { Hit(other.collider); } } private void OnTriggerEnter(Collider other) { if (((NetworkBehaviour)this).IsServer) { Hit(other); } } private void Hit(Collider collider) { //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB componentInParent = ((Component)collider).GetComponentInParent(); if ((Object)(object)componentInParent != (Object)null) { if (!componentInParent.isPlayerDead && hitPlayers.Add(componentInParent.actualClientId)) { Log.Debug("Flare hit player " + componentInParent.playerUsername); DamagePlayerRpc(componentInParent.actualClientId, RpcParams.op_Implicit(((NetworkBehaviour)this).RpcTarget.Single(componentInParent.actualClientId, (RpcTargetUse)0))); } return; } EnemyAI val = ((Component)collider).GetComponentInParent()?.mainScript ?? ((Component)collider).GetComponentInParent(); if ((Object)(object)val == (Object)null) { if (!loggedSurfaceContact) { loggedSurfaceContact = true; Log.Debug("Flare hit a surface without a damage target"); } return; } ForestGiantAI val2 = (ForestGiantAI)(object)((val is ForestGiantAI) ? val : null); if (val2 != null && !LethalThingsConfig.preventForestGiantIgnition.Value) { IgniteForestGiant(val2); } if (!val.isEnemyDead && hitEnemies.Add(((NetworkBehaviour)val).NetworkObjectId)) { Log.Debug("Flare hit enemy " + val.enemyType.enemyName); DamageEnemyRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)val).NetworkObject), RpcParams.op_Implicit(((NetworkBehaviour)this).RpcTarget.Single(((NetworkBehaviour)this).OwnerClientId, (RpcTargetUse)0))); } } [Rpc(/*Could not decode attribute arguments.*/)] private void DamagePlayerRpc(ulong playerClientId, RpcParams rpcParams = default(RpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: 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_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { Delivery = (RpcDelivery)0 }; FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2472449382u, rpcParams, val, (SendTo)8, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerClientId); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2472449382u, rpcParams, val, (SendTo)8, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(playerClientId, out var value)) { Log.Warn("Flare player left before damage arrived"); return; } PlayerControllerB val3 = StartOfRound.Instance.allPlayerScripts[value]; val3.DamagePlayer(10, true, true, (CauseOfDeath)0, 0, false, default(Vector3)); Log.Debug("Flare dealt 10 damage to local player"); } } [Rpc(/*Could not decode attribute arguments.*/)] private void DamageEnemyRpc(NetworkObjectReference enemyReference, RpcParams rpcParams = default(RpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { Delivery = (RpcDelivery)0 }; FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1159786529u, rpcParams, val, (SendTo)8, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref enemyReference, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1159786529u, rpcParams, val, (SendTo)8, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); if (!((NetworkObjectReference)(ref enemyReference)).TryGet(ref val3, (NetworkManager)null)) { Log.Warn("Flare enemy disappeared before damage arrived"); return; } EnemyAI component = ((Component)val3).GetComponent(); PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; PlayerControllerB val4 = localPlayerController; component.HitEnemyOnLocalClient(1, default(Vector3), val4, false, -1); Log.Debug("Flare submitted 1 damage to enemy " + component.enemyType.enemyName); } } private void IgniteForestGiant(ForestGiantAI forestGiant) { //IL_003b: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)this).IsServer && !((Object)(object)((NetworkBehaviour)forestGiant).NetworkObject == (Object)null) && ignitedForestGiants.Add(((NetworkBehaviour)forestGiant).NetworkObjectId)) { IgniteForestGiantClientRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)forestGiant).NetworkObject)); Log.Debug("Flare ignited a Forest Giant"); } } [Rpc(/*Could not decode attribute arguments.*/)] private void IgniteForestGiantClientRpc(NetworkObjectReference giantReference) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { Delivery = (RpcDelivery)0 }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1550945071u, val3, val, (SendTo)7, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref giantReference, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1550945071u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val4 = default(NetworkObject); ForestGiantAI val5 = default(ForestGiantAI); if (((NetworkObjectReference)(ref giantReference)).TryGet(ref val4, (NetworkManager)null) && ((Component)val4).TryGetComponent(ref val5) && ((NetworkBehaviour)val5).IsOwner) { ((EnemyAI)val5).HitFromExplosion(0f); } } } private void FixedUpdate() { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Max(1f, Mathf.Lerp(1f, 6f, Mathf.InverseLerp(flareDuration - 2f, flareDuration, currentBurnTime.Value))); flareRigidbody.AddForce(Vector3.down * num, (ForceMode)5); } private void Update() { //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_02c0: Unknown result type (might be due to invalid IL or missing references) //IL_02c5: Unknown result type (might be due to invalid IL or missing references) //IL_02d4: Unknown result type (might be due to invalid IL or missing references) //IL_02d9: Unknown result type (might be due to invalid IL or missing references) //IL_02dd: Unknown result type (might be due to invalid IL or missing references) //IL_02e2: 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_049b: Unknown result type (might be due to invalid IL or missing references) //IL_04a6: Unknown result type (might be due to invalid IL or missing references) //IL_04ab: Unknown result type (might be due to invalid IL or missing references) //IL_04b0: Unknown result type (might be due to invalid IL or missing references) //IL_06a8: Unknown result type (might be due to invalid IL or missing references) //IL_038d: Unknown result type (might be due to invalid IL or missing references) //IL_0392: Unknown result type (might be due to invalid IL or missing references) //IL_03a1: Unknown result type (might be due to invalid IL or missing references) //IL_03a6: Unknown result type (might be due to invalid IL or missing references) //IL_03aa: Unknown result type (might be due to invalid IL or missing references) //IL_03af: Unknown result type (might be due to invalid IL or missing references) //IL_0587: Unknown result type (might be due to invalid IL or missing references) //IL_06e0: Unknown result type (might be due to invalid IL or missing references) //IL_05cc: Unknown result type (might be due to invalid IL or missing references) //IL_05d8: Unknown result type (might be due to invalid IL or missing references) //IL_053b: Unknown result type (might be due to invalid IL or missing references) //IL_0547: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)this).IsServer && currentBurnTime.Value > 0f - burnoutTime) { NetworkVariable obj = currentBurnTime; obj.Value -= Time.deltaTime; } if (!burntOut && !hudManager.nodesOnScreen.Contains(scanNodeProperties)) { PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; Vector3 val = localPlayerController.gameplayCamera.WorldToViewportPoint(((Component)scanNodeProperties).transform.position); if (Vector3.Distance(((Component)scanNodeProperties).transform.position, ((Component)localPlayerController).transform.position) <= (float)scanNodeProperties.maxRange && val.x < 1f && val.x > 0f && val.y < 1f && val.y > 0f && val.z >= 0f) { hudManager.nodesOnScreen.Add(scanNodeProperties); hudManager.AssignNodeToUIElement(scanNodeProperties); } } if (!burntOut) { if (currentBurnTime.Value <= 0f) { if (currentBurnTime.Value >= 0f - burnoutTime) { float num = Mathf.InverseLerp(0f, 0f - burnoutTime, currentBurnTime.Value); flareLight.intensity = Mathf.Lerp(startIntensity, 0f, num); EmissionModule emission = flareParticles.emission; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(Mathf.Lerp(smokeRate, 0f, num)); } else { burntOut = true; Log.Debug("Flare attraction stopped after burnout"); ((Behaviour)flareLight).enabled = false; AudioSource obj2 = fizzleAudioSource; if (obj2 != null) { obj2.Stop(); } flareParticles.Stop(true, (ParticleSystemStopBehavior)1); ((Component)flareParticles).transform.SetParent((Transform)null); ((Component)flareParticles).transform.localScale = Vector3.one; ((Renderer)flareRenderer).enabled = false; popSystem.Play(); ((Component)popSystem).transform.SetParent((Transform)null); ((Component)popSystem).transform.localScale = Vector3.one; popAudioSource.PlayOneShot(flarePopSound); GameObject gameObject = ((Component)popSystem).gameObject; MainModule main = popSystem.main; float duration = ((MainModule)(ref main)).duration; main = popSystem.main; MinMaxCurve startLifetime = ((MainModule)(ref main)).startLifetime; Object.Destroy((Object)(object)gameObject, duration + ((MinMaxCurve)(ref startLifetime)).constant); Dictionary scanNodes = hudManager.scanNodes; RectTransform val2 = null; foreach (KeyValuePair item in scanNodes) { if ((Object)(object)item.Value == (Object)(object)scanNodeProperties) { val2 = item.Key; } } if ((Object)(object)val2 != (Object)null) { scanNodes.Remove(val2); ((Component)val2).gameObject.SetActive(false); } GameObject gameObject2 = ((Component)flareParticles).gameObject; main = flareParticles.main; float duration2 = ((MainModule)(ref main)).duration; main = flareParticles.main; startLifetime = ((MainModule)(ref main)).startLifetime; Object.Destroy((Object)(object)gameObject2, duration2 + ((MinMaxCurve)(ref startLifetime)).constant); ((MonoBehaviour)this).StartCoroutine(KillFlare()); } } else { ((Behaviour)flareLight).enabled = true; if (flareParticles.isStopped) { flareParticles.Play(); } } } if (burntOut) { return; } if (Time.time - lastUpdateTime >= 2f) { lastUpdateTime = Time.time; attractedEnemies.Clear(); float num2 = attractRadius * attractRadius; int num3 = 0; foreach (EnemyAI spawnedEnemy in RoundManager.Instance.SpawnedEnemies) { if ((Object)(object)spawnedEnemy == (Object)null || spawnedEnemy.isEnemyDead) { continue; } Vector3 val3 = ((Component)spawnedEnemy).transform.position - ((Component)this).transform.position; if (((Vector3)(ref val3)).sqrMagnitude > num2 || !attractedEnemies.Add(spawnedEnemy)) { continue; } ForestGiantAI val4 = (ForestGiantAI)(object)((spawnedEnemy is ForestGiantAI) ? spawnedEnemy : null); if (val4 != null) { if (((NetworkBehaviour)this).IsServer) { AttractForestGiant(val4); num3++; if (loggedAttractedEnemies.Add(((NetworkBehaviour)spawnedEnemy).NetworkObjectId)) { Log.Debug($"Flare attracted {spawnedEnemy.enemyType.enemyName} from {Vector3.Distance(((Component)this).transform.position, ((Component)spawnedEnemy).transform.position):0.0} metres"); } } } else if (((NetworkBehaviour)spawnedEnemy).IsOwner) { num3++; spawnedEnemy.DetectNoise(((Component)this).transform.position, 10000f, 1, 24234); if (loggedAttractedEnemies.Add(((NetworkBehaviour)spawnedEnemy).NetworkObjectId)) { Log.Debug($"Flare attracted {spawnedEnemy.enemyType.enemyName} from {Vector3.Distance(((Component)this).transform.position, ((Component)spawnedEnemy).transform.position):0.0} metres"); } } } if (!loggedAttractionScan) { loggedAttractionScan = true; Log.Debug($"Flare attraction scan found {attractedEnemies.Count} enemies; this flare controls {num3} enemies"); } } foreach (EnemyAI attractedEnemy in attractedEnemies) { if (!((Object)(object)attractedEnemy == (Object)null) && !attractedEnemy.isEnemyDead && !(attractedEnemy is ForestGiantAI) && ((NetworkBehaviour)attractedEnemy).IsOwner) { attractedEnemy.SetDestinationToPosition(((Component)this).transform.position, false); if (((Behaviour)attractedEnemy.agent).enabled && attractedEnemy.agent.isOnNavMesh) { attractedEnemy.agent.SetDestination(attractedEnemy.destination); } } } } private void AttractForestGiant(ForestGiantAI forestGiant) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0049: 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_0061: 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_006e: 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_002c: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Component)this).transform.position; if (!forestGiant.investigating) { forestGiant.stopAndLookTimer = 1.5f; forestGiant.turnCompass.LookAt(position); forestGiant.investigating = true; forestGiant.hasBegunInvestigating = false; } forestGiant.targetYRot = forestGiant.turnCompass.eulerAngles.y; forestGiant.investigatePosition = RoundManager.Instance.GetNavMeshPosition(position, default(NavMeshHit), 5f, -1); ((EnemyAI)forestGiant).currentBehaviourStateIndex = 0; } private IEnumerator KillFlare() { yield return flareDespawnDelay; Object.Destroy((Object)(object)((Component)this).gameObject); } protected override void __initializeVariables() { if (currentBurnTime == null) { throw new Exception("FlareController.currentBurnTime cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)currentBurnTime).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)currentBurnTime, "currentBurnTime"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)currentBurnTime); ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2472449382u, new RpcReceiveHandler(__rpc_handler_2472449382), "DamagePlayerRpc"); ((NetworkBehaviour)this).__registerRpc(1159786529u, new RpcReceiveHandler(__rpc_handler_1159786529), "DamageEnemyRpc"); ((NetworkBehaviour)this).__registerRpc(1550945071u, new RpcReceiveHandler(__rpc_handler_1550945071), "IgniteForestGiantClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_2472449382(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong playerClientId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref playerClientId); RpcParams ext = rpcParams.Ext; target.__rpc_exec_stage = (__RpcExecStage)1; ((FlareController)(object)target).DamagePlayerRpc(playerClientId, ext); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1159786529(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference enemyReference = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref enemyReference, default(ForNetworkSerializable)); RpcParams ext = rpcParams.Ext; target.__rpc_exec_stage = (__RpcExecStage)1; ((FlareController)(object)target).DamageEnemyRpc(enemyReference, ext); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1550945071(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference giantReference = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref giantReference, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((FlareController)(object)target).IgniteForestGiantClientRpc(giantReference); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "FlareController"; } } public class ForcedPing : MonoBehaviour { [CompilerGenerated] private static class <>O { public static hook_NodeIsNotVisible <0>__HUDManager_NodeIsNotVisible; } [SerializeField] private ScanNodeProperties scanNodeProperties; private HUDManager hudManager; private float pingDuration; private float currentPingTime; private bool isActive; public static void Init() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown object obj = <>O.<0>__HUDManager_NodeIsNotVisible; if (obj == null) { hook_NodeIsNotVisible val = HUDManager_NodeIsNotVisible; <>O.<0>__HUDManager_NodeIsNotVisible = val; obj = (object)val; } HUDManager.NodeIsNotVisible += (hook_NodeIsNotVisible)obj; } private static bool HUDManager_NodeIsNotVisible(orig_NodeIsNotVisible orig, HUDManager self, ScanNodeProperties node, int elementIndex) { //IL_004c: 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_0056: 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_0068: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0095: 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_00af: Unknown result type (might be due to invalid IL or missing references) ForcedPing forcedPing = ((node != null) ? ((Component)node).GetComponentInParent() : null); if (forcedPing == null || !forcedPing.isActive) { return orig.Invoke(self, node, elementIndex); } PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; Camera gameplayCamera = localPlayerController.gameplayCamera; Vector3 val = gameplayCamera.WorldToViewportPoint(((Component)node).transform.position); if (Vector3.Distance(((Component)node).transform.position, ((Component)gameplayCamera).transform.position) > (float)node.maxRange || val.x < 0f || val.x > 1f || val.y < 0f || val.y > 1f || val.z <= 0f) { return orig.Invoke(self, node, elementIndex); } if (!self.nodesOnScreen.Contains(node)) { self.nodesOnScreen.Add(node); } return false; } private void Awake() { hudManager = HUDManager.Instance; scanNodeProperties = ((Component)this).GetComponentInChildren(); if ((Object)(object)scanNodeProperties == (Object)null) { Log.Error("Pinger marker scan node is missing"); ((Behaviour)this).enabled = false; } } public void BeginPing(float duration, string headerText, int nodeType, string senderText) { //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)scanNodeProperties == (Object)null) { return; } pingDuration = duration; currentPingTime = 0f; isActive = true; scanNodeProperties.headerText = headerText; scanNodeProperties.nodeType = nodeType; scanNodeProperties.subText = senderText; PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if (!(Vector3.Distance(((Component)scanNodeProperties).transform.position, ((Component)localPlayerController).transform.position) >= (float)scanNodeProperties.maxRange)) { if (!hudManager.nodesOnScreen.Contains(scanNodeProperties)) { hudManager.nodesOnScreen.Add(scanNodeProperties); } hudManager.AssignNodeToUIElement(scanNodeProperties); } } private void Update() { //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) if (!isActive) { return; } currentPingTime += Time.deltaTime; if (currentPingTime >= pingDuration) { isActive = false; Object.Destroy((Object)(object)((Component)this).gameObject); } else if (!hudManager.nodesOnScreen.Contains(scanNodeProperties)) { PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; Camera gameplayCamera = localPlayerController.gameplayCamera; Vector3 val = gameplayCamera.WorldToViewportPoint(((Component)scanNodeProperties).transform.position); if (!(Vector3.Distance(((Component)scanNodeProperties).transform.position, ((Component)gameplayCamera).transform.position) >= (float)scanNodeProperties.maxRange) && !(val.x <= 0f) && !(val.x >= 1f) && !(val.y <= 0f) && !(val.y >= 1f) && !(val.z < 0f)) { hudManager.nodesOnScreen.Add(scanNodeProperties); hudManager.AssignNodeToUIElement(scanNodeProperties); } } } private void OnDestroy() { if ((Object)(object)hudManager == (Object)null || (Object)(object)scanNodeProperties == (Object)null) { return; } hudManager.nodesOnScreen.Remove(scanNodeProperties); Dictionary scanNodes = hudManager.scanNodes; RectTransform val = null; foreach (KeyValuePair item in scanNodes) { if ((Object)(object)item.Value == (Object)(object)scanNodeProperties) { val = item.Key; break; } } if (!((Object)(object)val == (Object)null)) { scanNodes.Remove(val); ((Component)val).gameObject.SetActive(false); } } } public class GremlinEnergy : GrabbableObject { private static WaitForSeconds drinkDelay; [SerializeField] private AudioSource audioSource; [SerializeField] private AudioClip[] drinkClips; private Coroutine drinkingCoroutine; private PlayerControllerB drinkingPlayer; private int useTzpItemHash; public override void Start() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected O, but got Unknown ((GrabbableObject)this).Start(); if (drinkDelay == null) { drinkDelay = new WaitForSeconds(3f); } useTzpItemHash = Animator.StringToHash("useTZPItem"); } public override void ItemActivate(bool used, bool buttonDown = true) { //IL_004c: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).ItemActivate(used, buttonDown); int num = Random.Range(0, drinkClips.Length); AudioClip val = drinkClips[num]; audioSource.PlayOneShot(val); WalkieTalkie.TransmitOneShotAudio(audioSource, val, 1f); RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, 20f, 1f, 0, base.isInElevator && StartOfRound.Instance.hangarDoorsClosed, 0); if (((NetworkBehaviour)this).IsOwner && !((Object)(object)base.playerHeldBy == (Object)null)) { CancelDrink(); drinkingPlayer = base.playerHeldBy; drinkingPlayer.activatingItem = buttonDown; drinkingPlayer.playerBodyAnimator.SetBool(useTzpItemHash, buttonDown); drinkingCoroutine = ((MonoBehaviour)this).StartCoroutine(FinishDrink()); } } private IEnumerator FinishDrink() { yield return drinkDelay; PlayerControllerB player = drinkingPlayer; drinkingCoroutine = null; ClearDrinkAnimation(); if (player != null) { player.DamagePlayer(50, true, true, (CauseOfDeath)0, 1, false, default(Vector3)); } } private void CancelDrink() { if (drinkingCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(drinkingCoroutine); } drinkingCoroutine = null; ClearDrinkAnimation(); } private void ClearDrinkAnimation() { if ((Object)(object)drinkingPlayer != (Object)null) { drinkingPlayer.playerBodyAnimator.SetBool(useTzpItemHash, false); drinkingPlayer.activatingItem = false; } drinkingPlayer = null; } public override void PocketItem() { CancelDrink(); ((GrabbableObject)this).PocketItem(); } public override void DiscardItem() { CancelDrink(); ((GrabbableObject)this).DiscardItem(); } public override void OnDestroy() { CancelDrink(); ((GrabbableObject)this).OnDestroy(); } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { ((GrabbableObject)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "GremlinEnergy"; } } public class HackingTool : GrabbableObject { private enum HackMode { Hazards, Doors } public enum HackState { Off, Selection, Connecting, Hacking, Failed, Success } [CompilerGenerated] private static class <>O { public static hook_PerformEmote <0>__PlayerControllerB_PerformEmote; } private const float TargetRefreshInterval = 2f; private const float PowerToggleCooldown = 0.25f; private const float TargetValidationDistance = 1.5f; private static readonly List TerminalObjects = new List(); private static WaitForSeconds resetWait; private static float lastRefreshTime = -2f; [SerializeField] private MeshRenderer toolRenderer; [SerializeField] private Camera renderCamera; [SerializeField] private Material screenMat; [SerializeField] private Light backLight; [SerializeField] private AudioSource audioSource; [SerializeField] private AudioSource audioSourceFar; [Space(3f)] [SerializeField] private AudioClip turnOnSound; [SerializeField] private AudioClip turnOffSound; [SerializeField] private AudioClip connecting; [SerializeField] private AudioClip buttonAccept; [SerializeField] private AudioClip hackingSuccess; [SerializeField] private AudioClip hackingCorrect; [SerializeField] private AudioClip hackingFailed; [SerializeField] private int noiseRange = 45; [Space(3f)] [SerializeField] private Transform UISystem; [SerializeField] private TextMeshProUGUI hackString; [SerializeField] private TextMeshProUGUI targetString; [SerializeField] private TextMeshProUGUI progressString; [SerializeField] private Slider connectionBar; [SerializeField] private List hackGuiElements; [Space(3f)] [SerializeField] private float connectionTime = 8f; [SerializeField] private float maxHackDistance = 15f; [SerializeField] private int hackCount = 8; private static int renderTextureId; private RenderTexture renderTexture; private float lastPowerToggleTime; private float connectionTimer; private float targetRefreshTimer; private int currentHack; private int currentHackAnswer; private HackState lastHackState = HackState.Off; private TerminalAccessibleObject selectedTarget; private string hackSequence = string.Empty; private string answerString = string.Empty; private bool waitingForHackCode; private readonly NetworkVariable hackState = new NetworkVariable(HackState.Off, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)1); private readonly NetworkVariable hackMode = new NetworkVariable(HackMode.Hazards, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)1); private readonly NetworkVariable targetDisplay = new NetworkVariable(default(FixedString64Bytes), (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)1); public bool TurnedOn => hackState.Value != HackState.Off; public bool IsHacking => hackState.Value == HackState.Hacking; private void PlaySoundByID(string soundId) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)this).IsOwner) { if (((NetworkBehaviour)this).IsServer) { PlaySoundClientRpc(soundId); } else { PlaySoundServerRpc(soundId); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void PlaySoundServerRpc(string soundId, RpcParams rpcParams = default(RpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false, Delivery = (RpcDelivery)0 }; FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3433791702u, rpcParams, val, (SendTo)2, (RpcDelivery)0); bool flag = soundId != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(soundId, false); } ((NetworkBehaviour)this).__endSendRpc(ref val2, 3433791702u, rpcParams, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (SenderHoldsTool(rpcParams.Receive.SenderClientId)) { PlaySoundClientRpc(soundId); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void PlaySoundClientRpc(string soundId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { Delivery = (RpcDelivery)0 }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3178971235u, val3, val, (SendTo)7, (RpcDelivery)0); bool flag = soundId != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(soundId, false); } ((NetworkBehaviour)this).__endSendRpc(ref val2, 3178971235u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlaySound(soundId); } } private void PlaySound(string soundId) { //IL_017a: Unknown result type (might be due to invalid IL or missing references) if (1 == 0) { } AudioClip val = (AudioClip)(soundId switch { "turnOn" => turnOnSound, "turnOff" => turnOffSound, "connecting" => connecting, "buttonAccept" => buttonAccept, "hackingSuccess" => hackingSuccess, "hackingCorrect" => hackingCorrect, "hackingFailed" => hackingFailed, _ => null, }); if (1 == 0) { } AudioClip val2 = val; if (!((Object)(object)val2 == (Object)null)) { audioSource.PlayOneShot(val2, 1f); AudioSource obj = audioSourceFar; if (obj != null) { obj.PlayOneShot(val2, 1f); } WalkieTalkie.TransmitOneShotAudio(audioSource, val2, 1f); RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, (float)noiseRange, 1f, 0, base.isInElevator && StartOfRound.Instance.hangarDoorsClosed, 0); } } private void SwitchHackState(HackState state) { if (((NetworkBehaviour)this).IsOwner) { hackState.Value = state; } lastHackState = state; ShowScreen(state); } private void ShowScreen(HackState state) { //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) int num = 0; foreach (Transform hackGuiElement in hackGuiElements) { num++; if ((Object)(object)hackGuiElement != (Object)null) { ((Component)hackGuiElement).gameObject.SetActive(num == (int)state); } } if (state != HackState.Connecting) { connectionTimer = 0f; } switch (state) { case HackState.Selection: selectedTarget = null; answerString = string.Empty; waitingForHackCode = false; if (((NetworkBehaviour)this).IsOwner) { ShowTarget((hackMode.Value == HackMode.Doors) ? "No door" : "No turret/mine/spikes"); } else { ((TMP_Text)targetString).text = ((object)targetDisplay.Value/*cast due to .constrained prefix*/).ToString(); } break; case HackState.Connecting: if (((NetworkBehaviour)this).IsOwner) { PlaySoundByID("connecting"); } break; case HackState.Hacking: if (!string.IsNullOrEmpty(hackSequence)) { ((TMP_Text)hackString).text = hackSequence; ((TMP_Text)progressString).text = answerString + new string('_', Mathf.Max(0, hackCount - currentHack)); } break; case HackState.Off: audioSource.Stop(); audioSourceFar.Stop(); break; } bool flag = state != HackState.Off; ((Behaviour)renderCamera).enabled = flag; ((Behaviour)backLight).enabled = flag; if (!flag) { RenderTexture active = RenderTexture.active; RenderTexture.active = renderTexture; GL.Clear(true, true, Color.black); RenderTexture.active = active; } if (((NetworkBehaviour)this).IsOwner && (Object)(object)base.playerHeldBy?.currentlyHeldObjectServer == (Object)(object)this) { ((GrabbableObject)this).SetControlTipsForItem(); } } private void Awake() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Expected O, but got Unknown //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Expected O, but got Unknown base.mainObjectRenderer = toolRenderer; renderTexture = new RenderTexture(500, 390, 16, (RenderTextureFormat)0) { name = $"HackingToolRenderTexture({renderTextureId})" }; UISystem.position = new Vector3(-1000f, -1000f * (float)(renderTextureId + 1), -1000f); renderTextureId++; renderCamera.targetTexture = renderTexture; ((Behaviour)renderCamera).enabled = false; screenMat = new Material(screenMat) { mainTexture = (Texture)(object)renderTexture }; if (screenMat.HasProperty("_BaseColorMap")) { screenMat.SetTexture("_BaseColorMap", (Texture)(object)renderTexture); } Material[] sharedMaterials = ((Renderer)base.mainObjectRenderer).sharedMaterials; sharedMaterials[1] = screenMat; ((Renderer)base.mainObjectRenderer).sharedMaterials = sharedMaterials; connectionTime = Mathf.Max(0.1f, LethalThingsConfig.hackingToolConnectionTime.Value); maxHackDistance = Mathf.Max(0.1f, LethalThingsConfig.hackingToolHackDistance.Value); hackCount = Mathf.Clamp(LethalThingsConfig.hackingToolAnswerNumber.Value, 1, 9); base.itemProperties.requiresBattery = true; base.itemProperties.batteryUsage = Mathf.Max(0.1f, LethalThingsConfig.hackingToolBattery.Value); backLight.intensity = 2f; ((Behaviour)backLight).enabled = false; } public override void OnNetworkSpawn() { ((NetworkBehaviour)this).OnNetworkSpawn(); NetworkVariable obj = hackMode; obj.OnValueChanged = (OnValueChangedDelegate)(object)Delegate.Combine((Delegate?)(object)obj.OnValueChanged, (Delegate?)(object)new OnValueChangedDelegate(HackModeChanged)); NetworkVariable obj2 = targetDisplay; obj2.OnValueChanged = (OnValueChangedDelegate)(object)Delegate.Combine((Delegate?)(object)obj2.OnValueChanged, (Delegate?)(object)new OnValueChangedDelegate(TargetDisplayChanged)); ShowScreen(hackState.Value); } public override void OnNetworkDespawn() { NetworkVariable obj = hackMode; obj.OnValueChanged = (OnValueChangedDelegate)(object)Delegate.Remove((Delegate?)(object)obj.OnValueChanged, (Delegate?)(object)new OnValueChangedDelegate(HackModeChanged)); NetworkVariable obj2 = targetDisplay; obj2.OnValueChanged = (OnValueChangedDelegate)(object)Delegate.Remove((Delegate?)(object)obj2.OnValueChanged, (Delegate?)(object)new OnValueChangedDelegate(TargetDisplayChanged)); ((NetworkBehaviour)this).OnNetworkDespawn(); } public override void Update() { //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) base.isBeingUsed = TurnedOn; if (TurnedOn) { Battery insertedBattery = base.insertedBattery; if (insertedBattery != null && !insertedBattery.empty) { Battery insertedBattery2 = base.insertedBattery; if (insertedBattery2 == null || !(insertedBattery2.charge <= 0f)) { goto IL_007b; } } if (((NetworkBehaviour)this).IsOwner) { SwitchHackState(HackState.Off); } audioSource.Stop(); audioSourceFar.Stop(); } goto IL_007b; IL_007b: if ((Object)(object)base.playerHeldBy != (Object)null) { base.playerHeldBy.activatingItem = IsHacking; } if ((Object)(object)selectedTarget != (Object)null) { Vector3 val = ((Component)selectedTarget).transform.position - ((Component)this).transform.position; if (((Vector3)(ref val)).sqrMagnitude > maxHackDistance * maxHackDistance) { selectedTarget = null; if (((NetworkBehaviour)this).IsOwner && TurnedOn) { SwitchHackState(HackState.Selection); } } } if (hackState.Value != lastHackState) { lastHackState = hackState.Value; ShowScreen(lastHackState); } if (((NetworkBehaviour)this).IsOwner) { switch (hackState.Value) { case HackState.Selection: UpdateSelection(); break; case HackState.Connecting: UpdateConnection(); break; case HackState.Hacking: ProcessHackInput(); break; } } ((GrabbableObject)this).Update(); } private void UpdateSelection() { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) targetRefreshTimer += Time.deltaTime; if (targetRefreshTimer < 2f) { return; } targetRefreshTimer = 0f; HackMode value = hackMode.Value; selectedTarget = ClosestTerminal(((Component)this).transform.position, maxHackDistance, value, out var _); if ((Object)(object)selectedTarget == (Object)null) { ShowTarget((value == HackMode.Doors) ? "No door" : "No turret/mine/spikes"); return; } string text; if (value == HackMode.Doors) { text = "Door"; } else { Component val = HazardFor(selectedTarget); if (1 == 0) { } string text2 = ((val is Turret) ? "Turret" : ((!(val is Landmine)) ? "Spikes" : "Mine")); if (1 == 0) { } text = text2; } string text3 = text; float distance = Mathf.Max(0.1f, LethalThingsConfig.hackingToolHackSpreadDistance.Value); ClosestTerminal(((Component)selectedTarget).transform.position, distance, value, out var terminalsInRange2); string text4 = ((terminalsInRange2 > 1) ? $"\n+{terminalsInRange2 - 1}" : string.Empty); ShowTarget(text3 + "\n" + selectedTarget.objectCode + text4); } private void UpdateConnection() { //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)selectedTarget == (Object)null || !CanHack(selectedTarget, hackMode.Value)) { SwitchHackState(HackState.Selection); return; } connectionTimer += Time.deltaTime; connectionBar.value = connectionTimer / connectionTime; if (!(connectionTimer < connectionTime) && !waitingForHackCode) { waitingForHackCode = true; BeginHackServerRpc(); } } [Rpc(/*Could not decode attribute arguments.*/)] private void BeginHackServerRpc(RpcParams rpcParams = default(RpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false, Delivery = (RpcDelivery)0 }; FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(633414190u, rpcParams, val, (SendTo)2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 633414190u, rpcParams, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (SenderHoldsTool(rpcParams.Receive.SenderClientId)) { int num = Mathf.Clamp(LethalThingsConfig.hackingToolAnswerNumber.Value, 1, 9); int num2 = ((num != 1) ? ((int)Mathf.Pow(10f, (float)(num - 1))) : 0); int num3 = (int)Mathf.Pow(10f, (float)num); BeginHackClientRpc(Random.Range(num2, num3).ToString($"D{num}")); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void BeginHackClientRpc(string sequence) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { Delivery = (RpcDelivery)0 }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2917254700u, val3, val, (SendTo)7, (RpcDelivery)0); bool flag = sequence != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(sequence, false); } ((NetworkBehaviour)this).__endSendRpc(ref val2, 2917254700u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; hackSequence = sequence; hackCount = sequence.Length; currentHack = 0; answerString = string.Empty; ((TMP_Text)hackString).text = hackSequence; currentHackAnswer = hackSequence[0] - 48; ((TMP_Text)progressString).text = new string('_', hackCount); if (((NetworkBehaviour)this).IsOwner) { waitingForHackCode = false; SwitchHackState(HackState.Hacking); PlaySoundByID("buttonAccept"); } } } private void ProcessHackInput() { //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) int num = ReadPressedDigit(); if (num < 0) { return; } if (num != currentHackAnswer) { SwitchHackState(HackState.Failed); PlaySoundByID("hackingFailed"); ((MonoBehaviour)this).StartCoroutine(Reset()); return; } answerString += num; currentHack++; ((TMP_Text)progressString).text = answerString + new string('_', Mathf.Max(0, hackCount - currentHack)); UpdateHackProgressServerRpc(answerString, currentHack); if (currentHack < hackCount) { currentHackAnswer = hackSequence[currentHack] - 48; PlaySoundByID("hackingCorrect"); return; } Vector3 position = ((Component)selectedTarget).transform.position; HackMode value = hackMode.Value; SwitchHackState(HackState.Success); CompleteHackServerRpc(position, (int)value); PlaySoundByID("hackingSuccess"); ((MonoBehaviour)this).StartCoroutine(Reset()); } [Rpc(/*Could not decode attribute arguments.*/)] private void UpdateHackProgressServerRpc(string progress, int enteredDigits, RpcParams rpcParams = default(RpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false, Delivery = (RpcDelivery)0 }; FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3781400879u, rpcParams, val, (SendTo)2, (RpcDelivery)0); bool flag = progress != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(progress, false); } BytePacker.WriteValueBitPacked(val2, enteredDigits); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3781400879u, rpcParams, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (SenderHoldsTool(rpcParams.Receive.SenderClientId)) { UpdateHackProgressClientRpc(progress, enteredDigits); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void UpdateHackProgressClientRpc(string progress, int enteredDigits) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { Delivery = (RpcDelivery)0 }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3984289822u, val3, val, (SendTo)7, (RpcDelivery)0); bool flag = progress != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(progress, false); } BytePacker.WriteValueBitPacked(val2, enteredDigits); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3984289822u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; answerString = progress; currentHack = Mathf.Clamp(enteredDigits, 0, hackCount); ((TMP_Text)progressString).text = answerString + new string('_', Mathf.Max(0, hackCount - currentHack)); } } private bool SenderHoldsTool(ulong senderClientId) { if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { return false; } return (Object)(object)StartOfRound.Instance.allPlayerScripts[value].currentlyHeldObjectServer == (Object)(object)this; } private static int ReadPressedDigit() { Keyboard current = Keyboard.current; if (current == null) { return -1; } if (((ButtonControl)current.digit0Key).wasPressedThisFrame || ((ButtonControl)current.numpad0Key).wasPressedThisFrame) { return 0; } if (((ButtonControl)current.digit1Key).wasPressedThisFrame || ((ButtonControl)current.numpad1Key).wasPressedThisFrame) { return 1; } if (((ButtonControl)current.digit2Key).wasPressedThisFrame || ((ButtonControl)current.numpad2Key).wasPressedThisFrame) { return 2; } if (((ButtonControl)current.digit3Key).wasPressedThisFrame || ((ButtonControl)current.numpad3Key).wasPressedThisFrame) { return 3; } if (((ButtonControl)current.digit4Key).wasPressedThisFrame || ((ButtonControl)current.numpad4Key).wasPressedThisFrame) { return 4; } if (((ButtonControl)current.digit5Key).wasPressedThisFrame || ((ButtonControl)current.numpad5Key).wasPressedThisFrame) { return 5; } if (((ButtonControl)current.digit6Key).wasPressedThisFrame || ((ButtonControl)current.numpad6Key).wasPressedThisFrame) { return 6; } if (((ButtonControl)current.digit7Key).wasPressedThisFrame || ((ButtonControl)current.numpad7Key).wasPressedThisFrame) { return 7; } if (((ButtonControl)current.digit8Key).wasPressedThisFrame || ((ButtonControl)current.numpad8Key).wasPressedThisFrame) { return 8; } if (((ButtonControl)current.digit9Key).wasPressedThisFrame || ((ButtonControl)current.numpad9Key).wasPressedThisFrame) { return 9; } return -1; } private IEnumerator Reset() { yield return resetWait; if (((NetworkBehaviour)this).IsOwner && TurnedOn) { SwitchHackState(HackState.Selection); } } public static void Load() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown resetWait = new WaitForSeconds(3f); object obj = <>O.<0>__PlayerControllerB_PerformEmote; if (obj == null) { hook_PerformEmote val = PlayerControllerB_PerformEmote; <>O.<0>__PlayerControllerB_PerformEmote = val; obj = (object)val; } PlayerControllerB.PerformEmote += (hook_PerformEmote)obj; } private static void PlayerControllerB_PerformEmote(orig_PerformEmote orig, PlayerControllerB self, CallbackContext context, int emoteId) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) if (!(self.currentlyHeldObjectServer is HackingTool { IsHacking: not false })) { orig.Invoke(self, context, emoteId); } } public void TogglePower() { if (!((NetworkBehaviour)this).IsOwner || Time.time - lastPowerToggleTime < 0.25f) { return; } lastPowerToggleTime = Time.time; if (TurnedOn) { SwitchHackState(HackState.Off); selectedTarget = null; PlaySoundByID("turnOff"); return; } Battery insertedBattery = base.insertedBattery; if (insertedBattery != null && !insertedBattery.empty && !(base.insertedBattery.charge <= 0f)) { SwitchHackState(HackState.Selection); PlaySoundByID("turnOn"); } } public void ToggleHackMode() { if (((NetworkBehaviour)this).IsOwner && TurnedOn) { selectedTarget = null; targetRefreshTimer = 2f; hackMode.Value = ((hackMode.Value != HackMode.Doors) ? HackMode.Doors : HackMode.Hazards); } } private void HackModeChanged(HackMode _, HackMode __) { if (((NetworkBehaviour)this).IsOwner && hackState.Value == HackState.Selection) { targetRefreshTimer = 2f; UpdateSelection(); } } private unsafe void TargetDisplayChanged(FixedString64Bytes _, FixedString64Bytes current) { ((TMP_Text)targetString).text = ((object)(*(FixedString64Bytes*)(¤t))/*cast due to .constrained prefix*/).ToString(); } private void ShowTarget(string text) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002c: 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) ((TMP_Text)targetString).text = text; FixedString64Bytes val = default(FixedString64Bytes); ((FixedString64Bytes)(ref val))..ctor(text); if (((NetworkBehaviour)this).IsOwner) { FixedString64Bytes value = targetDisplay.Value; if (!((FixedString64Bytes)(ref value)).Equals(val)) { targetDisplay.Value = val; } } } [Rpc(/*Could not decode attribute arguments.*/)] private void CompleteHackServerRpc(Vector3 requestedTargetPosition, int requestedMode, RpcParams rpcParams = default(RpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0091: 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_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false, Delivery = (RpcDelivery)0 }; FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1863818458u, rpcParams, val, (SendTo)2, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref requestedTargetPosition); BytePacker.WriteValueBitPacked(val2, requestedMode); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1863818458u, rpcParams, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!SenderHoldsTool(rpcParams.Receive.SenderClientId) || requestedMode < 0 || requestedMode > 1) { return; } Vector3 val3 = ((Component)this).transform.position - requestedTargetPosition; if (((Vector3)(ref val3)).sqrMagnitude > maxHackDistance * maxHackDistance) { return; } int terminalsInRange; TerminalAccessibleObject val4 = ClosestTerminal(requestedTargetPosition, 1.5f, (HackMode)requestedMode, out terminalsInRange); if (!((Object)(object)val4 == (Object)null)) { float radius = Mathf.Max(0.1f, LethalThingsConfig.hackingToolHackSpreadDistance.Value); float cooldown = ((requestedMode == 1) ? Mathf.Max(0f, LethalThingsConfig.hackingToolDoorCooldown.Value) : Mathf.Max(LethalThingsConfig.hackingToolTurretDisableTime.Value, Mathf.Max(LethalThingsConfig.hackingToolSpikeDisableTime.Value, LethalThingsConfig.hackingToolLandmineDisableTime.Value))); if (requestedMode == 1) { HackDoors(((Component)val4).transform.position, radius, cooldown); } else { HackHazards(((Component)val4).transform.position, radius, cooldown); } ShowHackClientRpc(((Component)val4).transform.position, requestedMode, radius, cooldown); Log.Debug((requestedMode == 1) ? "Hacking tool completed a door hack" : "Hacking tool completed a hazard hack"); } } [Rpc(/*Could not decode attribute arguments.*/)] private void ShowHackClientRpc(Vector3 origin, int requestedMode, float radius, float cooldown) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { Delivery = (RpcDelivery)0 }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3787075786u, val3, val, (SendTo)7, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref origin); BytePacker.WriteValueBitPacked(val2, requestedMode); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref radius, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref cooldown, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3787075786u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (requestedMode < 0 || requestedMode > 1) { return; } float num = radius * radius; Refresh(); foreach (TerminalAccessibleObject terminalObject in TerminalObjects) { if (CanHack(terminalObject, (HackMode)requestedMode)) { Vector3 val4 = ((Component)terminalObject).transform.position - origin; if (!(((Vector3)(ref val4)).sqrMagnitude > num)) { SetTerminalCooldown(terminalObject, cooldown); ((Graphic)terminalObject.mapRadarText).color = Color.red; ((Graphic)terminalObject.mapRadarBox).color = Color.red; ((MonoBehaviour)this).StartCoroutine(RestoreAfterDelay((Component)(object)terminalObject, cooldown)); } } } } private void HackDoors(Vector3 origin, float radius, float cooldown) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) float num = radius * radius; Refresh(); foreach (TerminalAccessibleObject terminalObject in TerminalObjects) { if (CanHack(terminalObject, HackMode.Doors)) { Vector3 val = ((Component)terminalObject).transform.position - origin; if (!(((Vector3)(ref val)).sqrMagnitude > num)) { SetTerminalCooldown(terminalObject, 0f); terminalObject.CallFunctionFromTerminal(); SetTerminalCooldown(terminalObject, cooldown); ((MonoBehaviour)this).StartCoroutine(RestoreAfterDelay((Component)(object)terminalObject, cooldown)); } } } } private void HackHazards(Vector3 origin, float radius, float cooldown) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003d: 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) HashSet hashSet = new HashSet(); float num = radius * radius; Refresh(); foreach (TerminalAccessibleObject terminalObject in TerminalObjects) { if (CanHack(terminalObject, HackMode.Hazards)) { Vector3 val = ((Component)terminalObject).transform.position - origin; if (!(((Vector3)(ref val)).sqrMagnitude > num)) { SetTerminalCooldown(terminalObject, cooldown); ((MonoBehaviour)this).StartCoroutine(RestoreAfterDelay((Component)(object)terminalObject, cooldown)); hashSet.Add(HazardFor(terminalObject)); } } } foreach (Component item in hashSet) { Component val2 = item; Component val3 = val2; Turret val4 = (Turret)(object)((val3 is Turret) ? val3 : null); if (val4 == null) { Landmine val5 = (Landmine)(object)((val3 is Landmine) ? val3 : null); if (val5 == null) { SpikeRoofTrap val6 = (SpikeRoofTrap)(object)((val3 is SpikeRoofTrap) ? val3 : null); if (val6 != null) { val6.ToggleSpikesEnabled(false); ((MonoBehaviour)this).StartCoroutine(RestoreAfterDelay((Component)(object)val6, LethalThingsConfig.hackingToolSpikeDisableTime.Value)); } } else if (LethalThingsConfig.hackingToolLandmineExplodeOnHack.Value) { val5.ExplodeMineClientRpc(); } else { Landmine val7 = val5; val7.ToggleMine(false); ((MonoBehaviour)this).StartCoroutine(RestoreAfterDelay((Component)(object)val7, LethalThingsConfig.hackingToolLandmineDisableTime.Value)); } } else { val4.ToggleTurretClientRpc(false); ((MonoBehaviour)this).StartCoroutine(RestoreAfterDelay((Component)(object)val4, LethalThingsConfig.hackingToolTurretDisableTime.Value)); } } } private static bool CanHack(TerminalAccessibleObject terminal, HackMode mode) { if (terminal == null || terminal.inCooldown || terminal == null || !terminal.isPoweredOn) { return false; } Component val = HazardFor(terminal); Landmine val2 = (Landmine)(object)((val is Landmine) ? val : null); if (val2 != null && val2.hasExploded) { return false; } return (mode == HackMode.Hazards) ? ((Object)(object)val != (Object)null) : ((Object)(object)val == (Object)null); } private static Component HazardFor(TerminalAccessibleObject terminal) { Turret componentInParent = ((Component)terminal).GetComponentInParent(); if ((Object)(object)componentInParent != (Object)null) { return (Component)(object)componentInParent; } Landmine componentInParent2 = ((Component)terminal).GetComponentInParent(); if ((Object)(object)componentInParent2 != (Object)null) { return (Component)(object)componentInParent2; } SpikeRoofTrap componentInParent3 = ((Component)terminal).GetComponentInParent(); if ((Object)(object)componentInParent3 != (Object)null) { return (Component)(object)componentInParent3; } Transform parent = ((Component)terminal).transform.parent; Transform val = ((parent != null) ? parent.parent : null); return (Component)(object)((val != null) ? ((Component)val).GetComponentInChildren() : null); } private static TerminalAccessibleObject ClosestTerminal(Vector3 origin, float distance, HackMode mode, out int terminalsInRange) { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) Refresh(); TerminalAccessibleObject result = null; float num = distance * distance; float num2 = num; terminalsInRange = 0; foreach (TerminalAccessibleObject terminalObject in TerminalObjects) { if (!CanHack(terminalObject, mode)) { continue; } Vector3 val = ((Component)terminalObject).transform.position - origin; float sqrMagnitude = ((Vector3)(ref val)).sqrMagnitude; if (!(sqrMagnitude >= num)) { terminalsInRange++; if (!(sqrMagnitude >= num2)) { num2 = sqrMagnitude; result = terminalObject; } } } return result; } private static void Refresh() { if (!(Time.time - lastRefreshTime < 2f)) { lastRefreshTime = Time.time; TerminalObjects.Clear(); TerminalObjects.AddRange(Object.FindObjectsByType((FindObjectsSortMode)0)); } } private static void SetTerminalCooldown(TerminalAccessibleObject terminal, float duration) { terminal.inCooldown = duration > 0f; terminal.currentCooldownTimer = Mathf.Max(0f, duration); } public override void OnDestroy() { renderCamera.targetTexture = null; renderTexture.Release(); Object.Destroy((Object)(object)renderTexture); Object.Destroy((Object)(object)screenMat); ((GrabbableObject)this).OnDestroy(); } private IEnumerator RestoreAfterDelay(Component component, float delay) { yield return (object)new WaitForSeconds(Mathf.Max(0f, delay)); if ((Object)(object)component == (Object)null) { yield break; } TerminalAccessibleObject terminal = (TerminalAccessibleObject)(object)((component is TerminalAccessibleObject) ? component : null); if (terminal == null) { Turret turret = (Turret)(object)((component is Turret) ? component : null); if (turret == null) { SpikeRoofTrap spikeTrap = (SpikeRoofTrap)(object)((component is SpikeRoofTrap) ? component : null); if (spikeTrap == null) { Landmine landmine = (Landmine)(object)((component is Landmine) ? component : null); if (landmine != null && !landmine.hasExploded) { landmine.ToggleMine(true); } } else { spikeTrap.ToggleSpikesEnabled(true); } } else { turret.ToggleTurretClientRpc(true); } } else { SetTerminalCooldown(terminal, 0f); } } public override void SetControlTipsForItem() { string text = InputUtilsCompat.BindingText(InputUtilsCompat.HackingToolPower); string text2 = InputUtilsCompat.BindingText(InputUtilsCompat.HackingToolMode); HackState value = hackState.Value; if (1 == 0) { } string[] array = value switch { HackState.Off => new string[1] { "Turn on : [" + text + "]" }, HackState.Selection => new string[3] { "Turn off : [" + text + "]", "Switch modes : [" + text2 + "]", "Select target : [LMB]" }, HackState.Connecting => new string[2] { "Turn off : [" + text + "]", "Connecting" }, HackState.Hacking => new string[2] { "Turn off : [" + text + "]", "Input value : [0-9]" }, HackState.Failed => new string[2] { "Turn off : [" + text + "]", "Hack failed" }, HackState.Success => new string[2] { "Turn off : [" + text + "]", "Hack complete" }, _ => Array.Empty(), }; if (1 == 0) { } string[] array2 = array; HUDManager.Instance.ClearControlTips(); HUDManager.Instance.ChangeControlTipMultiple(array2, true, base.itemProperties); } private static void ClearControlTips() { HUDManager instance = HUDManager.Instance; if (instance?.controlTipLines != null) { TextMeshProUGUI[] controlTipLines = instance.controlTipLines; foreach (TextMeshProUGUI val in controlTipLines) { ((TMP_Text)val).text = string.Empty; } } } public override void DiscardItem() { if ((Object)(object)base.playerHeldBy != (Object)null) { base.playerHeldBy.equippedUsableItemQE = false; base.playerHeldBy.activatingItem = false; } selectedTarget = null; currentHack = 0; currentHackAnswer = 0; answerString = string.Empty; if (((NetworkBehaviour)this).IsOwner && TurnedOn && hackState.Value != HackState.Selection) { SwitchHackState(HackState.Selection); } ClearControlTips(); ((GrabbableObject)this).DiscardItem(); } public override void PocketItem() { ((GrabbableObject)this).PocketItem(); ClearControlTips(); } public override void EquipItem() { ((GrabbableObject)this).EquipItem(); base.playerHeldBy.equippedUsableItemQE = false; base.playerHeldBy.activatingItem = false; if (((NetworkBehaviour)this).IsOwner) { ((GrabbableObject)this).SetControlTipsForItem(); } } public override void ItemActivate(bool used, bool buttonDown = true) { ((GrabbableObject)this).ItemActivate(used, buttonDown); if (((NetworkBehaviour)this).IsOwner && hackState.Value == HackState.Selection && !((Object)(object)selectedTarget == (Object)null)) { SwitchHackState(HackState.Connecting); PlaySoundByID("buttonAccept"); } } protected override void __initializeVariables() { if (hackState == null) { throw new Exception("HackingTool.hackState cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)hackState).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)hackState, "hackState"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)hackState); if (hackMode == null) { throw new Exception("HackingTool.hackMode cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)hackMode).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)hackMode, "hackMode"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)hackMode); if (targetDisplay == null) { throw new Exception("HackingTool.targetDisplay cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)targetDisplay).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)targetDisplay, "targetDisplay"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)targetDisplay); ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(3433791702u, new RpcReceiveHandler(__rpc_handler_3433791702), "PlaySoundServerRpc"); ((NetworkBehaviour)this).__registerRpc(3178971235u, new RpcReceiveHandler(__rpc_handler_3178971235), "PlaySoundClientRpc"); ((NetworkBehaviour)this).__registerRpc(633414190u, new RpcReceiveHandler(__rpc_handler_633414190), "BeginHackServerRpc"); ((NetworkBehaviour)this).__registerRpc(2917254700u, new RpcReceiveHandler(__rpc_handler_2917254700), "BeginHackClientRpc"); ((NetworkBehaviour)this).__registerRpc(3781400879u, new RpcReceiveHandler(__rpc_handler_3781400879), "UpdateHackProgressServerRpc"); ((NetworkBehaviour)this).__registerRpc(3984289822u, new RpcReceiveHandler(__rpc_handler_3984289822), "UpdateHackProgressClientRpc"); ((NetworkBehaviour)this).__registerRpc(1863818458u, new RpcReceiveHandler(__rpc_handler_1863818458), "CompleteHackServerRpc"); ((NetworkBehaviour)this).__registerRpc(3787075786u, new RpcReceiveHandler(__rpc_handler_3787075786), "ShowHackClientRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_3433791702(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_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0089: 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(ref flag, default(ForPrimitives)); string soundId = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref soundId, false); } RpcParams ext = rpcParams.Ext; target.__rpc_exec_stage = (__RpcExecStage)1; ((HackingTool)(object)target).PlaySoundServerRpc(soundId, ext); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3178971235(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string soundId = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref soundId, false); } target.__rpc_exec_stage = (__RpcExecStage)1; ((HackingTool)(object)target).PlaySoundClientRpc(soundId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_633414190(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { RpcParams ext = rpcParams.Ext; target.__rpc_exec_stage = (__RpcExecStage)1; ((HackingTool)(object)target).BeginHackServerRpc(ext); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2917254700(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string sequence = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref sequence, false); } target.__rpc_exec_stage = (__RpcExecStage)1; ((HackingTool)(object)target).BeginHackClientRpc(sequence); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3781400879(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_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_009a: 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(ref flag, default(ForPrimitives)); string progress = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref progress, false); } int enteredDigits = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref enteredDigits); RpcParams ext = rpcParams.Ext; target.__rpc_exec_stage = (__RpcExecStage)1; ((HackingTool)(object)target).UpdateHackProgressServerRpc(progress, enteredDigits, ext); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3984289822(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(ref flag, default(ForPrimitives)); string progress = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref progress, false); } int enteredDigits = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref enteredDigits); target.__rpc_exec_stage = (__RpcExecStage)1; ((HackingTool)(object)target).UpdateHackProgressClientRpc(progress, enteredDigits); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1863818458(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 requestedTargetPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref requestedTargetPosition); int requestedMode = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref requestedMode); RpcParams ext = rpcParams.Ext; target.__rpc_exec_stage = (__RpcExecStage)1; ((HackingTool)(object)target).CompleteHackServerRpc(requestedTargetPosition, requestedMode, ext); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3787075786(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006a: 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_0084: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 origin = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref origin); int requestedMode = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref requestedMode); float radius = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref radius, default(ForPrimitives)); float cooldown = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref cooldown, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((HackingTool)(object)target).ShowHackClientRpc(origin, requestedMode, radius, cooldown); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "HackingTool"; } } public class HandheldRadar : GrabbableObject { private enum RadarSound { TurnOn, TurnOff, SwitchTarget } [CompilerGenerated] private static class <>O { public static hook_Update <0>__ManualCameraRenderer_Update; } private readonly NetworkVariable turnedOn = new NetworkVariable(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); private Material screenOffMat; private Material screenOnMat; private int lastRadarIndex = -1; private bool waitingForPowerChange; [SerializeField] private AudioSource audioSource; [SerializeField] private AudioSource audioSourceFar; [Space(3f)] [SerializeField] private AudioClip turnOnSound; [SerializeField] private AudioClip turnOffSound; [SerializeField] private AudioClip switchTargetSound; [Space(3f)] [SerializeField] private int noiseRange = 45; public static void Load() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown object obj = <>O.<0>__ManualCameraRenderer_Update; if (obj == null) { hook_Update val = ManualCameraRenderer_Update; <>O.<0>__ManualCameraRenderer_Update = val; obj = (object)val; } ManualCameraRenderer.Update += (hook_Update)obj; } private static void ManualCameraRenderer_Update(orig_Update orig, ManualCameraRenderer self) { orig.Invoke(self); if ((Object)(object)self != (Object)(object)StartOfRound.Instance.mapScreen) { return; } PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; for (int i = 0; i < allPlayerScripts.Length; i++) { if (allPlayerScripts[i]?.currentlyHeldObjectServer is HandheldRadar handheldRadar && handheldRadar.turnedOn.Value) { ((Behaviour)self.mapCamera).enabled = true; break; } } } private void Awake() { screenOffMat = ((Renderer)base.mainObjectRenderer).sharedMaterials[1]; screenOnMat = StartOfRound.Instance.mapScreen.onScreenMat; } public override void Start() { ((GrabbableObject)this).Start(); base.itemProperties.requiresBattery = true; base.itemProperties.batteryUsage = LethalThingsConfig.handheldRadarBattery.Value; } public override void OnNetworkSpawn() { ((NetworkBehaviour)this).OnNetworkSpawn(); NetworkVariable obj = turnedOn; obj.OnValueChanged = (OnValueChangedDelegate)(object)Delegate.Combine((Delegate?)(object)obj.OnValueChanged, (Delegate?)(object)new OnValueChangedDelegate(ShowScreen)); ShowScreen(_: false, turnedOn.Value); } public override void OnNetworkDespawn() { NetworkVariable obj = turnedOn; obj.OnValueChanged = (OnValueChangedDelegate)(object)Delegate.Remove((Delegate?)(object)obj.OnValueChanged, (Delegate?)(object)new OnValueChangedDelegate(ShowScreen)); ((NetworkBehaviour)this).OnNetworkDespawn(); } public override void Update() { //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) base.isBeingUsed = turnedOn.Value; if (((NetworkBehaviour)this).IsOwner && turnedOn.Value && !waitingForPowerChange && base.insertedBattery.charge <= 0f) { waitingForPowerChange = true; PowerServerRpc(on: false); } if (((NetworkBehaviour)this).IsOwner && turnedOn.Value && (Object)(object)base.playerHeldBy?.currentlyHeldObjectServer == (Object)(object)this && StartOfRound.Instance.mapScreen.targetTransformIndex != lastRadarIndex) { ((GrabbableObject)this).SetControlTipsForItem(); } ((GrabbableObject)this).Update(); } [Rpc(/*Could not decode attribute arguments.*/)] private void PowerServerRpc(bool on, RpcParams rpcParams = default(RpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false, Delivery = (RpcDelivery)0 }; FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1470193123u, rpcParams, val, (SendTo)2, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref on, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1470193123u, rpcParams, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (SenderHoldsRadar(rpcParams.Receive.SenderClientId) && (!on || !(base.insertedBattery.charge <= 0f))) { turnedOn.Value = on; PlaySoundClientRpc((!on) ? RadarSound.TurnOff : RadarSound.TurnOn); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void TargetSoundServerRpc(RpcParams rpcParams = default(RpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false, Delivery = (RpcDelivery)0 }; FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(819753471u, rpcParams, val, (SendTo)2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 819753471u, rpcParams, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (SenderHoldsRadar(rpcParams.Receive.SenderClientId)) { PlaySoundClientRpc(RadarSound.SwitchTarget); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void PlaySoundClientRpc(RadarSound radarSound) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { Delivery = (RpcDelivery)0 }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3707848663u, val3, val, (SendTo)7, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref radarSound, default(ForEnums)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3707848663u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (1 == 0) { } AudioClip val4 = (AudioClip)(radarSound switch { RadarSound.TurnOn => turnOnSound, RadarSound.TurnOff => turnOffSound, _ => switchTargetSound, }); if (1 == 0) { } AudioClip val5 = val4; audioSource.PlayOneShot(val5, 1f); AudioSource obj = audioSourceFar; if (obj != null) { obj.PlayOneShot(val5, 1f); } WalkieTalkie.TransmitOneShotAudio(audioSource, val5, 1f); RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, (float)noiseRange, 1f, 0, base.isInElevator && StartOfRound.Instance.hangarDoorsClosed, 0); } } private void ShowScreen(bool _, bool on) { Material[] sharedMaterials = ((Renderer)base.mainObjectRenderer).sharedMaterials; sharedMaterials[1] = (on ? screenOnMat : screenOffMat); ((Renderer)base.mainObjectRenderer).sharedMaterials = sharedMaterials; waitingForPowerChange = false; if (((NetworkBehaviour)this).IsOwner && (Object)(object)base.playerHeldBy?.currentlyHeldObjectServer == (Object)(object)this) { ((GrabbableObject)this).SetControlTipsForItem(); } } private bool SenderHoldsRadar(ulong senderClientId) { int value; return StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out value) && (Object)(object)StartOfRound.Instance.allPlayerScripts[value].currentlyHeldObjectServer == (Object)(object)this; } public override void DiscardItem() { if ((Object)(object)base.playerHeldBy != (Object)null) { base.playerHeldBy.equippedUsableItemQE = false; } ((GrabbableObject)this).DiscardItem(); } public override void EquipItem() { ((GrabbableObject)this).EquipItem(); base.playerHeldBy.equippedUsableItemQE = false; if (((NetworkBehaviour)this).IsOwner) { ((GrabbableObject)this).SetControlTipsForItem(); } } public override void SetControlTipsForItem() { ManualCameraRenderer mapScreen = StartOfRound.Instance.mapScreen; lastRadarIndex = mapScreen.targetTransformIndex; string text = InputUtilsCompat.BindingText(InputUtilsCompat.HandheldRadarPower); string[] array = ((!turnedOn.Value) ? new string[1] { "Turn on : [" + text + "]" } : new string[3] { "Turn off : [" + text + "]", "Switch target : [LMB]", "Current target : [" + RadarName(mapScreen) + "]" }); HUDManager.Instance.ClearControlTips(); HUDManager.Instance.ChangeControlTipMultiple(array, true, base.itemProperties); } private static string RadarName(ManualCameraRenderer mapScreen) { return (mapScreen.targetTransformIndex < 0 || mapScreen.targetTransformIndex >= mapScreen.radarTargets.Count) ? "None" : (mapScreen.radarTargets[mapScreen.targetTransformIndex].name ?? "None"); } public override void ItemActivate(bool used, bool buttonDown = true) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).ItemActivate(used, buttonDown); if (((NetworkBehaviour)this).IsOwner && turnedOn.Value) { StartOfRound.Instance.mapScreen.SwitchRadarTargetForward(true); TargetSoundServerRpc(); } } public override void ItemInteractLeftRight(bool right) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).ItemInteractLeftRight(right); if (!(!((NetworkBehaviour)this).IsOwner || right) && !waitingForPowerChange) { waitingForPowerChange = true; PowerServerRpc(!turnedOn.Value); } } protected override void __initializeVariables() { if (turnedOn == null) { throw new Exception("HandheldRadar.turnedOn cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)turnedOn).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)turnedOn, "turnedOn"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)turnedOn); ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1470193123u, new RpcReceiveHandler(__rpc_handler_1470193123), "PowerServerRpc"); ((NetworkBehaviour)this).__registerRpc(819753471u, new RpcReceiveHandler(__rpc_handler_819753471), "TargetSoundServerRpc"); ((NetworkBehaviour)this).__registerRpc(3707848663u, new RpcReceiveHandler(__rpc_handler_3707848663), "PlaySoundClientRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_1470193123(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004e: 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_006c: 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(ref flag, default(ForPrimitives)); RpcParams ext = rpcParams.Ext; target.__rpc_exec_stage = (__RpcExecStage)1; ((HandheldRadar)(object)target).PowerServerRpc(flag, ext); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_819753471(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { RpcParams ext = rpcParams.Ext; target.__rpc_exec_stage = (__RpcExecStage)1; ((HandheldRadar)(object)target).TargetSoundServerRpc(ext); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3707848663(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { RadarSound radarSound = default(RadarSound); ((FastBufferReader)(ref reader)).ReadValueSafe(ref radarSound, default(ForEnums)); target.__rpc_exec_stage = (__RpcExecStage)1; ((HandheldRadar)(object)target).PlaySoundClientRpc(radarSound); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "HandheldRadar"; } } public class Missile : NetworkBehaviour { private enum DetonationReason : byte { Collision, EnemyProximity, Timeout } private const float EnemyDetectionRadius = 0.6f; private readonly Collider[] enemyColliders = (Collider[])(object)new Collider[16]; private int enemyLayerMask; private bool hasExploded; private bool explosionStarted; private Rigidbody rb; private float timeAlive; [SerializeField] private int damage = 50; [SerializeField] private float maxDistance = 10f; [SerializeField] private float minDistance; [SerializeField] private float gravity = 2.4f; [SerializeField] private float flightDelay = 0.5f; [SerializeField] private float flightForce = 150f; [SerializeField] private float flightTime = 2f; [SerializeField] private float autoDestroyTime = 3f; [SerializeField] private float LobForce = 100f; [SerializeField] private ParticleSystem particleSystem; private void Awake() { enemyLayerMask = LayerMask.GetMask(new string[1] { "Enemies" }); rb = ((Component)this).GetComponent(); } private void OnCollisionEnter(Collision collision) { if (!hasExploded && !explosionStarted) { Log.Debug("Rocket collided with " + ((Object)collision.collider).name); if (((NetworkBehaviour)this).IsServer) { BeginExplosion(DetonationReason.Collision); } else if (((NetworkBehaviour)this).IsOwner) { BoomServerRpc(DetonationReason.Collision); } } } private void Start() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) rb.useGravity = false; if (((NetworkBehaviour)this).IsHost) { rb.AddForce(((Component)this).transform.forward * LobForce, (ForceMode)1); } } [Rpc(/*Could not decode attribute arguments.*/)] private void BoomClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: 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) { RpcAttributeParams val = new RpcAttributeParams { Delivery = (RpcDelivery)0 }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2537191707u, val3, val, (SendTo)7, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2537191707u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; Boom(); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void BoomServerRpc(DetonationReason reason) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = true, Delivery = (RpcDelivery)0 }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2848693545u, val3, val, (SendTo)2, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref reason, default(ForEnums)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2848693545u, val3, val, (SendTo)2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; BeginExplosion(reason); } } } private void BeginExplosion(DetonationReason reason) { if (!explosionStarted) { explosionStarted = true; if (1 == 0) { } string text = reason switch { DetonationReason.Collision => "a collision", DetonationReason.EnemyProximity => "detecting an enemy", _ => "reaching its timeout", }; if (1 == 0) { } string text2 = text; Log.Debug("Rocket detonated after " + text2); BoomClientRpc(); } } private void Boom() { //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) if (!hasExploded) { hasExploded = true; if ((Object)(object)particleSystem == (Object)null) { Log.Warn("Missile particles are missing"); } else { particleSystem.Stop(true, (ParticleSystemStopBehavior)1); ((Component)particleSystem).transform.SetParent((Transform)null); ((Component)particleSystem).transform.localScale = Vector3.one; GameObject gameObject = ((Component)particleSystem).gameObject; MainModule main = particleSystem.main; float duration = ((MainModule)(ref main)).duration; main = particleSystem.main; MinMaxCurve startLifetime = ((MainModule)(ref main)).startLifetime; Object.Destroy((Object)(object)gameObject, duration + ((MinMaxCurve)(ref startLifetime)).constant); } PlayerControllerB attacker = StartOfRound.Instance.allPlayerScripts[StartOfRound.Instance.ClientPlayerList[((NetworkBehaviour)this).OwnerClientId]]; EXPLOOOOOOOOOOOSIONUtilities.CreateExplosion(((Component)this).transform.position, spawnExplosionEffect: true, damage * 2, Mathf.Max(minDistance, 1.5f), maxDistance * 1.25f, 10, (CauseOfDeath)3, attacker, "Rocket"); if (((NetworkBehaviour)this).IsServer) { ((NetworkBehaviour)this).NetworkObject.Despawn(true); } } } private void FixedUpdate() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_009c: 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_0079: Unknown result type (might be due to invalid IL or missing references) if (!((NetworkBehaviour)this).IsHost) { return; } rb.useGravity = false; rb.AddForce(Vector3.down * gravity); if (timeAlive <= flightTime && timeAlive >= flightDelay) { rb.AddForce(((Component)this).transform.forward * flightForce); } timeAlive += Time.fixedDeltaTime; int num = Physics.OverlapSphereNonAlloc(((Component)this).transform.position, 0.6f, enemyColliders, enemyLayerMask); for (int i = 0; i < num; i++) { Collider val = enemyColliders[i]; if ((Object)(object)val != (Object)null && (((Component)val).CompareTag("Enemy") || (Object)(object)((Component)val).GetComponent() != (Object)null)) { BeginExplosion(DetonationReason.EnemyProximity); return; } } if (timeAlive > autoDestroyTime) { BeginExplosion(DetonationReason.Timeout); } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2537191707u, new RpcReceiveHandler(__rpc_handler_2537191707), "BoomClientRpc"); ((NetworkBehaviour)this).__registerRpc(2848693545u, new RpcReceiveHandler(__rpc_handler_2848693545), "BoomServerRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_2537191707(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; ((Missile)(object)target).BoomClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2848693545(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { DetonationReason reason = default(DetonationReason); ((FastBufferReader)(ref reader)).ReadValueSafe(ref reason, default(ForEnums)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Missile)(object)target).BoomServerRpc(reason); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "Missile"; } } public class Pinger : GrabbableObject { private static readonly int PingHash = Animator.StringToHash("ping"); private static readonly int FireHash = Animator.StringToHash("fire"); private static int renderTextureId; private readonly NetworkVariable turnedOn = new NetworkVariable(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); private RenderTexture renderTexture; private WaitForSeconds pingWait; private Vector3 pingPosition; private NetworkObjectReference pingParent; private int nodeType; private string pingText; private bool isPinging; private bool validPing; private bool waitingForPowerChange; [SerializeField] private Camera renderCamera; [SerializeField] private Material screenMat; [SerializeField] private Light backLight; [SerializeField] private AudioSource audioSource; [SerializeField] private AudioSource audioSourceFar; [Space(6f)] [SerializeField] private Transform UISystem; [SerializeField] private Transform selectionUI; [SerializeField] private Transform pingUI; [SerializeField] private Animator pingAnimator; [SerializeField] private Animator triggerAnimator; [SerializeField] private TextMeshProUGUI selectionString; [SerializeField] private float pingTime = 5f; [SerializeField] private float maxPingDistance = 50f; [SerializeField] private GameObject pingMarkerPrefab; [SerializeField] private AudioClip turnOnClip; [SerializeField] private AudioClip pingClip; [SerializeField] private int noiseRange = 45; [SerializeField] private LayerMask rayMask; private void Awake() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Expected O, but got Unknown //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Expected O, but got Unknown screenMat = new Material(screenMat); renderTexture = new RenderTexture(500, 390, 16, (RenderTextureFormat)0) { name = $"PingerTool({renderTextureId})" }; renderTexture.Create(); UISystem.position = new Vector3(-1000f, -1000f * (float)(renderTextureId + 1), -1000f); renderTextureId++; renderCamera.targetTexture = renderTexture; ((Behaviour)renderCamera).enabled = false; screenMat.mainTexture = (Texture)(object)renderTexture; if (screenMat.HasProperty("_BaseColorMap")) { screenMat.SetTexture("_BaseColorMap", (Texture)(object)renderTexture); } Material[] sharedMaterials = ((Renderer)base.mainObjectRenderer).sharedMaterials; sharedMaterials[1] = screenMat; ((Renderer)base.mainObjectRenderer).sharedMaterials = sharedMaterials; ((Component)selectionUI).gameObject.SetActive(false); ((Component)pingUI).gameObject.SetActive(false); ((Behaviour)backLight).enabled = false; pingWait = new WaitForSeconds(2f); base.itemProperties.requiresBattery = true; base.itemProperties.batteryUsage = float.MaxValue; pingTime = LethalThingsConfig.pingerDuration.Value; maxPingDistance = LethalThingsConfig.pingerRange.Value; } public override void OnNetworkSpawn() { ((NetworkBehaviour)this).OnNetworkSpawn(); NetworkVariable obj = turnedOn; obj.OnValueChanged = (OnValueChangedDelegate)(object)Delegate.Combine((Delegate?)(object)obj.OnValueChanged, (Delegate?)(object)new OnValueChangedDelegate(ShowPower)); ShowPower(_: false, turnedOn.Value); } public override void OnNetworkDespawn() { NetworkVariable obj = turnedOn; obj.OnValueChanged = (OnValueChangedDelegate)(object)Delegate.Remove((Delegate?)(object)obj.OnValueChanged, (Delegate?)(object)new OnValueChangedDelegate(ShowPower)); ((NetworkBehaviour)this).OnNetworkDespawn(); } public override void Update() { //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)this).IsOwner && turnedOn.Value && !waitingForPowerChange) { Battery insertedBattery = base.insertedBattery; if (insertedBattery == null || insertedBattery.empty || base.insertedBattery.charge <= 0f) { waitingForPowerChange = true; PowerServerRpc(on: false); } } if (((NetworkBehaviour)this).IsOwner && turnedOn.Value && !isPinging && Time.frameCount % 20 == 0) { ReadPing(); } ((GrabbableObject)this).Update(); } private void ReadPing() { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_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) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) ((Component)selectionUI).gameObject.SetActive(true); ((Component)pingUI).gameObject.SetActive(false); Camera activeCamera = StartOfRound.Instance.activeCamera; Vector3 forward = ((Component)activeCamera).transform.forward; RaycastHit val = default(RaycastHit); if (!Physics.Raycast(((Component)activeCamera).transform.position + forward, forward, ref val, maxPingDistance, LayerMask.op_Implicit(rayMask), (QueryTriggerInteraction)2)) { ((TMP_Text)selectionString).text = "[No Target]"; validPing = false; pingParent = default(NetworkObjectReference); return; } ((TMP_Text)selectionString).text = "[Unknown Surface]"; nodeType = 0; pingText = "Received Ping"; pingParent = default(NetworkObjectReference); EnemyAI val2 = ((Component)((RaycastHit)(ref val)).collider).GetComponentInParent()?.mainScript ?? ((Component)((RaycastHit)(ref val)).collider).GetComponentInParent(); PlayerControllerB componentInParent = ((Component)((RaycastHit)(ref val)).collider).GetComponentInParent(); if (val2 != null) { NetworkObject networkObject = ((NetworkBehaviour)val2).NetworkObject; if (((networkObject != null) ? new bool?(networkObject.IsSpawned) : ((bool?)null)) == true) { pingParent = NetworkObjectReference.op_Implicit(((NetworkBehaviour)val2).NetworkObject); goto IL_0196; } } if (componentInParent != null) { NetworkObject networkObject2 = ((NetworkBehaviour)componentInParent).NetworkObject; if (((networkObject2 != null) ? new bool?(networkObject2.IsSpawned) : ((bool?)null)) == true) { pingParent = NetworkObjectReference.op_Implicit(((NetworkBehaviour)componentInParent).NetworkObject); } } goto IL_0196; IL_0196: validPing = true; pingPosition = ((RaycastHit)(ref val)).point; Transform val3 = TryFindRoot(((Component)((RaycastHit)(ref val)).collider).transform); if ((Object)(object)val3 == (Object)null) { return; } if ((Object)(object)componentInParent != (Object)null) { ((TMP_Text)selectionString).text = "[" + componentInParent.playerUsername + "]"; pingText = componentInParent.playerUsername; return; } if ((Object)(object)val2 != (Object)null) { ScanNodeProperties componentInChildren = ((Component)val2).GetComponentInChildren(true); string text = componentInChildren?.headerText ?? val2.enemyType.enemyName; ((TMP_Text)selectionString).text = "[" + text + "]"; pingText = text; if ((Object)(object)componentInChildren != (Object)null) { nodeType = componentInChildren.nodeType; } return; } ScanNodeProperties componentInChildren2 = ((Component)val3).GetComponentInChildren(true); if ((Object)(object)componentInChildren2 != (Object)null) { if ((Object)(object)TryFindRoot(((Component)componentInChildren2).transform) == (Object)(object)val3) { ((TMP_Text)selectionString).text = "[" + componentInChildren2.headerText + "]"; nodeType = componentInChildren2.nodeType; pingText = componentInChildren2.headerText; } return; } PlayerControllerB componentInChildren3 = ((Component)val3).GetComponentInChildren(true); if ((Object)(object)componentInChildren3 != (Object)null) { if ((Object)(object)TryFindRoot(((Component)componentInChildren3).transform) == (Object)(object)val3) { ((TMP_Text)selectionString).text = "[" + componentInChildren3.playerUsername + "]"; pingText = componentInChildren3.playerUsername; } return; } DeadBodyInfo componentInChildren4 = ((Component)val3).GetComponentInChildren(true); if ((Object)(object)componentInChildren4 != (Object)null) { if ((Object)(object)TryFindRoot(((Component)componentInChildren4).transform) == (Object)(object)val3) { pingText = componentInChildren4.playerScript.playerUsername + " (Dead)"; ((TMP_Text)selectionString).text = "[" + pingText + "]"; } return; } GrabbableObject componentInChildren5 = ((Component)val3).GetComponentInChildren(true); if ((Object)(object)componentInChildren5 != (Object)null) { if ((Object)(object)TryFindRoot(((Component)componentInChildren5).transform) == (Object)(object)val3 && (Object)(object)componentInChildren5.itemProperties != (Object)null) { ((TMP_Text)selectionString).text = "[" + componentInChildren5.itemProperties.itemName + "]"; pingText = componentInChildren5.itemProperties.itemName; } return; } PlaceableShipObject componentInChildren6 = ((Component)val3).GetComponentInChildren(true); if ((Object)(object)componentInChildren6 != (Object)null && (Object)(object)TryFindRoot(((Component)componentInChildren6).transform) == (Object)(object)val3) { string unlockableName = StartOfRound.Instance.unlockablesList.unlockables[componentInChildren6.unlockableID].unlockableName; ((TMP_Text)selectionString).text = "[" + unlockableName + "]"; pingText = unlockableName; } } private static Transform TryFindRoot(Transform child) { Transform val = child; while ((Object)(object)val != (Object)null) { if ((Object)(object)((Component)val).GetComponent() != (Object)null) { return val; } val = ((Component)val).transform.parent; } return null; } private void ShowPower(bool _, bool on) { //IL_0091: Unknown result type (might be due to invalid IL or missing references) waitingForPowerChange = false; ((Behaviour)renderCamera).enabled = on; ((Behaviour)backLight).enabled = on; ((Component)selectionUI).gameObject.SetActive(on && !isPinging); ((Component)pingUI).gameObject.SetActive(on && isPinging); if (!on) { validPing = false; isPinging = false; base.isBeingUsed = false; RenderTexture active = RenderTexture.active; RenderTexture.active = renderTexture; GL.Clear(true, true, Color.black); RenderTexture.active = active; } if (((NetworkBehaviour)this).IsOwner && (Object)(object)base.playerHeldBy?.currentlyHeldObjectServer == (Object)(object)this) { ((GrabbableObject)this).SetControlTipsForItem(); } } [Rpc(/*Could not decode attribute arguments.*/)] private void PowerServerRpc(bool on, RpcParams rpcParams = default(RpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false, Delivery = (RpcDelivery)0 }; FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2920403597u, rpcParams, val, (SendTo)2, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref on, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2920403597u, rpcParams, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ulong senderClientId = rpcParams.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value) || (Object)(object)StartOfRound.Instance.allPlayerScripts[value].currentlyHeldObjectServer != (Object)(object)this) { return; } if (on) { Battery insertedBattery = base.insertedBattery; if (insertedBattery == null || insertedBattery.empty || base.insertedBattery.charge <= 0f) { return; } } turnedOn.Value = on; if (on) { SoundClientRpc(pingSound: false); } } [Rpc(/*Could not decode attribute arguments.*/)] private void PingServerRpc(Vector3 position, string text, int requestedNodeType, NetworkObjectReference parentReference, RpcParams rpcParams = default(RpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_013a: 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_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false, Delivery = (RpcDelivery)0 }; FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3805145906u, rpcParams, val, (SendTo)2, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref position); bool flag = text != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(text, false); } BytePacker.WriteValueBitPacked(val2, requestedNodeType); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref parentReference, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3805145906u, rpcParams, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ulong senderClientId = rpcParams.Receive.SenderClientId; if (StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { PlayerControllerB val3 = StartOfRound.Instance.allPlayerScripts[value]; if (!((Object)(object)val3.currentlyHeldObjectServer != (Object)(object)this)) { PingClientRpc(position, text, requestedNodeType, val3.playerUsername, parentReference, pingTime); SoundClientRpc(pingSound: true); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void PingClientRpc(Vector3 position, string text, int requestedNodeType, string senderName, NetworkObjectReference parentReference, float duration) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { Delivery = (RpcDelivery)0 }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(4254932948u, val3, val, (SendTo)7, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref position); bool flag = text != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(text, false); } BytePacker.WriteValueBitPacked(val2, requestedNodeType); bool flag2 = senderName != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag2, default(ForPrimitives)); if (flag2) { ((FastBufferWriter)(ref val2)).WriteValueSafe(senderName, false); } ((FastBufferWriter)(ref val2)).WriteValueSafe(ref parentReference, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref duration, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 4254932948u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; GameObject val4 = Object.Instantiate(pingMarkerPrefab, position, Quaternion.identity); NetworkObject val5 = default(NetworkObject); if (((NetworkObjectReference)(ref parentReference)).TryGet(ref val5, (NetworkManager)null)) { val4.transform.SetParent(((Component)val5).transform, true); } ForcedPing forcedPing = default(ForcedPing); if (!val4.TryGetComponent(ref forcedPing)) { Log.Error("Pinger marker component is missing"); Object.Destroy((Object)(object)val4); } else { forcedPing.BeginPing(duration, text, requestedNodeType, "Received from " + senderName); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void SoundClientRpc(bool pingSound) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { Delivery = (RpcDelivery)0 }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(795649747u, val3, val, (SendTo)7, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref pingSound, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 795649747u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; AudioClip val4 = (pingSound ? pingClip : turnOnClip); if (pingSound) { pingAnimator.Play(PingHash); } audioSource.PlayOneShot(val4); audioSourceFar.PlayOneShot(val4); WalkieTalkie.TransmitOneShotAudio(audioSource, val4, 1f); RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, (float)noiseRange, 1f, 0, base.isInElevator && StartOfRound.Instance.hangarDoorsClosed, 0); } } public override void ItemActivate(bool used, bool buttonDown = true) { //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).ItemActivate(used, buttonDown); triggerAnimator.Play(FireHash); if (((NetworkBehaviour)this).IsOwner && turnedOn.Value && validPing && !isPinging) { isPinging = true; PingServerRpc(pingPosition, pingText, nodeType, pingParent); float num = 1f / (float)Mathf.Max(1, LethalThingsConfig.pingerMaxUses.Value); base.insertedBattery.charge = Mathf.Clamp01(base.insertedBattery.charge - num); base.insertedBattery.empty = base.insertedBattery.charge <= 0f; if (base.insertedBattery.empty) { waitingForPowerChange = true; PowerServerRpc(on: false); } ((GrabbableObject)this).SetControlTipsForItem(); ((Component)selectionUI).gameObject.SetActive(false); ((Component)pingUI).gameObject.SetActive(true); ((MonoBehaviour)this).StartCoroutine(WaitForPing()); base.isBeingUsed = true; } } private IEnumerator WaitForPing() { yield return pingWait; base.isBeingUsed = false; isPinging = false; ((Component)selectionUI).gameObject.SetActive(turnedOn.Value); ((Component)pingUI).gameObject.SetActive(false); } public override void SetControlTipsForItem() { string text = InputUtilsCompat.BindingText(InputUtilsCompat.PingerPower); string text2 = (turnedOn.Value ? ("Turn off : [" + text + "]") : ("Turn on : [" + text + "]")); string[] array = ((!turnedOn.Value) ? new string[1] { text2 } : new string[2] { text2, "Ping : [LMB]" }); HUDManager.Instance.ClearControlTips(); HUDManager.Instance.ChangeControlTipMultiple(array, true, base.itemProperties); } public override void DiscardItem() { if ((Object)(object)base.playerHeldBy != (Object)null) { base.playerHeldBy.equippedUsableItemQE = false; base.playerHeldBy.activatingItem = false; } base.isBeingUsed = false; ((GrabbableObject)this).DiscardItem(); } public override void EquipItem() { ((GrabbableObject)this).EquipItem(); base.playerHeldBy.equippedUsableItemQE = false; base.playerHeldBy.activatingItem = false; if (((NetworkBehaviour)this).IsOwner) { ((GrabbableObject)this).SetControlTipsForItem(); } } public override void ItemInteractLeftRight(bool right) { //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).ItemInteractLeftRight(right); if (!((NetworkBehaviour)this).IsOwner || right || waitingForPowerChange) { return; } if (!turnedOn.Value) { Battery insertedBattery = base.insertedBattery; if (insertedBattery == null || insertedBattery.empty || base.insertedBattery.charge <= 0f) { return; } } waitingForPowerChange = true; PowerServerRpc(!turnedOn.Value); } public override void OnDestroy() { renderCamera.targetTexture = null; renderTexture.Release(); Object.Destroy((Object)(object)renderTexture); Object.Destroy((Object)(object)screenMat); ((GrabbableObject)this).OnDestroy(); } protected override void __initializeVariables() { if (turnedOn == null) { throw new Exception("Pinger.turnedOn cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)turnedOn).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)turnedOn, "turnedOn"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)turnedOn); ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2920403597u, new RpcReceiveHandler(__rpc_handler_2920403597), "PowerServerRpc"); ((NetworkBehaviour)this).__registerRpc(3805145906u, new RpcReceiveHandler(__rpc_handler_3805145906), "PingServerRpc"); ((NetworkBehaviour)this).__registerRpc(4254932948u, new RpcReceiveHandler(__rpc_handler_4254932948), "PingClientRpc"); ((NetworkBehaviour)this).__registerRpc(795649747u, new RpcReceiveHandler(__rpc_handler_795649747), "SoundClientRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_2920403597(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004e: 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_006c: 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(ref flag, default(ForPrimitives)); RpcParams ext = rpcParams.Ext; target.__rpc_exec_stage = (__RpcExecStage)1; ((Pinger)(object)target).PowerServerRpc(flag, ext); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3805145906(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0087: 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_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 position = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref position); bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string text = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref text, false); } int requestedNodeType = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref requestedNodeType); NetworkObjectReference parentReference = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref parentReference, default(ForNetworkSerializable)); RpcParams ext = rpcParams.Ext; target.__rpc_exec_stage = (__RpcExecStage)1; ((Pinger)(object)target).PingServerRpc(position, text, requestedNodeType, parentReference, ext); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4254932948(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 position = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref position); bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string text = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref text, false); } int requestedNodeType = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref requestedNodeType); bool flag2 = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag2, default(ForPrimitives)); string senderName = null; if (flag2) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref senderName, false); } NetworkObjectReference parentReference = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref parentReference, default(ForNetworkSerializable)); float duration = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref duration, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Pinger)(object)target).PingClientRpc(position, text, requestedNodeType, senderName, parentReference, duration); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_795649747(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool pingSound = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pingSound, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Pinger)(object)target).SoundClientRpc(pingSound); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "Pinger"; } } public class PouchyBelt : GrabbableObject { [SerializeField] private Transform beltCosmetic; [SerializeField] private Vector3 beltCosmeticPositionOffset = Vector3.zero; [SerializeField] private Vector3 beltCosmeticRotationOffset = Vector3.zero; [SerializeField] private int beltCapacity = 3; private PlayerControllerB previousPlayerHeldBy; private PlayerControllerB slotOwner; private Renderer[] beltRenderers; private bool slotsAdded; private int grabValidatedHash; private string keyboardInteractBinding; private string controllerInteractBinding; private readonly List slotIndexes = new List(); private static bool HasBelt(PlayerControllerB player) { if ((Object)(object)player == (Object)null) { return false; } if (player.ItemOnlySlot is PouchyBelt) { return true; } for (int i = 0; i < player.ItemSlots.Length; i++) { if (player.ItemSlots[i] is PouchyBelt) { return true; } } return false; } private void Awake() { beltRenderers = ((Component)beltCosmetic).GetComponentsInChildren(true); grabValidatedHash = Animator.StringToHash("GrabValidated"); InputUtilsCompat.LTUtilityBeltQuick1.started += InputReceived; InputUtilsCompat.LTUtilityBeltQuick2.started += InputReceived; InputUtilsCompat.LTUtilityBeltQuick3.started += InputReceived; } public override void Start() { ((GrabbableObject)this).Start(); InputAction val = IngamePlayerSettings.Instance.playerInput.actions.FindAction("Interact", false); keyboardInteractBinding = InputActionRebindingExtensions.GetBindingDisplayString(val, 0, (DisplayStringOptions)0); controllerInteractBinding = InputActionRebindingExtensions.GetBindingDisplayString(val, 1, (DisplayStringOptions)0); } private void InputReceived(CallbackContext context) { if (((NetworkBehaviour)this).IsOwner && (Object)(object)base.playerHeldBy != (Object)null && ((CallbackContext)(ref context)).started) { int num = -1; if (((CallbackContext)(ref context)).action == InputUtilsCompat.LTUtilityBeltQuick1) { num = 0; } else if (((CallbackContext)(ref context)).action == InputUtilsCompat.LTUtilityBeltQuick2) { num = 1; } else if (((CallbackContext)(ref context)).action == InputUtilsCompat.LTUtilityBeltQuick3) { num = 2; } if (num != -1 && num < slotIndexes.Count) { SwitchBeltSlot(base.playerHeldBy, slotIndexes[num]); } } } private void SwitchBeltSlot(PlayerControllerB player, int slot) { if (!(player.timeSinceSwitchingSlots < 0.01f) && !player.inTerminalMenu && !player.isGrabbingObjectAnimation && !player.inSpecialInteractAnimation && !player.throwingObject && !player.isTypingChat && !player.twoHanded && !player.activatingItem && !player.jetpackControls && !player.disablingJetpackControls && player.currentItemSlot != slot) { ShipBuildModeManager.Instance.CancelBuildMode(true); player.playerBodyAnimator.SetBool(grabValidatedHash, false); player.SwitchToItemSlot(slot, (GrabbableObject)null); player.SwitchToSlotServerRpc(slot); if ((Object)(object)player.currentlyHeldObjectServer != (Object)null) { ((Component)player.currentlyHeldObjectServer).GetComponent().PlayOneShot(player.currentlyHeldObjectServer.itemProperties.grabSFX, 0.6f); } } } public override void LateUpdate() { //IL_00eb: 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_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).LateUpdate(); bool flag = HasBelt(GameNetworkManager.Instance.localPlayerController); string text = (StartOfRound.Instance.localPlayerUsingController ? controllerInteractBinding : keyboardInteractBinding); base.customGrabTooltip = (flag ? "(Cannot hold more than 1 belt)" : ("Pick up belt : [" + text + "]")); if (!base.isHeld) { base.grabbable = !flag; } if ((Object)(object)previousPlayerHeldBy != (Object)null) { ((Component)beltCosmetic).gameObject.SetActive(true); beltCosmetic.SetParent((Transform)null); Renderer[] array = beltRenderers; foreach (Renderer val in array) { val.enabled = !((NetworkBehaviour)this).IsOwner; } Transform parent = previousPlayerHeldBy.lowerSpine.parent; Transform obj = beltCosmetic; Vector3 val2 = parent.position + beltCosmeticPositionOffset; Quaternion rotation = parent.rotation; obj.SetPositionAndRotation(val2, Quaternion.Euler(((Quaternion)(ref rotation)).eulerAngles + beltCosmeticRotationOffset)); ((Renderer)base.mainObjectRenderer).enabled = false; ((Component)this).gameObject.SetActive(true); } else { ((Component)beltCosmetic).gameObject.SetActive(false); ((Renderer)base.mainObjectRenderer).enabled = true; beltCosmetic.SetParent(((Component)this).transform); } } private void UpdateHUD(bool add) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_004d: 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_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //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_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) slotIndexes.Clear(); HUDManager instance = HUDManager.Instance; if (add) { Image val = instance.itemSlotIconFrames[0]; Image val2 = instance.itemSlotIcons[0]; int num = instance.itemSlotIconFrames.Length; int num2 = Mathf.Min(4, num); float num3 = ((num2 > 1) ? (Mathf.Abs(((Graphic)instance.itemSlotIconFrames[num2 - 1]).rectTransform.anchoredPosition.x - ((Graphic)val).rectTransform.anchoredPosition.x) / (float)(num2 - 1)) : (((Graphic)val).rectTransform.sizeDelta.x + 15f)); float num4 = (((Graphic)val).rectTransform.anchoredPosition.x + ((Graphic)instance.itemSlotIconFrames[num2 - 1]).rectTransform.anchoredPosition.x) / 2f; float num5 = num4 - num3 * (float)(beltCapacity - 1) / 2f; float num6 = ((Graphic)val).rectTransform.anchoredPosition.y + ((Graphic)val).rectTransform.sizeDelta.y + 15f; Vector3 localEulerAngles = ((Transform)((Graphic)val).rectTransform).localEulerAngles; Vector3 localEulerAngles2 = ((Transform)((Graphic)val2).rectTransform).localEulerAngles; List list = instance.itemSlotIconFrames.ToList(); List list2 = instance.itemSlotIcons.ToList(); int count = list.Count; for (int i = 0; i < beltCapacity; i++) { Image val3 = list[0]; Image val4 = Object.Instantiate(val3, ((Component)val).transform.parent); ((Object)val4).name = $"Slot{num + i}[LethalThingsBelt]"; ((Graphic)val4).rectTransform.anchoredPosition = new Vector2(num5 + (float)i * num3, num6); ((Transform)((Graphic)val4).rectTransform).eulerAngles = localEulerAngles; Image component = ((Component)((Component)val4).transform.GetChild(0)).GetComponent(); ((Object)component).name = "icon"; ((Behaviour)component).enabled = false; ((Transform)((Graphic)component).rectTransform).eulerAngles = localEulerAngles2; ((Transform)((Graphic)component).rectTransform).Rotate(new Vector3(0f, 0f, -90f)); int num7 = count + i; list.Insert(num7, val4); list2.Insert(num7, component); slotIndexes.Add(num7); ((Component)val4).transform.SetSiblingIndex(num7); } instance.itemSlotIconFrames = list.ToArray(); instance.itemSlotIcons = list2.ToArray(); return; } List list3 = instance.itemSlotIconFrames.ToList(); List list4 = instance.itemSlotIcons.ToList(); int count2 = list3.Count; int num8 = 0; for (int num9 = count2 - 1; num9 >= 0; num9--) { if (((Object)list3[num9]).name.Contains("[LethalThingsBelt]")) { num8++; Image val5 = list3[num9]; list3.RemoveAt(num9); list4.RemoveAt(num9); Object.Destroy((Object)(object)((Component)val5).gameObject); if (num8 >= beltCapacity) { break; } } } instance.itemSlotIconFrames = list3.ToArray(); instance.itemSlotIcons = list4.ToArray(); } private void AddItemSlots() { if (!slotsAdded && !((Object)(object)base.playerHeldBy == (Object)null)) { slotOwner = base.playerHeldBy; slotsAdded = true; GrabbableObject[] itemSlots = slotOwner.ItemSlots; GrabbableObject[] array = (GrabbableObject[])(object)new GrabbableObject[itemSlots.Length + beltCapacity]; Array.Copy(itemSlots, array, itemSlots.Length); slotOwner.ItemSlots = array; if ((Object)(object)slotOwner == (Object)(object)GameNetworkManager.Instance.localPlayerController) { UpdateHUD(add: true); } } } private void RemoveItemSlots() { //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) if (!slotsAdded || (Object)(object)slotOwner == (Object)null) { return; } int num = slotOwner.ItemSlots.Length - beltCapacity; int currentItemSlot = slotOwner.currentItemSlot; for (int i = 0; i < beltCapacity; i++) { GrabbableObject val = slotOwner.ItemSlots[num + i]; if ((Object)(object)val != (Object)null && ((NetworkBehaviour)this).IsOwner) { DropBeltItemServerRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)val).NetworkObject), slotOwner.playerClientId, slotOwner.serverItemHolder.position); } } int slot = ((currentItemSlot < num) ? currentItemSlot : 0); GrabbableObject[] itemSlots = slotOwner.ItemSlots; GrabbableObject[] array = (GrabbableObject[])(object)new GrabbableObject[num]; Array.Copy(itemSlots, array, num); slotOwner.ItemSlots = array; if ((Object)(object)slotOwner == (Object)(object)GameNetworkManager.Instance.localPlayerController) { UpdateHUD(add: false); } if (((NetworkBehaviour)slotOwner).IsOwner) { SwitchBeltSlot(slotOwner, slot); } slotsAdded = false; slotOwner = null; } [Rpc(/*Could not decode attribute arguments.*/)] private void DropBeltItemServerRpc(NetworkObjectReference itemReference, ulong playerId, Vector3 dropPosition, RpcParams rpcParams = default(RpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: 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_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = true, Delivery = (RpcDelivery)0 }; FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(832468623u, rpcParams, val, (SendTo)2, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref itemReference, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val2, playerId); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref dropPosition); ((NetworkBehaviour)this).__endSendRpc(ref val2, 832468623u, rpcParams, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(rpcParams.Receive.SenderClientId, out var value) || !((NetworkObjectReference)(ref itemReference)).TryGet(ref val3, (NetworkManager)null)) { return; } GrabbableObject component = ((Component)val3).GetComponent(); if (component == null) { return; } PlayerControllerB val4 = StartOfRound.Instance.allPlayerScripts[value]; if ((Object)(object)val4.currentlyHeldObjectServer != (Object)(object)this || val4.playerClientId != playerId) { return; } bool flag = false; for (int i = 0; i < val4.ItemSlots.Length; i++) { if (!((Object)(object)val4.ItemSlots[i] != (Object)(object)component)) { flag = true; break; } } if (flag) { DropBeltItemClientRpc(itemReference, playerId, dropPosition); } } [Rpc(/*Could not decode attribute arguments.*/)] private void DropBeltItemClientRpc(NetworkObjectReference itemReference, ulong playerId, Vector3 dropPosition) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0091: 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_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { Delivery = (RpcDelivery)0 }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2066375460u, val3, val, (SendTo)7, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref itemReference, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val2, playerId); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref dropPosition); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2066375460u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val4 = default(NetworkObject); if (((NetworkObjectReference)(ref itemReference)).TryGet(ref val4, (NetworkManager)null)) { GrabbableObject component = ((Component)val4).GetComponent(); if (!((Object)(object)component == (Object)null) && StartOfRound.Instance.ClientPlayerList.TryGetValue(playerId, out var value)) { PlayerControllerB val5 = StartOfRound.Instance.allPlayerScripts[value]; Transform val6 = (val5.isInElevator ? val5.playersManager.elevatorTransform : val5.playersManager.propsContainer); ((Component)component).transform.SetParent(val6, true); ((Component)component).transform.position = dropPosition; Vector3 val7 = val6.InverseTransformPoint(component.GetItemFloorPosition(dropPosition)); val5.SetObjectAsNoLongerHeld(val5.isInElevator, val5.isInHangarShipRoom, val7, component, (int)((Component)val5).transform.localEulerAngles.y); component.EnableItemMeshes(true); component.DiscardItem(); Log.Debug("Utility belt item dropped"); } } } public override void DiscardItem() { RemoveItemSlots(); previousPlayerHeldBy = null; ((GrabbableObject)this).DiscardItem(); } public override void OnNetworkDespawn() { RemoveItemSlots(); previousPlayerHeldBy = null; ((NetworkBehaviour)this).OnNetworkDespawn(); } public override void OnDestroy() { InputUtilsCompat.LTUtilityBeltQuick1.started -= InputReceived; InputUtilsCompat.LTUtilityBeltQuick2.started -= InputReceived; InputUtilsCompat.LTUtilityBeltQuick3.started -= InputReceived; ((GrabbableObject)this).OnDestroy(); } public override void EquipItem() { ((GrabbableObject)this).EquipItem(); if ((Object)(object)base.playerHeldBy != (Object)null) { if ((Object)(object)base.playerHeldBy != (Object)(object)previousPlayerHeldBy) { AddItemSlots(); } previousPlayerHeldBy = base.playerHeldBy; } } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(832468623u, new RpcReceiveHandler(__rpc_handler_832468623), "DropBeltItemServerRpc"); ((NetworkBehaviour)this).__registerRpc(2066375460u, new RpcReceiveHandler(__rpc_handler_2066375460), "DropBeltItemClientRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_832468623(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: 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_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_007f: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference itemReference = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref itemReference, default(ForNetworkSerializable)); ulong playerId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); Vector3 dropPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref dropPosition); RpcParams ext = rpcParams.Ext; target.__rpc_exec_stage = (__RpcExecStage)1; ((PouchyBelt)(object)target).DropBeltItemServerRpc(itemReference, playerId, dropPosition, ext); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2066375460(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference itemReference = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref itemReference, default(ForNetworkSerializable)); ulong playerId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); Vector3 dropPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref dropPosition); target.__rpc_exec_stage = (__RpcExecStage)1; ((PouchyBelt)(object)target).DropBeltItemClientRpc(itemReference, playerId, dropPosition); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "PouchyBelt"; } } public class ProjectileWeapon : GrabbableObject { private const int UtilitySlot = 50; private static readonly int ReloadHash = Animator.StringToHash("reload"); private static readonly int FireHash = Animator.StringToHash("fire"); private readonly NetworkVariable currentAmmo = new NetworkVariable(4, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); [SerializeField] private AudioSource mainAudio; [SerializeField] private AudioClip[] activateClips; [SerializeField] private AudioClip[] noAmmoSounds; [SerializeField] private AudioClip[] reloadSounds; [SerializeField] private Transform aimDirection; [SerializeField] private int maxAmmo = 4; [SerializeField] private GameObject projectilePrefab; [SerializeField] private float LobForce = 100f; [SerializeField] private Animator Animator; [SerializeField] private ParticleSystem particleSystem; [SerializeField] private Item ammoItem; private int loadedAmmo = -1; private int lastShownAmmo = -1; private int lastAmmoSlot = -2; private string reloadBinding; internal GameObject ProjectilePrefab => projectilePrefab; public override int GetItemDataToSave() { return Mathf.Clamp(currentAmmo.Value, 0, maxAmmo); } public override void LoadItemSaveData(int saveData) { loadedAmmo = Mathf.Clamp(saveData, 0, maxAmmo); if (((NetworkBehaviour)this).IsSpawned && ((NetworkBehaviour)this).IsServer) { currentAmmo.Value = loadedAmmo; } } public override void Start() { ((GrabbableObject)this).Start(); reloadBinding = InputUtilsCompat.BindingText(InputUtilsCompat.FlaregunReload); } public override void OnNetworkSpawn() { ((NetworkBehaviour)this).OnNetworkSpawn(); NetworkVariable obj = currentAmmo; obj.OnValueChanged = (OnValueChangedDelegate)(object)Delegate.Combine((Delegate?)(object)obj.OnValueChanged, (Delegate?)(object)new OnValueChangedDelegate(AmmoChanged)); if (((NetworkBehaviour)this).IsServer) { currentAmmo.Value = ((loadedAmmo >= 0) ? loadedAmmo : maxAmmo); } } public override void OnNetworkDespawn() { NetworkVariable obj = currentAmmo; obj.OnValueChanged = (OnValueChangedDelegate)(object)Delegate.Remove((Delegate?)(object)obj.OnValueChanged, (Delegate?)(object)new OnValueChangedDelegate(AmmoChanged)); ((NetworkBehaviour)this).OnNetworkDespawn(); } private void AmmoChanged(int _, int __) { if (((NetworkBehaviour)this).IsOwner && (Object)(object)base.playerHeldBy?.currentlyHeldObjectServer == (Object)(object)this) { ((GrabbableObject)this).SetControlTipsForItem(); } } public override void ItemActivate(bool used, bool buttonDown = true) { //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).ItemActivate(used, buttonDown); if (currentAmmo.Value <= 0) { PlayRandomAudio(mainAudio, noAmmoSounds); return; } if (((NetworkBehaviour)this).IsServer) { NetworkVariable obj = currentAmmo; int value = obj.Value; obj.Value = value - 1; } PlayRandomAudio(mainAudio, activateClips); Animator.Play(FireHash); particleSystem.Play(); if (((NetworkBehaviour)this).IsOwner) { if (((NetworkBehaviour)this).IsServer) { SpawnProjectile(aimDirection.position, aimDirection.rotation, ((NetworkBehaviour)this).OwnerClientId); } else { SpawnProjectileServerRpc(aimDirection.position, aimDirection.rotation); } } } private int FindAmmoInInventory() { if ((Object)(object)base.playerHeldBy == (Object)null) { return -1; } for (int i = 0; i < base.playerHeldBy.ItemSlots.Length; i++) { if (IsAmmo(base.playerHeldBy.ItemSlots[i])) { return i; } } return IsAmmo(base.playerHeldBy.ItemOnlySlot) ? 50 : (-1); } private bool IsAmmo(GrabbableObject item) { return (Object)(object)item?.itemProperties != (Object)null && ((Object)(object)item.itemProperties == (Object)(object)ammoItem || (ammoItem.itemId >= 0 && item.itemProperties.itemId == ammoItem.itemId)); } public override void ItemInteractLeftRight(bool right) { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).ItemInteractLeftRight(right); if (!right && ((NetworkBehaviour)this).IsOwner && currentAmmo.Value < maxAmmo) { int num = FindAmmoInInventory(); if (num != -1) { ReloadAmmoServerRpc(num); } else { HUDManager.Instance.DisplayTip("No ammo found.", "Buy " + ammoItem.itemName + " from the Terminal to reload.", false, false, "LC_Tip1"); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void ReloadAmmoServerRpc(int ammoSlot, RpcParams rpcParams = default(RpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false, Delivery = (RpcDelivery)0 }; FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3764303945u, rpcParams, val, (SendTo)2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, ammoSlot); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3764303945u, rpcParams, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(rpcParams.Receive.SenderClientId, out var value)) { return; } PlayerControllerB val3 = StartOfRound.Instance.allPlayerScripts[value]; if (!((Object)(object)val3.currentlyHeldObjectServer != (Object)(object)this) && currentAmmo.Value < maxAmmo && (ammoSlot == 50 || (ammoSlot >= 0 && ammoSlot < val3.ItemSlots.Length))) { GrabbableObject item = ((ammoSlot == 50) ? val3.ItemOnlySlot : val3.ItemSlots[ammoSlot]); if (IsAmmo(item)) { currentAmmo.Value = maxAmmo; ReloadAmmoClientRpc(rpcParams.Receive.SenderClientId, ammoSlot); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void ReloadAmmoClientRpc(ulong ownerClientId, int ammoSlot) { //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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: 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_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { Delivery = (RpcDelivery)0 }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(508702097u, val3, val, (SendTo)7, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, ownerClientId); BytePacker.WriteValueBitPacked(val2, ammoSlot); ((NetworkBehaviour)this).__endSendRpc(ref val2, 508702097u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlayRandomAudio(mainAudio, reloadSounds); Animator.Play(ReloadHash); PlayerControllerB val4 = GameNetworkManager.Instance?.localPlayerController; if ((Object)(object)val4 == (Object)null || val4.actualClientId != ownerClientId || (ammoSlot != 50 && (ammoSlot < 0 || ammoSlot >= val4.ItemSlots.Length))) { return; } GrabbableObject item = ((ammoSlot == 50) ? val4.ItemOnlySlot : val4.ItemSlots[ammoSlot]); if (IsAmmo(item)) { val4.DestroyItemInSlotAndSync(ammoSlot); if ((Object)(object)val4.currentlyHeldObjectServer == (Object)(object)this) { ((GrabbableObject)this).SetControlTipsForItem(); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void SpawnProjectileServerRpc(Vector3 aimPosition, Quaternion aimRotation, RpcParams rpcParams = default(RpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false, Delivery = (RpcDelivery)0 }; FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(742340487u, rpcParams, val, (SendTo)2, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref aimPosition); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref aimRotation); ((NetworkBehaviour)this).__endSendRpc(ref val2, 742340487u, rpcParams, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (StartOfRound.Instance.ClientPlayerList.TryGetValue(rpcParams.Receive.SenderClientId, out var value) && !((Object)(object)StartOfRound.Instance.allPlayerScripts[value].currentlyHeldObjectServer != (Object)(object)this)) { SpawnProjectile(aimPosition, aimRotation, rpcParams.Receive.SenderClientId); } } } private void SpawnProjectile(Vector3 aimPosition, Quaternion aimRotation, ulong ownerClientId) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) GameObject val = Object.Instantiate(projectilePrefab, aimPosition, aimRotation); NetworkObject component = val.GetComponent(); component.SpawnWithOwnership(ownerClientId, false); LaunchProjectileClientRpc(NetworkObjectReference.op_Implicit(component), aimPosition, aimRotation); } [Rpc(/*Could not decode attribute arguments.*/)] private void LaunchProjectileClientRpc(NetworkObjectReference projectile, Vector3 aimPosition, Quaternion aimRotation) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { Delivery = (RpcDelivery)0 }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1582707981u, val3, val, (SendTo)7, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref projectile, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref aimPosition); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref aimRotation); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1582707981u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val4 = default(NetworkObject); if (((NetworkObjectReference)(ref projectile)).TryGet(ref val4, (NetworkManager)null)) { Transform transform = ((Component)val4).transform; transform.SetPositionAndRotation(aimPosition, aimRotation); ((Component)val4).GetComponent().AddForce(transform.forward * LobForce, (ForceMode)1); } } } private void PlayRandomAudio(AudioSource audioSource, AudioClip[] audioClips) { if (audioClips.Length != 0) { audioSource.PlayOneShot(audioClips[Random.Range(0, audioClips.Length)]); } } public override void Update() { ((GrabbableObject)this).Update(); if (((NetworkBehaviour)this).IsOwner && !((Object)(object)base.playerHeldBy?.currentlyHeldObjectServer != (Object)(object)this)) { int num = FindAmmoInInventory(); if (currentAmmo.Value != lastShownAmmo || num != lastAmmoSlot) { ((GrabbableObject)this).SetControlTipsForItem(); } } } public override void PocketItem() { ((GrabbableObject)this).PocketItem(); if ((Object)(object)base.playerHeldBy != (Object)null) { base.playerHeldBy.equippedUsableItemQE = false; } } public override void DiscardItem() { ((GrabbableObject)this).DiscardItem(); if ((Object)(object)base.playerHeldBy != (Object)null) { base.playerHeldBy.equippedUsableItemQE = false; } } public override void EquipItem() { ((GrabbableObject)this).EquipItem(); base.playerHeldBy.equippedUsableItemQE = false; } public override void SetControlTipsForItem() { lastShownAmmo = currentAmmo.Value; lastAmmoSlot = FindAmmoInInventory(); string text = ((currentAmmo.Value >= maxAmmo) ? "Ammo full" : ((currentAmmo.Value <= 0) ? ((lastAmmoSlot != -1) ? $"Reload [0/{maxAmmo}] : [{reloadBinding}]" : "No flares") : $"Ammo [{currentAmmo.Value}/{maxAmmo}]")); HUDManager.Instance.ClearControlTips(); HUDManager.Instance.ChangeControlTipMultiple(new string[2] { "Fire : [LMB]", text }, true, base.itemProperties); } protected override void __initializeVariables() { if (currentAmmo == null) { throw new Exception("ProjectileWeapon.currentAmmo cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)currentAmmo).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)currentAmmo, "currentAmmo"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)currentAmmo); ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(3764303945u, new RpcReceiveHandler(__rpc_handler_3764303945), "ReloadAmmoServerRpc"); ((NetworkBehaviour)this).__registerRpc(508702097u, new RpcReceiveHandler(__rpc_handler_508702097), "ReloadAmmoClientRpc"); ((NetworkBehaviour)this).__registerRpc(742340487u, new RpcReceiveHandler(__rpc_handler_742340487), "SpawnProjectileServerRpc"); ((NetworkBehaviour)this).__registerRpc(1582707981u, new RpcReceiveHandler(__rpc_handler_1582707981), "LaunchProjectileClientRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_3764303945(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int ammoSlot = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref ammoSlot); RpcParams ext = rpcParams.Ext; target.__rpc_exec_stage = (__RpcExecStage)1; ((ProjectileWeapon)(object)target).ReloadAmmoServerRpc(ammoSlot, ext); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_508702097(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong ownerClientId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref ownerClientId); int ammoSlot = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref ammoSlot); target.__rpc_exec_stage = (__RpcExecStage)1; ((ProjectileWeapon)(object)target).ReloadAmmoClientRpc(ownerClientId, ammoSlot); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_742340487(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 aimPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref aimPosition); Quaternion aimRotation = default(Quaternion); ((FastBufferReader)(ref reader)).ReadValueSafe(ref aimRotation); RpcParams ext = rpcParams.Ext; target.__rpc_exec_stage = (__RpcExecStage)1; ((ProjectileWeapon)(object)target).SpawnProjectileServerRpc(aimPosition, aimRotation, ext); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1582707981(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_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference projectile = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref projectile, default(ForNetworkSerializable)); Vector3 aimPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref aimPosition); Quaternion aimRotation = default(Quaternion); ((FastBufferReader)(ref reader)).ReadValueSafe(ref aimRotation); target.__rpc_exec_stage = (__RpcExecStage)1; ((ProjectileWeapon)(object)target).LaunchProjectileClientRpc(projectile, aimPosition, aimRotation); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "ProjectileWeapon"; } } public class RocketLauncher : GrabbableObject { private const int UtilitySlot = 50; private const float LaserDistance = 10f; private const int LaserMask = 605030721; private static readonly int FireHash = Animator.StringToHash("fire"); private readonly NetworkVariable currentAmmo = new NetworkVariable(4, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); private readonly NetworkVariable isLaserOn = new NetworkVariable(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); [SerializeField] private Light laserPointer; [SerializeField] private AudioSource mainAudio; [SerializeField] private AudioClip[] activateClips; [SerializeField] private AudioClip[] noAmmoSounds; [SerializeField] private AudioClip reloadSound; [SerializeField] private Transform aimDirection; [SerializeField] private int maxAmmo = 4; [SerializeField] private GameObject missilePrefab; [SerializeField] private Animator Animator; [SerializeField] private ParticleSystem particleSystem; [SerializeField] private LineRenderer laserLine; private Material[] ammoLampMaterials; private Item rocketItem; private Transform laserRoot; private Transform laserPointerTransform; private int loadedAmmo = -1; private int lastShownAmmo = -1; private int lastRocketSlot = -2; private float lastLocalReloadTime = float.NegativeInfinity; private float lastServerReloadTime = float.NegativeInfinity; private float fireReadyTime; private string laserBinding; private string reloadBinding; internal GameObject MissilePrefab => missilePrefab; private void Awake() { base.mainObjectRenderer = ((Component)this).GetComponentInChildren(); Material[] materials = ((Renderer)base.mainObjectRenderer).materials; ammoLampMaterials = (Material[])(object)new Material[Mathf.Max(0, materials.Length - 1)]; if (ammoLampMaterials.Length != 0) { Array.Copy(materials, 1, ammoLampMaterials, 0, ammoLampMaterials.Length); } rocketItem = ((Registry)(object)LethalContent.Items)[Keys.Rocket].Item; laserRoot = ((Component)laserLine).transform.parent; laserPointerTransform = ((Component)laserPointer).transform; } public override void Start() { ((GrabbableObject)this).Start(); laserBinding = InputUtilsCompat.BindingText(InputUtilsCompat.RocketLauncherLaser); reloadBinding = InputUtilsCompat.BindingText(InputUtilsCompat.RocketLauncherReload); ShowAmmo(); } public override int GetItemDataToSave() { return Mathf.Clamp(currentAmmo.Value, 0, maxAmmo); } public override void LoadItemSaveData(int saveData) { loadedAmmo = Mathf.Clamp(saveData, 0, maxAmmo); if (((NetworkBehaviour)this).IsSpawned && ((NetworkBehaviour)this).IsServer) { currentAmmo.Value = loadedAmmo; } } public override void OnNetworkSpawn() { ((NetworkBehaviour)this).OnNetworkSpawn(); NetworkVariable obj = currentAmmo; obj.OnValueChanged = (OnValueChangedDelegate)(object)Delegate.Combine((Delegate?)(object)obj.OnValueChanged, (Delegate?)(object)new OnValueChangedDelegate(AmmoChanged)); NetworkVariable obj2 = isLaserOn; obj2.OnValueChanged = (OnValueChangedDelegate)(object)Delegate.Combine((Delegate?)(object)obj2.OnValueChanged, (Delegate?)(object)new OnValueChangedDelegate(LaserChanged)); ((Behaviour)laserPointer).enabled = isLaserOn.Value; ((Renderer)laserLine).enabled = isLaserOn.Value; if (((NetworkBehaviour)this).IsServer) { currentAmmo.Value = ((loadedAmmo >= 0) ? loadedAmmo : maxAmmo); } } public override void OnNetworkDespawn() { NetworkVariable obj = currentAmmo; obj.OnValueChanged = (OnValueChangedDelegate)(object)Delegate.Remove((Delegate?)(object)obj.OnValueChanged, (Delegate?)(object)new OnValueChangedDelegate(AmmoChanged)); NetworkVariable obj2 = isLaserOn; obj2.OnValueChanged = (OnValueChangedDelegate)(object)Delegate.Remove((Delegate?)(object)obj2.OnValueChanged, (Delegate?)(object)new OnValueChangedDelegate(LaserChanged)); ((NetworkBehaviour)this).OnNetworkDespawn(); } private void AmmoChanged(int _, int __) { ShowAmmo(); if (((NetworkBehaviour)this).IsOwner && (Object)(object)base.playerHeldBy?.currentlyHeldObjectServer == (Object)(object)this) { ((GrabbableObject)this).SetControlTipsForItem(); } } private void LaserChanged(bool _, bool laserOn) { ((Behaviour)laserPointer).enabled = laserOn; ((Renderer)laserLine).enabled = laserOn; if (((NetworkBehaviour)this).IsOwner && (Object)(object)base.playerHeldBy?.currentlyHeldObjectServer == (Object)(object)this) { ((GrabbableObject)this).SetControlTipsForItem(); } } private void ShowAmmo() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < ammoLampMaterials.Length; i++) { Color val = ((i < currentAmmo.Value) ? Color.green : Color.red); ammoLampMaterials[i].SetColor("_BaseColor", val); ammoLampMaterials[i].SetColor("_EmissiveColor", val); } } public override void Update() { ((GrabbableObject)this).Update(); if (((NetworkBehaviour)this).IsOwner && !((Object)(object)base.playerHeldBy?.currentlyHeldObjectServer != (Object)(object)this)) { int num = RocketSlot(); if (currentAmmo.Value != lastShownAmmo || num != lastRocketSlot) { ((GrabbableObject)this).SetControlTipsForItem(); } } } public override void ItemActivate(bool used, bool buttonDown = true) { //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).ItemActivate(used, buttonDown); if (Time.time < fireReadyTime || (Object)(object)base.playerHeldBy == (Object)null) { return; } if (currentAmmo.Value <= 0) { if (noAmmoSounds.Length != 0) { mainAudio.PlayOneShot(noAmmoSounds[Random.Range(0, noAmmoSounds.Length)]); } return; } if (activateClips.Length != 0) { mainAudio.PlayOneShot(activateClips[Random.Range(0, activateClips.Length)]); } Animator.Play(FireHash); particleSystem.Play(); if (((NetworkBehaviour)this).IsOwner) { Vector3 forward = ((Component)base.playerHeldBy.gameplayCamera).transform.forward; Vector3 normalized = ((Vector3)(ref forward)).normalized; if (((NetworkBehaviour)this).IsServer) { NetworkVariable obj = currentAmmo; int value = obj.Value; obj.Value = value - 1; SpawnMissile(aimDirection.position, Quaternion.LookRotation(normalized, Vector3.up), base.playerHeldBy.actualClientId); } else { SpawnMissileServerRpc(aimDirection.position, normalized); } } } public override void ItemInteractLeftRight(bool right) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).ItemInteractLeftRight(right); if (!right && ((NetworkBehaviour)this).IsOwner) { SetLaserServerRpc(!isLaserOn.Value); } } [Rpc(/*Could not decode attribute arguments.*/)] private void SetLaserServerRpc(bool laserOn, RpcParams rpcParams = default(RpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false, Delivery = (RpcDelivery)0 }; FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1506048930u, rpcParams, val, (SendTo)2, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref laserOn, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1506048930u, rpcParams, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (StartOfRound.Instance.ClientPlayerList.TryGetValue(rpcParams.Receive.SenderClientId, out var value) && !((Object)(object)StartOfRound.Instance.allPlayerScripts[value].currentlyHeldObjectServer != (Object)(object)this)) { isLaserOn.Value = laserOn; } } } [Rpc(/*Could not decode attribute arguments.*/)] private void SpawnMissileServerRpc(Vector3 aimPosition, Vector3 fireDirection, RpcParams rpcParams = default(RpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false, Delivery = (RpcDelivery)0 }; FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2805882054u, rpcParams, val, (SendTo)2, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref aimPosition); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref fireDirection); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2805882054u, rpcParams, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (StartOfRound.Instance.ClientPlayerList.TryGetValue(rpcParams.Receive.SenderClientId, out var value) && currentAmmo.Value > 0 && !(Time.time < fireReadyTime) && !(((Vector3)(ref fireDirection)).sqrMagnitude < 0.9f)) { PlayerControllerB val3 = StartOfRound.Instance.allPlayerScripts[value]; if (!((Object)(object)val3.currentlyHeldObjectServer != (Object)(object)this)) { NetworkVariable obj = currentAmmo; int value2 = obj.Value; obj.Value = value2 - 1; SpawnMissile(aimPosition, Quaternion.LookRotation(((Vector3)(ref fireDirection)).normalized, Vector3.up), rpcParams.Receive.SenderClientId); } } } public void Reload() { //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB playerHeldBy = base.playerHeldBy; if (playerHeldBy != null && ((NetworkBehaviour)playerHeldBy).IsOwner && !((Object)(object)base.playerHeldBy.currentlyHeldObjectServer != (Object)(object)this) && currentAmmo.Value < maxAmmo && !(Time.time - lastLocalReloadTime < 0.5f)) { int num = RocketSlot(); if (num == -1) { HUDManager.Instance.DisplayTip("No ammo found.", "Buy " + rocketItem.itemName + " from the Terminal to reload.", false, false, "LC_Tip1"); return; } lastLocalReloadTime = Time.time; ReloadServerRpc(num); } } [Rpc(/*Could not decode attribute arguments.*/)] private void ReloadServerRpc(int rocketSlot, RpcParams rpcParams = default(RpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false, Delivery = (RpcDelivery)0 }; FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1899860777u, rpcParams, val, (SendTo)2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, rocketSlot); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1899860777u, rpcParams, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(rpcParams.Receive.SenderClientId, out var value)) { return; } PlayerControllerB val3 = StartOfRound.Instance.allPlayerScripts[value]; if (currentAmmo.Value < maxAmmo && !(Time.time - lastServerReloadTime < 0.5f) && !((Object)(object)val3.currentlyHeldObjectServer != (Object)(object)this) && (rocketSlot == 50 || (rocketSlot >= 0 && rocketSlot < val3.ItemSlots.Length))) { GrabbableObject item = ((rocketSlot == 50) ? val3.ItemOnlySlot : val3.ItemSlots[rocketSlot]); if (IsRocket(item)) { lastServerReloadTime = Time.time; NetworkVariable obj = currentAmmo; int value2 = obj.Value; obj.Value = value2 + 1; ReloadClientRpc(rpcParams.Receive.SenderClientId, rocketSlot); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void ReloadClientRpc(ulong ownerClientId, int rocketSlot) { //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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: 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_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { Delivery = (RpcDelivery)0 }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(238633276u, val3, val, (SendTo)7, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, ownerClientId); BytePacker.WriteValueBitPacked(val2, rocketSlot); ((NetworkBehaviour)this).__endSendRpc(ref val2, 238633276u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if ((Object)(object)reloadSound != (Object)null) { mainAudio.PlayOneShot(reloadSound); } PlayerControllerB val4 = GameNetworkManager.Instance?.localPlayerController; if ((Object)(object)val4 == (Object)null || val4.actualClientId != ownerClientId || (rocketSlot != 50 && (rocketSlot < 0 || rocketSlot >= val4.ItemSlots.Length))) { return; } GrabbableObject item = ((rocketSlot == 50) ? val4.ItemOnlySlot : val4.ItemSlots[rocketSlot]); if (IsRocket(item)) { val4.DestroyItemInSlotAndSync(rocketSlot); if ((Object)(object)val4.currentlyHeldObjectServer == (Object)(object)this) { ((GrabbableObject)this).SetControlTipsForItem(); } } } private int RocketSlot() { if ((Object)(object)base.playerHeldBy == (Object)null) { return -1; } for (int i = 0; i < base.playerHeldBy.ItemSlots.Length; i++) { if (IsRocket(base.playerHeldBy.ItemSlots[i])) { return i; } } return IsRocket(base.playerHeldBy.ItemOnlySlot) ? 50 : (-1); } private bool IsRocket(GrabbableObject item) { return (Object)(object)item?.itemProperties == (Object)(object)rocketItem; } private void SpawnMissile(Vector3 aimPosition, Quaternion aimRotation, ulong missileOwner) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) GameObject val = Object.Instantiate(missilePrefab, aimPosition, aimRotation); val.GetComponent().SpawnWithOwnership(missileOwner, false); } public override void LateUpdate() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).LateUpdate(); if (isLaserOn.Value) { RaycastHit val2 = default(RaycastHit); Vector3 val = (Physics.Raycast(laserRoot.position, aimDirection.forward, ref val2, 10f, 605030721) ? ((RaycastHit)(ref val2)).point : (laserRoot.position + aimDirection.forward * 10f)); laserPointerTransform.position = val; laserLine.SetPosition(0, laserRoot.position); laserLine.SetPosition(1, val); } } public override void PocketItem() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)this).IsServer) { isLaserOn.Value = false; } else if (((NetworkBehaviour)this).IsOwner) { SetLaserServerRpc(laserOn: false); } ((GrabbableObject)this).PocketItem(); if ((Object)(object)base.playerHeldBy != (Object)null) { base.playerHeldBy.equippedUsableItemQE = false; } } public override void DiscardItem() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)this).IsServer) { isLaserOn.Value = false; } else if (((NetworkBehaviour)this).IsOwner) { SetLaserServerRpc(laserOn: false); } ((GrabbableObject)this).DiscardItem(); if ((Object)(object)base.playerHeldBy != (Object)null) { base.playerHeldBy.equippedUsableItemQE = false; } } public override void EquipItem() { ((GrabbableObject)this).EquipItem(); float num = ((base.itemProperties.grabAnimationTime > 0f) ? base.itemProperties.grabAnimationTime : 0.4f); fireReadyTime = Time.time + num; if ((Object)(object)base.playerHeldBy != (Object)null) { base.playerHeldBy.equippedUsableItemQE = false; } } public override void SetControlTipsForItem() { lastShownAmmo = currentAmmo.Value; lastRocketSlot = RocketSlot(); string text = ((currentAmmo.Value < maxAmmo) ? ((currentAmmo.Value <= 0 && lastRocketSlot == -1) ? "No rockets" : $"Reload [{currentAmmo.Value}/{maxAmmo}] : [{reloadBinding}]") : "Ammo full"); HUDManager.Instance.ClearControlTips(); HUDManager.Instance.ChangeControlTipMultiple(new string[3] { "Fire : [LMB]", "Toggle laser " + (isLaserOn.Value ? "off" : "on") + " : [" + laserBinding + "]", text }, true, base.itemProperties); } protected override void __initializeVariables() { if (currentAmmo == null) { throw new Exception("RocketLauncher.currentAmmo cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)currentAmmo).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)currentAmmo, "currentAmmo"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)currentAmmo); if (isLaserOn == null) { throw new Exception("RocketLauncher.isLaserOn cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)isLaserOn).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)isLaserOn, "isLaserOn"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)isLaserOn); ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1506048930u, new RpcReceiveHandler(__rpc_handler_1506048930), "SetLaserServerRpc"); ((NetworkBehaviour)this).__registerRpc(2805882054u, new RpcReceiveHandler(__rpc_handler_2805882054), "SpawnMissileServerRpc"); ((NetworkBehaviour)this).__registerRpc(1899860777u, new RpcReceiveHandler(__rpc_handler_1899860777), "ReloadServerRpc"); ((NetworkBehaviour)this).__registerRpc(238633276u, new RpcReceiveHandler(__rpc_handler_238633276), "ReloadClientRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_1506048930(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004e: 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_006c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool laserOn = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref laserOn, default(ForPrimitives)); RpcParams ext = rpcParams.Ext; target.__rpc_exec_stage = (__RpcExecStage)1; ((RocketLauncher)(object)target).SetLaserServerRpc(laserOn, ext); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2805882054(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 aimPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref aimPosition); Vector3 fireDirection = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref fireDirection); RpcParams ext = rpcParams.Ext; target.__rpc_exec_stage = (__RpcExecStage)1; ((RocketLauncher)(object)target).SpawnMissileServerRpc(aimPosition, fireDirection, ext); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1899860777(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int rocketSlot = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref rocketSlot); RpcParams ext = rpcParams.Ext; target.__rpc_exec_stage = (__RpcExecStage)1; ((RocketLauncher)(object)target).ReloadServerRpc(rocketSlot, ext); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_238633276(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong ownerClientId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref ownerClientId); int rocketSlot = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref rocketSlot); target.__rpc_exec_stage = (__RpcExecStage)1; ((RocketLauncher)(object)target).ReloadClientRpc(ownerClientId, rocketSlot); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "RocketLauncher"; } } public class RocketLauncherAmmo : GrabbableObject { [CompilerGenerated] private static class <>O { public static hook_LightningStrike <0>__StormyWeather_LightningStrike; } private const float StrikeDistance = 1.5f; private static readonly HashSet SpawnedAmmo = new HashSet(); private bool hasExploded; [SerializeField] private int explosionDamage = 100; [SerializeField] private float minDamageRange = 2f; [SerializeField] private float maxDamageRange = 6f; public static void Init() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown object obj = <>O.<0>__StormyWeather_LightningStrike; if (obj == null) { hook_LightningStrike val = StormyWeather_LightningStrike; <>O.<0>__StormyWeather_LightningStrike = val; obj = (object)val; } StormyWeather.LightningStrike += (hook_LightningStrike)obj; } private static void StormyWeather_LightningStrike(orig_LightningStrike orig, StormyWeather self, Vector3 strikePosition, bool useTargetedObject) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, strikePosition, useTargetedObject); if (!useTargetedObject) { return; } NetworkManager singleton = NetworkManager.Singleton; if (singleton == null || !singleton.IsServer) { return; } RocketLauncherAmmo rocketLauncherAmmo = null; float num = 2.25f; foreach (RocketLauncherAmmo item in SpawnedAmmo) { if (Object.op_Implicit((Object)(object)item) && !item.hasExploded && ((NetworkBehaviour)item).IsSpawned) { Vector3 val = ((Component)item).transform.position - strikePosition; float sqrMagnitude = ((Vector3)(ref val)).sqrMagnitude; if (!(sqrMagnitude > num)) { rocketLauncherAmmo = item; num = sqrMagnitude; } } } rocketLauncherAmmo?.Explode(); } public override void OnNetworkSpawn() { ((NetworkBehaviour)this).OnNetworkSpawn(); SpawnedAmmo.Add(this); } public override void OnNetworkDespawn() { SpawnedAmmo.Remove(this); ((NetworkBehaviour)this).OnNetworkDespawn(); } public override void OnDestroy() { SpawnedAmmo.Remove(this); ((GrabbableObject)this).OnDestroy(); } private void Explode() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)this).IsServer && !hasExploded) { hasExploded = true; Vector3 position = ((Component)this).transform.position; Log.Debug("Rocket ammo exploded after a lightning strike"); ExplodeClientRpc(position); ((NetworkBehaviour)this).NetworkObject.Despawn(true); } } [Rpc(/*Could not decode attribute arguments.*/)] private void ExplodeClientRpc(Vector3 explosionPosition) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { Delivery = (RpcDelivery)0 }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1536151105u, val3, val, (SendTo)7, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref explosionPosition); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1536151105u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; EXPLOOOOOOOOOOOSIONUtilities.CreateExplosion(explosionPosition, spawnExplosionEffect: true, explosionDamage, minDamageRange, maxDamageRange, 6, (CauseOfDeath)3); } } } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1536151105u, new RpcReceiveHandler(__rpc_handler_1536151105), "ExplodeClientRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_1536151105(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 explosionPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref explosionPosition); target.__rpc_exec_stage = (__RpcExecStage)1; ((RocketLauncherAmmo)(object)target).ExplodeClientRpc(explosionPosition); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "RocketLauncherAmmo"; } } public class RoombaAI : EnemyAI { [Header("Behaviors")] [SerializeField] private AISearchRoutine searchForPlayers; [SerializeField] private AudioSource mineAudio; [SerializeField] private AudioSource idleSound; [SerializeField] private AudioClip mineDetonate; [SerializeField] private AudioClip mineTrigger; [SerializeField] private AudioClip beepNoise; [SerializeField] private AudioClip minePress; [SerializeField] private Transform roombaCube; [SerializeField] private Rigidbody Rigidbody; [SerializeField] private float lightInterval = 1f; [SerializeField] private float lightOnDuration = 0.1f; private bool investigating; private bool hasBegunInvestigating; private bool hasExploded; private bool explosionRequested; private bool explosionPlayed; private bool serverExplosionStarted; private bool detonationStarted; private Vector3 investigatePosition; private float angeredTimer; private float lightTimer; private Light[] lights; private LocalPlayerTrigger playerTrigger; private WaitForSeconds triggerWait; private WaitForSeconds lightWait; public override void Awake() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Expected O, but got Unknown ((EnemyAI)this).Awake(); lights = ((Component)roombaCube.parent).GetComponentsInChildren(); triggerWait = new WaitForSeconds(0.5f); lightWait = new WaitForSeconds(lightOnDuration); } public override void Start() { ((EnemyAI)this).Start(); searchForPlayers.loopSearch = true; playerTrigger = LocalPlayerTrigger.Arm(((Component)this).GetComponent()); if ((Object)(object)playerTrigger != (Object)null) { playerTrigger.Entered += LocalPlayerEntered; } else { Log.Warn("Roomba player trigger is missing"); } } public override void DoAIInterval() { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).DoAIInterval(); if (base.isEnemyDead || StartOfRound.Instance.allPlayersDead) { return; } Vector3 val = Rigidbody.velocity; float magnitude = ((Vector3)(ref val)).magnitude; idleSound.pitch = Mathf.Lerp(0.8f, 1.2f, magnitude / 2f); if (!((NetworkBehaviour)this).IsOwner) { return; } if (((EnemyAI)this).TargetClosestPlayer(4f, true, 70f, false, false, true)) { ((EnemyAI)this).StopSearch(searchForPlayers, true); base.movingTowardsTargetPlayer = true; hasBegunInvestigating = false; investigating = false; } else if (investigating) { if (!hasBegunInvestigating) { hasBegunInvestigating = true; ((EnemyAI)this).StopSearch(base.currentSearch, false); ((EnemyAI)this).SetDestinationToPosition(investigatePosition, false); } val = ((Component)this).transform.position - investigatePosition; if (((Vector3)(ref val)).sqrMagnitude < 25f) { investigating = false; hasBegunInvestigating = false; } } else if (!searchForPlayers.inProgress) { base.movingTowardsTargetPlayer = false; ((EnemyAI)this).StartSearch(((Component)this).transform.position, searchForPlayers); } } private IEnumerator DisableLights() { yield return lightWait; Light[] array = lights; foreach (Light light in array) { ((Behaviour)light).enabled = false; } } public override void Update() { ((EnemyAI)this).Update(); if (lightTimer > 0f) { lightTimer -= Time.deltaTime; if (lightTimer <= 0f) { Light[] array = lights; foreach (Light val in array) { ((Behaviour)val).enabled = true; } ((MonoBehaviour)this).StartCoroutine(DisableLights()); mineAudio.PlayOneShot(beepNoise); WalkieTalkie.TransmitOneShotAudio(mineAudio, beepNoise, 1f); } } else { lightTimer = lightInterval; } if (!base.ventAnimationFinished || (Object)(object)base.creatureAnimator == (Object)null) { return; } ((Behaviour)base.creatureAnimator).enabled = false; if (base.isEnemyDead || StartOfRound.Instance.allPlayersDead) { return; } if (base.stunNormalizedTimer > 0f) { base.agent.speed = 0f; angeredTimer = 7f; } else if (angeredTimer > 0f) { angeredTimer -= Time.deltaTime; if (((NetworkBehaviour)this).IsOwner) { base.agent.stoppingDistance = 0.1f; base.agent.speed = 1f; } } else if (((NetworkBehaviour)this).IsOwner) { base.agent.stoppingDistance = 5f; base.agent.speed = 0.8f; } } public override void OnDestroy() { if ((Object)(object)playerTrigger != (Object)null) { playerTrigger.Entered -= LocalPlayerEntered; } ((EnemyAI)this).OnDestroy(); } private void LocalPlayerEntered(Collider playerCollider) { PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if (!hasExploded && localPlayerController != null && !localPlayerController.isPlayerDead) { PressMineServerRpc(); ((MonoBehaviour)this).StartCoroutine(TriggerMine(playerCollider)); hasExploded = true; } } [Rpc(/*Could not decode attribute arguments.*/)] private void PressMineServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false, Delivery = (RpcDelivery)0 }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1409949815u, val3, val, (SendTo)2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1409949815u, val3, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PressMineClientRpc(); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void PressMineClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { Delivery = (RpcDelivery)0 }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3490382774u, val3, val, (SendTo)7, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3490382774u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; mineAudio.PlayOneShot(minePress); WalkieTalkie.TransmitOneShotAudio(mineAudio, minePress, 1f); } } } private IEnumerator TriggerMine(Collider other) { yield return triggerWait; MineGoesBoom(other); } private void MineGoesBoom(Collider other) { DeadBodyInfo val = default(DeadBodyInfo); GrabbableObject val2 = default(GrabbableObject); if (((Component)other).CompareTag("Player") || ((Component)other).CompareTag("PlayerBody") || ((Component)((Component)other).transform.parent).CompareTag("Player")) { PlayerControllerB componentInParent = default(PlayerControllerB); ((Component)other).TryGetComponent(ref componentInParent); if ((Object)(object)componentInParent == (Object)null) { ((Component)((Component)other).transform.parent).TryGetComponent(ref componentInParent); } if ((Object)(object)componentInParent == (Object)null) { componentInParent = ((Component)other).GetComponentInParent(); } if (componentInParent != null && !componentInParent.isPlayerDead && (Object)(object)componentInParent == (Object)(object)GameNetworkManager.Instance.localPlayerController) { RequestExplosion(); } } else if ((((Component)other).CompareTag("PlayerRagdoll") || ((Component)other).CompareTag("PhysicsProp")) && (!((Component)other).TryGetComponent(ref val) || (!((Object)(object)val.playerScript != (Object)(object)GameNetworkManager.Instance.localPlayerController) && (!((Component)other).TryGetComponent(ref val2) || ((NetworkBehaviour)val2).NetworkObject.IsOwner)))) { RequestExplosion(); } } [Rpc(/*Could not decode attribute arguments.*/)] private void ExplodeMineServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false, Delivery = (RpcDelivery)0 }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3814014037u, val3, val, (SendTo)2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3814014037u, val3, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!serverExplosionStarted) { serverExplosionStarted = true; ArmMineClientRpc(); ((MonoBehaviour)this).StartCoroutine(DetonateMineDelayed()); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void ArmMineClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { Delivery = (RpcDelivery)0 }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(4015340235u, val3, val, (SendTo)7, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 4015340235u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!detonationStarted) { detonationStarted = true; SetOffMineAnimation(); } } } private void RequestExplosion() { if (!explosionRequested && !detonationStarted) { explosionRequested = true; ExplodeMineServerRpc(); } } private void SetOffMineAnimation() { hasExploded = true; mineAudio.PlayOneShot(mineTrigger, 1f); } private IEnumerator DetonateMineDelayed() { yield return triggerWait; Log.Debug("Boomba sync boom"); DetonateMineClientRpc(); yield return null; ((NetworkBehaviour)this).NetworkObject.Despawn(true); } [Rpc(/*Could not decode attribute arguments.*/)] private void DetonateMineClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { Delivery = (RpcDelivery)0 }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2443271557u, val3, val, (SendTo)7, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2443271557u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!explosionPlayed) { explosionPlayed = true; Detonate(); } } } private void Detonate() { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) mineAudio.pitch = Random.Range(0.93f, 1.07f); mineAudio.PlayOneShot(mineDetonate, 1f); EXPLOOOOOOOOOOOSIONUtilities.CreateExplosion(((Component)this).transform.position + Vector3.up, spawnExplosionEffect: true, 100, 5.7f, 6.4f, 6, (CauseOfDeath)3); } public bool MineHasLineOfSight(Vector3 pos) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) return !Physics.Linecast(((Component)this).transform.position, pos, 256); } public override void HitEnemy(int force = 1, PlayerControllerB playerWhoHit = null, bool playHitSFX = false, int hitID = -1) { ((EnemyAI)this).HitEnemy(force, playerWhoHit, false, -1); angeredTimer = 18f; if (((NetworkBehaviour)this).IsOwner) { RequestExplosion(); } } public override void HitFromExplosion(float distance) { ((EnemyAI)this).HitFromExplosion(distance); if (((NetworkBehaviour)this).IsOwner) { RequestExplosion(); } } public override void DetectNoise(Vector3 noisePosition, float noiseLoudness, int timesPlayedInOneSpot = 0, int noiseID = 0) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_003e: 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) ((EnemyAI)this).DetectNoise(noisePosition, noiseLoudness, timesPlayedInOneSpot, noiseID); Vector3 val = noisePosition - ((Component)this).transform.position; if (((Vector3)(ref val)).sqrMagnitude <= 225f && !base.movingTowardsTargetPlayer) { investigatePosition = noisePosition; } } public void InvestigatePosition(Vector3 position) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) if (!hasBegunInvestigating) { investigatePosition = position; investigating = true; } } protected override void __initializeVariables() { ((EnemyAI)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1409949815u, new RpcReceiveHandler(__rpc_handler_1409949815), "PressMineServerRpc"); ((NetworkBehaviour)this).__registerRpc(3490382774u, new RpcReceiveHandler(__rpc_handler_3490382774), "PressMineClientRpc"); ((NetworkBehaviour)this).__registerRpc(3814014037u, new RpcReceiveHandler(__rpc_handler_3814014037), "ExplodeMineServerRpc"); ((NetworkBehaviour)this).__registerRpc(4015340235u, new RpcReceiveHandler(__rpc_handler_4015340235), "ArmMineClientRpc"); ((NetworkBehaviour)this).__registerRpc(2443271557u, new RpcReceiveHandler(__rpc_handler_2443271557), "DetonateMineClientRpc"); ((EnemyAI)this).__initializeRpcs(); } private static void __rpc_handler_1409949815(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; ((RoombaAI)(object)target).PressMineServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3490382774(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; ((RoombaAI)(object)target).PressMineClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3814014037(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; ((RoombaAI)(object)target).ExplodeMineServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4015340235(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; ((RoombaAI)(object)target).ArmMineClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2443271557(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; ((RoombaAI)(object)target).DetonateMineClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "RoombaAI"; } } public class SeasonalHandler : MonoBehaviour { public GameObject[] crimasObjects; public AudioClip[] crimasNoisemakerSounds; public AudioClip[] crimasFarNoisemakerSounds; public void Start() { if (DateTime.Now.Month == 12 && DateTime.Now.Day >= 20) { GameObject[] array = crimasObjects; foreach (GameObject val in array) { val.SetActive(true); } NoisemakerProp val2 = default(NoisemakerProp); if (((Component)this).TryGetComponent(ref val2)) { List list = val2.noiseSFX.ToList(); list.AddRange(crimasNoisemakerSounds); val2.noiseSFX = list.ToArray(); List list2 = val2.noiseSFXFar.ToList(); list2.AddRange(crimasFarNoisemakerSounds); val2.noiseSFXFar = list2.ToArray(); } } } } public class TeleporterTrap : NetworkBehaviour { private readonly NetworkVariable teleportCooldown = new NetworkVariable(0f, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); [SerializeField] private float teleportCooldownTime = 5f; [SerializeField] private float teleporterChargeUp = 2f; [SerializeField] private AudioSource teleporterAudio; [SerializeField] private AudioClip teleporterBeamUpSFX; [SerializeField] private AudioClip teleporterPrimeSFX; private readonly List teleportingPlayers = new List(); private readonly List teleportingAI = new List(); private LocalPlayerTrigger playerTrigger; private WaitForSeconds teleportWait; public override void OnNetworkSpawn() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown ((NetworkBehaviour)this).OnNetworkSpawn(); teleportWait = new WaitForSeconds(teleporterChargeUp); playerTrigger = LocalPlayerTrigger.Arm(((Component)this).GetComponent()); if ((Object)(object)playerTrigger != (Object)null) { playerTrigger.Entered += LocalPlayerEntered; } else { Log.Warn("Teleporter player trigger is missing"); } } public override void OnNetworkDespawn() { if ((Object)(object)playerTrigger != (Object)null) { playerTrigger.Entered -= LocalPlayerEntered; } ((NetworkBehaviour)this).OnNetworkDespawn(); } private void Update() { if (((NetworkBehaviour)this).IsServer && teleportCooldown.Value > 0f) { NetworkVariable obj = teleportCooldown; obj.Value -= Time.deltaTime; } } private void LocalPlayerEntered(Collider _) { //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: 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_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) if (teleportCooldown.Value > 0f) { return; } PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if (localPlayerController == null || localPlayerController.isPlayerDead || teleportingPlayers.Contains(localPlayerController)) { return; } GameObject[] insideAINodes = RoundManager.Instance.insideAINodes; if (insideAINodes.Length != 0) { teleportingPlayers.Add(localPlayerController); Vector3 position = insideAINodes[Random.Range(0, insideAINodes.Length)].transform.position; position = RoundManager.Instance.GetRandomNavMeshPositionInRadiusSpherical(position, 10f, default(NavMeshHit)); PlayPrimeServerRpc(); if ((Object)(object)localPlayerController.deadBody != (Object)null) { ((MonoBehaviour)this).StartCoroutine(TeleportPlayerBodyCoroutine((int)localPlayerController.playerClientId, position)); } else { ((MonoBehaviour)this).StartCoroutine(TeleportPlayerCoroutine((int)localPlayerController.playerClientId, position)); } } } private void OnTriggerStay(Collider other) { //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) EnemyAICollisionDetect val = default(EnemyAICollisionDetect); if (((NetworkBehaviour)this).IsServer && !(teleportCooldown.Value > 0f) && ((Component)other).CompareTag("Enemy") && ((Component)other).gameObject.TryGetComponent(ref val)) { EnemyAI mainScript = val.mainScript; GameObject[] insideAINodes = RoundManager.Instance.insideAINodes; if (insideAINodes.Length != 0 && !teleportingAI.Contains(mainScript)) { teleportingAI.Add(mainScript); Vector3 position = insideAINodes[Random.Range(0, insideAINodes.Length)].transform.position; position = RoundManager.Instance.GetRandomNavMeshPositionInRadiusSpherical(position, 10f, default(NavMeshHit)); ((MonoBehaviour)this).StartCoroutine(TeleportEnemyCoroutine(mainScript, position)); PlayPrimeServerRpc(); } } } private IEnumerator TeleportPlayerCoroutine(int playerObj, Vector3 teleportPos) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) yield return teleportWait; teleportingPlayers.Remove(StartOfRound.Instance.allPlayerScripts[playerObj]); TeleportPlayerServerRpc(playerObj, teleportPos); } private IEnumerator TeleportEnemyCoroutine(EnemyAI enemy, Vector3 teleportPos) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) yield return teleportWait; TeleportEnemy(enemy, teleportPos); teleportingAI.Remove(enemy); TeleportEnemyServerRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)enemy).NetworkObject), teleportPos); } private IEnumerator TeleportPlayerBodyCoroutine(int playerObj, Vector3 teleportPos) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) yield return teleportWait; TeleportPlayerBodyServerRpc(playerObj, teleportPos); teleportingPlayers.Remove(StartOfRound.Instance.allPlayerScripts[playerObj]); ((MonoBehaviour)this).StartCoroutine(TeleportPlayerBody(playerObj, teleportPos)); } public static void TeleportPlayer(int playerObj, Vector3 teleportPos) { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[playerObj]; AudioReverbPresets val2 = Object.FindFirstObjectByType(); if (Object.op_Implicit((Object)(object)val2)) { val2.audioPresets[2].ChangeAudioReverbForPlayer(val); } val.isInElevator = false; val.isInHangarShipRoom = false; val.isInsideFactory = true; val.averageVelocity = 0f; val.velocityLastFrame = Vector3.zero; StartOfRound.Instance.allPlayerScripts[playerObj].TeleportPlayer(teleportPos, false, 0f, false, true); StartOfRound.Instance.allPlayerScripts[playerObj].beamOutParticle.Play(); if ((Object)(object)val == (Object)(object)GameNetworkManager.Instance.localPlayerController) { HUDManager.Instance.ShakeCamera((ScreenShakeType)1); } } public static IEnumerator TeleportPlayerBody(int playerObj, Vector3 teleportPosition) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) float startTime = Time.realtimeSinceStartup; yield return (object)new WaitUntil((Func)(() => (Object)(object)StartOfRound.Instance.allPlayerScripts[playerObj].deadBody != (Object)null || Time.realtimeSinceStartup - startTime > 2f)); if (StartOfRound.Instance.inShipPhase || SceneManager.sceneCount <= 1) { yield break; } DeadBodyInfo deadBody = StartOfRound.Instance.allPlayerScripts[playerObj].deadBody; if ((Object)(object)deadBody != (Object)null) { deadBody.attachedTo = null; deadBody.attachedLimb = null; deadBody.secondaryAttachedLimb = null; deadBody.secondaryAttachedTo = null; if ((deadBody.grabBodyObject?.isHeld ?? false) && (Object)(object)deadBody.grabBodyObject.playerHeldBy != (Object)null) { deadBody.grabBodyObject.playerHeldBy.DropAllHeldItems(true, false, false, false, default(Vector3), default(Vector3), default(Vector3), default(Vector3), default(Vector3)); } deadBody.isInShip = false; deadBody.parentedToShip = false; ((Component)deadBody).transform.SetParent((Transform)null, true); deadBody.SetRagdollPositionSafely(teleportPosition, true); } } public static void TeleportEnemy(EnemyAI enemy, Vector3 teleportPos) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) enemy.serverPosition = teleportPos; ((Component)enemy).transform.position = teleportPos; enemy.agent.Warp(teleportPos); enemy.SyncPositionToClients(); } [Rpc(/*Could not decode attribute arguments.*/)] private void TeleportPlayerServerRpc(int playerObj, Vector3 teleportPos) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0084: 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_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false, Delivery = (RpcDelivery)0 }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(4195942959u, val3, val, (SendTo)2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerObj); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref teleportPos); ((NetworkBehaviour)this).__endSendRpc(ref val2, 4195942959u, val3, val, (SendTo)2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; TeleportPlayerClientRpc(playerObj, teleportPos); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void PlayPrimeServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false, Delivery = (RpcDelivery)0 }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(244293179u, val3, val, (SendTo)2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 244293179u, val3, val, (SendTo)2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; teleportCooldown.Value = teleportCooldownTime; PlayPrimeClientRpc(); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void PlayPrimeClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: 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) { RpcAttributeParams val = new RpcAttributeParams { Delivery = (RpcDelivery)0 }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(260928582u, val3, val, (SendTo)7, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 260928582u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; teleporterAudio.PlayOneShot(teleporterPrimeSFX); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void TeleportEnemyServerRpc(NetworkObjectReference enemy, Vector3 teleportPos) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: 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) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false, Delivery = (RpcDelivery)0 }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1546790755u, val3, val, (SendTo)2, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref enemy, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref teleportPos); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1546790755u, val3, val, (SendTo)2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; TeleportEnemyClientRpc(enemy, teleportPos); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void TeleportPlayerBodyServerRpc(int playerObj, Vector3 teleportPos) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0084: 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_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false, Delivery = (RpcDelivery)0 }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1351623037u, val3, val, (SendTo)2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerObj); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref teleportPos); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1351623037u, val3, val, (SendTo)2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; TeleportPlayerBodyClientRpc(playerObj, teleportPos); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void TeleportPlayerClientRpc(int playerObj, Vector3 teleportPos) { //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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { Delivery = (RpcDelivery)0 }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2971731906u, val3, val, (SendTo)7, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerObj); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref teleportPos); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2971731906u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; TeleportPlayer(playerObj, teleportPos); PlayerControllerB val4 = StartOfRound.Instance.allPlayerScripts[playerObj]; if ((Object)(object)val4 == (Object)(object)GameNetworkManager.Instance.localPlayerController) { val4.movementAudio.PlayOneShot(teleporterBeamUpSFX); } else { teleporterAudio.PlayOneShot(teleporterBeamUpSFX); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void TeleportEnemyClientRpc(NetworkObjectReference enemy, Vector3 teleportPos) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_010c: 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) { RpcAttributeParams val = new RpcAttributeParams { Delivery = (RpcDelivery)0 }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1835623434u, val3, val, (SendTo)7, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref enemy, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref teleportPos); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1835623434u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val4 = default(NetworkObject); if (((NetworkObjectReference)(ref enemy)).TryGet(ref val4, (NetworkManager)null)) { teleporterAudio.PlayOneShot(teleporterBeamUpSFX); TeleportEnemy(((Component)val4).GetComponent(), teleportPos); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void TeleportPlayerBodyClientRpc(int playerObj, Vector3 teleportPos) { //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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: 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) { RpcAttributeParams val = new RpcAttributeParams { Delivery = (RpcDelivery)0 }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2590751174u, val3, val, (SendTo)7, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerObj); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref teleportPos); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2590751174u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; teleporterAudio.PlayOneShot(teleporterBeamUpSFX); ((MonoBehaviour)this).StartCoroutine(TeleportPlayerBody(playerObj, teleportPos)); } } } protected override void __initializeVariables() { if (teleportCooldown == null) { throw new Exception("TeleporterTrap.teleportCooldown cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)teleportCooldown).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)teleportCooldown, "teleportCooldown"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)teleportCooldown); ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(4195942959u, new RpcReceiveHandler(__rpc_handler_4195942959), "TeleportPlayerServerRpc"); ((NetworkBehaviour)this).__registerRpc(244293179u, new RpcReceiveHandler(__rpc_handler_244293179), "PlayPrimeServerRpc"); ((NetworkBehaviour)this).__registerRpc(260928582u, new RpcReceiveHandler(__rpc_handler_260928582), "PlayPrimeClientRpc"); ((NetworkBehaviour)this).__registerRpc(1546790755u, new RpcReceiveHandler(__rpc_handler_1546790755), "TeleportEnemyServerRpc"); ((NetworkBehaviour)this).__registerRpc(1351623037u, new RpcReceiveHandler(__rpc_handler_1351623037), "TeleportPlayerBodyServerRpc"); ((NetworkBehaviour)this).__registerRpc(2971731906u, new RpcReceiveHandler(__rpc_handler_2971731906), "TeleportPlayerClientRpc"); ((NetworkBehaviour)this).__registerRpc(1835623434u, new RpcReceiveHandler(__rpc_handler_1835623434), "TeleportEnemyClientRpc"); ((NetworkBehaviour)this).__registerRpc(2590751174u, new RpcReceiveHandler(__rpc_handler_2590751174), "TeleportPlayerBodyClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_4195942959(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerObj = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerObj); Vector3 teleportPos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref teleportPos); target.__rpc_exec_stage = (__RpcExecStage)1; ((TeleporterTrap)(object)target).TeleportPlayerServerRpc(playerObj, teleportPos); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_244293179(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; ((TeleporterTrap)(object)target).PlayPrimeServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_260928582(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; ((TeleporterTrap)(object)target).PlayPrimeClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1546790755(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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference enemy = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref enemy, default(ForNetworkSerializable)); Vector3 teleportPos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref teleportPos); target.__rpc_exec_stage = (__RpcExecStage)1; ((TeleporterTrap)(object)target).TeleportEnemyServerRpc(enemy, teleportPos); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1351623037(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerObj = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerObj); Vector3 teleportPos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref teleportPos); target.__rpc_exec_stage = (__RpcExecStage)1; ((TeleporterTrap)(object)target).TeleportPlayerBodyServerRpc(playerObj, teleportPos); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2971731906(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerObj = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerObj); Vector3 teleportPos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref teleportPos); target.__rpc_exec_stage = (__RpcExecStage)1; ((TeleporterTrap)(object)target).TeleportPlayerClientRpc(playerObj, teleportPos); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1835623434(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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference enemy = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref enemy, default(ForNetworkSerializable)); Vector3 teleportPos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref teleportPos); target.__rpc_exec_stage = (__RpcExecStage)1; ((TeleporterTrap)(object)target).TeleportEnemyClientRpc(enemy, teleportPos); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2590751174(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerObj = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerObj); Vector3 teleportPos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref teleportPos); target.__rpc_exec_stage = (__RpcExecStage)1; ((TeleporterTrap)(object)target).TeleportPlayerBodyClientRpc(playerObj, teleportPos); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "TeleporterTrap"; } } public class ThrowableItem : GrabbableObject { private readonly Collider[] throwDestinationColliders = (Collider[])(object)new Collider[1]; [SerializeField] private AnimationCurve itemFallCurve; [SerializeField] private AnimationCurve itemVerticalFallCurve; [SerializeField] private AnimationCurve itemVerticalFallCurveNoBounce; public override void ItemActivate(bool used, bool buttonDown = true) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).ItemActivate(used, buttonDown); if (((NetworkBehaviour)this).IsOwner) { base.playerHeldBy.DiscardHeldObject(true, (NetworkObject)null, GetItemThrowDestination(), true); } } public override void FallWithCurve() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0164: 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_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) Vector3 val = base.startFallingPosition - base.targetFloorPosition; float magnitude = ((Vector3)(ref val)).magnitude; Transform transform = ((Component)this).transform; transform.rotation = Quaternion.Lerp(transform.rotation, Quaternion.Euler(base.itemProperties.restingRotation.x, transform.eulerAngles.y, base.itemProperties.restingRotation.z), 14f * Time.deltaTime / magnitude); transform.localPosition = Vector3.Lerp(base.startFallingPosition, base.targetFloorPosition, itemFallCurve.Evaluate(base.fallTime)); transform.localPosition = ((magnitude > 5f) ? Vector3.Lerp(new Vector3(transform.localPosition.x, base.startFallingPosition.y, transform.localPosition.z), new Vector3(transform.localPosition.x, base.targetFloorPosition.y, transform.localPosition.z), itemVerticalFallCurveNoBounce.Evaluate(base.fallTime)) : Vector3.Lerp(new Vector3(transform.localPosition.x, base.startFallingPosition.y, transform.localPosition.z), new Vector3(transform.localPosition.x, base.targetFloorPosition.y, transform.localPosition.z), itemVerticalFallCurve.Evaluate(base.fallTime))); base.fallTime += Mathf.Abs(Time.deltaTime * 12f / magnitude); } public Vector3 GetItemThrowDestination() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0032: 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_005a: 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_006e: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) Ray val = default(Ray); ((Ray)(ref val))..ctor(((Component)base.playerHeldBy.gameplayCamera).transform.position, ((Component)base.playerHeldBy.gameplayCamera).transform.forward); RaycastHit val3 = default(RaycastHit); Vector3 val2 = ((!Physics.Raycast(val, ref val3, 12f, StartOfRound.Instance.collidersAndRoomMaskAndDefault)) ? ((Ray)(ref val)).GetPoint(10f) : ((Ray)(ref val)).GetPoint(((RaycastHit)(ref val3)).distance - 0.05f)); if (Physics.OverlapSphereNonAlloc(val2, 0.02f, throwDestinationColliders, StartOfRound.Instance.collidersAndRoomMaskAndDefault) > 0 && Physics.OverlapSphereNonAlloc(val2 + Vector3.down * 0.05f, 0.02f, throwDestinationColliders, StartOfRound.Instance.collidersAndRoomMaskAndDefault) == 0) { val2 += Vector3.down * 0.05f; } ((Ray)(ref val))..ctor(val2, Vector3.down); return Physics.Raycast(val, ref val3, 30f, StartOfRound.Instance.collidersAndRoomMaskAndDefault) ? (((RaycastHit)(ref val3)).point + Vector3.up * 0.05f) : ((Ray)(ref val)).GetPoint(30f); } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { ((GrabbableObject)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "ThrowableItem"; } } public class ToyGun : GrabbableObject { private static readonly int PewpewHash = Animator.StringToHash("pewpew"); private static readonly int UnpewHash = Animator.StringToHash("unpew"); [SerializeField] private float reloadTime = 2f; [SerializeField] private AudioClip[] fireSounds; [SerializeField] private AudioClip[] reloadSounds; [SerializeField] private AudioSource audioSource; [SerializeField] private AudioSource audioSourceFar; [SerializeField] private Animator animator; private bool isFiring; private bool wasFired; private WaitForSeconds fireSoundWait; private WaitForSeconds reloadWait; private void Awake() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown fireSoundWait = new WaitForSeconds(0.03f); reloadWait = new WaitForSeconds(reloadTime); } private void Fire(int fireSoundIndex, int reloadSoundIndex) { if (!wasFired) { wasFired = true; animator.Play(PewpewHash); isFiring = false; ((MonoBehaviour)this).StartCoroutine(FireSound(fireSoundIndex)); ((MonoBehaviour)this).StartCoroutine(Reload(reloadSoundIndex)); } } private IEnumerator Reload(int soundIndex) { yield return reloadWait; wasFired = false; animator.Play(UnpewHash); audioSource.PlayOneShot(reloadSounds[soundIndex]); AudioSource obj = audioSourceFar; if (obj != null) { obj.PlayOneShot(reloadSounds[soundIndex]); } } private IEnumerator FireSound(int soundIndex) { yield return fireSoundWait; audioSource.PlayOneShot(fireSounds[soundIndex]); AudioSource obj = audioSourceFar; if (obj != null) { obj.PlayOneShot(fireSounds[soundIndex]); } } [Rpc(/*Could not decode attribute arguments.*/)] private void FireServerRpc(int fireSoundIndex, int reloadSoundIndex, RpcParams rpcParams = default(RpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false, Delivery = (RpcDelivery)0 }; FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1165324127u, rpcParams, val, (SendTo)2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, fireSoundIndex); BytePacker.WriteValueBitPacked(val2, reloadSoundIndex); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1165324127u, rpcParams, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (StartOfRound.Instance.ClientPlayerList.TryGetValue(rpcParams.Receive.SenderClientId, out var value) && !((Object)(object)StartOfRound.Instance.allPlayerScripts[value].currentlyHeldObjectServer != (Object)(object)this) && fireSoundIndex >= 0 && fireSoundIndex < fireSounds.Length && reloadSoundIndex >= 0 && reloadSoundIndex < reloadSounds.Length) { FireClientRpc(fireSoundIndex, reloadSoundIndex); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void FireClientRpc(int fireSoundIndex, int reloadSoundIndex) { //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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: 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_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { Delivery = (RpcDelivery)0 }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(534740728u, val3, val, (SendTo)7, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, fireSoundIndex); BytePacker.WriteValueBitPacked(val2, reloadSoundIndex); ((NetworkBehaviour)this).__endSendRpc(ref val2, 534740728u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Fire(fireSoundIndex, reloadSoundIndex); } } } public override void ItemActivate(bool used, bool buttonDown = true) { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).ItemActivate(used, buttonDown); if (((NetworkBehaviour)this).IsOwner && !isFiring && !wasFired) { isFiring = true; FireServerRpc(Random.Range(0, fireSounds.Length), Random.Range(0, reloadSounds.Length)); } } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1165324127u, new RpcReceiveHandler(__rpc_handler_1165324127), "FireServerRpc"); ((NetworkBehaviour)this).__registerRpc(534740728u, new RpcReceiveHandler(__rpc_handler_534740728), "FireClientRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_1165324127(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int fireSoundIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref fireSoundIndex); int reloadSoundIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref reloadSoundIndex); RpcParams ext = rpcParams.Ext; target.__rpc_exec_stage = (__RpcExecStage)1; ((ToyGun)(object)target).FireServerRpc(fireSoundIndex, reloadSoundIndex, ext); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_534740728(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int fireSoundIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref fireSoundIndex); int reloadSoundIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref reloadSoundIndex); target.__rpc_exec_stage = (__RpcExecStage)1; ((ToyGun)(object)target).FireClientRpc(fireSoundIndex, reloadSoundIndex); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "ToyGun"; } } internal class ToyHammer : Shovel { public int hammerHitForce = 100; public float hammerHitPercentage = 1f; protected override void __initializeVariables() { ((Shovel)this).__initializeVariables(); } protected override void __initializeRpcs() { ((Shovel)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "ToyHammer"; } } } namespace LethalThings.DynamicBone { [AddComponentMenu("Dynamic Bone/Dynamic Bone")] [DefaultExecutionOrder(100)] public class DynamicBone : MonoBehaviour { public enum UpdateMode { Normal, AnimatePhysics, UnscaledTime, Default } public enum FreezeAxis { None, X, Y, Z } private class Particle { public Transform m_Transform; public int m_ParentIndex; public int m_ChildCount; public float m_Damping; public float m_Elasticity; public float m_Stiffness; public float m_Inert; public float m_Friction; public float m_Radius; public float m_BoneLength; public bool m_isCollide; public bool m_TransformNotNull; public Vector3 m_Position; public Vector3 m_PrevPosition; public Vector3 m_EndOffset; public Vector3 m_InitLocalPosition; public Quaternion m_InitLocalRotation; public Vector3 m_TransformPosition; public Vector3 m_TransformLocalPosition; public Matrix4x4 m_TransformLocalToWorldMatrix; } private class ParticleTree { public Transform m_Root; public Vector3 m_LocalGravity; public Matrix4x4 m_RootWorldToLocalMatrix; public float m_BoneTotalLength; public List m_Particles = new List(); public Vector3 m_RestGravity; } public Transform m_Root = null; public List m_Roots = null; public float m_UpdateRate = 60f; public UpdateMode m_UpdateMode = UpdateMode.Default; [Range(0f, 1f)] public float m_Damping = 0.1f; public AnimationCurve m_DampingDistrib = null; [Range(0f, 1f)] public float m_Elasticity = 0.1f; public AnimationCurve m_ElasticityDistrib = null; [Range(0f, 1f)] public float m_Stiffness = 0.1f; public AnimationCurve m_StiffnessDistrib = null; [Range(0f, 1f)] public float m_Inert = 0f; public AnimationCurve m_InertDistrib = null; public float m_Friction = 0f; public AnimationCurve m_FrictionDistrib = null; public float m_Radius = 0f; public AnimationCurve m_RadiusDistrib = null; public float m_EndLength = 0f; public Vector3 m_EndOffset = Vector3.zero; public Vector3 m_Gravity = Vector3.zero; public Vector3 m_Force = Vector3.zero; [Range(0f, 1f)] public float m_BlendWeight = 1f; public List m_Colliders = null; public List m_Exclusions = null; public FreezeAxis m_FreezeAxis = FreezeAxis.None; public bool m_DistantDisable = false; public Transform m_ReferenceObject = null; public float m_DistanceToObject = 20f; [HideInInspector] public bool m_Multithread = true; private Vector3 m_ObjectMove; private Vector3 m_ObjectPrevPosition; private float m_ObjectScale; private float m_Time = 0f; private float m_Weight = 1f; private bool m_DistantDisabled = false; private int m_PreUpdateCount = 0; private List m_ParticleTrees = new List(); private float m_DeltaTime; private List m_EffectiveColliders; private bool m_WorkAdded = false; private static List s_PendingWorks = new List(); private static List s_EffectiveWorks = new List(); private static AutoResetEvent s_AllWorksDoneEvent; private static int s_RemainWorkCount; private static Semaphore s_WorkQueueSemaphore; private static int s_WorkQueueIndex; private static int s_UpdateCount; private static int s_PrepareFrame; private void Start() { SetupParticles(); } private void FixedUpdate() { if (m_UpdateMode == UpdateMode.AnimatePhysics) { PreUpdate(); } } private void Update() { if (m_UpdateMode != UpdateMode.AnimatePhysics) { PreUpdate(); } if (m_PreUpdateCount > 0 && m_Multithread) { AddPendingWork(this); m_WorkAdded = true; } s_UpdateCount++; } private void LateUpdate() { if (m_PreUpdateCount == 0) { return; } if (s_UpdateCount > 0) { s_UpdateCount = 0; s_PrepareFrame++; } SetWeight(m_BlendWeight); if (m_WorkAdded) { m_WorkAdded = false; ExecuteWorks(); } else { CheckDistance(); if (IsNeedUpdate()) { Prepare(); UpdateParticles(); ApplyParticlesToTransforms(); } } m_PreUpdateCount = 0; } private void Prepare() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Expected O, but got Unknown m_DeltaTime = Time.deltaTime; m_ObjectScale = Mathf.Abs(((Component)this).transform.lossyScale.x); m_ObjectMove = ((Component)this).transform.position - m_ObjectPrevPosition; m_ObjectPrevPosition = ((Component)this).transform.position; for (int i = 0; i < m_ParticleTrees.Count; i++) { ParticleTree particleTree = m_ParticleTrees[i]; particleTree.m_RestGravity = particleTree.m_Root.TransformDirection(particleTree.m_LocalGravity); for (int j = 0; j < particleTree.m_Particles.Count; j++) { Particle particle = particleTree.m_Particles[j]; if (particle.m_TransformNotNull) { particle.m_TransformPosition = particle.m_Transform.position; particle.m_TransformLocalPosition = particle.m_Transform.localPosition; particle.m_TransformLocalToWorldMatrix = particle.m_Transform.localToWorldMatrix; } } } if (m_EffectiveColliders != null) { m_EffectiveColliders.Clear(); } if (m_Colliders == null) { return; } for (int k = 0; k < m_Colliders.Count; k++) { DynamicBoneColliderBase dynamicBoneColliderBase = m_Colliders[k]; if ((Object)dynamicBoneColliderBase != (Object)null && ((Behaviour)dynamicBoneColliderBase).enabled) { if (m_EffectiveColliders == null) { m_EffectiveColliders = new List(); } m_EffectiveColliders.Add(dynamicBoneColliderBase); if (dynamicBoneColliderBase.PrepareFrame != s_PrepareFrame) { dynamicBoneColliderBase.Prepare(); dynamicBoneColliderBase.PrepareFrame = s_PrepareFrame; } } } } private bool IsNeedUpdate() { return m_Weight > 0f && (!m_DistantDisable || !m_DistantDisabled); } private void PreUpdate() { if (IsNeedUpdate()) { InitTransforms(); } m_PreUpdateCount++; } private void CheckDistance() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Expected O, but got Unknown //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Expected O, but got Unknown //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) if (!m_DistantDisable) { return; } Transform val = m_ReferenceObject; if ((Object)val == (Object)null && (Object)Camera.main != (Object)null) { val = ((Component)Camera.main).transform; } if (!((Object)val != (Object)null)) { return; } Vector3 val2 = val.position - ((Component)this).transform.position; float sqrMagnitude = ((Vector3)(ref val2)).sqrMagnitude; bool flag = sqrMagnitude > m_DistanceToObject * m_DistanceToObject; if (flag != m_DistantDisabled) { if (!flag) { ResetParticlesPosition(); } m_DistantDisabled = flag; } } private void OnEnable() { ResetParticlesPosition(); } private void OnDisable() { InitTransforms(); } private void OnValidate() { m_UpdateRate = Mathf.Max(m_UpdateRate, 0f); m_Damping = Mathf.Clamp01(m_Damping); m_Elasticity = Mathf.Clamp01(m_Elasticity); m_Stiffness = Mathf.Clamp01(m_Stiffness); m_Inert = Mathf.Clamp01(m_Inert); m_Friction = Mathf.Clamp01(m_Friction); m_Radius = Mathf.Max(m_Radius, 0f); if (Application.isEditor && Application.isPlaying) { if (IsRootChanged()) { InitTransforms(); SetupParticles(); } else { UpdateParameters(); } } } private bool IsRootChanged() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Expected O, but got Unknown //IL_00ed: Expected O, but got Unknown //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Expected O, but got Unknown List list = new List(); if ((Object)m_Root != (Object)null) { list.Add(m_Root); } if (m_Roots != null) { foreach (Transform root in m_Roots) { if ((Object)root != (Object)null && !list.Contains(root)) { list.Add(root); } } } if (list.Count != m_ParticleTrees.Count) { return true; } for (int i = 0; i < list.Count; i++) { if ((Object)list[i] != (Object)m_ParticleTrees[i].m_Root) { return true; } } return false; } private void OnDidApplyAnimationProperties() { UpdateParameters(); } private void OnDrawGizmosSelected() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) if (((Behaviour)this).enabled) { if (Application.isEditor && !Application.isPlaying && ((Component)this).transform.hasChanged) { SetupParticles(); } Gizmos.color = Color.white; for (int i = 0; i < m_ParticleTrees.Count; i++) { DrawGizmos(m_ParticleTrees[i]); } } } private void DrawGizmos(ParticleTree pt) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < pt.m_Particles.Count; i++) { Particle particle = pt.m_Particles[i]; if (particle.m_ParentIndex >= 0) { Particle particle2 = pt.m_Particles[particle.m_ParentIndex]; Gizmos.DrawLine(particle.m_Position, particle2.m_Position); } if (particle.m_Radius > 0f) { Gizmos.DrawWireSphere(particle.m_Position, particle.m_Radius * m_ObjectScale); } } } public void SetWeight(float w) { if (m_Weight != w) { if (w == 0f) { InitTransforms(); } else if (m_Weight == 0f) { ResetParticlesPosition(); } m_Weight = (m_BlendWeight = w); } } public float GetWeight() { return m_Weight; } private void UpdateParticles() { if (m_ParticleTrees.Count <= 0) { return; } int num = 1; float timeVar = 1f; float deltaTime = m_DeltaTime; if (m_UpdateMode == UpdateMode.Default) { if (m_UpdateRate > 0f) { timeVar = deltaTime * m_UpdateRate; } } else if (m_UpdateRate > 0f) { float num2 = 1f / m_UpdateRate; m_Time += deltaTime; num = 0; while (m_Time >= num2) { m_Time -= num2; if (++num >= 3) { m_Time = 0f; break; } } } if (num > 0) { for (int i = 0; i < num; i++) { UpdateParticles1(timeVar, i); UpdateParticles2(timeVar); } } else { SkipUpdateParticles(); } } public void SetupParticles() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected O, but got Unknown //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Expected O, but got Unknown m_ParticleTrees.Clear(); if ((Object)m_Root != (Object)null) { AppendParticleTree(m_Root); } if (m_Roots != null) { for (int i = 0; i < m_Roots.Count; i++) { Transform root = m_Roots[i]; if (!((Object)root == (Object)null) && !m_ParticleTrees.Exists((ParticleTree x) => (Object)x.m_Root == (Object)root)) { AppendParticleTree(root); } } } m_ObjectScale = Mathf.Abs(((Component)this).transform.lossyScale.x); m_ObjectPrevPosition = ((Component)this).transform.position; m_ObjectMove = Vector3.zero; for (int num = 0; num < m_ParticleTrees.Count; num++) { ParticleTree particleTree = m_ParticleTrees[num]; AppendParticles(particleTree, particleTree.m_Root, -1, 0f); } UpdateParameters(); } private void AppendParticleTree(Transform root) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Expected O, but got Unknown //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) if (!((Object)root == (Object)null)) { ParticleTree particleTree = new ParticleTree(); particleTree.m_Root = root; particleTree.m_RootWorldToLocalMatrix = root.worldToLocalMatrix; m_ParticleTrees.Add(particleTree); } } private void AppendParticles(ParticleTree pt, Transform b, int parentIndex, float boneLength) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0063: 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_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Expected O, but got Unknown //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: 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) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Expected O, but got Unknown //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_02d6: Unknown result type (might be due to invalid IL or missing references) //IL_02db: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_0285: Unknown result type (might be due to invalid IL or missing references) Particle particle = new Particle(); particle.m_Transform = b; particle.m_TransformNotNull = (Object)b != (Object)null; particle.m_ParentIndex = parentIndex; Vector3 val; if ((Object)b != (Object)null) { val = (particle.m_Position = (particle.m_PrevPosition = b.position)); particle.m_InitLocalPosition = b.localPosition; particle.m_InitLocalRotation = b.localRotation; } else { Transform transform = pt.m_Particles[parentIndex].m_Transform; if (m_EndLength > 0f) { Transform parent = transform.parent; if ((Object)parent != (Object)null) { particle.m_EndOffset = transform.InverseTransformPoint(transform.position * 2f - parent.position) * m_EndLength; } else { particle.m_EndOffset = new Vector3(m_EndLength, 0f, 0f); } } else { particle.m_EndOffset = transform.InverseTransformPoint(((Component)this).transform.TransformDirection(m_EndOffset) + transform.position); } val = (particle.m_Position = (particle.m_PrevPosition = transform.TransformPoint(particle.m_EndOffset))); particle.m_InitLocalPosition = Vector3.zero; particle.m_InitLocalRotation = Quaternion.identity; } if (parentIndex >= 0) { float num = boneLength; val = pt.m_Particles[parentIndex].m_Transform.position - particle.m_Position; boneLength = num + ((Vector3)(ref val)).magnitude; particle.m_BoneLength = boneLength; pt.m_BoneTotalLength = Mathf.Max(pt.m_BoneTotalLength, boneLength); pt.m_Particles[parentIndex].m_ChildCount++; } int count = pt.m_Particles.Count; pt.m_Particles.Add(particle); if (!((Object)b != (Object)null)) { return; } for (int i = 0; i < b.childCount; i++) { Transform child = b.GetChild(i); bool flag = false; if (m_Exclusions != null) { flag = m_Exclusions.Contains(child); } if (!flag) { AppendParticles(pt, child, count, boneLength); } else if (m_EndLength > 0f || m_EndOffset != Vector3.zero) { AppendParticles(pt, null, count, boneLength); } } if (b.childCount == 0 && (m_EndLength > 0f || m_EndOffset != Vector3.zero)) { AppendParticles(pt, null, count, boneLength); } } public void UpdateParameters() { SetWeight(m_BlendWeight); for (int i = 0; i < m_ParticleTrees.Count; i++) { UpdateParameters(m_ParticleTrees[i]); } } private void UpdateParameters(ParticleTree pt) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) Vector3 val = ((Matrix4x4)(ref pt.m_RootWorldToLocalMatrix)).MultiplyVector(m_Gravity); pt.m_LocalGravity = ((Vector3)(ref val)).normalized * ((Vector3)(ref m_Gravity)).magnitude; for (int i = 0; i < pt.m_Particles.Count; i++) { Particle particle = pt.m_Particles[i]; particle.m_Damping = m_Damping; particle.m_Elasticity = m_Elasticity; particle.m_Stiffness = m_Stiffness; particle.m_Inert = m_Inert; particle.m_Friction = m_Friction; particle.m_Radius = m_Radius; if (pt.m_BoneTotalLength > 0f) { float num = particle.m_BoneLength / pt.m_BoneTotalLength; if (m_DampingDistrib != null && m_DampingDistrib.keys.Length != 0) { particle.m_Damping *= m_DampingDistrib.Evaluate(num); } if (m_ElasticityDistrib != null && m_ElasticityDistrib.keys.Length != 0) { particle.m_Elasticity *= m_ElasticityDistrib.Evaluate(num); } if (m_StiffnessDistrib != null && m_StiffnessDistrib.keys.Length != 0) { particle.m_Stiffness *= m_StiffnessDistrib.Evaluate(num); } if (m_InertDistrib != null && m_InertDistrib.keys.Length != 0) { particle.m_Inert *= m_InertDistrib.Evaluate(num); } if (m_FrictionDistrib != null && m_FrictionDistrib.keys.Length != 0) { particle.m_Friction *= m_FrictionDistrib.Evaluate(num); } if (m_RadiusDistrib != null && m_RadiusDistrib.keys.Length != 0) { particle.m_Radius *= m_RadiusDistrib.Evaluate(num); } } particle.m_Damping = Mathf.Clamp01(particle.m_Damping); particle.m_Elasticity = Mathf.Clamp01(particle.m_Elasticity); particle.m_Stiffness = Mathf.Clamp01(particle.m_Stiffness); particle.m_Inert = Mathf.Clamp01(particle.m_Inert); particle.m_Friction = Mathf.Clamp01(particle.m_Friction); particle.m_Radius = Mathf.Max(particle.m_Radius, 0f); } } private void InitTransforms() { for (int i = 0; i < m_ParticleTrees.Count; i++) { InitTransforms(m_ParticleTrees[i]); } } private void InitTransforms(ParticleTree pt) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < pt.m_Particles.Count; i++) { Particle particle = pt.m_Particles[i]; if (particle.m_TransformNotNull) { particle.m_Transform.localPosition = particle.m_InitLocalPosition; particle.m_Transform.localRotation = particle.m_InitLocalRotation; } } } private void ResetParticlesPosition() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < m_ParticleTrees.Count; i++) { ResetParticlesPosition(m_ParticleTrees[i]); } m_ObjectPrevPosition = ((Component)this).transform.position; } private void ResetParticlesPosition(ParticleTree pt) { //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < pt.m_Particles.Count; i++) { Particle particle = pt.m_Particles[i]; if (particle.m_TransformNotNull) { particle.m_Position = (particle.m_PrevPosition = particle.m_Transform.position); } else { Transform transform = pt.m_Particles[particle.m_ParentIndex].m_Transform; particle.m_Position = (particle.m_PrevPosition = transform.TransformPoint(particle.m_EndOffset)); } particle.m_isCollide = false; } } private void UpdateParticles1(float timeVar, int loopIndex) { for (int i = 0; i < m_ParticleTrees.Count; i++) { UpdateParticles1(m_ParticleTrees[i], timeVar, loopIndex); } } private void UpdateParticles1(ParticleTree pt, float timeVar, int loopIndex) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: 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_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) Vector3 gravity = m_Gravity; Vector3 normalized = ((Vector3)(ref m_Gravity)).normalized; Vector3 val = normalized * Mathf.Max(Vector3.Dot(pt.m_RestGravity, normalized), 0f); gravity -= val; gravity = (gravity + m_Force) * (m_ObjectScale * timeVar); Vector3 val2 = ((loopIndex == 0) ? m_ObjectMove : Vector3.zero); for (int i = 0; i < pt.m_Particles.Count; i++) { Particle particle = pt.m_Particles[i]; if (particle.m_ParentIndex >= 0) { Vector3 val3 = particle.m_Position - particle.m_PrevPosition; Vector3 val4 = val2 * particle.m_Inert; particle.m_PrevPosition = particle.m_Position + val4; float num = particle.m_Damping; if (particle.m_isCollide) { num += particle.m_Friction; if (num > 1f) { num = 1f; } particle.m_isCollide = false; } particle.m_Position += val3 * (1f - num) + gravity + val4; } else { particle.m_PrevPosition = particle.m_Position; particle.m_Position = particle.m_TransformPosition; } } } private void UpdateParticles2(float timeVar) { for (int i = 0; i < m_ParticleTrees.Count; i++) { UpdateParticles2(m_ParticleTrees[i], timeVar); } } private void UpdateParticles2(ParticleTree pt, float timeVar) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Unknown result type (might be due to invalid IL or missing references) //IL_0273: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Unknown result type (might be due to invalid IL or missing references) //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_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0121: 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_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02a9: Unknown result type (might be due to invalid IL or missing references) //IL_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) Plane val = default(Plane); for (int i = 1; i < pt.m_Particles.Count; i++) { Particle particle = pt.m_Particles[i]; Particle particle2 = pt.m_Particles[particle.m_ParentIndex]; Vector3 val2; float magnitude; if (particle.m_TransformNotNull) { val2 = particle2.m_TransformPosition - particle.m_TransformPosition; magnitude = ((Vector3)(ref val2)).magnitude; } else { val2 = ((Matrix4x4)(ref particle2.m_TransformLocalToWorldMatrix)).MultiplyVector(particle.m_EndOffset); magnitude = ((Vector3)(ref val2)).magnitude; } float num = Mathf.Lerp(1f, particle.m_Stiffness, m_Weight); if (num > 0f || particle.m_Elasticity > 0f) { Matrix4x4 transformLocalToWorldMatrix = particle2.m_TransformLocalToWorldMatrix; ((Matrix4x4)(ref transformLocalToWorldMatrix)).SetColumn(3, Vector4.op_Implicit(particle2.m_Position)); Vector3 val3 = ((!particle.m_TransformNotNull) ? ((Matrix4x4)(ref transformLocalToWorldMatrix)).MultiplyPoint3x4(particle.m_EndOffset) : ((Matrix4x4)(ref transformLocalToWorldMatrix)).MultiplyPoint3x4(particle.m_TransformLocalPosition)); Vector3 val4 = val3 - particle.m_Position; particle.m_Position += val4 * (particle.m_Elasticity * timeVar); if (num > 0f) { val4 = val3 - particle.m_Position; float magnitude2 = ((Vector3)(ref val4)).magnitude; float num2 = magnitude * (1f - num) * 2f; if (magnitude2 > num2) { particle.m_Position += val4 * ((magnitude2 - num2) / magnitude2); } } } if (m_EffectiveColliders != null) { float particleRadius = particle.m_Radius * m_ObjectScale; for (int j = 0; j < m_EffectiveColliders.Count; j++) { DynamicBoneColliderBase dynamicBoneColliderBase = m_EffectiveColliders[j]; particle.m_isCollide |= dynamicBoneColliderBase.Collide(ref particle.m_Position, particleRadius); } } if (m_FreezeAxis != FreezeAxis.None) { Vector4 column = ((Matrix4x4)(ref particle2.m_TransformLocalToWorldMatrix)).GetColumn((int)(m_FreezeAxis - 1)); Vector3 val5 = Vector4.op_Implicit(((Vector4)(ref column)).normalized); ((Plane)(ref val)).SetNormalAndPosition(val5, particle2.m_Position); particle.m_Position -= ((Plane)(ref val)).normal * ((Plane)(ref val)).GetDistanceToPoint(particle.m_Position); } Vector3 val6 = particle2.m_Position - particle.m_Position; float magnitude3 = ((Vector3)(ref val6)).magnitude; if (magnitude3 > 0f) { particle.m_Position += val6 * ((magnitude3 - magnitude) / magnitude3); } } } private void SkipUpdateParticles() { for (int i = 0; i < m_ParticleTrees.Count; i++) { SkipUpdateParticles(m_ParticleTrees[i]); } } private void SkipUpdateParticles(ParticleTree pt) { //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < pt.m_Particles.Count; i++) { Particle particle = pt.m_Particles[i]; if (particle.m_ParentIndex >= 0) { particle.m_PrevPosition += m_ObjectMove; particle.m_Position += m_ObjectMove; Particle particle2 = pt.m_Particles[particle.m_ParentIndex]; Vector3 val; float magnitude; if (particle.m_TransformNotNull) { val = particle2.m_TransformPosition - particle.m_TransformPosition; magnitude = ((Vector3)(ref val)).magnitude; } else { val = ((Matrix4x4)(ref particle2.m_TransformLocalToWorldMatrix)).MultiplyVector(particle.m_EndOffset); magnitude = ((Vector3)(ref val)).magnitude; } float num = Mathf.Lerp(1f, particle.m_Stiffness, m_Weight); if (num > 0f) { Matrix4x4 transformLocalToWorldMatrix = particle2.m_TransformLocalToWorldMatrix; ((Matrix4x4)(ref transformLocalToWorldMatrix)).SetColumn(3, Vector4.op_Implicit(particle2.m_Position)); Vector3 val2 = ((!particle.m_TransformNotNull) ? ((Matrix4x4)(ref transformLocalToWorldMatrix)).MultiplyPoint3x4(particle.m_EndOffset) : ((Matrix4x4)(ref transformLocalToWorldMatrix)).MultiplyPoint3x4(particle.m_TransformLocalPosition)); Vector3 val3 = val2 - particle.m_Position; float magnitude2 = ((Vector3)(ref val3)).magnitude; float num2 = magnitude * (1f - num) * 2f; if (magnitude2 > num2) { particle.m_Position += val3 * ((magnitude2 - num2) / magnitude2); } } Vector3 val4 = particle2.m_Position - particle.m_Position; float magnitude3 = ((Vector3)(ref val4)).magnitude; if (magnitude3 > 0f) { particle.m_Position += val4 * ((magnitude3 - magnitude) / magnitude3); } } else { particle.m_PrevPosition = particle.m_Position; particle.m_Position = particle.m_TransformPosition; } } } private static Vector3 MirrorVector(Vector3 v, Vector3 axis) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) return v - axis * (Vector3.Dot(v, axis) * 2f); } private void ApplyParticlesToTransforms() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: 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_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown Vector3 right = Vector3.right; Vector3 up = Vector3.up; Vector3 forward = Vector3.forward; bool flag = false; bool flag2 = false; bool flag3 = false; Vector3 lossyScale = ((Component)this).transform.lossyScale; if (lossyScale.x < 0f || lossyScale.y < 0f || lossyScale.z < 0f) { Transform val = ((Component)this).transform; do { Vector3 localScale = val.localScale; flag = localScale.x < 0f; if (flag) { right = val.right; } flag2 = localScale.y < 0f; if (flag2) { up = val.up; } flag3 = localScale.z < 0f; if (flag3) { forward = val.forward; } if (flag || flag2 || flag3) { break; } val = val.parent; } while ((Object)val != (Object)null); } for (int i = 0; i < m_ParticleTrees.Count; i++) { ApplyParticlesToTransforms(m_ParticleTrees[i], right, up, forward, flag, flag2, flag3); } } private void ApplyParticlesToTransforms(ParticleTree pt, Vector3 ax, Vector3 ay, Vector3 az, bool nx, bool ny, bool nz) { //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_004a: 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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) for (int i = 1; i < pt.m_Particles.Count; i++) { Particle particle = pt.m_Particles[i]; Particle particle2 = pt.m_Particles[particle.m_ParentIndex]; if (particle2.m_ChildCount <= 1) { Vector3 val = ((!particle.m_TransformNotNull) ? particle.m_EndOffset : particle.m_Transform.localPosition); Vector3 val2 = particle2.m_Transform.TransformDirection(val); Vector3 val3 = particle.m_Position - particle2.m_Position; if (nx) { val3 = MirrorVector(val3, ax); } if (ny) { val3 = MirrorVector(val3, ay); } if (nz) { val3 = MirrorVector(val3, az); } Quaternion val4 = Quaternion.FromToRotation(val2, val3); particle2.m_Transform.rotation = val4 * particle2.m_Transform.rotation; } if (particle.m_TransformNotNull) { particle.m_Transform.position = particle.m_Position; } } } private static void AddPendingWork(DynamicBone db) { s_PendingWorks.Add(db); } private static void AddWorkToQueue(DynamicBone db) { s_WorkQueueSemaphore.Release(); } private static DynamicBone GetWorkFromQueue() { int index = Interlocked.Increment(ref s_WorkQueueIndex); return s_EffectiveWorks[index]; } private static void ThreadProc() { while (true) { s_WorkQueueSemaphore.WaitOne(); DynamicBone workFromQueue = GetWorkFromQueue(); workFromQueue.UpdateParticles(); if (Interlocked.Decrement(ref s_RemainWorkCount) <= 0) { s_AllWorksDoneEvent.Set(); } } } private static void InitThreadPool() { s_AllWorksDoneEvent = new AutoResetEvent(initialState: false); s_WorkQueueSemaphore = new Semaphore(0, int.MaxValue); int processorCount = Environment.ProcessorCount; for (int i = 0; i < processorCount; i++) { Thread thread = new Thread(ThreadProc); thread.IsBackground = true; thread.Start(); } } private static void ExecuteWorks() { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Expected O, but got Unknown if (s_PendingWorks.Count <= 0) { return; } s_EffectiveWorks.Clear(); for (int i = 0; i < s_PendingWorks.Count; i++) { DynamicBone dynamicBone = s_PendingWorks[i]; if ((Object)dynamicBone != (Object)null && ((Behaviour)dynamicBone).enabled) { dynamicBone.CheckDistance(); if (dynamicBone.IsNeedUpdate()) { s_EffectiveWorks.Add(dynamicBone); } } } s_PendingWorks.Clear(); if (s_EffectiveWorks.Count > 0) { if (s_AllWorksDoneEvent == null) { InitThreadPool(); } int num = (s_RemainWorkCount = s_EffectiveWorks.Count); s_WorkQueueIndex = -1; for (int j = 0; j < num; j++) { DynamicBone dynamicBone2 = s_EffectiveWorks[j]; dynamicBone2.Prepare(); AddWorkToQueue(dynamicBone2); } s_AllWorksDoneEvent.WaitOne(); for (int k = 0; k < num; k++) { DynamicBone dynamicBone3 = s_EffectiveWorks[k]; dynamicBone3.ApplyParticlesToTransforms(); } } } } [AddComponentMenu("Dynamic Bone/Dynamic Bone Collider")] public class DynamicBoneCollider : DynamicBoneColliderBase { public float m_Radius = 0.5f; public float m_Height = 0f; public float m_Radius2 = 0f; private float m_ScaledRadius; private float m_ScaledRadius2; private Vector3 m_C0; private Vector3 m_C1; private float m_C01Distance; private int m_CollideType; private void OnValidate() { m_Radius = Mathf.Max(m_Radius, 0f); m_Height = Mathf.Max(m_Height, 0f); m_Radius2 = Mathf.Max(m_Radius2, 0f); } public override void Prepare() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Unknown result type (might be due to invalid IL or missing references) //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_025a: Unknown result type (might be due to invalid IL or missing references) //IL_025f: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: 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) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_02dd: Unknown result type (might be due to invalid IL or missing references) //IL_02df: Unknown result type (might be due to invalid IL or missing references) //IL_02e4: Unknown result type (might be due to invalid IL or missing references) //IL_02f0: Unknown result type (might be due to invalid IL or missing references) //IL_02f2: Unknown result type (might be due to invalid IL or missing references) //IL_02f7: Unknown result type (might be due to invalid IL or missing references) //IL_02fd: Unknown result type (might be due to invalid IL or missing references) //IL_0303: Unknown result type (might be due to invalid IL or missing references) //IL_0308: Unknown result type (might be due to invalid IL or missing references) //IL_030d: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Abs(((Component)this).transform.lossyScale.x); float num2 = m_Height * 0.5f; Vector3 val; if (m_Radius2 <= 0f || Mathf.Abs(m_Radius - m_Radius2) < 0.01f) { m_ScaledRadius = m_Radius * num; float num3 = num2 - m_Radius; if (num3 <= 0f) { m_C0 = ((Component)this).transform.TransformPoint(m_Center); if (m_Bound == Bound.Outside) { m_CollideType = 0; } else { m_CollideType = 1; } return; } Vector3 center = m_Center; Vector3 center2 = m_Center; switch (m_Direction) { case Direction.X: center.x += num3; center2.x -= num3; break; case Direction.Y: center.y += num3; center2.y -= num3; break; case Direction.Z: center.z += num3; center2.z -= num3; break; } m_C0 = ((Component)this).transform.TransformPoint(center); m_C1 = ((Component)this).transform.TransformPoint(center2); val = m_C1 - m_C0; m_C01Distance = ((Vector3)(ref val)).magnitude; if (m_Bound == Bound.Outside) { m_CollideType = 2; } else { m_CollideType = 3; } return; } float num4 = Mathf.Max(m_Radius, m_Radius2); if (num2 - num4 <= 0f) { m_ScaledRadius = num4 * num; m_C0 = ((Component)this).transform.TransformPoint(m_Center); if (m_Bound == Bound.Outside) { m_CollideType = 0; } else { m_CollideType = 1; } return; } m_ScaledRadius = m_Radius * num; m_ScaledRadius2 = m_Radius2 * num; float num5 = num2 - m_Radius; float num6 = num2 - m_Radius2; Vector3 center3 = m_Center; Vector3 center4 = m_Center; switch (m_Direction) { case Direction.X: center3.x += num5; center4.x -= num6; break; case Direction.Y: center3.y += num5; center4.y -= num6; break; case Direction.Z: center3.z += num5; center4.z -= num6; break; } m_C0 = ((Component)this).transform.TransformPoint(center3); m_C1 = ((Component)this).transform.TransformPoint(center4); val = m_C1 - m_C0; m_C01Distance = ((Vector3)(ref val)).magnitude; if (m_Bound == Bound.Outside) { m_CollideType = 4; } else { m_CollideType = 5; } } public override bool Collide(ref Vector3 particlePosition, float particleRadius) { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) int collideType = m_CollideType; if (1 == 0) { } bool result = collideType switch { 0 => OutsideSphere(ref particlePosition, particleRadius, m_C0, m_ScaledRadius), 1 => InsideSphere(ref particlePosition, particleRadius, m_C0, m_ScaledRadius), 2 => OutsideCapsule(ref particlePosition, particleRadius, m_C0, m_C1, m_ScaledRadius, m_C01Distance), 3 => InsideCapsule(ref particlePosition, particleRadius, m_C0, m_C1, m_ScaledRadius, m_C01Distance), 4 => OutsideCapsule2(ref particlePosition, particleRadius, m_C0, m_C1, m_ScaledRadius, m_ScaledRadius2, m_C01Distance), 5 => InsideCapsule2(ref particlePosition, particleRadius, m_C0, m_C1, m_ScaledRadius, m_ScaledRadius2, m_C01Distance), _ => false, }; if (1 == 0) { } return result; } private static bool OutsideSphere(ref Vector3 particlePosition, float particleRadius, Vector3 sphereCenter, float sphereRadius) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_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) float num = sphereRadius + particleRadius; float num2 = num * num; Vector3 val = particlePosition - sphereCenter; float sqrMagnitude = ((Vector3)(ref val)).sqrMagnitude; if (sqrMagnitude > 0f && sqrMagnitude < num2) { float num3 = Mathf.Sqrt(sqrMagnitude); particlePosition = sphereCenter + val * (num / num3); return true; } return false; } private static bool InsideSphere(ref Vector3 particlePosition, float particleRadius, Vector3 sphereCenter, float sphereRadius) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) float num = sphereRadius - particleRadius; float num2 = num * num; Vector3 val = particlePosition - sphereCenter; float sqrMagnitude = ((Vector3)(ref val)).sqrMagnitude; if (sqrMagnitude > num2) { float num3 = Mathf.Sqrt(sqrMagnitude); particlePosition = sphereCenter + val * (num / num3); return true; } return false; } private static bool OutsideCapsule(ref Vector3 particlePosition, float particleRadius, Vector3 capsuleP0, Vector3 capsuleP1, float capsuleRadius, float dirlen) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_0066: 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_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) float num = capsuleRadius + particleRadius; float num2 = num * num; Vector3 val = capsuleP1 - capsuleP0; Vector3 val2 = particlePosition - capsuleP0; float num3 = Vector3.Dot(val2, val); if (num3 <= 0f) { float sqrMagnitude = ((Vector3)(ref val2)).sqrMagnitude; if (sqrMagnitude > 0f && sqrMagnitude < num2) { float num4 = Mathf.Sqrt(sqrMagnitude); particlePosition = capsuleP0 + val2 * (num / num4); return true; } } else { float num5 = dirlen * dirlen; if (num3 >= num5) { val2 = particlePosition - capsuleP1; float sqrMagnitude2 = ((Vector3)(ref val2)).sqrMagnitude; if (sqrMagnitude2 > 0f && sqrMagnitude2 < num2) { float num6 = Mathf.Sqrt(sqrMagnitude2); particlePosition = capsuleP1 + val2 * (num / num6); return true; } } else { Vector3 val3 = val2 - val * (num3 / num5); float sqrMagnitude3 = ((Vector3)(ref val3)).sqrMagnitude; if (sqrMagnitude3 > 0f && sqrMagnitude3 < num2) { float num7 = Mathf.Sqrt(sqrMagnitude3); particlePosition += val3 * ((num - num7) / num7); return true; } } } return false; } private static bool InsideCapsule(ref Vector3 particlePosition, float particleRadius, Vector3 capsuleP0, Vector3 capsuleP1, float capsuleRadius, float dirlen) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) float num = capsuleRadius - particleRadius; float num2 = num * num; Vector3 val = capsuleP1 - capsuleP0; Vector3 val2 = particlePosition - capsuleP0; float num3 = Vector3.Dot(val2, val); if (num3 <= 0f) { float sqrMagnitude = ((Vector3)(ref val2)).sqrMagnitude; if (sqrMagnitude > num2) { float num4 = Mathf.Sqrt(sqrMagnitude); particlePosition = capsuleP0 + val2 * (num / num4); return true; } } else { float num5 = dirlen * dirlen; if (num3 >= num5) { val2 = particlePosition - capsuleP1; float sqrMagnitude2 = ((Vector3)(ref val2)).sqrMagnitude; if (sqrMagnitude2 > num2) { float num6 = Mathf.Sqrt(sqrMagnitude2); particlePosition = capsuleP1 + val2 * (num / num6); return true; } } else { Vector3 val3 = val2 - val * (num3 / num5); float sqrMagnitude3 = ((Vector3)(ref val3)).sqrMagnitude; if (sqrMagnitude3 > num2) { float num7 = Mathf.Sqrt(sqrMagnitude3); particlePosition += val3 * ((num - num7) / num7); return true; } } } return false; } private static bool OutsideCapsule2(ref Vector3 particlePosition, float particleRadius, Vector3 capsuleP0, Vector3 capsuleP1, float capsuleRadius0, float capsuleRadius1, float dirlen) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012c: 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_00b5: 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_00bb: 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_0068: 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_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) Vector3 val = capsuleP1 - capsuleP0; Vector3 val2 = particlePosition - capsuleP0; float num = Vector3.Dot(val2, val); if (num <= 0f) { float num2 = capsuleRadius0 + particleRadius; float num3 = num2 * num2; float sqrMagnitude = ((Vector3)(ref val2)).sqrMagnitude; if (sqrMagnitude > 0f && sqrMagnitude < num3) { float num4 = Mathf.Sqrt(sqrMagnitude); particlePosition = capsuleP0 + val2 * (num2 / num4); return true; } } else { float num5 = dirlen * dirlen; if (num >= num5) { float num6 = capsuleRadius1 + particleRadius; float num7 = num6 * num6; val2 = particlePosition - capsuleP1; float sqrMagnitude2 = ((Vector3)(ref val2)).sqrMagnitude; if (sqrMagnitude2 > 0f && sqrMagnitude2 < num7) { float num8 = Mathf.Sqrt(sqrMagnitude2); particlePosition = capsuleP1 + val2 * (num6 / num8); return true; } } else { Vector3 val3 = val2 - val * (num / num5); float sqrMagnitude3 = ((Vector3)(ref val3)).sqrMagnitude; float num9 = Vector3.Dot(val2, val / dirlen); float num10 = Mathf.Lerp(capsuleRadius0, capsuleRadius1, num9 / dirlen) + particleRadius; float num11 = num10 * num10; if (sqrMagnitude3 > 0f && sqrMagnitude3 < num11) { float num12 = Mathf.Sqrt(sqrMagnitude3); particlePosition += val3 * ((num10 - num12) / num12); return true; } } } return false; } private static bool InsideCapsule2(ref Vector3 particlePosition, float particleRadius, Vector3 capsuleP0, Vector3 capsuleP1, float capsuleRadius0, float capsuleRadius1, float dirlen) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_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_00aa: 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_005b: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) Vector3 val = capsuleP1 - capsuleP0; Vector3 val2 = particlePosition - capsuleP0; float num = Vector3.Dot(val2, val); if (num <= 0f) { float num2 = capsuleRadius0 - particleRadius; float num3 = num2 * num2; float sqrMagnitude = ((Vector3)(ref val2)).sqrMagnitude; if (sqrMagnitude > num3) { float num4 = Mathf.Sqrt(sqrMagnitude); particlePosition = capsuleP0 + val2 * (num2 / num4); return true; } } else { float num5 = dirlen * dirlen; if (num >= num5) { float num6 = capsuleRadius1 - particleRadius; float num7 = num6 * num6; val2 = particlePosition - capsuleP1; float sqrMagnitude2 = ((Vector3)(ref val2)).sqrMagnitude; if (sqrMagnitude2 > num7) { float num8 = Mathf.Sqrt(sqrMagnitude2); particlePosition = capsuleP1 + val2 * (num6 / num8); return true; } } else { Vector3 val3 = val2 - val * (num / num5); float sqrMagnitude3 = ((Vector3)(ref val3)).sqrMagnitude; float num9 = Vector3.Dot(val2, val / dirlen); float num10 = Mathf.Lerp(capsuleRadius0, capsuleRadius1, num9 / dirlen) - particleRadius; float num11 = num10 * num10; if (sqrMagnitude3 > num11) { float num12 = Mathf.Sqrt(sqrMagnitude3); particlePosition += val3 * ((num10 - num12) / num12); return true; } } } return false; } private void OnDrawGizmosSelected() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) if (((Behaviour)this).enabled) { Prepare(); if (m_Bound == Bound.Outside) { Gizmos.color = Color.yellow; } else { Gizmos.color = Color.magenta; } switch (m_CollideType) { case 0: case 1: Gizmos.DrawWireSphere(m_C0, m_ScaledRadius); break; case 2: case 3: DrawCapsule(m_C0, m_C1, m_ScaledRadius, m_ScaledRadius); break; case 4: case 5: DrawCapsule(m_C0, m_C1, m_ScaledRadius, m_ScaledRadius2); break; } } } private static void DrawCapsule(Vector3 c0, Vector3 c1, float radius0, float radius1) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) Gizmos.DrawLine(c0, c1); Gizmos.DrawWireSphere(c0, radius0); Gizmos.DrawWireSphere(c1, radius1); } } public class DynamicBoneColliderBase : MonoBehaviour { public enum Direction { X, Y, Z } public enum Bound { Outside, Inside } public Direction m_Direction = Direction.Y; public Vector3 m_Center = Vector3.zero; public Bound m_Bound = Bound.Outside; public int PrepareFrame { get; set; } public virtual void Start() { } public virtual void Prepare() { } public virtual bool Collide(ref Vector3 particlePosition, float particleRadius) { return false; } } } namespace __GEN { internal class NetworkVariableSerializationHelper { [RuntimeInitializeOnLoadMethod] internal static void InitializeSerialization() { NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable(); NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable(); NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedValueEquals(); NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedValueEquals(); NetworkVariableSerializationTypes.InitializeSerializer_FixedString(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable(); } } } namespace LethalThings.NetcodePatcher { [AttributeUsage(AttributeTargets.Module)] internal class NetcodePatchedAssemblyAttribute : Attribute { } }