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 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+54738cff6ffb2dcd439e11517949370bf11ae012")] [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 void Awake() { //IL_001c: 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_0052: 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_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00de: 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) List sequenceData = new List { new CameraPositionData { StartPos = new Vector3(-4.1845903f, 4.845959f, 20.96401f), EndPos = new Vector3(-8.809374f, 5.344844f, 20.55906f), StartRot = new Vector3(0f, 270f, 0f), EndRot = new Vector3(0f, 270f, 0f), CamEasingType = CameraPositionData.EasingType.EaseOut, WaitAfterMove = 2.2f }, new CameraPositionData { StartPos = new Vector3(-1.4201511f, 6.7959437f, 114.20211f), EndPos = new Vector3(-10.149621f, 6.265077f, 114.101974f), StartRot = new Vector3(0f, 270f, 0f), EndRot = new Vector3(0f, 270f, 0f), CamEasingType = CameraPositionData.EasingType.EaseOut, WaitAfterMove = 2.2f } }; data = new CameraSequenceData { CutsceneName = "Test", PersistentId = 1u, SequenceData = sequenceData }; } public void LevelStarted() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown SetupCameraCanvas(); player = PlayerManager.GetLocalPlayerAgent(); fpsCamera = ((Component)player.FPSCamera).transform; cameraParent = new GameObject("Camera Parent"); } 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_00b5: 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_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_016c: 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_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: 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_0209: Unknown result type (might be due to invalid IL or missing references) //IL_022f: 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_0245: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_03fc: 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_0277: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_02a6: Unknown result type (might be due to invalid IL or missing references) //IL_02d0: Unknown result type (might be due to invalid IL or missing references) //IL_02fa: Unknown result type (might be due to invalid IL or missing references) //IL_0319: Unknown result type (might be due to invalid IL or missing references) //IL_0335: Unknown result type (might be due to invalid IL or missing references) //IL_0351: Unknown result type (might be due to invalid IL or missing references) if (!RundownManager.ExpeditionIsStarted) { return; } if (Input.GetKeyDown((KeyCode)120)) { timer = 0f; currentShot = 0; waitTimer = 0f; current = data.SequenceData.First(); ToggleCutscene(!cutsceneActive); } 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_0025: Unknown result type (might be due to invalid IL or missing references) if (!isActive) { cameraParent.transform.position = ((Component)player.FPItemHolder).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 escapeMusic; private AudioSource musicLooper; private AudioSource musicTransitioner; private List audioClips; private AudioClip spotlightSfx; 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; public bool idontwantthingstohappen; 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) { escapeMusic.mute = !hasFocus; musicLooper.mute = !hasFocus; musicTransitioner.mute = !hasFocus; } } public void OnVolumeChanged(float value) { if (RundownManager.ExpeditionIsStarted) { escapeMusic.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_0251: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_0276: 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) if ((int)GameStateManager.CurrentStateName == 15) { StopAndResetMusic(); } if (!RundownManager.ExpeditionIsStarted || idontwantthingstohappen) { 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 = 600 * PlayerManager.PlayerAgentsInLevel.Count; ((Dam_SyncedDamageBase)selectedEnemy.Damage).Health = 600 * 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)(600 * PlayerManager.PlayerAgentsInLevel.Count) * 0.66f && !enteredPhase2) { enteredPhase2 = true; ProgressMusic(); } if (((Dam_SyncedDamageBase)selectedEnemy.Damage).Health < (float)(600 * 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_0259: 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(0, 5); int num2 = Random.Range(0, 4); int index = Random.Range(0, 6); NetworkAPI.InvokeEvent("OnNetworkedAttack", num * 10 + num2, (SNet_ChannelType)2); Debug.Log(Object.op_Implicit($"Sending value of {num * 10 + num2} across network")); switch (num) { case 0: SpawnSunAttack(10f, 10f); break; case 1: SpawnFireballAttack(8f, enteredPhase3 ? 0.5f : (enteredPhase2 ? 0.75f : 1f)); break; case 2: case 3: switch (num2) { case 0: SpawnFirePlumeAttacks(PlumePattern.CircleExpand, 5, enteredPhase3 ? 0f : (enteredPhase2 ? 0.25f : 0.6f)); break; case 1: SpawnFirePlumeAttacks(PlumePattern.OnPlayers, enteredPhase3 ? 12 : (enteredPhase2 ? 8 : 4), enteredPhase3 ? 0.33f : (enteredPhase2 ? 0.5f : 1f)); break; case 2: SpawnFirePlumeAttacks(PlumePattern.Spiral, 16, enteredPhase3 ? 0.1f : (enteredPhase2 ? 0.2f : 0.3f)); break; case 3: SpawnFirePlumeAttacks(PlumePattern.CircleExpandAlternating, 5, enteredPhase3 ? 0f : (enteredPhase2 ? 0.25f : 0.6f)); break; } break; case 4: attackCooldown += 15f; isOnCooldown = true; SpawnWave(WaveDatas.AllWaveDatas[index], Vector3.zero); 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 '0': SpawnSunAttack(10f, 10f); break; case '1': SpawnFireballAttack(8f, enteredPhase3 ? 0.5f : (enteredPhase2 ? 0.75f : 1f)); break; case '2': switch (text[1]) { case '0': SpawnFirePlumeAttacks(PlumePattern.CircleExpand, 5, enteredPhase3 ? 0f : (enteredPhase2 ? 0.25f : 0.6f)); break; case '1': SpawnFirePlumeAttacks(PlumePattern.OnPlayers, enteredPhase3 ? 12 : (enteredPhase2 ? 8 : 4), enteredPhase3 ? 0.33f : (enteredPhase2 ? 0.5f : 1f)); break; case '2': SpawnFirePlumeAttacks(PlumePattern.Spiral, 16, enteredPhase3 ? 0.1f : (enteredPhase2 ? 0.2f : 0.3f)); break; case '3': SpawnFirePlumeAttacks(PlumePattern.CircleExpandAlternating, 5, enteredPhase3 ? 0f : (enteredPhase2 ? 0.25f : 0.6f)); break; } break; case '4': attackCooldown += 20f; isOnCooldown = true; break; case '3': break; } } internal void LevelStarted() { //IL_009e: 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_00b7: 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); } Debug.Log(Object.op_Implicit("Boss Spawned")); LoadAudio(); } internal void Cleanup() { StopAndResetMusic(); currentMusicStep = -1; introStarted = false; introFinished = false; enteredPhase2 = false; enteredPhase3 = false; youRaiseMeUp = false; Object.Destroy((Object)(object)escapeMusic); Object.Destroy((Object)(object)musicLooper); Object.Destroy((Object)(object)musicTransitioner); } public void LoadAudio() { audioClips = new List(); escapeMusic = ((Component)this).gameObject.AddComponent(); musicLooper = ((Component)this).gameObject.AddComponent(); musicTransitioner = ((Component)this).gameObject.AddComponent(); escapeMusic.loop = false; musicLooper.loop = true; musicTransitioner.loop = false; escapeMusic.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)); 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 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, Vector3.zero, 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, Delay = 0f }, 0f); } ((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"); WorldEventManager.ExecuteEvent(new WardenObjectiveEventData { Type = (eWardenObjectiveEventType)24, Duration = 63f, Delay = 0f }, 0f); SpawnSunAttack(60f, 150f, 30f, 1f, doesDamage: false, isFinal: true); PlayFinalMusic(); } private IEnumerator Cleanup(CellSoundPlayer csPlayer, float waitTime) { yield return (object)new WaitForSeconds(waitTime); csPlayer.Stop(); csPlayer.Recycle(); } public IEnumerator PerformIntro() { introStarted = true; CellSound.StopAll(); StopAndResetMusic(); Enumerator enumerator = PlayerManager.PlayerAgentsInLevel.GetEnumerator(); while (enumerator.MoveNext()) { PlayerAgent player = enumerator.Current; player.TeleportTo(((Component)player).transform.position); } yield return (object)new WaitForSeconds(3f); 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; introFinished = true; } } 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; public static Fireball Instance { get; private set; } public void Init(int playerIndex) { //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_004f: 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) 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" })); playerTarget = PlayerManager.PlayerAgentsInLevel[playerIndex]; previousPos = ((Component)this).transform.position; } public void Update() { //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_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_00cb: 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_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: 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_00fa: 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_0109: 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_011b: 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_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012a: 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_0140: 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_021a: Unknown result type (might be due to invalid IL or missing references) //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_017a: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Expected O, but got Unknown //IL_018a: 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_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) timer += Time.deltaTime; if (timer >= 10f) { Object.Destroy((Object)(object)((Component)this).gameObject); } if (timer > 1f) { Transform transform = ((Component)this).transform; transform.position += direction; } else { 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.down, ref val, float.PositiveInfinity, num)) { target = ((RaycastHit)(ref val)).point; Vector3 val2 = target - ((Component)this).transform.position; direction = ((Vector3)(ref val2)).normalized * 20f * Time.deltaTime; } } Vector3 position = ((Component)this).transform.position; Vector3 val3 = position - 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); RaycastHit val7 = default(RaycastHit); if (Physics.Raycast(previousPos, ((Component)playerTarget).transform.position - previousPos, ref val7, 3f, LayerMask.op_Implicit(layerMask)) && ((Component)((RaycastHit)(ref val7)).collider).gameObject.layer == LayerManager.LAYER_PLAYER_MOVER) { ((Dam_SyncedDamageBase)playerTarget.Damage).NoAirDamage(5f); } Object.Destroy((Object)(object)((Component)this).gameObject); } previousPos = position; } } internal class FireballAttack : MonoBehaviour { private float timer; private float pulseTimer; public float pulseInterval = 2f; public float duration = 10f; 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 Update() { if (!SNet.IsMaster) { return; } timer += Time.deltaTime; if (timer <= duration && pulseInterval != 0f) { pulseTimer += Time.deltaTime; if (pulseTimer > pulseInterval) { pulseTimer = 0f; SendPulse(); } } else { FireballAttack.OnFireballAttackFinished?.Invoke(); Object.Destroy((Object)(object)((Component)this).gameObject); } } private void SendPulse() { //IL_0050: 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_007e: Unknown result type (might be due to invalid IL or missing references) if (SNet.IsMaster) { int num = Random.Range(0, PlayerManager.PlayerAgentsInLevel.Count); NetworkAPI.InvokeEvent("OnFireballTargetSet", num, (SNet_ChannelType)2); 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(num); } } 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] = 8, [11u] = 6, [16u] = 2 }, 2u, SWITCH.STRIKER), new WaveData(new Dictionary { [30u] = 6, [13u] = 4, [11u] = 6 }, 1u, SWITCH.STRIKER), new WaveData(new Dictionary { [30u] = 6, [39u] = 1 }, 2u, SWITCH.BULLRUSHER), new WaveData(new Dictionary { [13u] = 3, [30u] = 4, [39u] = 2 }, 3u, SWITCH.BULLRUSHER), new WaveData(new Dictionary { [29u] = 1 }, 1u, SWITCH.TANK), new WaveData(new Dictionary { [36u] = 1 }, 3u, SWITCH.BIRTHER) }; } }