using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using ExitGames.Client.Photon; using HarmonyLib; using Microsoft.CodeAnalysis; using Photon.Pun; using Photon.Realtime; using UnityEngine; using UnityEngine.SceneManagement; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("Empress")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.10.0")] [assembly: AssemblyInformationalVersion("1.0.10+5f1b735e473ca4ccf3b383128fbebd889cb564da")] [assembly: AssemblyProduct("EmpressInteractiveTruckDoor")] [assembly: AssemblyTitle("EmpressInteractiveTruckDoor")] [assembly: AssemblyVersion("1.0.10.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace EmpressInteractiveTruckDoor { [BepInPlugin("empress.repo.interactivetruckdoor", "Empress Interactive Truck Door", "1.0.10")] public sealed class EmpressInteractiveTruckDoorPlugin : BaseUnityPlugin { internal const string EmpressPluginGuid = "empress.repo.interactivetruckdoor"; internal const string EmpressPluginName = "Empress Interactive Truck Door"; internal const string EmpressPluginVersion = "1.0.10"; internal ConfigEntry EmpressEnabled; internal ConfigEntry EmpressDoorTravel; internal ConfigEntry EmpressGrabTravelScale; internal ConfigEntry EmpressSyncInterval; internal ConfigEntry EmpressAllowClientPrediction; private Harmony? _empressHarmony; private float _empressNextDoorScanTime; private bool _empressPhotonEventsHooked; internal static EmpressInteractiveTruckDoorPlugin? Instance { get; private set; } internal static ManualLogSource EmpressLog => ((BaseUnityPlugin)Instance).Logger; private void Awake() { //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Expected O, but got Unknown Instance = this; EmpressHideChainloaderManager(((Component)this).gameObject, (Component)(object)this); EmpressEnabled = ((BaseUnityPlugin)this).Config.Bind("General", "Enabled", true, "Master switch for Empress Interactive Truck Door."); EmpressDoorTravel = ((BaseUnityPlugin)this).Config.Bind("Door", "DoorTravel", 2.5f, "Vertical distance the truck door travels from closed to open."); EmpressGrabTravelScale = ((BaseUnityPlugin)this).Config.Bind("Door", "GrabTravelScale", 1f, "How strongly vertical phys-grab movement maps into truck-door movement."); EmpressSyncInterval = ((BaseUnityPlugin)this).Config.Bind("Networking", "SyncInterval", 0.05f, "Minimum seconds between host door-position broadcasts."); EmpressAllowClientPrediction = ((BaseUnityPlugin)this).Config.Bind("Networking", "ClientPrediction", true, "Lets clients preview their own pull locally while waiting for the host correction."); _empressHarmony = new Harmony("empress.repo.interactivetruckdoor"); _empressHarmony.PatchAll(); SceneManager.sceneLoaded += EmpressOnSceneLoaded; ((BaseUnityPlugin)this).Logger.LogInfo((object)"Empress Interactive Truck Door 1.0.10 loaded. Host authority, Harmony access, Empress seal intact."); } private void OnDisable() { EmpressSetPhotonEventHook(enabled: false); SceneManager.sceneLoaded -= EmpressOnSceneLoaded; } private void Update() { EmpressSetPhotonEventHook(EmpressDoorSystemsCanRun()); if (!EmpressDoorSystemsCanRun() || Time.unscaledTime < _empressNextDoorScanTime) { return; } _empressNextDoorScanTime = Time.unscaledTime + 1f; TruckDoor[] array = Object.FindObjectsOfType(); foreach (TruckDoor val in array) { if ((Object)(object)val != (Object)null && (Object)(object)((Component)val).GetComponent() == (Object)null) { ((Component)val).gameObject.AddComponent().EmpressInitialize(val); } } } private static void EmpressOnSceneLoaded(Scene scene, LoadSceneMode mode) { if ((Object)(object)Instance != (Object)null) { EmpressHideChainloaderManager(((Component)Instance).gameObject, (Component)(object)Instance); } EmpressTruckDoorNetwork.EmpressClearSceneRegistry(); } internal static bool EmpressDoorSystemsCanRun() { if ((Object)(object)Instance == (Object)null || !Instance.EmpressEnabled.Value) { return false; } try { if ((Object)(object)RunManager.instance == (Object)null) { return false; } if (SemiFunc.MenuLevel() || SemiFunc.RunIsLobbyMenu() || SemiFunc.RunIsLobby()) { return false; } return SemiFunc.RunIsLevel() || SemiFunc.RunIsShop(); } catch { return false; } } private void EmpressSetPhotonEventHook(bool enabled) { LoadBalancingClient networkingClient = PhotonNetwork.NetworkingClient; bool flag = enabled && GameManager.Multiplayer() && PhotonNetwork.InRoom && networkingClient != null; if (flag != _empressPhotonEventsHooked) { if (flag && networkingClient != null) { networkingClient.EventReceived += EmpressTruckDoorNetwork.OnEmpressEvent; } else if (networkingClient != null) { networkingClient.EventReceived -= EmpressTruckDoorNetwork.OnEmpressEvent; } _empressPhotonEventsHooked = flag; } } private static void EmpressHideChainloaderManager(GameObject managerObject, Component pluginComponent) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: 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_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) ((Object)managerObject).hideFlags = (HideFlags)(((Object)managerObject).hideFlags | 0x3D); ((Object)pluginComponent).hideFlags = (HideFlags)(((Object)pluginComponent).hideFlags | 2); Transform[] componentsInChildren = managerObject.GetComponentsInChildren(true); foreach (Transform val in componentsInChildren) { if ((Object)(object)val == (Object)null) { continue; } GameObject gameObject = ((Component)val).gameObject; ((Object)gameObject).hideFlags = (HideFlags)(((Object)gameObject).hideFlags | 0x3D); Component[] components = gameObject.GetComponents(); foreach (Component val2 in components) { if ((Object)(object)val2 != (Object)null) { ((Object)val2).hideFlags = (HideFlags)(((Object)val2).hideFlags | 2); } } } } } internal static class EmpressTruckDoorNetwork { private const byte EmpressDoorRequestEvent = 88; private const byte EmpressDoorStateEvent = 89; private const string EmpressDoorRoomPropertyPrefix = "empress.itd."; private static readonly Dictionary EmpressDoorsById = new Dictionary(StringComparer.Ordinal); internal static void EmpressRegister(EmpressTruckDoorController controller) { if (!string.IsNullOrWhiteSpace(controller.EmpressDoorId)) { EmpressDoorsById[controller.EmpressDoorId] = controller; } } internal static void EmpressUnregister(EmpressTruckDoorController controller) { if (!string.IsNullOrWhiteSpace(controller.EmpressDoorId) && EmpressDoorsById.TryGetValue(controller.EmpressDoorId, out EmpressTruckDoorController value) && value == controller) { EmpressDoorsById.Remove(controller.EmpressDoorId); } } internal static void EmpressClearSceneRegistry() { EmpressDoorsById.Clear(); } internal static void EmpressRequestDoorPosition(string doorId, float openAmount) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Expected O, but got Unknown if (!GameManager.Multiplayer() || !PhotonNetwork.InRoom) { EmpressApplyHostDoorPosition(doorId, openAmount, broadcast: false); return; } if (PhotonNetwork.IsMasterClient) { EmpressApplyHostDoorPosition(doorId, openAmount, broadcast: true); return; } object[] array = new object[2] { doorId, Mathf.Clamp01(openAmount) }; PhotonNetwork.RaiseEvent((byte)88, (object)array, new RaiseEventOptions { Receivers = (ReceiverGroup)2 }, SendOptions.SendUnreliable); } internal static void EmpressBroadcastDoorPosition(string doorId, float openAmount) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Expected O, but got Unknown if (GameManager.Multiplayer() && PhotonNetwork.InRoom && PhotonNetwork.IsMasterClient) { float num = Mathf.Clamp01(openAmount); object[] array = new object[2] { doorId, num }; PhotonNetwork.RaiseEvent((byte)89, (object)array, new RaiseEventOptions { Receivers = (ReceiverGroup)0 }, SendOptions.SendUnreliable); Room currentRoom = PhotonNetwork.CurrentRoom; if (currentRoom != null) { currentRoom.SetCustomProperties(new Hashtable { [(object)("empress.itd." + doorId)] = num }, (Hashtable)null, (WebFlags)null); } } } internal static bool EmpressTryReadRoomDoorPosition(string doorId, out float openAmount) { openAmount = 0f; if (!GameManager.Multiplayer() || !PhotonNetwork.InRoom || PhotonNetwork.CurrentRoom == null) { return false; } string key = "empress.itd." + doorId; if (!((Dictionary)(object)((RoomInfo)PhotonNetwork.CurrentRoom).CustomProperties).TryGetValue((object)key, out object value)) { return false; } if (value is float num) { openAmount = Mathf.Clamp01(num); return true; } if (value is double num2) { openAmount = Mathf.Clamp01((float)num2); return true; } return false; } internal static void OnEmpressEvent(EventData photonEvent) { if ((photonEvent.Code != 88 && photonEvent.Code != 89) || !EmpressInteractiveTruckDoorPlugin.EmpressDoorSystemsCanRun() || !(photonEvent.CustomData is object[] array) || array.Length < 2) { return; } string text = (array[0] as string) ?? string.Empty; float openAmount = EmpressPayloadFloat(array[1]); if (string.IsNullOrWhiteSpace(text)) { return; } EmpressTruckDoorController value; if (photonEvent.Code == 88) { if (PhotonNetwork.IsMasterClient) { EmpressApplyHostDoorPosition(text, openAmount, broadcast: true); } } else if (!PhotonNetwork.IsMasterClient && EmpressDoorsById.TryGetValue(text, out value)) { value.EmpressApplyNetworkOpenAmount(openAmount); } } private static void EmpressApplyHostDoorPosition(string doorId, float openAmount, bool broadcast) { if (EmpressDoorsById.TryGetValue(doorId, out EmpressTruckDoorController value)) { value.EmpressApplyHostOpenAmount(openAmount, broadcast); } } private static float EmpressPayloadFloat(object value) { if (!(value is float num)) { if (!(value is double num2)) { if (value is int num3) { return Mathf.Clamp01((float)num3); } return 0f; } return Mathf.Clamp01((float)num2); } return Mathf.Clamp01(num); } } internal static class EmpressPhysGrabberAccess { internal static readonly FieldRef EmpressPlayerCamera = AccessTools.FieldRefAccess("playerCamera"); internal static readonly FieldRef EmpressGrabbedPhysGrabObject = AccessTools.FieldRefAccess("grabbedPhysGrabObject"); internal static readonly FieldRef EmpressGrabbedPhysGrabObjectCollider = AccessTools.FieldRefAccess("grabbedPhysGrabObjectCollider"); internal static readonly FieldRef EmpressGrabbedPhysGrabObjectColliderID = AccessTools.FieldRefAccess("grabbedPhysGrabObjectColliderID"); internal static readonly FieldRef EmpressGrabbedStaticGrabObject = AccessTools.FieldRefAccess("grabbedStaticGrabObject"); internal static readonly FieldRef EmpressGrabbedObjectTransform = AccessTools.FieldRefAccess("grabbedObjectTransform"); internal static readonly FieldRef EmpressGrabbedObject = AccessTools.FieldRefAccess("grabbedObject"); internal static readonly FieldRef EmpressPhysGrabPoint = AccessTools.FieldRefAccess("physGrabPoint"); internal static readonly FieldRef EmpressPhysGrabPointPuller = AccessTools.FieldRefAccess("physGrabPointPuller"); internal static readonly FieldRef EmpressPhysGrabPointPlane = AccessTools.FieldRefAccess("physGrabPointPlane"); internal static readonly FieldRef EmpressPhysGrabPointPosition = AccessTools.FieldRefAccess("physGrabPointPosition"); internal static readonly FieldRef EmpressPhysGrabPointPullerPosition = AccessTools.FieldRefAccess("physGrabPointPullerPosition"); internal static readonly FieldRef EmpressLocalGrabPosition = AccessTools.FieldRefAccess("localGrabPosition"); internal static readonly FieldRef EmpressPhysRotatingTimer = AccessTools.FieldRefAccess("physRotatingTimer"); internal static readonly FieldRef EmpressCameraRelativeGrabbedForward = AccessTools.FieldRefAccess("cameraRelativeGrabbedForward"); internal static readonly FieldRef EmpressCameraRelativeGrabbedUp = AccessTools.FieldRefAccess("cameraRelativeGrabbedUp"); internal static readonly FieldRef EmpressCameraRelativeGrabbedRight = AccessTools.FieldRefAccess("cameraRelativeGrabbedRight"); internal static readonly FieldRef EmpressIsLocal = AccessTools.FieldRefAccess("isLocal"); internal static readonly FieldRef EmpressInitialPressTimer = AccessTools.FieldRefAccess("initialPressTimer"); internal static readonly FieldRef EmpressPrevGrabbed = AccessTools.FieldRefAccess("prevGrabbed"); internal static readonly FieldRef EmpressGrabbed = AccessTools.FieldRefAccess("grabbed"); internal static readonly FieldRef EmpressMask = AccessTools.FieldRefAccess("mask"); internal static readonly FieldRef EmpressGrabRange = AccessTools.FieldRefAccess("grabRange"); internal static readonly Action EmpressPhysGrabPointActivate = AccessTools.MethodDelegate>(AccessTools.Method(typeof(PhysGrabber), "PhysGrabPointActivate", (Type[])null, (Type[])null), (object)null, true); } internal static class EmpressStaticGrabObjectAccess { internal static readonly FieldRef EmpressColliderTransform = AccessTools.FieldRefAccess("colliderTransform"); internal static readonly FieldRef EmpressGrabbed = AccessTools.FieldRefAccess("grabbed"); internal static readonly FieldRef> EmpressPlayerGrabbing = AccessTools.FieldRefAccess>("playerGrabbing"); } internal static class EmpressTruckDoorAccess { internal static readonly FieldRef EmpressDoorLoopStart = AccessTools.FieldRefAccess("doorLoopStart"); internal static readonly FieldRef EmpressDoorLoopEnd = AccessTools.FieldRefAccess("doorLoopEnd"); internal static readonly FieldRef EmpressDoorSound = AccessTools.FieldRefAccess("doorSound"); internal static readonly FieldRef EmpressStartYPosition = AccessTools.FieldRefAccess("startYPosition"); internal static readonly FieldRef EmpressFullyOpen = AccessTools.FieldRefAccess("fullyOpen"); internal static readonly FieldRef EmpressDoorEval = AccessTools.FieldRefAccess("doorEval"); internal static readonly FieldRef EmpressDoorCurve = AccessTools.FieldRefAccess("doorCurve"); internal static readonly FieldRef EmpressDoorMesh = AccessTools.FieldRefAccess("doorMesh"); internal static readonly FieldRef EmpressDoorOpen = AccessTools.FieldRefAccess("doorOpen"); internal static readonly FieldRef EmpressExtractionPointNearest = AccessTools.FieldRefAccess("extractionPointNearest"); internal static readonly FieldRef EmpressPlayerInTruckCheckTimer = AccessTools.FieldRefAccess("playerInTruckCheckTimer"); internal static readonly FieldRef EmpressTimeToCheck = AccessTools.FieldRefAccess("timeToCheck"); internal static readonly FieldRef EmpressIntroActivationDone = AccessTools.FieldRefAccess("introActivationDone"); } internal static class EmpressTutorialDirectorAccess { internal static readonly FieldRef EmpressTutorialActive = AccessTools.FieldRefAccess("tutorialActive"); } internal sealed class EmpressTruckDoorController : MonoBehaviour { private readonly struct EmpressDoorGrabSession { internal PhysGrabber EmpressGrabber { get; } internal float EmpressStartOpenAmount { get; } internal Vector3 EmpressStartPullerPosition { get; } internal EmpressDoorGrabSession(PhysGrabber grabber, float startOpenAmount, Vector3 startPullerPosition) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) EmpressGrabber = grabber; EmpressStartOpenAmount = startOpenAmount; EmpressStartPullerPosition = startPullerPosition; } } private const string EmpressGrabTargetName = "Empress.InteractiveTruckDoor.GrabTarget"; private const float EmpressClosedSnap = 0.025f; private const float EmpressOpenSnap = 0.975f; private readonly Dictionary _empressGrabSessions = new Dictionary(); private TruckDoor _empressDoor; private Transform _empressDoorTransform; private EmpressTruckDoorGrabTarget? _empressGrabTarget; private StaticGrabObject? _empressGrabStaticObject; private float _empressOpenAmount; private float _empressPublishedOpenAmount = -1f; private float _empressNextRequestTime; private float _empressNextBroadcastTime; private float _empressMovementAudioUntil; private bool _empressWasMoving; private bool _empressWasFullyOpen; private bool _empressWasFullyClosed = true; internal string EmpressDoorId { get; private set; } = string.Empty; internal void EmpressInitialize(TruckDoor truckDoor) { _empressDoor = truckDoor; _empressDoorTransform = ((Component)truckDoor).transform; EmpressDoorId = EmpressBuildDoorId(((Component)truckDoor).transform); _empressOpenAmount = Mathf.Clamp01(EmpressTruckDoorAccess.EmpressDoorEval.Invoke(truckDoor)); _empressWasFullyOpen = _empressOpenAmount >= 0.975f; _empressWasFullyClosed = _empressOpenAmount <= 0.025f; EmpressInstallGrabTarget(); EmpressTruckDoorNetwork.EmpressRegister(this); if (EmpressTruckDoorNetwork.EmpressTryReadRoomDoorPosition(EmpressDoorId, out var openAmount)) { EmpressApplyNetworkOpenAmount(openAmount); } else { EmpressApplyDoorTransform(_empressOpenAmount); } _empressPublishedOpenAmount = _empressOpenAmount; } private void OnDisable() { EmpressTruckDoorNetwork.EmpressUnregister(this); } private void Update() { if (EmpressInteractiveTruckDoorPlugin.EmpressDoorSystemsCanRun()) { EmpressTickLocalGrabSessions(); EmpressTickRemoteRoomCorrection(); EmpressMaintainGrabTargetTransform(); EmpressTickDoorAudioState(); } } internal bool EmpressTryBeginGrab(PhysGrabber grabber, RaycastHit hit) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: 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_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) if (!EmpressInteractiveTruckDoorPlugin.EmpressDoorSystemsCanRun() || (Object)(object)_empressGrabTarget == (Object)null || (Object)(object)_empressGrabStaticObject == (Object)null || (Object)(object)grabber == (Object)null) { return false; } Transform transform = ((Component)_empressGrabTarget).transform; Vector3 point = ((RaycastHit)(ref hit)).point; Camera val = EmpressPhysGrabberAccess.EmpressPlayerCamera.Invoke(grabber); float num = (((Object)(object)val != (Object)null) ? Vector3.Distance(((Component)val).transform.position, point) : 1f); Vector3 val2 = (((Object)(object)val != (Object)null) ? (((Component)val).transform.position + ((Component)val).transform.forward * num) : point); EmpressPhysGrabberAccess.EmpressGrabbedPhysGrabObject.Invoke(grabber) = null; EmpressPhysGrabberAccess.EmpressGrabbedPhysGrabObjectCollider.Invoke(grabber) = null; EmpressPhysGrabberAccess.EmpressGrabbedPhysGrabObjectColliderID.Invoke(grabber) = 0; EmpressPhysGrabberAccess.EmpressGrabbedStaticGrabObject.Invoke(grabber) = _empressGrabStaticObject; EmpressPhysGrabberAccess.EmpressGrabbedObjectTransform.Invoke(grabber) = transform; EmpressPhysGrabberAccess.EmpressGrabbedObject.Invoke(grabber) = null; EmpressPhysGrabberAccess.EmpressPhysGrabPointActivate(grabber); Transform val3 = EmpressPhysGrabberAccess.EmpressPhysGrabPoint.Invoke(grabber); Transform obj = EmpressPhysGrabberAccess.EmpressPhysGrabPointPuller.Invoke(grabber); Transform val4 = EmpressPhysGrabberAccess.EmpressPhysGrabPointPlane.Invoke(grabber); ((Component)obj).gameObject.SetActive(true); val3.position = point; val4.position = val2; obj.position = val2; EmpressPhysGrabberAccess.EmpressPhysGrabPointPosition.Invoke(grabber) = point; EmpressPhysGrabberAccess.EmpressPhysGrabPointPullerPosition.Invoke(grabber) = val2; EmpressPhysGrabberAccess.EmpressLocalGrabPosition.Invoke(grabber) = transform.InverseTransformPoint(point); if (EmpressPhysGrabberAccess.EmpressPhysRotatingTimer.Invoke(grabber) <= 0f && (Object)(object)Camera.main != (Object)null) { Transform transform2 = ((Component)Camera.main).transform; EmpressPhysGrabberAccess.EmpressCameraRelativeGrabbedForward.Invoke(grabber) = transform2.InverseTransformDirection(transform.forward); EmpressPhysGrabberAccess.EmpressCameraRelativeGrabbedUp.Invoke(grabber) = transform2.InverseTransformDirection(transform.up); EmpressPhysGrabberAccess.EmpressCameraRelativeGrabbedRight.Invoke(grabber) = transform2.InverseTransformDirection(transform.right); } EmpressPhysGrabberAccess.EmpressInitialPressTimer.Invoke(grabber) = 0.1f; EmpressPhysGrabberAccess.EmpressPrevGrabbed.Invoke(grabber) = EmpressPhysGrabberAccess.EmpressGrabbed.Invoke(grabber); EmpressPhysGrabberAccess.EmpressGrabbed.Invoke(grabber) = true; EmpressGrabStarted(grabber); return true; } internal void EmpressGrabStarted(PhysGrabber grabber) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)grabber == (Object)null) && !_empressGrabSessions.ContainsKey(grabber)) { Vector3 startPullerPosition = EmpressGrabberPullerPosition(grabber); _empressGrabSessions[grabber] = new EmpressDoorGrabSession(grabber, _empressOpenAmount, startPullerPosition); } } internal void EmpressGrabEnded(PhysGrabber grabber) { if ((Object)(object)grabber != (Object)null) { _empressGrabSessions.Remove(grabber); } } internal void EmpressApplyNetworkOpenAmount(float openAmount) { EmpressSetOpenAmount(openAmount, authoritative: true); } internal void EmpressApplyHostOpenAmount(float openAmount, bool broadcast) { if (EmpressCanHostDoor()) { EmpressSetOpenAmount(openAmount, authoritative: true); if (broadcast && Time.unscaledTime >= _empressNextBroadcastTime) { EmpressTruckDoorNetwork.EmpressBroadcastDoorPosition(EmpressDoorId, _empressOpenAmount); _empressNextBroadcastTime = Time.unscaledTime + Mathf.Max(0.01f, EmpressInteractiveTruckDoorPlugin.Instance.EmpressSyncInterval.Value); } } } private void EmpressTickLocalGrabSessions() { //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) if (_empressGrabSessions.Count == 0) { return; } foreach (PhysGrabber item in _empressGrabSessions.Keys.ToList()) { if ((Object)(object)item == (Object)null || !EmpressPhysGrabberAccess.EmpressGrabbed.Invoke(item)) { _empressGrabSessions.Remove(item); continue; } EmpressDoorGrabSession empressDoorGrabSession = _empressGrabSessions[item]; float num = Vector3.Dot(EmpressGrabberPullerPosition(item) - empressDoorGrabSession.EmpressStartPullerPosition, Vector3.up); float num2 = Mathf.Max(0.1f, EmpressInteractiveTruckDoorPlugin.Instance.EmpressDoorTravel.Value); float num3 = Mathf.Max(0.05f, EmpressInteractiveTruckDoorPlugin.Instance.EmpressGrabTravelScale.Value); float openAmount = Mathf.Clamp01(empressDoorGrabSession.EmpressStartOpenAmount + num / num2 * num3); if (EmpressCanHostDoor()) { EmpressApplyHostOpenAmount(openAmount, GameManager.Multiplayer()); continue; } if (EmpressInteractiveTruckDoorPlugin.Instance.EmpressAllowClientPrediction.Value) { EmpressSetOpenAmount(openAmount, authoritative: false); } if (Time.unscaledTime >= _empressNextRequestTime) { EmpressTruckDoorNetwork.EmpressRequestDoorPosition(EmpressDoorId, openAmount); _empressNextRequestTime = Time.unscaledTime + Mathf.Max(0.01f, EmpressInteractiveTruckDoorPlugin.Instance.EmpressSyncInterval.Value); } } } private void EmpressTickRemoteRoomCorrection() { if (GameManager.Multiplayer() && !PhotonNetwork.IsMasterClient && _empressGrabSessions.Count <= 0 && EmpressTruckDoorNetwork.EmpressTryReadRoomDoorPosition(EmpressDoorId, out var openAmount) && Mathf.Abs(openAmount - _empressOpenAmount) > 0.001f) { EmpressApplyNetworkOpenAmount(openAmount); } } private void EmpressSetOpenAmount(float openAmount, bool authoritative) { float num = Mathf.Clamp01(openAmount); if (!(Mathf.Abs(_empressOpenAmount - num) < 0.0005f)) { _empressMovementAudioUntil = Time.unscaledTime + 0.15f; _empressOpenAmount = num; EmpressApplyDoorTransform(num); if (authoritative) { _empressPublishedOpenAmount = num; } } } private void EmpressApplyDoorTransform(float openAmount) { //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_empressDoorTransform == (Object)null)) { float num = Mathf.Max(0.1f, EmpressInteractiveTruckDoorPlugin.Instance.EmpressDoorTravel.Value); AnimationCurve val = EmpressTruckDoorAccess.EmpressDoorCurve.Invoke(_empressDoor); float num2 = ((val != null && val.length > 0) ? val.Evaluate(Mathf.Clamp01(openAmount)) : Mathf.Clamp01(openAmount)); Vector3 position = _empressDoorTransform.position; _empressDoorTransform.position = new Vector3(position.x, EmpressTruckDoorAccess.EmpressStartYPosition.Invoke(_empressDoor) + num * num2, position.z); EmpressTruckDoorAccess.EmpressDoorEval.Invoke(_empressDoor) = Mathf.Clamp01(openAmount); EmpressTruckDoorAccess.EmpressDoorOpen.Invoke(_empressDoor) = openAmount > 0.025f; EmpressTruckDoorAccess.EmpressFullyOpen.Invoke(_empressDoor) = openAmount >= 0.975f; } } private void EmpressTickDoorAudioState() { //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) bool flag = Time.unscaledTime < _empressMovementAudioUntil || _empressGrabSessions.Count > 0; if (flag && !_empressWasMoving) { Sound obj = EmpressTruckDoorAccess.EmpressDoorLoopStart.Invoke(_empressDoor); if (obj != null) { obj.Play(_empressDoorTransform.position, 1f, 1f, 1f, 1f); } } if (!flag && _empressWasMoving) { Sound obj2 = EmpressTruckDoorAccess.EmpressDoorLoopEnd.Invoke(_empressDoor); if (obj2 != null) { obj2.Play(_empressDoorTransform.position, 1f, 1f, 1f, 1f); } } bool flag2 = _empressOpenAmount >= 0.975f; bool flag3 = _empressOpenAmount <= 0.025f; if ((flag2 && !_empressWasFullyOpen) || (flag3 && !_empressWasFullyClosed)) { Sound obj3 = EmpressTruckDoorAccess.EmpressDoorSound.Invoke(_empressDoor); if (obj3 != null) { obj3.Play(_empressDoorTransform.position, 1f, 1f, 1f, 1f); } GameDirector instance = GameDirector.instance; if (instance != null) { instance.CameraImpact.ShakeDistance(flag2 ? 5f : 3f, 3f, 8f, _empressDoorTransform.position, 0.1f); } } _empressWasMoving = flag; _empressWasFullyOpen = flag2; _empressWasFullyClosed = flag3; _empressPublishedOpenAmount = _empressOpenAmount; } private void EmpressInstallGrabTarget() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_empressGrabTarget != (Object)null)) { GameObject val = new GameObject("Empress.InteractiveTruckDoor.GrabTarget"); ((Object)val).hideFlags = (HideFlags)3; val.transform.SetParent((Transform)null, false); Bounds val2 = EmpressResolveDoorBounds(); val.transform.position = ((Bounds)(ref val2)).center; val.transform.rotation = _empressDoorTransform.rotation; val.transform.localScale = Vector3.one; BoxCollider val3 = val.AddComponent(); ((Collider)val3).isTrigger = true; val3.size = EmpressWorldSizeToLocal(val.transform, ((Bounds)(ref val2)).size); val3.size = new Vector3(Mathf.Max(val3.size.x, 1f), Mathf.Max(val3.size.y, 1f), Mathf.Max(val3.size.z, 0.25f)); _empressGrabStaticObject = val.AddComponent(); EmpressStaticGrabObjectAccess.EmpressColliderTransform.Invoke(_empressGrabStaticObject) = val.transform; _empressGrabTarget = val.AddComponent(); _empressGrabTarget.EmpressController = this; _empressGrabTarget.EmpressStaticGrabObject = _empressGrabStaticObject; EmpressMakePhysGrabVisible(val); } } private void EmpressMaintainGrabTargetTransform() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_empressGrabTarget == (Object)null)) { Bounds val = EmpressResolveDoorBounds(); Transform transform = ((Component)_empressGrabTarget).transform; transform.position = ((Bounds)(ref val)).center; transform.rotation = _empressDoorTransform.rotation; } } private Bounds EmpressResolveDoorBounds() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: 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_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) Transform val = EmpressTruckDoorAccess.EmpressDoorMesh.Invoke(_empressDoor); Transform val2 = (Transform)(((Object)(object)val != (Object)null) ? ((object)val) : ((object)_empressDoorTransform)); Renderer[] componentsInChildren = ((Component)val2).GetComponentsInChildren(true); if (componentsInChildren.Length != 0) { Bounds bounds = componentsInChildren[0].bounds; for (int i = 1; i < componentsInChildren.Length; i++) { ((Bounds)(ref bounds)).Encapsulate(componentsInChildren[i].bounds); } return bounds; } Collider[] componentsInChildren2 = ((Component)val2).GetComponentsInChildren(true); if (componentsInChildren2.Length != 0) { Bounds bounds2 = componentsInChildren2[0].bounds; for (int j = 1; j < componentsInChildren2.Length; j++) { ((Bounds)(ref bounds2)).Encapsulate(componentsInChildren2[j].bounds); } return bounds2; } return new Bounds(_empressDoorTransform.position + Vector3.up * 1.25f, new Vector3(3f, 2.5f, 0.35f)); } private static Vector3 EmpressWorldSizeToLocal(Transform transform, Vector3 worldSize) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) Vector3 lossyScale = transform.lossyScale; return new Vector3(worldSize.x / Mathf.Max(Mathf.Abs(lossyScale.x), 0.001f), worldSize.y / Mathf.Max(Mathf.Abs(lossyScale.y), 0.001f), worldSize.z / Mathf.Max(Mathf.Abs(lossyScale.z), 0.001f)); } private static void EmpressMakePhysGrabVisible(GameObject targetObject) { try { targetObject.tag = "Phys Grab Object"; } catch (Exception ex) { EmpressInteractiveTruckDoorPlugin.EmpressLog.LogWarning((object)("Empress truck door could not assign Phys Grab Object tag: " + ex.Message)); } int num = LayerMask.NameToLayer("PhysGrabObject"); if (num >= 0) { targetObject.layer = num; } } private static Vector3 EmpressGrabberPullerPosition(PhysGrabber grabber) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) Transform val = EmpressPhysGrabberAccess.EmpressPhysGrabPointPuller.Invoke(grabber); if ((Object)(object)val != (Object)null) { return val.position; } return EmpressPhysGrabberAccess.EmpressPhysGrabPointPullerPosition.Invoke(grabber); } private static bool EmpressCanHostDoor() { if (GameManager.Multiplayer()) { return PhotonNetwork.IsMasterClient; } return true; } private static string EmpressBuildDoorId(Transform transform) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) Stack stack = new Stack(); Transform val = transform; while ((Object)(object)val != (Object)null) { int siblingIndex = val.GetSiblingIndex(); stack.Push($"{((Object)val).name}[{siblingIndex}]"); val = val.parent; } Scene activeScene = SceneManager.GetActiveScene(); return ((Scene)(ref activeScene)).name + "/" + string.Join("/", stack); } } internal sealed class EmpressTruckDoorGrabTarget : MonoBehaviour { internal EmpressTruckDoorController EmpressController; internal StaticGrabObject EmpressStaticGrabObject; } [HarmonyPatch(typeof(PhysGrabber), "RayCheck")] internal static class EmpressPhysGrabberRayCheckTruckDoorPatch { private static bool Prefix(PhysGrabber __instance, bool _grab) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) if (!_grab || !EmpressInteractiveTruckDoorPlugin.EmpressDoorSystemsCanRun()) { return true; } Camera val = EmpressPhysGrabberAccess.EmpressPlayerCamera.Invoke(__instance); if ((Object)(object)val == (Object)null) { return true; } Vector3 position = ((Component)val).transform.position; Vector3 forward = ((Component)val).transform.forward; RaycastHit hit = default(RaycastHit); if (!Physics.Raycast(position, forward, ref hit, 10f, LayerMask.op_Implicit(EmpressPhysGrabberAccess.EmpressMask.Invoke(__instance)), (QueryTriggerInteraction)2)) { return true; } EmpressTruckDoorController empressTruckDoorController = EmpressFindDoorController(((RaycastHit)(ref hit)).collider); if ((Object)(object)empressTruckDoorController == (Object)null) { return true; } if (((RaycastHit)(ref hit)).distance > EmpressPhysGrabberAccess.EmpressGrabRange.Invoke(__instance)) { return true; } if (empressTruckDoorController.EmpressTryBeginGrab(__instance, hit)) { return false; } return true; } private static EmpressTruckDoorController? EmpressFindDoorController(Collider collider) { EmpressTruckDoorGrabTarget componentInParent = ((Component)collider).GetComponentInParent(); if ((Object)(object)componentInParent != (Object)null) { return componentInParent.EmpressController; } TruckDoor componentInParent2 = ((Component)collider).GetComponentInParent(); if (componentInParent2 == null) { return null; } return ((Component)componentInParent2).GetComponent(); } } [HarmonyPatch(typeof(TruckDoor), "Start")] internal static class EmpressTruckDoorStartPatch { private static void Postfix(TruckDoor __instance) { if (EmpressInteractiveTruckDoorPlugin.EmpressDoorSystemsCanRun() && !((Object)(object)((Component)__instance).GetComponent() != (Object)null)) { ((Component)__instance).gameObject.AddComponent().EmpressInitialize(__instance); } } } [HarmonyPatch(typeof(TruckDoor), "Update")] internal static class EmpressTruckDoorUpdatePatch { private static bool Prefix(TruckDoor __instance) { if (!EmpressInteractiveTruckDoorPlugin.EmpressDoorSystemsCanRun()) { return true; } EmpressRunOriginalTruckSafetyChecks(__instance); return false; } private static void EmpressRunOriginalTruckSafetyChecks(TruckDoor door) { if (!EmpressTruckDoorAccess.EmpressTimeToCheck.Invoke(door)) { return; } float num = EmpressTruckDoorAccess.EmpressPlayerInTruckCheckTimer.Invoke(door); if (num > 0f) { EmpressTruckDoorAccess.EmpressPlayerInTruckCheckTimer.Invoke(door) = num - Time.deltaTime; return; } EmpressTruckDoorAccess.EmpressPlayerInTruckCheckTimer.Invoke(door) = 0.5f; if (EmpressTruckDoorAccess.EmpressIntroActivationDone.Invoke(door) || SemiFunc.PlayersAllInTruck()) { return; } EmpressTruckDoorAccess.EmpressIntroActivationDone.Invoke(door) = true; TutorialDirector instance = TutorialDirector.instance; if (!((Object)(object)instance != (Object)null) || !EmpressTutorialDirectorAccess.EmpressTutorialActive.Invoke(instance)) { ExtractionPoint obj = EmpressTruckDoorAccess.EmpressExtractionPointNearest.Invoke(door); if (obj != null) { obj.ActivateTheFirstExtractionPointAutomaticallyWhenAPlayerLeaveTruck(); } } } } [HarmonyPatch(typeof(StaticGrabObject), "Start")] internal static class EmpressStaticGrabObjectStartPatch { private static bool Prefix(StaticGrabObject __instance) { return (Object)(object)((Component)__instance).GetComponent() == (Object)null; } } [HarmonyPatch(typeof(StaticGrabObject), "Update")] internal static class EmpressStaticGrabObjectUpdatePatch { private static bool Prefix(StaticGrabObject __instance) { return (Object)(object)((Component)__instance).GetComponent() == (Object)null; } } [HarmonyPatch(typeof(StaticGrabObject), "GrabLink")] internal static class EmpressStaticGrabObjectGrabLinkPatch { private static bool Prefix(StaticGrabObject __instance, int playerPhotonID, Vector3 point) { //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)((Component)__instance).GetComponent() == (Object)null) { return true; } PhotonView val = PhotonView.Find(playerPhotonID); PhysGrabber val2 = (((Object)(object)val != (Object)null) ? ((Component)val).GetComponent() : null); if ((Object)(object)val2 == (Object)null) { return false; } Transform val3 = EmpressStaticGrabObjectAccess.EmpressColliderTransform.Invoke(__instance); if ((Object)(object)val3 == (Object)null) { val3 = ((Component)__instance).transform; } EmpressPhysGrabberAccess.EmpressPhysGrabPoint.Invoke(val2).position = point; EmpressPhysGrabberAccess.EmpressLocalGrabPosition.Invoke(val2) = val3.InverseTransformPoint(point); EmpressPhysGrabberAccess.EmpressGrabbedObjectTransform.Invoke(val2) = val3; EmpressPhysGrabberAccess.EmpressGrabbed.Invoke(val2) = true; return false; } } [HarmonyPatch(typeof(StaticGrabObject), "GrabStarted")] internal static class EmpressStaticGrabObjectGrabStartedPatch { private static bool Prefix(StaticGrabObject __instance, PhysGrabber player) { EmpressTruckDoorGrabTarget component = ((Component)__instance).GetComponent(); if ((Object)(object)component == (Object)null) { return true; } EmpressStaticGrabObjectAccess.EmpressGrabbed.Invoke(__instance) = true; List list = EmpressStaticGrabObjectAccess.EmpressPlayerGrabbing.Invoke(__instance); if (!list.Contains(player)) { list.Add(player); } component.EmpressController.EmpressGrabStarted(player); return false; } } [HarmonyPatch(typeof(StaticGrabObject), "GrabEnded")] internal static class EmpressStaticGrabObjectGrabEndedPatch { private static bool Prefix(StaticGrabObject __instance, PhysGrabber player) { EmpressTruckDoorGrabTarget component = ((Component)__instance).GetComponent(); if ((Object)(object)component == (Object)null) { return true; } EmpressStaticGrabObjectAccess.EmpressGrabbed.Invoke(__instance) = false; EmpressStaticGrabObjectAccess.EmpressPlayerGrabbing.Invoke(__instance).Remove(player); component.EmpressController.EmpressGrabEnded(player); return false; } } }