Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of SeparateMonitorPlayer2 TheShySage v1.0.2
SeparateMonitorPlayer2-TheShySage.dll
Decompiled 2 months ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using BepInEx; using BepInEx.Configuration; using ExitGames.Client.Photon; using HarmonyLib; using Microsoft.CodeAnalysis; using Photon.Pun; using Photon.Realtime; using Strobotnik.Klattersynth; using TMPro; using UnityEngine; using UnityEngine.AI; using UnityEngine.Events; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Utilities; using UnityEngine.Rendering; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: AssemblyVersion("0.0.0.0")] [module: RefSafetyRules(11)] 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 TheShySage.SeparateMonitorPlayer2 { public enum PlayerTwoController { XboxController1, XboxController2 } public enum PlayerTwoDisplayTarget { SplitScreen = 1, Monitor2, Monitor3, Monitor4, Monitor5, Monitor6 } [BepInPlugin("TheShySage.SeparateMonitorPlayer2", "Separate Monitor Player 2-TheShySage", "1.0.34")] public sealed class Plugin : BaseUnityPlugin { internal static ConfigEntry<bool> Enabled; internal static ConfigEntry<PlayerTwoController> Controller; internal static ConfigEntry<PlayerTwoDisplayTarget> DisplayNumber; internal static ConfigEntry<float> CameraSensitivity; private void Awake() { //IL_0006: 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_00a9: Expected O, but got Unknown //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Expected O, but got Unknown new Harmony("TheShySage.SeparateMonitorPlayer2").PatchAll(); Enabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Player 2", "Enabled", true, "Enables the controller-only local Player 2 proxy."); Controller = ((BaseUnityPlugin)this).Config.Bind<PlayerTwoController>("Player 2", "Controller", PlayerTwoController.XboxController2, "Selects Xbox Controller 1 or Xbox Controller 2 for Player 2."); DisplayNumber = ((BaseUnityPlugin)this).Config.Bind<PlayerTwoDisplayTarget>("Player 2", "Monitor Number", PlayerTwoDisplayTarget.Monitor2, "Select SplitScreen for one-window vertical split screen, or Monitor2 through Monitor6 for the original separate-monitor view."); CameraSensitivity = ((BaseUnityPlugin)this).Config.Bind<float>("Player 2", "Camera Sensitivity", 1.5f, new ConfigDescription("Player 2 camera look-speed multiplier. 1.00 is the previous sensitivity.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.25f, 4f), Array.Empty<object>())); GameObject val = new GameObject("Separate Monitor Player 2 Manager"); ((Object)val).hideFlags = (HideFlags)4; Object.DontDestroyOnLoad((Object)(object)val); val.AddComponent<PlayerTwoManager>(); Debug.Log((object)"[Separate Monitor Player 2] Persistent Player 2 manager created."); } } public sealed class PlayerTwoManager : MonoBehaviour { private sealed class RemoteDummy { internal GameObject Visual; internal Vector3 TargetPosition; internal Quaternion TargetRotation; internal float LastPacketTime; } private sealed class BindingBackup { internal InputAction Action; internal int Index; internal string OverridePath; } private const byte DummyStateEvent = 173; private readonly Dictionary<int, RemoteDummy> remoteDummies = new Dictionary<int, RemoteDummy>(); private float networkSendTimer; private bool lobbyCoopStateSent; private bool lobbyCoopStatePrevious; private bool extractionPointAutoActivated; private float extractionPointReadyTimer; private bool networkEventsSubscribed; internal static PlayerTwoManager ActiveManager; private const float MoveFriction = 5f; private const float GrabDistance = 4f; private const float PlayerTwoScale = 0.75f; private const float PlayerTwoCartForceMultiplier = 9f; private const float PlayerTwoStrengthMultiplier = 0.65f; private const float DeadHeadDummyStatMultiplierPerLevel = 2f; private const float PlayerTwoUpwardLiftMultiplier = 1.05f; private const float PlayerTwoDamageTakenMultiplier = 0.97f; private const float PlayerTwoEnemyDetectionRangeMultiplier = 1.2f; private const float PlayerTwoEnemyDetectionDotBonus = 0.08f; private const float PlayerTwoGravityMultiplier = 0.999f; private GameObject proxy; private Rigidbody proxyBody; private Camera playerCamera; private Camera playerOneCamera; private PlayerTwoDisplayTarget appliedDisplayTarget = (PlayerTwoDisplayTarget)(-1); private RenderTexture playerOneSplitTexture; private RenderTexture playerTwoSplitTexture; private GameObject splitScreenCompositor; private bool splitScreenMenuOpen; private TextMeshProUGUI playerOneSplitHealthText; private TextMeshProUGUI playerOneSplitEnergyText; private TextMeshProUGUI playerOneSplitHaulText; private GameObject playerTwoHud; private TextMeshProUGUI playerTwoHealthText; private TextMeshProUGUI playerTwoSprintText; private TextMeshProUGUI playerTwoVoiceLineText; private TextMeshProUGUI playerTwoHeldValueText; private GameObject playerTwoTtsObject; private GameObject playerTwoMapDevice; private Transform playerTwoMapMarker; private Transform playerOneMapMarker; private float playerTwoMapScale = 0.1f; private readonly List<Transform> playerTwoMapLayers = new List<Transform>(); private readonly List<int> playerTwoMapLayerNumbers = new List<int>(); private readonly List<Transform> playerTwoMapSourceTransforms = new List<Transform>(); private readonly List<Transform> playerTwoMapCloneTransforms = new List<Transform>(); private bool playerTwoMapActive; private bool previousMapButton; private float mapDeviceCreateRetry; private TTSVoice playerTwoTtsVoice; private Speech playerTwoNaturalSpeech; private int playerTwoVoiceLineIndex; private bool previousVoiceSpeak; private float ttsCreateRetry; private static readonly string[] PlayerTwoVoiceLines = new string[10] { "Hi", "Run", "Come here", "Follow me", "Enemy nearby", "Loot over here", "Up ahead", "Behind", "To the left", "To the right" }; private GameObject ghostVisual; private GameObject playerOneVisualForPlayerTwo; private Transform[] playerOneVisualSourceTransforms; private Transform[] playerOneVisualCloneTransforms; private PhysGrabObject heldValuable; private Rigidbody heldBody; private PhysGrabCart heldCart; private PhysGrabber heldDummyGrabber; private EnemyRigidbody heldEnemyRigidbody; private StaticGrabObject heldStaticObject; private Transform heldStaticTransform; private Vector3 heldStaticLocalPoint; private bool heldPhysRegistered; private Vector3 heldLocalPoint; private float grabHoldDistance; private Vector3 playerTwoCurrentGrabForce; private float grabForceRamp; private GameObject grabVisualRoot; private LineRenderer grabBeamLine; private GameObject grabPointVisual; private float pitch; private bool previousGrab; private bool previousUse; private int dummyExpressionIndex; private List<ExpressionSettings> dummyExpressions; private GameObject dummyEyelidLeft; private GameObject dummyEyelidRight; private Transform dummyEyelidLeftScale; private Transform dummyEyelidRightScale; private Transform dummyLeftUpperLidX; private Transform dummyLeftUpperLidZ; private Transform dummyLeftLowerLidX; private Transform dummyLeftLowerLidZ; private Transform dummyRightUpperLidX; private Transform dummyRightUpperLidZ; private Transform dummyRightLowerLidX; private Transform dummyRightLowerLidZ; private Transform dummyPupilLeftScale; private Transform dummyPupilRightScale; private Transform dummyPupilLeftRotation; private Transform dummyPupilRightRotation; private bool playerOneWasAlive; private float spawnRetry; private float avatarCloneReadyTimer; private float multiplayerDiagnosticTimer; private GameObject mainMenuInfoCanvas; private GameObject mainMenuInfoPanel; private Canvas mainMenuInfoCanvasComponent; private readonly List<TextMeshProUGUI> mainMenuInfoTexts = new List<TextMeshProUGUI>(); private bool mainMenuInfoStyled; private const string MainMenuInfoText = "hi welcome to my first ever mod, thank you for giving it a try.\n\ncurrently its still sort of buggy and has a few issues\nbut overtime i want to improve it.\n\n-why use this mod instead of just something else that creates a second window\n\nthis mod is mostly aimed to be simpler to do and easier to do co op,\nthis mod does not create a second instance of the game instead\nits doing what true co op games do.\nits running in the same instance and same render\ntherefore no lag behaviors\n, \nthe co op player is not entirely an actual player, its more like a drone or a object to the game,\nwhich meant i had to recreate the movement system and everything else.\nbut because its not a actual player it will still load up without the use of adding a player to the playerlist.\n\nCurrently this only works with two monitors, and i do want to create a better control scheme for the tts\n\ndrone players cannot hold weapons properly yet, im still unsure about how to go about doing that, or the direction i want to go with it, so it will be on pause.\n\nFeatures:\n-drone/dummy co op player\nare 50% weaker then a normal player,\nbut anything player 1 grabs like upgrades does scale alongside the drone player, dead head player upgrade also increases all stats of the drone player by 1.5x for all drone players.\n-drone players share the same health as player 1.\nif player 1 or player 2 is attacked Player 1 health will drop.\nif player 1 dies so does the drone but the drone takes 15% less damage\n\nthank you again for giving my mod a try. i do hope that this becomes an actual feature for the game.\n-TheShySage"; private int activeDisplay = -1; private float inputIsolationTimer; private bool crouched; private bool crawling; private bool grounded; private bool sprinting; private bool canSlide; private bool sliding; private float sprintLerp; private float sprintGrace; private float sprintDrainTimer; private float slideTimer; private float energy = 100f; private float jumpBuffer; private float groundedBuffer; private float groundedLatch; private float groundedDisableTimer; private float jumpCooldown; private float sprintRechargeTimer; private Vector3 relativeVelocity; private Vector3 relativeVelocityTarget; private bool velocityIdle = true; private Vector3 slideDirection; private Vector3 slideDirectionCurrent; private CapsuleCollider proxyCapsule; private float standingCapsuleHeight = 1.7f; private Vector3 standingCapsuleCenter = new Vector3(0f, 0.85f, 0f); private float crouchCollisionRatio = 0.56f; private float crawlCollisionRatio = 0.38f; private Vector3 groundProbeOffset = new Vector3(0f, 0.08f, 0f); private float groundProbeRadius = 0.3f; private int groundProbeMask = -1; private Vector3 cameraStandingOffset = new Vector3(0f, 0.85f, 0f); private float cameraPositionSmooth = 2f; private float tumbleCameraBlendTimer; private float cameraCrouchLerp; private float cameraCrouchPosition = -0.3f; private float cameraCrouchSpeed = 5f; private AnimationCurve cameraCrouchCurve; private Gamepad isolatedPad; private readonly List<Light> ghostLights = new List<Light>(); private Light playerTwoFlashlight; private float playerTwoFlashlightBaseIntensity = 1f; private float flashlightCreateRetry; private bool flashlightOn = true; private readonly List<BindingBackup> bindingBackups = new List<BindingBackup>(); private readonly List<InputActionMap> isolatedActionMaps = new List<InputActionMap>(); private GameObject tumbleRig; private Rigidbody tumbleBody; private PhysGrabObject tumblePhysGrabObject; private RigidbodyInterpolation tumbleInterpolation; private Collider[] tumbleColliders = (Collider[])(object)new Collider[0]; private Transform tumbleFollowPosition; private bool isTumbling; private float tumbleInputCooldown; private bool previousTumbleButton; private float tumbleNotMovingTimer; private Vector3 tumbleLastPosition; private float tumbleCustomGravity = 10f; private Animator dummyAnimator; private Transform dummyHeadTransform; private Transform dummyMouthTransform; private Quaternion dummyMouthNeutralRotation = Quaternion.identity; private float dummyMouthMaxAngle = 45f; private readonly float[] dummyMouthSamples = new float[64]; private Transform dummyHeadUpTransform; private Transform dummyHeadSideTransform; private Transform dummyHeadLookTransform; private Transform dummyEyeLeft; private Transform dummyEyeRight; private Vector3 cameraMotionPosition; private Vector3 cameraMotionRotation; private bool animatorJumping; private float animatorJumpTimer; private bool animatorSprinting; private bool animatorSliding; private float vanillaBobUpAmount; private float vanillaBobUpActive; private float vanillaBobUpStrength; private float vanillaBobSideAmount; private float vanillaBobSideActive; private float vanillaBobSideStrength; private bool vanillaBobSideReverse; private float vanillaBobMultiplier; private PlayerAvatar soundPlayer; private PlayerAvatar enemyTargetAvatar; private bool enemyTargetRegistered; private readonly HashSet<Enemy> enemyTargetRegistrations = new HashSet<Enemy>(); private float enemyVisionScanTimer; private PlayerVisionTarget enemyVisionTarget; private Transform enemyVisionTransform; private float footstepDistance; private Vector3 soundLastPosition; private bool soundWasGrounded; private bool soundWasSliding; private float tumbleImpactSoundCooldown; private Vector3 tumbleSoundVelocity; private float tumbleRollSoundTimer; private readonly Dictionary<HurtCollider, float> sharedHealthHitCooldowns = new Dictionary<HurtCollider, float>(); private float sharedHealthScanTimer; private void OnEnable() { ActiveManager = this; } private void UpdateNetworkSubscription() { bool flag = PhotonNetwork.InRoom && PhotonNetwork.NetworkingClient != null; if (flag && !networkEventsSubscribed) { PhotonNetwork.NetworkingClient.EventReceived += OnPhotonEvent; networkEventsSubscribed = true; Debug.Log((object)"[Separate Monitor Player 2] NETWORK listener enabled after joining the Photon room."); } else if (!flag && networkEventsSubscribed) { PhotonNetwork.NetworkingClient.EventReceived -= OnPhotonEvent; networkEventsSubscribed = false; ClearRemoteDummies(); } } private void ClearRemoteDummies() { foreach (RemoteDummy value in remoteDummies.Values) { if (Object.op_Implicit((Object)(object)value.Visual)) { Object.Destroy((Object)(object)value.Visual); } } remoteDummies.Clear(); } internal Vector3 RouteAudioPosition(Vector3 sourcePosition) { //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_0163: 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_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_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) //IL_00c4: 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_011a: 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_0130: 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_013a: 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_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0150: 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_015f: 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_0115: Unknown result type (might be due to invalid IL or missing references) if (!Plugin.Enabled.Value || !Object.op_Implicit((Object)(object)proxy) || !Object.op_Implicit((Object)(object)playerCamera)) { return sourcePosition; } AudioListener[] array = Object.FindObjectsOfType<AudioListener>(); Transform val = null; AudioListener[] array2 = array; AudioListener[] array3 = array2; AudioListener[] array4 = array3; foreach (AudioListener val2 in array4) { if (Object.op_Implicit((Object)(object)val2) && ((Behaviour)val2).enabled && ((Component)val2).gameObject.activeInHierarchy && !((Component)val2).transform.IsChildOf(proxy.transform)) { val = ((Component)val2).transform; break; } } if (!Object.op_Implicit((Object)(object)val)) { return sourcePosition; } Vector3 val3 = sourcePosition - val.position; float sqrMagnitude = ((Vector3)(ref val3)).sqrMagnitude; val3 = sourcePosition - ((Component)playerCamera).transform.position; float sqrMagnitude2 = ((Vector3)(ref val3)).sqrMagnitude; if (sqrMagnitude2 >= sqrMagnitude) { return sourcePosition; } return val.position + val.rotation * Quaternion.Inverse(((Component)playerCamera).transform.rotation) * (sourcePosition - ((Component)playerCamera).transform.position); } private void UpdateMultiplayerDiagnostics() { //IL_0195: 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) if (!PhotonNetwork.InRoom) { return; } multiplayerDiagnosticTimer -= Time.unscaledDeltaTime; if (!(multiplayerDiagnosticTimer > 0f)) { multiplayerDiagnosticTimer = 3f; PhotonView val = (Object.op_Implicit((Object)(object)proxy) ? proxy.GetComponent<PhotonView>() : null); PhotonView val2 = (Object.op_Implicit((Object)(object)tumbleRig) ? tumbleRig.GetComponent<PhotonView>() : null); PhotonView val3 = (Object.op_Implicit((Object)(object)heldValuable) ? ((Component)heldValuable).GetComponent<PhotonView>() : null); string text = ((PhotonNetwork.LocalPlayer == null) ? "none" : PhotonNetwork.LocalPlayer.ActorNumber.ToString()); string[] obj = new string[25] { "[Separate Monitor Player 2] MPDIAG actor=", text, " inRoom=", PhotonNetwork.InRoom.ToString(), " master=", PhotonNetwork.IsMasterClient.ToString(), " proxy=", Object.op_Implicit((Object)(object)proxy).ToString(), " proxyView=", (!Object.op_Implicit((Object)(object)val)) ? "none" : val.ViewID.ToString(), " proxyMine=", (Object.op_Implicit((Object)(object)val) && val.IsMine).ToString(), " pos=", null, null, null, null, null, null, null, null, null, null, null, null }; object obj2; if (Object.op_Implicit((Object)(object)proxy)) { Vector3 position = proxy.transform.position; obj2 = ((Vector3)(ref position)).ToString("F2"); } else { obj2 = "none"; } obj[13] = (string)obj2; obj[14] = " tumbling="; obj[15] = isTumbling.ToString(); obj[16] = " tumbleView="; obj[17] = ((!Object.op_Implicit((Object)(object)val2)) ? "none" : val2.ViewID.ToString()); obj[18] = " heldView="; obj[19] = ((!Object.op_Implicit((Object)(object)val3)) ? "none" : val3.ViewID.ToString()); obj[20] = " heldMine="; obj[21] = (Object.op_Implicit((Object)(object)val3) && val3.IsMine).ToString(); obj[22] = " enemyRegs="; obj[23] = enemyTargetRegistrations.Count.ToString(); obj[24] = "."; Debug.Log((object)string.Concat(obj)); } } private void UpdateNetworkState() { //IL_007b: 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_0088: 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_0097: 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_00c2: 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_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_00cf: 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_017b: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: 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_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Expected O, but got Unknown //IL_0130: 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_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0150: 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) if (!PhotonNetwork.InRoom || !Object.op_Implicit((Object)(object)proxy)) { return; } networkSendTimer -= Time.unscaledDeltaTime; if (networkSendTimer > 0f) { return; } networkSendTimer = 0.05f; Vector3 val = ((isTumbling && Object.op_Implicit((Object)(object)tumbleBody)) ? (tumbleBody.position + Vector3.down * 0.225f) : proxy.transform.position); Quaternion val2 = ((isTumbling && Object.op_Implicit((Object)(object)tumbleBody)) ? tumbleBody.rotation : proxy.transform.rotation); int num = 0; Vector3 val3 = Vector3.zero; if (Object.op_Implicit((Object)(object)heldValuable)) { PhotonView component = ((Component)heldValuable).GetComponent<PhotonView>(); if (Object.op_Implicit((Object)(object)component)) { num = component.ViewID; } if (Object.op_Implicit((Object)(object)playerCamera)) { val3 = ((Component)playerCamera).transform.position + ((Component)playerCamera).transform.forward * grabHoldDistance; } } object[] array = new object[6] { PhotonNetwork.LocalPlayer.ActorNumber, val, val2, isTumbling, num, val3 }; PhotonNetwork.RaiseEvent((byte)173, (object)array, new RaiseEventOptions { Receivers = (ReceiverGroup)0 }, SendOptions.SendUnreliable); } private void OnPhotonEvent(EventData photonEvent) { //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) if (photonEvent.Code != 173 || !(photonEvent.CustomData is object[])) { return; } object[] array = (object[])photonEvent.CustomData; if (array.Length < 6) { return; } int num = (int)array[0]; if (PhotonNetwork.LocalPlayer == null || num != PhotonNetwork.LocalPlayer.ActorNumber) { if (!remoteDummies.TryGetValue(num, out var value)) { value = new RemoteDummy(); remoteDummies[num] = value; } value.TargetPosition = (Vector3)array[1]; value.TargetRotation = (Quaternion)array[2]; value.LastPacketTime = Time.unscaledTime; EnsureRemoteVisual(num, value); if (PhotonNetwork.IsMasterClient) { ApplyRemoteGrab((int)array[4], (Vector3)array[5]); } } } private void EnsureRemoteVisual(int actor, RemoteDummy remote) { //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)remote.Visual)) { return; } GameObject val = ghostVisual; bool flag = false; if (!Object.op_Implicit((Object)(object)val)) { val = CreateRemoteVisualTemplate(actor); flag = Object.op_Implicit((Object)(object)val); } if (Object.op_Implicit((Object)(object)val)) { remote.Visual = Object.Instantiate<GameObject>(val); if (flag) { Object.Destroy((Object)(object)val); } ((Object)remote.Visual).name = "Remote DUMMYPlayer Actor " + actor; remote.Visual.transform.SetPositionAndRotation(remote.TargetPosition, remote.TargetRotation); remote.Visual.SetActive(true); SetLayerRecursively(remote.Visual.transform, 0); Debug.Log((object)("[Separate Monitor Player 2] NETWORK created remote dummy for actor " + actor + ".")); } } private static PlayerAvatar FindOnlinePlayerForActor(int actor) { PlayerAvatar[] array = Object.FindObjectsOfType<PlayerAvatar>(); PlayerAvatar[] array2 = array; PlayerAvatar[] array3 = array2; foreach (PlayerAvatar val in array3) { if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.photonView) && val.photonView.Owner != null && val.photonView.Owner.ActorNumber == actor) { return val; } } return null; } private static GameObject CreateRemoteVisualTemplate(int actor) { //IL_009f: 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) PlayerAvatar val = FindOnlinePlayerForActor(actor); if (!Object.op_Implicit((Object)(object)val)) { return null; } PlayerAvatarVisuals value = Traverse.Create((object)val).Field("playerAvatarVisuals").GetValue<PlayerAvatarVisuals>(); if (!Object.op_Implicit((Object)(object)value)) { return null; } bool activeSelf = ((Component)value).gameObject.activeSelf; ((Component)value).gameObject.SetActive(false); GameObject val2 = Object.Instantiate<GameObject>(((Component)value).gameObject); ((Component)value).gameObject.SetActive(activeSelf); ((Object)val2).name = "Remote DUMMYPlayer Visual Template Actor " + actor; Transform transform = val2.transform; transform.localScale *= 0.75f; val2.SetActive(false); MonoBehaviour[] componentsInChildren = val2.GetComponentsInChildren<MonoBehaviour>(true); MonoBehaviour[] array = componentsInChildren; MonoBehaviour[] array2 = array; foreach (MonoBehaviour val3 in array2) { if (Object.op_Implicit((Object)(object)val3)) { Object.DestroyImmediate((Object)(object)val3); } } Rigidbody[] componentsInChildren2 = val2.GetComponentsInChildren<Rigidbody>(true); Rigidbody[] array3 = componentsInChildren2; Rigidbody[] array4 = array3; foreach (Rigidbody val4 in array4) { if (Object.op_Implicit((Object)(object)val4)) { Object.DestroyImmediate((Object)(object)val4); } } Collider[] componentsInChildren3 = val2.GetComponentsInChildren<Collider>(true); Collider[] array5 = componentsInChildren3; Collider[] array6 = array5; foreach (Collider val5 in array6) { if (Object.op_Implicit((Object)(object)val5)) { Object.DestroyImmediate((Object)(object)val5); } } ForceRenderersVisible(val2); Debug.Log((object)("[Separate Monitor Player 2] NETWORK cloned remote dummy appearance from online player actor " + actor + ".")); return val2; } private void UpdateRemoteDummies() { //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) //IL_00b8: 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_00df: 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) List<int> list = null; foreach (KeyValuePair<int, RemoteDummy> remoteDummy2 in remoteDummies) { RemoteDummy value = remoteDummy2.Value; EnsureRemoteVisual(remoteDummy2.Key, value); if (Time.unscaledTime - value.LastPacketTime > 5f) { if (list == null) { list = new List<int>(); } list.Add(remoteDummy2.Key); } else if (Object.op_Implicit((Object)(object)value.Visual)) { value.Visual.transform.position = Vector3.Lerp(value.Visual.transform.position, value.TargetPosition, Mathf.Clamp01(Time.unscaledDeltaTime * 15f)); value.Visual.transform.rotation = Quaternion.Slerp(value.Visual.transform.rotation, value.TargetRotation, Mathf.Clamp01(Time.unscaledDeltaTime * 15f)); } } if (list == null) { return; } foreach (int item in list) { RemoteDummy remoteDummy = remoteDummies[item]; if (Object.op_Implicit((Object)(object)remoteDummy.Visual)) { Object.Destroy((Object)(object)remoteDummy.Visual); } remoteDummies.Remove(item); } } private static void ApplyRemoteGrab(int viewId, Vector3 target) { //IL_002e: 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_0035: 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_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_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_005e: Unknown result type (might be due to invalid IL or missing references) if (viewId > 0) { PhotonView val = PhotonView.Find(viewId); Rigidbody val2 = (Object.op_Implicit((Object)(object)val) ? ((Component)val).GetComponent<Rigidbody>() : null); if (Object.op_Implicit((Object)(object)val2)) { Vector3 val3 = Vector3.ClampMagnitude((target - val2.worldCenterOfMass) * 8f, 12f); val2.velocity = Vector3.Lerp(val2.velocity, val3, 0.45f); } } } private void Update() { //IL_0426: Unknown result type (might be due to invalid IL or missing references) //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_03f6: Unknown result type (might be due to invalid IL or missing references) //IL_0401: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) UpdateNetworkSubscription(); UpdateLobbyCoopState(); UpdateMultiplayerDiagnostics(); UpdateNetworkState(); UpdateRemoteDummies(); if (!Plugin.Enabled.Value) { RestorePlayerOneInputDevices(); DespawnProxy(); return; } UpdateAutomaticExtractionPoint(); UpdateMainMenuInfoPopup(); PlayerAvatar instance = PlayerAvatar.instance; inputIsolationTimer -= Time.unscaledDeltaTime; if (inputIsolationTimer <= 0f) { inputIsolationTimer = 1f; ApplyPlayerOneInputIsolation(); IgnoreActorCollisions(); } if (!IsPlayerOneAlive(instance)) { if (playerOneWasAlive) { DespawnProxy(); } playerOneWasAlive = false; return; } playerOneWasAlive = true; if (!Object.op_Implicit((Object)(object)proxy)) { if (!AvatarCloneSourceReady(instance)) { avatarCloneReadyTimer = 0f; return; } avatarCloneReadyTimer += Time.unscaledDeltaTime; if (!(avatarCloneReadyTimer < 1.25f)) { spawnRetry -= Time.unscaledDeltaTime; if (spawnRetry <= 0f) { spawnRetry = 2f; SpawnProxy(instance); } } return; } UpdateDisplayTarget(); UpdateSplitScreenMenuMode(); UpdatePlayerOneSplitHud(); Gamepad val = SelectedGamepad(); if (val == null) { previousTumbleButton = false; previousVoiceSpeak = false; previousMapButton = false; SetPlayerTwoMapActive(active: false); return; } avatarCloneReadyTimer = 0f; ttsCreateRetry -= Time.unscaledDeltaTime; if (!Object.op_Implicit((Object)(object)playerTwoTtsVoice) && !Object.op_Implicit((Object)(object)playerTwoNaturalSpeech) && ttsCreateRetry <= 0f) { ttsCreateRetry = 0.5f; CreatePlayerTwoTts(instance); } bool isPressed = val.rightStickButton.isPressed; UpdateLook(val); UpdateAutomaticCrawl(val); tumbleInputCooldown = Mathf.Max(0f, tumbleInputCooldown - Time.deltaTime); if (isPressed && !previousTumbleButton && tumbleInputCooldown <= 0f) { SetTumbling(!isTumbling, instance, playerInput: true); } previousTumbleButton = isPressed; if (isTumbling) { UpdateTumbleRecovery(val, instance); } else { UpdateGrab(val); UpdateGrabDistance(val); UpdateUseInteraction(val); } UpdateExpressionInput(val); UpdateVoiceLineInput(val, instance); UpdatePlayerTwoMap(val); UpdateEnemyTargetState(); UpdateGrabVisuals(); if (val.buttonNorth.wasPressedThisFrame) { flashlightOn = !flashlightOn; PlayNestedSound((!Object.op_Implicit((Object)(object)soundPlayer)) ? null : soundPlayer.flashlightController, (!flashlightOn) ? "lightOffAudio" : "lightOnAudio", proxy.transform.position); foreach (Light ghostLight in ghostLights) { if (Object.op_Implicit((Object)(object)ghostLight)) { ((Behaviour)ghostLight).enabled = flashlightOn; } } } if (Object.op_Implicit((Object)(object)ghostVisual)) { if (isTumbling && Object.op_Implicit((Object)(object)tumbleFollowPosition)) { ghostVisual.transform.SetPositionAndRotation(tumbleFollowPosition.position, tumbleFollowPosition.rotation); } else { ghostVisual.transform.SetPositionAndRotation(proxy.transform.position, proxy.transform.rotation); } } flashlightCreateRetry -= Time.unscaledDeltaTime; if (!Object.op_Implicit((Object)(object)playerTwoFlashlight) && flashlightCreateRetry <= 0f) { flashlightCreateRetry = 0.5f; CreatePlayerTwoFlashlight(instance); } if (Object.op_Implicit((Object)(object)playerTwoFlashlight)) { ((Behaviour)playerTwoFlashlight).enabled = flashlightOn; if (flashlightOn && playerTwoFlashlight.intensity <= 0.001f) { playerTwoFlashlight.intensity = playerTwoFlashlightBaseIntensity; } if (val.buttonNorth.wasPressedThisFrame) { Debug.Log((object)("[Separate Monitor Player 2] Flashlight toggled " + ((!flashlightOn) ? "OFF" : "ON") + "; enabled=" + ((Behaviour)playerTwoFlashlight).enabled + "; intensity=" + playerTwoFlashlight.intensity)); } } UpdateDummyAnimation(); ApplyDummyExpression(); UpdatePlayerTwoMouth(); UpdateDummyLook(); UpdatePlayerTwoSounds(); SyncPlayerOneVisualClone(); UpdateSharedHealth(instance); UpdatePlayerTwoHudValues(instance); UpdatePlayerTwoHeldValue(); } private void UpdateMainMenuInfoPopup() { if (!SemiFunc.MenuLevel()) { if (Object.op_Implicit((Object)(object)mainMenuInfoCanvas)) { mainMenuInfoCanvas.SetActive(false); } return; } if (!Object.op_Implicit((Object)(object)mainMenuInfoCanvas)) { CreateMainMenuInfoPopup(); } if (Object.op_Implicit((Object)(object)mainMenuInfoCanvas) && !mainMenuInfoCanvas.activeSelf) { mainMenuInfoCanvas.SetActive(true); } if (Object.op_Implicit((Object)(object)CursorManager.instance)) { CursorManager.instance.Unlock(0.1f); } if (Object.op_Implicit((Object)(object)MenuCursor.instance)) { MenuCursor.instance.Show(); Canvas componentInParent = ((Component)MenuCursor.instance).GetComponentInParent<Canvas>(); if (Object.op_Implicit((Object)(object)componentInParent) && Object.op_Implicit((Object)(object)mainMenuInfoCanvasComponent)) { mainMenuInfoCanvasComponent.sortingOrder = componentInParent.sortingOrder - 1; } } ApplyMainMenuInfoStyle(); } private void CreateMainMenuInfoPopup() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0080: 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_00cc: 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_00ea: 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_0139: 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_016c: 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_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_028b: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: 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_02fb: Unknown result type (might be due to invalid IL or missing references) //IL_0320: Unknown result type (might be due to invalid IL or missing references) //IL_03ae: Unknown result type (might be due to invalid IL or missing references) //IL_03ca: Unknown result type (might be due to invalid IL or missing references) //IL_03e6: Unknown result type (might be due to invalid IL or missing references) //IL_0402: Unknown result type (might be due to invalid IL or missing references) //IL_0427: Unknown result type (might be due to invalid IL or missing references) //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_0445: Unknown result type (might be due to invalid IL or missing references) //IL_0454: Unknown result type (might be due to invalid IL or missing references) //IL_0475: Unknown result type (might be due to invalid IL or missing references) //IL_049f: Unknown result type (might be due to invalid IL or missing references) //IL_04c9: Unknown result type (might be due to invalid IL or missing references) //IL_04ea: Unknown result type (might be due to invalid IL or missing references) //IL_04fc: Unknown result type (might be due to invalid IL or missing references) //IL_0515: Unknown result type (might be due to invalid IL or missing references) //IL_051f: Expected O, but got Unknown //IL_052e: Unknown result type (might be due to invalid IL or missing references) //IL_0538: Expected O, but got Unknown mainMenuInfoCanvas = new GameObject("Separate Monitor Player 2 - Main Menu Info"); mainMenuInfoCanvas.transform.SetParent(((Component)this).transform, false); Canvas val = (mainMenuInfoCanvasComponent = mainMenuInfoCanvas.AddComponent<Canvas>()); val.renderMode = (RenderMode)0; val.targetDisplay = 0; val.overrideSorting = true; val.sortingOrder = 100; CanvasScaler val2 = mainMenuInfoCanvas.AddComponent<CanvasScaler>(); val2.uiScaleMode = (ScaleMode)1; val2.referenceResolution = new Vector2(1920f, 1080f); val2.matchWidthOrHeight = 0.5f; mainMenuInfoCanvas.AddComponent<GraphicRaycaster>(); GameObject val3 = CreatePopupRect("MOD INFO Button", mainMenuInfoCanvas.transform, new Vector2(1f, 0f), new Vector2(1f, 0f), new Vector2(-24f, 24f), new Vector2(220f, 64f)); Image val4 = val3.AddComponent<Image>(); ((Graphic)val4).color = new Color(0.04f, 0.12f, 0.2f, 0.96f); Button val5 = val3.AddComponent<Button>(); TextMeshProUGUI val6 = CreatePopupText("MOD INFO", val3.transform, 30f, (TextAlignmentOptions)514, Color.white); mainMenuInfoTexts.Add(val6); ((TMP_Text)val6).rectTransform.offsetMin = Vector2.zero; ((TMP_Text)val6).rectTransform.offsetMax = Vector2.zero; mainMenuInfoPanel = CreatePopupRect("Mod Information Window", mainMenuInfoCanvas.transform, new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), Vector2.zero, new Vector2(1080f, 940f)); Image val7 = mainMenuInfoPanel.AddComponent<Image>(); ((Graphic)val7).color = new Color(0.015f, 0.025f, 0.04f, 0.97f); Outline val8 = mainMenuInfoPanel.AddComponent<Outline>(); ((Shadow)val8).effectColor = new Color(0f, 0.55f, 1f, 1f); ((Shadow)val8).effectDistance = new Vector2(4f, -4f); TextMeshProUGUI val9 = CreatePopupText("SEPARATE MONITOR PLAYER 2", mainMenuInfoPanel.transform, 34f, (TextAlignmentOptions)514, new Color(1f, 0.55f, 0.05f)); mainMenuInfoTexts.Add(val9); ((TMP_Text)val9).rectTransform.anchorMin = new Vector2(0f, 1f); ((TMP_Text)val9).rectTransform.anchorMax = new Vector2(1f, 1f); ((TMP_Text)val9).rectTransform.pivot = new Vector2(0.5f, 1f); ((TMP_Text)val9).rectTransform.anchoredPosition = new Vector2(0f, -24f); ((TMP_Text)val9).rectTransform.sizeDelta = new Vector2(0f, 56f); TextMeshProUGUI val10 = CreatePopupText("hi welcome to my first ever mod, thank you for giving it a try.\n\ncurrently its still sort of buggy and has a few issues\nbut overtime i want to improve it.\n\n-why use this mod instead of just something else that creates a second window\n\nthis mod is mostly aimed to be simpler to do and easier to do co op,\nthis mod does not create a second instance of the game instead\nits doing what true co op games do.\nits running in the same instance and same render\ntherefore no lag behaviors\n, \nthe co op player is not entirely an actual player, its more like a drone or a object to the game,\nwhich meant i had to recreate the movement system and everything else.\nbut because its not a actual player it will still load up without the use of adding a player to the playerlist.\n\nCurrently this only works with two monitors, and i do want to create a better control scheme for the tts\n\ndrone players cannot hold weapons properly yet, im still unsure about how to go about doing that, or the direction i want to go with it, so it will be on pause.\n\nFeatures:\n-drone/dummy co op player\nare 50% weaker then a normal player,\nbut anything player 1 grabs like upgrades does scale alongside the drone player, dead head player upgrade also increases all stats of the drone player by 1.5x for all drone players.\n-drone players share the same health as player 1.\nif player 1 or player 2 is attacked Player 1 health will drop.\nif player 1 dies so does the drone but the drone takes 15% less damage\n\nthank you again for giving my mod a try. i do hope that this becomes an actual feature for the game.\n-TheShySage", mainMenuInfoPanel.transform, 18f, (TextAlignmentOptions)257, Color.white); mainMenuInfoTexts.Add(val10); ((TMP_Text)val10).text = ((TMP_Text)val10).text.Replace("are 50% weaker then a normal player,", "have 65% of a normal player's item-holding strength,"); ((TMP_Text)val10).text = ((TMP_Text)val10).text.Replace("increases all stats of the drone player by 1.5x", "increases all stats of the drone player by 2x per level"); ((TMP_Text)val10).text = ((TMP_Text)val10).text.Replace("the drone takes 15% less damage", "the drone takes 3% less damage"); ((TMP_Text)val10).enableWordWrapping = true; ((TMP_Text)val10).rectTransform.anchorMin = new Vector2(0f, 0f); ((TMP_Text)val10).rectTransform.anchorMax = new Vector2(1f, 1f); ((TMP_Text)val10).rectTransform.offsetMin = new Vector2(44f, 34f); ((TMP_Text)val10).rectTransform.offsetMax = new Vector2(-44f, -94f); GameObject val11 = CreatePopupRect("Close", mainMenuInfoPanel.transform, new Vector2(1f, 1f), new Vector2(1f, 1f), new Vector2(-20f, -20f), new Vector2(54f, 54f)); RectTransform component = val11.GetComponent<RectTransform>(); component.pivot = new Vector2(1f, 1f); Image val12 = val11.AddComponent<Image>(); ((Graphic)val12).color = new Color(0.85f, 0.03f, 0.03f, 1f); Button val13 = val11.AddComponent<Button>(); TextMeshProUGUI val14 = CreatePopupText("X", val11.transform, 32f, (TextAlignmentOptions)514, Color.white); mainMenuInfoTexts.Add(val14); ((TMP_Text)val14).rectTransform.offsetMin = Vector2.zero; ((TMP_Text)val14).rectTransform.offsetMax = Vector2.zero; ((UnityEvent)val5.onClick).AddListener((UnityAction)delegate { if (Object.op_Implicit((Object)(object)mainMenuInfoPanel)) { mainMenuInfoPanel.SetActive(true); } }); ((UnityEvent)val13.onClick).AddListener((UnityAction)delegate { if (Object.op_Implicit((Object)(object)mainMenuInfoPanel)) { mainMenuInfoPanel.SetActive(false); } }); mainMenuInfoPanel.SetActive(false); mainMenuInfoStyled = false; } private void ApplyMainMenuInfoStyle() { //IL_0156: Unknown result type (might be due to invalid IL or missing references) if (mainMenuInfoStyled || !Object.op_Implicit((Object)(object)MenuManager.instance)) { return; } FieldInfo field = typeof(MenuManager).GetField("currentMenuPage", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); MenuPage val = (MenuPage)((!(field != null)) ? null : /*isinst with value type is only supported in some contexts*/); if (!Object.op_Implicit((Object)(object)val)) { return; } TextMeshProUGUI val2 = val.menuHeader; if (!Object.op_Implicit((Object)(object)val2) || !Object.op_Implicit((Object)(object)((TMP_Text)val2).font)) { TextMeshProUGUI[] componentsInChildren = ((Component)val).GetComponentsInChildren<TextMeshProUGUI>(true); TextMeshProUGUI[] array = componentsInChildren; TextMeshProUGUI[] array2 = array; TextMeshProUGUI[] array3 = array2; foreach (TextMeshProUGUI val3 in array3) { if (Object.op_Implicit((Object)(object)val3) && Object.op_Implicit((Object)(object)((TMP_Text)val3).font)) { val2 = val3; break; } } } if (!Object.op_Implicit((Object)(object)val2) || !Object.op_Implicit((Object)(object)((TMP_Text)val2).font)) { return; } foreach (TextMeshProUGUI mainMenuInfoText in mainMenuInfoTexts) { if (Object.op_Implicit((Object)(object)mainMenuInfoText)) { ((TMP_Text)mainMenuInfoText).font = ((TMP_Text)val2).font; ((TMP_Text)mainMenuInfoText).fontSharedMaterial = ((TMP_Text)val2).fontSharedMaterial; ((TMP_Text)mainMenuInfoText).fontStyle = ((TMP_Text)val2).fontStyle; ((TMP_Text)mainMenuInfoText).characterSpacing = ((TMP_Text)val2).characterSpacing; ((TMP_Text)mainMenuInfoText).wordSpacing = ((TMP_Text)val2).wordSpacing; ((TMP_Text)mainMenuInfoText).lineSpacing = ((TMP_Text)val2).lineSpacing; } } mainMenuInfoStyled = true; } private static GameObject CreatePopupRect(string name, Transform parent, Vector2 anchorMin, Vector2 anchorMax, Vector2 position, Vector2 size) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_001e: 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_002f: 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_0037: 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_0059: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(name); val.transform.SetParent(parent, false); RectTransform val2 = val.AddComponent<RectTransform>(); val2.anchorMin = anchorMin; val2.anchorMax = anchorMax; val2.pivot = (Vector2)((!(anchorMin == anchorMax)) ? new Vector2(0.5f, 0.5f) : anchorMin); val2.anchoredPosition = position; val2.sizeDelta = size; return val; } private static TextMeshProUGUI CreatePopupText(string text, Transform parent, float size, TextAlignmentOptions alignment, Color color) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0022: 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_0051: 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) GameObject val = new GameObject("Text"); val.transform.SetParent(parent, false); RectTransform val2 = val.AddComponent<RectTransform>(); val2.anchorMin = Vector2.zero; val2.anchorMax = Vector2.one; TextMeshProUGUI val3 = val.AddComponent<TextMeshProUGUI>(); ((TMP_Text)val3).text = text; ((TMP_Text)val3).fontSize = size; ((TMP_Text)val3).alignment = alignment; ((Graphic)val3).color = color; ((Graphic)val3).raycastTarget = false; return val3; } private static bool AvatarCloneSourceReady(PlayerAvatar playerOne) { if (!Object.op_Implicit((Object)(object)playerOne) || !Object.op_Implicit((Object)(object)LevelGenerator.Instance) || !LevelGenerator.Instance.Generated) { return false; } PlayerAvatarVisuals value = Traverse.Create((object)playerOne).Field("playerAvatarVisuals").GetValue<PlayerAvatarVisuals>(); PlayerTumble value2 = Traverse.Create((object)playerOne).Field("tumble").GetValue<PlayerTumble>(); if (!Object.op_Implicit((Object)(object)value) || !((Component)value).gameObject.activeInHierarchy || !Object.op_Implicit((Object)(object)((Component)value).GetComponentInChildren<Animator>(true)) || !Object.op_Implicit((Object)(object)value.playerEyes) || !Object.op_Implicit((Object)(object)value2) || !Object.op_Implicit((Object)(object)((Component)value2).GetComponent<Rigidbody>()) || !Object.op_Implicit((Object)(object)((Component)value2).GetComponent<PhysGrabObject>())) { return false; } Renderer[] componentsInChildren = ((Component)value).GetComponentsInChildren<Renderer>(true); if (componentsInChildren.Length == 0) { return false; } Renderer[] array = componentsInChildren; Renderer[] array2 = array; Renderer[] array3 = array2; foreach (Renderer val in array3) { if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.sharedMaterial)) { return true; } } return false; } private void UpdatePlayerTwoHudValues(PlayerAvatar playerOne) { if (Object.op_Implicit((Object)(object)playerOne) && Object.op_Implicit((Object)(object)playerOne.playerHealth)) { int value = Traverse.Create((object)playerOne.playerHealth).Field("health").GetValue<int>(); int value2 = Traverse.Create((object)playerOne.playerHealth).Field("maxHealth").GetValue<int>(); float num = ((!Object.op_Implicit((Object)(object)PlayerController.instance)) ? 100f : PlayerController.instance.EnergyStart) * GetDeadHeadDummyStatMultiplier(); if (Object.op_Implicit((Object)(object)playerTwoHealthText)) { ((TMP_Text)playerTwoHealthText).text = "P1 HEALTH " + value + " <color=#008b20>/</color> " + value2; } if (Object.op_Implicit((Object)(object)playerTwoSprintText)) { ((TMP_Text)playerTwoSprintText).text = "P2 SPRINT " + Mathf.CeilToInt(energy) + " <color=orange>/</color> " + Mathf.CeilToInt(num); } } } private float GetDeadHeadDummyStatMultiplier() { if (!Object.op_Implicit((Object)(object)StatsManager.instance) || StatsManager.instance.playerUpgradeDeathHeadBattery == null) { return 1f; } int num = 0; foreach (KeyValuePair<string, int> item in StatsManager.instance.playerUpgradeDeathHeadBattery) { num += Mathf.Max(0, item.Value); } return Mathf.Pow(2f, (float)num); } private void UpdateSharedHealth(PlayerAvatar playerOne) { //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_02a8: Unknown result type (might be due to invalid IL or missing references) //IL_02ad: Unknown result type (might be due to invalid IL or missing references) //IL_02b1: Unknown result type (might be due to invalid IL or missing references) //IL_02bb: 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_02c4: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)playerOne) || !Object.op_Implicit((Object)(object)playerOne.playerHealth)) { return; } List<HurtCollider> list = null; List<HurtCollider> list2 = new List<HurtCollider>(sharedHealthHitCooldowns.Keys); foreach (HurtCollider item in list2) { if (!Object.op_Implicit((Object)(object)item)) { if (list == null) { list = new List<HurtCollider>(); } list.Add(item); continue; } sharedHealthHitCooldowns[item] -= Time.deltaTime; if (sharedHealthHitCooldowns[item] <= 0f) { if (list == null) { list = new List<HurtCollider>(); } list.Add(item); } } if (list != null) { foreach (HurtCollider item2 in list) { sharedHealthHitCooldowns.Remove(item2); } } sharedHealthScanTimer -= Time.deltaTime; if (sharedHealthScanTimer > 0f) { return; } sharedHealthScanTimer = 0.03f; Collider val = (Collider)((!isTumbling) ? ((object)proxyCapsule) : ((object)FirstEnabledCollider(tumbleColliders))); if (!Object.op_Implicit((Object)(object)val) || !val.enabled) { return; } Bounds bounds = val.bounds; Collider value = Traverse.Create((object)playerOne).Field("collider").GetValue<Collider>(); Bounds val2 = (Bounds)((!Object.op_Implicit((Object)(object)value)) ? new Bounds(((Component)playerOne).transform.position, Vector3.zero) : value.bounds); HurtCollider[] array = Object.FindObjectsOfType<HurtCollider>(); HurtCollider[] array2 = array; HurtCollider[] array3 = array2; foreach (HurtCollider val3 in array3) { Collider val4 = ((!Object.op_Implicit((Object)(object)val3)) ? null : Traverse.Create((object)val3).Field("Collider").GetValue<Collider>()); bool flag = Object.op_Implicit((Object)(object)val3) && Traverse.Create((object)val3).Field("ignoreLocalPlayer").GetValue<bool>(); if (!Object.op_Implicit((Object)(object)val3) || !((Behaviour)val3).enabled || !((Component)val3).gameObject.activeInHierarchy || !val3.playerLogic || flag || !Object.op_Implicit((Object)(object)val4) || !val4.enabled) { continue; } Bounds bounds2 = val4.bounds; if (!((Bounds)(ref bounds2)).Intersects(bounds)) { continue; } bounds2 = val4.bounds; if (!((Bounds)(ref bounds2)).Intersects(val2) && !sharedHealthHitCooldowns.ContainsKey(val3)) { int value2 = Traverse.Create((object)playerOne.playerHealth).Field("health").GetValue<int>(); int num = ((!val3.playerKill) ? Mathf.Max(1, Mathf.RoundToInt((float)val3.playerDamage * 0.97f)) : Mathf.Max(value2, 1)); if (num > 0) { playerOne.playerHealth.Hurt(num, true, -1, false); sharedHealthHitCooldowns[val3] = Mathf.Max(val3.playerDamageCooldown, 0.1f); } } } } private static Collider FirstEnabledCollider(Collider[] colliders) { if (colliders != null) { foreach (Collider val in colliders) { if (Object.op_Implicit((Object)(object)val) && val.enabled) { return val; } } } return null; } private void FixedUpdate() { //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_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: 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_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_03c8: Unknown result type (might be due to invalid IL or missing references) //IL_03cd: Unknown result type (might be due to invalid IL or missing references) //IL_03ee: Unknown result type (might be due to invalid IL or missing references) //IL_03fa: Unknown result type (might be due to invalid IL or missing references) //IL_03e4: Unknown result type (might be due to invalid IL or missing references) //IL_03e9: Unknown result type (might be due to invalid IL or missing references) //IL_05f2: Unknown result type (might be due to invalid IL or missing references) //IL_05f7: Unknown result type (might be due to invalid IL or missing references) //IL_062d: Unknown result type (might be due to invalid IL or missing references) //IL_062f: Unknown result type (might be due to invalid IL or missing references) //IL_0633: Unknown result type (might be due to invalid IL or missing references) //IL_0638: Unknown result type (might be due to invalid IL or missing references) //IL_063d: Unknown result type (might be due to invalid IL or missing references) //IL_0640: Unknown result type (might be due to invalid IL or missing references) //IL_0644: Unknown result type (might be due to invalid IL or missing references) //IL_0649: Unknown result type (might be due to invalid IL or missing references) //IL_0650: Unknown result type (might be due to invalid IL or missing references) //IL_0655: Unknown result type (might be due to invalid IL or missing references) //IL_0702: Unknown result type (might be due to invalid IL or missing references) //IL_0704: Unknown result type (might be due to invalid IL or missing references) //IL_0708: Unknown result type (might be due to invalid IL or missing references) //IL_070d: Unknown result type (might be due to invalid IL or missing references) //IL_0712: Unknown result type (might be due to invalid IL or missing references) //IL_06ec: Unknown result type (might be due to invalid IL or missing references) //IL_06ee: Unknown result type (might be due to invalid IL or missing references) //IL_06f2: Unknown result type (might be due to invalid IL or missing references) //IL_06f7: Unknown result type (might be due to invalid IL or missing references) //IL_06fc: Unknown result type (might be due to invalid IL or missing references) //IL_068b: Unknown result type (might be due to invalid IL or missing references) //IL_068e: Unknown result type (might be due to invalid IL or missing references) //IL_0693: Unknown result type (might be due to invalid IL or missing references) //IL_0698: Unknown result type (might be due to invalid IL or missing references) //IL_069c: Unknown result type (might be due to invalid IL or missing references) //IL_06a2: Unknown result type (might be due to invalid IL or missing references) //IL_06a9: Unknown result type (might be due to invalid IL or missing references) //IL_06af: Unknown result type (might be due to invalid IL or missing references) //IL_06b4: Unknown result type (might be due to invalid IL or missing references) //IL_06b9: Unknown result type (might be due to invalid IL or missing references) //IL_0737: Unknown result type (might be due to invalid IL or missing references) //IL_073c: Unknown result type (might be due to invalid IL or missing references) //IL_0742: Unknown result type (might be due to invalid IL or missing references) //IL_0747: Unknown result type (might be due to invalid IL or missing references) //IL_072a: Unknown result type (might be due to invalid IL or missing references) //IL_072c: Unknown result type (might be due to invalid IL or missing references) //IL_075e: Unknown result type (might be due to invalid IL or missing references) //IL_0763: Unknown result type (might be due to invalid IL or missing references) //IL_0768: Unknown result type (might be due to invalid IL or missing references) //IL_0863: Unknown result type (might be due to invalid IL or missing references) //IL_0868: Unknown result type (might be due to invalid IL or missing references) //IL_086e: Unknown result type (might be due to invalid IL or missing references) //IL_0873: Unknown result type (might be due to invalid IL or missing references) //IL_07cf: Unknown result type (might be due to invalid IL or missing references) //IL_07d5: Unknown result type (might be due to invalid IL or missing references) //IL_07de: Unknown result type (might be due to invalid IL or missing references) //IL_07e3: Unknown result type (might be due to invalid IL or missing references) //IL_07ee: Unknown result type (might be due to invalid IL or missing references) //IL_0801: Unknown result type (might be due to invalid IL or missing references) //IL_0806: Unknown result type (might be due to invalid IL or missing references) //IL_0808: Unknown result type (might be due to invalid IL or missing references) //IL_0896: Unknown result type (might be due to invalid IL or missing references) //IL_089b: Unknown result type (might be due to invalid IL or missing references) //IL_08a0: Unknown result type (might be due to invalid IL or missing references) //IL_08cb: Unknown result type (might be due to invalid IL or missing references) //IL_08cd: Unknown result type (might be due to invalid IL or missing references) //IL_08f0: Unknown result type (might be due to invalid IL or missing references) //IL_08f7: Unknown result type (might be due to invalid IL or missing references) //IL_08fd: Unknown result type (might be due to invalid IL or missing references) //IL_094e: Unknown result type (might be due to invalid IL or missing references) //IL_0968: Unknown result type (might be due to invalid IL or missing references) //IL_096f: Unknown result type (might be due to invalid IL or missing references) //IL_0974: Unknown result type (might be due to invalid IL or missing references) //IL_0976: Unknown result type (might be due to invalid IL or missing references) //IL_09e6: Unknown result type (might be due to invalid IL or missing references) //IL_0ea6: Unknown result type (might be due to invalid IL or missing references) //IL_0eab: Unknown result type (might be due to invalid IL or missing references) //IL_0eb0: Unknown result type (might be due to invalid IL or missing references) //IL_0ebd: Unknown result type (might be due to invalid IL or missing references) //IL_0ecd: Unknown result type (might be due to invalid IL or missing references) //IL_0ed8: Unknown result type (might be due to invalid IL or missing references) //IL_0edd: Unknown result type (might be due to invalid IL or missing references) //IL_0ee2: Unknown result type (might be due to invalid IL or missing references) //IL_0f04: Unknown result type (might be due to invalid IL or missing references) //IL_0f0e: Unknown result type (might be due to invalid IL or missing references) //IL_0f10: Unknown result type (might be due to invalid IL or missing references) //IL_0f18: Unknown result type (might be due to invalid IL or missing references) //IL_0f1d: Unknown result type (might be due to invalid IL or missing references) //IL_0b5f: Unknown result type (might be due to invalid IL or missing references) //IL_0b6f: Unknown result type (might be due to invalid IL or missing references) //IL_0b7a: Unknown result type (might be due to invalid IL or missing references) //IL_0b7f: Unknown result type (might be due to invalid IL or missing references) //IL_0b84: Unknown result type (might be due to invalid IL or missing references) //IL_0b92: Unknown result type (might be due to invalid IL or missing references) //IL_0b97: Unknown result type (might be due to invalid IL or missing references) //IL_0b9c: Unknown result type (might be due to invalid IL or missing references) //IL_0ba4: Unknown result type (might be due to invalid IL or missing references) //IL_0ba6: Unknown result type (might be due to invalid IL or missing references) //IL_0bab: Unknown result type (might be due to invalid IL or missing references) //IL_0bad: Unknown result type (might be due to invalid IL or missing references) //IL_0baf: Unknown result type (might be due to invalid IL or missing references) //IL_0bb1: Unknown result type (might be due to invalid IL or missing references) //IL_0bb8: Unknown result type (might be due to invalid IL or missing references) //IL_0bc2: Unknown result type (might be due to invalid IL or missing references) //IL_0bc7: Unknown result type (might be due to invalid IL or missing references) //IL_0bc9: Unknown result type (might be due to invalid IL or missing references) //IL_0bcd: Unknown result type (might be due to invalid IL or missing references) //IL_0bd2: Unknown result type (might be due to invalid IL or missing references) //IL_0bd4: Unknown result type (might be due to invalid IL or missing references) //IL_0bd8: Unknown result type (might be due to invalid IL or missing references) //IL_0bdd: Unknown result type (might be due to invalid IL or missing references) //IL_0be1: Unknown result type (might be due to invalid IL or missing references) //IL_0be6: Unknown result type (might be due to invalid IL or missing references) //IL_0bed: Unknown result type (might be due to invalid IL or missing references) //IL_0bf2: Unknown result type (might be due to invalid IL or missing references) //IL_0bf4: Unknown result type (might be due to invalid IL or missing references) //IL_0bfb: Unknown result type (might be due to invalid IL or missing references) //IL_0c15: Unknown result type (might be due to invalid IL or missing references) //IL_0c1a: Unknown result type (might be due to invalid IL or missing references) //IL_0c7b: Unknown result type (might be due to invalid IL or missing references) //IL_0c7f: Unknown result type (might be due to invalid IL or missing references) //IL_0c86: Unknown result type (might be due to invalid IL or missing references) //IL_0c8b: Unknown result type (might be due to invalid IL or missing references) //IL_0c8d: Unknown result type (might be due to invalid IL or missing references) //IL_0c8f: Unknown result type (might be due to invalid IL or missing references) //IL_0c91: Unknown result type (might be due to invalid IL or missing references) //IL_0ca8: Unknown result type (might be due to invalid IL or missing references) //IL_0cad: Unknown result type (might be due to invalid IL or missing references) //IL_0caf: Unknown result type (might be due to invalid IL or missing references) //IL_0cb9: Unknown result type (might be due to invalid IL or missing references) //IL_0cbe: Unknown result type (might be due to invalid IL or missing references) //IL_0cc4: Unknown result type (might be due to invalid IL or missing references) //IL_0cdd: Unknown result type (might be due to invalid IL or missing references) //IL_0d43: Unknown result type (might be due to invalid IL or missing references) //IL_0d4b: Unknown result type (might be due to invalid IL or missing references) //IL_0d50: Unknown result type (might be due to invalid IL or missing references) //IL_0d1b: Unknown result type (might be due to invalid IL or missing references) //IL_0d22: Unknown result type (might be due to invalid IL or missing references) //IL_0d27: Unknown result type (might be due to invalid IL or missing references) //IL_0d66: Unknown result type (might be due to invalid IL or missing references) //IL_0d6b: Unknown result type (might be due to invalid IL or missing references) //IL_0d6f: Unknown result type (might be due to invalid IL or missing references) //IL_0d74: Unknown result type (might be due to invalid IL or missing references) //IL_0d80: Unknown result type (might be due to invalid IL or missing references) //IL_0d85: Unknown result type (might be due to invalid IL or missing references) //IL_0ded: Unknown result type (might be due to invalid IL or missing references) //IL_0def: Unknown result type (might be due to invalid IL or missing references) //IL_0e0a: Unknown result type (might be due to invalid IL or missing references) //IL_0dde: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)proxyBody) || !Plugin.Enabled.Value) { return; } Gamepad val = SelectedGamepad(); if (val == null) { return; } if (isTumbling) { bool flag = Object.op_Implicit((Object)(object)tumblePhysGrabObject) && tumblePhysGrabObject.playerGrabbing.Count > 0; if (Object.op_Implicit((Object)(object)tumbleBody) && tumbleBody.useGravity && !flag) { tumbleBody.AddForce(Vector3.down * (tumbleCustomGravity * 0.999f), (ForceMode)0); } UpdateCarriedTumblePhysics(); proxy.transform.position = tumbleBody.position + Vector3.down * 0.22500001f; return; } float fixedDeltaTime = Time.fixedDeltaTime; Vector3 val2 = proxy.transform.TransformPoint(groundProbeOffset); if (groundedDisableTimer > 0f) { groundedDisableTimer -= fixedDeltaTime; } if (jumpCooldown > 0f) { jumpCooldown -= fixedDeltaTime; } Collider[] array = (Collider[])((groundedDisableTimer <= 0f) ? ((Array)Physics.OverlapSphere(val2, groundProbeRadius, groundProbeMask, (QueryTriggerInteraction)1)) : ((Array)new Collider[0])); bool flag2 = false; Collider[] array2 = array; Collider[] array3 = array2; Collider[] array4 = array3; Collider[] array5 = array4; foreach (Collider val3 in array5) { if (Object.op_Implicit((Object)(object)val3) && !((Component)val3).transform.IsChildOf(proxy.transform)) { flag2 = true; break; } } if (flag2) { groundedLatch = 0.1f; } else { groundedLatch -= fixedDeltaTime; } grounded = groundedLatch >= 0f; if (grounded) { groundedBuffer = 0.25f; } else { groundedBuffer = Mathf.Max(0f, groundedBuffer - fixedDeltaTime); } jumpBuffer = Mathf.Max(0f, jumpBuffer - fixedDeltaTime); PlayerController instance = PlayerController.instance; float deadHeadDummyStatMultiplier = GetDeadHeadDummyStatMultiplier(); float num = (Object.op_Implicit((Object)(object)instance) ? instance.MoveSpeed : 0.5f) * deadHeadDummyStatMultiplier; float num2 = (Object.op_Implicit((Object)(object)instance) ? instance.SprintSpeed : 1f) * deadHeadDummyStatMultiplier; float num3 = (Object.op_Implicit((Object)(object)instance) ? instance.SprintAcceleration : 1f) * deadHeadDummyStatMultiplier; float num4 = (Object.op_Implicit((Object)(object)instance) ? instance.CrouchSpeed : 1f) * deadHeadDummyStatMultiplier; float num5 = (Object.op_Implicit((Object)(object)instance) ? instance.SlideTime : 1f); float num6 = (Object.op_Implicit((Object)(object)instance) ? instance.SlideDecay : 0.1f); float num7 = (Object.op_Implicit((Object)(object)instance) ? instance.JumpForce : 20f); float num8 = (Object.op_Implicit((Object)(object)instance) ? instance.CustomGravity : 20f) * 0.999f; float num9 = (Object.op_Implicit((Object)(object)instance) ? instance.EnergyStart : 100f) * deadHeadDummyStatMultiplier; float num10 = (Object.op_Implicit((Object)(object)instance) ? instance.EnergySprintDrain : 1f) / deadHeadDummyStatMultiplier; float num11 = (Object.op_Implicit((Object)(object)instance) ? instance.MoveFriction : 5f); energy = Mathf.Min(energy, num9); Vector2 val4 = ((InputControl<Vector2>)(object)val.leftStick).ReadValue(); if (((Vector2)(ref val4)).sqrMagnitude < 0.01f) { val4 = Vector2.zero; } Vector3 val5 = default(Vector3); ((Vector3)(ref val5))..ctor(val4.x, 0f, val4.y); if (((Vector3)(ref val5)).sqrMagnitude > 1f) { ((Vector3)(ref val5)).Normalize(); } if (val.leftStickButton.isPressed && ((Vector3)(ref val5)).sqrMagnitude > 0.01f && !crouched && energy > 0f) { sprinting = true; canSlide = true; sprintGrace = 0.5f; sprintDrainTimer = 0.2f; sprintRechargeTimer = 1f; } else { sprinting = false; sprintLerp = 0f; sprintGrace = Mathf.Max(0f, sprintGrace - fixedDeltaTime); if (sprintGrace <= 0f) { canSlide = false; } } if (sprintDrainTimer > 0f) { float num12 = (num10 * deadHeadDummyStatMultiplier + (Object.op_Implicit((Object)(object)instance) ? instance.SprintSpeedUpgrades : 0f)) / deadHeadDummyStatMultiplier; energy = Mathf.Max(0f, energy - num12 * Mathf.Lerp(0f, 1f, sprintLerp) * fixedDeltaTime); sprintDrainTimer -= fixedDeltaTime; } if (!sprinting) { if (sprintRechargeTimer > 0f) { sprintRechargeTimer -= fixedDeltaTime; } else { energy = Mathf.Min(num9, energy + 2f * deadHeadDummyStatMultiplier * fixedDeltaTime); } } if (crouched && canSlide) { energy = Mathf.Max(0f, energy - 5f); canSlide = false; sliding = true; slideTimer = num5; } Vector3 val6 = Vector3.zero; if (sprinting) { float num13 = Mathf.Lerp(num, num2, sprintLerp); sprintLerp = Mathf.Clamp01(sprintLerp + num3 * fixedDeltaTime); val6 += val5 * num13; slideDirection = val5 * num13; slideDirectionCurrent = slideDirection; sliding = false; } else if (crouched) { if (slideTimer > 0f) { val6 += slideDirectionCurrent; slideDirectionCurrent -= slideDirection * num6 * fixedDeltaTime; slideTimer -= fixedDeltaTime; if (slideTimer <= 0f) { sliding = false; } } val6 += val5 * num4; } else { val6 += val5 * num; sliding = false; } if (velocityIdle) { relativeVelocityTarget = val6; } else { relativeVelocityTarget = Vector3.Lerp(relativeVelocityTarget, val6, num11 * fixedDeltaTime); } Vector3 val7 = proxy.transform.InverseTransformDirection(proxyBody.velocity); if (((Vector3)(ref relativeVelocityTarget)).magnitude > 0.1f) { velocityIdle = false; if (Object.op_Implicit((Object)(object)proxyCapsule) && Object.op_Implicit((Object)(object)instance) && Object.op_Implicit((Object)(object)instance.PhysicMaterialMove)) { ((Collider)proxyCapsule).material = instance.PhysicMaterialMove; } relativeVelocity = Vector3.Lerp(relativeVelocity, relativeVelocityTarget, num11 * fixedDeltaTime); relativeVelocity.y = val7.y; proxyBody.AddRelativeForce(relativeVelocity - val7, (ForceMode)1); } else { velocityIdle = true; if (Object.op_Implicit((Object)(object)proxyCapsule) && Object.op_Implicit((Object)(object)instance) && Object.op_Implicit((Object)(object)instance.PhysicMaterialIdle)) { ((Collider)proxyCapsule).material = instance.PhysicMaterialIdle; } relativeVelocity = Vector3.zero; relativeVelocityTarget = Vector3.zero; if (grounded) { Vector3 val8 = proxy.transform.InverseTransformDirection(proxyBody.velocity); val8.x = 0f; val8.z = 0f; proxyBody.velocity = proxy.transform.TransformDirection(val8); } } if (!grounded) { proxyBody.AddForce(Vector3.down * num8 * fixedDeltaTime, (ForceMode)1); } if (jumpBuffer > 0f && groundedBuffer > 0f && jumpCooldown <= 0f) { Vector3 val9 = default(Vector3); ((Vector3)(ref val9))..ctor(0f, proxyBody.velocity.y, 0f); proxyBody.AddForce(Vector3.up * num7 - val9, (ForceMode)1); jumpBuffer = 0f; groundedBuffer = 0f; groundedLatch = -1f; grounded = false; groundedDisableTimer = 0.1f; jumpCooldown = 0.1f; PlaySound((!Object.op_Implicit((Object)(object)soundPlayer)) ? null : soundPlayer.jumpSound, proxy.transform.position); } if (Object.op_Implicit((Object)(object)heldValuable)) { heldValuable.OverrideIndestructible(0.2f); heldValuable.OverrideBreakEffects(0.2f); if (Object.op_Implicit((Object)(object)heldCart)) { Traverse.Create((object)heldCart).Field("cartActive").SetValue((object)true); } if (Object.op_Implicit((Object)(object)heldBody) && Object.op_Implicit((Object)(object)playerCamera)) { PhysGrabber val10 = ((!Object.op_Implicit((Object)(object)soundPlayer)) ? null : soundPlayer.physGrabber); float num14 = ((!Object.op_Implicit((Object)(object)val10)) ? 0.9f : val10.springConstant); float num15 = ((!Object.op_Implicit((Object)(object)val10)) ? 0.5f : val10.dampingConstant); float num16 = ((!Object.op_Implicit((Object)(object)val10)) ? 4f : val10.forceConstant); float num17 = ((!Object.op_Implicit((Object)(object)val10)) ? 4f : val10.forceMax); float num18 = ((!Object.op_Implicit((Object)(object)val10)) ? 1f : val10.grabStrength); bool flag3 = !Object.op_Implicit((Object)(object)heldCart); if (flag3) { num14 *= 0.7f; num15 *= 1.2f; num16 *= 0.85f; } Vector3 val11 = ((Component)playerCamera).transform.position + ((Component)playerCamera).transform.forward * grabHoldDistance; Vector3 val12 = ((Component)heldBody).transform.TransformPoint(heldLocalPoint); Vector3 pointVelocity = heldBody.GetPointVelocity(val12); Vector3 val13 = Vector3.ClampMagnitude(val11 - val12, num17) * 10f; val13 = Vector3.ClampMagnitude(val13, num17); Vector3 val14 = Vector3.ClampMagnitude(val13 * num14 - pointVelocity * num15, num17); Vector3 val15 = val14 * 2f / Mathf.Max(heldBody.mass, 0.001f); float num19 = Mathf.Min(num18, 30f); float num20 = num18 / (1f + num19); float num21 = ((!(heldBody.mass < 2f)) ? 20f : 7f); float num22 = Mathf.Min((num18 - 1f) / num21, 0.9f); float num23 = Mathf.Lerp(num18, num20, num22); Vector3 val16 = val15 * num23 * num16; val16 *= Mathf.Min(Vector3.Distance(val11, val12) * 10f, 1f); val16 *= 0.65f * deadHeadDummyStatMultiplier; if (flag3 && val16.y > 0f && ((Component)playerCamera).transform.forward.y > 0.15f) { val16.y *= 1.05f; } if (Object.op_Implicit((Object)(object)heldCart)) { val16 *= 9f; } grabForceRamp = Mathf.Clamp01(grabForceRamp + fixedDeltaTime / 0.15f); val16 *= grabForceRamp; float num24 = ((!flag3) ? 0.8f : 0.35f); playerTwoCurrentGrabForce = Vector3.Lerp(playerTwoCurrentGrabForce, val16, num24); heldBody.AddForceAtPosition(playerTwoCurrentGrabForce, val12, (ForceMode)5); if (Object.op_Implicit((Object)(object)heldDummyGrabber)) { heldDummyGrabber.grabbed = true; heldDummyGrabber.physGrabForcesDisabledTimer = 0.2f; if (Object.op_Implicit((Object)(object)heldDummyGrabber.physGrabPoint)) { heldDummyGrabber.physGrabPoint.position = val12; } heldDummyGrabber.physGrabPointPullerPosition = val11; Traverse.Create((object)heldValuable).Field("grabDisplacementCurrent").SetValue((object)playerTwoCurrentGrabForce); } heldValuable.OverrideKnockOutOfGrabDisable(0.2f); } } if (Object.op_Implicit((Object)(object)heldStaticObject) && Object.op_Implicit((Object)(object)heldStaticTransform) && Object.op_Implicit((Object)(object)playerCamera)) { PhysGrabber val17 = ((!Object.op_Implicit((Object)(object)soundPlayer)) ? null : soundPlayer.physGrabber); if (Object.op_Implicit((Object)(object)val17) && Object.op_Implicit((Object)(object)val17.physGrabPoint)) { Vector3 val18 = heldStaticTransform.TransformPoint(heldStaticLocalPoint); Vector3 val19 = ((Component)playerCamera).transform.position + ((Component)playerCamera).transform.forward * grabHoldDistance; grabForceRamp = Mathf.Clamp01(grabForceRamp + fixedDeltaTime / 0.15f); val17.physGrabPoint.position = val18; val17.physGrabPointPullerPosition = Vector3.Lerp(val18, val19, grabForceRamp); } } } private void UpdateCarriedTumblePhysics() { //IL_00b8: 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_00bd: 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_00cf: 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_00d3: 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_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) //IL_00eb: 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_00fc: 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_0105: 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_0112: 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_011f: 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_012d: 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_014e: 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_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016b: 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_016f: 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_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: 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_0241: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Unknown result type (might be due to invalid IL or missing references) //IL_024b: 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_0256: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Unknown result type (might be due to invalid IL or missing references) //IL_0268: 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_026f: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_0286: Unknown result type (might be due to invalid IL or missing references) //IL_028b: Unknown result type (might be due to invalid IL or missing references) //IL_0290: 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_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_02b5: Unknown result type (might be due to invalid IL or missing references) //IL_02ba: Unknown result type (might be due to invalid IL or missing references) //IL_02bf: Unknown result type (might be due to invalid IL or missing references) //IL_02c7: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)tumbleBody) || !Object.op_Implicit((Object)(object)tumblePhysGrabObject) || tumblePhysGrabObject.playerGrabbing.Count == 0 || !GameManager.Multiplayer() || Traverse.Create((object)tumblePhysGrabObject).Field("isMaster").GetValue<bool>()) { return; } foreach (PhysGrabber item in tumblePhysGrabObject.playerGrabbing) { if (Object.op_Implicit((Object)(object)item)) { Transform value = Traverse.Create((object)item).Field("physGrabPoint").GetValue<Transform>(); Vector3 val = ((!Object.op_Implicit((Object)(object)value)) ? tumbleBody.worldCenterOfMass : value.position); Vector3 physGrabPointPullerPosition = item.physGrabPointPullerPosition; float forceMax = item.forceMax; Vector3 val2 = Vector3.ClampMagnitude(physGrabPointPullerPosition - val, forceMax) * 10f; val2 = Vector3.ClampMagnitude(val2, forceMax); Vector3 pointVelocity = tumbleBody.GetPointVelocity(val); Vector3 val3 = Vector3.ClampMagnitude(val2 * item.springConstant - pointVelocity * item.dampingConstant, forceMax); Vector3 val4 = val3 * 2f / Mathf.Max(tumbleBody.mass, 0.001f) * item.grabStrength * item.forceConstant; val4 *= Mathf.Min(Vector3.Distance(physGrabPointPullerPosition, val) * 10f, 1f); tumbleBody.AddForceAtPosition(val4, val, (ForceMode)5); Vector3 value2 = Traverse.Create((object)item).Field("cameraRelativeGrabbedForward").GetValue<Vector3>(); Vector3 value3 = Traverse.Create((object)item).Field("cameraRelativeGrabbedUp").GetValue<Vector3>(); PlayerAvatar value4 = Traverse.Create((object)item).Field("playerAvatar").GetValue<PlayerAvatar>(); Transform val5 = ((!Object.op_Implicit((Object)(object)value4) || !Object.op_Implicit((Object)(object)value4.localCamera)) ? null : value4.localCamera.GetOverrideTransform()); if (Object.op_Implicit((Object)(object)val5) && ((Vector3)(ref value2)).sqrMagnitude > 0.001f && ((Vector3)(ref value3)).sqrMagnitude > 0.001f) { Vector3 val6 = val5.TransformDirection(((Vector3)(ref value2)).normalized); Vector3 val7 = val5.TransformDirection(((Vector3)(ref value3)).normalized); Vector3 val8 = Vector3.Cross(tumbleRig.transform.forward, val6) + Vector3.Cross(tumbleRig.transform.up, val7); val8 = val8 * (12f * item.grabStrength) - tumbleBody.angularVelocity * 2f; tumbleBody.AddTorque(Vector3.ClampMagnitude(val8, 18f), (ForceMode)5); } } } } private void SpawnProxy(PlayerAvatar playerOne) { //IL_0007: 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_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown //IL_0053: 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_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: 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_032a: Unknown result type (might be due to invalid IL or missing references) //IL_03d0: Unknown result type (might be due to invalid IL or missing references) //IL_03da: Unknown result type (might be due to invalid IL or missing references) //IL_03df: Unknown result type (might be due to invalid IL or missing references) //IL_0415: Unknown result type (might be due to invalid IL or missing references) //IL_0422: Unknown result type (might be due to invalid IL or missing references) //IL_042c: Unknown result type (might be due to invalid IL or missing references) //IL_0431: Unknown result type (might be due to invalid IL or missing references) //IL_036d: Unknown result type (might be due to invalid IL or missing references) //IL_0372: Unknown result type (might be due to invalid IL or missing references) //IL_0377: Unknown result type (might be due to invalid IL or missing references) //IL_04e8: Unknown result type (might be due to invalid IL or missing references) //IL_04ed: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Component)playerOne).transform.position + ((Component)playerOne).transform.right * 1.5f; soundPlayer = playerOne; proxy = new GameObject(PlayerTwoName() + " Ghost Physics"); proxy.transform.position = position; proxyCapsule = proxy.AddComponent<CapsuleCollider>(); proxyCapsule.radius = 0.32f; proxyCapsule.height = 1.7f; proxyCapsule.center = new Vector3(0f, 0.85f, 0f); proxyBody = proxy.GetComponent<Rigidbody>(); if (!Object.op_Implicit((Object)(object)proxyBody)) { proxyBody = proxy.AddComponent<Rigidbody>(); } proxyBody.constraints = (RigidbodyConstraints)80; proxyBody.collisionDetectionMode = (CollisionDetectionMode)2; proxyBody.interpolation = (RigidbodyInterpolation)1; proxyBody.useGravity = true; PlayerController instance = PlayerController.instance; if (Object.op_Implicit((Object)(object)instance) && Object.op_Implicit((Object)(object)instance.rb)) { proxyBody.mass = instance.rb.mass; proxyBody.drag = instance.rb.drag; proxyBody.angularDrag = instance.rb.angularDrag; proxyBody.maxAngularVelocity = instance.rb.maxAngularVelocity; proxyBody.useGravity = instance.rb.useGravity; proxyBody.constraints = instance.rb.constraints; proxyBody.collisionDetectionMode = instance.rb.collisionDetectionMode; proxyBody.interpolation = instance.rb.interpolation; } if (Object.op_Implicit((Object)(object)instance) && Object.op_Implicit((Object)(object)instance.col)) { ((Collider)proxyCapsule).material = instance.col.material; Collider col = instance.col; CapsuleCollider val = (CapsuleCollider)(object)((col is CapsuleCollider) ? col : null); if (Object.op_Implicit((Object)(object)val)) { proxyCapsule.radius = val.radius; proxyCapsule.height = val.height; proxyCapsule.center = val.center; proxyCapsule.direction = val.direction; standingCapsuleHeight = val.height; standingCapsuleCenter = val.center; } } if (Object.op_Implicit((Object)(object)instance) && Object.op_Implicit((Object)(object)instance.PlayerCollision) && Object.op_Implicit((Object)(object)instance.PlayerCollision.StandCollision) && Object.op_Implicit((Object)(object)instance.PlayerCollision.CrouchCollision)) { float y = instance.PlayerCollision.StandCollision.localScale.y; if (Mathf.Abs(y) > 0.001f) { crouchCollisionRatio = instance.PlayerCollision.CrouchCollision.localScale.y / y; } } if (Object.op_Implicit((Object)(object)instance) && Object.op_Implicit((Object)(object)instance.CollisionGrounded)) { groundProbeOffset = ((Component)instance).transform.InverseTransformPoint(((Component)instance.CollisionGrounded).transform.position); SphereCollider component = ((Component)instance.CollisionGrounded).GetComponent<SphereCollider>(); if (Object.op_Implicit((Object)(object)component)) { groundProbeRadius = component.radius; } groundProbeMask = ((LayerMask)(ref instance.CollisionGrounded.LayerMask)).value; } standingCapsuleHeight *= 0.75f; standingCapsuleCenter *= 0.75f; CapsuleCollider obj = proxyCapsule; obj.radius *= 0.75f; proxyCapsule.height = standingCapsuleHeight; proxyCapsule.center = standingCapsuleCenter; groundProbeOffset *= 0.75f; groundProbeRadius *= 0.75f; energy = (Object.op_Implicit((Object)(object)instance) ? instance.EnergyStart : 100f) * GetDeadHeadDummyStatMultiplier(); PhysGrabObject component2 = proxy.GetComponent<PhysGrabObject>(); if (Object.op_Implicit((Object)(object)component2)) { component2.OverrideGrabDisable(999999f); } CreateCamera(); CreateGhostVisual(playerOne); CreatePlayerTwoFlashlight(playerOne); CreatePlayerTwoTts(playerOne); CreatePlayerTwoMapDevice(); CreateEnemyTarget(playerOne); CreateGrabberVisuals(playerOne); CreatePlayerOneVisualForPlayerTwo(playerOne); CreatePlayerTwoHud(); IgnoreActorCollisions(); soundLastPosition = proxy.transform.position; soundWasGrounded = true; try { CreateTumbleRig(playerOne); } catch (Exception ex) { Debug.LogWarning((object)("[Separate Monitor Player 2] Tumble physics could not initialize; Player 2 camera, HUD, and normal movement remain active. " + ex.Message)); if (Object.op_Implicit((Object)(object)tumbleRig)) { Object.Destroy((Object)(object)tumbleRig); } tumbleRig = null; tumbleBody = null; tumblePhysGrabObject = null; tumbleColliders = null; } } private void CreateEnemyTarget(PlayerAvatar playerOne) { //IL_0119: 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_0151: 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) if (Object.op_Implicit((Object)(object)proxy) && Object.op_Implicit((Object)(object)playerOne) && Object.op_Implicit((Object)(object)GameDirector.instance)) { proxy.tag = "Player"; Collider componentInChildren = ((Component)playerOne).GetComponentInChildren<Collider>(true); if (Object.op_Implicit((Object)(object)componentInChildren)) { proxy.layer = ((Component)componentInChildren).gameObject.layer; } PhotonView val = proxy.GetComponent<PhotonView>(); if (!Object.op_Implicit((Object)(object)val)) { val = proxy.AddComponent<PhotonView>(); } int num = (Object.op_Implicit((Object)(object)playerOne.photonView) ? (playerOne.photonView.ViewID / PhotonNetwork.MAX_VIEW_IDS * PhotonNetwork.MAX_VIEW_IDS) : 0); int num2 = num + PhotonNetwork.MAX_VIEW_IDS - 1; while (num2 > num && Object.op_Implicit((Object)(object)PhotonView.Find(num2))) { num2--; } if (num2 <= num) { num2 = 999999; } val.ViewID = num2; enemyVisionTransform = new GameObject(PlayerTwoName() + " Vision Point").transform; enemyVisionTransform.SetParent(proxy.transform, false); enemyVisionTransform.localPosition = Vector3.up * standingCapsuleHeight * 0.82f; enemyVisionTarget = proxy.AddComponent<PlayerVisionTarget>(); enemyVisionTarget.VisionTransform = enemyVisionTransform; ((Behaviour)enemyVisionTarget).enabled = false; enemyTargetAvatar = proxy.AddComponent<PlayerAvatar>(); ((Behaviour)enemyTargetAvatar).enabled = false; enemyTargetAvatar.PlayerVisionTarget = enemyVisionTarget; enemyTargetAvatar.physGrabber = CreateEnemyTargetGrabberStub(enemyTargetAvatar); Traverse.Create((object)enemyTargetAvatar).Field("steamID").SetValue((object)"DUMMYPlayer"); Traverse.Create((object)enemyTargetAvatar).Field("isDisabled").SetValue((object)false); Traverse.Create((object)enemyTargetAvatar).Field("isLocal").SetValue((object)false); } } private PhysGrabber CreateEnemyTargetGrabberStub(PlayerAvatar targetAvatar) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown GameObject val = new GameObject(PlayerTwoName() + " Enemy Target Grabber Stub"); val.transform.SetParent(proxy.transform, false); val.SetActive(false); LineRenderer val2 = val.AddComponent<LineRenderer>(); ((Renderer)val2).enabled = false; val2.positionCount = 0; PhysGrabBeam v