using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Serialization; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using ExitGames.Client.Photon; using HarmonyLib; using Microsoft.CodeAnalysis; using Photon.Pun; using Photon.Realtime; using REPOLib.Modules; using REPOLib.Objects.Sdk; using TMPro; using Unity.AI.Navigation; using UnityEngine; using UnityEngine.AI; using UnityEngine.Networking; using UnityEngine.Rendering; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("Empress")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("EmpressBowser")] [assembly: AssemblyTitle("EmpressBowser")] [assembly: AssemblyVersion("1.0.0.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace Empress.REPO.Bowser { internal static class BowserAccess { private delegate void ModuleSetAllChecklistDelegate(Module module); private delegate void LevelGeneratorGenerateDoneDelegate(LevelGenerator instance, PhotonMessageInfo info); private static readonly FieldInfo EnvironmentSetupDoneField = AccessTools.Field(typeof(EnvironmentDirector), "SetupDone"); private static readonly FieldInfo EnvironmentMainCameraField = AccessTools.Field(typeof(EnvironmentDirector), "MainCamera"); private static readonly FieldInfo EnvironmentAmbientColorField = AccessTools.Field(typeof(EnvironmentDirector), "AmbientColor"); private static readonly FieldInfo EnvironmentAmbientColorNewField = AccessTools.Field(typeof(EnvironmentDirector), "AmbientColorNew"); private static readonly FieldInfo EnvironmentAmbientColorPreviousField = AccessTools.Field(typeof(EnvironmentDirector), "AmbientColorPrevious"); private static readonly FieldInfo EnvironmentAmbientColorAdaptationField = AccessTools.Field(typeof(EnvironmentDirector), "AmbientColorAdaptation"); private static readonly FieldInfo EnvironmentAmbientColorAdaptationNewField = AccessTools.Field(typeof(EnvironmentDirector), "AmbientColorAdaptationNew"); private static readonly FieldInfo EnvironmentAmbientColorAdaptationPreviousField = AccessTools.Field(typeof(EnvironmentDirector), "AmbientColorAdaptationPrevious"); private static readonly FieldInfo EnvironmentDarkAdaptationLerpField = AccessTools.Field(typeof(EnvironmentDirector), "DarkAdaptationLerp"); private static readonly FieldInfo EnvironmentFogColorField = AccessTools.Field(typeof(EnvironmentDirector), "FogColor"); private static readonly FieldInfo EnvironmentFogColorNewField = AccessTools.Field(typeof(EnvironmentDirector), "FogColorNew"); private static readonly FieldInfo EnvironmentFogColorPreviousField = AccessTools.Field(typeof(EnvironmentDirector), "FogColorPrevious"); private static readonly FieldInfo EnvironmentFogStartDistanceField = AccessTools.Field(typeof(EnvironmentDirector), "FogStartDistance"); private static readonly FieldInfo EnvironmentFogStartDistanceNewField = AccessTools.Field(typeof(EnvironmentDirector), "FogStartDistanceNew"); private static readonly FieldInfo EnvironmentFogStartDistancePreviousField = AccessTools.Field(typeof(EnvironmentDirector), "FogStartDistancePrevious"); private static readonly FieldInfo EnvironmentFogEndDistanceField = AccessTools.Field(typeof(EnvironmentDirector), "FogEndDistance"); private static readonly FieldInfo EnvironmentFogEndDistanceNewField = AccessTools.Field(typeof(EnvironmentDirector), "FogEndDistanceNew"); private static readonly FieldInfo EnvironmentFogEndDistancePreviousField = AccessTools.Field(typeof(EnvironmentDirector), "FogEndDistancePrevious"); private static readonly FieldInfo LevelGeneratorAllPlayersReadyField = AccessTools.Field(typeof(LevelGenerator), "AllPlayersReady"); private static readonly FieldInfo LevelGeneratorEnemyReadyField = AccessTools.Field(typeof(LevelGenerator), "EnemyReady"); private static readonly FieldInfo LevelGeneratorModulesSpawnedField = AccessTools.Field(typeof(LevelGenerator), "ModulesSpawned"); private static readonly FieldInfo LevelGeneratorPlayerSpawnedField = AccessTools.Field(typeof(LevelGenerator), "playerSpawned"); private static readonly FieldInfo RunManagerLevelPreviousField = AccessTools.Field(typeof(RunManager), "levelPrevious"); private static readonly FieldInfo PlayerAvatarIsDisabledField = AccessTools.Field(typeof(PlayerAvatar), "isDisabled"); private static readonly FieldInfo PlayerAvatarDeadSetField = AccessTools.Field(typeof(PlayerAvatar), "deadSet"); private static readonly FieldInfo ValuableDirectorSetupCompleteField = AccessTools.Field(typeof(ValuableDirector), "setupComplete"); private static readonly FieldInfo ValuableDirectorValuablesSpawnedField = AccessTools.Field(typeof(ValuableDirector), "valuablesSpawned"); private static readonly FieldInfo RoundDirectorExtractionPointsField = AccessTools.Field(typeof(RoundDirector), "extractionPoints"); private static readonly FieldInfo RoundDirectorExtractionPointsCompletedField = AccessTools.Field(typeof(RoundDirector), "extractionPointsCompleted"); private static readonly FieldInfo RoundDirectorExtractionPointListField = AccessTools.Field(typeof(RoundDirector), "extractionPointList"); private static readonly FieldInfo LoadingUiLevelAnimationCompletedField = AccessTools.Field(typeof(LoadingUI), "levelAnimationCompleted"); private static readonly FieldInfo LevelPointInStartRoomField = AccessTools.Field(typeof(LevelPoint), "inStartRoom"); private static readonly FieldInfo ModuleSetupDoneField = AccessTools.Field(typeof(Module), "SetupDone"); private static readonly FieldInfo ModuleStartRoomField = AccessTools.Field(typeof(Module), "StartRoom"); private static readonly FieldInfo ModuleGridXField = AccessTools.Field(typeof(Module), "GridX"); private static readonly FieldInfo ModuleGridYField = AccessTools.Field(typeof(Module), "GridY"); private static readonly FieldInfo PhysGrabObjectGrabDisableTimerField = AccessTools.Field(typeof(PhysGrabObject), "grabDisableTimer"); private static readonly FieldInfo ImpactDetectorIsNotValuableField = AccessTools.Field(typeof(PhysGrabObjectImpactDetector), "isNotValuable"); private static readonly FieldInfo ItemAttributesHasIconField = AccessTools.Field(typeof(ItemAttributes), "hasIcon"); private static readonly MethodInfo ModuleSetAllChecklistMethod = AccessTools.Method(typeof(Module), "SetAllChecklist", (Type[])null, (Type[])null); private static readonly MethodInfo LevelGeneratorGenerateDoneMethod = AccessTools.Method(typeof(LevelGenerator), "GenerateDone", new Type[1] { typeof(PhotonMessageInfo) }, (Type[])null); private static readonly ModuleSetAllChecklistDelegate ModuleSetAllChecklistCall = CreateDelegate(ModuleSetAllChecklistMethod); private static readonly LevelGeneratorGenerateDoneDelegate LevelGeneratorGenerateDoneCall = CreateDelegate(LevelGeneratorGenerateDoneMethod); public static void SetEnvironmentFog(EnvironmentDirector director, Color color, float startDistance, float endDistance) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) SetField(EnvironmentFogColorField, director, color); SetField(EnvironmentFogColorNewField, director, color); SetField(EnvironmentFogColorPreviousField, director, color); SetField(EnvironmentFogStartDistanceField, director, startDistance); SetField(EnvironmentFogStartDistanceNewField, director, startDistance); SetField(EnvironmentFogStartDistancePreviousField, director, startDistance); SetField(EnvironmentFogEndDistanceField, director, endDistance); SetField(EnvironmentFogEndDistanceNewField, director, endDistance); SetField(EnvironmentFogEndDistancePreviousField, director, endDistance); } public static void SetEnvironmentAmbient(EnvironmentDirector director, Color ambient, Color adaptation) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0028: 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_004a: 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) SetField(EnvironmentAmbientColorField, director, ambient); SetField(EnvironmentAmbientColorNewField, director, ambient); SetField(EnvironmentAmbientColorPreviousField, director, ambient); SetField(EnvironmentAmbientColorAdaptationField, director, adaptation); SetField(EnvironmentAmbientColorAdaptationNewField, director, adaptation); SetField(EnvironmentAmbientColorAdaptationPreviousField, director, adaptation); } public static void SetEnvironmentDarkAdaptation(EnvironmentDirector director, float value) { SetField(EnvironmentDarkAdaptationLerpField, director, value); } public static Camera GetEnvironmentMainCamera(EnvironmentDirector director) { return Get(EnvironmentMainCameraField, director); } public static void SetEnvironmentMainCamera(EnvironmentDirector director, Camera camera) { SetField(EnvironmentMainCameraField, director, camera); } public static void SetEnvironmentSetupDone(EnvironmentDirector director, bool value) { SetField(EnvironmentSetupDoneField, director, value); } public static void SetAllPlayersReady(LevelGenerator generator, bool value) { SetField(LevelGeneratorAllPlayersReadyField, generator, value); } public static bool GetAllPlayersReady(LevelGenerator generator) { return GetBool(LevelGeneratorAllPlayersReadyField, generator); } public static void SetEnemyReady(LevelGenerator generator, bool value) { SetField(LevelGeneratorEnemyReadyField, generator, value); } public static void SetModulesSpawned(LevelGenerator generator, int value) { SetField(LevelGeneratorModulesSpawnedField, generator, value); } public static void SetPlayerSpawnedCount(LevelGenerator generator, int value) { SetField(LevelGeneratorPlayerSpawnedField, generator, value); } public static int GetPlayerSpawnedCount(LevelGenerator generator) { return GetInt(LevelGeneratorPlayerSpawnedField, generator); } public static void SetLevelPrevious(RunManager manager, Level level) { SetField(RunManagerLevelPreviousField, manager, level); } public static bool GetIsDisabled(PlayerAvatar avatar) { return GetBool(PlayerAvatarIsDisabledField, avatar); } public static bool GetDeadSet(PlayerAvatar avatar) { return GetBool(PlayerAvatarDeadSetField, avatar); } public static void SetValuableSetupComplete(ValuableDirector director, bool value) { SetField(ValuableDirectorSetupCompleteField, director, value); } public static void SetValuableValuablesSpawned(ValuableDirector director, bool value) { SetField(ValuableDirectorValuablesSpawnedField, director, value); } public static void ResetRoundExtraction(RoundDirector director) { SetField(RoundDirectorExtractionPointsField, director, 0); SetField(RoundDirectorExtractionPointsCompletedField, director, 0); Get>(RoundDirectorExtractionPointListField, director)?.Clear(); } public static bool GetLevelAnimationCompleted(LoadingUI ui) { return GetBool(LoadingUiLevelAnimationCompletedField, ui); } public static void ConfigureStartRoomModule(Module module, int gridX, int gridY) { ModuleSetAllChecklistCall?.Invoke(module); SetField(ModuleSetupDoneField, module, true); SetField(ModuleStartRoomField, module, true); SetField(ModuleGridXField, module, gridX); SetField(ModuleGridYField, module, gridY); } public static void MarkLevelPointInStartRoom(LevelPoint point, bool value) { SetField(LevelPointInStartRoomField, point, value); } public static void SetGrabDisableTimer(PhysGrabObject grab, float value) { SetField(PhysGrabObjectGrabDisableTimerField, grab, value); } public static void SetImpactDetectorNotValuable(PhysGrabObjectImpactDetector detector, bool value) { SetField(ImpactDetectorIsNotValuableField, detector, value); } public static bool GetItemHasIcon(ItemAttributes attributes) { return GetBool(ItemAttributesHasIconField, attributes); } public static void GenerateDone(LevelGenerator generator) { //IL_0010: 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) if (LevelGeneratorGenerateDoneCall != null) { LevelGeneratorGenerateDoneCall(generator, default(PhotonMessageInfo)); } } private static T Get(FieldInfo field, object instance) where T : class { if (field == null || instance == null) { return null; } return field.GetValue(instance) as T; } private static bool GetBool(FieldInfo field, object instance) { if (field == null || instance == null) { return false; } object value = field.GetValue(instance); bool flag = default(bool); int num; if (value is bool) { flag = (bool)value; num = 1; } else { num = 0; } return (byte)((uint)num & (flag ? 1u : 0u)) != 0; } private static int GetInt(FieldInfo field, object instance) { if (field == null || instance == null) { return 0; } object value = field.GetValue(instance); if (value is int) { return (int)value; } return 0; } private static void SetField(FieldInfo field, object instance, object value) { if (!(field == null) && instance != null) { field.SetValue(instance, value); } } private static TDelegate CreateDelegate(MethodInfo method) where TDelegate : Delegate { if (method == null) { return null; } return AccessTools.MethodDelegate(method, (object)null, true); } } internal sealed class BowserArenaInfo { public Transform Root; public Transform BossHolder; public Vector3 Center; public float PlatformRadius; public float PlatformY; public float LavaY; public readonly List SpawnPositions = new List(); public readonly List FlickerLights = new List(); public Material LavaMaterial; } internal static class BowserArena { public const float PlatformRadius = 15.5f; public const float LavaDepth = 2.2f; private static Material _rockMat; private static Material _rockDarkMat; private static Material _lavaMat; private static Material _lavaDeepMat; private static Material _crackMat; private static Material _emberMat; public static BowserArenaInfo Build(LevelGenerator generator) { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Expected O, but got Unknown //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Expected O, but got Unknown //IL_010e: 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_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0148: 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_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Expected O, but got Unknown if ((Object)(object)generator.LevelParent != (Object)null) { for (int num = generator.LevelParent.transform.childCount - 1; num >= 0; num--) { Object.Destroy((Object)(object)((Component)generator.LevelParent.transform.GetChild(num)).gameObject); } } EnsureMaterials(); BowserArenaInfo bowserArenaInfo = new BowserArenaInfo(); GameObject val = new GameObject("Empress Bowser Root"); val.transform.SetParent(generator.LevelParent.transform, false); bowserArenaInfo.Root = val.transform; bowserArenaInfo.Center = val.transform.position; bowserArenaInfo.PlatformRadius = 15.5f; bowserArenaInfo.PlatformY = bowserArenaInfo.Center.y; bowserArenaInfo.LavaY = bowserArenaInfo.Center.y - 2.2f; GameObject val2 = new GameObject("Empress Bowser Module"); val2.transform.SetParent(val.transform, false); val2.AddComponent().ObservedComponents = new List(); BowserAccess.ConfigureStartRoomModule(val2.AddComponent(), 0, 0); val2.AddComponent(); GameObject val3 = new GameObject("Empress Bowser Room Volume"); val3.transform.SetParent(val2.transform, false); RoomVolume roomVolume = val3.AddComponent(); BoxCollider obj = val3.AddComponent(); ((Collider)obj).isTrigger = true; obj.size = new Vector3(101f, 70f, 101f); obj.center = new Vector3(0f, 22f, 0f); BuildPlatform(val2.transform, bowserArenaInfo); BuildLava(val2.transform, bowserArenaInfo); BuildRocks(val2.transform, bowserArenaInfo); BuildLighting(val2.transform, bowserArenaInfo); BuildEmbers(val2.transform, bowserArenaInfo); BuildSpawnPoints(val2.transform, roomVolume, generator, bowserArenaInfo); GameObject val4 = new GameObject("Empress Bowser Boss Holder"); val4.transform.SetParent(val.transform, false); bowserArenaInfo.BossHolder = val4.transform; return bowserArenaInfo; } private static void BuildPlatform(Transform parent, BowserArenaInfo info) { //IL_0033: 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_00b5: 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_015c: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Unknown result type (might be due to invalid IL or missing references) //IL_0295: Unknown result type (might be due to invalid IL or missing references) //IL_02b4: Unknown result type (might be due to invalid IL or missing references) GameObject obj = GameObject.CreatePrimitive((PrimitiveType)2); ((Object)obj).name = "Bowser Platform"; obj.transform.SetParent(parent, false); obj.transform.localPosition = new Vector3(0f, -0.75f, 0f); obj.transform.localScale = new Vector3(31f, 0.75f, 31f); ((Renderer)obj.GetComponent()).sharedMaterial = _rockMat; Object.Destroy((Object)(object)obj.GetComponent()); obj.AddComponent().convex = false; GameObject obj2 = GameObject.CreatePrimitive((PrimitiveType)2); ((Object)obj2).name = "Bowser Platform Core"; obj2.transform.SetParent(parent, false); obj2.transform.localPosition = new Vector3(0f, -2.4f, 0f); obj2.transform.localScale = new Vector3(26.35f, 1.4f, 26.35f); ((Renderer)obj2.GetComponent()).sharedMaterial = _rockDarkMat; Object.Destroy((Object)(object)obj2.GetComponent()); int num = 26; Vector3 localPosition = default(Vector3); for (int i = 0; i < num; i++) { float num2 = (float)i / (float)num * MathF.PI * 2f; ((Vector3)(ref localPosition))..ctor(Mathf.Cos(num2) * 15.15f, 0.18f, Mathf.Sin(num2) * 15.15f); GameObject obj3 = GameObject.CreatePrimitive((PrimitiveType)3); ((Object)obj3).name = "Rim Rock"; obj3.transform.SetParent(parent, false); obj3.transform.localPosition = localPosition; obj3.transform.localRotation = Quaternion.Euler(Random.Range(-14f, 14f), num2 * 57.29578f + Random.Range(-20f, 20f), Random.Range(-14f, 14f)); obj3.transform.localScale = new Vector3(Random.Range(0.9f, 1.7f), Random.Range(0.5f, 1.1f), Random.Range(0.9f, 1.6f)); ((Renderer)obj3.GetComponent()).sharedMaterial = _rockDarkMat; Object.Destroy((Object)(object)obj3.GetComponent()); } int num3 = 34; for (int j = 0; j < num3; j++) { float num4 = (float)j / (float)num3 * MathF.PI * 2f; float num5 = 14.15f; GameObject obj4 = GameObject.CreatePrimitive((PrimitiveType)3); ((Object)obj4).name = "Lava Crack"; obj4.transform.SetParent(parent, false); obj4.transform.localPosition = new Vector3(Mathf.Cos(num4) * num5, 0.02f, Mathf.Sin(num4) * num5); obj4.transform.localRotation = Quaternion.Euler(0f, num4 * 57.29578f + 90f, 0f); obj4.transform.localScale = new Vector3(2.55f, 0.045f, 0.24f); ((Renderer)obj4.GetComponent()).sharedMaterial = _crackMat; Object.Destroy((Object)(object)obj4.GetComponent()); } } private static void BuildLava(Transform parent, BowserArenaInfo info) { //IL_0033: 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_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) GameObject obj = GameObject.CreatePrimitive((PrimitiveType)2); ((Object)obj).name = "Bowser Lava"; obj.transform.SetParent(parent, false); obj.transform.localPosition = new Vector3(0f, -2.2f, 0f); obj.transform.localScale = new Vector3(95f, 0.2f, 95f); ((Renderer)obj.GetComponent()).sharedMaterial = _lavaMat; Object.Destroy((Object)(object)obj.GetComponent()); info.LavaMaterial = _lavaMat; GameObject obj2 = GameObject.CreatePrimitive((PrimitiveType)2); ((Object)obj2).name = "Bowser Lava Deep"; obj2.transform.SetParent(parent, false); obj2.transform.localPosition = new Vector3(0f, -2.8000002f, 0f); obj2.transform.localScale = new Vector3(120f, 0.2f, 120f); ((Renderer)obj2.GetComponent()).sharedMaterial = _lavaDeepMat; Object.Destroy((Object)(object)obj2.GetComponent()); } private static void BuildRocks(Transform parent, BowserArenaInfo info) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_004d: 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_0068: 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_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: 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_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_0270: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_029d: Unknown result type (might be due to invalid IL or missing references) //IL_02c7: Unknown result type (might be due to invalid IL or missing references) Vector3[] array = (Vector3[])(object)new Vector3[5] { new Vector3(-7.5f, 0f, 5.5f), new Vector3(8.2f, 0f, 4.2f), new Vector3(-5.2f, 0f, -7.8f), new Vector3(6.4f, 0f, -8.4f), new Vector3(0.5f, 0f, 9.6f) }; for (int i = 0; i < array.Length; i++) { GameObject obj = GameObject.CreatePrimitive((PrimitiveType)0); ((Object)obj).name = "Cover Boulder"; obj.transform.SetParent(parent, false); float num = Random.Range(1.9f, 2.7f); obj.transform.localPosition = array[i] + new Vector3(0f, num * 0.32f, 0f); obj.transform.localRotation = Random.rotation; obj.transform.localScale = new Vector3(num, num * 0.78f, num); ((Renderer)obj.GetComponent()).sharedMaterial = _rockDarkMat; } int num2 = 6; for (int j = 0; j < num2; j++) { float num3 = ((float)j / (float)num2 + 0.07f) * MathF.PI * 2f; float num4 = 15.5f + Random.Range(5f, 10f); float num5 = Random.Range(7f, 13f); GameObject val = GameObject.CreatePrimitive((PrimitiveType)3); ((Object)val).name = "Basalt Pillar"; val.transform.SetParent(parent, false); val.transform.localPosition = new Vector3(Mathf.Cos(num3) * num4, -2.2f + num5 * 0.4f, Mathf.Sin(num3) * num4); val.transform.localRotation = Quaternion.Euler(Random.Range(-7f, 7f), Random.Range(0f, 360f), Random.Range(-7f, 7f)); val.transform.localScale = new Vector3(Random.Range(1.7f, 3f), num5, Random.Range(1.7f, 3f)); ((Renderer)val.GetComponent()).sharedMaterial = _rockDarkMat; Object.Destroy((Object)(object)val.GetComponent()); if (j % 2 == 0) { GameObject val2 = new GameObject("Pillar Flame Light"); val2.transform.SetParent(val.transform, false); val2.transform.localPosition = new Vector3(0f, 0.56f, 0f); Light val3 = val2.AddComponent(); val3.type = (LightType)2; val3.color = new Color(1f, 0.5f, 0.14f); val3.intensity = 2.6f; val3.range = 22f; info.FlickerLights.Add(val3); } } } private static void BuildLighting(Transform parent, BowserArenaInfo info) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_002c: 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_006b: 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_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Empress Bowser Key Light"); val.transform.SetParent(parent, false); val.transform.localRotation = Quaternion.Euler(62f, -28f, 0f); Light obj = val.AddComponent(); obj.type = (LightType)1; obj.color = new Color(0.55f, 0.42f, 0.4f); obj.intensity = 0.55f; GameObject val2 = new GameObject("Empress Bowser Lava Glow"); val2.transform.SetParent(parent, false); val2.transform.localPosition = new Vector3(0f, -1f, 0f); Light val3 = val2.AddComponent(); val3.type = (LightType)2; val3.color = new Color(1f, 0.42f, 0.1f); val3.intensity = 2.9f; val3.range = 70f; info.FlickerLights.Add(val3); GameObject val4 = new GameObject("Empress Bowser Rim Light"); val4.transform.SetParent(parent, false); val4.transform.localPosition = new Vector3(0f, 18f, 0f); Light obj2 = val4.AddComponent(); obj2.type = (LightType)2; obj2.color = new Color(1f, 0.28f, 0.12f); obj2.intensity = 1.9f; obj2.range = 52f; } private static void BuildEmbers(Transform parent, BowserArenaInfo info) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0057: 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_0083: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: 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) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_012e: 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_0148: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Empress Bowser Embers"); val.transform.SetParent(parent, false); val.transform.localPosition = new Vector3(0f, -1.6f, 0f); ParticleSystem obj = val.AddComponent(); MainModule main = obj.main; ((MainModule)(ref main)).loop = true; ((MainModule)(ref main)).startLifetime = new MinMaxCurve(3f, 6f); ((MainModule)(ref main)).startSpeed = new MinMaxCurve(0.7f, 2.1f); ((MainModule)(ref main)).startSize = new MinMaxCurve(0.05f, 0.17f); ((MainModule)(ref main)).startColor = new MinMaxGradient(new Color(1f, 0.55f, 0.12f, 0.9f), new Color(1f, 0.25f, 0.05f, 0.85f)); ((MainModule)(ref main)).maxParticles = 500; ((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)1; EmissionModule emission = obj.emission; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(42f); ShapeModule shape = obj.shape; ((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)10; ((ShapeModule)(ref shape)).radius = 31.5f; ((ShapeModule)(ref shape)).rotation = new Vector3(90f, 0f, 0f); VelocityOverLifetimeModule velocityOverLifetime = obj.velocityOverLifetime; ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).enabled = true; ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).y = new MinMaxCurve(1.1f, 2.6f); ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).x = new MinMaxCurve(-0.4f, 0.4f); ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).z = new MinMaxCurve(-0.4f, 0.4f); ((Renderer)val.GetComponent()).sharedMaterial = _emberMat; } private static void BuildSpawnPoints(Transform parent, RoomVolume roomVolume, LevelGenerator generator, BowserArenaInfo info) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_004d: 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_0068: 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_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: 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_00b4: 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_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00da: 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_00e5: 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_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0108: 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_014c: Unknown result type (might be due to invalid IL or missing references) Vector3[] array = (Vector3[])(object)new Vector3[6] { new Vector3(-3.6f, 0.3f, -11.9f), new Vector3(0f, 0.3f, -12.3f), new Vector3(3.6f, 0.3f, -11.9f), new Vector3(-2f, 0.3f, -9.9f), new Vector3(2f, 0.3f, -9.9f), new Vector3(0f, 0.3f, -9.1f) }; foreach (Vector3 val in array) { GameObject val2 = new GameObject("Empress Bowser Spawn"); val2.transform.SetParent(parent, false); val2.transform.localPosition = val; val2.transform.localRotation = Quaternion.LookRotation(Vector3.forward, Vector3.up); val2.AddComponent(); info.SpawnPositions.Add(info.Root.TransformPoint(val)); } LevelPoint val3 = CreateLevelPoint(parent, roomVolume, generator, new Vector3(0f, 0.3f, -10.9f), truck: true); LevelPoint val4 = CreateLevelPoint(parent, roomVolume, generator, new Vector3(0f, 0.3f, 0f), truck: false); val3.ConnectedPoints = new List { val4 }; val4.ConnectedPoints = new List { val3 }; } private static LevelPoint CreateLevelPoint(Transform parent, RoomVolume roomVolume, LevelGenerator generator, Vector3 localPosition, bool truck) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: 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_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Empress Bowser Level Point") { layer = LayerMask.NameToLayer("Other") }; val.transform.SetParent(parent, false); val.transform.localPosition = localPosition; SphereCollider obj = val.AddComponent(); ((Collider)obj).isTrigger = true; obj.radius = 0.35f; LevelPoint obj2 = val.AddComponent(); obj2.ConnectedPoints = new List(); obj2.Room = roomVolume; obj2.Truck = truck; obj2.ModuleConnect = false; BowserAccess.MarkLevelPointInStartRoom(obj2, value: true); if (generator.LevelPathPoints == null) { generator.LevelPathPoints = new List(); } return obj2; } private static void EnsureMaterials() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Expected O, but got Unknown //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Expected O, but got Unknown //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Expected O, but got Unknown //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_010a: 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_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Expected O, but got Unknown //IL_016c: 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_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0186: 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_01a5: Expected O, but got Unknown //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Expected O, but got Unknown //IL_0229: 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) if (!((Object)(object)_rockMat != (Object)null)) { Shader val = Shader.Find("Standard"); _rockMat = new Material(val) { color = new Color(0.11f, 0.085f, 0.08f) }; _rockMat.SetFloat("_Glossiness", 0.18f); _rockMat.SetFloat("_Metallic", 0.05f); _rockDarkMat = new Material(val) { color = new Color(0.055f, 0.045f, 0.05f) }; _rockDarkMat.SetFloat("_Glossiness", 0.12f); _rockDarkMat.SetFloat("_Metallic", 0.04f); _lavaMat = new Material(val) { color = new Color(1f, 0.36f, 0.05f) }; _lavaMat.EnableKeyword("_EMISSION"); _lavaMat.SetColor("_EmissionColor", new Color(1f, 0.32f, 0.03f) * 2.6f); _lavaMat.globalIlluminationFlags = (MaterialGlobalIlluminationFlags)1; _lavaDeepMat = new Material(val) { color = new Color(0.6f, 0.12f, 0.02f) }; _lavaDeepMat.EnableKeyword("_EMISSION"); _lavaDeepMat.SetColor("_EmissionColor", new Color(0.7f, 0.12f, 0.02f) * 1.4f); _crackMat = new Material(val) { color = new Color(1f, 0.42f, 0.08f) }; _crackMat.EnableKeyword("_EMISSION"); _crackMat.SetColor("_EmissionColor", new Color(1f, 0.4f, 0.06f) * 3.2f); _emberMat = new Material(Shader.Find("Particles/Standard Unlit") ?? val); if (_emberMat.HasProperty("_Color")) { _emberMat.SetColor("_Color", new Color(1f, 0.5f, 0.1f, 0.9f)); } if (_emberMat.HasProperty("_EmissionColor")) { _emberMat.EnableKeyword("_EMISSION"); _emberMat.SetColor("_EmissionColor", new Color(1f, 0.45f, 0.08f) * 2f); } } } } internal static class BowserAudio { private static readonly Dictionary Clips = new Dictionary(); private static AudioSource _sfx; private static AudioSource _action; private static AudioSource _loop; private static MonoBehaviour _runner; private static Coroutine _fade; private static bool _started; private static bool _sfxRouted; private static bool _actionRouted; private static bool _loopRouted; private static bool _musicRouted; public static AudioClip MusicClip { get { if (!Clips.TryGetValue("bowser_music", out var value)) { return null; } return value; } } public static void Initialize(string directory, MonoBehaviour runner, ManualLogSource log) { //IL_003f: 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_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) if (!_started && !((Object)(object)runner == (Object)null) && !string.IsNullOrEmpty(directory) && Directory.Exists(directory)) { _started = true; _runner = runner; if ((Object)(object)_sfx == (Object)null) { GameObject val = new GameObject("Empress Bowser SFX"); val.transform.SetParent(((Component)runner).transform, false); _sfx = val.AddComponent(); _sfx.playOnAwake = false; _sfx.spatialBlend = 0f; _sfx.volume = 1f; _sfx.priority = 0; } if ((Object)(object)_action == (Object)null) { GameObject val2 = new GameObject("Empress Bowser Action SFX"); val2.transform.SetParent(((Component)runner).transform, false); _action = val2.AddComponent(); _action.playOnAwake = false; _action.spatialBlend = 0f; _action.loop = false; _action.priority = 0; } if ((Object)(object)_loop == (Object)null) { GameObject val3 = new GameObject("Empress Bowser Loop SFX"); val3.transform.SetParent(((Component)runner).transform, false); _loop = val3.AddComponent(); _loop.playOnAwake = false; _loop.spatialBlend = 0f; _loop.loop = true; _loop.priority = 0; } runner.StartCoroutine(LoadAll(directory, log)); } } private static IEnumerator LoadAll(string directory, ManualLogSource log) { string[] files = Directory.GetFiles(directory, "*.ogg", SearchOption.TopDirectoryOnly); for (int i = 0; i < files.Length; i++) { yield return LoadOne(files[i], log); } if (log != null) { log.LogInfo((object)("Empress Bowser loaded " + Clips.Count + " sound(s). Music: " + ((Object)(object)MusicClip != (Object)null))); } } private static IEnumerator LoadOne(string path, ManualLogSource log) { string text = "file:///" + path.Replace("\\", "/"); UnityWebRequest request = UnityWebRequestMultimedia.GetAudioClip(text, (AudioType)14); try { yield return request.SendWebRequest(); if (!string.IsNullOrEmpty(request.error)) { if (log != null) { log.LogWarning((object)("Empress Bowser could not load " + Path.GetFileName(path) + ": " + request.error)); } yield break; } AudioClip content = DownloadHandlerAudioClip.GetContent(request); if ((Object)(object)content == (Object)null) { yield break; } ((Object)content).name = Path.GetFileNameWithoutExtension(path); Clips[((Object)content).name.ToLowerInvariant().TrimEnd('.')] = content; } finally { ((IDisposable)request)?.Dispose(); } } public static void Play(string key, float volumeScale = 1f) { if (Clips.TryGetValue(key, out var value) && !((Object)(object)value == (Object)null) && !((Object)(object)_sfx == (Object)null)) { RouteSfx(); float num = 1f; if (EmpressBowserPlugin.Settings != null) { num = EmpressBowserPlugin.Settings.SfxVolume.Value; } _sfx.PlayOneShot(value, Mathf.Clamp01(num * volumeScale)); } } public static void PlayFirst(float volumeScale, params string[] keys) { for (int i = 0; i < keys.Length; i++) { if (Clips.ContainsKey(keys[i])) { Play(keys[i], volumeScale); break; } } } public static void PlayAction(string key, float volumeScale = 1f) { if (!((Object)(object)_action == (Object)null) && Clips.TryGetValue(key, out var value) && !((Object)(object)value == (Object)null)) { StopFade(); RouteAction(); float num = ((EmpressBowserPlugin.Settings != null) ? EmpressBowserPlugin.Settings.SfxVolume.Value : 0.85f); _action.Stop(); _action.clip = value; _action.volume = Mathf.Clamp01(num * volumeScale); _action.Play(); } } public static void PlayActionFirst(float volumeScale, params string[] keys) { for (int i = 0; i < keys.Length; i++) { if (Clips.ContainsKey(keys[i])) { PlayAction(keys[i], volumeScale); break; } } } public static void PlayLoop(string key, float pitch, float volumeScale = 1f) { if (!((Object)(object)_loop == (Object)null) && Clips.TryGetValue(key, out var value) && !((Object)(object)value == (Object)null)) { RouteLoop(); float num = ((EmpressBowserPlugin.Settings != null) ? EmpressBowserPlugin.Settings.SfxVolume.Value : 0.85f); _loop.pitch = pitch; _loop.volume = Mathf.Clamp01(num * volumeScale); if ((Object)(object)_loop.clip != (Object)(object)value) { _loop.clip = value; } if (!_loop.isPlaying) { _loop.Play(); } } } public static void StopLoop() { if ((Object)(object)_loop != (Object)null && _loop.isPlaying) { _loop.Stop(); } } private static void RouteLoop() { if (!_loopRouted && !((Object)(object)_loop == (Object)null) && !((Object)(object)AudioManager.instance == (Object)null) && !((Object)(object)AudioManager.instance.SoundMasterGroup == (Object)null)) { _loop.outputAudioMixerGroup = AudioManager.instance.SoundMasterGroup; _loopRouted = true; } } public static void FadeAction(float seconds) { if (!((Object)(object)_action == (Object)null) && _action.isPlaying) { StopFade(); if ((Object)(object)_runner != (Object)null) { _fade = _runner.StartCoroutine(FadeRoutine(seconds)); } else { _action.Stop(); } } } private static IEnumerator FadeRoutine(float seconds) { float start = _action.volume; float elapsed = 0f; while (elapsed < seconds && _action.isPlaying) { elapsed += Time.deltaTime; _action.volume = Mathf.Lerp(start, 0f, elapsed / seconds); yield return null; } _action.Stop(); _fade = null; } private static void StopFade() { if (_fade != null && (Object)(object)_runner != (Object)null) { _runner.StopCoroutine(_fade); } _fade = null; } private static void RouteSfx() { if (!_sfxRouted && !((Object)(object)_sfx == (Object)null) && !((Object)(object)AudioManager.instance == (Object)null) && !((Object)(object)AudioManager.instance.SoundMasterGroup == (Object)null)) { _sfx.outputAudioMixerGroup = AudioManager.instance.SoundMasterGroup; _sfxRouted = true; } } private static void RouteAction() { if (!_actionRouted && !((Object)(object)_action == (Object)null) && !((Object)(object)AudioManager.instance == (Object)null) && !((Object)(object)AudioManager.instance.SoundMasterGroup == (Object)null)) { _action.outputAudioMixerGroup = AudioManager.instance.SoundMasterGroup; _actionRouted = true; } } public static void ConfigureMusicSource(AudioSource source) { if (!((Object)(object)source == (Object)null)) { source.volume = ((EmpressBowserPlugin.Settings != null) ? EmpressBowserPlugin.Settings.MusicVolume.Value : 0.25f); if (!_musicRouted && !((Object)(object)AudioManager.instance == (Object)null) && !((Object)(object)AudioManager.instance.MusicMasterGroup == (Object)null)) { source.outputAudioMixerGroup = AudioManager.instance.MusicMasterGroup; _musicRouted = true; } } } } internal static class BowserActions { public const byte FireballSpawn = 1; public const byte PoundImpact = 2; public const byte KnockPulse = 3; public const byte ThrowHit = 4; public const byte Recovered = 5; public const byte Death = 6; public const byte LavaBomb = 7; public const byte StarSpawn = 8; public const byte StarPickup = 9; } internal sealed class BowserBoss { private const int StateIntro = 0; private const int StateIdle = 1; private const int StateMove = 2; private const int StateFire = 3; private const int StateBalls = 4; private const int StatePound = 5; private const int StateCharge = 6; private const int StateSwipe = 7; private const int StateVulnerable = 8; private const int StateGrabbed = 9; private const int StateThrown = 10; private const int StateReturn = 11; private const int StateDying = 12; private const int StateDone = 13; private const int StateWaiting = 14; private static readonly string[] AnimNames = new string[33] { "Wait", "Move", "FireBeamSign", "FireBeamStart", "FireBeam", "FireBeamEnd", "ThrowBallSign", "ThrowBallStart", "ThrowBall", "ThrowBallEnd", "HipDropSign", "HipDropStart", "HipDrop", "HipDropLand", "HipDropLandEnd", "AttackTailSign", "AttackTailStart", "AttackTail", "AttackTailEnd", "JumpSign", "JumpStart", "Jump", "JumpEnd", "Swoon", "DamageL", "DamageR", "DamageCollide", "DownLand", "DownLandEnd", "Die", "Angry", "SurpriseAngry", "Surprise" }; private const int AnimWait = 0; private const int AnimMove = 1; private const int AnimFireSign = 2; private const int AnimFireStart = 3; private const int AnimFireLoop = 4; private const int AnimFireEnd = 5; private const int AnimBallSign = 6; private const int AnimBall = 8; private const int AnimBallEnd = 9; private const int AnimPoundSign = 10; private const int AnimPoundStart = 11; private const int AnimPoundAir = 12; private const int AnimPoundLand = 13; private const int AnimPoundLandEnd = 14; private const int AnimSwipeStart = 16; private const int AnimSwipe = 17; private const int AnimSwipeEnd = 18; private const int AnimJump = 21; private const int AnimJumpEnd = 22; private const int AnimSwoon = 23; private const int AnimCollide = 26; private const int AnimDownLand = 27; private const int AnimDie = 29; private const int AnimAngry = 30; private const int AnimRage = 31; private BowserRuntime _runtime; private BowserArenaInfo _arena; private Transform _root; private GameObject _model; private Animator _animator; private Transform _tailBone; private Transform _headBone; private Transform _mouthBone; private Renderer[] _renderers; private float _modelYOffset; private float _groundFix; private float _poseGroundOffset; private ParticleSystem _fireParticles; private Light _fireLight; private Transform _fireAnchor; private GameObject _tailGlow; private Light _tailGlowLight; private PhysGrabObject _tail; private Rigidbody _tailRb; private Vector3 _pos; private float _yaw; private Vector3 _renderPos; private float _renderYaw; private Vector3 _lastGrabDirection; private int _state; private int _animId; private float _animSpeed = 1f; private int _phase = 1; private int _hits; private bool _tailWindow; private bool _fireActive; private bool _raged; private float _timer; private float _sub; private float _grace; private float _attackCooldown = 2.5f; private float _swipeCooldown; private float _fireTick; private float _windowRemaining; private float _rageTimer; private int _rainBombsLeft; private float _rainBombTimer; private bool _lavaRainDone; private int _ballsLeft; private float _ballTimer; private Vector3 _from; private Vector3 _target; private Vector3 _chargeDir; private Vector3 _splash; private readonly HashSet _chargeVictims = new HashSet(); public bool DeathComplete { get; private set; } public int Hits => _hits; public int Phase => _phase; public bool HasTail => (Object)(object)_tail != (Object)null; public PhysGrabObject Tail => _tail; public Vector3 SplashPoint => _splash; private float SpeedScale => (1f + 0.14f * (float)(_phase - 1)) * (_raged ? 1.2f : 1f); public static BowserBoss Create(BowserRuntime runtime, BowserArenaInfo arena) { BowserBoss bowserBoss = new BowserBoss(); bowserBoss._runtime = runtime; bowserBoss._arena = arena; bowserBoss.Build(); return bowserBoss; } private void Build() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Empress Bowser"); val.transform.SetParent(_arena.BossHolder, false); _root = val.transform; _model = BowserModel.CreateInstance(_root); if ((Object)(object)_model != (Object)null) { float num = BowserModel.ComputeScale(_model); _model.transform.localScale = Vector3.one * num; Bounds val2 = BowserModel.ComputeBounds(_model); _modelYOffset = _root.position.y - ((Bounds)(ref val2)).min.y; _model.transform.localPosition = new Vector3(0f, _modelYOffset, 0f); _animator = _model.GetComponentInChildren(true); _tailBone = BowserModel.FindTailBone(_model); _headBone = BowserModel.FindBone(_model, "head", deepest: false); _mouthBone = BowserModel.FindBone(_model, "mouth", deepest: false); _renderers = _model.GetComponentsInChildren(false); SkinnedMeshRenderer[] componentsInChildren = _model.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].updateWhenOffscreen = true; } BuildFireAnchor(); BuildTailGlow(); _model.SetActive(false); } else { EmpressBowserPlugin.Log.LogError((object)"Empress Bowser model unavailable, fight cannot start."); } _state = 14; _pos = _arena.Center + Vector3.up * 26f; _yaw = 180f; _renderPos = _pos; _renderYaw = _yaw; _lastGrabDirection = Forward(); _timer = 0f; SetAnim(0, 1f); Apply(0.5f); } public void BeginIntro() { if (_state == 14) { _state = 0; _timer = 0f; _sub = 0f; SetAnim(21, 1f); IntroCue(); } } private void IntroCue() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) SemiFunc.UIFocusText("BOWSER\nDodge his attacks, grab the glowing tail, throw him into the lava!", new Color(1f, 0.55f, 0.15f), Color.white, 6f); } private void BuildFireAnchor() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0125: 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_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0191: 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_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Expected O, but got Unknown //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_026f: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Unknown result type (might be due to invalid IL or missing references) //IL_02ad: Expected O, but got Unknown //IL_02b2: Unknown result type (might be due to invalid IL or missing references) //IL_02b9: Expected O, but got Unknown //IL_02e2: Unknown result type (might be due to invalid IL or missing references) //IL_031a: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Empress Bowser Fire Anchor"); Transform val2 = (((Object)(object)_root != (Object)null) ? _root : _model.transform); val.transform.SetParent(val2, false); _fireAnchor = val.transform; _fireParticles = val.AddComponent(); MainModule main = _fireParticles.main; ((MainModule)(ref main)).loop = true; ((MainModule)(ref main)).playOnAwake = false; ((MainModule)(ref main)).startLifetime = new MinMaxCurve(0.5f, 0.85f); ((MainModule)(ref main)).startSpeed = new MinMaxCurve(13f, 17f); ((MainModule)(ref main)).startSize = new MinMaxCurve(0.5f, 1.5f); ((MainModule)(ref main)).startColor = new MinMaxGradient(new Color(1f, 0.75f, 0.15f, 0.95f), new Color(1f, 0.3f, 0.04f, 0.9f)); ((MainModule)(ref main)).maxParticles = 700; ((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)1; EmissionModule emission = _fireParticles.emission; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(150f); ShapeModule shape = _fireParticles.shape; ((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)4; ((ShapeModule)(ref shape)).angle = 16f; ((ShapeModule)(ref shape)).radius = 0.28f; SizeOverLifetimeModule sizeOverLifetime = _fireParticles.sizeOverLifetime; ((SizeOverLifetimeModule)(ref sizeOverLifetime)).enabled = true; ((SizeOverLifetimeModule)(ref sizeOverLifetime)).size = new MinMaxCurve(1f, AnimationCurve.Linear(0f, 0.55f, 1f, 1.8f)); ColorOverLifetimeModule colorOverLifetime = _fireParticles.colorOverLifetime; ((ColorOverLifetimeModule)(ref colorOverLifetime)).enabled = true; Gradient val3 = new Gradient(); val3.SetKeys((GradientColorKey[])(object)new GradientColorKey[3] { new GradientColorKey(new Color(1f, 0.85f, 0.3f), 0f), new GradientColorKey(new Color(1f, 0.35f, 0.05f), 0.45f), new GradientColorKey(new Color(0.25f, 0.05f, 0.02f), 1f) }, (GradientAlphaKey[])(object)new GradientAlphaKey[3] { new GradientAlphaKey(0.95f, 0f), new GradientAlphaKey(0.75f, 0.6f), new GradientAlphaKey(0f, 1f) }); ((ColorOverLifetimeModule)(ref colorOverLifetime)).color = new MinMaxGradient(val3); ParticleSystemRenderer component = val.GetComponent(); Shader val4 = Shader.Find("Particles/Standard Unlit"); ((Renderer)component).sharedMaterial = new Material(((Object)(object)val4 != (Object)null) ? val4 : Shader.Find("Standard")); GameObject val5 = new GameObject("Fire Light"); val5.transform.SetParent(val.transform, false); val5.transform.localPosition = new Vector3(0f, 0f, 2.4f); _fireLight = val5.AddComponent(); _fireLight.type = (LightType)2; _fireLight.color = new Color(1f, 0.5f, 0.1f); _fireLight.intensity = 0f; _fireLight.range = 18f; _fireParticles.Stop(true, (ParticleSystemStopBehavior)0); } private void BuildTailGlow() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown //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_005f: 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_008b: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Expected O, but got Unknown //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Expected O, but got Unknown //IL_0195: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_tailBone == (Object)null)) { _tailGlow = new GameObject("Empress Bowser Tail Glow"); _tailGlow.transform.SetParent(_tailBone, false); ParticleSystem obj = _tailGlow.AddComponent(); MainModule main = obj.main; ((MainModule)(ref main)).loop = true; ((MainModule)(ref main)).playOnAwake = true; ((MainModule)(ref main)).startLifetime = MinMaxCurve.op_Implicit(0.7f); ((MainModule)(ref main)).startSpeed = new MinMaxCurve(0.4f, 1.3f); ((MainModule)(ref main)).startSize = new MinMaxCurve(0.07f, 0.2f); ((MainModule)(ref main)).startColor = new MinMaxGradient(new Color(1f, 0.9f, 0.35f, 1f), new Color(1f, 0.7f, 0.1f, 1f)); ((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)1; EmissionModule emission = obj.emission; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(46f); ShapeModule shape = obj.shape; ((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)0; ((ShapeModule)(ref shape)).radius = 0.55f; ParticleSystemRenderer component = _tailGlow.GetComponent(); Shader val = Shader.Find("Particles/Standard Unlit"); ((Renderer)component).sharedMaterial = new Material(((Object)(object)val != (Object)null) ? val : Shader.Find("Standard")); GameObject val2 = new GameObject("Tail Light"); val2.transform.SetParent(_tailGlow.transform, false); _tailGlowLight = val2.AddComponent(); _tailGlowLight.type = (LightType)2; _tailGlowLight.color = new Color(1f, 0.82f, 0.25f); _tailGlowLight.intensity = 2.4f; _tailGlowLight.range = 7f; _tailGlow.SetActive(false); } } public void AssignTail(PhysGrabObject tail) { _tail = tail; _tailRb = (((Object)(object)tail != (Object)null) ? ((Component)tail).GetComponent() : null); BowserTail.Sanitize(tail); } private int ScaleDamage(int damage) { float num = (1f + 0.12f * (float)(_phase - 1)) * ((EmpressBowserPlugin.Settings != null) ? EmpressBowserPlugin.Settings.DamageScale.Value : 1f); return Mathf.Max(1, Mathf.RoundToInt((float)damage * num)); } private float WindowSeconds(float typeScale) { float num = ((EmpressBowserPlugin.Settings != null) ? EmpressBowserPlugin.Settings.GrabWindowSeconds.Value : 6f); float num2 = ((_phase == 1) ? 1f : ((_phase == 2) ? 0.85f : 0.7f)); return num * num2 * typeScale; } public void HostTick(float dt, List players) { if (_state == 13) { return; } _attackCooldown -= dt * SpeedScale; _swipeCooldown -= dt; if (_rageTimer > 0f) { _rageTimer -= dt; if (_rageTimer <= 0f) { _raged = false; } } if (_rainBombsLeft > 0 && _state != 12 && _state != 13) { _rainBombTimer -= dt; if (_rainBombTimer <= 0f) { _rainBombTimer = 0.16f; _rainBombsLeft--; LaunchRainBomb(players); } } switch (_state) { case 0: TickIntro(dt); break; case 1: TickIdle(dt, players); break; case 2: TickMove(dt, players); break; case 3: TickFire(dt, players); break; case 4: TickBalls(dt, players); break; case 5: TickPound(dt, players); break; case 6: TickCharge(dt, players); break; case 7: TickSwipe(dt, players); break; case 8: TickVulnerable(dt); break; case 10: TickThrown(dt); break; case 11: TickReturn(dt); break; case 12: TickDying(dt); break; } HostTail(); Apply(dt); } private void TickIntro(float dt) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0046: 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) //IL_0053: Unknown result type (might be due to invalid IL or missing references) _timer += dt; float num = Mathf.Clamp01(_timer / 1.35f); _pos = Vector3.Lerp(_arena.Center + Vector3.up * 20f, _arena.Center, num * num); if (_timer >= 1.35f && _timer < 1.4f && _sub < 0.5f) { _sub = 1f; Action(3, _pos.x, _pos.y, _pos.z, 6f, 9f); SetAnim(22, 1f); } if (_timer >= 1.9f && _sub < 1.5f) { _sub = 2f; SetAnim(30, 1f); } if (_timer >= 4f) { _sub = 0f; _timer = 0f; _grace = 1.5f; _attackCooldown = 1.2f; _state = 1; SetAnim(0, 1f); } } private void TickIdle(float dt, List players) { //IL_0018: 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_0066: Unknown result type (might be due to invalid IL or missing references) PlayerAvatar val = Nearest(players); if ((Object)(object)val != (Object)null) { FaceToward(((Component)val).transform.position, dt, 120f); } if (_grace > 0f) { _grace -= dt; } else if ((Object)(object)val != (Object)null && _swipeCooldown <= 0f && FlatDistance(_pos, ((Component)val).transform.position) < 4.6f) { BeginSwipe(); } else if (!(_attackCooldown > 0f) && !((Object)(object)val == (Object)null)) { ChooseAttack(players, val); } } private void ChooseAttack(List players, PlayerAvatar target) { //IL_0001: 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) float num = FlatDistance(_pos, ((Component)target).transform.position); if (num > 13f && Random.value < 0.55f) { BeginMove(target); return; } float num2 = ((num <= 13.5f) ? 3f : 0f); float num3 = 3f; float num4 = ((num <= 15f) ? 2.6f : 0f); float num5 = ((_phase >= 2) ? 2.8f : 0f); float num6 = num2 + num3 + num4 + num5; float num7 = Random.value * num6; if (num7 < num2) { BeginFire(); } else if (num7 < num2 + num3) { BeginBalls(); } else if (num7 < num2 + num3 + num4) { BeginPound(players); } else { BeginCharge(target); } } private void BeginMove(PlayerAvatar target) { //IL_0018: 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_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0059: 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) _state = 2; _timer = 0f; Vector3 val = ((Component)target).transform.position - _pos; val.y = 0f; Vector3 point = ((Component)target).transform.position - ((Vector3)(ref val)).normalized * 8f; _target = ClampToArena(point, 2.2f); SetAnim(1, SpeedScale); } private void TickMove(float dt, List players) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_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_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) _timer += dt; Vector3 val = _target - _pos; val.y = 0f; float num = 3.4f * SpeedScale * dt; if (((Vector3)(ref val)).magnitude <= num || _timer > 4.5f) { _state = 1; _attackCooldown = 0.35f; SetAnim(0, 1f); } else { _pos += ((Vector3)(ref val)).normalized * num; FaceToward(_pos + val, dt, 200f); } } private void BeginFire() { _state = 3; _timer = 0f; _sub = 0f; _fireTick = 0f; SetAnim(2, 1f); } private void TickFire(float dt, List players) { //IL_00b7: Unknown result type (might be due to invalid IL or missing references) _timer += dt; PlayerAvatar val = Nearest(players); if (_sub < 0.5f) { if (_timer >= 1.05f) { _sub = 1f; _timer = 0f; SetAnim(3, 1f); } } else if (_sub < 1.5f) { if (_timer >= 0.5f) { _sub = 2f; _timer = 0f; _fireActive = true; SetAnim(4, 1f); } } else if (_sub < 2.5f) { if ((Object)(object)val != (Object)null) { FaceToward(((Component)val).transform.position, dt, 34f + 6f * (float)_phase); } _fireTick -= dt; if (_fireTick <= 0f) { _fireTick = 0.45f; DamageCone(players, 15.5f, 42f, ScaleDamage(8)); } if (_timer >= 3.4f) { _sub = 3f; _timer = 0f; _fireActive = false; SetAnim(5, 1f); } } else if (_timer >= 0.8f) { BeginVulnerable(1f); } } private void BeginBalls() { _state = 4; _timer = 0f; _sub = 0f; _ballsLeft = 1 + _phase * 2; _ballTimer = 0f; SetAnim(6, 1f); } private void TickBalls(float dt, List players) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) _timer += dt; PlayerAvatar val = Nearest(players); if ((Object)(object)val != (Object)null) { FaceToward(((Component)val).transform.position, dt, 90f); } if (_sub < 0.5f) { if (_timer >= 0.85f) { _sub = 1f; _timer = 0f; SetAnim(8, 1.1f); } } else if (_ballsLeft > 0) { _ballTimer -= dt; if (_ballTimer <= 0f) { _ballTimer = 0.52f; _ballsLeft--; ThrowFireball(players); } } else if (_sub < 1.5f) { _sub = 2f; _timer = 0f; SetAnim(9, 1f); } else if (_timer >= 0.7f) { _state = 1; _attackCooldown = Random.Range(1.4f, 2.4f) / SpeedScale; SetAnim(0, 1f); } } private void ThrowFireball(List players) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0045: 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_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0077: 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_007f: 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_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) PlayerAvatar val = RandomAlive(players); Vector3 val2 = MouthPosition(); Vector3 val3 = (((Object)(object)val != (Object)null) ? (((Component)val).transform.position + new Vector3(Random.Range(-1.3f, 1.3f), 0f, Random.Range(-1.3f, 1.3f))) : ClampToArena(_pos + Forward() * 9f, 2f)); float num = 1.35f; Vector3 val4 = val3 - val2; float num2 = 14f; Vector3 val5 = val4 / num; val5.y = (val3.y - val2.y) / num + 0.5f * num2 * num; Action(1, val2.x, val2.y, val2.z, val5.x, val5.y, val5.z); } private void BeginPound(List players) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0051: 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_005a: 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) PlayerAvatar val = RandomAlive(players); _state = 5; _timer = 0f; _sub = 0f; _from = _pos; Vector3 point = (((Object)(object)val != (Object)null) ? ((Component)val).transform.position : _arena.Center); _target = ClampToArena(point, 2f); SetAnim(11, 1f); } private void TickPound(float dt, List players) { //IL_006f: 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_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: 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_010e: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) _timer += dt; if (_sub < 0.5f) { if (_timer >= 0.42f) { _sub = 1f; _timer = 0f; SetAnim(12, 1f); } } else if (_sub < 1.5f) { float num = Mathf.Clamp01(_timer / 1.05f); Vector3 pos = Vector3.Lerp(_from, _target, num); pos.y = Mathf.Lerp(_from.y, _target.y, num) + Mathf.Sin(num * MathF.PI) * 6f; _pos = pos; FaceToward(_target + (_target - _from), dt, 250f); if (num >= 1f) { _sub = 2f; _timer = 0f; _pos = _target; SetAnim(13, 1f); Action(2, _pos.x, _pos.y, _pos.z); DamageNear(players, _pos, 5.2f, ScaleDamage(25)); } } else if (_sub < 2.5f) { if (_timer >= 0.55f) { _sub = 3f; _timer = 0f; SetAnim(14, 1f); } } else if (_timer >= 0.6f) { BeginVulnerable(0.75f); } } private void BeginCharge(PlayerAvatar target) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) _state = 6; _timer = 0f; _sub = 0f; _chargeVictims.Clear(); _target = ((Component)target).transform.position; SetAnim(31, 1f); } private void TickCharge(float dt, List players) { //IL_00b0: 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_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0054: 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) //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) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: 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_0081: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) _timer += dt; if (_sub < 0.5f) { FaceToward(_target, dt, 160f); if (_timer >= 0.95f) { _sub = 1f; _timer = 0f; Vector3 val = _target - _pos; val.y = 0f; _chargeDir = ((((Vector3)(ref val)).sqrMagnitude > 0.01f) ? ((Vector3)(ref val)).normalized : Forward()); SetAnim(1, 2.3f); } return; } float num = 15f * SpeedScale; _pos += _chargeDir * num * dt; _yaw = Mathf.Atan2(_chargeDir.x, _chargeDir.z) * 57.29578f; for (int i = 0; i < players.Count; i++) { PlayerAvatar val2 = players[i]; if (!((Object)(object)val2 == (Object)null) && !_chargeVictims.Contains(val2) && FlatDistance(_pos, ((Component)val2).transform.position) < 2.9f) { _chargeVictims.Add(val2); HurtPlayer(val2, ScaleDamage(28)); Action(3, _pos.x, _pos.y, _pos.z, 4.2f, 13f); } } if (FlatDistance(_arena.Center, _pos) >= _arena.PlatformRadius - 1.7f || _timer > 3.5f) { _pos = ClampToArena(_pos, 1.6f); _sub = 2f; _timer = 0f; SetAnim(26, 1f); Action(3, _pos.x, _pos.y, _pos.z, 4.5f, 10f); BeginVulnerable(1.05f); } } private void BeginSwipe() { _state = 7; _timer = 0f; _sub = 0f; _swipeCooldown = 5.5f; SetAnim(16, 1.15f); } private void TickSwipe(float dt, List players) { //IL_0084: Unknown result type (might be due to invalid IL or missing references) _timer += dt; if (_sub < 0.5f) { if (_timer >= 0.35f) { _sub = 1f; _timer = 0f; SetAnim(17, 1.15f); } } else if (_sub < 1.5f) { if (_timer >= 0.34f && _sub < 1.25f) { _sub = 1.3f; DamageNear(players, _pos, 4.8f, ScaleDamage(16)); Action(3, _pos.x, _pos.y, _pos.z, 5.5f, 12f); } if (_timer >= 0.85f) { _sub = 2f; _timer = 0f; SetAnim(18, 1f); } } else if (_timer >= 0.5f) { _state = 1; _attackCooldown = Random.Range(0.8f, 1.6f) / SpeedScale; SetAnim(0, 1f); } } private void BeginVulnerable(float typeScale) { _state = 8; _timer = 0f; _windowRemaining = WindowSeconds(typeScale); _tailWindow = true; _fireActive = false; _pos.y = _arena.PlatformY; _renderPos.y = Mathf.Min(_renderPos.y, _arena.PlatformY + 0.4f); SetAnim(27, 1f); } private void TickVulnerable(float dt) { _windowRemaining -= dt; _pos.y = Mathf.MoveTowards(_pos.y, _arena.PlatformY, 12f * dt); if (BowserTail.IsGrabbed(_tail)) { BeginLaunch(); } else if (_windowRemaining <= 0f) { EndWindow(); } } private void BeginLaunch() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0077: 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_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: 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_0050: 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) Vector3 proxy = (((Object)(object)_tail != (Object)null) ? ((Component)_tail).transform.position : _pos); Vector3 val = GrabDirection(proxy, PrimaryGrabber()); val.y = 0f; if (((Vector3)(ref val)).sqrMagnitude < 0.01f) { val = Forward(); } val = (_lastGrabDirection = ((Vector3)(ref val)).normalized); _from = _pos; Vector3 target = _arena.Center + val * (_arena.PlatformRadius + 7.5f); target.y = _arena.LavaY; _target = target; _state = 10; _tailWindow = false; _timer = 0f; SetAnim(26, 1f); BowserAudio.PlayFirst(1f, "bowser_hurt"); if ((Object)(object)_tail != (Object)null) { BowserTail.LockGrab(_tail); } } private void EndWindow() { _tailWindow = false; _state = 1; _attackCooldown = 1.1f / SpeedScale; SetAnim(30, 1f); } private void TickThrown(float dt) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_006c: 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_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: 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) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015c: 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) _timer += dt; float num = 1.55f; float num2 = Mathf.Clamp01(_timer / num); Vector3 pos = Vector3.Lerp(_from, _target, num2); pos.y = Mathf.Lerp(_from.y, _target.y, num2) + Mathf.Sin(num2 * MathF.PI) * 10f; _pos = pos; _yaw += 460f * dt; if (!(num2 < 1f)) { _hits++; _splash = new Vector3(_pos.x, _arena.LavaY, _pos.z); Action(4, _hits, _splash.x, _splash.y, _splash.z); ParkTail(); int num3 = ((EmpressBowserPlugin.Settings != null) ? EmpressBowserPlugin.Settings.ThrowsToWin.Value : 3); if (_hits >= num3) { _state = 12; _timer = 0f; _pos = _splash + Vector3.up * 1.4f; SetAnim(29, 1f); Action(6, _splash.x, _splash.y, _splash.z); } else { _state = 11; _timer = 0f; _sub = 0f; _pos = _splash + Vector3.down * 5f; } } } private void ParkTail() { //IL_0015: 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_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004a: 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) if (!((Object)(object)_tailRb == (Object)null)) { _tailRb.velocity = Vector3.zero; _tailRb.angularVelocity = Vector3.zero; _tailRb.position = _arena.Center + Vector3.down * 30f; } } private PhysGrabber PrimaryGrabber() { if ((Object)(object)_tail == (Object)null || _tail.playerGrabbing == null) { return null; } for (int num = _tail.playerGrabbing.Count - 1; num >= 0; num--) { PhysGrabber val = _tail.playerGrabbing[num]; if ((Object)(object)val != (Object)null && val.grabbed) { return val; } } return null; } private Vector3 GrabDirection(Vector3 proxy, PhysGrabber grabber) { //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: 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_001d: 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_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_011f: 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_00fa: 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_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)grabber != (Object)null && (Object)(object)grabber.playerAvatar != (Object)null) { Vector3 val = proxy - ((Component)grabber.playerAvatar).transform.position; val.y = 0f; if (((Vector3)(ref val)).sqrMagnitude > 0.04f) { return ((Vector3)(ref val)).normalized; } Transform val2 = (((Object)(object)grabber.playerAvatar.localCamera != (Object)null) ? grabber.playerAvatar.localCamera.GetOverrideTransform() : ((Component)grabber).transform); if ((Object)(object)val2 != (Object)null) { Vector3 forward = val2.forward; forward.y = 0f; if (((Vector3)(ref forward)).sqrMagnitude > 0.04f) { return ((Vector3)(ref forward)).normalized; } } } if ((Object)(object)_tailBone != (Object)null) { Vector3 val3 = _root.position - _tailBone.position; val3.y = 0f; if (((Vector3)(ref val3)).sqrMagnitude > 0.04f) { return ((Vector3)(ref val3)).normalized; } } if (!(((Vector3)(ref _lastGrabDirection)).sqrMagnitude > 0.04f)) { return Forward(); } return ((Vector3)(ref _lastGrabDirection)).normalized; } private void TickReturn(float dt) { //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00be: 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_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0077: 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) _timer += dt; if (_sub < 0.5f) { if (_timer >= 2.6f) { _sub = 1f; _timer = 0f; _from = new Vector3(_splash.x, _arena.LavaY - 1f, _splash.z); _target = _arena.Center; SetAnim(21, 1f); } } else if (_sub < 1.5f) { float num = Mathf.Clamp01(_timer / 1.35f); Vector3 pos = Vector3.Lerp(_from, _target, num); pos.y = Mathf.Lerp(_from.y, _target.y, num) + Mathf.Sin(num * MathF.PI) * 9f; _pos = pos; if (num >= 1f) { _sub = 2f; _timer = 0f; _phase = Mathf.Min(_hits + 1, 3); _raged = true; _rageTimer = 12f; Action(5, _phase); SetAnim(30, 1f); if (_phase >= 3 && !_lavaRainDone) { _lavaRainDone = true; _rainBombsLeft = 9; _rainBombTimer = 0.5f; } } } else if (_timer >= 1.4f) { _state = 1; _attackCooldown = 0.9f; SetAnim(0, 1f); } } private void TickDying(float dt) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) _timer += dt; _pos += Vector3.down * 0.75f * dt; _yaw += dt * 14f; if (_timer >= 5f) { _state = 13; DeathComplete = true; } } private void LaunchRainBomb(List players) { //IL_005a: 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_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_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_0025: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: 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_00e4: Unknown result type (might be due to invalid IL or missing references) PlayerAvatar val = ((Random.value < 0.55f) ? RandomAlive(players) : null); Vector3 val2; if ((Object)(object)val != (Object)null) { val2 = ((Component)val).transform.position + new Vector3(Random.Range(-2.5f, 2.5f), 0f, Random.Range(-2.5f, 2.5f)); } else { Vector2 val3 = Random.insideUnitCircle * (_arena.PlatformRadius * 0.85f); val2 = _arena.Center + new Vector3(val3.x, 0f, val3.y); } float num = Mathf.Clamp(val2.x, _arena.Center.x - _arena.PlatformRadius, _arena.Center.x + _arena.PlatformRadius); float num2 = Mathf.Clamp(val2.z, _arena.Center.z - _arena.PlatformRadius, _arena.Center.z + _arena.PlatformRadius); Action(7, num, num2); } private void HostTail() { //IL_005b: 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_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: 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_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: 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) if ((Object)(object)_tail == (Object)null || (Object)(object)_tailRb == (Object)null || (Object)(object)_tailBone == (Object)null) { return; } if (_state == 12 || _state == 13 || _state == 11) { BowserTail.LockGrab(_tail); return; } Vector3 val = _tailBone.position + Vector3.up * 0.35f; if (_tailWindow) { Vector3 val2 = val - _tailRb.position; _tailRb.velocity = _tailRb.velocity * 0.82f + val2 * 9f * Time.deltaTime * 60f * 0.02f; if (((Vector3)(ref val2)).magnitude > 3f) { _tailRb.position = val; } } else { _tailRb.velocity = Vector3.zero; _tailRb.angularVelocity = Vector3.zero; _tailRb.position = val; _tailRb.rotation = _tailBone.rotation; BowserTail.LockGrab(_tail); } } public void ClientTick(float dt) { Apply(dt); } private void Apply(float dt) { //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_root == (Object)null) { return; } if ((Object)(object)_model != (Object)null && _model.activeSelf == (_state == 14)) { _model.SetActive(_state != 14); } float num = 1f - Mathf.Exp(-14f * dt); _renderPos = Vector3.Lerp(_renderPos, _pos, num); _renderYaw = Mathf.LerpAngle(_renderYaw, _yaw, num); _root.position = _renderPos; _root.rotation = Quaternion.Euler(0f, _renderYaw, 0f); UpdateGroundFix(dt); UpdateFireAnchorTransform(); if ((Object)(object)_animator != (Object)null) { _animator.speed = _animSpeed; } if ((Object)(object)_fireParticles != (Object)null) { if (_fireActive && !_fireParticles.isEmitting) { _fireParticles.Play(true); } else if (!_fireActive && _fireParticles.isEmitting) { _fireParticles.Stop(true, (ParticleSystemStopBehavior)1); } } if ((Object)(object)_fireLight != (Object)null) { _fireLight.intensity = (_fireActive ? (2.6f + Mathf.PerlinNoise(Time.time * 9f, 0.3f) * 1.6f) : 0f); } if ((Object)(object)_tailGlow != (Object)null && _tailGlow.activeSelf != _tailWindow) { _tailGlow.SetActive(_tailWindow); } if ((Object)(object)_tailGlowLight != (Object)null && _tailWindow) { _tailGlowLight.intensity = 2f + Mathf.Sin(Time.time * 7f) * 1.1f; } } private void UpdateGroundFix(float dt) { //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_model == (Object)null) { return; } bool num = _state == 1 || _state == 2 || _state == 3 || _state == 4 || _state == 7 || _state == 8 || _state == 6; float num2 = 0f; if (num && _renderers != null && _renderers.Length != 0) { float num3 = float.MaxValue; bool flag = false; for (int i = 0; i < _renderers.Length; i++) { Renderer val = _renderers[i]; if (!((Object)(object)val == (Object)null) && ((Component)val).gameObject.activeInHierarchy) { Bounds bounds = val.bounds; float y = ((Bounds)(ref bounds)).min.y; if (y < num3) { num3 = y; flag = true; } } } if (flag) { num2 = Mathf.Clamp(_groundFix + (_arena.PlatformY - 0.38f - num3), -8f, 4f); } } float num4 = ((_state == 8) ? 18f : 8f); float num5 = 1f - Mathf.Exp((0f - num4) * dt); _groundFix = Mathf.Lerp(_groundFix, num2, num5); float num6 = ((_state == 8) ? (-1.85f) : 0f); _poseGroundOffset = Mathf.Lerp(_poseGroundOffset, num6, 1f - Mathf.Exp(-12f * dt)); _model.transform.localPosition = new Vector3(0f, _modelYOffset + _groundFix + _poseGroundOffset, 0f); } private void UpdateFireAnchorTransform() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_fireAnchor == (Object)null)) { _fireAnchor.position = MouthPosition(); _fireAnchor.rotation = Quaternion.Euler(2f, _renderYaw, 0f); } } private void SetAnim(int animId, float speed) { _animSpeed = speed; if (_animId != animId) { _animId = animId; PlayAnim(animId); } } private void PlayAnim(int animId) { if ((Object)(object)_animator != (Object)null && animId >= 0 && animId < AnimNames.Length) { _animator.CrossFadeInFixedTime(AnimNames[animId], 0.18f); } switch (animId) { case 3: BowserAudio.PlayAction("bowser_fire"); break; case 5: BowserAudio.FadeAction(0.5f); break; case 31: BowserAudio.PlayActionFirst(1f, "bowser_charge", "bowser_roar"); break; case 30: if (_state != 0 && _state != 11) { BowserAudio.PlayActionFirst(1f, "bowser_roar"); } break; case 11: BowserAudio.PlayActionFirst(1f, "bowser-jump", "bowser_pound", "bowser_roar"); break; case 6: BowserAudio.PlayActionFirst(0.85f, "bowser_fireball"); break; case 22: BowserAudio.PlayActionFirst(1f, "bowser_intro", "bowser_roar"); break; case 23: case 27: BowserAudio.FadeAction(0.35f); BowserAudio.StopLoop(); BowserAudio.PlayFirst(0.9f, "bowser_hurt"); break; case 0: BowserAudio.FadeAction(0.4f); BowserAudio.StopLoop(); break; case 1: if (_state == 6) { BowserAudio.PlayLoop("bowser-step", 1.45f); } else { BowserAudio.FadeAction(0.4f); } break; case 26: BowserAudio.FadeAction(0.3f); BowserAudio.StopLoop(); break; case 29: BowserAudio.FadeAction(0.25f); BowserAudio.StopLoop(); break; } } public object[] GetState() { int num = (int)((_tailWindow ? 1u : 0u) | (uint)(_fireActive ? 2 : 0)) | (_raged ? 4 : 0); return new object[10] { _pos.x, _pos.y, _pos.z, _yaw, _state, _animId, _animSpeed, _phase, _hits, num }; } public void ApplyState(object[] data) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) if (data != null && data.Length >= 10) { int state = _state; _pos = new Vector3(ToFloat(data[0]), ToFloat(data[1]), ToFloat(data[2])); _yaw = ToFloat(data[3]); _state = ToInt(data[4]); if (state != 0 && _state == 0) { IntroCue(); } int animId = ToInt(data[5]); float speed = ToFloat(data[6]); _phase = ToInt(data[7]); _hits = ToInt(data[8]); int num = ToInt(data[9]); _tailWindow = (num & 1) != 0; _fireActive = (num & 2) != 0; _raged = (num & 4) != 0; SetAnim(animId, speed); if (_state == 13) { DeathComplete = true; } } } private Vector3 MouthPosition() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003f: 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_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: 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_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Quaternion.Euler(0f, _renderYaw, 0f) * Vector3.forward; if ((Object)(object)_mouthBone != (Object)null) { return _mouthBone.position + val * 0.25f; } if ((Object)(object)_headBone != (Object)null) { return _headBone.position + Vector3.up * 0.1f + val * 1.1f; } return _renderPos + Vector3.up * 3.1f + Forward() * 1.6f; } private Vector3 Forward() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) return Quaternion.Euler(0f, _yaw, 0f) * Vector3.forward; } private void FaceToward(Vector3 point, float dt, float degreesPerSecond) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_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_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) Vector3 val = point - _pos; val.y = 0f; if (!(((Vector3)(ref val)).sqrMagnitude < 0.01f)) { float num = Mathf.Atan2(val.x, val.z) * 57.29578f; _yaw = Mathf.MoveTowardsAngle(_yaw, num, degreesPerSecond * dt); } } private Vector3 ClampToArena(Vector3 point, float margin) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) Vector3 val = point - _arena.Center; val.y = 0f; float num = _arena.PlatformRadius - margin; if (((Vector3)(ref val)).magnitude > num) { val = ((Vector3)(ref val)).normalized * num; } return new Vector3(_arena.Center.x + val.x, _arena.PlatformY, _arena.Center.z + val.z); } private PlayerAvatar Nearest(List players) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) PlayerAvatar result = null; float num = float.MaxValue; for (int i = 0; i < players.Count; i++) { if (!((Object)(object)players[i] == (Object)null)) { float num2 = FlatDistance(_pos, ((Component)players[i]).transform.position); if (num2 < num) { num = num2; result = players[i]; } } } return result; } private static PlayerAvatar RandomAlive(List players) { if (players == null || players.Count == 0) { return null; } return players[Random.Range(0, players.Count)]; } private static float FlatDistance(Vector3 a, Vector3 b) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) a.y = 0f; b.y = 0f; return Vector3.Distance(a, b); } private void DamageNear(List players, Vector3 point, float radius, int damage) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < players.Count; i++) { PlayerAvatar val = players[i]; if (!((Object)(object)val == (Object)null) && !((Object)(object)val.playerHealth == (Object)null) && !(Vector3.Distance(((Component)val).transform.position, point) > radius)) { HurtPlayer(val, damage); } } } private void DamageCone(List players, float range, float halfAngle, int damage) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: 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_0072: 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_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: 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_00b8: 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_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) Vector3 val = MouthPosition(); Vector3 val2 = Quaternion.Euler(0f, _renderYaw, 0f) * Vector3.forward; int num = 1 << LayerMask.NameToLayer("Default"); for (int i = 0; i < players.Count; i++) { PlayerAvatar val3 = players[i]; if ((Object)(object)val3 == (Object)null || (Object)(object)val3.playerHealth == (Object)null) { continue; } Vector3 val4 = ((Component)val3).transform.position + Vector3.up * 0.8f; if (Mathf.Abs(val4.y - val.y) > 5.5f) { continue; } Vector3 val5 = val4 - val; if (!(((Vector3)(ref val5)).magnitude > range)) { Vector3 val6 = val5; val6.y = 0f; if (!(((Vector3)(ref val6)).sqrMagnitude < 0.01f) && !(Vector3.Angle(val2, ((Vector3)(ref val6)).normalized) > halfAngle) && !Physics.Raycast(val, ((Vector3)(ref val5)).normalized, ((Vector3)(ref val5)).magnitude, num, (QueryTriggerInteraction)1)) { HurtPlayer(val3, damage); } } } } private void HurtPlayer(PlayerAvatar player, int damage) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)player == (Object)null) && !((Object)(object)player.playerHealth == (Object)null)) { if (SemiFunc.IsMultiplayer()) { player.playerHealth.HurtOther(damage, ((Component)player).transform.position, false, -1, false); } else { player.playerHealth.Hurt(damage, false, -1, false); } } } private void Action(byte subtype, params float[] args) { object[] array = new object[args.Length + 1]; array[0] = subtype; for (int i = 0; i < args.Length; i++) { array[i + 1] = args[i]; } if ((Object)(object)_runtime != (Object)null) { _runtime.HandleBossAction(subtype, array); } EmpressBowserPlugin.RaiseBossAction(array); } private static float ToFloat(object value) { if (value is float) { return (float)value; } if (value is int num) { return num; } return 0f; } private static int ToInt(object value) { if (value is int) { return (int)value; } if (value is float num) { return Mathf.RoundToInt(num); } return 0; } public void Dispose() { if ((Object)(object)_root != (Object)null) { Object.Destroy((Object)(object)((Component)_root).gameObject); } _root = null; _tail = null; _tailRb = null; } } internal static class BowserLevelRegistry { private static readonly FieldRef LevelContentLevelRef = AccessTools.FieldRefAccess("_level"); private static readonly FieldRef> LevelContentStartRoomsRef = AccessTools.FieldRefAccess>("_startRooms"); private static readonly FieldRef> LevelContentModulesNormal1Ref = AccessTools.FieldRefAccess>("_modulesNormal1"); private static readonly FieldRef> LevelContentModulesNormal2Ref = AccessTools.FieldRefAccess>("_modulesNormal2"); private static readonly FieldRef> LevelContentModulesNormal3Ref = AccessTools.FieldRefAccess>("_modulesNormal3"); private static readonly FieldRef> LevelContentModulesPassage1Ref = AccessTools.FieldRefAccess>("_modulesPassage1"); private static readonly FieldRef> LevelContentModulesPassage2Ref = AccessTools.FieldRefAccess>("_modulesPassage2"); private static readonly FieldRef> LevelContentModulesPassage3Ref = AccessTools.FieldRefAccess>("_modulesPassage3"); private static readonly FieldRef> LevelContentModulesDeadEnd1Ref = AccessTools.FieldRefAccess>("_modulesDeadEnd1"); private static readonly FieldRef> LevelContentModulesDeadEnd2Ref = AccessTools.FieldRefAccess>("_modulesDeadEnd2"); private static readonly FieldRef> LevelContentModulesDeadEnd3Ref = AccessTools.FieldRefAccess>("_modulesDeadEnd3"); private static readonly FieldRef> LevelContentModulesExtraction1Ref = AccessTools.FieldRefAccess>("_modulesExtraction1"); private static readonly FieldRef> LevelContentModulesExtraction2Ref = AccessTools.FieldRefAccess>("_modulesExtraction2"); private static readonly FieldRef> LevelContentModulesExtraction3Ref = AccessTools.FieldRefAccess>("_modulesExtraction3"); private static readonly FieldRef LevelContentConnectObjectRef = AccessTools.FieldRefAccess("_connectObject"); private static readonly FieldRef LevelContentBlockObjectRef = AccessTools.FieldRefAccess("_blockObject"); public static Level RegisterLevel() { //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0199: 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) Level val = ScriptableObject.CreateInstance(); ((Object)val).name = "Level - Empress Bowser"; val.NarrativeName = "Empress - Bowser"; LevelValuables val2 = ScriptableObject.CreateInstance(); ((Object)val2).name = "Valuables - Empress Bowser"; val2.tiny = new List(); val2.small = new List(); val2.medium = new List(); val2.big = new List(); val2.wide = new List(); val2.tall = new List(); val2.veryTall = new List(); SetLevelField(val, "ModuleAmount", 0); SetLevelField(val, "PassageMaxAmount", 0); SetLevelField(val, "HasEnemies", false); SetLevelField(val, "ValuablePresets", new List { val2 }); SetLevelField(val, "AmbiencePresets", new List()); SetLevelField(val, "FogColor", (object)new Color(0.09f, 0.015f, 0.004f)); SetLevelField(val, "FogStartDistance", 8f); SetLevelField(val, "FogEndDistance", 90f); SetLevelField(val, "AmbientColor", (object)new Color(0.26f, 0.09f, 0.04f)); SetLevelField(val, "AmbientColorAdaptation", (object)new Color(0.1f, 0.03f, 0.015f)); SetLevelField(val, "ColorTemperature", 12f); SetLevelField(val, "ColorFilter", (object)new Color(1f, 0.88f, 0.78f, 1f)); SetLevelField(val, "BloomIntensity", 7.5f); SetLevelField(val, "BloomThreshold", 0.72f); SetLevelField(val, "VignetteColor", (object)new Color(0.08f, 0.01f, 0f, 1f)); SetLevelField(val, "VignetteIntensity", 0.36f); SetLevelField(val, "VignetteSmoothness", 0.8f); SetLevelField(val, "DiscordIcon", "level"); EnsureLevelFieldInstance(val, "LoadingGraphic01"); EnsureLevelFieldInstance(val, "LoadingGraphic02"); EnsureLevelFieldInstance(val, "LoadingGraphic03"); EnsureLevelFieldInstance(val, "ConnectObject"); EnsureLevelFieldInstance(val, "BlockObject"); LevelContent val3 = ScriptableObject.CreateInstance(); ((Object)val3).name = "Empress Bowser Content"; LevelContentLevelRef.Invoke(val3) = val; LevelContentStartRoomsRef.Invoke(val3) = new List(); LevelContentModulesNormal1Ref.Invoke(val3) = new List(); LevelContentModulesNormal2Ref.Invoke(val3) = new List(); LevelContentModulesNormal3Ref.Invoke(val3) = new List(); LevelContentModulesPassage1Ref.Invoke(val3) = new List(); LevelContentModulesPassage2Ref.Invoke(val3) = new List(); LevelContentModulesPassage3Ref.Invoke(val3) = new List(); LevelContentModulesDeadEnd1Ref.Invoke(val3) = new List(); LevelContentModulesDeadEnd2Ref.Invoke(val3) = new List(); LevelContentModulesDeadEnd3Ref.Invoke(val3) = new List(); LevelContentModulesExtraction1Ref.Invoke(val3) = new List(); LevelContentModulesExtraction2Ref.Invoke(val3) = new List(); LevelContentModulesExtraction3Ref.Invoke(val3) = new List(); LevelContentConnectObjectRef.Invoke(val3) = null; LevelContentBlockObjectRef.Invoke(val3) = null; Levels.RegisterLevel(val3); return val; } private static void SetLevelField(Level level, string fieldName, object value) { FieldInfo fieldInfo = AccessTools.Field(typeof(Level), fieldName); if (!(fieldInfo == null) && value != null && fieldInfo.FieldType.IsInstanceOfType(value)) { fieldInfo.SetValue(level, value); } } private static void EnsureLevelFieldInstance(Level level, string fieldName) { FieldInfo fieldInfo = AccessTools.Field(typeof(Level), fieldName); if (!(fieldInfo == null) && fieldInfo.FieldType.IsClass && !(fieldInfo.FieldType == typeof(string)) && fieldInfo.GetValue(level) == null) { object uninitializedObject = FormatterServices.GetUninitializedObject(fieldInfo.FieldType); fieldInfo.SetValue(level, uninitializedObject); } } } internal static class BowserModel { public const float TargetHeight = 4.6f; private static AssetBundle _bundle; private static GameObject _prefab; private static GameObject _starPrefab; private static bool _loadAttempted; public static bool EnsureLoaded() { if ((Object)(object)_prefab != (Object)null) { return true; } if (_loadAttempted) { return false; } _loadAttempted = true; string text = Path.Combine(EmpressBowserPlugin.PluginDirectory, "empressbowser.bundle"); if (!File.Exists(text)) { EmpressBowserPlugin.Log.LogError((object)("Empress Bowser bundle missing at " + text)); return false; } _bundle = AssetBundle.LoadFromFile(text); if ((Object)(object)_bundle == (Object)null) { EmpressBowserPlugin.Log.LogError((object)"Empress Bowser bundle failed to load."); return false; } GameObject[] array = _bundle.LoadAllAssets(); for (int i = 0; i < array.Length; i++) { if (((Object)array[i]).name == "EmpressBowser") { _prefab = array[i]; } else if (((Object)array[i]).name == "EmpressStar") { _starPrefab = array[i]; } } if ((Object)(object)_prefab == (Object)null) { for (int j = 0; j < array.Length; j++) { if ((Object)(object)array[j] != (Object)(object)_starPrefab) { _prefab = array[j]; break; } } } if ((Object)(object)_prefab == (Object)null) { EmpressBowserPlugin.Log.LogError((object)"Empress Bowser prefab missing from bundle."); return false; } EmpressBowserPlugin.Log.LogInfo((object)("Empress Bowser model loaded: " + ((Object)_prefab).name)); return true; } public static GameObject CreateInstance(Transform parent) { if (!EnsureLoaded()) { return null; } GameObject obj = Object.Instantiate(_prefab, parent, false); ((Object)obj).name = "Empress Bowser Model"; RelinkMaterials(obj); return obj; } public static GameObject CreateStarInstance(Transform parent) { if (!EnsureLoaded() || (Object)(object)_starPrefab == (Object)null) { return null; } GameObject obj = Object.Instantiate(_starPrefab, parent, false); ((Object)obj).name = "Empress Star Model"; RelinkMaterials(obj); BrightenStar(obj); return obj; } private static void BrightenStar(GameObject instance) { //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010b: 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_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) Color val = default(Color); ((Color)(ref val))..ctor(1f, 0.85f, 0.2f); Renderer[] componentsInChildren = instance.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { Material[] materials = componentsInChildren[i].materials; foreach (Material val2 in materials) { if (!((Object)(object)val2 == (Object)null)) { Texture val3 = (val2.HasProperty("_MainTex") ? val2.GetTexture("_MainTex") : null); Color val4 = (val2.HasProperty("_Color") ? val2.color : Color.white); if (val4.r + val4.g + val4.b < 0.3f) { val2.color = (((Object)(object)val3 != (Object)null) ? Color.white : val); } val2.EnableKeyword("_EMISSION"); if ((Object)(object)val3 != (Object)null) { val2.SetTexture("_EmissionMap", val3); val2.SetColor("_EmissionColor", Color.white * 1.1f); } else { val2.SetColor("_EmissionColor", val * 1.9f); } } } } } private static void RelinkMaterials(GameObject instance) { Shader val = Shader.Find("Standard"); if ((Object)(object)val == (Object)null) { return; } Renderer[] componentsInChildren = instance.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { Material[] sharedMaterials = componentsInChildren[i].sharedMaterials; foreach (Material val2 in sharedMaterials) { if (!((Object)(object)val2 == (Object)null) && !((Object)(object)val2.shader == (Object)null) && ((Object)val2.shader).name == "Standard" && (Object)(object)val2.shader != (Object)(object)val) { val2.shader = val; } } } } public static float ComputeScale(GameObject instance) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) Bounds val = ComputeBounds(instance); float y = ((Bounds)(ref val)).size.y; if (y <= 0.01f) { return 1f; } return 4.6f / y; } public static Bounds ComputeBounds(GameObject instance) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_005d: 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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) Renderer[] componentsInChildren = instance.GetComponentsInChildren(false); Bounds bounds = default(Bounds); ((Bounds)(ref bounds))..ctor(instance.transform.position, Vector3.zero); bool flag = true; for (int i = 0; i < componentsInChildren.Length; i++) { if (((Component)componentsInChildren[i]).gameObject.activeInHierarchy) { if (flag) { bounds = componentsInChildren[i].bounds; flag = false; } else { ((Bounds)(ref bounds)).Encapsulate(componentsInChildren[i].bounds); } } } return bounds; } public static Transform FindBone(GameObject instance, string token, bool deepest) { Transform[] componentsInChildren = instance.GetComponentsInChildren(true); Transform result = null; int num = (deepest ? (-1) : int.MaxValue); for (int i = 0; i < componentsInChildren.Length; i++) { if (((Object)componentsInChildren[i]).name.ToLowerInvariant().Contains(token)) { int num2 = Depth(componentsInChildren[i]); if (deepest ? (num2 > num) : (num2 < num)) { num = num2; result = componentsInChildren[i]; } } } return result; } public static Transform FindTailBone(GameObject instance) { Transform[] componentsInChildren = instance.GetComponentsInChildren(true); List list = new List(); for (int i = 0; i < componentsInChildren.Length; i++) { if (((Object)componentsInChildren[i]).name.ToLowerInvariant().Contains("tail")) { list.Add(componentsInChildren[i]); } } if (list.Count == 0) { return null; } list.Sort((Transform a, Transform b) => Depth(a).CompareTo(Depth(b))); int index = Mathf.Clamp(Mathf.RoundToInt((float)list.Count * 0.75f), 0, list.Count - 1); return list[index]; } private static int Depth(Transform transform) { int num = 0; while ((Object)(object)transform.parent != (Object)null) { num++; transform = transform.parent; } return num; } } [HarmonyPatch(typeof(RunManager), "SetRunLevel")] internal static class BowserPatchSetRunLevel { private static void Postfix(RunManager __instance) { if (EmpressBowserPlugin.Settings != null && EmpressBowserPlugin.Settings.ForceBowserLevel.Value && !((Object)(object)EmpressBowserPlugin.BowserLevel == (Object)null)) { __instance.levelCurrent = EmpressBowserPlugin.BowserLevel; } } } [HarmonyPatch(typeof(LevelGenerator), "Generate")] internal static class BowserPatchGenerate { private static bool Prefix(LevelGenerator __instance, ref IEnumerator __result) { if (!EmpressBowserPlugin.IsBowserLevel(Object.op_Implicit((Object)(object)RunManager.instance) ? RunManager.instance.levelCurrent : null)) { return true; } __result = BowserRuntime.EnsureHost().GenerateBowserLevel(__instance); return false; } } [HarmonyPatch(typeof(LevelPoint), "NavMeshCheck")] internal static class BowserPatchNavMeshCheck { private static bool Prefix(ref IEnumerator __result) { if (!EmpressBowserPlugin.IsBowserLevel(Object.op_Implicit((Object)(object)RunManager.instance) ? RunManager.instance.levelCurrent : null)) { return true; } __result = BowserRuntime.EmptyCoroutine(); return false; } } [HarmonyPatch(typeof(EnvironmentDirector), "Setup")] internal static class BowserPatchEnvironmentSetup { private static bool Prefix(EnvironmentDirector __instance) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)LevelGenerator.Instance)) { return true; } Level level = LevelGenerator.Instance.Level; if (!Object.op_Implicit((Object)(object)level) || !EmpressBowserPlugin.IsBowserLevel(level)) { return true; } Color fogColor = level.FogColor; Color ambientColor = level.AmbientColor; BowserAccess.SetEnvironmentFog(__instance, fogColor, level.FogStartDistance, level.FogEndDistance); BowserAccess.SetEnvironmentAmbient(__instance, ambientColor, level.AmbientColorAdaptation); RenderSettings.fog = true; RenderSettings.fogMode = (FogMode)1; RenderSettings.fogColor = fogColor; RenderSettings.fogStartDistance = level.FogStartDistance; RenderSettings.fogEndDistance = level.FogEndDistance; RenderSettings.ambientLight = ambientColor; RenderSettings.ambientMode = (AmbientMode)3; Camera val = BowserAccess.GetEnvironmentMainCamera(__instance); if (!Object.op_Implicit((Object)(object)val)) { val = Camera.main; BowserAccess.SetEnvironmentMainCamera(__instance, val); } if (Object.op_Implicit((Object)(object)val)) { val.clearFlags = (CameraClearFlags)2; val.backgroundColor = fogColor; val.farClipPlane = level.FogEndDistance + 10f; } BowserAccess.SetEnvironmentDarkAdaptation(__instance, 0.2f); BowserAccess.SetEnvironmentSetupDone(__instance, value: true); return false; } } [HarmonyPatch(typeof(LoadingUI), "LevelAnimationStart")] internal static class BowserPatchLoadingUi { private const string IconName = "Empress Bowser Loading Icon"; private static Sprite _loadingSprite; private static bool _loadingSpriteAttempted; private static void Postfix(LoadingUI __instance) { //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) if (!EmpressBowserPlugin.IsBowserLevel(Object.op_Implicit((Object)(object)LevelGenerator.Instance) ? LevelGenerator.Instance.Level : null)) { HideIcon(__instance); return; } if ((Object)(object)__instance.levelNumberText != (Object)null) { ((TMP_Text)__instance.levelNumberText).text = "FINAL BOSS"; ((Graphic)__instance.levelNumberText).color = new Color(1f, 0.45f, 0.15f); ((Component)__instance.levelNumberText).gameObject.SetActive(true); ((TMP_Text)__instance.levelNumberText).transform.SetAsLastSibling(); } if ((Object)(object)__instance.levelNameText != (Object)null) { ((TMP_Text)__instance.levelNameText).text = "Empress - Bowser"; ((Graphic)__instance.levelNameText).color = new Color(1f, 0.7f, 0.25f); ((Component)__instance.levelNameText).gameObject.SetActive(true); ((TMP_Text)__instance.levelNameText).transform.SetAsLastSibling(); } ApplyIcon(__instance); } private static void ApplyIcon(LoadingUI loadingUI) { //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: 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_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)loadingUI.levelNameText == (Object)null) { return; } Sprite loadingSprite = GetLoadingSprite(); if ((Object)(object)loadingSprite == (Object)null) { return; } Transform parent = ((TMP_Text)loadingUI.levelNameText).transform.parent; if (!((Object)(object)parent == (Object)null)) { Transform val = parent.Find("Empress Bowser Loading Icon"); Image val2; if ((Object)(object)val != (Object)null) { val2 = ((Component)val).GetComponent(); } else { GameObject val3 = new GameObject("Empress Bowser Loading Icon"); RectTransform obj = val3.AddComponent(); ((Transform)obj).SetParent(parent, false); obj.anchorMin = new Vector2(0.5f, 0.5f); obj.anchorMax = new Vector2(0.5f, 0.5f); obj.pivot = new Vector2(0.5f, 0.5f); obj.anchoredPosition = new Vector2(0f, 150f); obj.sizeDelta = new Vector2(170f, 170f); val2 = val3.AddComponent(); } if (!((Object)(object)val2 == (Object)null)) { val2.sprite = loadingSprite; ((Graphic)val2).color = Color.white; val2.preserveAspect = true; ((Graphic)val2).raycastTarget = false; ((Component)val2).gameObject.SetActive(true); ((Component)val2).transform.SetAsLastSibling(); } } } private static void HideIcon(LoadingUI loadingUI) { if ((Object)(object)loadingUI == (Object)null || (Object)(object)loadingUI.levelNameText == (Object)null) { return; } Transform parent = ((TMP_Text)loadingUI.levelNameText).transform.parent; if (!((Object)(object)parent == (Object)null)) { Transform val = parent.Find("Empress Bowser Loading Icon"); if ((Object)(object)val != (Object)null) { ((Component)val).gameObject.SetActive(false); } } } private static Sprite GetLoadingSprite() { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Expected O, but got Unknown //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) if (_loadingSpriteAttempted) { return _loadingSprite; } _loadingSpriteAttempted = true; string path = Path.Combine(EmpressBowserPlugin.PluginDirectory, "loading.png"); if (!File.Exists(path)) { return null; } Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false) { wrapMode = (TextureWrapMode)1 }; if (!ImageConversion.LoadImage(val, File.ReadAllBytes(path))) { return null; } _loadingSprite = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f), 100f); return _loadingSprite; } } [HarmonyPatch(typeof(ItemManager), "TurnOffIconLights")] internal static class BowserPatchIconLights { private static bool Prefix(ItemManager __instance, ref IEnumerator __result) { if (!EmpressBowserPlugin.IsBowserLevel(Object.op_Implicit((Object)(object)RunManager.instance) ? RunManager.instance.levelCurrent : null)) { return true; } __result = SafeTurnOffIconLights(__instance); return false; } private static IEnumerator SafeTurnOffIconLights(ItemManager itemManager) { if ((Object)(object)itemManager.itemIconLights == (Object)null) { yield break; } if (SemiFunc.RunIsShop() || SemiFunc.MenuLevel()) { itemManager.itemIconLights.SetActive(false); yield break; } while ((Object)(object)LevelGenerator.Instance == (Object)null || !LevelGenerator.Instance.Generated) { yield return (object)new WaitForSeconds(0.2f); } while (itemManager.spawnedItems != null) { itemManager.spawnedItems.RemoveAll((ItemAttributes item) => (Object)(object)item == (Object)null); bool flag = false; for (int num = 0; num < itemManager.spawnedItems.Count; num++) { ItemAttributes val = itemManager.spawnedItems[num]; if ((Object)(object)val != (Object)null && !BowserAccess.GetItemHasIcon(val)) { flag = true; break; } } if (!flag) { break; } yield return (object)new WaitForSeconds(0.2f); } itemManager.itemIconLights.SetActive(false); } } internal sealed class BowserRuntime : MonoBehaviour { private sealed class Missile { public Vector3 Position; public Vector3 Velocity; public bool Bomb; public float Life; public GameObject Body; public Light Glow; } private readonly List _missiles = new List(); private readonly List _spawnLocations = new List(); private BowserArenaInfo _arena; private BowserBoss _boss; private AudioSource _musicSource; private Material _missileMat; private Material _bombMat; private bool _active; private bool _won; private float _exitTimer; private float _broadcastTimer; private float _tailRetryTimer; private float _tailSanitizeTimer; private float _lavaHurtTimer; private float _dropTimer; private bool _dropStarted; private bool _readyShown; private int _sceneHandle = -1; private GameObject _star; private Transform _starModel; private Light _starLight; private Vector3 _starFrom; private float _starTime; private bool _starSpawned; private bool _starTaken; public static BowserRuntime Instance { get; private set; } public bool Active => _active; public static BowserRuntime EnsureHost() { //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_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Expected O, but got Unknown if ((Object)(object)Instance != (Object)null) { return Instance; } GameObject val = new GameObject("Empress Bowser Runtime"); val.transform.parent = null; ((Object)val).hideFlags = (HideFlags)61; Object.DontDestroyOnLoad((Object)val); Instance = val.AddComponent(); return Instance; } public static IEnumerator EmptyCoroutine() { yield break; } private void Awake() { Instance = this; EnsureMusicSource(); } private void EnsureMusicSource() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown if (!((Object)(object)_musicSource != (Object)null)) { GameObject val = new GameObject("Empress Bowser Music"); val.transform.SetParent(((Component)this).transform, false); _musicSource = val.AddComponent(); _musicSource.playOnAwake = false; _musicSource.loop = true; _musicSource.spatialBlend = 0f; _musicSource.priority = 0; } } private void StartMusic() { EnsureMusicSource(); AudioClip musicClip = BowserAudio.MusicClip; if (!((Object)(object)musicClip == (Object)null)) { if ((Object)(object)_musicSource.clip != (Object)(object)musicClip) { _musicSource.clip = musicClip; } BowserAudio.ConfigureMusicSource(_musicSource); if (!_musicSource.isPlaying) { _musicSource.Play(); } } } private void StopMusic() { if ((Object)(object)_musicSource != (Object)null && _musicSource.isPlaying) { _musicSource.Stop(); } } private void Update() { //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Invalid comparison between Unknown and I4 //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) HandleSceneTransition(); if (!_active) { return; } if (!EmpressBowserPlugin.IsBowserLevel(Object.op_Implicit((Object)(object)RunManager.instance) ? RunManager.instance.levelCurrent : null)) { Deactivate(); return; } RefillStamina(); if (!((Object)(object)LevelGenerator.Instance != (Object)null) || !LevelGenerator.Instance.Generated || !((Object)(object)GameDirector.instance != (Object)null) || (int)GameDirector.instance.currentState != 2 || !IsLoadingFinished() || !BowserAccess.GetAllPlayersReady(LevelGenerator.Instance)) { return; } float deltaTime = Time.deltaTime; bool flag = SemiFunc.IsMasterClientOrSingleplayer(); ResolveTail(); if (_boss != null) { if (flag) { _boss.HostTick(deltaTime, PlayablePlayers()); BroadcastBossState(deltaTime); } else { _boss.ClientTick(deltaTime); } } TickMissiles(deltaTime, flag); TickStar(deltaTime, flag); TickFlicker(); TickLava(deltaTime); StartMusic(); if (!_readyShown) { _readyShown = true; _dropTimer = ((EmpressBowserPlugin.Settings != null) ? EmpressBowserPlugin.Settings.GraceSeconds.Value : 10f); SemiFunc.UIFocusText("SOMETHING BIG IS COMING...", new Color(1f, 0.5f, 0.15f), Color.white, 4f); } if (flag && !_dropStarted && _boss != null) { _dropTimer -= deltaTime; if (_dropTimer <= 0f) { _dropStarted = true; _boss.BeginIntro(); } } if (flag) { CheckWin(); AdvanceAfterWin(deltaTime); } } private void LateUpdate() { if (_active && Time.timeScale != 1f) { Time.timeScale = 1f; } } private bool IsLoadingFinished() { LoadingUI instance = LoadingUI.instance; if ((Object)(object)instance == (Object)null) { return true; } if (((Component)instance).gameObject.activeInHierarchy) { return false; } return BowserAccess.GetLevelAnimationCompleted(instance); } public IEnumerator GenerateBowserLevel(LevelGenerator generator) { EmpressBowserPlugin.EnsurePhotonHooked(); yield return (object)new WaitForSeconds(0.2f); if (!SemiFunc.IsMultiplayer()) { BowserAccess.SetAllPlayersReady(generator, value: true); } while (!BowserAccess.GetAllPlayersReady(generator)) { generator.State = (LevelState)1; yield return (object)new WaitForSeconds(0.1f); } yield return (object)new WaitForSeconds(0.2f); generator.Level = RunManager.instance.levelCurrent; BowserAccess.SetLevelPrevious(RunManager.instance, generator.Level); generator.Generated = false; BowserAccess.SetEnemyReady(generator, value: true); BowserAccess.SetModulesSpawned(generator, 0); BowserAccess.SetPlayerSpawnedCount(generator, 0); generator.LevelPathPoints = new List(); generator.LevelPathTruck = null; if (Object.op_Implicit((Object)(object)ValuableDirector.instance)) { BowserAccess.SetValuableSetupComplete(ValuableDirector.instance, value: true); BowserAccess.SetValuableValuablesSpawned(ValuableDirector.instance, value: true); } if (Object.op_Implicit((Object)(object)RoundDirector.instance)) { BowserAccess.ResetRoundExtraction(RoundDirector.instance); } generator.State = (LevelState)3; _arena = BowserArena.Build(generator); _spawnLocations.Clear(); _spawnLocations.AddRange(_arena.SpawnPositions); BowserRuntime bowserRuntime = this; Scene activeScene = SceneManager.GetActiveScene(); bowserRuntime._sceneHandle = ((Scene)(ref activeScene)).handle; yield return (object)new WaitForSeconds(0.2f); if (Object.op_Implicit((Object)(object)EnvironmentDirector.Instance)) { EnvironmentDirector.Instance.Setup(); } if (Object.op_Implicit((Object)(object)PostProcessing.Instance)) { PostProcessing.Instance.Setup(); } if (Object.op_Implicit((Object)(object)LevelMusic.instance)) { LevelMusic.instance.Setup(); } if (Object.op_Implicit((Object)(object)ConstantMusic.instance)) { ConstantMusic.instance.Setup(); } if (SemiFunc.IsMasterClientOrSingleplayer()) { NavMeshSurface component = ((Component)generator).GetComponent(); if ((Object)(object)component != (Object)null) { component.collectObjects = (CollectObjects)0; component.useGeometry = (NavMeshCollectGeometry)1; component.layerMask = LayerMask.op_Implicit(-1); component.defaultArea = 0; } generator.NavMeshSetup(); yield return null; while ((Object)(object)GameDirector.instance == (Object)null || GameDirector.instance.PlayerList.Count == 0) { generator.State = (LevelState)12; yield return (object)new WaitForSeconds(0.1f); } generator.PlayerSpawn(); yield return null; while (BowserAccess.GetPlayerSpawnedCount(generator) < GameDirector.instance.PlayerList.Count) { generator.State = (LevelState)13; yield return (object)new WaitForSeconds(0.1f); } if (SemiFunc.IsMultiplayer()) { generator.PhotonView.RPC("GenerateDone", (RpcTarget)3, Array.Empty()); } else { BowserAccess.GenerateDone(generator); } } else { while (!generator.Generated) { yield return (object)new WaitForSeconds(0.1f); } } yield return (object)new WaitForSeconds(0.4f); Activate(); } private void Activate() { //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) _active = true; _won = false; _exitTimer = 0f; _lavaHurtTimer = 0f; _dropStarted = false; _readyShown = false; _starSpawned = false; _starTaken = false; ClearStar(); if (_arena != null && BowserModel.EnsureLoaded()) { _boss = BowserBoss.Create(this, _arena); if (SemiFunc.IsMasterClientOrSingleplayer()) { GameObject val = BowserTail.Spawn(_arena.Center + Vector3.up * 2f); if ((Object)(object)val != (Object)null) { PhysGrabObject component = val.GetComponent(); if ((Object)(object)component != (Object)null) { _boss.AssignTail(component); } } } } StartMusic(); } private void Deactivate() { if (_active) { _active = false; _won = false; _exitTimer = 0f; ClearMissiles(); ClearStar(); _starSpawned = false; _starTaken = false; if (_boss != null) { _boss.Dispose(); } _boss = null; _arena = null; BowserAudio.StopLoop(); StopMusic(); } } private void HandleSceneTransition() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) Scene activeScene = SceneManager.GetActiveScene(); int handle = ((Scene)(ref activeScene)).handle; if (handle != _sceneHandle) { _sceneHandle = handle; _active = false; _won = false; _exitTimer = 0f; _spawnLocations.Clear(); ClearMissiles(); ClearStar(); _starSpawned = false; _starTaken = false; if (_boss != null) { _boss.Dispose(); } _boss = null; _arena = null; BowserAudio.StopLoop(); StopMusic(); } } private void ResolveTail() { if (_boss == null) { return; } if (_boss.HasTail) { _tailSanitizeTimer -= Time.deltaTime; if (_tailSanitizeTimer <= 0f) { _tailSanitizeTimer = 1f; BowserTail.Sanitize(_boss.Tail); } return; } _tailRetryTimer -= Time.deltaTime; if (!(_tailRetryTimer > 0f)) { _tailRetryTimer = 0.5f; PhysGrabObject val = BowserTail.FindLocal(); if ((Object)(object)val != (Object)null) { _boss.AssignTail(val); } } } private void BroadcastBossState(float dt) { if (SemiFunc.IsMultiplayer() && _boss != null) { _broadcastTimer -= dt; if (!(_broadcastTimer > 0f)) { _broadcastTimer = 0.08f; EmpressBowserPlugin.RaiseBossState(_boss.GetState()); } } } internal void ReceiveBossState(object[] data) { if (!SemiFunc.IsMasterClientOrSingleplayer() && _boss != null) { _boss.ApplyState(data); } } internal void ReceiveBossAction(byte subtype, object[] data) { HandleBossAction(subtype, data); } internal void HandleBossAction(byte subtype, object[] data) { //IL_0039: 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_0077: 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_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_010b: 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_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: 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_02d8: Unknown result type (might be due to invalid IL or missing references) //IL_02eb: Unknown result type (might be due to invalid IL or missing references) //IL_0363: Unknown result type (might be due to invalid IL or missing references) //IL_0377: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: 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_028a: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_033f: Unknown result type (might be due to invalid IL or missing references) //IL_0344: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Unknown result type (might be due to invalid IL or missing references) switch (subtype) { case 1: if (data.Length >= 7) { SpawnMissile(ReadVector(data, 1), ReadVector(data, 4), bomb: false); BowserAudio.PlayFirst(0.95f, "bowser-fireball", "bowser_fireball"); } break; case 2: if (data.Length >= 4) { Vector3 val2 = ReadVector(data, 1); Explosion(val2, 1.5f, new Color(1f, 0.5f, 0.12f)); KnockLocalPlayer(val2, 7f, 13f); ShakeAll(val2); BowserAudio.PlayFirst(1f, "bowser-impact", "bower-impact", "bowser_pound"); } break; case 3: if (data.Length >= 6) { Vector3 val3 = ReadVector(data, 1); float radius = ToFloat(data[4]); float force = ToFloat(data[5]); KnockLocalPlayer(val3, radius, force); Explosion(val3, 0.7f, new Color(1f, 0.6f, 0.2f)); } break; case 4: if (data.Length >= 5) { int num = Mathf.RoundToInt(ToFloat(data[1])); Vector3 val = ReadVector(data, 2); Explosion(val, 2.4f, new Color(1f, 0.42f, 0.06f)); Explosion(val + Vector3.up * 1.5f, 1.5f, new Color(1f, 0.7f, 0.2f)); BowserAudio.Play("bowser_throw"); BowserAudio.PlayFirst(0.9f, "bowser_hurt"); ShakeAll(val); int num2 = ((EmpressBowserPlugin.Settings != null) ? EmpressBowserPlugin.Settings.ThrowsToWin.Value : 3); SemiFunc.UIFocusText("BOWSER GOES DOWN! " + num + " / " + num2, new Color(1f, 0.75f, 0.3f), Color.white, 4f); } break; case 5: if (data.Length >= 2) { int num6 = Mathf.RoundToInt(ToFloat(data[1])); BowserAudio.PlayFirst(1f, "bowser_phase" + num6, "bowser_roar"); if (num6 >= 3) { SemiFunc.UIFocusText("BOWSER IS FURIOUS!\nWATCH THE SKY!", new Color(1f, 0.28f, 0.15f), Color.white, 4f); } else { SemiFunc.UIFocusText("BOWSER RETURNS ANGRIER!", new Color(1f, 0.35f, 0.2f), Color.white, 4f); } } break; case 6: if (data.Length >= 4) { Vector3 center = ReadVector(data, 1); BowserAudio.Play("bowser_death"); ((MonoBehaviour)this).StartCoroutine(DeathExplosions(center)); } break; case 7: if (data.Length >= 3) { float num3 = ToFloat(data[1]); float num4 = ToFloat(data[2]); float num5 = ((_arena != null) ? (_arena.PlatformY + 24f) : 24f); SpawnMissile(new Vector3(num3, num5, num4), Vector3.down * 15.5f, bomb: true); } break; case 8: if (data.Length >= 4) { SpawnStar(ReadVector(data, 1)); } break; case 9: if (data.Length >= 5) { PickupStar(ReadVector(data, 1), Mathf.RoundToInt(ToFloat(data[4]))); } break; } } private IEnumerator DeathExplosions(Vector3 center) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) Vector3 val = default(Vector3); for (int i = 0; i < 6; i++) { ((Vector3)(ref val))..ctor(Random.Range(-3f, 3f), Random.Range(0f, 2.5f), Random.Range(-3f, 3f)); Explosion(center + val, Random.Range(1.2f, 2.2f), new Color(1f, Random.Range(0.35f, 0.7f), 0.1f)); ShakeAll(center); yield return (object)new WaitForSeconds(0.45f); } } private void SpawnMissile(Vector3 position, Vector3 velocity, bool bomb) { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0053: 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_00cb: 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_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) EnsureMissileMaterials(); GameObject val = GameObject.CreatePrimitive((PrimitiveType)0); ((Object)val).name = (bomb ? "Bowser Lava Bomb" : "Bowser Fireball"); Object.Destroy((Object)(object)val.GetComponent()); val.transform.position = position; val.transform.localScale = Vector3.one * (bomb ? 0.85f : 0.55f); ((Renderer)val.GetComponent()).sharedMaterial = (bomb ? _bombMat : _missileMat); GameObject val2 = new GameObject("Glow"); val2.transform.SetParent(val.transform, false); Light val3 = val2.AddComponent(); val3.type = (LightType)2; val3.color = (bomb ? new Color(1f, 0.32f, 0.06f) : new Color(1f, 0.55f, 0.12f)); val3.intensity = 2.4f; val3.range = (bomb ? 10f : 7f); TrailRenderer obj = val.AddComponent(); obj.time = 0.35f; obj.startWidth = (bomb ? 0.55f : 0.35f); obj.endWidth = 0f; ((Renderer)obj).material = (bomb ? _bombMat : _missileMat); _missiles.Add(new Missile { Position = position, Velocity = velocity, Bomb = bomb, Body = val, Glow = val3 }); } private void TickMissiles(float dt, bool host) { //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: 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_0046: 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_0060: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: 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_009c: Unknown result type (might be due to invalid IL or missing references) if (_arena == null) { return; } for (int num = _missiles.Count - 1; num >= 0; num--) { Missile missile = _missiles[num]; missile.Life += dt; if (!missile.Bomb) { missile.Velocity += Vector3.down * 14f * dt; } missile.Position += missile.Velocity * dt; if ((Object)(object)missile.Body != (Object)null) { missile.Body.transform.position = missile.Position; } float num2 = ((FlatDistance(_arena.Center, missile.Position) <= _arena.PlatformRadius) ? _arena.PlatformY : _arena.LavaY); if (missile.Position.y <= num2 + 0.25f || missile.Life > 7f) { ImpactMissile(missile, host); _missiles.RemoveAt(num); } } } private void ImpactMissile(Missile missile, bool host) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) float num = (missile.Bomb ? 3f : 2.6f); Explosion(missile.Position, missile.Bomb ? 1.2f : 0.9f, new Color(1f, 0.5f, 0.1f)); KnockLocalPlayer(missile.Position, num + 0.6f, 7f); BowserAudio.PlayFirst(missile.Bomb ? 1f : 0.85f, "bowser-fireballboom"); if (host && _boss != null) { List list = PlayablePlayers(); int num2 = (missile.Bomb ? 15 : 18); float num3 = ((EmpressBowserPlugin.Settings != null) ? EmpressBowserPlugin.Settings.DamageScale.Value : 1f); num2 = Mathf.Max(1, Mathf.RoundToInt((float)num2 * num3)); for (int i = 0; i < list.Count; i++) { PlayerAvatar val = list[i]; if (!((Object)(object)val == (Object)null) && !((Object)(object)val.playerHealth == (Object)null) && !(Vector3.Distance(((Component)val).transform.position, missile.Position) > num)) { if (SemiFunc.IsMultiplayer()) { val.playerHealth.HurtOther(num2, ((Component)val).transform.position, false, -1, false); } else { val.playerHealth.Hurt(num2, false, -1, false); } } } } if ((Object)(object)missile.Body != (Object)null) { Object.Destroy((Object)(object)missile.Body); } } private void ClearMissiles() { for (int i = 0; i < _missiles.Count; i++) { if ((Object)(object)_missiles[i].Body != (Object)null) { Object.Destroy((Object)(object)_missiles[i].Body); } } _missiles.Clear(); } private void EnsureMissileMaterials() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Expected O, but got Unknown //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_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_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Expected O, but got Unknown //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_missileMat != (Object)null)) { Shader val = Shader.Find("Standard"); _missileMat = new Material(val) { color = new Color(1f, 0.6f, 0.12f) }; _missileMat.EnableKeyword("_EMISSION"); _missileMat.SetColor("_EmissionColor", new Color(1f, 0.5f, 0.08f) * 3.4f); _bombMat = new Material(val) { color = new Color(1f, 0.32f, 0.06f) }; _bombMat.EnableKeyword("_EMISSION"); _bombMat.SetColor("_EmissionColor", new Color(1f, 0.28f, 0.04f) * 3.8f); } } internal void Explosion(Vector3 position, float scale, Color color) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: 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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: 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_00ef: 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_00ff: 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_014b: Expected O, but got Unknown //IL_0150: 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_0178: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Empress Bowser Burst"); val.transform.position = position; ParticleSystem val2 = val.AddComponent(); MainModule main = val2.main; ((MainModule)(ref main)).loop = false; ((MainModule)(ref main)).duration = 0.5f; ((MainModule)(ref main)).startLifetime = new MinMaxCurve(0.35f, 0.7f); ((MainModule)(ref main)).startSpeed = new MinMaxCurve(4f * scale, 8.5f * scale); ((MainModule)(ref main)).startSize = new MinMaxCurve(0.25f * scale, 0.7f * scale); ((MainModule)(ref main)).startColor = new MinMaxGradient(color, new Color(color.r, color.g * 0.6f, color.b * 0.4f)); ((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)1; EmissionModule emission = val2.emission; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(0f); ((EmissionModule)(ref emission)).SetBursts((Burst[])(object)new Burst[1] { new Burst(0f, (short)(34f * scale)) }); ShapeModule shape = val2.shape; ((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)0; ((ShapeModule)(ref shape)).radius = 0.4f * scale; ParticleSystemRenderer component = val.GetComponent(); Shader val3 = Shader.Find("Particles/Standard Unlit"); ((Renderer)component).sharedMaterial = new Material(((Object)(object)val3 != (Object)null) ? val3 : Shader.Find("Standard")); GameObject val4 = new GameObject("Flash"); val4.transform.SetParent(val.transform, false); Light val5 = val4.AddComponent(); val5.type = (LightType)2; val5.color = color; val5.intensity = 4.2f * scale; val5.range = 14f * scale; val2.Play(); ((MonoBehaviour)this).StartCoroutine(FadeAndKill(val, val5, 1.4f)); } private IEnumerator FadeAndKill(GameObject target, Light flash, float seconds) { float elapsed = 0f; float start = (((Object)(object)flash != (Object)null) ? flash.intensity : 0f); while (elapsed < seconds) { elapsed += Time.deltaTime; if ((Object)(object)flash != (Object)null) { flash.intensity = Mathf.Lerp(start, 0f, elapsed / seconds); } yield return null; } Object.Destroy((Object)(object)target); } private void ShakeAll(Vector3 position) { //IL_0027: 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) if (!((Object)(object)GameDirector.instance == (Object)null)) { GameDirector.instance.CameraShake.ShakeDistance(4f, 4f, 18f, position, 0.35f); GameDirector.instance.CameraImpact.ShakeDistance(4f, 4f, 18f, position, 0.12f); } } private void KnockLocalPlayer(Vector3 center, float radius, float force) { //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_002a: 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_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: 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_006d: 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_007a: 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_0081: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) PlayerController instance = PlayerController.instance; if ((Object)(object)instance == (Object)null || (Object)(object)instance.rb == (Object)null) { return; } Vector3 position = ((Component)instance).transform.position; if (!(Vector3.Distance(position, center) > radius)) { Vector3 val = position - center; val.y = 0f; Vector3 normalized; if (!(((Vector3)(ref val)).sqrMagnitude > 0.01f)) { Vector3 insideUnitSphere = Random.insideUnitSphere; normalized = ((Vector3)(ref insideUnitSphere)).normalized; } else { normalized = ((Vector3)(ref val)).normalized; } val = normalized; Rigidbody rb = instance.rb; rb.velocity += val * force + Vector3.up * (force * 0.45f); } } private void TickFlicker() { if (_arena == null) { return; } for (int i = 0; i < _arena.FlickerLights.Count; i++) { Light val = _arena.FlickerLights[i]; if (!((Object)(object)val == (Object)null)) { float num = Mathf.PerlinNoise(Time.time * 2.2f, (float)i * 3.7f); val.intensity = Mathf.Lerp(2.1f, 3.3f, num); } } } private void TickLava(float dt) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0058: 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_0103: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: 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_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_0108: 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_010a: 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_0119: 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_0125: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) if (_arena == null) { return; } _lavaHurtTimer -= dt; PlayerController instance = PlayerController.instance; if ((Object)(object)instance == (Object)null || ((Component)instance).transform.position.y >= _arena.PlatformY - 1.4f) { return; } Vector3 position = ((Component)instance).transform.position; Explosion(position, 0.8f, new Color(1f, 0.45f, 0.08f)); if (_lavaHurtTimer <= 0f) { _lavaHurtTimer = 0.6f; PlayerAvatar playerAvatarScript = instance.playerAvatarScript; if ((Object)(object)playerAvatarScript != (Object)null && (Object)(object)playerAvatarScript.playerHealth != (Object)null) { playerAvatarScript.playerHealth.Hurt(15, false, -1, false); } } Vector3 val = ((_spawnLocations.Count > 0) ? _spawnLocations[Random.Range(0, _spawnLocations.Count)] : (_arena.Center + Vector3.up * 0.5f)); val += Vector3.up * 0.5f; ((Component)instance).transform.position = val; if ((Object)(object)instance.rb != (Object)null) { instance.rb.position = val; instance.rb.velocity = Vector3.zero; } } private void RefillStamina() { PlayerController instance = PlayerController.instance; if ((Object)(object)instance != (Object)null) { instance.EnergyCurrent = instance.EnergyStart; } } private List PlayablePlayers() { List list = new List(); if ((Object)(object)GameDirector.instance != (Object)null && GameDirector.instance.PlayerList != null) { for (int i = 0; i < GameDirector.instance.PlayerList.Count; i++) { PlayerAvatar val = GameDirector.instance.PlayerList[i]; if ((Object)(object)val != (Object)null && !BowserAccess.GetIsDisabled(val) && !BowserAccess.GetDeadSet(val)) { list.Add(val); } } } return list; } private void CheckWin() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_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_004c: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) if (!_won && !_starSpawned && _boss != null && _boss.DeathComplete) { _starSpawned = true; Vector3 val = _boss.SplashPoint + Vector3.up * 0.3f; object[] data = new object[4] { (byte)8, val.x, val.y, val.z }; HandleBossAction(8, data); EmpressBowserPlugin.RaiseBossAction(data); } } private void SpawnStar(Vector3 position) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Expected O, but got Unknown //IL_004a: 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_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0150: 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_0165: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Expected O, but got Unknown //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_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_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Expected O, but got Unknown //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_0240: 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_025c: 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_0278: 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_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_02c4: Unknown result type (might be due to invalid IL or missing references) //IL_02dd: 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_02f5: 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_0302: Unknown result type (might be due to invalid IL or missing references) //IL_030c: Unknown result type (might be due to invalid IL or missing references) //IL_0311: Unknown result type (might be due to invalid IL or missing references) //IL_0350: Unknown result type (might be due to invalid IL or missing references) //IL_035a: Expected O, but got Unknown //IL_038e: Unknown result type (might be due to invalid IL or missing references) //IL_0393: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_star != (Object)null)) { _starSpawned = true; _starTaken = false; _starFrom = position; _starTime = 0f; _star = new GameObject("Empress Bowser Star"); _star.transform.position = position; GameObject val = BowserModel.CreateStarInstance(_star.transform); if ((Object)(object)val != (Object)null) { Bounds val2 = BowserModel.ComputeBounds(val); float num = Mathf.Max(((Bounds)(ref val2)).size.y, 0.001f); float num2 = 1.4f / num; val.transform.localScale = val.transform.localScale * num2; val2 = BowserModel.ComputeBounds(val); Transform transform = val.transform; transform.position += _star.transform.position - ((Bounds)(ref val2)).center; _starModel = val.transform; } else { GameObject val3 = GameObject.CreatePrimitive((PrimitiveType)0); Object.Destroy((Object)(object)val3.GetComponent()); val3.transform.SetParent(_star.transform, false); val3.transform.localScale = Vector3.one * 1.2f; Material val4 = new Material(Shader.Find("Standard")) { color = new Color(1f, 0.83f, 0.15f) }; val4.EnableKeyword("_EMISSION"); val4.SetColor("_EmissionColor", new Color(1f, 0.8f, 0.1f) * 2.6f); ((Renderer)val3.GetComponent()).sharedMaterial = val4; _starModel = val3.transform; } GameObject val5 = new GameObject("Star Light"); val5.transform.SetParent(_star.transform, false); _starLight = val5.AddComponent(); _starLight.type = (LightType)2; _starLight.color = new Color(1f, 0.88f, 0.4f); _starLight.intensity = 3.2f; _starLight.range = 16f; GameObject val6 = new GameObject("Star Sparkles"); val6.transform.SetParent(_star.transform, false); ParticleSystem obj = val6.AddComponent(); MainModule main = obj.main; ((MainModule)(ref main)).loop = true; ((MainModule)(ref main)).startLifetime = MinMaxCurve.op_Implicit(0.9f); ((MainModule)(ref main)).startSpeed = new MinMaxCurve(0.5f, 1.6f); ((MainModule)(ref main)).startSize = new MinMaxCurve(0.08f, 0.22f); ((MainModule)(ref main)).startColor = new MinMaxGradient(new Color(1f, 0.95f, 0.5f, 1f), new Color(1f, 0.8f, 0.2f, 1f)); ((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)1; EmissionModule emission = obj.emission; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(40f); ShapeModule shape = obj.shape; ((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)0; ((ShapeModule)(ref shape)).radius = 0.9f; ParticleSystemRenderer component = val6.GetComponent(); Shader val7 = Shader.Find("Particles/Standard Unlit"); ((Renderer)component).sharedMaterial = new Material(((Object)(object)val7 != (Object)null) ? val7 : Shader.Find("Standard")); BowserAudio.PlayFirst(1f, "bowser_star", "bowser_roar"); SemiFunc.UIFocusText("A POWER STAR!\nGrab it to claim your reward!", new Color(1f, 0.88f, 0.35f), Color.white, 5f); } } private void TickStar(float dt, bool host) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: 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) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_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_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0129: 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_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013d: 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_00cb: 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_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: 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_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_0257: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_star == (Object)null || _starTaken || _arena == null) { return; } _starTime += dt; Vector3 val = _starFrom + Vector3.up * 15f; Vector3 val2 = _arena.Center + Vector3.up * 1.2f; Vector3 val3; if (_starTime < 2.4f) { float num = _starTime / 2.4f; val3 = Vector3.Lerp(_starFrom, val, num * num * (3f - 2f * num)); } else if (_starTime < 4.3f) { float num2 = (_starTime - 2.4f) / 1.9f; val3 = Vector3.Lerp(val, val2, num2 * num2 * (3f - 2f * num2)); val3.y += Mathf.Sin(num2 * MathF.PI) * 2.2f; } else { val3 = val2 + Vector3.up * Mathf.Sin((_starTime - 2.4f - 1.9f) * 2.1f) * 0.28f; } _star.transform.position = val3; if ((Object)(object)_starModel != (Object)null) { _starModel.Rotate(0f, 150f * dt, 0f, (Space)0); } if ((Object)(object)_starLight != (Object)null) { _starLight.intensity = 2.8f + Mathf.Sin(Time.time * 5f) * 0.7f; } if (!host || _starTime < 4.3f) { return; } List list = PlayablePlayers(); for (int i = 0; i < list.Count; i++) { PlayerAvatar val4 = list[i]; if (!((Object)(object)val4 == (Object)null)) { Vector3 position = ((Component)val4).transform.position; if (!(FlatDistance(position, val3) > 1.9f) && !(Mathf.Abs(position.y - val3.y) > 2.6f)) { float num3 = Random.Range(55, 71); object[] data = new object[5] { (byte)9, val3.x, val3.y, val3.z, num3 }; HandleBossAction(9, data); EmpressBowserPlugin.RaiseBossAction(data); break; } } } } private void PickupStar(Vector3 position, int reward) { //IL_0011: 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_0031: 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_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_005a: 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_00b4: Unknown result type (might be due to invalid IL or missing references) if (!_starTaken) { _starTaken = true; Explosion(position, 1.7f, new Color(1f, 0.9f, 0.4f)); Explosion(position + Vector3.up * 0.8f, 1f, new Color(1f, 0.95f, 0.6f)); BowserAudio.PlayFirst(1f, "bowser_star_pickup", "bowser_star"); ClearStar(); SemiFunc.UIFocusText("STAR GET!\nBOWSER IS DEFEATED - Team earns $" + reward + "K", new Color(1f, 0.88f, 0.35f), Color.white, 6f); if (SemiFunc.IsMasterClientOrSingleplayer()) { _won = true; _exitTimer = Mathf.Max(2f, EmpressBowserPlugin.Settings.ExitDelaySeconds.Value); AwardVictory(reward); } } } private void ClearStar() { if ((Object)(object)_star != (Object)null) { Object.Destroy((Object)(object)_star); } _star = null; _starModel = null; _starLight = null; } private void AwardVictory(int reward) { SemiFunc.StatSetRunCurrency(SemiFunc.StatGetRunCurrency() + reward); SemiFunc.StatSetRunTotalHaul(SemiFunc.StatGetRunTotalHaul() + reward); if ((Object)(object)CurrencyUI.instance != (Object)null) { CurrencyUI.instance.FetchCurrency(); } } private void AdvanceAfterWin(float dt) { if (!_won || _exitTimer > 900f) { return; } _exitTimer -= dt; if (!(_exitTimer > 0f)) { _exitTimer = 999f; Time.timeScale = 1f; if ((Object)(object)RunManager.instance != (Object)null && EmpressBowserPlugin.IsBowserLevel(RunManager.instance.levelCurrent)) { RunManager.instance.ChangeLevel(true, false, (ChangeLevelType)0); } } } private static float FlatDistance(Vector3 a, Vector3 b) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) a.y = 0f; b.y = 0f; return Vector3.Distance(a, b); } private static float ToFloat(object value) { if (value is float) { return (float)value; } if (value is int num) { return num; } return 0f; } private static Vector3 ReadVector(object[] data, int start) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) return new Vector3(ToFloat(data[start]), ToFloat(data[start + 1]), ToFloat(data[start + 2])); } } internal static class BowserTail { public const string PrefabId = "EmpressBowserTail"; private static GameObject _prefab; private static object _prefabRef; public static void RegisterPrefab() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown if (!((Object)(object)_prefab != (Object)null)) { GameObject val = new GameObject("Empress Bowser Prefabs"); Object.DontDestroyOnLoad((Object)(object)val); ((Object)val).hideFlags = (HideFlags)61; val.SetActive(false); _prefab = new GameObject("EmpressBowserTail"); _prefab.transform.SetParent(val.transform, false); int num = LayerMask.NameToLayer("PhysGrabObject"); if (num >= 0) { _prefab.layer = num; } _prefab.tag = "Phys Grab Object"; Rigidbody obj = _prefab.AddComponent(); obj.mass = 2.1f; obj.drag = 0.35f; obj.angularDrag = 0.6f; CapsuleCollider obj2 = _prefab.AddComponent(); obj2.radius = 0.72f; obj2.height = 2.3f; obj2.direction = 2; _prefab.AddComponent(); PhotonView obj3 = _prefab.AddComponent(); PhotonTransformView item = _prefab.AddComponent(); PhysGrabObject item2 = _prefab.AddComponent(); PhysGrabObjectImpactDetector val2 = _prefab.AddComponent(); val2.particleDisable = true; val2.destroyDisable = true; val2.playerHurtDisable = true; val2.canHurtLogic = false; obj3.ObservedComponents = new List { (Component)(object)item, (Component)(object)item2, (Component)(object)val2 }; _prefabRef = NetworkPrefabs.RegisterNetworkPrefab("EmpressBowserTail", _prefab); EmpressBowserPlugin.Log.LogInfo((object)("Empress Bowser tail prefab registered: " + (_prefabRef != null))); } } public static GameObject Spawn(Vector3 position) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) object prefabRef = _prefabRef; PrefabRef val = (PrefabRef)((prefabRef is PrefabRef) ? prefabRef : null); if (val != null) { GameObject val2 = NetworkPrefabs.SpawnNetworkPrefab(val, position, Quaternion.identity, (byte)0, (object[])null); if ((Object)(object)val2 != (Object)null) { return val2; } } if ((Object)(object)_prefab != (Object)null) { GameObject obj = Object.Instantiate(_prefab, position, Quaternion.identity); obj.SetActive(true); return obj; } return null; } public static PhysGrabObject FindLocal() { PhysGrabObject[] array = Object.FindObjectsOfType(true); for (int i = 0; i < array.Length; i++) { if (((Object)array[i]).name.StartsWith("EmpressBowserTail")) { return array[i]; } } return null; } public static void LockGrab(PhysGrabObject grab) { if ((Object)(object)grab != (Object)null) { BowserAccess.SetGrabDisableTimer(grab, 0.4f); } } public static void Sanitize(PhysGrabObject grab) { if (!((Object)(object)grab == (Object)null)) { PhysGrabObjectImpactDetector component = ((Component)grab).GetComponent(); if ((Object)(object)component != (Object)null) { BowserAccess.SetImpactDetectorNotValuable(component, value: false); } } } public static bool IsGrabbed(PhysGrabObject grab) { if ((Object)(object)grab != (Object)null) { if (!grab.grabbed) { return grab.playerGrabbing.Count > 0; } return true; } return false; } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.empress.repo.bowser", "Empress Bowser", "1.0.0")] public sealed class EmpressBowserPlugin : BaseUnityPlugin { public const string PluginGuid = "com.empress.repo.bowser"; public const string PluginName = "Empress Bowser"; public const string PluginVersion = "1.0.0"; public const string LevelName = "Level - Empress Bowser"; public const string DisplayName = "Empress - Bowser"; internal const byte BossStateEventCode = 183; internal const byte BossActionEventCode = 184; private static bool _photonHooked; private Harmony _harmony; internal static EmpressBowserPlugin Instance { get; private set; } internal static ManualLogSource Log { get; private set; } internal static BowserSettings Settings { get; private set; } internal static Level BowserLevel { get; private set; } internal static string PluginDirectory { get; private set; } private void Awake() { //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Expected O, but got Unknown Instance = this; Log = ((BaseUnityPlugin)this).Logger; PluginDirectory = Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location); Settings = new BowserSettings(((BaseUnityPlugin)this).Config); ((Component)this).gameObject.transform.parent = null; ((Object)((Component)this).gameObject).hideFlags = (HideFlags)61; Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject); BowserLevel = BowserLevelRegistry.RegisterLevel(); BowserTail.RegisterPrefab(); _harmony = new Harmony("com.empress.repo.bowser"); _harmony.PatchAll(typeof(EmpressBowserPlugin).Assembly); BowserRuntime.EnsureHost(); BowserAudio.Initialize(PluginDirectory, (MonoBehaviour)(object)BowserRuntime.Instance, ((BaseUnityPlugin)this).Logger); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Empress Bowser v1.0.0 loaded. Level registered: Level - Empress Bowser"); } private void OnDestroy() { RemovePhotonHook(); } internal static bool IsBowserLevel(Level level) { if ((Object)(object)level != (Object)null) { return ((Object)level).name == "Level - Empress Bowser"; } return false; } internal static void EnsurePhotonHooked() { if (!_photonHooked) { LoadBalancingClient networkingClient = PhotonNetwork.NetworkingClient; if (networkingClient != null) { networkingClient.EventReceived -= OnPhotonEvent; networkingClient.EventReceived += OnPhotonEvent; _photonHooked = true; } } } internal static void RemovePhotonHook() { if (_photonHooked) { LoadBalancingClient networkingClient = PhotonNetwork.NetworkingClient; if (networkingClient != null) { networkingClient.EventReceived -= OnPhotonEvent; } _photonHooked = false; } } private static void OnPhotonEvent(EventData ev) { BowserRuntime instance = BowserRuntime.Instance; if ((Object)(object)instance == (Object)null) { return; } switch (ev.Code) { case 183: if (ev.CustomData is object[] data) { instance.ReceiveBossState(data); } break; case 184: if (ev.CustomData is object[] array && array.Length >= 1 && array[0] is byte subtype) { instance.ReceiveBossAction(subtype, array); } break; } } internal static void RaiseBossState(object[] data) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) RaisePhotonEvent(183, data, (ReceiverGroup)0, SendOptions.SendUnreliable); } internal static void RaiseBossAction(object[] data) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) RaisePhotonEvent(184, data, (ReceiverGroup)0, SendOptions.SendReliable); } private static void RaisePhotonEvent(byte code, object[] payload, ReceiverGroup receivers, SendOptions sendOptions) { //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_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown //IL_001d: Unknown result type (might be due to invalid IL or missing references) EnsurePhotonHooked(); if (PhotonNetwork.InRoom) { RaiseEventOptions val = new RaiseEventOptions { Receivers = receivers }; PhotonNetwork.RaiseEvent(code, (object)payload, val, sendOptions); } } internal static void DebugLog(string message) { if (Settings != null && Settings.DebugLogs.Value) { Log.LogInfo((object)message); } } } internal sealed class BowserSettings { public readonly ConfigEntry ForceBowserLevel; public readonly ConfigEntry DebugLogs; public readonly ConfigEntry ThrowsToWin; public readonly ConfigEntry ExitDelaySeconds; public readonly ConfigEntry MusicVolume; public readonly ConfigEntry SfxVolume; public readonly ConfigEntry GrabWindowSeconds; public readonly ConfigEntry DamageScale; public readonly ConfigEntry GraceSeconds; public BowserSettings(ConfigFile config) { //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Expected O, but got Unknown //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Expected O, but got Unknown //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Expected O, but got Unknown //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Expected O, but got Unknown //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Expected O, but got Unknown //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Expected O, but got Unknown //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Expected O, but got Unknown ForceBowserLevel = config.Bind("Debug", "ForceBowserLevel", false, "Forces every real run level to load the Empress Bowser arena. Useful for testing."); DebugLogs = config.Bind("Debug", "DebugLogs", false, "Logs verbose Bowser fight diagnostics."); ThrowsToWin = config.Bind("Boss", "ThrowsToWin", 3, new ConfigDescription("Times Bowser must be thrown into the lava to win.", (AcceptableValueBase)(object)new AcceptableValueRange(1, 10), Array.Empty())); ExitDelaySeconds = config.Bind("Boss", "ExitDelaySeconds", 8f, new ConfigDescription("Seconds after Bowser dies before the level transitions away.", (AcceptableValueBase)(object)new AcceptableValueRange(2f, 30f), Array.Empty())); MusicVolume = config.Bind("Audio", "MusicVolume", 0.25f, new ConfigDescription("Volume of the boss music.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 1f), Array.Empty())); SfxVolume = config.Bind("Audio", "SfxVolume", 0.85f, new ConfigDescription("Volume of Bowser sounds.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 1f), Array.Empty())); GrabWindowSeconds = config.Bind("Boss", "GrabWindowSeconds", 6f, new ConfigDescription("Base seconds the tail stays grabbable after Bowser is staggered. Later phases shorten this.", (AcceptableValueBase)(object)new AcceptableValueRange(2f, 15f), Array.Empty())); DamageScale = config.Bind("Boss", "DamageScale", 1f, new ConfigDescription("Multiplier on all damage Bowser deals.", (AcceptableValueBase)(object)new AcceptableValueRange(0.25f, 3f), Array.Empty())); GraceSeconds = config.Bind("Boss", "GraceSeconds", 10f, new ConfigDescription("Seconds after all players load in before Bowser drops into the arena.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 30f), Array.Empty())); } } }