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 Empress Cinematic v2.0.0
CinematicOverhaul.dll
Decompiled 2 months agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using Microsoft.CodeAnalysis; using UnityEngine; [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("Omniscye")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+5f1b735e473ca4ccf3b383128fbebd889cb564da")] [assembly: AssemblyProduct("CinematicOverhaul")] [assembly: AssemblyTitle("CinematicOverhaul")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [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; } } } [BepInPlugin("com.empress.cinematic", "Empress Cinematic", "2.1.3")] public class EmpressCinematic : BaseUnityPlugin { private ConfigEntry<KeyCode> MenuKey; private bool showUI; private Rect windowRect = new Rect(20f, 20f, 450f, 750f); private Vector2 scrollPosition; private bool cineCameraEnabled; private bool cineCameraLocked; private bool wasCineCameraEnabled; private GameObject tpcObject; private Camera tpcRootCam; private List<Camera> tpcAllCams = new List<Camera>(); private List<Behaviour> tpcAllPostLayers = new List<Behaviour>(); private Camera originalMainCameraRef; private List<Camera> originalAllCams = new List<Camera>(); private string originalMainCameraTag; private bool originalMainCameraEnabled; private Dictionary<Camera, int> originalCullingMasks = new Dictionary<Camera, int>(); private float flySpeed = 5f; private float flySpeedFastMultiplier = 3f; private float mouseSensitivity = 2f; private float rotationX; private float rotationY; private float cameraRoll; private bool shadowsEnabled = true; private float ambientIntensity = 1f; private float timeScale = 1f; private bool fovEnabled; private float fovValue = 60f; private bool smoothEnabled; private float smoothValue = 2f; private bool satEnabled; private float satValue; private bool conEnabled; private float conValue; private bool vigEnabled; private float vigIntensity = 0.5f; private float vigSmoothness = 0.5f; private Color vigColor = Color.black; private bool effectMatrix; private bool effectNoir; private bool effectPsycho; private float psychoTimer; private bool animSprinting; private bool animSliding; private bool animSlidingImpulse; private bool animJumping; private bool animJumpingImpulse; private float animJumpTimer; private float animJumpedTimer; private float animFallingTimer; private bool animTumbling; private Texture2D windowBg; private Texture2D buttonBg; private Texture2D buttonHoverBg; private Texture2D sliderBg; private Texture2D sliderThumb; private GUIStyle windowStyle; private GUIStyle buttonStyle; private GUIStyle labelStyle; private GUIStyle headerStyle; private GUIStyle sliderStyle; private GUIStyle sliderThumbStyle; private GUIStyle toggleStyle; private Transform flashlightOriginalParent; private Vector3 flashlightOriginalLocalPos; private Quaternion flashlightOriginalLocalRot; private Vector3 flashlightOriginalLocalScale; private bool flashlightRebound; private int flashlightLayer = -1; private int playerLayer = -1; private void Awake() { ((Component)this).gameObject.transform.parent = null; ((Object)((Component)this).gameObject).hideFlags = (HideFlags)61; Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject); MenuKey = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("General", "CinematicMenuKey", (KeyCode)120, "Key to toggle the Empress Cinematic Menu"); } private void Start() { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Expected O, but got Unknown //IL_0029: 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_004b: Expected O, but got Unknown //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Expected O, but got Unknown //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Expected O, but got Unknown //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Expected O, but got Unknown //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Invalid comparison between Unknown and I4 windowBg = new Texture2D(1, 1); windowBg.SetPixel(0, 0, new Color(0.05f, 0f, 0f, 0.95f)); windowBg.Apply(); buttonBg = new Texture2D(1, 1); buttonBg.SetPixel(0, 0, new Color(0.4f, 0f, 0f, 1f)); buttonBg.Apply(); buttonHoverBg = new Texture2D(1, 1); buttonHoverBg.SetPixel(0, 0, new Color(0.7f, 0f, 0f, 1f)); buttonHoverBg.Apply(); sliderBg = new Texture2D(1, 1); sliderBg.SetPixel(0, 0, new Color(0.2f, 0f, 0f, 1f)); sliderBg.Apply(); sliderThumb = new Texture2D(1, 1); sliderThumb.SetPixel(0, 0, Color.red); sliderThumb.Apply(); shadowsEnabled = (int)QualitySettings.shadows > 0; try { ambientIntensity = RenderSettings.ambientIntensity; } catch { } } private void Update() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) if (Input.GetKeyDown(MenuKey.Value)) { showUI = !showUI; if (showUI) { Cursor.visible = true; Cursor.lockState = (CursorLockMode)0; } else { if (Object.op_Implicit((Object)(object)GameDirector.instance)) { GameDirector.instance.SetDisableInput(0f); } Cursor.visible = false; Cursor.lockState = (CursorLockMode)1; } } if (showUI) { if (Object.op_Implicit((Object)(object)GameDirector.instance)) { GameDirector.instance.SetDisableInput(0.1f); } Cursor.visible = true; Cursor.lockState = (CursorLockMode)0; } if (effectPsycho) { psychoTimer += Time.deltaTime; cameraRoll = Mathf.Sin(psychoTimer) * 10f; fovValue = 60f + Mathf.Sin(psychoTimer * 2f) * 20f; fovEnabled = true; } HandleCinematicCamera(); ApplyPostProcessingOverrides(); if (cineCameraEnabled) { KeepLocalPlayerVisible(); SyncFlashlightToClientHand(); } } private void ApplyPostProcessingOverrides() { //IL_00b2: 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_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_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_0215: Unknown result type (might be due to invalid IL or missing references) if (fovEnabled && Object.op_Implicit((Object)(object)CameraZoom.Instance)) { CameraZoom.Instance.OverrideZoomSet(fovValue, 0.1f, 100f, 100f, ((Component)this).gameObject, -999); } if (smoothEnabled && Object.op_Implicit((Object)(object)CameraAim.Instance)) { CameraAim.Instance.OverrideAimSmooth(smoothValue, 0.1f); } if (Object.op_Implicit((Object)(object)PostProcessing.Instance)) { float num = (satEnabled ? satValue : 0f); float num2 = (conEnabled ? conValue : 0f); Color val = (vigEnabled ? vigColor : Color.black); float num3 = (vigEnabled ? vigIntensity : 0f); float num4 = (vigEnabled ? vigSmoothness : 0f); if (effectMatrix) { num = -50f; num2 = 50f; val = Color.green; num3 = 0.4f; num4 = 1f; } else if (effectNoir) { num = -100f; num2 = 30f; val = Color.black; num3 = 0.6f; num4 = 0.6f; } else if (effectPsycho) { num = 100f; num2 = 20f; val = Color.HSVToRGB(Mathf.Repeat(Time.time, 1f), 1f, 1f); num3 = 0.5f; } if (satEnabled || effectMatrix || effectNoir || effectPsycho) { PostProcessing.Instance.SaturationOverride(num, 100f, 100f, 0.1f, ((Component)this).gameObject); } if (conEnabled || effectMatrix || effectNoir || effectPsycho) { PostProcessing.Instance.ContrastOverride(num2, 100f, 100f, 0.1f, ((Component)this).gameObject); } if (vigEnabled || effectMatrix || effectNoir || effectPsycho) { PostProcessing.Instance.VignetteOverride(val, num3, num4, 100f, 100f, 0.1f, ((Component)this).gameObject); } } } private void HandleCinematicCamera() { //IL_074c: Unknown result type (might be due to invalid IL or missing references) //IL_0751: Unknown result type (might be due to invalid IL or missing references) //IL_075c: Unknown result type (might be due to invalid IL or missing references) //IL_0769: Unknown result type (might be due to invalid IL or missing references) //IL_076e: Unknown result type (might be due to invalid IL or missing references) //IL_0773: Unknown result type (might be due to invalid IL or missing references) //IL_077e: Unknown result type (might be due to invalid IL or missing references) //IL_078b: Unknown result type (might be due to invalid IL or missing references) //IL_0790: Unknown result type (might be due to invalid IL or missing references) //IL_0795: Unknown result type (might be due to invalid IL or missing references) //IL_07a0: Unknown result type (might be due to invalid IL or missing references) //IL_07ad: Unknown result type (might be due to invalid IL or missing references) //IL_07b2: Unknown result type (might be due to invalid IL or missing references) //IL_07b7: Unknown result type (might be due to invalid IL or missing references) //IL_07c2: 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_07d4: Unknown result type (might be due to invalid IL or missing references) //IL_07d9: Unknown result type (might be due to invalid IL or missing references) //IL_07e4: Unknown result type (might be due to invalid IL or missing references) //IL_07e6: Unknown result type (might be due to invalid IL or missing references) //IL_07eb: Unknown result type (might be due to invalid IL or missing references) //IL_07f0: Unknown result type (might be due to invalid IL or missing references) //IL_0815: Unknown result type (might be due to invalid IL or missing references) //IL_081a: Unknown result type (might be due to invalid IL or missing references) //IL_081e: Unknown result type (might be due to invalid IL or missing references) //IL_0828: Unknown result type (might be due to invalid IL or missing references) //IL_082d: Unknown result type (might be due to invalid IL or missing references) //IL_07fb: Unknown result type (might be due to invalid IL or missing references) //IL_07fd: Unknown result type (might be due to invalid IL or missing references) //IL_0802: Unknown result type (might be due to invalid IL or missing references) //IL_0807: Unknown result type (might be due to invalid IL or missing references) //IL_08df: Unknown result type (might be due to invalid IL or missing references) //IL_08b6: Unknown result type (might be due to invalid IL or missing references) //IL_037a: Unknown result type (might be due to invalid IL or missing references) //IL_0380: Unknown result type (might be due to invalid IL or missing references) //IL_038a: Unknown result type (might be due to invalid IL or missing references) //IL_038f: Unknown result type (might be due to invalid IL or missing references) //IL_0394: Unknown result type (might be due to invalid IL or missing references) //IL_039e: Unknown result type (might be due to invalid IL or missing references) //IL_03a3: Unknown result type (might be due to invalid IL or missing references) //IL_03b9: Unknown result type (might be due to invalid IL or missing references) //IL_03c5: Unknown result type (might be due to invalid IL or missing references) //IL_03d6: Unknown result type (might be due to invalid IL or missing references) if (cineCameraEnabled != wasCineCameraEnabled) { if (cineCameraEnabled) { if (Object.op_Implicit((Object)(object)Camera.main)) { Camera val = (originalMainCameraRef = Camera.main); originalMainCameraTag = ((Component)val).tag; originalMainCameraEnabled = ((Behaviour)val).enabled; originalAllCams.Clear(); originalAllCams.AddRange(((Component)val).GetComponentsInChildren<Camera>(true)); originalCullingMasks.Clear(); foreach (Camera originalAllCam in originalAllCams) { originalCullingMasks[originalAllCam] = originalAllCam.cullingMask; } if (!Object.op_Implicit((Object)(object)tpcObject)) { tpcObject = Object.Instantiate<GameObject>(((Component)val).gameObject); } else { tpcObject.SetActive(true); } ((Object)tpcObject).name = "EmpressCinematicCam"; tpcObject.tag = "MainCamera"; AudioListener component = tpcObject.GetComponent<AudioListener>(); if (Object.op_Implicit((Object)(object)component)) { ((Behaviour)component).enabled = false; } MonoBehaviour[] components = tpcObject.GetComponents<MonoBehaviour>(); foreach (MonoBehaviour val2 in components) { string name = ((object)val2).GetType().Name; if (name.Contains("CameraZoom") || name.Contains("CameraAim") || name.Contains("GameDirector") || name.Contains("Recorder")) { ((Behaviour)val2).enabled = false; } } tpcAllCams.Clear(); tpcAllCams.AddRange(tpcObject.GetComponentsInChildren<Camera>(true)); tpcRootCam = tpcObject.GetComponent<Camera>(); foreach (Camera tpcAllCam in tpcAllCams) { ((Behaviour)tpcAllCam).enabled = true; tpcAllCam.depth = originalMainCameraRef.depth + 10f; tpcAllCam.useOcclusionCulling = false; tpcAllCam.layerCullSpherical = true; float[] array = new float[32]; for (int j = 0; j < 32; j++) { array[j] = 100000f; } tpcAllCam.layerCullDistances = array; if (tpcAllCam.farClipPlane < 2000f) { tpcAllCam.farClipPlane = 2000f; } if ((Object)(object)CameraZoom.Instance != (Object)null && CameraZoom.Instance.cams != null && !CameraZoom.Instance.cams.Contains(tpcAllCam)) { CameraZoom.Instance.cams.Add(tpcAllCam); } } tpcAllPostLayers.Clear(); Behaviour[] componentsInChildren = tpcObject.GetComponentsInChildren<Behaviour>(true); foreach (Behaviour val3 in componentsInChildren) { if (Object.op_Implicit((Object)(object)val3) && ((object)val3).GetType().Name == "PostProcessLayer") { PropertyInfo property = ((object)val3).GetType().GetProperty("volumeTrigger"); if (property != null) { property.SetValue(val3, tpcObject.transform); } val3.enabled = true; tpcAllPostLayers.Add(val3); } } Transform val4 = (Object.op_Implicit((Object)(object)CameraAim.Instance) ? ((Component)CameraAim.Instance).transform : ((Component)val).transform); tpcObject.transform.position = val4.position - val4.forward * 2f + Vector3.up * 0.5f; tpcObject.transform.rotation = val4.rotation; rotationX = val4.eulerAngles.y; rotationY = val4.eulerAngles.x; foreach (Camera originalAllCam2 in originalAllCams) { originalAllCam2.cullingMask = 0; } ((Component)val).tag = "Untagged"; } if (Object.op_Implicit((Object)(object)HUD.instance)) { HUD.instance.Hide(); } if (Object.op_Implicit((Object)(object)PlayerAvatar.instance) && Object.op_Implicit((Object)(object)PlayerAvatar.instance.playerAvatarVisuals)) { PlayerAvatar.instance.playerAvatarVisuals.ShowSelfOverride(0.25f); PlayerAvatar.instance.playerAvatarVisuals.meshParent.SetActive(true); ((Behaviour)PlayerAvatar.instance.playerAvatarVisuals.animator).enabled = true; SkinnedMeshRenderer[] componentsInChildren2 = ((Component)PlayerAvatar.instance.playerAvatarVisuals).GetComponentsInChildren<SkinnedMeshRenderer>(); for (int i = 0; i < componentsInChildren2.Length; i++) { ((Renderer)componentsInChildren2[i]).enabled = true; } playerLayer = PlayerAvatar.instance.playerAvatarVisuals.meshParent.layer; } BindFlashlightToClientHand(enable: true); ApplyFlashlightCameraMaskRouting(); } else { if (Object.op_Implicit((Object)(object)originalMainCameraRef)) { foreach (Camera originalAllCam3 in originalAllCams) { if (originalCullingMasks.TryGetValue(originalAllCam3, out var value)) { originalAllCam3.cullingMask = value; } } ((Component)originalMainCameraRef).tag = originalMainCameraTag; ((Behaviour)originalMainCameraRef).enabled = originalMainCameraEnabled; } if ((Object)(object)CameraZoom.Instance != (Object)null && CameraZoom.Instance.cams != null) { foreach (Camera tpcAllCam2 in tpcAllCams) { CameraZoom.Instance.cams.Remove(tpcAllCam2); } } if (Object.op_Implicit((Object)(object)tpcObject)) { tpcObject.tag = "Untagged"; tpcObject.SetActive(false); } if (Object.op_Implicit((Object)(object)HUD.instance)) { HUD.instance.Show(); } if (Object.op_Implicit((Object)(object)PlayerAvatar.instance) && Object.op_Implicit((Object)(object)PlayerAvatar.instance.playerAvatarVisuals)) { SkinnedMeshRenderer[] componentsInChildren2 = ((Component)PlayerAvatar.instance.playerAvatarVisuals).GetComponentsInChildren<SkinnedMeshRenderer>(); for (int i = 0; i < componentsInChildren2.Length; i++) { ((Renderer)componentsInChildren2[i]).enabled = true; } PlayerAvatar.instance.playerAvatarVisuals.ShowSelfOverride(0f); if (!PlayerAvatar.instance.playerAvatarVisuals.isMenuAvatar && (!GameManager.Multiplayer() || PlayerAvatar.instance.photonView.IsMine)) { PlayerAvatar.instance.playerAvatarVisuals.meshParent.SetActive(false); ((Behaviour)PlayerAvatar.instance.playerAvatarVisuals.animator).enabled = false; } } BindFlashlightToClientHand(enable: false); cineCameraLocked = false; effectMatrix = false; effectNoir = false; effectPsycho = false; cameraRoll = 0f; } wasCineCameraEnabled = cineCameraEnabled; } if (!cineCameraEnabled || !Object.op_Implicit((Object)(object)tpcObject)) { return; } if (!cineCameraLocked && showUI) { float num = flySpeed; if (Input.GetKey((KeyCode)304)) { num *= flySpeedFastMultiplier; } Vector3 val5 = Vector3.zero; if (Input.GetKey((KeyCode)119)) { val5 += tpcObject.transform.forward; } if (Input.GetKey((KeyCode)115)) { val5 -= tpcObject.transform.forward; } if (Input.GetKey((KeyCode)97)) { val5 -= tpcObject.transform.right; } if (Input.GetKey((KeyCode)100)) { val5 += tpcObject.transform.right; } if (Input.GetKey((KeyCode)101)) { val5 += Vector3.up; } if (Input.GetKey((KeyCode)113)) { val5 -= Vector3.up; } Transform transform = tpcObject.transform; transform.position += val5 * num * Time.deltaTime; if (Input.GetMouseButton(1)) { rotationX += Input.GetAxis("Mouse X") * mouseSensitivity; rotationY -= Input.GetAxis("Mouse Y") * mouseSensitivity; rotationY = Mathf.Clamp(rotationY, -90f, 90f); tpcObject.transform.rotation = Quaternion.Euler(rotationY, rotationX, cameraRoll); } else { tpcObject.transform.rotation = Quaternion.Euler(rotationY, rotationX, cameraRoll); } } if (Object.op_Implicit((Object)(object)PlayerAvatar.instance) && Object.op_Implicit((Object)(object)PlayerAvatar.instance.playerAvatarVisuals)) { KeepLocalPlayerVisible(); UpdateLocalPlayerAnimation(PlayerAvatar.instance.playerAvatarVisuals, PlayerAvatar.instance); } } private void KeepLocalPlayerVisible() { if (Object.op_Implicit((Object)(object)PlayerAvatar.instance) && Object.op_Implicit((Object)(object)PlayerAvatar.instance.playerAvatarVisuals)) { PlayerAvatarVisuals playerAvatarVisuals = PlayerAvatar.instance.playerAvatarVisuals; playerAvatarVisuals.ShowSelfOverride(0.25f); if (Object.op_Implicit((Object)(object)playerAvatarVisuals.meshParent) && !playerAvatarVisuals.meshParent.activeSelf) { playerAvatarVisuals.meshParent.SetActive(true); } if (Object.op_Implicit((Object)(object)playerAvatarVisuals.animator) && !((Behaviour)playerAvatarVisuals.animator).enabled) { ((Behaviour)playerAvatarVisuals.animator).enabled = true; } } } private void ApplyFlashlightCameraMaskRouting() { if (flashlightLayer < 0) { return; } foreach (Camera tpcAllCam in tpcAllCams) { if (playerLayer >= 0 && (tpcAllCam.cullingMask & (1 << playerLayer)) != 0) { tpcAllCam.cullingMask |= 1 << flashlightLayer; } else { tpcAllCam.cullingMask &= ~(1 << flashlightLayer); } } } private void BindFlashlightToClientHand(bool enable) { //IL_0104: 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_0126: 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_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) FlashlightController instance = FlashlightController.Instance; if ((Object)(object)instance == (Object)null) { return; } if (enable) { if (!((Object)(object)instance.FollowTransformClient == (Object)null)) { if (!flashlightRebound) { flashlightOriginalParent = ((Component)instance).transform.parent; flashlightOriginalLocalPos = ((Component)instance).transform.localPosition; flashlightOriginalLocalRot = ((Component)instance).transform.localRotation; flashlightOriginalLocalScale = ((Component)instance).transform.localScale; flashlightRebound = true; } flashlightLayer = ((Component)instance).gameObject.layer; ((Component)instance).transform.SetParent(instance.FollowTransformClient, false); ((Component)instance).transform.localPosition = Vector3.zero; ((Component)instance).transform.localRotation = Quaternion.identity; Renderer[] componentsInChildren = ((Component)instance).GetComponentsInChildren<Renderer>(true); foreach (Renderer obj in componentsInChildren) { obj.forceRenderingOff = false; obj.allowOcclusionWhenDynamic = false; } } } else if (flashlightRebound) { ((Component)instance).transform.SetParent(flashlightOriginalParent, false); ((Component)instance).transform.localPosition = flashlightOriginalLocalPos; ((Component)instance).transform.localRotation = flashlightOriginalLocalRot; ((Component)instance).transform.localScale = flashlightOriginalLocalScale; flashlightRebound = false; flashlightOriginalParent = null; flashlightLayer = -1; } } private void SyncFlashlightToClientHand() { //IL_0033: 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) FlashlightController instance = FlashlightController.Instance; if (!((Object)(object)instance == (Object)null) && flashlightRebound && !((Object)(object)instance.FollowTransformClient == (Object)null)) { ((Component)instance).transform.position = instance.FollowTransformClient.position; ((Component)instance).transform.rotation = instance.FollowTransformClient.rotation; } } private void UpdateLocalPlayerAnimation(PlayerAvatarVisuals visuals, PlayerAvatar player) { //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_03ae: Unknown result type (might be due to invalid IL or missing references) //IL_03b3: Unknown result type (might be due to invalid IL or missing references) Animator animator = visuals.animator; float num = Time.deltaTime * visuals.animationSpeedMultiplier; if (player.isTumbling) { if (!animSprinting && !animTumbling) { animator.SetTrigger("TumblingImpulse"); animTumbling = true; } if ((((Vector3)(ref player.tumble.physGrabObject.rbVelocity)).magnitude > 1f && !player.tumble.physGrabObject.impactDetector.inCart) || ((Vector3)(ref player.tumble.physGrabObject.rbAngularVelocity)).magnitude > 1f) { animator.SetBool("TumblingMove", true); } else { animator.SetBool("TumblingMove", false); } animator.SetBool("Tumbling", true); } else { animator.SetBool("Tumbling", false); animator.SetBool("TumblingMove", false); animTumbling = false; } if (Object.op_Implicit((Object)(object)visuals.playerAvatarRightArm) && visuals.playerAvatarRightArm.poseNew == visuals.playerAvatarRightArm.grabberPose) { animator.SetBool("Grabbing", true); } else { animator.SetBool("Grabbing", false); } animator.SetBool("Crouching", player.isCrouching || player.isTumbling); animator.SetBool("Crawling", player.isCrawling || player.isTumbling); animator.SetBool("Moving", player.isMoving && !animJumping); if (player.isSprinting && !animJumping && !animTumbling) { if (!animSprinting && !animSliding) { animator.SetTrigger("SprintingImpulse"); animSprinting = true; } animator.SetBool("Sprinting", true); } else { animator.SetBool("Sprinting", false); animSprinting = false; } animSlidingImpulse = false; if (player.isSliding && !animJumping && !animTumbling) { if (!animSliding) { animSlidingImpulse = true; animator.SetTrigger("SlidingImpulse"); } animator.SetBool("Sliding", true); animSliding = true; } else { animator.SetBool("Sliding", false); animSliding = false; } if (animJumping) { if (animJumpingImpulse) { animJumpTimer = 0.2f; animJumpingImpulse = false; animator.SetTrigger("JumpingImpulse"); animator.SetBool("Jumping", true); animator.SetBool("Falling", false); } else if (player.rbVelocityRaw.y < -0.5f && animJumpTimer <= 0f) { animator.SetBool("Falling", true); } if (player.isGrounded && animJumpTimer <= 0f) { animJumpedTimer = 0.5f; animJumping = false; } animJumpTimer -= num; } else { animator.SetBool("Jumping", false); animator.SetBool("Falling", false); } if (animJumpedTimer > 0f) { animJumpedTimer -= num; } if (!player.isGrounded) { animFallingTimer += num; } else { animFallingTimer = 0f; } if (!player.isCrawling && !animJumping && !animSliding && !animTumbling && animFallingTimer > 0.25f && animJumpedTimer <= 0f) { animJumpTimer = 0.2f; animJumping = true; animJumpingImpulse = false; animator.SetTrigger("FallingImpulse"); animator.SetBool("Jumping", true); animator.SetBool("Falling", true); } float num2 = 1f; AnimatorStateInfo currentAnimatorStateInfo = animator.GetCurrentAnimatorStateInfo(0); if (((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("Sprint") && Object.op_Implicit((Object)(object)StatsManager.instance) && StatsManager.instance.playerUpgradeSpeed.ContainsKey(player.steamID)) { num2 = 1f + (float)StatsManager.instance.playerUpgradeSpeed[player.steamID] * 0.1f; } else if (player.isMoving && player.mapToolController.Active) { num2 = 0.5f; } animator.speed = num2 * visuals.animationSpeedMultiplier; } private void OnGUI() { //IL_02a6: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02c1: Unknown result type (might be due to invalid IL or missing references) //IL_02cd: Unknown result type (might be due to invalid IL or missing references) //IL_02dc: Expected O, but got Unknown //IL_02d7: Unknown result type (might be due to invalid IL or missing references) //IL_02dc: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Expected O, but got Unknown //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Expected O, but got Unknown //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Expected O, but got Unknown //IL_0105: 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_013e: Expected O, but got Unknown //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Expected O, but got Unknown //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Expected O, but got Unknown //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Expected O, but got Unknown //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Expected O, but got Unknown //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_0258: Expected O, but got Unknown //IL_0263: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_029c: Unknown result type (might be due to invalid IL or missing references) if (showUI) { if (windowStyle == null) { windowStyle = new GUIStyle(GUI.skin.window); windowStyle.normal.background = windowBg; windowStyle.onNormal.background = windowBg; windowStyle.normal.textColor = Color.red; windowStyle.fontStyle = (FontStyle)3; windowStyle.fontSize = 16; windowStyle.alignment = (TextAnchor)1; windowStyle.border = new RectOffset(4, 4, 4, 4); buttonStyle = new GUIStyle(GUI.skin.button); buttonStyle.normal.background = buttonBg; buttonStyle.hover.background = buttonHoverBg; buttonStyle.active.background = buttonHoverBg; buttonStyle.normal.textColor = Color.white; buttonStyle.fontStyle = (FontStyle)1; buttonStyle.fontSize = 13; buttonStyle.padding = new RectOffset(10, 10, 5, 5); headerStyle = new GUIStyle(GUI.skin.label); headerStyle.normal.textColor = Color.red; headerStyle.fontStyle = (FontStyle)1; headerStyle.fontSize = 14; headerStyle.alignment = (TextAnchor)4; labelStyle = new GUIStyle(GUI.skin.label); labelStyle.normal.textColor = new Color(0.9f, 0.9f, 0.9f, 1f); labelStyle.fontStyle = (FontStyle)0; sliderStyle = new GUIStyle(GUI.skin.horizontalSlider); sliderStyle.normal.background = sliderBg; sliderThumbStyle = new GUIStyle(GUI.skin.horizontalSliderThumb); sliderThumbStyle.normal.background = sliderThumb; sliderThumbStyle.hover.background = sliderThumb; toggleStyle = new GUIStyle(GUI.skin.toggle); toggleStyle.normal.textColor = Color.white; toggleStyle.onNormal.textColor = Color.red; toggleStyle.hover.textColor = new Color(1f, 0.5f, 0.5f); } GUI.backgroundColor = Color.white; GUI.contentColor = Color.white; windowRect = GUI.Window(999, windowRect, new WindowFunction(DrawWindow), "EMPRESS CINEMATIC SUITE"); } } private void DrawWindow(int windowID) { //IL_0014: 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_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) GUI.DragWindow(new Rect(0f, 0f, 10000f, 25f)); GUILayout.BeginVertical(Array.Empty<GUILayoutOption>()); GUILayout.Space(10f); scrollPosition = GUILayout.BeginScrollView(scrollPosition, Array.Empty<GUILayoutOption>()); GUILayout.Space(5f); GUILayout.Label(":: CAMERA ::", headerStyle, Array.Empty<GUILayoutOption>()); GUILayout.Space(5f); bool flag = GUILayout.Toggle(cineCameraEnabled, " Enable Freecam", toggleStyle, Array.Empty<GUILayoutOption>()); if (flag != cineCameraEnabled) { cineCameraEnabled = flag; } if (cineCameraEnabled) { cineCameraLocked = GUILayout.Toggle(cineCameraLocked, " LOCK POSITION (Tripod)", toggleStyle, Array.Empty<GUILayoutOption>()); GUILayout.Space(5f); GUILayout.Label("[ Controls: WASD | Q/E=Up/Down | Shift=Speed | R-Click=Rot ]", labelStyle, Array.Empty<GUILayoutOption>()); GUILayout.Space(5f); GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); GUILayout.Label($"Speed: {flySpeed:F1}", labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(80f) }); flySpeed = GUILayout.HorizontalSlider(flySpeed, 1f, 50f, sliderStyle, sliderThumbStyle, Array.Empty<GUILayoutOption>()); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); GUILayout.Label($"Sens: {mouseSensitivity:F1}", labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(80f) }); mouseSensitivity = GUILayout.HorizontalSlider(mouseSensitivity, 0.1f, 10f, sliderStyle, sliderThumbStyle, Array.Empty<GUILayoutOption>()); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); GUILayout.Label($"Roll: {cameraRoll:F1}", labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(80f) }); cameraRoll = GUILayout.HorizontalSlider(cameraRoll, -180f, 180f, sliderStyle, sliderThumbStyle, Array.Empty<GUILayoutOption>()); GUILayout.EndHorizontal(); } GUILayout.Space(15f); DrawSeparator(); GUILayout.Label(":: EMPRESS FX ::", headerStyle, Array.Empty<GUILayoutOption>()); GUILayout.Space(5f); if (GUILayout.Toggle(effectMatrix, " MATRIX HACK", toggleStyle, Array.Empty<GUILayoutOption>())) { if (!effectMatrix) { effectMatrix = true; effectNoir = false; effectPsycho = false; } } else { effectMatrix = false; } if (GUILayout.Toggle(effectNoir, " NOIR CITY", toggleStyle, Array.Empty<GUILayoutOption>())) { if (!effectNoir) { effectNoir = true; effectMatrix = false; effectPsycho = false; } } else { effectNoir = false; } if (GUILayout.Toggle(effectPsycho, " PSYCHO TRIP", toggleStyle, Array.Empty<GUILayoutOption>())) { if (!effectPsycho) { effectPsycho = true; effectMatrix = false; effectNoir = false; } } else { effectPsycho = false; } GUILayout.Space(15f); DrawSeparator(); GUILayout.Label(":: POST FX ::", headerStyle, Array.Empty<GUILayoutOption>()); GUILayout.Space(5f); GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); fovEnabled = GUILayout.Toggle(fovEnabled, " FOV", toggleStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(60f) }); if (fovEnabled) { fovValue = GUILayout.HorizontalSlider(fovValue, 10f, 150f, sliderStyle, sliderThumbStyle, Array.Empty<GUILayoutOption>()); GUILayout.Label($"{fovValue:F0}", labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(30f) }); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); satEnabled = GUILayout.Toggle(satEnabled, " Sat", toggleStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(60f) }); if (satEnabled) { satValue = GUILayout.HorizontalSlider(satValue, -100f, 100f, sliderStyle, sliderThumbStyle, Array.Empty<GUILayoutOption>()); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); conEnabled = GUILayout.Toggle(conEnabled, " Con", toggleStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(60f) }); if (conEnabled) { conValue = GUILayout.HorizontalSlider(conValue, -100f, 100f, sliderStyle, sliderThumbStyle, Array.Empty<GUILayoutOption>()); } GUILayout.EndHorizontal(); GUILayout.Space(5f); vigEnabled = GUILayout.Toggle(vigEnabled, " Vignette", toggleStyle, Array.Empty<GUILayoutOption>()); if (vigEnabled) { GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); GUILayout.Label($"Int: {vigIntensity:F2}", labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(60f) }); vigIntensity = GUILayout.HorizontalSlider(vigIntensity, 0f, 1f, sliderStyle, sliderThumbStyle, Array.Empty<GUILayoutOption>()); GUILayout.EndHorizontal(); } GUILayout.Space(15f); DrawSeparator(); GUILayout.Label(":: WORLD ::", headerStyle, Array.Empty<GUILayoutOption>()); GUILayout.Space(5f); bool flag2 = GUILayout.Toggle(shadowsEnabled, " Shadows", toggleStyle, Array.Empty<GUILayoutOption>()); if (flag2 != shadowsEnabled) { shadowsEnabled = flag2; QualitySettings.shadows = (ShadowQuality)(shadowsEnabled ? 2 : 0); } GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); GUILayout.Label($"Ambient: {ambientIntensity:F1}", labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(80f) }); float num = GUILayout.HorizontalSlider(ambientIntensity, 0f, 5f, sliderStyle, sliderThumbStyle, Array.Empty<GUILayoutOption>()); if (num != ambientIntensity) { ambientIntensity = num; RenderSettings.ambientIntensity = ambientIntensity; } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); GUILayout.Label($"Time: {timeScale:F1}", labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(80f) }); float num2 = GUILayout.HorizontalSlider(timeScale, 0f, 2f, sliderStyle, sliderThumbStyle, Array.Empty<GUILayoutOption>()); if (Mathf.Abs(num2 - timeScale) > 0.01f) { timeScale = num2; Time.timeScale = timeScale; } GUILayout.EndHorizontal(); GUILayout.Space(20f); DrawSeparator(); GUILayout.Space(5f); if (GUILayout.Button("TOGGLE HUD (REC MODE)", buttonStyle, Array.Empty<GUILayoutOption>()) && Object.op_Implicit((Object)(object)GameDirector.instance)) { GameDirector.instance.CommandRecordingDirectorToggle(); } GUILayout.EndScrollView(); GUILayout.EndVertical(); } private void DrawSeparator() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) Rect rect = GUILayoutUtility.GetRect(1f, 1f); GUI.color = Color.red; GUI.DrawTexture(rect, (Texture)(object)Texture2D.whiteTexture); GUI.color = Color.white; } }