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 CinematicSpectator v1.0.0
BepInEx/plugins/CinematicSpectator/CinematicSpectator.dll
Decompiled a day agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using GameNetcodeStuff; using HarmonyLib; using UnityEngine; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; [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("CinematicSpectator")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("CinematicSpectator")] [assembly: AssemblyTitle("CinematicSpectator")] [assembly: AssemblyVersion("1.0.0.0")] namespace CinematicSpectator; [DefaultExecutionOrder(10000)] public sealed class CinematicController : MonoBehaviour { private readonly ShotDirector director = new ShotDirector(); private PlayerControllerB local; private Camera cam; private PlayerControllerB lastTarget; private bool active; private bool manualOn; private bool manualOff; private float deadSince = -1f; private bool uiSaved; private bool pendingUiRestore; private bool hidUi; private bool prevBoxes; private bool prevText; private bool prevTip; private Transform boxes; private GameObject textObject; private GameObject tipObject; private float savedNearClip = 0.3f; private float savedFov = 66f; private bool audioAnchored; private GameObject audioAnchor; private bool dofRelaxed; private bool soloActive; private float soloEndTime; private float lastErrorLogTime; internal bool IsActive => active; internal string ShotName { get { if (!active) { return string.Empty; } return director.CurrentShotName; } } private void Update() { try { Tick(); } catch (Exception exception) { ReportError(exception); } } private void LateUpdate() { //IL_0083: 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) try { if (active && !((Object)(object)cam == (Object)null) && !((Object)(object)local == (Object)null) && local.isPlayerDead && director.HasPose) { StartOfRound instance = StartOfRound.Instance; if (!((Object)(object)instance == (Object)null) && (soloActive || (!instance.overrideSpectateCamera && !instance.allPlayersDead))) { CameraPose pose = director.Pose; ((Component)cam).transform.SetPositionAndRotation(pose.Position, pose.Rotation); cam.fieldOfView = pose.FieldOfView; } } } catch (Exception exception) { ReportError(exception); } } private void Tick() { if (!Plugin.Enabled.Value) { if (active) { End(restoreUi: true); } manualOn = false; manualOff = false; deadSince = -1f; return; } GameNetworkManager instance = GameNetworkManager.Instance; StartOfRound instance2 = StartOfRound.Instance; if ((Object)(object)instance == (Object)null || (Object)(object)instance2 == (Object)null || (Object)(object)instance.localPlayerController == (Object)null || (Object)(object)instance2.spectateCamera == (Object)null) { if (active) { End(restoreUi: false); } deadSince = -1f; return; } local = instance.localPlayerController; cam = instance2.spectateCamera; if (!local.isPlayerDead) { if (active) { End(restoreUi: true); } if (pendingUiRestore) { RestoreSpectateUi(); pendingUiRestore = false; } manualOn = false; manualOff = false; deadSince = -1f; return; } if (deadSince < 0f) { deadSince = Time.time; manualOn = false; manualOff = false; } bool flag = (Object)(object)local.quickMenuManager != (Object)null && local.quickMenuManager.isMenuOpen; if (!(local.isTypingChat || local.inTerminalMenu || local.inSpecialMenu || flag)) { HandleKeys(); } if (instance2.overrideSpectateCamera || instance2.allPlayersDead) { bool flag2 = IsSoloCase(instance2, local); if (instance2.overrideSpectateCamera && !flag2) { if (active) { End(restoreUi: false); } manualOn = false; return; } if (instance2.allPlayersDead && !flag2) { if (active) { End(restoreUi: false); } manualOn = false; return; } } bool flag3 = IsSoloCase(instance2, local); bool flag4 = Time.time - deadSince >= Plugin.ActivationDelay.Value && local.isInGameOverAnimation <= 0f; bool flag5 = local.isInGameOverAnimation <= 0f; bool flag6 = !manualOff && ((manualOn && flag5) || ((Plugin.ActivateOnDeath.Value || flag3) && flag4)); if (flag6 && !active) { Begin(); } else if (!flag6 && active) { End(restoreUi: true); } if (active) { if (soloActive && Time.time >= soloEndTime) { End(restoreUi: false); manualOff = true; } else { TickActive(instance2); } } } private void HandleKeys() { //IL_0000: 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) if (Pressed(Plugin.ToggleKey)) { if (active || manualOn) { manualOn = false; manualOff = true; } else { manualOn = true; manualOff = false; } } if (active && Pressed(Plugin.NextShotKey)) { director.NextShot(); } } private void TickActive(StartOfRound round) { if ((Object)(object)local == (Object)null || (Object)(object)cam == (Object)null) { End(restoreUi: false); return; } PlayerControllerB val = ResolveTarget(); if ((Object)(object)val == (Object)null) { End(restoreUi: true); return; } if ((Object)(object)val != (Object)(object)lastTarget) { director.OnTargetChanged(val); lastTarget = val; } UpdateAudioAnchor(val); director.Tick(Time.deltaTime, val); if (!director.HasPose) { End(restoreUi: true); } } private static bool IsSoloCase(StartOfRound round, PlayerControllerB player) { if ((Object)(object)round != (Object)null && (Object)(object)player != (Object)null && player.isPlayerDead && round.allPlayersDead && Plugin.SoloDeathCam.Value && (Object)(object)player.deadBody != (Object)null) { return !HasOtherPlayers(round, player); } return false; } private static bool HasOtherPlayers(StartOfRound round, PlayerControllerB local) { if (round.allPlayerScripts == null) { return false; } for (int i = 0; i < round.allPlayerScripts.Length; i++) { PlayerControllerB val = round.allPlayerScripts[i]; if ((Object)(object)val != (Object)null && (Object)(object)val != (Object)(object)local && (val.isPlayerControlled || val.isPlayerDead)) { return true; } } return false; } private PlayerControllerB ResolveTarget() { //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_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) if ((Object)(object)local == (Object)null) { return null; } PlayerControllerB spectatedPlayerScript = local.spectatedPlayerScript; if ((Object)(object)spectatedPlayerScript != (Object)null && (Object)(object)((Component)spectatedPlayerScript).gameObject != (Object)null && ((Component)spectatedPlayerScript).gameObject.activeInHierarchy) { return spectatedPlayerScript; } StartOfRound instance = StartOfRound.Instance; if ((Object)(object)instance == (Object)null || instance.allPlayerScripts == null) { return null; } if (IsSoloCase(instance, local)) { return local; } PlayerControllerB val = null; float num = float.MaxValue; Vector3 position = ((Component)local).transform.position; for (int i = 0; i < instance.allPlayerScripts.Length; i++) { PlayerControllerB val2 = instance.allPlayerScripts[i]; if (!((Object)(object)val2 == (Object)null) && !((Object)(object)val2 == (Object)(object)local) && !((Object)(object)((Component)val2).gameObject == (Object)null) && ((Component)val2).gameObject.activeInHierarchy && (val2.isPlayerControlled || val2.isPlayerDead)) { Vector3 val3 = ((Component)val2).transform.position - position; float sqrMagnitude = ((Vector3)(ref val3)).sqrMagnitude; if ((Object)(object)val == (Object)null || (val.isPlayerDead && !val2.isPlayerDead) || (val2.isPlayerDead == val.isPlayerDead && sqrMagnitude < num)) { val = val2; num = sqrMagnitude; } } } return val; } private void Begin() { //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)local == (Object)null || (Object)(object)cam == (Object)null) { return; } PlayerControllerB val = ResolveTarget(); if (!((Object)(object)val == (Object)null)) { soloActive = IsSoloCase(StartOfRound.Instance, local); soloEndTime = (soloActive ? (Time.time + Mathf.Max(3f, Plugin.SoloDeathCamDuration.Value)) : 0f); if (pendingUiRestore) { RestoreSpectateUi(); pendingUiRestore = false; } active = true; lastTarget = val; savedNearClip = cam.nearClipPlane; savedFov = cam.fieldOfView; cam.nearClipPlane = 0.05f; SaveAndHideSpectateUi(); if (Plugin.DisableNearDof.Value) { SetNearDof(enabled: false); dofRelaxed = true; } AnchorAudio(val); director.Begin(val, ((Component)cam).transform.position, ((Component)cam).transform.rotation, cam.fieldOfView); if ((Object)(object)Plugin.Overlay != (Object)null) { Plugin.Overlay.BeginEntry(); } Plugin.Log.LogInfo((object)(soloActive ? "Solo death camera ON (watching own corpse)." : ("Cinematic mode ON (watching " + val.playerUsername + ")."))); } } private void End(bool restoreUi) { //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) if (!active) { return; } active = false; bool flag = soloActive; soloActive = false; soloEndTime = 0f; director.Reset(); RestoreAudio(); if (flag && (Object)(object)cam != (Object)null) { StartOfRound instance = StartOfRound.Instance; if ((Object)(object)instance != (Object)null && instance.overrideSpectateCamera) { ((Component)cam).transform.localPosition = Vector3.zero; ((Component)cam).transform.localEulerAngles = Vector3.zero; } } if ((Object)(object)cam != (Object)null) { cam.fieldOfView = savedFov; cam.nearClipPlane = savedNearClip; } if (restoreUi && !flag) { RestoreSpectateUi(); pendingUiRestore = false; } else { pendingUiRestore = uiSaved; } bool nearDof = (Object)(object)local != (Object)null && local.isPlayerDead; if (dofRelaxed) { SetNearDof(nearDof); dofRelaxed = false; } if ((Object)(object)Plugin.Overlay != (Object)null) { Plugin.Overlay.End(); } Plugin.Log.LogInfo((object)"Cinematic mode OFF."); } private void SaveAndHideSpectateUi() { uiSaved = false; boxes = null; textObject = null; tipObject = null; HUDManager instance = HUDManager.Instance; if ((Object)(object)instance == (Object)null) { return; } boxes = instance.SpectateBoxesContainer; textObject = (((Object)(object)instance.spectatingPlayerText != (Object)null) ? ((Component)instance.spectatingPlayerText).gameObject : null); tipObject = (((Object)(object)instance.spectatorTipText != (Object)null) ? ((Component)instance.spectatorTipText).gameObject : null); prevBoxes = (Object)(object)boxes != (Object)null && ((Component)boxes).gameObject.activeSelf; prevText = (Object)(object)textObject != (Object)null && textObject.activeSelf; prevTip = (Object)(object)tipObject != (Object)null && tipObject.activeSelf; uiSaved = true; hidUi = Plugin.HideSpectateUI.Value; if (hidUi) { if ((Object)(object)boxes != (Object)null) { ((Component)boxes).gameObject.SetActive(false); } if ((Object)(object)textObject != (Object)null) { textObject.SetActive(false); } if ((Object)(object)tipObject != (Object)null) { tipObject.SetActive(false); } } } private void RestoreSpectateUi() { if (uiSaved && hidUi) { if ((Object)(object)boxes != (Object)null) { ((Component)boxes).gameObject.SetActive(prevBoxes); } if ((Object)(object)textObject != (Object)null) { textObject.SetActive(prevText); } if ((Object)(object)tipObject != (Object)null) { tipObject.SetActive(prevTip); } uiSaved = false; } } private void AnchorAudio(PlayerControllerB target) { //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Expected O, but got Unknown if (!Plugin.KeepAudioNearSubject.Value || (Object)(object)local == (Object)null || (Object)(object)target == (Object)null || (Object)(object)target == (Object)(object)local) { return; } try { if ((Object)(object)audioAnchor == (Object)null) { audioAnchor = new GameObject("CinematicAudioAnchor"); audioAnchor.transform.SetParent(((Component)this).transform, false); } UpdateAudioAnchor(target); local.ChangeAudioListenerToObject(audioAnchor); audioAnchored = true; } catch (Exception ex) { Plugin.Log.LogWarning((object)("Could not anchor audio listener: " + ex.Message)); } } private void UpdateAudioAnchor(PlayerControllerB target) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)audioAnchor == (Object)null) && !((Object)(object)target == (Object)null)) { Vector3 position = ((Component)target).transform.position + Vector3.up * 1.5f; if (target.isPlayerDead && (Object)(object)target.deadBody != (Object)null && target.deadBody.bodyParts != null && target.deadBody.bodyParts.Length != 0 && (Object)(object)target.deadBody.bodyParts[0] != (Object)null) { position = target.deadBody.bodyParts[0].position; } else if (target.bodyParts != null && target.bodyParts.Length != 0 && (Object)(object)target.bodyParts[0] != (Object)null) { position = target.bodyParts[0].position; } audioAnchor.transform.position = position; } } private void RestoreAudio() { if (!audioAnchored) { return; } audioAnchored = false; if ((Object)(object)local == (Object)null) { return; } GameObject val = null; if (local.isPlayerDead) { val = (((Object)(object)cam != (Object)null) ? ((Component)cam).gameObject : null); } else if ((Object)(object)local.gameplayCamera != (Object)null) { val = ((Component)local.gameplayCamera).gameObject; } if ((Object)(object)val == (Object)null) { return; } try { local.ChangeAudioListenerToObject(val); } catch (Exception ex) { Plugin.Log.LogWarning((object)("Could not restore audio listener: " + ex.Message)); } } private static void SetNearDof(bool enabled) { HUDManager instance = HUDManager.Instance; if ((Object)(object)instance == (Object)null) { return; } try { instance.SetNearDepthOfFieldEnabled(enabled); } catch (Exception ex) { Plugin.Log.LogWarning((object)("Could not set near DOF: " + ex.Message)); } } private static bool Pressed(Key key) { //IL_0000: 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) if ((int)key == 0) { return false; } Keyboard current = Keyboard.current; if (current == null) { return false; } KeyControl val = current[key]; if (val != null) { return ((ButtonControl)val).wasPressedThisFrame; } return false; } private void ReportError(Exception exception) { if (Time.unscaledTime - lastErrorLogTime < 5f) { return; } lastErrorLogTime = Time.unscaledTime; Plugin.Log.LogError((object)("Cinematic mode error: " + exception)); try { if (active) { End(restoreUi: true); } } catch (Exception ex) { Plugin.Log.LogError((object)("Cinematic mode error while shutting down: " + ex)); } manualOn = false; manualOff = true; deadSince = Time.time; } } public sealed class CinematicOverlay : MonoBehaviour { private bool visible; private float bars; private float entryFade = 1f; private float visibleTime; private Texture2D vignetteTexture; private Texture2D grainTexture; private float grainOffsetX; private float grainOffsetY; private GUIStyle titleStyle; private GUIStyle hintStyle; private GUIStyle shotStyle; private int styleScreenHeight; private float lastErrorTime; internal void BeginEntry() { EnsureTextures(); visible = true; visibleTime = 0f; bars = 0f; entryFade = (Plugin.FadeOnEnter.Value ? 0f : 1f); } internal void End() { visible = false; entryFade = 1f; } private void Update() { float unscaledDeltaTime = Time.unscaledDeltaTime; bars = Mathf.MoveTowards(bars, visible ? 1f : 0f, unscaledDeltaTime / 0.35f); if (visible) { visibleTime += unscaledDeltaTime; entryFade = Mathf.MoveTowards(entryFade, 1f, unscaledDeltaTime / 0.55f); grainOffsetX = Random.value; grainOffsetY = Random.value; } } private void OnGUI() { //IL_004a: Unknown result type (might be due to invalid IL or missing references) try { Draw(); } catch (Exception ex) { if (Time.unscaledTime - lastErrorTime > 5f) { lastErrorTime = Time.unscaledTime; if (Plugin.Log != null) { Plugin.Log.LogWarning((object)("Cinematic overlay error: " + ex.Message)); } } } finally { GUI.color = Color.white; } } private void Draw() { //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_0417: 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_026e: Unknown result type (might be due to invalid IL or missing references) //IL_02e4: Unknown result type (might be due to invalid IL or missing references) //IL_02f9: Unknown result type (might be due to invalid IL or missing references) //IL_0366: Unknown result type (might be due to invalid IL or missing references) //IL_0385: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: Unknown result type (might be due to invalid IL or missing references) //IL_0405: Unknown result type (might be due to invalid IL or missing references) if ((!visible && bars <= 0.001f) || !Plugin.Enabled.Value) { return; } PlayerControllerB val = (((Object)(object)GameNetworkManager.Instance != (Object)null) ? GameNetworkManager.Instance.localPlayerController : null); if ((Object)(object)val != (Object)null && (Object)(object)val.quickMenuManager != (Object)null && val.quickMenuManager.isMenuOpen) { return; } EnsureStyles(); int width = Screen.width; int height = Screen.height; if (width <= 0 || height <= 0) { return; } float num = Mathf.Clamp(Plugin.LetterboxAspect.Value, 1.2f, 3.2f); float num2 = (Plugin.Letterbox.Value ? Mathf.Max(0f, ((float)height - (float)width / num) * 0.5f) : 0f) * Mathf.SmoothStep(0f, 1f, Mathf.Clamp01(bars)); float num3 = Mathf.Clamp01(bars * 1.2f); if (Plugin.Vignette.Value && num3 > 0.001f && (Object)(object)vignetteTexture != (Object)null) { GUI.color = new Color(1f, 1f, 1f, Plugin.VignetteStrength.Value * num3); GUI.DrawTexture(new Rect(0f, 0f, (float)width, (float)height), (Texture)(object)vignetteTexture); } if (Plugin.FilmGrain.Value && visible && (Object)(object)grainTexture != (Object)null) { float num4 = 150f; GUI.color = new Color(1f, 1f, 1f, 0.05f); GUI.DrawTextureWithTexCoords(new Rect(0f, 0f, (float)width, (float)height), (Texture)(object)grainTexture, new Rect(grainOffsetX, grainOffsetY, (float)width / num4, (float)height / num4)); } if (num2 >= 0.5f) { GUI.color = Color.black; GUI.DrawTexture(new Rect(0f, 0f, (float)width, num2), (Texture)(object)Texture2D.whiteTexture); GUI.DrawTexture(new Rect(0f, (float)height - num2, (float)width, num2), (Texture)(object)Texture2D.whiteTexture); } if (visible && entryFade < 0.999f) { GUI.color = new Color(0f, 0f, 0f, 1f - entryFade); GUI.DrawTexture(new Rect(0f, 0f, (float)width, (float)height), (Texture)(object)Texture2D.whiteTexture); } if (visible) { float num5 = Mathf.Clamp01(Mathf.Min(visibleTime * 3f, (5.2f - visibleTime) / 1.2f)); if (Plugin.ShowTitle.Value && num5 > 0.01f) { string text = "CINEMATIC"; string text2 = "[" + KeyName(Plugin.ToggleKey) + "] exit [" + KeyName(Plugin.NextShotKey) + "] next shot"; float num6 = (float)titleStyle.fontSize + 12f; float num7 = (float)hintStyle.fontSize + 10f; float num8 = num2 + (float)height * 0.045f; float num9 = (float)height - num2 - (float)height * 0.05f - num7; DrawShadowedLabel(new Rect(0f, num8, (float)width, num6), text, titleStyle, num5); DrawShadowedLabel(new Rect(0f, num9, (float)width, num7), text2, hintStyle, num5 * 0.85f); } if (Plugin.ShowShotName.Value && (Object)(object)Plugin.Controller != (Object)null) { string shotName = Plugin.Controller.ShotName; if (!string.IsNullOrEmpty(shotName)) { GUI.color = new Color(0.9f, 0.88f, 0.8f, 0.55f); GUI.Label(new Rect((float)width - 240f, num2 + 10f, 230f, 24f), shotName, shotStyle); } } } GUI.color = Color.white; } private static void DrawShadowedLabel(Rect rect, string text, GUIStyle style, float alpha) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_004d: 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_0073: Unknown result type (might be due to invalid IL or missing references) Color color = GUI.color; GUI.color = new Color(0f, 0f, 0f, 0.55f * alpha); GUI.Label(new Rect(((Rect)(ref rect)).x + 1.5f, ((Rect)(ref rect)).y + 1.5f, ((Rect)(ref rect)).width, ((Rect)(ref rect)).height), text, style); GUI.color = new Color(1f, 1f, 1f, alpha); GUI.Label(rect, text, style); GUI.color = color; } private void EnsureStyles() { //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Expected O, but got Unknown //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: 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_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010e: 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_0121: Expected O, but got Unknown //IL_013b: Unknown result type (might be due to invalid IL or missing references) if (titleStyle == null || Mathf.Abs(styleScreenHeight - Screen.height) >= 40) { styleScreenHeight = Screen.height; int fontSize = Mathf.Max(15, Mathf.RoundToInt((float)Screen.height * 0.026f)); int fontSize2 = Mathf.Max(11, Mathf.RoundToInt((float)Screen.height * 0.0155f)); titleStyle = new GUIStyle(GUI.skin.label) { alignment = (TextAnchor)4, fontSize = fontSize, fontStyle = (FontStyle)1 }; titleStyle.normal.textColor = new Color(0.94f, 0.9f, 0.8f); hintStyle = new GUIStyle(GUI.skin.label) { alignment = (TextAnchor)4, fontSize = fontSize2, fontStyle = (FontStyle)0 }; hintStyle.normal.textColor = new Color(0.86f, 0.84f, 0.78f); shotStyle = new GUIStyle(GUI.skin.label) { alignment = (TextAnchor)5, fontSize = fontSize2, fontStyle = (FontStyle)0 }; shotStyle.normal.textColor = new Color(0.86f, 0.84f, 0.78f); } } private unsafe static string KeyName(Key key) { string text = ((object)(*(Key*)(&key))/*cast due to .constrained prefix*/).ToString(); if (text.Length != 0) { return text.ToUpperInvariant(); } return "?"; } private void EnsureTextures() { if ((Object)(object)vignetteTexture == (Object)null) { vignetteTexture = CreateVignette(256); } if ((Object)(object)grainTexture == (Object)null) { grainTexture = CreateGrain(128); } } private static Texture2D CreateVignette(int size) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Expected O, but got Unknown //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) Texture2D val = new Texture2D(size, size, (TextureFormat)4, false); ((Object)val).name = "CinematicVignette"; ((Texture)val).wrapMode = (TextureWrapMode)1; ((Texture)val).filterMode = (FilterMode)1; Color32[] array = (Color32[])(object)new Color32[size * size]; for (int i = 0; i < size; i++) { for (int j = 0; j < size; j++) { float num = ((float)j + 0.5f) / (float)size * 2f - 1f; float num2 = ((float)i + 0.5f) / (float)size * 2f - 1f; float num3 = Mathf.Clamp01((Mathf.Sqrt(num * num + num2 * num2) / 1.4142135f - 0.28f) / 0.72f); num3 *= num3; array[i * size + j] = new Color32((byte)0, (byte)0, (byte)0, (byte)(num3 * 255f)); } } val.SetPixels32(array); val.Apply(false, true); return val; } private static Texture2D CreateGrain(int size) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Expected O, but got Unknown //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) Texture2D val = new Texture2D(size, size, (TextureFormat)4, false); ((Object)val).name = "CinematicGrain"; ((Texture)val).wrapMode = (TextureWrapMode)0; ((Texture)val).filterMode = (FilterMode)0; Color32[] array = (Color32[])(object)new Color32[size * size]; for (int i = 0; i < array.Length; i++) { byte b = (byte)Random.Range(40, 220); array[i] = new Color32(b, b, b, byte.MaxValue); } val.SetPixels32(array); val.Apply(false, true); return val; } } [BepInPlugin("com.dsh.cinematicspectator", "Cinematic Spectator", "1.0.0")] public sealed class Plugin : BaseUnityPlugin { public const string Guid = "com.dsh.cinematicspectator"; public const string Version = "1.0.0"; internal static ManualLogSource Log; internal static ConfigEntry<bool> Enabled; internal static ConfigEntry<bool> ActivateOnDeath; internal static ConfigEntry<float> ActivationDelay; internal static ConfigEntry<string> ToggleKeyText; internal static ConfigEntry<string> NextShotKeyText; internal static ConfigEntry<bool> HideSpectateUI; internal static ConfigEntry<bool> DisableNearDof; internal static ConfigEntry<bool> SoloDeathCam; internal static ConfigEntry<float> SoloDeathCamDuration; internal static ConfigEntry<bool> KeepAudioNearSubject; internal static ConfigEntry<bool> Letterbox; internal static ConfigEntry<float> LetterboxAspect; internal static ConfigEntry<bool> FadeOnEnter; internal static ConfigEntry<bool> Vignette; internal static ConfigEntry<float> VignetteStrength; internal static ConfigEntry<bool> FilmGrain; internal static ConfigEntry<bool> ShowTitle; internal static ConfigEntry<bool> ShowShotName; internal static ConfigEntry<float> MinShotLength; internal static ConfigEntry<float> MaxShotLength; internal static ConfigEntry<float> CutChance; internal static ConfigEntry<float> InteriorDistanceScale; internal static ConfigEntry<float> HandheldScale; internal static ConfigEntry<float> EntryBlend; internal static ConfigEntry<bool> DebugLog; internal static Key ToggleKey = (Key)98; internal static Key NextShotKey = (Key)99; internal static CinematicController Controller; internal static CinematicOverlay Overlay; private Harmony harmony; private void Awake() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Expected O, but got Unknown Log = ((BaseUnityPlugin)this).Logger; BindConfig(); ToggleKey = ParseKey(ToggleKeyText.Value, (Key)98); NextShotKey = ParseKey(NextShotKeyText.Value, (Key)99); ToggleKeyText.SettingChanged += delegate { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) ToggleKey = ParseKey(ToggleKeyText.Value, (Key)98); }; NextShotKeyText.SettingChanged += delegate { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) NextShotKey = ParseKey(NextShotKeyText.Value, (Key)99); }; harmony = new Harmony("com.dsh.cinematicspectator"); harmony.PatchAll(typeof(Plugin).Assembly); Log.LogInfo((object)("Cinematic Spectator 1.0.0 loaded. Toggle=" + ((object)Unsafe.As<Key, Key>(ref ToggleKey)/*cast due to .constrained prefix*/).ToString() + " NextShot=" + ((object)Unsafe.As<Key, Key>(ref NextShotKey)/*cast due to .constrained prefix*/).ToString() + ".")); } internal static void Attach(GameObject host) { if (!((Object)(object)host == (Object)null) && (!((Object)(object)Controller != (Object)null) || !((Object)(object)Overlay != (Object)null) || !((Object)(object)((Component)Controller).gameObject == (Object)(object)host))) { if ((Object)(object)Controller != (Object)null) { Object.Destroy((Object)(object)Controller); } if ((Object)(object)Overlay != (Object)null) { Object.Destroy((Object)(object)Overlay); } Controller = host.AddComponent<CinematicController>(); Overlay = host.AddComponent<CinematicOverlay>(); Log.LogInfo((object)("Cinematic Spectator attached to " + ((Object)host).name + ".")); } } private void BindConfig() { //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Expected O, but got Unknown //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Expected O, but got Unknown //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Expected O, but got Unknown //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_0257: Expected O, but got Unknown //IL_02ea: Unknown result type (might be due to invalid IL or missing references) //IL_02f4: Expected O, but got Unknown //IL_0327: Unknown result type (might be due to invalid IL or missing references) //IL_0331: Expected O, but got Unknown //IL_0364: Unknown result type (might be due to invalid IL or missing references) //IL_036e: Expected O, but got Unknown //IL_03a1: Unknown result type (might be due to invalid IL or missing references) //IL_03ab: Expected O, but got Unknown //IL_03de: Unknown result type (might be due to invalid IL or missing references) //IL_03e8: Expected O, but got Unknown //IL_041b: Unknown result type (might be due to invalid IL or missing references) //IL_0425: Expected O, but got Unknown Enabled = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Enabled", true, "Master switch for the mod."); ActivateOnDeath = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "ActivateOnDeath", true, "Enter cinematic spectate automatically after the local player dies."); ActivationDelay = ((BaseUnityPlugin)this).Config.Bind<float>("General", "ActivationDelay", 1.6f, new ConfigDescription("Seconds to wait after death before the cinematic camera takes over. The vanilla death cam plays during this time.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 10f), Array.Empty<object>())); ToggleKeyText = ((BaseUnityPlugin)this).Config.Bind<string>("General", "ToggleKey", "<Keyboard>/f5", "Keyboard key that toggles cinematic spectate while dead (Input System syntax)."); NextShotKeyText = ((BaseUnityPlugin)this).Config.Bind<string>("General", "NextShotKey", "<Keyboard>/f6", "Keyboard key that cuts to the next shot immediately."); HideSpectateUI = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "HideSpectateUI", true, "Hide the vanilla spectator player list and '(Spectating: ...)' label."); DisableNearDof = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "DisableNearDof", true, "Relax the vanilla near depth-of-field while cinematic mode is active."); KeepAudioNearSubject = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "KeepAudioNearSubject", false, "Keep the audio listener near the spectated crew member while the cinematic camera is far away, so voice chat and nearby sounds do not fade out. Off by default because it reparents the game's audio listener."); SoloDeathCam = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "SoloDeathCam", true, "When playing alone and the whole crew is wiped, film the local player's corpse with the cinematic camera before the vanilla game-over camera takes over."); SoloDeathCamDuration = ((BaseUnityPlugin)this).Config.Bind<float>("General", "SoloDeathCamDuration", 20f, new ConfigDescription("How long the solo death camera stays on the corpse, in seconds. After this the vanilla game-over camera is restored.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(3f, 90f), Array.Empty<object>())); Letterbox = ((BaseUnityPlugin)this).Config.Bind<bool>("Presentation", "Letterbox", true, "Draw cinematic black bars."); LetterboxAspect = ((BaseUnityPlugin)this).Config.Bind<float>("Presentation", "LetterboxAspect", 2.39f, new ConfigDescription("Aspect ratio of the visible picture. 2.39 = anamorphic widescreen.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1.33f, 3.2f), Array.Empty<object>())); FadeOnEnter = ((BaseUnityPlugin)this).Config.Bind<bool>("Presentation", "FadeOnEnter", true, "Fade up from black when cinematic mode starts."); Vignette = ((BaseUnityPlugin)this).Config.Bind<bool>("Presentation", "Vignette", true, "Draw a soft lens vignette."); VignetteStrength = ((BaseUnityPlugin)this).Config.Bind<float>("Presentation", "VignetteStrength", 0.42f, new ConfigDescription("Vignette opacity.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>())); FilmGrain = ((BaseUnityPlugin)this).Config.Bind<bool>("Presentation", "FilmGrain", false, "Draw a subtle animated 35mm grain. Costs a little GPU/CPU time."); ShowTitle = ((BaseUnityPlugin)this).Config.Bind<bool>("Presentation", "ShowTitle", true, "Show the short 'CINEMATIC' title and the control hint when entering."); ShowShotName = ((BaseUnityPlugin)this).Config.Bind<bool>("Presentation", "ShowShotName", false, "Show the current shot name in the top-right corner (debug / tuning)."); MinShotLength = ((BaseUnityPlugin)this).Config.Bind<float>("Director", "MinShotLength", 6f, new ConfigDescription("Minimum length of one shot, in seconds.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(2f, 30f), Array.Empty<object>())); MaxShotLength = ((BaseUnityPlugin)this).Config.Bind<float>("Director", "MaxShotLength", 11f, new ConfigDescription("Maximum length of one shot, in seconds.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(3f, 40f), Array.Empty<object>())); CutChance = ((BaseUnityPlugin)this).Config.Bind<float>("Director", "CutChance", 0.7f, new ConfigDescription("Chance that a shot change is a hard cut instead of a smooth blend.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>())); InteriorDistanceScale = ((BaseUnityPlugin)this).Config.Bind<float>("Director", "InteriorDistanceScale", 0.62f, new ConfigDescription("How much shot distances are shortened indoors. Lower = closer, tighter shots.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.25f, 1.5f), Array.Empty<object>())); HandheldScale = ((BaseUnityPlugin)this).Config.Bind<float>("Director", "HandheldScale", 1f, new ConfigDescription("Multiplier for handheld camera movement in documentary shots.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 3f), Array.Empty<object>())); EntryBlend = ((BaseUnityPlugin)this).Config.Bind<float>("Director", "EntryBlend", 1.1f, new ConfigDescription("Length of the camera move from the vanilla view into the first shot.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 4f), Array.Empty<object>())); DebugLog = ((BaseUnityPlugin)this).Config.Bind<bool>("Debug", "DebugLog", false, "Log every shot change to the BepInEx console."); } internal unsafe static Key ParseKey(string text, Key fallback) { //IL_0008: 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_00b1: Unknown result type (might be due to invalid IL or missing references) if (string.IsNullOrEmpty(text)) { return fallback; } string text2 = text.Trim(); int num = text2.LastIndexOf('/'); if (num >= 0 && num < text2.Length - 1) { text2 = text2.Substring(num + 1); } text2 = text2.Trim().TrimEnd('>').Trim(); if (text2.StartsWith("<", StringComparison.Ordinal)) { text2 = text2.Substring(1); } if (Enum.TryParse<Key>(text2, ignoreCase: true, out Key result)) { return result; } if (Log != null) { Log.LogWarning((object)("Cinematic Spectator: key '" + text + "' is not a keyboard key; using " + ((object)(*(Key*)(&fallback))/*cast due to .constrained prefix*/).ToString() + ".")); } return fallback; } } [HarmonyPatch(typeof(HUDManager), "Start")] internal static class HudManagerStartPatch { private static void Postfix(HUDManager __instance) { Plugin.Attach(((Component)__instance).gameObject); } } internal struct CameraPose { public Vector3 Position; public Quaternion Rotation; public float FieldOfView; public CameraPose(Vector3 position, Quaternion rotation, float fieldOfView) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: 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) Position = position; Rotation = rotation; FieldOfView = fieldOfView; } public static CameraPose Lerp(CameraPose a, CameraPose b, float t) { //IL_0009: 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_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) t = Mathf.Clamp01(t); return new CameraPose(Vector3.Lerp(a.Position, b.Position, t), Quaternion.Slerp(a.Rotation, b.Rotation, t), Mathf.Lerp(a.FieldOfView, b.FieldOfView, t)); } } internal sealed class ShotSpec { public string Name = "shot"; public float DistanceStart = 4f; public float DistanceEnd = 4f; public float HeightStart; public float HeightEnd; public float AzimuthStart; public float AzimuthEnd; public float FovStart = 45f; public float FovEnd = 45f; public float RollStart; public float RollEnd; public float LookYaw; public float LookPitch; public float MinTime = 6f; public float MaxTime = 10f; public float Weight = 1f; public float MoveBias = 1f; public float IdleBias = 1f; public float DeadBias = 1f; public float Lead = 0.08f; public float Handheld = 0.4f; public float FollowFacing = 0.25f; public bool ExteriorOnly; public bool FirstShot; public bool SmoothDrift = true; public float MinDistance = 0.55f; } internal sealed class ShotInstance { public readonly ShotSpec Spec; public readonly float Duration; public readonly float DistanceMultiplier; public readonly float AzimuthJitter; public readonly float HeightJitter; public readonly float FovJitter; public readonly float Seed; public readonly bool IndoorAtStart; public readonly bool ShipAtStart; public float Elapsed; public float Yaw; public float SideOffset; public bool SideChosen; public ShotInstance(ShotSpec spec, PlayerControllerB target, bool indoor, bool ship) { //IL_00ec: Unknown result type (might be due to invalid IL or missing references) Spec = spec; float num = Mathf.Max(2f, Plugin.MinShotLength.Value); float num2 = Mathf.Max(num + 0.5f, Plugin.MaxShotLength.Value); float num3 = Mathf.Clamp(spec.MinTime, num, num2); float num4 = Mathf.Clamp(spec.MaxTime, num3, num2); Duration = Mathf.Max(0.5f, Random.Range(num3, num4)); DistanceMultiplier = Random.Range(0.92f, 1.08f); AzimuthJitter = Random.Range(-6f, 6f); HeightJitter = Random.Range(-0.2f, 0.2f); FovJitter = Random.Range(-0.045f, 0.045f); Seed = Random.Range(0f, 100f); Yaw = (((Object)(object)target != (Object)null) ? ((Component)target).transform.eulerAngles.y : 0f); IndoorAtStart = indoor; ShipAtStart = ship; } } internal sealed class ShotDirector { private ShotInstance shot; private ShotSpec lastSpec; private CameraPose pose; private CameraPose blendFrom; private float blend; private float blendDuration; private bool hasPose; private PlayerControllerB target; private Vector3 smoothFocus; private Vector3 lastFocus; private Vector3 velocity; private bool focusReady; private bool indoor; private bool ship; private int mask; internal bool HasPose => hasPose; internal CameraPose Pose => pose; internal string CurrentShotName { get { if (shot == null) { return string.Empty; } return shot.Spec.Name; } } internal void Begin(PlayerControllerB newTarget, Vector3 cameraPosition, Quaternion cameraRotation, float cameraFov) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) target = newTarget; shot = null; lastSpec = null; focusReady = false; velocity = Vector3.zero; blend = 0f; blendDuration = Mathf.Max(0.01f, Plugin.EntryBlend.Value); UpdateEnvironment(); UpdateFocus(0f); CameraPose cameraPose = new CameraPose(cameraPosition, cameraRotation, cameraFov); StartShot(Pick(first: true), blendDuration, cameraPose); pose = cameraPose; hasPose = true; } internal void Tick(float deltaTime, PlayerControllerB newTarget) { //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)newTarget == (Object)null || shot == null) { return; } if ((Object)(object)newTarget != (Object)(object)target) { OnTargetChanged(newTarget); } if (deltaTime <= 0f) { return; } UpdateEnvironment(); UpdateFocus(deltaTime); UpdateShotYaw(deltaTime); shot.Elapsed += deltaTime; if (shot.Elapsed >= shot.Duration) { float blendSeconds = ((Random.value < Plugin.CutChance.Value) ? 0f : Random.Range(0.55f, 0.95f)); StartShot(Pick(first: false), blendSeconds, pose); } CameraPose cameraPose = Evaluate(shot.Elapsed); CameraPose cameraPose2 = cameraPose; if (blend < blendDuration) { blend = Mathf.Min(blendDuration, blend + deltaTime); float t = ((blendDuration <= 0.0001f) ? 1f : Mathf.SmoothStep(0f, 1f, blend / blendDuration)); cameraPose2 = CameraPose.Lerp(blendFrom, cameraPose, t); if (blendDuration > 0.12f && mask != 0 && Physics.Linecast(blendFrom.Position, cameraPose.Position, mask, (QueryTriggerInteraction)1)) { blend = blendDuration; cameraPose2 = cameraPose; } } pose = cameraPose2; hasPose = true; } internal void NextShot() { if (shot != null && !((Object)(object)target == (Object)null)) { StartShot(Pick(first: false), 0.3f, pose); } } internal void OnTargetChanged(PlayerControllerB newTarget) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)newTarget == (Object)null) && !((Object)(object)newTarget == (Object)(object)target)) { target = newTarget; focusReady = false; velocity = Vector3.zero; UpdateEnvironment(); UpdateFocus(0f); if (hasPose) { StartShot(Pick(first: false), 0.35f, pose); } } } internal void Reset() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) shot = null; lastSpec = null; target = null; hasPose = false; focusReady = false; velocity = Vector3.zero; blend = 0f; blendDuration = 0f; } private void StartShot(ShotSpec spec, float blendSeconds, CameraPose from) { lastSpec = ((shot != null) ? shot.Spec : null); shot = new ShotInstance(spec, target, indoor, ship); blendFrom = from; blend = 0f; blendDuration = Mathf.Max(0f, blendSeconds); if (Plugin.DebugLog.Value) { Plugin.Log.LogInfo((object)("Shot -> " + spec.Name + " (distance " + spec.DistanceStart.ToString("0.0") + "-" + spec.DistanceEnd.ToString("0.0") + "m, " + shot.Duration.ToString("0.0") + "s)")); } } private ShotSpec Pick(bool first) { List<ShotSpec> all = ShotLibrary.All; float[] array = new float[all.Count]; float num = 0f; bool flag = ((Vector3)(ref velocity)).magnitude > 1.2f; bool flag2 = (Object)(object)target != (Object)null && target.isPlayerDead; for (int i = 0; i < all.Count; i++) { ShotSpec shotSpec = all[i]; if (!shotSpec.ExteriorOnly || !indoor) { float num2 = Mathf.Max(0.001f, shotSpec.Weight); if (first) { num2 *= (shotSpec.FirstShot ? 4f : 0.3f); } num2 *= (flag ? shotSpec.MoveBias : shotSpec.IdleBias); if (flag2) { num2 *= shotSpec.DeadBias; } if (shotSpec == lastSpec) { num2 *= 0.12f; } if (indoor && shotSpec.DistanceStart > 9f) { num2 *= 0.15f; } array[i] = num2; num += num2; } } if (num <= 0f) { for (int j = 0; j < all.Count; j++) { ShotSpec shotSpec2 = all[j]; if (!shotSpec2.ExteriorOnly || !indoor) { return shotSpec2; } } return all[0]; } float num3 = Random.value * num; for (int k = 0; k < all.Count; k++) { if (!(array[k] <= 0f)) { num3 -= array[k]; if (num3 <= 0f) { return all[k]; } } } for (int num4 = all.Count - 1; num4 >= 0; num4--) { ShotSpec shotSpec3 = all[num4]; if (!shotSpec3.ExteriorOnly || !indoor) { return shotSpec3; } } return all[all.Count - 1]; } private CameraPose Evaluate(float elapsed) { //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: 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_01e5: 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_01e9: 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_01f1: 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_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: 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_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_023a: 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_0259: Unknown result type (might be due to invalid IL or missing references) //IL_0265: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) //IL_0270: Unknown result type (might be due to invalid IL or missing references) //IL_0272: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_0287: Unknown result type (might be due to invalid IL or missing references) //IL_028c: Unknown result type (might be due to invalid IL or missing references) //IL_039a: Unknown result type (might be due to invalid IL or missing references) //IL_039c: Unknown result type (might be due to invalid IL or missing references) //IL_0322: Unknown result type (might be due to invalid IL or missing references) //IL_0324: Unknown result type (might be due to invalid IL or missing references) //IL_0329: Unknown result type (might be due to invalid IL or missing references) //IL_032e: Unknown result type (might be due to invalid IL or missing references) //IL_0330: Unknown result type (might be due to invalid IL or missing references) //IL_0332: Unknown result type (might be due to invalid IL or missing references) //IL_0337: Unknown result type (might be due to invalid IL or missing references) //IL_033c: Unknown result type (might be due to invalid IL or missing references) //IL_033e: Unknown result type (might be due to invalid IL or missing references) //IL_0340: Unknown result type (might be due to invalid IL or missing references) //IL_0344: Unknown result type (might be due to invalid IL or missing references) //IL_0349: Unknown result type (might be due to invalid IL or missing references) //IL_034d: Unknown result type (might be due to invalid IL or missing references) //IL_0352: Unknown result type (might be due to invalid IL or missing references) //IL_035f: Unknown result type (might be due to invalid IL or missing references) //IL_0364: Unknown result type (might be due to invalid IL or missing references) //IL_0369: Unknown result type (might be due to invalid IL or missing references) //IL_036b: Unknown result type (might be due to invalid IL or missing references) //IL_038e: Unknown result type (might be due to invalid IL or missing references) //IL_0393: Unknown result type (might be due to invalid IL or missing references) //IL_0398: Unknown result type (might be due to invalid IL or missing references) ShotInstance shotInstance = shot; if (shotInstance == null) { return pose; } ShotSpec spec = shotInstance.Spec; float num = Mathf.Max(0.01f, shotInstance.Duration); float num2 = Mathf.Clamp01(elapsed / num); float num3 = (spec.SmoothDrift ? Mathf.SmoothStep(0f, 1f, num2) : num2); float num4 = (shotInstance.IndoorAtStart ? Plugin.InteriorDistanceScale.Value : 1f); if (shotInstance.ShipAtStart) { num4 *= 0.85f; } float num5 = Mathf.Lerp(spec.DistanceStart, spec.DistanceEnd, num3) * shotInstance.DistanceMultiplier * num4; float num6 = (shotInstance.IndoorAtStart ? 7.5f : 45f); if (shotInstance.ShipAtStart) { num6 = Mathf.Min(num6, 4.2f); } num5 = Mathf.Clamp(num5, Mathf.Max(0.8f, spec.MinDistance), num6); float num7 = Mathf.Lerp(spec.HeightStart, spec.HeightEnd, num3) + shotInstance.HeightJitter; float num8 = Mathf.Lerp(spec.AzimuthStart, spec.AzimuthEnd, num3) + shotInstance.AzimuthJitter; float fieldOfView = Mathf.Clamp(Mathf.Lerp(spec.FovStart, spec.FovEnd, num3) * (1f + shotInstance.FovJitter), 18f, 75f); float num9 = Mathf.Lerp(spec.RollStart, spec.RollEnd, num3); Vector3 val = smoothFocus; float num10 = shotInstance.Yaw + num8; if (!shotInstance.SideChosen) { shotInstance.SideOffset = ChooseSide(val, num5, num7, num10); shotInstance.SideChosen = true; } float num11 = (num10 + shotInstance.SideOffset) * (MathF.PI / 180f); Vector3 val2 = default(Vector3); ((Vector3)(ref val2))..ctor(Mathf.Sin(num11), 0f, Mathf.Cos(num11)); Vector3 position = val + val2 * num5 + Vector3.up * num7; position = ClampAboveFloor(val, position); Vector3 position2 = Resolve(val, position); position = KeepAboveGround(position2); Vector3 val3 = val + velocity * spec.Lead - position; if (((Vector3)(ref val3)).sqrMagnitude < 0.0001f) { val3 = Vector3.forward; } Vector3 val4 = ((Mathf.Abs(Vector3.Dot(((Vector3)(ref val3)).normalized, Vector3.up)) > 0.97f) ? Vector3.forward : Vector3.up); Quaternion val5 = Quaternion.LookRotation(val3, val4); val5 *= Quaternion.Euler(spec.LookPitch, spec.LookYaw, num9); float num12 = spec.Handheld * Plugin.HandheldScale.Value; if (num12 > 0.001f) { float seed = shotInstance.Seed; float num13 = Time.time * 0.55f; float num14 = Mathf.PerlinNoise(num13 + seed, seed * 1.7f) - 0.5f; float num15 = Mathf.PerlinNoise(seed * 3.1f, num13 + seed * 0.7f) - 0.5f; float num16 = Mathf.PerlinNoise(num13 * 0.8f + seed * 2.3f, seed * 5.1f) - 0.5f; Vector3 val6 = val5 * Vector3.right; Vector3 val7 = val5 * Vector3.up; position += (val6 * num14 + val7 * num15) * (0.035f * num12); val5 *= Quaternion.Euler(num15 * 0.35f * num12, num14 * 0.45f * num12, num16 * 0.5f * num12); } return new CameraPose(position, val5, fieldOfView); } private void UpdateEnvironment() { //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_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: 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) StartOfRound instance = StartOfRound.Instance; if ((Object)(object)instance == (Object)null || (Object)(object)target == (Object)null) { indoor = false; ship = false; mask = 0; return; } mask = instance.collidersAndRoomMask & -9; Vector3 val = HeadPosition(); ship = target.isInHangarShipRoom || target.isInElevator; if (!ship && (Object)(object)instance.shipBounds != (Object)null) { Bounds bounds = instance.shipBounds.bounds; ship = ((Bounds)(ref bounds)).Contains(val); } indoor = target.isInsideFactory || ship; if (!indoor && mask != 0) { indoor = Physics.Raycast(val + Vector3.up * 0.2f, Vector3.up, 10f, mask, (QueryTriggerInteraction)1); } } private void UpdateFocus(float deltaTime) { //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_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //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_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_007f: 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_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_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_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)target == (Object)null) { return; } Vector3 val = HeadPosition(); if (!focusReady) { smoothFocus = val; lastFocus = val; velocity = Vector3.zero; focusReady = true; return; } if (deltaTime > 0f) { Vector3 val2 = val - lastFocus; if (((Vector3)(ref val2)).sqrMagnitude > 25f) { smoothFocus = val; lastFocus = val; velocity = Vector3.zero; return; } Vector3 val3 = (val - lastFocus) / deltaTime; if (((Vector3)(ref val3)).sqrMagnitude > 900f) { val3 = Vector3.zero; } velocity = Vector3.Lerp(velocity, val3, 1f - Mathf.Exp(-7f * deltaTime)); } smoothFocus = Vector3.Lerp(smoothFocus, val, 1f - Mathf.Exp(-9f * deltaTime)); lastFocus = val; } private void UpdateShotYaw(float deltaTime) { //IL_0044: Unknown result type (might be due to invalid IL or missing references) if (shot != null && !((Object)(object)target == (Object)null) && !(deltaTime <= 0f)) { float followFacing = shot.Spec.FollowFacing; if (!(followFacing <= 0.001f)) { float y = ((Component)target).transform.eulerAngles.y; shot.Yaw = Mathf.LerpAngle(shot.Yaw, y, 1f - Mathf.Exp((0f - followFacing) * deltaTime)); } } } private Vector3 HeadPosition() { //IL_000e: 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_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_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)target == (Object)null) { return Vector3.zero; } Transform val = null; if (target.isPlayerDead && (Object)(object)target.deadBody != (Object)null && target.deadBody.bodyParts != null && target.deadBody.bodyParts.Length != 0 && (Object)(object)target.deadBody.bodyParts[0] != (Object)null) { val = ((Component)target.deadBody.bodyParts[0]).transform; } if ((Object)(object)val == (Object)null && target.bodyParts != null && target.bodyParts.Length != 0 && (Object)(object)target.bodyParts[0] != (Object)null) { val = target.bodyParts[0]; } if ((Object)(object)val == (Object)null && (Object)(object)target.playerEye != (Object)null) { val = target.playerEye; } if (!((Object)(object)val != (Object)null)) { return ((Component)target).transform.position + Vector3.up * 1.6f; } return val.position; } private float ChooseSide(Vector3 focus, float distance, float height, float baseYaw) { //IL_005c: 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_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: 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_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) if (mask == 0) { return 0f; } float[] array = new float[7] { 0f, 50f, -50f, 100f, -100f, 145f, -145f }; float result = 0f; float num = -1f; Vector3 val = default(Vector3); for (int i = 0; i < array.Length; i++) { float num2 = (baseYaw + array[i]) * (MathF.PI / 180f); ((Vector3)(ref val))..ctor(Mathf.Sin(num2), 0f, Mathf.Cos(num2)); Vector3 desired = ClampAboveFloor(focus, focus + val * distance + Vector3.up * height); Vector3 val2 = Resolve(focus, desired) - focus; float num3 = ((Vector3)(ref val2)).sqrMagnitude; if (array[i] == 0f) { num3 *= 1.05f; } if (num3 > num) { num = num3; result = array[i]; } } return result; } private Vector3 ClampAboveFloor(Vector3 focus, Vector3 position) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_005d: 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_004c: Unknown result type (might be due to invalid IL or missing references) if (mask == 0) { return position; } RaycastHit val = default(RaycastHit); if (Physics.Raycast(focus + Vector3.up * 0.5f, Vector3.down, ref val, 6f, mask, (QueryTriggerInteraction)1)) { float num = ((RaycastHit)(ref val)).point.y + 0.3f; if (position.y < num) { position.y = num; } } return position; } private Vector3 Resolve(Vector3 focus, Vector3 desired) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0008: 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_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006e: 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_0083: 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_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) if (mask == 0) { return desired; } Vector3 val = desired - focus; float magnitude = ((Vector3)(ref val)).magnitude; if (magnitude < 0.001f) { return desired; } Vector3 val2 = val / magnitude; float num = magnitude; RaycastHit val3 = default(RaycastHit); if (Physics.SphereCast(focus, 0.16f, val2, ref val3, magnitude, mask, (QueryTriggerInteraction)1)) { num = Mathf.Clamp(((RaycastHit)(ref val3)).distance - 0.18f, 0.02f, magnitude); } Vector3 val4 = focus + val2 * num; if (Physics.CheckSphere(val4, 0.18f, mask, (QueryTriggerInteraction)1)) { val4 = focus + val2 * Mathf.Max(0.02f, num - 0.25f); } return val4; } private Vector3 KeepAboveGround(Vector3 position) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0008: 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_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) if (mask == 0) { return position; } RaycastHit val = default(RaycastHit); if (Physics.Raycast(position, Vector3.down, ref val, 0.6f, mask, (QueryTriggerInteraction)1)) { float num = ((RaycastHit)(ref val)).point.y + 0.2f; if (position.y < num) { position.y = num; } } return position; } } internal static class ShotLibrary { internal static readonly List<ShotSpec> All = Build(); private static List<ShotSpec> Build() { return new List<ShotSpec> { new ShotSpec { Name = "EstablishingWide", DistanceStart = 13f, DistanceEnd = 11f, HeightStart = 3.2f, HeightEnd = 2.6f, AzimuthStart = 32f, AzimuthEnd = 22f, FovStart = 40f, FovEnd = 37f, LookYaw = 3f, LookPitch = 1.5f, MinTime = 10f, MaxTime = 14f, Weight = 1.15f, MoveBias = 0.7f, IdleBias = 1f, DeadBias = 1.6f, Handheld = 0.25f, FollowFacing = 0f, ExteriorOnly = true, FirstShot = true }, new ShotSpec { Name = "LongLensObserver", DistanceStart = 19f, DistanceEnd = 16f, HeightStart = 2.1f, HeightEnd = 1.8f, AzimuthStart = 54f, AzimuthEnd = 46f, FovStart = 24f, FovEnd = 27f, LookYaw = 4f, MinTime = 9f, MaxTime = 13f, Weight = 0.95f, MoveBias = 0.7f, IdleBias = 1.1f, DeadBias = 1.4f, Handheld = 0.2f, FollowFacing = 0f, ExteriorOnly = true }, new ShotSpec { Name = "CraneDown", DistanceStart = 13f, DistanceEnd = 5.5f, HeightStart = 7.5f, HeightEnd = 1.6f, AzimuthStart = 40f, AzimuthEnd = 25f, FovStart = 46f, FovEnd = 50f, LookYaw = 2f, MinTime = 10f, MaxTime = 13f, Weight = 0.7f, MoveBias = 0.8f, IdleBias = 0.9f, DeadBias = 1.4f, Handheld = 0.25f, FollowFacing = 0f, ExteriorOnly = true }, new ShotSpec { Name = "TopDown", DistanceStart = 2.4f, DistanceEnd = 2.2f, HeightStart = 9f, HeightEnd = 8f, AzimuthStart = 10f, AzimuthEnd = -5f, FovStart = 42f, FovEnd = 40f, LookYaw = 0f, MinTime = 8f, MaxTime = 11f, Weight = 0.5f, MoveBias = 0.4f, IdleBias = 0.8f, DeadBias = 1.5f, Handheld = 0.15f, FollowFacing = 0f, ExteriorOnly = true }, new ShotSpec { Name = "WormEye", DistanceStart = 6f, DistanceEnd = 5f, HeightStart = -1.3f, HeightEnd = -1.25f, AzimuthStart = 12f, AzimuthEnd = -4f, FovStart = 56f, FovEnd = 54f, RollStart = -2f, RollEnd = -1f, LookYaw = 4f, LookPitch = -3f, MinTime = 7f, MaxTime = 10f, Weight = 0.5f, MoveBias = 0.8f, IdleBias = 0.9f, DeadBias = 1.5f, Handheld = 0.5f, FollowFacing = 0.1f, ExteriorOnly = true }, new ShotSpec { Name = "SilhouetteBack", DistanceStart = 7f, DistanceEnd = 6f, HeightStart = 0.6f, HeightEnd = 0.4f, AzimuthStart = 178f, AzimuthEnd = 171f, FovStart = 34f, FovEnd = 36f, LookYaw = 2f, MinTime = 8f, MaxTime = 11f, Weight = 0.4f, MoveBias = 0.8f, IdleBias = 0.8f, DeadBias = 1.1f, Handheld = 0.3f, FollowFacing = 0f, ExteriorOnly = true }, new ShotSpec { Name = "PushIn", DistanceStart = 9f, DistanceEnd = 4.8f, HeightStart = 2.2f, HeightEnd = 1.7f, AzimuthStart = 26f, AzimuthEnd = 17f, FovStart = 48f, FovEnd = 42f, LookYaw = 4f, MinTime = 8f, MaxTime = 11f, Weight = 1.15f, MoveBias = 1.15f, IdleBias = 1.1f, DeadBias = 1.1f, Handheld = 0.3f, FollowFacing = 0.15f, FirstShot = true }, new ShotSpec { Name = "LowHero", DistanceStart = 3.9f, DistanceEnd = 3.3f, HeightStart = -1.05f, HeightEnd = -0.95f, AzimuthStart = 26f, AzimuthEnd = 17f, FovStart = 52f, FovEnd = 50f, RollStart = 1.5f, RollEnd = 0.5f, LookYaw = 4f, LookPitch = -1.5f, MinTime = 7f, MaxTime = 10f, Weight = 1.05f, MoveBias = 1.1f, IdleBias = 1.1f, DeadBias = 1.5f, Handheld = 0.45f, FollowFacing = 0.2f }, new ShotSpec { Name = "CloseUp", DistanceStart = 1.5f, DistanceEnd = 1.35f, HeightStart = 0.02f, HeightEnd = 0.01f, AzimuthStart = 9f, AzimuthEnd = 5f, FovStart = 38f, FovEnd = 36f, LookYaw = 5f, LookPitch = -1f, MinTime = 6f, MaxTime = 9f, Weight = 1.05f, MoveBias = 0.55f, IdleBias = 1.5f, DeadBias = 0.55f, Handheld = 0.3f, FollowFacing = 0.3f, MinDistance = 0.5f }, new ShotSpec { Name = "FaceProfile", DistanceStart = 2.1f, DistanceEnd = 1.95f, HeightStart = 0.03f, HeightEnd = 0.02f, AzimuthStart = 88f, AzimuthEnd = 80f, FovStart = 43f, FovEnd = 41f, LookYaw = 6f, LookPitch = -1f, MinTime = 6f, MaxTime = 9f, Weight = 0.85f, MoveBias = 0.6f, IdleBias = 1.3f, DeadBias = 0.6f, Handheld = 0.3f, FollowFacing = 0.35f }, new ShotSpec { Name = "OverShoulder", DistanceStart = 2.45f, DistanceEnd = 2.2f, HeightStart = 0.14f, HeightEnd = 0.1f, AzimuthStart = 152f, AzimuthEnd = 145f, FovStart = 46f, FovEnd = 44f, LookYaw = 7f, MinTime = 7f, MaxTime = 10f, Weight = 0.95f, MoveBias = 0.9f, IdleBias = 1.15f, DeadBias = 0.45f, Handheld = 0.35f, FollowFacing = 0.5f }, new ShotSpec { Name = "Orbit", DistanceStart = 4.8f, DistanceEnd = 4.3f, HeightStart = 0.95f, HeightEnd = 0.7f, AzimuthStart = 62f, AzimuthEnd = 138f, FovStart = 48f, FovEnd = 46f, LookYaw = 3f, MinTime = 9f, MaxTime = 13f, Weight = 1.05f, MoveBias = 1.15f, IdleBias = 0.85f, DeadBias = 1.2f, Handheld = 0.2f, SmoothDrift = false, FollowFacing = 0f }, new ShotSpec { Name = "TrackingDolly", DistanceStart = 4.4f, DistanceEnd = 4.1f, HeightStart = 1f, HeightEnd = 0.85f, AzimuthStart = 106f, AzimuthEnd = 94f, FovStart = 50f, FovEnd = 48f, LookYaw = 4f, MinTime = 8f, MaxTime = 11f, Weight = 0.95f, MoveBias = 1.6f, IdleBias = 0.5f, DeadBias = 0.6f, Handheld = 0.55f, FollowFacing = 0.1f }, new ShotSpec { Name = "DutchAngle", DistanceStart = 3.4f, DistanceEnd = 3.1f, HeightStart = 0.55f, HeightEnd = 0.25f, AzimuthStart = 56f, AzimuthEnd = 76f, FovStart = 46f, FovEnd = 44f, RollStart = 7f, RollEnd = 10f, LookYaw = 5f, MinTime = 7f, MaxTime = 10f, Weight = 0.65f, MoveBias = 0.9f, IdleBias = 1f, DeadBias = 0.8f, Handheld = 0.4f, FollowFacing = 0.15f }, new ShotSpec { Name = "HandheldDoc", DistanceStart = 3.1f, DistanceEnd = 2.7f, HeightStart = 0.45f, HeightEnd = 0.2f, AzimuthStart = 31f, AzimuthEnd = 14f, FovStart = 54f, FovEnd = 50f, LookYaw = 4f, MinTime = 8f, MaxTime = 12f, Weight = 0.85f, MoveBias = 1.1f, IdleBias = 0.9f, DeadBias = 1f, Handheld = 2.2f, FollowFacing = 0.2f } }; } }