using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using AIGraph; using AK; using Agents; using AssetShards; using BepInEx; using BepInEx.Core.Logging.Interpolation; using BepInEx.Logging; using BepInEx.Unity.IL2CPP; using BepInEx.Unity.IL2CPP.Utils.Collections; using BossfightLevel.BossfightMain; using Enemies; using FluffyUnderware.DevTools.Extensions; using GTFO.API; using GameData; using Globals; using HarmonyLib; using Il2CppInterop.Runtime.Injection; using Il2CppInterop.Runtime.InteropTypes.Arrays; using Il2CppSystem; using Il2CppSystem.Collections.Generic; using LevelGeneration; using Localization; using Microsoft.CodeAnalysis; using Player; using SNetwork; using StrikerBossfight.BossfightMain; using StrikerBossfight.CutsceneCamera; using UnityEngine; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")] [assembly: AssemblyCompany("BossfightLevel")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+97829c4d5b8d2f8703db1c9aa3a119d8927d3512")] [assembly: AssemblyProduct("BossfightLevel")] [assembly: AssemblyTitle("BossfightLevel")] [assembly: AssemblyVersion("1.0.0.0")] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [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] [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; } } } namespace StrikerBossfight { [BepInPlugin("com.Brandonious.StrikerBossfight", "StrikerBossfight", "1.0.0")] public class Loader : BasePlugin { public const string MODNAME = "StrikerBossfight"; public const string AUTHOR = "Brandonious"; public const string GUID = "com.Brandonious.StrikerBossfight"; public const string VERSION = "1.0.0"; public static ManualLogSource Logger; public override void Load() { //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Expected O, but got Unknown //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Expected O, but got Unknown ClassInjector.RegisterTypeInIl2Cpp(); ClassInjector.RegisterTypeInIl2Cpp(); ClassInjector.RegisterTypeInIl2Cpp(); ClassInjector.RegisterTypeInIl2Cpp(); ClassInjector.RegisterTypeInIl2Cpp(); ClassInjector.RegisterTypeInIl2Cpp(); ClassInjector.RegisterTypeInIl2Cpp(); ClassInjector.RegisterTypeInIl2Cpp(); ClassInjector.RegisterTypeInIl2Cpp(); EventAPI.OnManagersSetup += delegate { CutsceneCameraLogic cutsceneCameraLogic = ((Component)Global.Current).gameObject.AddComponent(); LevelAPI.OnEnterLevel += cutsceneCameraLogic.LevelStarted; BossfightCore bossfightCore = ((Component)Global.Current).gameObject.AddComponent(); LevelAPI.OnEnterLevel += bossfightCore.LevelStarted; LevelAPI.OnLevelCleanup += bossfightCore.Cleanup; }; NetworkAPI.RegisterEvent("OnNetworkedAttack", (Action)BossfightCore.OnNetworkedAttack); NetworkAPI.RegisterEvent("OnFireballTargetSet", (Action)FireballAttack.OnFireballTargetSet); Logger = ((BasePlugin)this).Log; Harmony val = new Harmony("StrikerBossfight"); val.PatchAll(); ManualLogSource log = ((BasePlugin)this).Log; bool flag = default(bool); BepInExWarningLogInterpolatedStringHandler val2 = new BepInExWarningLogInterpolatedStringHandler(15, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("Plugin "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted("StrikerBossfight"); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" Loaded!"); } log.LogWarning(val2); } } } namespace StrikerBossfight.CutsceneCamera { public class CameraPositionData { public enum EasingType { EaseIn, EaseOut, EaseInOut, None } public Vector3 StartPos { get; set; } public Vector3 EndPos { get; set; } public Vector3 StartRot { get; set; } public Vector3 EndRot { get; set; } public float ShotDuration { get; set; } = 5f; public float WaitAfterMove { get; set; } public EasingType CamEasingType { get; set; } = EasingType.None; public bool LerpTowardsThisPoint { get; set; } } public class CameraSequenceData { public string CutsceneName { get; set; } = string.Empty; public float FadeInOutTime { get; set; } = 1.5f; public List SequenceData { get; set; } public uint PersistentId { get; set; } } public class CutsceneCameraLogic : MonoBehaviourExtended { public bool cutsceneActive; public bool debugMode = false; public GameObject cutsceneCanvasObject; public GameObject Image1; public GameObject Image2; public PlayerAgent player; public Transform fpsCamera; public GameObject cameraParent; public float moveSpeed = 0.05f; public float rotationSpeed = 300f; public float rotX; public float rotY; public float timer = 0f; public float waitTimer; public int currentShot = 0; public CameraSequenceData data; public CameraPositionData current; public AnimationCurve easeInCurve = new AnimationCurve((Keyframe[])(object)new Keyframe[2] { new Keyframe(0f, 0f, 0f, 2f), new Keyframe(1f, 1f, 0f, 0f) }); public AnimationCurve easeOutCurve = new AnimationCurve((Keyframe[])(object)new Keyframe[2] { new Keyframe(0f, 0f, 2f, 0f), new Keyframe(1f, 1f, 0f, 0f) }); public AnimationCurve easeInOutCurve = AnimationCurve.EaseInOut(0f, 0f, 1f, 1f); public static CutsceneCameraLogic Instance { get; set; } public void LevelStarted() { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Expected O, but got Unknown player = PlayerManager.GetLocalPlayerAgent(); fpsCamera = ((Component)player.FPSCamera).transform; List sequenceData = new List { new CameraPositionData { StartPos = ((Component)fpsCamera).transform.position, EndPos = new Vector3(0f, 4f, 105f), StartRot = new Vector3(0f, 0f, 0f), EndRot = new Vector3(0f, 0f, 0f), CamEasingType = CameraPositionData.EasingType.EaseIn, ShotDuration = 0.5f }, new CameraPositionData { StartPos = new Vector3(0f, 4f, 105f), EndPos = new Vector3(0f, 4f, 120f), StartRot = new Vector3(0f, 0f, 0f), EndRot = new Vector3(0f, 0f, 0f), CamEasingType = CameraPositionData.EasingType.EaseOut, ShotDuration = 12f, WaitAfterMove = 0f } }; data = new CameraSequenceData { CutsceneName = "Test", PersistentId = 1u, SequenceData = sequenceData }; SetupCameraCanvas(); cameraParent = new GameObject("Camera Parent"); current = data.SequenceData.First(); } public void SetupCameraCanvas() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Expected O, but got Unknown //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: 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_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Expected O, but got Unknown //IL_0162: 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_0198: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) cutsceneCanvasObject = new GameObject("Cutscene Canvas"); Canvas val = cutsceneCanvasObject.AddComponent(); val.renderMode = (RenderMode)0; cutsceneCanvasObject.AddComponent(); cutsceneCanvasObject.AddComponent(); cutsceneCanvasObject.GetComponent().uiScaleMode = (ScaleMode)1; Image1 = new GameObject("Top Bar"); Image1.transform.parent = cutsceneCanvasObject.transform; Image val2 = Image1.AddComponent(); ((Graphic)val2).rectTransform.anchorMin = new Vector2(0.5f, 1f); ((Graphic)val2).rectTransform.anchorMax = new Vector2(0.5f, 1f); ((Graphic)val2).rectTransform.pivot = new Vector2(0.5f, 1f); ((Graphic)val2).rectTransform.sizeDelta = new Vector2(2000f, 60f); ((Graphic)val2).rectTransform.anchoredPosition = new Vector2(0f, 0f); ((Graphic)val2).color = Color.black; Image2 = new GameObject("Bottom Bar"); Image2.transform.parent = cutsceneCanvasObject.transform; Image val3 = Image2.AddComponent(); ((Graphic)val3).rectTransform.anchorMin = new Vector2(0.5f, 0f); ((Graphic)val3).rectTransform.anchorMax = new Vector2(0.5f, 0f); ((Graphic)val3).rectTransform.pivot = new Vector2(0.5f, 0f); ((Graphic)val3).rectTransform.sizeDelta = new Vector2(2000f, 60f); ((Graphic)val3).rectTransform.anchoredPosition = new Vector2(0f, 0f); ((Graphic)val3).color = Color.black; cutsceneCanvasObject.SetActive(false); } public void Update() { //IL_009d: 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_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: 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_0217: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_03e4: Unknown result type (might be due to invalid IL or missing references) //IL_025a: Unknown result type (might be due to invalid IL or missing references) //IL_025f: Unknown result type (might be due to invalid IL or missing references) //IL_0263: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_028e: Unknown result type (might be due to invalid IL or missing references) //IL_02b8: Unknown result type (might be due to invalid IL or missing references) //IL_02e2: Unknown result type (might be due to invalid IL or missing references) //IL_0301: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0339: Unknown result type (might be due to invalid IL or missing references) if (!RundownManager.ExpeditionIsStarted) { return; } if ((Object)(object)Instance == (Object)null) { Debug.LogWarning(Object.op_Implicit("Getting Instance")); Instance = this; Debug.LogWarning(Object.op_Implicit("Done")); } if (cutsceneActive && !debugMode) { PlayCutscene(); } UpdateCuller(); if (cutsceneActive && debugMode) { player.m_movingCuller.UpdatePosition(((Agent)player).DimensionIndex, cameraParent.transform.position); if (Input.GetKey((KeyCode)119)) { Transform transform = cameraParent.transform; transform.position += fpsCamera.forward * moveSpeed; } if (Input.GetKey((KeyCode)115)) { Transform transform2 = cameraParent.transform; transform2.position -= fpsCamera.forward * moveSpeed; } if (Input.GetKey((KeyCode)97)) { Transform transform3 = cameraParent.transform; transform3.position -= fpsCamera.right * moveSpeed; } if (Input.GetKey((KeyCode)100)) { Transform transform4 = cameraParent.transform; transform4.position += fpsCamera.right * moveSpeed; } if (Input.GetKey((KeyCode)113)) { Transform transform5 = cameraParent.transform; transform5.position += fpsCamera.up * moveSpeed; } if (Input.GetKey((KeyCode)101)) { Transform transform6 = cameraParent.transform; transform6.position -= fpsCamera.up * moveSpeed; } if (Input.GetKeyDown((KeyCode)122)) { Quaternion rotation = cameraParent.transform.rotation; Vector3 eulerAngles = ((Quaternion)(ref rotation)).eulerAngles; Debug.Log(Object.op_Implicit($"\n{cameraParent.transform.position.x}f, {cameraParent.transform.position.y}f, {cameraParent.transform.position.z}f\n{eulerAngles.x}f, {eulerAngles.y}f, {eulerAngles.z}f\n")); } float axis = Input.GetAxis("MouseX"); float axis2 = Input.GetAxis("MouseY"); rotX += axis * rotationSpeed * Time.deltaTime; rotY -= axis2 * rotationSpeed * Time.deltaTime; Mathf.Clamp(axis2, -90f, 90f); cameraParent.transform.rotation = Quaternion.Euler(rotY, rotX, 0f); } } public void ToggleCutscene(bool isActive) { //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) if (!isActive) { cameraParent.transform.position = ((Component)player.FPItemHolder).transform.position; } timer = 0f; currentShot = 0; waitTimer = 0f; current = data.SequenceData.First(); current.StartPos = ((Component)fpsCamera).transform.position; cutsceneActive = isActive; player.PlayerSyncModel.SetHeadVisible(isActive, isActive); cutsceneCanvasObject.SetActive(isActive); ((Behaviour)player.Locomotion).enabled = !isActive; ((Behaviour)((Component)fpsCamera).GetComponent()).enabled = !isActive; fpsCamera.parent = (isActive ? cameraParent.transform : ((Component)player.FPItemHolder).transform.parent); player.FPSCamera.LookSpeedModifier = ((!isActive) ? 1 : 0); player.FPItemHolder.ItemHiddenTrigger = isActive; ((GuiLayer)GuiManager.CrosshairLayer).SetVisible(!isActive); } private void UpdateCuller() { //IL_001f: 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_0025: 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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_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) if (!cutsceneActive) { return; } Vector3 val = ((Component)fpsCamera).transform.position; RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(val, Vector3.down, ref val2, 50f, LayerManager.MASK_WORLD)) { val = val2.m_Point; } if ((Object)(object)((RaycastHit)(ref val2)).transform != (Object)null) { AIG_CourseNode val3 = FindCourseNodeInParent(((RaycastHit)(ref val2)).transform); if (val3 != null && player.m_movingCuller.CurrentNode.CourseNode != val3) { player.m_movingCuller.SetCurrentNode(val3.m_cullNode); } } player.m_movingCuller.UpdatePosition(((Agent)player).m_dimensionIndex, val); } public static AIG_CourseNode? FindCourseNodeInParent(Transform nodeItem) { Transform parent = nodeItem.parent; while ((Object)(object)parent != (Object)null) { LG_Area val = ((Component)parent).GetComponent() ?? null; if ((Object)(object)val != (Object)null) { return val.m_courseNode; } parent = parent.parent; } return null; } public void PlayCutscene() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0050: 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_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) timer += 1f * Time.deltaTime; RaycastHit val2 = default(RaycastHit); Vector3 val = (Physics.Raycast(cameraParent.transform.position, Vector3.down, ref val2) ? ((RaycastHit)(ref val2)).point : cameraParent.transform.position); player.m_movingCuller.UpdatePosition(((Agent)player).m_dimensionIndex, val); if (timer <= current.ShotDuration) { float num = timer / current.ShotDuration; switch (current.CamEasingType) { case CameraPositionData.EasingType.EaseIn: num = easeInCurve.Evaluate(num); break; case CameraPositionData.EasingType.EaseOut: num = easeOutCurve.Evaluate(num); break; case CameraPositionData.EasingType.EaseInOut: num = easeInOutCurve.Evaluate(num); break; } Vector3 position = Vector3.Lerp(current.StartPos, current.EndPos, num); Quaternion rotation = Quaternion.Euler(current.StartRot); cameraParent.transform.position = position; cameraParent.transform.rotation = rotation; } else if (waitTimer <= current.WaitAfterMove) { waitTimer += 1f * Time.deltaTime; } else if (currentShot + 1 < data.SequenceData.Count) { current = UpdateShot(); } else { ToggleCutscene(isActive: false); } } public CameraPositionData UpdateShot() { currentShot++; waitTimer = 0f; timer = 0f; return data.SequenceData[currentShot]; } public IEnumerator FadeOut(float fadeTime) { yield return (object)new WaitForSeconds(fadeTime); } } } namespace StrikerBossfight.BossfightMain { [HarmonyPatch] internal class BossfightPatches { public static event Action? OnVolumeChangedAction; [HarmonyPatch(typeof(CellSettingsApply), "ApplyMusicVolume")] [HarmonyPostfix] private static void GlobalMusic(float value) { BossfightPatches.OnVolumeChangedAction?.Invoke(value); } [HarmonyPatch(typeof(EB_InCombat), "TryScream")] [HarmonyPrefix] private static bool Postfix_TryScream(EB_InCombat __instance) { if (((EB_StateBase)__instance).m_ai.m_enemyAgent.EnemyDataID == 150 || ((EB_StateBase)__instance).m_ai.m_enemyAgent.EnemyDataID == 151) { return false; } return true; } } } namespace BossfightLevel.BossfightMain { public class AnimationEventReceiver : MonoBehaviour { public static event Action PunchEventTriggered; public void PunchEvent() { AnimationEventReceiver.PunchEventTriggered?.Invoke(); } } internal class BossfightCore : MonoBehaviourExtended { public enum PlumePattern { OnPlayers, CircleExpand, CircleExpandAlternating, Spiral } private EnemyAgent selectedEnemy; private EnemyAgent finalBoss; private Animator enemyAnim; private GameObject sunPrefab; private GameObject preFireballEffectPrefab; private GameObject flameAuraPrefab; private AudioSource spotlightEmitter; private AudioSource musicLooper; private AudioSource musicTransitioner; private List audioClips; private AudioClip spotlightSfx; private Light spotlight; private int currentMusicStep; private bool fadeMusicLooperOut; private bool enteredPhase2; private bool enteredPhase3; private bool enteredFinal; private bool introStarted; private bool introFinished; private bool youRaiseMeUp; private bool canAttack; private bool isOnCooldown; private float attackCooldown; private float targetHeight = 2f; private List AllSpawnPoints = new List { new Vector3(-62f, 0f, 127f), new Vector3(62f, 0f, 127f) }; public static BossfightCore Instance { get; private set; } public void OnEnable() { Instance = this; AnimationEventReceiver.PunchEventTriggered += OnPunch; SunAttack.OnSunAttackFinished += GoToIdleFloating; FireballAttack.OnFireballAttackFinished += GoToIdleFloating; PlumeAttack.OnPlumeAttackFinished += GoToIdleFloating; BossfightPatches.OnVolumeChangedAction += OnVolumeChanged; } public void OnDisable() { AnimationEventReceiver.PunchEventTriggered -= OnPunch; SunAttack.OnSunAttackFinished -= GoToIdleFloating; FireballAttack.OnFireballAttackFinished -= GoToIdleFloating; PlumeAttack.OnPlumeAttackFinished -= GoToIdleFloating; BossfightPatches.OnVolumeChangedAction -= OnVolumeChanged; } public void OnApplicationFocus(bool hasFocus) { if (RundownManager.ExpeditionIsStarted) { spotlightEmitter.mute = !hasFocus; musicLooper.mute = !hasFocus; musicTransitioner.mute = !hasFocus; } } public void OnVolumeChanged(float value) { if (RundownManager.ExpeditionIsStarted) { spotlightEmitter.volume = value; musicLooper.volume = value; musicTransitioner.volume = value; } } public void ProgressMusic() { currentMusicStep++; Debug.Log(Object.op_Implicit($"Current music step is {currentMusicStep}, playing {((Object)audioClips[currentMusicStep]).name}!")); if (currentMusicStep % 2 == 0) { fadeMusicLooperOut = true; musicTransitioner.clip = audioClips[currentMusicStep]; musicTransitioner.Play(); ((MonoBehaviour)this).StartCoroutine(CollectionExtensions.WrapToIl2Cpp(WaitThenStop(audioClips[currentMusicStep].length))); } else { musicLooper.volume = musicTransitioner.volume; musicLooper.clip = audioClips[currentMusicStep]; musicLooper.Play(); } } public void StopAndResetMusic() { if ((Object)(object)musicLooper != (Object)null) { currentMusicStep = -1; musicLooper.Stop(); musicTransitioner.Stop(); } } public void Update() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Invalid comparison between Unknown and I4 //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Invalid comparison between Unknown and I4 //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_02c9: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: 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) if ((int)GameStateManager.CurrentStateName == 15 || (int)GameStateManager.CurrentStateName == 14) { StopAndResetMusic(); } if (SNet.IsMaster && (Object)(object)finalBoss != (Object)null) { finalBoss.Locomotion.m_maxMovementSpeed = 0f; ((Component)finalBoss).transform.position = new Vector3(120f, 228.5f, 292f); } if (!RundownManager.ExpeditionIsStarted) { return; } if (fadeMusicLooperOut) { if (musicLooper.volume > 0f) { AudioSource obj = musicLooper; obj.volume -= Time.deltaTime * 0.2f; } else { musicLooper.Stop(); fadeMusicLooperOut = false; } } if ((Object)(object)selectedEnemy != (Object)null && !((Agent)selectedEnemy).Alive && !fadeMusicLooperOut && !enteredFinal) { enteredFinal = true; fadeMusicLooperOut = true; ((MonoBehaviour)this).StartCoroutine(CollectionExtensions.WrapToIl2Cpp(WaitForFinalMusic())); return; } if ((Object)(object)selectedEnemy == (Object)null) { canAttack = false; List reachableEnemiesInNodes = AIG_CourseGraph.GetReachableEnemiesInNodes(((Agent)PlayerManager.GetLocalPlayerAgent()).CourseNode, 100); Enumerator enumerator = reachableEnemiesInNodes.GetEnumerator(); while (enumerator.MoveNext()) { EnemyAgent current = enumerator.Current; if (((GameDataBlockBase)(object)current.EnemyData).persistentID == 150) { selectedEnemy = current; ((Dam_SyncedDamageBase)selectedEnemy.Damage).HealthMax = 700 * PlayerManager.PlayerAgentsInLevel.Count; ((Dam_SyncedDamageBase)selectedEnemy.Damage).Health = 700 * PlayerManager.PlayerAgentsInLevel.Count; targetHeight = ((Component)selectedEnemy).transform.position.y; } } if ((Object)(object)selectedEnemy != (Object)null) { RuntimeAnimatorController loadedAsset = AssetShardManager.GetLoadedAsset("Assets/-CustomStuff/BuildThisOne/fungus.controller", false); enemyAnim = selectedEnemy.Anim; enemyAnim.runtimeAnimatorController = loadedAsset; enemyAnim.SetTrigger("GoToSitting"); AnimationEventReceiver animationEventReceiver = ((Component)selectedEnemy).gameObject.AddComponent(); } return; } selectedEnemy.Locomotion.m_maxMovementSpeed = 0f; ((Component)selectedEnemy).transform.position = new Vector3(((Component)selectedEnemy).transform.position.x, targetHeight, ((Component)selectedEnemy).transform.position.z); if (!introStarted) { ((MonoBehaviour)this).StartCoroutine(CollectionExtensions.WrapToIl2Cpp(PerformIntro())); } if (youRaiseMeUp) { targetHeight += Time.deltaTime / 1.75f; } if (introFinished) { if (((Dam_SyncedDamageBase)selectedEnemy.Damage).Health < (float)(700 * PlayerManager.PlayerAgentsInLevel.Count) * 0.66f && !enteredPhase2) { enteredPhase2 = true; ProgressMusic(); } if (((Dam_SyncedDamageBase)selectedEnemy.Damage).Health < (float)(700 * PlayerManager.PlayerAgentsInLevel.Count) * 0.33f && !enteredPhase3) { enteredPhase3 = true; ProgressMusic(); } if (canAttack) { Attack(); } else if (isOnCooldown && attackCooldown > 0f) { attackCooldown -= Time.deltaTime; } else if (attackCooldown < 0f) { isOnCooldown = false; canAttack = true; } } } public void OnPunch() { Debug.Log(Object.op_Implicit("PunchPerformed")); } public void Attack() { //IL_0232: Unknown result type (might be due to invalid IL or missing references) if (!SNet.IsMaster) { return; } canAttack = false; enemyAnim.SetTrigger("PraiseSun"); attackCooldown = (enteredPhase3 ? 6.5f : ((float)(enteredPhase2 ? 7 : 8))); int num = Random.Range(1, 6); int num2 = Random.Range(1, 5); int index = Random.Range(0, 5); int index2 = Random.Range(0, 2); NetworkAPI.InvokeEvent("OnNetworkedAttack", num * 10 + num2, (SNet_ChannelType)2); switch (num) { case 1: SpawnSunAttack(10f, 10f); break; case 2: SpawnFireballAttack(8f, enteredPhase3 ? 0.5f : (enteredPhase2 ? 0.75f : 1f)); break; case 3: case 4: switch (num2) { case 1: SpawnFirePlumeAttacks(PlumePattern.CircleExpand, 5, enteredPhase3 ? 0f : (enteredPhase2 ? 0.25f : 0.6f)); break; case 2: SpawnFirePlumeAttacks(PlumePattern.OnPlayers, enteredPhase3 ? 12 : (enteredPhase2 ? 8 : 4), enteredPhase3 ? 0.33f : (enteredPhase2 ? 0.5f : 1f)); break; case 3: SpawnFirePlumeAttacks(PlumePattern.Spiral, 16, enteredPhase3 ? 0.1f : (enteredPhase2 ? 0.2f : 0.3f)); break; case 4: SpawnFirePlumeAttacks(PlumePattern.CircleExpandAlternating, 5, enteredPhase3 ? 0f : (enteredPhase2 ? 0.25f : 0.6f)); break; } break; case 5: attackCooldown += 6 - PlayerManager.PlayerAgentsInLevel.Count; isOnCooldown = true; SpawnWave(WaveDatas.AllWaveDatas[index], AllSpawnPoints[index2]); break; } } public static void OnNetworkedAttack(ulong senderID, int value) { Debug.Log(Object.op_Implicit("Recieved Networked Attack")); Instance?.NetworkedAttack(value); } public void NetworkedAttack(int value) { if (SNet.IsMaster) { return; } Debug.Log(Object.op_Implicit("Running Networked Attack")); string text = value.ToString(); canAttack = false; enemyAnim.SetTrigger("PraiseSun"); attackCooldown = (enteredPhase3 ? 7.5f : ((float)(enteredPhase2 ? 9 : 10))); switch (text[0]) { case '1': SpawnSunAttack(10f, 10f); break; case '2': SpawnFireballAttack(8f, enteredPhase3 ? 0.5f : (enteredPhase2 ? 0.75f : 1f)); break; case '3': case '4': switch (text[1]) { case '1': SpawnFirePlumeAttacks(PlumePattern.CircleExpand, 5, enteredPhase3 ? 0f : (enteredPhase2 ? 0.25f : 0.6f)); break; case '2': SpawnFirePlumeAttacks(PlumePattern.OnPlayers, enteredPhase3 ? 12 : (enteredPhase2 ? 8 : 4), enteredPhase3 ? 0.33f : (enteredPhase2 ? 0.5f : 1f)); break; case '3': SpawnFirePlumeAttacks(PlumePattern.Spiral, 16, enteredPhase3 ? 0.1f : (enteredPhase2 ? 0.2f : 0.3f)); break; case '4': SpawnFirePlumeAttacks(PlumePattern.CircleExpandAlternating, 5, enteredPhase3 ? 0f : (enteredPhase2 ? 0.25f : 0.6f)); break; } break; case '5': attackCooldown += 20f; isOnCooldown = true; break; } } internal void LevelStarted() { //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) sunPrefab = AssetShardManager.GetLoadedAsset("Assets/-CustomStuff/CustomBossfightStuff/Attacks/SunAttack.prefab", false); preFireballEffectPrefab = AssetShardManager.GetLoadedAsset("Assets/-CustomStuff/CustomBossfightStuff/Attacks/PreFireball.prefab", false); flameAuraPrefab = AssetShardManager.GetLoadedAsset("Assets/-CustomStuff/CustomBossfightStuff/Attacks/FlameAura.prefab", false); Debug.Log(Object.op_Implicit("Assets Loaded")); if (SNet.IsMaster) { EnemyAllocator.Current.SpawnEnemy(150u, Builder.CurrentFloor.m_dimensions[0].Layers[1].m_zones[0].m_areas[0].m_courseNode, (AgentMode)4, new Vector3(0f, 0.25f, 125.4f), Quaternion.EulerAngles(new Vector3(0f, (float)Math.PI, 0f)), (EnemyGroup)null, -1); finalBoss = EnemyAllocator.Current.SpawnEnemy(151u, Builder.CurrentFloor.m_dimensions[1].Layers[0].m_zones[0].m_areas[0].m_courseNode, (AgentMode)4, new Vector3(120f, 228.5f, 292f), Quaternion.EulerAngles(new Vector3(0f, 3.4906585f, 0f)), (EnemyGroup)null, -1); RuntimeAnimatorController loadedAsset = AssetShardManager.GetLoadedAsset("Assets/-CustomStuff/BuildThisOne/fungus.controller", false); finalBoss.Anim.runtimeAnimatorController = loadedAsset; } Debug.Log(Object.op_Implicit("Boss Spawned")); LoadAudio(); } internal void Cleanup() { StopAndResetMusic(); currentMusicStep = -1; introStarted = false; introFinished = false; enteredPhase2 = false; enteredPhase3 = false; youRaiseMeUp = false; enteredFinal = false; ((MonoBehaviour)this).StopAllCoroutines(); Object.Destroy((Object)(object)spotlight); Object.Destroy((Object)(object)spotlightEmitter); Object.Destroy((Object)(object)musicLooper); Object.Destroy((Object)(object)musicTransitioner); } public void LoadAudio() { audioClips = new List(); spotlightEmitter = ((Component)this).gameObject.AddComponent(); musicLooper = ((Component)this).gameObject.AddComponent(); musicTransitioner = ((Component)this).gameObject.AddComponent(); spotlightEmitter.loop = false; musicLooper.loop = true; musicTransitioner.loop = false; spotlightEmitter.volume = 0.35f; musicLooper.volume = 0.35f; musicTransitioner.volume = 0.35f; audioClips.Add(AssetShardManager.GetLoadedAsset("Assets/-CustomStuff/Music/Opening.ogg", false)); audioClips.Add(AssetShardManager.GetLoadedAsset("Assets/-CustomStuff/Music/Phase1Loop.ogg", false)); audioClips.Add(AssetShardManager.GetLoadedAsset("Assets/-CustomStuff/Music/Phase2Transition.ogg", false)); audioClips.Add(AssetShardManager.GetLoadedAsset("Assets/-CustomStuff/Music/Phase2Loop.ogg", false)); audioClips.Add(AssetShardManager.GetLoadedAsset("Assets/-CustomStuff/Music/Phase3Transition.ogg", false)); audioClips.Add(AssetShardManager.GetLoadedAsset("Assets/-CustomStuff/Music/Phase3Loop.ogg", false)); audioClips.Add(AssetShardManager.GetLoadedAsset("Assets/-CustomStuff/Music/FinalDesperation.ogg", false)); spotlightSfx = AssetShardManager.GetLoadedAsset("Assets/-CustomStuff/Music/Spotlight.mp3", false); Debug.Log(Object.op_Implicit("Audio Loaded")); } public void SpawnFireballAttack(float duration, float pulseInterval = 2f) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) GameObject val = Object.Instantiate(preFireballEffectPrefab, Vector3.zero, Quaternion.identity); FireballAttack fireballAttack = val.AddComponent(); Transform transform = ((Component)fireballAttack).transform; transform.position += ((Component)selectedEnemy).transform.position + Vector3.up * 4f; fireballAttack.pulseInterval = pulseInterval; fireballAttack.duration = duration; } public void SpawnFireballAttacks(List positions, float pulseInterval = 2f) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) GameObject val = Object.Instantiate(preFireballEffectPrefab, Vector3.zero, Quaternion.identity); FireballAttack fireballAttack = val.AddComponent(); Transform transform = ((Component)fireballAttack).transform; transform.position += new Vector3(122f, 370f, 290f); fireballAttack.pulseInterval = pulseInterval; fireballAttack.duration = 60f; fireballAttack.Init(positions); } public void SpawnSunAttack(float duration, float spawnHeight, float maxSizeOverTime = 1.5f, float startSize = 0.05f, bool doesDamage = true, bool isFinal = false) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_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_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0040: 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) GameObject val = Object.Instantiate(sunPrefab, Vector3.zero, Quaternion.identity); if (isFinal) { Transform transform = val.transform; transform.position += ((Component)finalBoss).transform.position + Vector3.up * spawnHeight; } else { Transform transform2 = val.transform; transform2.position += ((Component)selectedEnemy).transform.position + Vector3.up * spawnHeight; } SunAttack sunAttack = val.AddComponent(); sunAttack.Init(duration, maxSizeOverTime, startSize, doesDamage); } public void SpawnFirePlumeAttacks(PlumePattern pattern, int count = 1, float pulseInterval = 1f, bool isShort = false) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) GameObject val = Object.Instantiate(flameAuraPrefab, ((Component)selectedEnemy).transform.position, Quaternion.identity); PlumeAttack plumeAttack = val.AddComponent(); plumeAttack.Init(pattern, count, pulseInterval, isShort); } public void GoToIdleFloating() { if ((Object)(object)selectedEnemy != (Object)null && ((Agent)selectedEnemy).Alive) { enemyAnim.SetTrigger("GoToIdleFloating"); isOnCooldown = true; } } private void PlayFinalMusic() { musicTransitioner.clip = audioClips[6]; musicTransitioner.Play(); } public void SpawnWave(WaveData waveData, Vector3 spawnPoint) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00af: 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_00cc: Unknown result type (might be due to invalid IL or missing references) CellSoundPlayer val = new CellSoundPlayer(); GameObject val2 = Object.Instantiate(flameAuraPrefab, ((Component)selectedEnemy).transform.position, Quaternion.identity); val2.AddComponent(); if (SNet.IsMaster) { ((MonoBehaviour)this).StartCoroutine(CollectionExtensions.WrapToIl2Cpp(SpawnEnemies(waveData.EnemyList, spawnPoint))); } if (waveData.ScreamType.HasValue) { val.SetSwitch(ENEMY_TYPE.GROUP, waveData.ScreamType.Value); uint num = ((!waveData.ScreamSize.HasValue) ? 1u : waveData.ScreamSize.Value); val.SetSwitch(ROAR_SIZE.GROUP, num); val.SetSwitch(ENVIROMENT.GROUP, SWITCH.COMPLEX); val.Post(EVENTS.PLAY_WAVE_DISTANT_ROAR, spawnPoint); } else { Debug.Log(Object.op_Implicit("Scream type is null")); val.Post(EVENTS.PLAY_WAVE_DISTANT_ROAR_R8E1, true); } ((MonoBehaviour)this).StartCoroutine(CollectionExtensions.WrapToIl2Cpp(Cleanup(val, 10f))); } private IEnumerator SpawnEnemies(Dictionary enemyIDs, Vector3 spawnPos) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) foreach (KeyValuePair val in enemyIDs) { for (int i = 0; i < val.Value; i++) { EnemyAllocator.Current.SpawnEnemy(val.Key, ((Agent)PlayerManager.GetLocalPlayerAgent()).CourseNode, (AgentMode)1, spawnPos, Quaternion.identity, (EnemyGroup)null, -1); yield return (object)new WaitForSeconds(0.05f); } } } public IEnumerator WaitThenStop(float timeToWait) { yield return (object)new WaitForSeconds(timeToWait); ProgressMusic(); } public IEnumerator WaitForFinalMusic() { Debug.Log(Object.op_Implicit("Beginning final phase")); yield return (object)new WaitForSeconds(6f); Enumerator enumerator = PlayerManager.PlayerAgentsInLevel.GetEnumerator(); while (enumerator.MoveNext()) { _ = enumerator.Current; WorldEventManager.ExecuteEvent(new WardenObjectiveEventData { Type = (eWardenObjectiveEventType)8, DimensionIndex = (eDimensionIndex)1, WardenIntel = new LocalizedText { UntranslatedText = "REACH THE TERMINAL BEFORE THE SIMULATION COLLAPSES" }, Delay = 0f }, 0f); } List enemyList = AIG_CourseGraph.GetReachableEnemiesInNodes(((Agent)PlayerManager.GetLocalPlayerAgent()).CourseNode, 100); Enumerator enumerator2 = enemyList.GetEnumerator(); while (enumerator2.MoveNext()) { EnemyAgent enemy = enumerator2.Current; if (((GameDataBlockBase)(object)enemy.EnemyData).persistentID == 151) { finalBoss = enemy; } } if ((Object)(object)finalBoss != (Object)null) { ((AgentAI)finalBoss.AI).Mode = (AgentMode)1; finalBoss.Locomotion.ChangeState((ES_StateEnum)15); finalBoss.Anim.SetTrigger("GoToIdleFloating"); yield return (object)new WaitForSeconds(5f); finalBoss.Anim.SetTrigger("PraiseSun"); } else { yield return (object)new WaitForSeconds(5f); } List fireballPositionOverrides = new List { new Vector3(130f, 211f, 187f), new Vector3(97f, 210f, 200f), new Vector3(65f, 210f, 193f), new Vector3(97f, 214f, 259f), new Vector3(87f, 213f, 164f), new Vector3(83f, 212f, 138f), new Vector3(59f, 211f, 150f), new Vector3(53f, 208f, 98f), new Vector3(151f, 215f, 242f), new Vector3(49f, 208f, 90f), new Vector3(69f, 212f, 124f), new Vector3(90f, 211f, 110f), new Vector3(46f, 208f, 36f), new Vector3(80f, 209f, 77f), new Vector3(55f, 209f, 62f), new Vector3(86f, 207f, 28f) }; SpawnSunAttack(60f, 150f, 30f, 1f, doesDamage: false, isFinal: true); SpawnFireballAttacks(fireballPositionOverrides, 0.5f); PlayFinalMusic(); yield return (object)new WaitForSeconds(65f); if ((int)GameStateManager.CurrentStateName != 14) { Enumerator enumerator3 = PlayerManager.PlayerAgentsInLevel.GetEnumerator(); while (enumerator3.MoveNext()) { PlayerAgent player = enumerator3.Current; ((Dam_SyncedDamageBase)player.Damage).NoAirDamage(100f); } StopAndResetMusic(); } } private IEnumerator Cleanup(CellSoundPlayer csPlayer, float waitTime) { yield return (object)new WaitForSeconds(waitTime); csPlayer.Stop(); csPlayer.Recycle(); } public IEnumerator PerformIntro() { introStarted = true; Enumerator enumerator = PlayerManager.PlayerAgentsInLevel.GetEnumerator(); while (enumerator.MoveNext()) { PlayerAgent player = enumerator.Current; player.TeleportTo(new Vector3(0f, 0f, 110f)); } yield return (object)new WaitForSeconds(2f); CutsceneCameraLogic.Instance.ToggleCutscene(isActive: true); Object wallPrefab = AssetShardManager.GetLoadedAsset("Assets/-CustomStuff/Wall/BP_Gardens_Rocks_4x4M.prefab", false); Object.Instantiate(wallPrefab, new Vector3(0f, 0f, 96f), Quaternion.identity); CellSound.StopAll(); StopAndResetMusic(); spotlightEmitter.clip = spotlightSfx; spotlightEmitter.Play(); GameObject spotlightObject = new GameObject(); spotlight = spotlightObject.AddComponent(); spotlight.color = new Color(1f, 0.2f, 0.2f, 1f); ((Component)spotlight).transform.position = new Vector3(((Component)selectedEnemy).transform.position.x, 15f, ((Component)selectedEnemy).transform.position.z); spotlight.range = 25f; spotlight.intensity = 0.7f; spotlight.shape = (LightShape)0; ((Component)spotlight).transform.LookAt(((Component)selectedEnemy).transform); WorldEventManager.ExecuteEvent(new WardenObjectiveEventData { Type = (eWardenObjectiveEventType)1, DimensionIndex = (eDimensionIndex)0, Layer = (LG_LayerType)1, LocalIndex = (eLocalZoneIndex)2, Delay = 0f }, 0f); WorldEventManager.ExecuteEvent(new WardenObjectiveEventData { Type = (eWardenObjectiveEventType)1, DimensionIndex = (eDimensionIndex)0, Layer = (LG_LayerType)1, LocalIndex = (eLocalZoneIndex)3, Delay = 0f }, 0f); yield return (object)new WaitForSeconds(1f); enemyAnim.SetTrigger("GetUp"); yield return (object)new WaitForSeconds(1f); ProgressMusic(); youRaiseMeUp = true; yield return (object)new WaitForSeconds(audioClips[0].length / 2f); ((AgentAI)selectedEnemy.AI).Mode = (AgentMode)1; selectedEnemy.Locomotion.ChangeState((ES_StateEnum)15); youRaiseMeUp = false; enemyAnim.SetTrigger("PraiseSun"); yield return (object)new WaitForSeconds(audioClips[0].length / 2f); enemyAnim.SetTrigger("GoToIdleFloating"); canAttack = true; CutsceneCameraLogic.Instance.ToggleCutscene(isActive: false); introFinished = true; if (SNet.IsMaster) { ((MonoBehaviour)this).StartCoroutine(CollectionExtensions.WrapToIl2Cpp(UnlimitedStrikers())); ((MonoBehaviour)this).StartCoroutine(CollectionExtensions.WrapToIl2Cpp(UnlimitedGiants())); } } public IEnumerator UnlimitedStrikers() { if (SNet.IsMaster) { EnemyAllocator.Current.SpawnEnemy(13u, ((Agent)PlayerManager.GetLocalPlayerAgent()).CourseNode, (AgentMode)1, new Vector3(-62f, 0f, 127f), Quaternion.identity, (EnemyGroup)null, -1); EnemyAllocator.Current.SpawnEnemy(13u, ((Agent)PlayerManager.GetLocalPlayerAgent()).CourseNode, (AgentMode)1, new Vector3(62f, 0f, 127f), Quaternion.identity, (EnemyGroup)null, -1); EnemyAllocator.Current.SpawnEnemy(11u, ((Agent)PlayerManager.GetLocalPlayerAgent()).CourseNode, (AgentMode)1, new Vector3(62f, 0f, 127f), Quaternion.identity, (EnemyGroup)null, -1); int spawnTimer = (enteredPhase3 ? 18 : (enteredPhase2 ? 20 : 24)); yield return (object)new WaitForSeconds((float)spawnTimer); if (!enteredFinal) { ((MonoBehaviour)this).StartCoroutine(CollectionExtensions.WrapToIl2Cpp(UnlimitedStrikers())); } } } public IEnumerator UnlimitedGiants() { if (SNet.IsMaster) { EnemyAllocator.Current.SpawnEnemy(16u, ((Agent)PlayerManager.GetLocalPlayerAgent()).CourseNode, (AgentMode)1, new Vector3(-62f, 0f, 127f), Quaternion.identity, (EnemyGroup)null, -1); yield return (object)new WaitForSeconds(40f); if (!enteredFinal) { ((MonoBehaviour)this).StartCoroutine(CollectionExtensions.WrapToIl2Cpp(UnlimitedGiants())); } } } } internal class DespawnEffect : MonoBehaviour { private float timer; public void Update() { timer += Time.deltaTime; if (timer > 5f) { Object.Destroy((Object)(object)((Component)this).gameObject); } } } internal class Fireball : MonoBehaviour { private float timer; private Vector3 previousPos; private GameObject explosionPrefab; private LayerMask layerMask; private Vector3? target; private Vector3 direction; private PlayerAgent playerTarget; private bool targetOverriden; public static Fireball Instance { get; private set; } public void Init(int playerIndex, Vector3? targetOverride = null) { //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_0061: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) explosionPrefab = AssetShardManager.GetLoadedAsset("Assets/-CustomStuff/CustomBossfightStuff/Attacks/Explosion.prefab", false); layerMask = LayerMask.op_Implicit(LayerManager.MASK_ENEMY_PROJECTILE_COLLIDERS & ~LayerMask.GetMask(new string[1] { "PlayerSynced" })); if (!targetOverride.HasValue) { playerTarget = PlayerManager.PlayerAgentsInLevel[playerIndex]; } else { target = targetOverride.Value; Vector3? val = target; Vector3 position = ((Component)this).transform.position; Vector3 value = (val.HasValue ? new Vector3?(val.GetValueOrDefault() - position) : ((Vector3?)null)).Value; direction = ((Vector3)(ref value)).normalized * 40f * Time.deltaTime; Transform transform = ((Component)this).transform; transform.localScale *= 4f; targetOverriden = true; } previousPos = ((Component)this).transform.position; } public void Update() { //IL_0050: 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_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: 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_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Expected O, but got Unknown //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0132: 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_020c: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) timer += Time.deltaTime; if (timer >= 25f) { Object.Destroy((Object)(object)((Component)this).gameObject); } if (timer > 1f) { Transform transform = ((Component)this).transform; transform.position += direction; } else if (!targetOverriden) { int num = LayerManager.MASK_ENEMY_PROJECTILE_COLLIDERS & ~LayerMask.GetMask(new string[1] { "PlayerSynced" }) & ~LayerMask.GetMask(new string[1] { "PlayerMover" }); RaycastHit val = default(RaycastHit); if (Physics.Raycast(((Component)playerTarget).transform.position + Vector3.up * 0.05f, Vector3.down, ref val, float.PositiveInfinity, num)) { target = ((RaycastHit)(ref val)).point; Vector3? val2 = target; Vector3 position = ((Component)this).transform.position; Vector3 value = (val2.HasValue ? new Vector3?(val2.GetValueOrDefault() - position) : ((Vector3?)null)).Value; direction = ((Vector3)(ref value)).normalized * 20f * Time.deltaTime; } } Vector3 position2 = ((Component)this).transform.position; Vector3 val3 = position2 - previousPos; RaycastHit val4 = default(RaycastHit); if (Physics.Raycast(previousPos, ((Vector3)(ref val3)).normalized, ref val4, ((Vector3)(ref val3)).magnitude, LayerMask.op_Implicit(layerMask))) { GameObject val5 = Object.Instantiate(explosionPrefab, ((RaycastHit)(ref val4)).point, Quaternion.identity); val5.AddComponent(); CellSoundPlayer val6 = new CellSoundPlayer(); val6.Post(704948356u, ((RaycastHit)(ref val4)).point); Il2CppReferenceArray val7 = Physics.OverlapSphere(((RaycastHit)(ref val4)).point, targetOverriden ? 12f : 3f, LayerMask.op_Implicit(layerMask)); if (((IEnumerable)val7).Any()) { foreach (Collider item in (Il2CppArrayBase)(object)val7) { if (((Component)item).gameObject.layer == LayerManager.LAYER_PLAYER_MOVER) { PlayerAgent component = ((Component)item).GetComponent(); ((Dam_SyncedDamageBase)component.Damage).NoAirDamage(targetOverriden ? 8f : 5f); } } } Object.Destroy((Object)(object)((Component)this).gameObject); } previousPos = position2; } } internal class FireballAttack : MonoBehaviour { private float timer; private int count; private float pulseTimer; public float pulseInterval = 2f; public float duration = 10f; public List? fireballPositionOverrides; private GameObject fireballPrefab; public static FireballAttack Instance { get; private set; } public static event Action? OnFireballAttackFinished; public void OnEnable() { Instance = this; fireballPrefab = AssetShardManager.GetLoadedAsset("Assets/-CustomStuff/CustomBossfightStuff/Attacks/Fireball.prefab", false); } public void Init(List positionOverrides) { fireballPositionOverrides = positionOverrides; } public void Update() { //IL_0087: Unknown result type (might be due to invalid IL or missing references) timer += Time.deltaTime; if (timer <= duration && pulseInterval != 0f) { pulseTimer += Time.deltaTime; if (!(pulseTimer > pulseInterval)) { return; } pulseTimer = 0f; if (fireballPositionOverrides != null) { SendPulse(fireballPositionOverrides[count]); count++; if (count >= fireballPositionOverrides.Count) { count = 0; } } else { SendPulse(); } } else { FireballAttack.OnFireballAttackFinished?.Invoke(); Object.Destroy((Object)(object)((Component)this).gameObject); } } private void SendPulse(Vector3? overridePos = null) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_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) if (overridePos.HasValue) { GameObject val = Object.Instantiate(fireballPrefab, ((Component)this).transform.position, Quaternion.identity); Fireball fireball = val.AddComponent(); fireball.Init(0, overridePos); } else if (SNet.IsMaster) { int num = Random.Range(0, PlayerManager.PlayerAgentsInLevel.Count); Debug.Log(Object.op_Implicit($"random was: {num} which should be {PlayerManager.PlayerAgentsInLevel[num].PlayerName}")); NetworkAPI.InvokeEvent("OnFireballTargetSet", num, (SNet_ChannelType)2); GameObject val2 = Object.Instantiate(fireballPrefab, ((Component)this).transform.position, Quaternion.identity); Fireball fireball2 = val2.AddComponent(); fireball2.Init(num, overridePos); } } public static void OnFireballTargetSet(ulong senderID, int value) { Instance?.SendNetworkedPulse(value); } private void SendNetworkedPulse(int playerIndex) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) if (!SNet.IsMaster) { Debug.Log(Object.op_Implicit($"Fireball spawned at {((Component)this).transform.position}")); GameObject val = Object.Instantiate(fireballPrefab, ((Component)this).transform.position, Quaternion.identity); Fireball fireball = val.AddComponent(); fireball.Init(playerIndex); } } } internal class Plume : MonoBehaviour { private bool plumeInitialized; private float timer; private float pulseTimer; private bool isShort; private Light pointLight; public void Init(bool isShort = false) { this.isShort = isShort; timer = 10f; pointLight = ((Component)this).GetComponentInChildren(); plumeInitialized = true; } public void Update() { if (!plumeInitialized) { return; } timer -= Time.deltaTime; if (timer <= 0f) { Object.Destroy((Object)(object)((Component)this).gameObject); } if (timer < (float)(isShort ? 9 : 7) && timer > (isShort ? 6.5f : 0.5f)) { pulseTimer += Time.deltaTime; if (pulseTimer > 0.2f) { pulseTimer = 0f; SendPulse(); } } if (timer < 1f) { pointLight.intensity = Mathf.Lerp(pointLight.intensity, 0f, 0.1f); pointLight.range = Mathf.Lerp(pointLight.range, 0f, 0.1f); } } private void SendPulse() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) int mask = LayerMask.GetMask(new string[1] { "PlayerMover" }); Il2CppReferenceArray val = Physics.OverlapSphere(new Vector3(((Component)this).transform.position.x, ((Component)this).transform.position.y + 0.2f, ((Component)this).transform.position.z), 1f, mask); if (!((IEnumerable)val).Any()) { return; } foreach (Collider item in (Il2CppArrayBase)(object)val) { if (((Component)item).gameObject.layer == LayerManager.LAYER_PLAYER_MOVER) { PlayerAgent component = ((Component)item).GetComponent(); ((Dam_SyncedDamageBase)component.Damage).NoAirDamage(0.5f); } } } } internal class PlumeAttack : MonoBehaviour { private GameObject firePlumePrefab; private bool isShort; private int plumeCount; private int iteration; private BossfightCore.PlumePattern pattern; public static event Action? OnPlumeAttackFinished; public void Init(BossfightCore.PlumePattern pattern, int plumeCount, float pulseInterval, bool isShort = false) { this.isShort = isShort; this.pattern = pattern; this.plumeCount = plumeCount; iteration = 1; firePlumePrefab = AssetShardManager.GetLoadedAsset("Assets/-CustomStuff/CustomBossfightStuff/Attacks/FirePlume.prefab", false); ((MonoBehaviour)this).StartCoroutine(CollectionExtensions.WrapToIl2Cpp(WaitBetweenPulse(pulseInterval))); } private void SendPulse(List positions) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001a: 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) foreach (Vector3 position in positions) { GameObject val = Object.Instantiate(firePlumePrefab, position, Quaternion.identity); Plume plume = val.AddComponent(); plume.Init(isShort); } } public IEnumerator WaitBetweenPulse(float pulseInterval) { List positions = new List(); int layerMask = LayerManager.MASK_ENEMY_PROJECTILE_COLLIDERS & ~LayerMask.GetMask(new string[1] { "PlayerSynced" }) & ~LayerMask.GetMask(new string[1] { "PlayerMover" }); switch (pattern) { case BossfightCore.PlumePattern.OnPlayers: { List playerPositions = PlayerManager.PlayerAgentsInLevel; Enumerator enumerator = playerPositions.GetEnumerator(); RaycastHit hitInfo3 = default(RaycastHit); while (enumerator.MoveNext()) { PlayerAgent player = enumerator.Current; if (Physics.Raycast(((Component)player).transform.position + Vector3.up, Vector3.down, ref hitInfo3, float.PositiveInfinity, layerMask)) { positions.Add(((RaycastHit)(ref hitInfo3)).point); } } SendPulse(positions); break; } case BossfightCore.PlumePattern.CircleExpand: { RaycastHit hitInfo2 = default(RaycastHit); for (int j = 0; j < 6 * iteration; j++) { float angle2 = (float)j * (360f / (6f * (float)iteration)); float radians2 = angle2 * ((float)Math.PI / 180f); if (Physics.Raycast(((Component)this).transform.position, Vector3.down, ref hitInfo2, float.PositiveInfinity, layerMask)) { positions.Add(((RaycastHit)(ref hitInfo2)).point + new Vector3(Mathf.Sin(radians2), 0f, Mathf.Cos(radians2)) * 5f * (float)iteration); } } SendPulse(positions); break; } case BossfightCore.PlumePattern.CircleExpandAlternating: { RaycastHit hitInfo4 = default(RaycastHit); for (int k = 0; k < 6 * iteration; k++) { float angle3 = (float)k * (360f / (6f * (float)iteration)); if (iteration % 2 == 0) { angle3 += 360f / (6f * (float)iteration) / 2f; } float radians3 = angle3 * ((float)Math.PI / 180f); if (Physics.Raycast(((Component)this).transform.position, Vector3.down, ref hitInfo4, float.PositiveInfinity, layerMask)) { positions.Add(((RaycastHit)(ref hitInfo4)).point + new Vector3(Mathf.Sin(radians3), 0f, Mathf.Cos(radians3)) * 5f * (float)iteration); } } SendPulse(positions); break; } case BossfightCore.PlumePattern.Spiral: { RaycastHit hitInfo = default(RaycastHit); for (int i = 0; i < 5; i++) { float angle = i * 72 + 15 * (iteration - 1); float radians = angle * ((float)Math.PI / 180f); if (Physics.Raycast(((Component)this).transform.position, Vector3.down, ref hitInfo, float.PositiveInfinity, layerMask)) { positions.Add(((RaycastHit)(ref hitInfo)).point + new Vector3(Mathf.Sin(radians), 0f, Mathf.Cos(radians)) * (float)iteration * 3f); } } SendPulse(positions); break; } } yield return (object)new WaitForSeconds(pulseInterval); if (plumeCount > 0) { plumeCount--; iteration++; ((MonoBehaviour)this).StartCoroutine(CollectionExtensions.WrapToIl2Cpp(WaitBetweenPulse(pulseInterval))); } else { Debug.Log(Object.op_Implicit("PlumeAttackFinished")); PlumeAttack.OnPlumeAttackFinished?.Invoke(); ObjectExt.Destroy((Object)(object)((Component)this).gameObject); } } } internal class SunAttack : MonoBehaviour { private Light sunlight; private float timer; private float maxDuration; private float pulseTimer; private float maxSizeOverTime; private float startSize; private bool initialized; private bool doesDamage; public static event Action? OnSunAttackFinished; public void Init(float duration, float maxSizeOverTime = 1.5f, float startSize = 0.05f, bool doesDamage = true) { timer = duration; maxDuration = duration; this.doesDamage = doesDamage; this.startSize = startSize; this.maxSizeOverTime = maxSizeOverTime; initialized = true; } public void Update() { //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_0103: 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_01ec: Unknown result type (might be due to invalid IL or missing references) if (!initialized) { return; } if ((Object)(object)sunlight == (Object)null) { sunlight = ((Component)this).GetComponentInChildren(); return; } timer -= Time.deltaTime; if (timer > 0f) { sunlight.intensity = Mathf.Lerp(0.2f, 0.9f, 1f - timer / maxDuration); sunlight.range = Mathf.Lerp(0.5f, ((Component)this).transform.localScale.x * 50f, 1f - timer / maxDuration); ((Component)this).transform.localScale = Vector3.Lerp(Vector3.one * startSize, Vector3.one * maxSizeOverTime, 1f - timer / maxDuration); } if (timer < 6f && timer > -4f) { pulseTimer += Time.deltaTime; if (pulseTimer > 0.66f) { pulseTimer = 0f; SendPulse(); } } if (timer <= -4f) { sunlight.intensity = Mathf.Lerp(sunlight.intensity, 0f, 0.05f); sunlight.range = Mathf.Lerp(sunlight.range, 0f, 0.05f); ((Component)this).transform.localScale = Vector3.Lerp(((Component)this).transform.localScale, Vector3.zero, 0.05f); if (timer <= -5f) { SunAttack.OnSunAttackFinished?.Invoke(); Object.Destroy((Object)(object)((Component)this).gameObject); } } } private void SendPulse() { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0054: 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_0064: Unknown result type (might be due to invalid IL or missing references) if (doesDamage) { PlayerAgent localPlayerAgent = PlayerManager.GetLocalPlayerAgent(); int num = LayerManager.MASK_ENEMY_PROJECTILE_COLLIDERS & ~LayerMask.GetMask(new string[1] { "PlayerSynced" }); Vector3 position = ((Component)this).transform.position; Bounds bounds = ((Collider)localPlayerAgent.PlayerCharacterController.m_characterController).bounds; RaycastHit val = default(RaycastHit); if (Physics.Raycast(position, ((Bounds)(ref bounds)).center - ((Component)this).transform.position, ref val, float.PositiveInfinity, num) && ((Component)((RaycastHit)(ref val)).collider).gameObject.layer == LayerManager.LAYER_PLAYER_MOVER) { ((Dam_SyncedDamageBase)localPlayerAgent.Damage).NoAirDamage(1.25f * (1f + (1f - timer / 10f))); } } } } public class WaveData { public Dictionary EnemyList { get; set; } public uint? ScreamSize { get; set; } public uint? ScreamType { get; set; } public WaveData(Dictionary enemyList, uint screamSize, uint screamType) { EnemyList = enemyList; ScreamSize = screamSize; ScreamType = screamType; } public WaveData(Dictionary enemyList) { EnemyList = enemyList; } } internal class WaveDatas { public static List AllWaveDatas = new List { new WaveData(new Dictionary { [13u] = 4, [11u] = 2, [16u] = 1 }, 2u, SWITCH.STRIKER), new WaveData(new Dictionary { [30u] = 2, [13u] = 2, [11u] = 2 }, 1u, SWITCH.STRIKER), new WaveData(new Dictionary { [30u] = 3, [39u] = 1 }, 2u, SWITCH.BULLRUSHER), new WaveData(new Dictionary { [13u] = 2, [30u] = 1, [39u] = 1 }, 3u, SWITCH.BULLRUSHER) }; } }