using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using Awakened_Grand_Mother_Silk.Source.Behaviours; using Awakened_Grand_Mother_Silk.Source.Patches; using BepInEx; using BepInEx.Logging; using GlobalEnums; using HarmonyLib; using HutongGames.PlayMaker; using HutongGames.PlayMaker.Actions; using JetBrains.Annotations; using Microsoft.CodeAnalysis; using TeamCherry.Localization; using UnityEngine; using UnityEngine.AddressableAssets; [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("Awakened Grand Mother Silk")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("Awakened Grand Mother Silk")] [assembly: AssemblyTitle("Awakened Grand Mother Silk")] [assembly: AssemblyVersion("1.0.0.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace Awakened_Grand_Mother_Silk { public static class MyPluginInfo { public const string PLUGIN_GUID = "AwakenedGrandMotherSilk"; public const string PLUGIN_NAME = "AwakenedGrandMotherSilk"; public const string PLUGIN_VERSION = "1.0.0"; } } namespace Awakened_Grand_Mother_Silk.Source { public static class ArrayExtensions { public static T[] RemoveFirst(this T[] array, Func predicate) { Func predicate2 = predicate; List list = array.ToList(); int num = list.FindIndex((T x) => predicate2(x)); if (num >= 0) { list.RemoveAt(num); } return list.ToArray(); } public static T[] Insert(this T[] array, int index, T item) { List list = array.ToList(); list.Insert(index, item); return list.ToArray(); } } internal static class AssetManager { [CompilerGenerated] private sealed class <>c__DisplayClass5_0 { public string assetPath; internal bool b__0(string objName) { return assetPath.Contains(objName); } } [CompilerGenerated] private sealed class <>c__DisplayClass9_0 { public string bundleName; internal bool b__0(AssetBundle bundle) { return ((Object)bundle).name == bundleName; } } [CompilerGenerated] private sealed class <>c__DisplayClass9_1 { public AssetBundleRequest assetLoadRequest; internal void b__1(AsyncOperation _) { Object asset = assetLoadRequest.asset; GameObject val = (GameObject)(object)((asset is GameObject) ? asset : null); if (val != null && asset.name == "Lost Lace Ground Tendril") { ConstrainPosition component = val.GetComponent(); component.xMax = 100f; component.yMin = 0f; component.yMax = 100f; FsmState[] fsmStates = FSMUtility.LocateMyFSM(val, "Control").FsmStates; foreach (FsmState val2 in fsmStates) { if (val2.Name == "Antic") { FsmStateAction[] actions = val2.Actions; FsmStateAction[] array = actions; foreach (FsmStateAction val3 in array) { SetFloatValue val4 = (SetFloatValue)(object)((val3 is SetFloatValue) ? val3 : null); if (val4 == null) { EaseFloat val5 = (EaseFloat)(object)((val3 is EaseFloat) ? val3 : null); if (val5 != null) { val5.fromValue.Value = 11f; val5.toValue.Value = 13f; } } else { val4.floatValue.Value = 11f; } } val2.Actions = actions; } else { if (!(val2.Name == "Recycle")) { continue; } FsmStateAction[] actions2 = val2.Actions; FsmStateAction[] array = actions2; foreach (FsmStateAction obj in array) { SetPosition2D val6 = (SetPosition2D)(object)((obj is SetPosition2D) ? obj : null); if (val6 != null) { val6.Y.Value = 11f; } } val2.Actions = actions2; } } } AssetManager.TryAdd(asset); } } [CompilerGenerated] private sealed class d__5 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; private IEnumerator <>7__wrap1; private AssetBundle 5__3; private string[] <>7__wrap3; private int <>7__wrap4; private AssetBundleRequest 5__6; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__5(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { int num = <>1__state; if (num == -3 || num == 1) { try { } finally { <>m__Finally1(); } } <>7__wrap1 = null; 5__3 = null; <>7__wrap3 = null; 5__6 = null; <>1__state = -2; } private bool MoveNext() { try { int num = <>1__state; if (num != 0) { if (num != 1) { return false; } <>1__state = -3; Object asset = 5__6.asset; if (asset != (Object)null) { AssetManager.TryAdd(asset); } 5__6 = null; goto IL_010a; } <>1__state = -1; if (_initialized) { return false; } _initialized = true; <>7__wrap1 = AssetBundle.GetAllLoadedAssetBundles().GetEnumerator(); <>1__state = -3; goto IL_0139; IL_0139: if (<>7__wrap1.MoveNext()) { 5__3 = <>7__wrap1.Current; <>7__wrap3 = 5__3.GetAllAssetNames(); <>7__wrap4 = 0; goto IL_0118; } <>m__Finally1(); <>7__wrap1 = null; return false; IL_010a: <>7__wrap4++; goto IL_0118; IL_0118: if (<>7__wrap4 < <>7__wrap3.Length) { <>c__DisplayClass5_0 CS$<>8__locals0 = new <>c__DisplayClass5_0 { assetPath = <>7__wrap3[<>7__wrap4] }; if (_assetNames.Any((string objName) => CS$<>8__locals0.assetPath.Contains(objName))) { 5__6 = 5__3.LoadAssetAsync(CS$<>8__locals0.assetPath); <>2__current = 5__6; <>1__state = 1; return true; } goto IL_010a; } <>7__wrap3 = null; 5__3 = null; goto IL_0139; } catch { //try-fault ((IDisposable)this).Dispose(); throw; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } private void <>m__Finally1() { <>1__state = -1; if (<>7__wrap1 != null) { <>7__wrap1.Dispose(); } } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__9 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; private string[] <>7__wrap1; private int <>7__wrap2; private AssetBundleCreateRequest 5__4; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__9(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>7__wrap1 = null; 5__4 = null; <>1__state = -2; } private bool MoveNext() { //IL_0065: 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_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Invalid comparison between Unknown and I4 //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Invalid comparison between Unknown and I4 //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Invalid comparison between Unknown and I4 int num = <>1__state; if (num != 0) { if (num != 1) { return false; } <>1__state = -1; AssetBundle assetBundle = 5__4.assetBundle; _manuallyLoadedBundles.Add(assetBundle); string[] allAssetNames = assetBundle.GetAllAssetNames(); foreach (string text in allAssetNames) { string[] assetNames = _assetNames; foreach (string value in assetNames) { if (!text.Contains(value)) { continue; } <>c__DisplayClass9_1 CS$<>8__locals1 = new <>c__DisplayClass9_1 { assetLoadRequest = assetBundle.LoadAssetAsync(text) }; ((AsyncOperation)CS$<>8__locals1.assetLoadRequest).completed += delegate { Object asset = CS$<>8__locals1.assetLoadRequest.asset; GameObject val = (GameObject)(object)((asset is GameObject) ? asset : null); if (val != null && asset.name == "Lost Lace Ground Tendril") { ConstrainPosition component = val.GetComponent(); component.xMax = 100f; component.yMin = 0f; component.yMax = 100f; FsmState[] fsmStates = FSMUtility.LocateMyFSM(val, "Control").FsmStates; foreach (FsmState val2 in fsmStates) { if (val2.Name == "Antic") { FsmStateAction[] actions = val2.Actions; FsmStateAction[] array = actions; foreach (FsmStateAction val3 in array) { SetFloatValue val4 = (SetFloatValue)(object)((val3 is SetFloatValue) ? val3 : null); if (val4 == null) { EaseFloat val5 = (EaseFloat)(object)((val3 is EaseFloat) ? val3 : null); if (val5 != null) { val5.fromValue.Value = 11f; val5.toValue.Value = 13f; } } else { val4.floatValue.Value = 11f; } } val2.Actions = actions; } else if (val2.Name == "Recycle") { FsmStateAction[] actions2 = val2.Actions; FsmStateAction[] array = actions2; foreach (FsmStateAction obj in array) { SetPosition2D val6 = (SetPosition2D)(object)((obj is SetPosition2D) ? obj : null); if (val6 != null) { val6.Y.Value = 11f; } } val2.Actions = actions2; } } } AssetManager.TryAdd(asset); }; } } 5__4 = null; goto IL_0186; } <>1__state = -1; <>7__wrap1 = _bundleNames; <>7__wrap2 = 0; goto IL_0194; IL_0186: <>7__wrap2++; goto IL_0194; IL_0194: if (<>7__wrap2 < <>7__wrap1.Length) { <>c__DisplayClass9_0 CS$<>8__locals0 = new <>c__DisplayClass9_0 { bundleName = <>7__wrap1[<>7__wrap2] }; if (!AssetBundle.GetAllLoadedAssetBundles().Any((AssetBundle bundle) => ((Object)bundle).name == CS$<>8__locals0.bundleName)) { RuntimePlatform platform = Application.platform; string text2 = (((int)platform == 1) ? "StandaloneOSX" : (((int)platform == 2) ? "StandaloneWindows64" : (((int)platform != 13) ? "" : "StandaloneLinux64"))); string path = text2; string text3 = Path.Combine(Addressables.RuntimePath, path, CS$<>8__locals0.bundleName + ".bundle"); 5__4 = AssetBundle.LoadFromFileAsync(text3); <>2__current = 5__4; <>1__state = 1; return true; } goto IL_0186; } <>7__wrap1 = null; return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static string[] _bundleNames = new string[1] { "localpoolprefabs_assets_laceboss" }; private static List _manuallyLoadedBundles = new List(); private static string[] _assetNames = new string[1] { "Audio Player Actor Simple" }; private static readonly Dictionary> Assets = new Dictionary>(); private static bool _initialized; [IteratorStateMachine(typeof(d__5))] internal static IEnumerator Initialize() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__5(0); } private static void TryAdd(T asset) where T : Object { string name = ((Object)asset).name; if (Has(name)) { Log.Warn("Asset \"" + ((Object)asset).name + "\" has already been loaded!"); return; } Type type = ((object)asset).GetType(); if (Assets.ContainsKey(type)) { Dictionary dictionary = Assets[type]; if (dictionary != null) { if (dictionary.ContainsKey(name)) { if (dictionary[name] != (Object)null) { Log.Warn($"There is already an asset \"{name}\" of type \"{type}\"!"); return; } Log.Info($"Key \"{name}\" for sub-dictionary of type \"{type}\" exists, but its value is null; Replacing with new asset..."); Assets[type][name] = (Object)(object)asset; } else { Log.Debug($"Adding asset \"{name}\" of type \"{type}\"."); Assets[type].Add(name, (Object)(object)asset); } } else { Log.Error($"Failed to get sub-dictionary of type \"{type}\"!"); Assets.Add(type, new Dictionary()); } } else { Assets.Add(type, new Dictionary { [name] = (Object)(object)asset }); Log.Debug($"Added new sub-dictionary of type \"{type}\" with initial asset \"{name}\"."); } } internal static void LoadTextures() { //IL_0079: 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_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Expected O, but got Unknown //IL_00a5: Expected O, but got Unknown Assembly executingAssembly = Assembly.GetExecutingAssembly(); string[] manifestResourceNames = executingAssembly.GetManifestResourceNames(); foreach (string text in manifestResourceNames) { string text2 = text.ToLower(); if (!text2.EndsWith(".png") && !text2.EndsWith(".jpg") && !text2.EndsWith(".jpeg")) { continue; } using Stream stream = executingAssembly.GetManifestResourceStream(text); if (stream != null) { byte[] array = new byte[stream.Length]; stream.Read(array, 0, array.Length); Texture2D val = new Texture2D(2, 2); string text4 = (((Object)val).name = text.Split('.')[^2]); ImageConversion.LoadImage(val, array); TryAdd(val); Log.Debug("Loaded texture: " + text4); } } } internal static void LoadAudioClips() { Assembly executingAssembly = Assembly.GetExecutingAssembly(); int num = 0; string[] manifestResourceNames = executingAssembly.GetManifestResourceNames(); string[] array = manifestResourceNames; foreach (string text in array) { Log.Debug(" Resource: " + text); } array = manifestResourceNames; foreach (string text2 in array) { if (!text2.ToLower().EndsWith(".wav")) { continue; } using Stream stream = executingAssembly.GetManifestResourceStream(text2); if (stream == null) { Log.Warn("LoadAudioClips: Could not open stream for " + text2); continue; } byte[] array2 = new byte[stream.Length]; stream.Read(array2, 0, array2.Length); string text3 = text2.Split('.')[^2]; try { AudioClip val = WavUtility.ToAudioClip(array2, text3); if ((Object)(object)val != (Object)null) { TryAdd(val); num++; } } catch (Exception ex) { Log.Error("Failed to load audio clip '" + text3 + "': " + ex.Message); } } Log.Info($"LoadAudioClips: Loaded {num} audio clips total"); } [IteratorStateMachine(typeof(d__9))] internal static IEnumerator ManuallyLoadBundles() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__9(0); } internal static void UnloadAll() { foreach (Dictionary value in Assets.Values) { foreach (Object value2 in value.Values) { Object.DestroyImmediate(value2); } } Assets.Clear(); GC.Collect(); } internal static void UnloadManualBundles() { foreach (AssetBundle manuallyLoadedBundle in _manuallyLoadedBundles) { string bundleName = ((Object)manuallyLoadedBundle).name; ((AsyncOperation)manuallyLoadedBundle.UnloadAsync(true)).completed += delegate { Log.Info("Successfully unloaded bundle \"" + bundleName + "\""); }; } _manuallyLoadedBundles.Clear(); if (!Assets.ContainsKey(typeof(GameObject))) { return; } foreach (KeyValuePair item in Assets[typeof(GameObject)]) { item.Deconstruct(out var _, out var value); GameObject val = (GameObject)(object)((value is GameObject) ? value : null); if (val != null && val.activeSelf) { Log.Info("Recycling all instances of prefab \"" + ((Object)val).name + "\""); ObjectPoolExtensions.RecycleAll(val); } } } private static bool Has(string assetName) { foreach (KeyValuePair> asset in Assets) { asset.Deconstruct(out var _, out var value); foreach (var (text2, val2) in value) { if (assetName == text2 && Object.op_Implicit(val2)) { return true; } } } return false; } internal static T? Get(string assetName) where T : Object { Type typeFromHandle = typeof(T); if (Assets.ContainsKey(typeFromHandle)) { Dictionary dictionary = Assets[typeFromHandle]; if (dictionary != null) { if (dictionary.ContainsKey(assetName)) { Object val = dictionary[assetName]; if (val != (Object)null) { return (T)(object)((val is T) ? val : null); } Log.Error("Failed to get asset \"" + assetName + "\"; asset is null"); return default(T); } Log.Error($"Sub-dictionary for type \"{typeFromHandle}\" does not contain key \"{assetName}\""); return default(T); } Log.Error($"Failed to get asset \"{assetName}\"; sub-dictionary of key \"{typeFromHandle}\" is null"); return default(T); } Log.Error($"Could not find a sub-dictionary of type \"{typeFromHandle}\""); return default(T); } } internal static class WavUtility { public static AudioClip? ToAudioClip(byte[] wavData, string clipName) { if (wavData.Length < 44) { Log.Error("WAV data too short for '" + clipName + "'"); return null; } if (wavData[0] != 82 || wavData[1] != 73 || wavData[2] != 70 || wavData[3] != 70) { Log.Error("Invalid WAV header for '" + clipName + "' - not a RIFF file"); return null; } if (wavData[8] != 87 || wavData[9] != 65 || wavData[10] != 86 || wavData[11] != 69) { Log.Error("Invalid WAV header for '" + clipName + "' - not a WAVE file"); return null; } int num = BitConverter.ToInt16(wavData, 22); int num2 = BitConverter.ToInt32(wavData, 24); int num3 = BitConverter.ToInt16(wavData, 34); Log.Debug($"WAV '{clipName}': {num} channels, {num2} Hz, {num3}-bit"); int num4 = -1; int num5 = 0; for (int i = 36; i < wavData.Length - 8; i++) { if (wavData[i] == 100 && wavData[i + 1] == 97 && wavData[i + 2] == 116 && wavData[i + 3] == 97) { num5 = BitConverter.ToInt32(wavData, i + 4); num4 = i + 8; break; } } if (num4 < 0) { Log.Error("Could not find data chunk in WAV '" + clipName + "'"); return null; } int num6 = num3 / 8; int num7 = num5 / num6 / num; if (num7 <= 0) { Log.Error("Invalid sample count for WAV '" + clipName + "'"); return null; } AudioClip val = AudioClip.Create(clipName, num7, num, num2, false); float[] array = new float[num7 * num]; switch (num3) { case 16: { for (int k = 0; k < array.Length; k++) { int num9 = num4 + k * 2; if (num9 + 1 < wavData.Length) { short num10 = BitConverter.ToInt16(wavData, num9); array[k] = (float)num10 / 32768f; } } break; } case 8: { for (int j = 0; j < array.Length; j++) { int num8 = num4 + j; if (num8 < wavData.Length) { array[j] = (float)(wavData[num8] - 128) / 128f; } } break; } default: Log.Error($"Unsupported bits per sample ({num3}) for WAV '{clipName}'"); return null; } val.SetData(array, 0); Log.Debug($"Created AudioClip '{clipName}': {num7} samples, {val.length:F2}s duration"); return val; } } [PublicAPI] public static class FsmUtil { public static void RemoveAction(this FsmState state, int index) { state.Actions = state.Actions.Where((FsmStateAction _, int ind) => ind != index).ToArray(); } public static void RemoveAction(this FsmState state) where T : FsmStateAction { state.Actions = state.Actions.RemoveFirst((FsmStateAction x) => x is T).ToArray(); } public static void RemoveAllOfType(this FsmState state) where T : FsmStateAction { state.Actions = state.Actions.Where((FsmStateAction x) => !(x is T)).ToArray(); } public static void RemoveAnim(this PlayMakerFSM fsm, string stateName, int index) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown //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_003a: 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_004d: Expected O, but got Unknown Tk2dPlayAnimationWithEvents action = fsm.GetAction(stateName, index); FsmEvent sendEvent = new FsmEvent(action.animationCompleteEvent ?? action.animationTriggerEvent); FsmState state = fsm.GetState(stateName); state.RemoveAction(index); state.InsertAction(index, (FsmStateAction)new NextFrameEvent { sendEvent = sendEvent, Active = true, Enabled = true }); } public static FsmState GetState(this PlayMakerFSM fsm, string stateName) { string stateName2 = stateName; return fsm.FsmStates.First((FsmState t) => t.Name == stateName2); } public static bool TryGetState(this PlayMakerFSM fsm, string stateName, [MaybeNullWhen(false)] out FsmState state) { string stateName2 = stateName; state = ((IEnumerable)fsm.FsmStates).FirstOrDefault((Func)((FsmState t) => t.Name == stateName2)); return state != null; } public static FsmState CopyState(this PlayMakerFSM fsm, string stateName, string newState) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: 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_004b: Expected O, but got Unknown FsmState state = fsm.GetState(stateName); FsmState val = new FsmState(state) { Name = newState, Transitions = ((IEnumerable)state.Transitions).Select((Func)((FsmTransition x) => new FsmTransition(x) { ToFsmState = x.ToFsmState })).ToArray() }; fsm.Fsm.States = fsm.FsmStates.Append(val).ToArray(); return val; } public static T GetAction(this FsmState state, int index) where T : FsmStateAction { return (T)(object)state.Actions[index]; } public static T GetAction(this PlayMakerFSM fsm, string stateName, int index) where T : FsmStateAction { return (T)(object)fsm.GetState(stateName).Actions[index]; } public static T GetAction(this FsmState state) where T : FsmStateAction { return state.Actions.OfType().First(); } public static T GetAction(this PlayMakerFSM fsm, string stateName) where T : FsmStateAction { return fsm.GetState(stateName).GetAction(); } public static void AddAction(this FsmState state, FsmStateAction action) { state.Actions = state.Actions.Append(action).ToArray(); action.Init(state); } public static void InsertAction(this FsmState state, int index, FsmStateAction action) { state.Actions = state.Actions.Insert(index, action).ToArray(); action.Init(state); } public static void ChangeTransition(this PlayMakerFSM self, string state, string eventName, string toState) { self.GetState(state).ChangeTransition(eventName, toState); } public static void ChangeTransition(this FsmState state, string eventName, string toState) { string eventName2 = eventName; state.Transitions.First((FsmTransition tr) => tr.EventName == eventName2).ToFsmState = state.Fsm.FsmComponent.GetState(toState); } public static void AddTransition(this FsmState state, FsmEvent @event, string toState) { //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_0013: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown state.Transitions = state.Transitions.Append(new FsmTransition { FsmEvent = @event, ToFsmState = state.Fsm.GetState(toState) }).ToArray(); } [PublicAPI] public static void AddTransition(this FsmState state, string eventName, string toState) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) state.AddTransition((FsmEvent)(((object)FsmEvent.GetFsmEvent(eventName)) ?? ((object)new FsmEvent(eventName))), toState); } [PublicAPI] public static void RemoveTransition(this FsmState state, string transition) { string transition2 = transition; state.Transitions = state.Transitions.Where((FsmTransition trans) => transition2 != trans.ToFsmState.Name).ToArray(); } [PublicAPI] public static void AddCoroutine(this FsmState state, Func method) { state.InsertCoroutine(state.Actions.Length, method); } [PublicAPI] public static void AddMethod(this FsmState state, Action method) { state.InsertMethod(state.Actions.Length, method); } [PublicAPI] public static void InsertMethod(this FsmState state, int index, Action method) { state.InsertAction(index, (FsmStateAction)(object)new InvokeMethod(method)); } [PublicAPI] public static void InsertCoroutine(this FsmState state, int index, Func coro, bool wait = true) { state.InsertAction(index, (FsmStateAction)(object)new InvokeCoroutine(coro, wait)); } [PublicAPI] public static FsmInt GetOrCreateInt(this PlayMakerFSM fsm, string intName) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown string intName2 = intName; FsmInt val = ((IEnumerable)fsm.FsmVariables.IntVariables).FirstOrDefault((Func)((FsmInt x) => ((NamedVariable)x).Name == intName2)); if (val != null) { return val; } FsmInt val2 = new FsmInt(intName2); fsm.FsmVariables.IntVariables = fsm.FsmVariables.IntVariables.Append(val2).ToArray(); return val2; } [PublicAPI] public static FsmBool CreateBool(this PlayMakerFSM fsm, string boolName) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown FsmBool val = new FsmBool(boolName); fsm.FsmVariables.BoolVariables = fsm.FsmVariables.BoolVariables.Append(val).ToArray(); return val; } [PublicAPI] public static void AddToSendRandomEventV3(this SendRandomEventV3 sre, string toState, float weight, int eventMaxAmount, int missedMaxAmount, string? eventName = null, bool createInt = true) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown string eventName2 = eventName; PlayMakerFSM fsm = (PlayMakerFSM)((FsmStateAction)sre).Fsm.Owner; string name = ((FsmStateAction)sre).State.Name; if (eventName2 == null) { eventName2 = toState.Split(' ').First(); } fsm.GetState(name).AddTransition(eventName2, toState); sre.events = sre.events.Append(fsm.GetState(name).Transitions.Single((FsmTransition x) => x.FsmEvent.Name == eventName2).FsmEvent).ToArray(); sre.weights = sre.weights.Append(FsmFloat.op_Implicit(weight)).ToArray(); sre.trackingInts = sre.trackingInts.Append(fsm.GetOrCreateInt("Ms " + eventName2)).ToArray(); sre.eventMax = sre.eventMax.Append(FsmInt.op_Implicit(eventMaxAmount)).ToArray(); sre.trackingIntsMissed = sre.trackingIntsMissed.Append(fsm.GetOrCreateInt("Ct " + eventName2)).ToArray(); sre.missedMax = sre.missedMax.Append(FsmInt.op_Implicit(missedMaxAmount)).ToArray(); } [PublicAPI] public static FsmState CreateState(this PlayMakerFSM fsm, string stateName) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected O, but got Unknown FsmState val = new FsmState(fsm.Fsm) { Name = stateName }; fsm.Fsm.States = fsm.FsmStates.Append(val).ToArray(); return val; } } public class InvokeCoroutine : FsmStateAction { [CompilerGenerated] private sealed class d__3 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public InvokeCoroutine <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__3(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { int num = <>1__state; InvokeCoroutine invokeCoroutine = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <>2__current = invokeCoroutine._coroutine(); <>1__state = 1; return true; case 1: <>1__state = -1; ((FsmStateAction)invokeCoroutine).Finish(); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private readonly Func _coroutine; private readonly bool _wait; public InvokeCoroutine(Func coroutine, bool wait) { _coroutine = coroutine; _wait = wait; } [IteratorStateMachine(typeof(d__3))] private IEnumerator Coroutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__3(0) { <>4__this = this }; } public override void OnEnter() { ((FsmStateAction)this).Fsm.Owner.StartCoroutine(_wait ? Coroutine() : _coroutine()); if (!_wait) { ((FsmStateAction)this).Finish(); } } } public class InvokeMethod : FsmStateAction { private readonly Action _action; public InvokeMethod(Action action) { _action = action; } public override void OnEnter() { _action(); ((FsmStateAction)this).Finish(); } } internal static class Log { private static ManualLogSource? _logSource; private static string LogPrefix => $"[{Assembly.GetExecutingAssembly().GetName().Version}] "; internal static void Init(ManualLogSource logSource) { _logSource = logSource; } internal static void Debug(object debug) { ManualLogSource? logSource = _logSource; if (logSource != null) { logSource.LogDebug((object)(LogPrefix + debug)); } } internal static void Error(object error) { ManualLogSource? logSource = _logSource; if (logSource != null) { logSource.LogError((object)(LogPrefix + error)); } } internal static void Fatal(object fatal) { ManualLogSource? logSource = _logSource; if (logSource != null) { logSource.LogFatal((object)(LogPrefix + fatal)); } } internal static void Info(object info) { ManualLogSource? logSource = _logSource; if (logSource != null) { logSource.LogInfo((object)(LogPrefix + info)); } } internal static void Message(object message) { ManualLogSource? logSource = _logSource; if (logSource != null) { logSource.LogMessage((object)(LogPrefix + message)); } } internal static void Warn(object warning) { ManualLogSource? logSource = _logSource; if (logSource != null) { logSource.LogWarning((object)(LogPrefix + warning)); } } } [BepInPlugin("AwakenedGrandMotherSilk", "AwakenedGrandMotherSilk", "1.0.4")] public class Plugin : BaseUnityPlugin { [CompilerGenerated] private sealed class d__7 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Type silkbossType; public Plugin <>4__this; private bool 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__7(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0028: 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_00cc: Expected O, but got Unknown int num = <>1__state; Plugin plugin = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; 5__2 = false; break; case 1: <>1__state = -1; break; } if (!5__2) { try { Language.CurrentLanguage(); 5__2 = true; } catch { } <>2__current = null; <>1__state = 1; return true; } MethodInfo method = silkbossType.GetMethod("PatchBossTitle", BindingFlags.Static | BindingFlags.NonPublic); if (method != null) { MethodInfo method2 = typeof(Language).GetMethod("Get", new Type[2] { typeof(string), typeof(string) }); if (method2 != null) { plugin._harmony.Patch((MethodBase)method2, (HarmonyMethod)null, new HarmonyMethod(method), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); Log.Info("PatchBossTitle applied to Language.Get (deferred)"); } IEnumerable patchedMethods = plugin._harmony.GetPatchedMethods(); int num2 = 0; foreach (MethodBase item in patchedMethods) { Log.Info("Patched: " + item.DeclaringType?.Name + "." + item.Name); num2++; } Log.Info($"Total patches applied: {num2}"); } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public const string PLUGIN_GUID = "AwakenedGrandMotherSilk"; public const string PLUGIN_NAME = "AwakenedGrandMotherSilk"; public const string PLUGIN_VERSION = "1.0.4"; private Harmony _harmony; private const string BUILD_ID = "BUILD_2025_01_25_A"; private void Awake() { //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Expected O, but got Unknown //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Expected O, but got Unknown Log.Init(((BaseUnityPlugin)this).Logger); Log.Info("Awakened GMS mod loading... [BUILD_2025_01_25_A]"); Log.Info(">>> Step 1: Loading textures..."); try { AssetManager.LoadTextures(); Log.Info(">>> Step 1: Textures loaded successfully"); } catch (Exception arg) { Log.Error($">>> Step 1 FAILED: {arg}"); } Log.Info(">>> Step 2: Loading audio clips..."); try { AssetManager.LoadAudioClips(); Log.Info(">>> Step 2: Audio clips loaded successfully"); } catch (Exception arg2) { Log.Error($">>> Step 2 FAILED: {arg2}"); } _harmony = new Harmony("AwakenedGrandMotherSilk"); Log.Info(">>> Step 3: Attempting to manually patch..."); try { Type type = Assembly.GetExecutingAssembly().GetType("Awakened_Grand_Mother_Silk.Source.Patches.SilkbossPatches"); if (type != null) { Log.Info("Found SilkbossPatches, manually patching methods..."); MethodInfo method = type.GetMethod("ModifySilkboss", BindingFlags.Static | BindingFlags.NonPublic); if (method != null) { _harmony.Patch((MethodBase)typeof(PlayMakerFSM).GetMethod("Start", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic), new HarmonyMethod(method), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); Log.Info("ModifySilkboss applied"); } new Harmony("AwakenedGrandMotherSilk").PatchAll(typeof(SilkbossPatches).Assembly); } } catch (Exception arg3) { Log.Error($"Manual patching failed: {arg3}"); } } private void Start() { Log.Info("Plugin Start() called, beginning deferred language patch..."); try { Type type = Assembly.GetExecutingAssembly().GetType("Awakened_Grand_Mother_Silk.Source.Patches.SilkbossPatches"); if (type != null) { ((MonoBehaviour)this).StartCoroutine(DeferredLanguagePatch(type)); } } catch (Exception arg) { Log.Error($"Failed to start deferred language patch: {arg}"); } } [IteratorStateMachine(typeof(d__7))] private IEnumerator DeferredLanguagePatch(Type silkbossType) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__7(0) { <>4__this = this, silkbossType = silkbossType }; } private void OnDestroy() { _harmony.UnpatchSelf(); AssetManager.UnloadAll(); } } } namespace Awakened_Grand_Mother_Silk.Source.Patches { internal static class DebugPatches { [HarmonyPrefix] [HarmonyPatch(typeof(HeroController), "Awake")] private static void ForceInvincible() { CheatManager.Invincibility = (InvincibilityStates)3; } } internal static class MainPatches { [CompilerGenerated] private sealed class d__2 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IEnumerator result; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__2(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; break; case 1: <>1__state = -1; break; } if (result.MoveNext()) { <>2__current = result.Current; <>1__state = 1; return true; } _harmony.UnpatchSelf(); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static Harmony _harmony; internal static void Initialize() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Expected O, but got Unknown _harmony = new Harmony("MainPatches"); } [IteratorStateMachine(typeof(d__2))] private static IEnumerator UnpatchSilkboss(IEnumerator result) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__2(0) { result = result }; } } internal static class SilkbossPatches { public static class StateWatcher { private class WatchData { public PlayMakerFSM? Fsm; public string? LastState; public Action? Callback; } private class WatcherUpdater : MonoBehaviour { private void Update() { for (int i = 0; i < watchers.Count; i++) { WatchData watchData = watchers[i]; if ((Object)(object)watchData.Fsm == (Object)null) { watchers.RemoveAt(i); i--; continue; } string activeStateName = watchData.Fsm.ActiveStateName; if (activeStateName != watchData.LastState) { watchData.LastState = activeStateName; watchData.Callback?.Invoke(); } } } } private static readonly List watchers = new List(); private static bool hooked = false; public static void Watch(PlayMakerFSM fsm, Action callback) { //IL_006b: Unknown result type (might be due to invalid IL or missing references) PlayMakerFSM fsm2 = fsm; if (!watchers.Exists((WatchData w) => (Object)(object)w.Fsm == (Object)(object)fsm2)) { watchers.Add(new WatchData { Fsm = fsm2, LastState = fsm2.ActiveStateName, Callback = callback }); if (!hooked) { hooked = true; new GameObject("FSMStateWatcher").AddComponent(); } } } } private static readonly HashSet loggedKeys = new HashSet(); [HarmonyPrefix] [HarmonyPatch(typeof(PlayMakerFSM), "Start")] private static void ModifySilkboss(PlayMakerFSM __instance) { if (((Object)__instance).name == "Silk Boss" && __instance.FsmName == "Control" && ((Component)__instance).gameObject.layer == LayerMask.NameToLayer("Enemies") && (Object)(object)((Component)__instance).gameObject.GetComponent() == (Object)null) { ((Component)__instance).gameObject.AddComponent(); } else if (__instance.FsmName == "Hand Control" && (Object)(object)((Component)__instance).gameObject.GetComponent() == (Object)null) { Log.Info("SilkbossPatches: Found Hand Control FSM on " + ((Object)((Component)__instance).gameObject).name); ((Component)__instance).gameObject.AddComponent(); } } private static void PatchBossTitle(string key, string sheetTitle, ref string __result) { if (key == "SILK_SUPER" || key == "SILK_MAIN") { __result = " "; Log.Info("[PatchBossTitle] Modified result for key=" + key); } } } } namespace Awakened_Grand_Mother_Silk.Source.Behaviours { internal static class BossAnimation { private struct FrameDefinition { public int X; public int Y; public int Width; public int Height; public int AnchorX; public int AnchorY; public FrameDefinition(int x, int y, int width, int height, int anchorX, int anchorY) { X = x; Y = y; Width = width; Height = height; AnchorX = anchorX; AnchorY = anchorY; } } internal const string NUKE_SUMMON_CLIP = "Nuke Summon"; private static tk2dSpriteAnimator? _bossAnimator; private static tk2dSpriteCollectionData? _spriteCollection; private static bool _initialized = false; private static int _nukeSummonStartId = -1; private static int _nukeSummonFrameCount = 20; private const int ATLAS3_WIDTH = 4096; private const int ATLAS3_HEIGHT = 4096; private const int ATLAS3_MATERIAL_ID = 3; private static readonly FrameDefinition[] NukeSummonFrames = new FrameDefinition[15] { new FrameDefinition(369, 0, 369, 958, 211, 479), new FrameDefinition(0, 0, 369, 958, 213, 479), new FrameDefinition(1510, 0, 369, 958, 208, 479), new FrameDefinition(0, 963, 491, 958, 323, 479), new FrameDefinition(490, 963, 491, 958, 314, 479), new FrameDefinition(968, 963, 491, 958, 314, 483), new FrameDefinition(1450, 963, 491, 958, 314, 482), new FrameDefinition(1930, 963, 491, 958, 322, 482), new FrameDefinition(2420, 963, 491, 958, 321, 482), new FrameDefinition(2908, 963, 491, 958, 324, 483), new FrameDefinition(0, 963, 491, 958, 323, 479), new FrameDefinition(490, 963, 491, 958, 314, 479), new FrameDefinition(1107, 0, 369, 958, 210, 483), new FrameDefinition(1915, 0, 373, 958, 206, 484), new FrameDefinition(738, 0, 369, 958, 208, 483) }; internal static void Reset() { _bossAnimator = null; _spriteCollection = null; _initialized = false; _nukeSummonStartId = -1; } internal static void Initialize(tk2dSpriteAnimator bossAnimator) { _bossAnimator = bossAnimator; tk2dSprite component = ((Component)bossAnimator).GetComponent(); if ((Object)(object)component != (Object)null) { _spriteCollection = ((tk2dBaseSprite)component).Collection; for (int i = 0; i < _spriteCollection.materials.Length; i++) { _ = _spriteCollection.materials[i]; } int num = FindExistingNukeSummonSprite(); if (num >= 0) { _nukeSummonStartId = num; } else { AddNukeSummonSpriteDefinitions(); } _initialized = true; EnsureNukeSummonClipInAnimator(); } else { Log.Error("CustomAnimations: Could not get tk2dSprite component from animator"); } } private static int FindExistingNukeSummonSprite() { if ((Object)(object)_spriteCollection == (Object)null) { return -1; } for (int i = 0; i < _spriteCollection.spriteDefinitions.Length; i++) { tk2dSpriteDefinition val = _spriteCollection.spriteDefinitions[i]; if (val != null && val.name == "nuke_summon_00") { return i; } } return -1; } private static void EnsureNukeSummonClipInAnimator() { if ((Object)(object)_bossAnimator == (Object)null) { Log.Error("CustomAnimations: Cannot ensure clip - animator is null"); return; } if ((Object)(object)_bossAnimator.Library == (Object)null) { Log.Error("CustomAnimations: Cannot ensure clip - animator Library is null"); return; } if (_nukeSummonStartId < 0) { Log.Error("CustomAnimations: Cannot ensure clip - sprite definitions not added yet"); return; } tk2dSpriteAnimationClip val = FindClipByName("Nuke Summon"); if (val != null && val.frames != null && val.frames.Length != 0) { tk2dSpriteAnimationFrame val2 = val.frames[0]; if ((Object)(object)val2.spriteCollection == (Object)(object)_spriteCollection && val2.spriteId == _nukeSummonStartId) { return; } RemoveClipFromLibrary("Nuke Summon"); } AddNukeSummonClip(); } private static void RemoveClipFromLibrary(string clipName) { string clipName2 = clipName; tk2dSpriteAnimator? bossAnimator = _bossAnimator; if (!((Object)(object)((bossAnimator != null) ? bossAnimator.Library : null) == (Object)null)) { tk2dSpriteAnimationClip[] clips = _bossAnimator.Library.clips.Where((tk2dSpriteAnimationClip c) => c == null || c.name != clipName2).ToArray(); _bossAnimator.Library.clips = clips; Log.Info("CustomAnimations: Removed clip '" + clipName2 + "' from Library"); } } private static void AddNukeSummonSpriteDefinitions() { //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Expected O, but got Unknown //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Expected O, but got Unknown if ((Object)(object)_spriteCollection == (Object)null) { Log.Error("CustomAnimations: Cannot add sprite definitions - collection is null"); return; } tk2dSpriteDefinition[] spriteDefinitions = _spriteCollection.spriteDefinitions; int num = spriteDefinitions.Length; int num2 = 3; Material val = null; if (num2 < _spriteCollection.materials.Length) { val = _spriteCollection.materials[num2]; } else { Texture2D val2 = AssetManager.Get("atlas3"); if ((Object)(object)val2 == (Object)null) { Log.Error("CustomAnimations: atlas3 texture not found!"); return; } Material val3 = ((IEnumerable)_spriteCollection.materials).FirstOrDefault((Func)((Material m) => (Object)(object)m != (Object)null)); if ((Object)(object)val3 != (Object)null) { val = new Material(val3.shader); val.CopyPropertiesFromMaterial(val3); } else { val = new Material(Shader.Find("Sprites/Default")); } val.mainTexture = (Texture)(object)val2; ((Object)val).name = "atlas3"; Material[] array = (Material[])(object)new Material[num2 + 1]; for (int i = 0; i < _spriteCollection.materials.Length; i++) { array[i] = _spriteCollection.materials[i]; } array[num2] = val; _spriteCollection.materials = array; if (_spriteCollection.materialInsts != null) { Material[] array2 = (Material[])(object)new Material[num2 + 1]; for (int j = 0; j < _spriteCollection.materialInsts.Length; j++) { array2[j] = _spriteCollection.materialInsts[j]; } array2[num2] = val; _spriteCollection.materialInsts = array2; } } int? obj; if (val == null) { obj = null; } else { Texture mainTexture = val.mainTexture; obj = ((mainTexture != null) ? new int?(mainTexture.width) : null); } int? num3 = obj; float num4 = num3.GetValueOrDefault(4096); int? obj2; if (val == null) { obj2 = null; } else { Texture mainTexture2 = val.mainTexture; obj2 = ((mainTexture2 != null) ? new int?(mainTexture2.height) : null); } num3 = obj2; float num5 = num3.GetValueOrDefault(4096); if (num4 != 4096f || num5 != 4096f) { Log.Error($"CustomAnimations: Texture size ({num4}x{num5}) differs from constants ({4096}x{4096})!"); } _nukeSummonStartId = num; _nukeSummonFrameCount = NukeSummonFrames.Length; tk2dSpriteDefinition[] array3 = (tk2dSpriteDefinition[])(object)new tk2dSpriteDefinition[num + _nukeSummonFrameCount]; for (int k = 0; k < num; k++) { array3[k] = spriteDefinitions[k]; } for (int l = 0; l < _nukeSummonFrameCount; l++) { FrameDefinition frameDefinition = NukeSummonFrames[l]; int num6 = _nukeSummonStartId + l; float uvX = (float)frameDefinition.X / num4; float uvY = (float)frameDefinition.Y / num5; float uvW = (float)frameDefinition.Width / num4; float uvH = (float)frameDefinition.Height / num5; array3[num6] = CreateSpriteDefinition($"nuke_summon_{l:D2}", num2, uvX, uvY, uvW, uvH, frameDefinition.Width, frameDefinition.Height, frameDefinition.AnchorX, frameDefinition.AnchorY); array3[num6].material = val; array3[num6].materialInst = val; } _spriteCollection.spriteDefinitions = array3; } private static tk2dSpriteDefinition CreateSpriteDefinition(string name, int materialId, float uvX, float uvY, float uvW, float uvH, float pixelWidth, float pixelHeight, float anchorX, float anchorY) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: 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_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: 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_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_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_016f: 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) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_018d: 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_0199: 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_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) float num = 0.0157f; float num2 = (0f - anchorX) * num; float num3 = (pixelWidth - anchorX) * num; float num4 = (0f - anchorY) * num; float num5 = (pixelHeight - anchorY) * num; tk2dSpriteDefinition val = new tk2dSpriteDefinition(); val.name = name; val.materialId = materialId; val.positions = (Vector3[])(object)new Vector3[4] { new Vector3(num2, num4, 0f), new Vector3(num3, num4, 0f), new Vector3(num2, num5, 0f), new Vector3(num3, num5, 0f) }; val.uvs = (Vector2[])(object)new Vector2[4] { new Vector2(uvX, uvY), new Vector2(uvX + uvW, uvY), new Vector2(uvX, uvY + uvH), new Vector2(uvX + uvW, uvY + uvH) }; val.indices = new int[6] { 0, 2, 1, 2, 3, 1 }; val.boundsData = (Vector3[])(object)new Vector3[2] { new Vector3(0f, 0f, 0f), new Vector3(num3 - num2, num5 - num4, 0f) }; val.untrimmedBoundsData = (Vector3[])(object)new Vector3[2] { new Vector3(0f, 0f, 0f), new Vector3(num3 - num2, num5 - num4, 0f) }; val.normals = (Vector3[])(object)new Vector3[4] { Vector3.back, Vector3.back, Vector3.back, Vector3.back }; val.tangents = (Vector4[])(object)new Vector4[4] { new Vector4(1f, 0f, 0f, 1f), new Vector4(1f, 0f, 0f, 1f), new Vector4(1f, 0f, 0f, 1f), new Vector4(1f, 0f, 0f, 1f) }; return val; } private static void AddNukeSummonClip() { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0058: 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_0065: 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_007b: Expected O, but got Unknown //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Expected O, but got Unknown if ((Object)(object)_bossAnimator == (Object)null) { Log.Error("CustomAnimations: Cannot add Nuke Summon clip - animator is null"); return; } if ((Object)(object)_bossAnimator.Library == (Object)null) { Log.Error("CustomAnimations: Cannot add Nuke Summon clip - animator Library is null"); return; } if (_nukeSummonStartId < 0) { Log.Error("CustomAnimations: Cannot add Nuke Summon clip - sprite IDs not set"); return; } tk2dSpriteAnimationClip val = new tk2dSpriteAnimationClip { name = "Nuke Summon", fps = 13f, wrapMode = (WrapMode)2, frames = (tk2dSpriteAnimationFrame[])(object)new tk2dSpriteAnimationFrame[_nukeSummonFrameCount] }; for (int i = 0; i < _nukeSummonFrameCount; i++) { val.frames[i] = new tk2dSpriteAnimationFrame { spriteId = _nukeSummonStartId + i, spriteCollection = _spriteCollection }; } tk2dSpriteAnimationClip[] clips = _bossAnimator.Library.clips; _bossAnimator.Library.clips = clips.Append(val).ToArray(); } private static tk2dSpriteAnimationClip? FindClipByName(string clipName) { tk2dSpriteAnimator? bossAnimator = _bossAnimator; if (((bossAnimator == null) ? null : bossAnimator.Library?.clips) == null) { return null; } tk2dSpriteAnimationClip[] clips = _bossAnimator.Library.clips; foreach (tk2dSpriteAnimationClip val in clips) { if (val != null && !string.IsNullOrEmpty(val.name) && val.name == clipName) { return val; } } return null; } internal static void PlayNukeSummon() { if ((Object)(object)_bossAnimator == (Object)null) { Log.Error("CustomAnimations: Cannot play animation - _bossAnimator is null"); return; } if ((Object)(object)((Component)_bossAnimator).gameObject == (Object)null) { Log.Error("CustomAnimations: Cannot play animation - animator's gameObject is null (object was destroyed?)"); _bossAnimator = null; return; } if ((Object)(object)_bossAnimator.Library == (Object)null) { Log.Error("CustomAnimations: Cannot play animation - animator Library is null"); return; } tk2dSpriteAnimationClip val = FindClipByName("Nuke Summon"); if (val == null) { Log.Error("CustomAnimations: Clip 'Nuke Summon' not found in Library!"); tk2dSpriteAnimationClip[] clips = _bossAnimator.Library.clips; Log.Error($" Library has {((clips != null) ? clips.Length : 0)} clips:"); if (_bossAnimator.Library.clips != null) { for (int i = 0; i < _bossAnimator.Library.clips.Length; i++) { tk2dSpriteAnimationClip val2 = _bossAnimator.Library.clips[i]; Log.Error(string.Format(" [{0}] - '{1}'", i, val2?.name ?? "NULL")); } } } else { _bossAnimator.Play(val); } } internal static float GetNukeSummonDuration() { tk2dSpriteAnimator? bossAnimator = _bossAnimator; if ((Object)(object)((bossAnimator != null) ? bossAnimator.Library : null) == (Object)null) { return 1f; } tk2dSpriteAnimationClip val = FindClipByName("Nuke Summon"); if (val == null || val.frames == null || val.frames.Length == 0) { return 1f; } return (float)val.frames.Length / val.fps; } internal static bool IsPlayingNukeSummon() { if ((Object)(object)_bossAnimator == (Object)null) { return false; } tk2dSpriteAnimationClip currentClip = _bossAnimator.CurrentClip; if (currentClip != null) { return currentClip.name == "Nuke Summon"; } return false; } internal static bool IsReady() { if ((Object)(object)_bossAnimator == (Object)null) { return false; } if ((Object)(object)((Component)_bossAnimator).gameObject == (Object)null) { return false; } if ((Object)(object)_bossAnimator.Library == (Object)null) { return false; } if (_nukeSummonStartId < 0) { return false; } return _initialized; } } internal class BossShieldAnimation : MonoBehaviour { [CompilerGenerated] private sealed class d__38 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public BossShieldAnimation <>4__this; private float 5__2; private int 5__3; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__38(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Expected O, but got Unknown //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Expected O, but got Unknown //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Expected O, but got Unknown int num = <>1__state; BossShieldAnimation bossShieldAnimation = <>4__this; float num2; switch (num) { default: return false; case 0: <>1__state = -1; bossShieldAnimation._isAnimating = true; <>2__current = (object)new WaitForSeconds(0.9f); <>1__state = 1; return true; case 1: <>1__state = -1; 5__2 = 0.3f; 5__3 = 0; goto IL_00f0; case 2: <>1__state = -1; goto IL_00de; case 3: { <>1__state = -1; bossShieldAnimation._isAnimating = false; bossShieldAnimation._frameCoroutines.Clear(); Log.Info("BossShieldAnimation: Animation sequence complete"); return false; } IL_00f0: if (5__3 < 6) { if (!bossShieldAnimation._isAnimating || bossShieldAnimation._isCancelling) { return false; } SpriteRenderer[]? shieldRenderers = bossShieldAnimation._shieldRenderers; SpriteRenderer val = ((shieldRenderers != null) ? shieldRenderers[5__3] : null); if (!((Object)(object)val == (Object)null)) { Coroutine item = ((MonoBehaviour)bossShieldAnimation).StartCoroutine(bossShieldAnimation.FrameSequence(val, 5__3)); bossShieldAnimation._frameCoroutines.Add(item); <>2__current = (object)new WaitForSeconds(5__2); <>1__state = 2; return true; } goto IL_00de; } num2 = 2.9999998f; <>2__current = (object)new WaitForSeconds(num2); <>1__state = 3; return true; IL_00de: 5__3++; goto IL_00f0; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__37 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public BossShieldAnimation <>4__this; private float 5__2; private float[] 5__3; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__37(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__3 = null; <>1__state = -2; } private bool MoveNext() { //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) int num = <>1__state; BossShieldAnimation bossShieldAnimation = <>4__this; switch (num) { default: return false; case 0: { <>1__state = -1; Log.Info("BossShieldAnimation: Starting cancel fade out"); 5__2 = 0f; 5__3 = new float[6]; if (bossShieldAnimation._shieldRenderers == null) { break; } for (int i = 0; i < bossShieldAnimation._shieldRenderers.Length; i++) { if ((Object)(object)bossShieldAnimation._shieldRenderers[i] != (Object)null) { 5__3[i] = bossShieldAnimation._shieldRenderers[i].color.a; } } break; } case 1: <>1__state = -1; break; } if (5__2 < 0.2f) { 5__2 += Time.deltaTime; float num2 = Mathf.Clamp01(5__2 / 0.2f); if (bossShieldAnimation._shieldRenderers != null) { for (int j = 0; j < bossShieldAnimation._shieldRenderers.Length; j++) { if ((Object)(object)bossShieldAnimation._shieldRenderers[j] != (Object)null) { float num3 = Mathf.Lerp(5__3[j], 0f, num2); bossShieldAnimation._shieldRenderers[j].color = new Color(1f, 1f, 1f, num3); } } } <>2__current = null; <>1__state = 1; return true; } if (bossShieldAnimation._shieldRenderers != null) { SpriteRenderer[] shieldRenderers = bossShieldAnimation._shieldRenderers; foreach (SpriteRenderer val in shieldRenderers) { if ((Object)(object)val != (Object)null) { val.color = new Color(1f, 1f, 1f, 0f); } } } bossShieldAnimation._isAnimating = false; bossShieldAnimation._isCancelling = false; Log.Info("BossShieldAnimation: Cancel fade out complete"); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__39 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public BossShieldAnimation <>4__this; public SpriteRenderer renderer; private float 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__39(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_02bb: Unknown result type (might be due to invalid IL or missing references) //IL_03c6: Unknown result type (might be due to invalid IL or missing references) //IL_04da: Unknown result type (might be due to invalid IL or missing references) //IL_05f0: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0273: Unknown result type (might be due to invalid IL or missing references) //IL_037b: Unknown result type (might be due to invalid IL or missing references) //IL_048f: Unknown result type (might be due to invalid IL or missing references) //IL_05a4: Unknown result type (might be due to invalid IL or missing references) int num = <>1__state; BossShieldAnimation bossShieldAnimation = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; 5__2 = 0f; goto IL_00d2; case 1: <>1__state = -1; goto IL_00d2; case 2: <>1__state = -1; goto IL_018f; case 3: <>1__state = -1; goto IL_020b; case 4: <>1__state = -1; goto IL_0294; case 5: <>1__state = -1; goto IL_030d; case 6: <>1__state = -1; goto IL_039c; case 7: <>1__state = -1; goto IL_0418; case 8: <>1__state = -1; goto IL_04b0; case 9: <>1__state = -1; goto IL_052d; case 10: { <>1__state = -1; break; } IL_00d2: if (5__2 < 0.3f) { if (!bossShieldAnimation._isAnimating || bossShieldAnimation._isCancelling) { return false; } 5__2 += Time.deltaTime; float num2 = Mathf.Lerp(0f, 0.7f, Mathf.Clamp01(5__2 / 0.3f)); renderer.color = new Color(1f, 1f, 1f, num2); <>2__current = null; <>1__state = 1; return true; } renderer.color = new Color(1f, 1f, 1f, 0.7f); 5__2 = 0f; goto IL_018f; IL_039c: if (5__2 < 0.4f) { if (!bossShieldAnimation._isAnimating || bossShieldAnimation._isCancelling) { return false; } 5__2 += Time.deltaTime; float num3 = 1f - Mathf.Clamp01(5__2 / 0.4f); renderer.color = new Color(1f, 1f, 1f, num3); <>2__current = null; <>1__state = 6; return true; } renderer.color = new Color(1f, 1f, 1f, 0f); 5__2 = 0f; goto IL_0418; IL_018f: if (5__2 < 0.3f) { if (!bossShieldAnimation._isAnimating || bossShieldAnimation._isCancelling) { return false; } 5__2 += Time.deltaTime; float num4 = Mathf.Lerp(0.7f, 0f, Mathf.Clamp01(5__2 / 0.3f)); renderer.color = new Color(1f, 1f, 1f, num4); <>2__current = null; <>1__state = 2; return true; } renderer.color = new Color(1f, 1f, 1f, 0f); 5__2 = 0f; goto IL_020b; IL_052d: if (5__2 < 0.25f) { if (!bossShieldAnimation._isAnimating || bossShieldAnimation._isCancelling) { return false; } 5__2 += Time.deltaTime; <>2__current = null; <>1__state = 9; return true; } 5__2 = 0f; break; IL_020b: if (5__2 < 0.3f) { if (!bossShieldAnimation._isAnimating || bossShieldAnimation._isCancelling) { return false; } 5__2 += Time.deltaTime; <>2__current = null; <>1__state = 3; return true; } 5__2 = 0f; goto IL_0294; IL_0294: if (5__2 < 0.3f) { if (!bossShieldAnimation._isAnimating || bossShieldAnimation._isCancelling) { return false; } 5__2 += Time.deltaTime; float num5 = Mathf.Clamp01(5__2 / 0.3f); renderer.color = new Color(1f, 1f, 1f, num5); <>2__current = null; <>1__state = 4; return true; } renderer.color = new Color(1f, 1f, 1f, 1f); 5__2 = 0f; goto IL_030d; IL_04b0: if (5__2 < 0.3f) { if (!bossShieldAnimation._isAnimating || bossShieldAnimation._isCancelling) { return false; } 5__2 += Time.deltaTime; float num6 = Mathf.Lerp(0f, 0.7f, Mathf.Clamp01(5__2 / 0.3f)); renderer.color = new Color(1f, 1f, 1f, num6); <>2__current = null; <>1__state = 8; return true; } renderer.color = new Color(1f, 1f, 1f, 0.7f); 5__2 = 0f; goto IL_052d; IL_030d: if (5__2 < 0.3f) { if (!bossShieldAnimation._isAnimating || bossShieldAnimation._isCancelling) { return false; } 5__2 += Time.deltaTime; <>2__current = null; <>1__state = 5; return true; } 5__2 = 0f; goto IL_039c; IL_0418: if (5__2 < 0.5f) { if (!bossShieldAnimation._isAnimating || bossShieldAnimation._isCancelling) { return false; } 5__2 += Time.deltaTime; <>2__current = null; <>1__state = 7; return true; } 5__2 = 0f; goto IL_04b0; } if (5__2 < 0.35f) { if (!bossShieldAnimation._isAnimating || bossShieldAnimation._isCancelling) { return false; } 5__2 += Time.deltaTime; float num7 = Mathf.Lerp(0.7f, 0f, Mathf.Clamp01(5__2 / 0.35f)); renderer.color = new Color(1f, 1f, 1f, num7); <>2__current = null; <>1__state = 10; return true; } renderer.color = new Color(1f, 1f, 1f, 0f); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private const float CAST_ANIMATION_DELAY = 0.9f; private const float SHIELD_SCALE = 1f; private const float PRE_FLASH_FADE_IN_DURATION = 0.3f; private const float PRE_FLASH_ALPHA = 0.7f; private const float PRE_FLASH_FADE_OUT_DURATION = 0.3f; private const float PRE_TO_MAIN_HOLD_DURATION = 0.3f; private const float MAIN_FADE_IN_DURATION = 0.3f; private const float MAIN_HOLD_DURATION = 0.3f; private const float MAIN_FADE_OUT_DURATION = 0.4f; private const float POST_FLASH_WAIT = 0.5f; private const float POST_FLASH_FADE_IN_DURATION = 0.3f; private const float POST_FLASH_ALPHA = 0.7f; private const float POST_FLASH_HOLD_DURATION = 0.25f; private const float POST_FLASH_FADE_OUT_DURATION = 0.35f; private const float CANCEL_FADE_OUT_DURATION = 0.2f; private const float OFFSET_X = 1.9f; private const float OFFSET_Y = -1f; private const int SHIELD_FRAME_COUNT = 6; private static Sprite[]? _shieldSprites; private static bool _spritesLoaded; private Transform? _bossTransform; private SpriteRenderer[]? _shieldRenderers; private Coroutine? _animationCoroutine; private List _frameCoroutines = new List(); private bool _isAnimating; private bool _isCancelling; private static BossShieldAnimation? _instance; internal static BossShieldAnimation? Instance => _instance; internal bool IsAnimating => _isAnimating; internal static void Initialize(GameObject bossObject) { if ((Object)(object)bossObject == (Object)null) { Log.Error("BossShieldAnimation: Cannot initialize - boss object is null"); return; } if (!_spritesLoaded) { LoadShieldSprites(); } _instance = bossObject.GetComponent(); if ((Object)(object)_instance == (Object)null) { _instance = bossObject.AddComponent(); } _instance._bossTransform = bossObject.transform; _instance.CreateShieldRenderers(); Log.Info("BossShieldAnimation: Initialized successfully"); } internal static void Reset() { if ((Object)(object)_instance != (Object)null) { _instance.StopAnimationImmediate(); _instance.DestroyShieldRenderers(); } _instance = null; Log.Info("BossShieldAnimation: Reset complete"); } private static void LoadShieldSprites() { //IL_004d: 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) _shieldSprites = (Sprite[]?)(object)new Sprite[6]; for (int i = 0; i < 6; i++) { Texture2D val = AssetManager.Get($"silk_boss_shield{i}"); if ((Object)(object)val != (Object)null) { _shieldSprites[i] = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f), 64f); } } _spritesLoaded = true; Log.Info($"BossShieldAnimation: Loaded {6} shield sprites"); } private void CreateShieldRenderers() { //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_0051: 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_0070: 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_0080: 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_0090: 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_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Expected O, but got Unknown DestroyShieldRenderers(); if (_shieldSprites == null) { Log.Error("BossShieldAnimation: Cannot create renderers - sprites not loaded"); return; } _shieldRenderers = (SpriteRenderer[]?)(object)new SpriteRenderer[6]; for (int i = 0; i < 6; i++) { GameObject val = new GameObject($"ShieldLayer_{i}"); val.transform.SetParent(((Component)this).transform); val.transform.localPosition = new Vector3(1.9f, -1f, 0f); val.transform.localRotation = Quaternion.identity; val.transform.localScale = Vector3.one * 1f; SpriteRenderer val2 = val.AddComponent(); val2.sprite = _shieldSprites[i]; ((Renderer)val2).sortingLayerName = "Default"; ((Renderer)val2).sortingOrder = 100 + i; val2.color = new Color(1f, 1f, 1f, 0f); ((Renderer)val2).material = new Material(Shader.Find("Sprites/Default")); ((Renderer)val2).material.SetInt("_SrcBlend", 5); ((Renderer)val2).material.SetInt("_DstBlend", 1); _shieldRenderers[i] = val2; } Log.Info($"BossShieldAnimation: Created {6} shield renderers"); } private void DestroyShieldRenderers() { if (_shieldRenderers == null) { return; } SpriteRenderer[] shieldRenderers = _shieldRenderers; foreach (SpriteRenderer val in shieldRenderers) { if ((Object)(object)val != (Object)null && (Object)(object)((Component)val).gameObject != (Object)null) { Object.Destroy((Object)(object)((Component)val).gameObject); } } _shieldRenderers = null; } internal void PlayAnimation() { if (_isAnimating) { Log.Info("BossShieldAnimation: Animation already playing, restarting"); StopAnimationImmediate(); } if (_shieldRenderers == null || _shieldSprites == null) { Log.Error("BossShieldAnimation: Cannot play renderers or sprites not initialized"); return; } _isCancelling = false; _animationCoroutine = ((MonoBehaviour)this).StartCoroutine(AnimationSequence()); Log.Info("BossShieldAnimation: Started animation sequence"); } internal void StopAnimation() { if (_isCancelling) { return; } if (_animationCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(_animationCoroutine); _animationCoroutine = null; } foreach (Coroutine frameCoroutine in _frameCoroutines) { if (frameCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(frameCoroutine); } } _frameCoroutines.Clear(); if (_isAnimating && _shieldRenderers != null) { _isCancelling = true; ((MonoBehaviour)this).StartCoroutine(CancelFadeOut()); } else { _isAnimating = false; } Log.Info("BossShieldAnimation: Stopping animation with fade out"); } private void StopAnimationImmediate() { //IL_00a5: Unknown result type (might be due to invalid IL or missing references) if (_animationCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(_animationCoroutine); _animationCoroutine = null; } foreach (Coroutine frameCoroutine in _frameCoroutines) { if (frameCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(frameCoroutine); } } _frameCoroutines.Clear(); _isAnimating = false; _isCancelling = false; if (_shieldRenderers != null) { SpriteRenderer[] shieldRenderers = _shieldRenderers; foreach (SpriteRenderer val in shieldRenderers) { if ((Object)(object)val != (Object)null) { val.color = new Color(1f, 1f, 1f, 0f); } } } Log.Info("BossShieldAnimation: Stopped animation immediately"); } [IteratorStateMachine(typeof(d__37))] private IEnumerator CancelFadeOut() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__37(0) { <>4__this = this }; } [IteratorStateMachine(typeof(d__38))] private IEnumerator AnimationSequence() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__38(0) { <>4__this = this }; } [IteratorStateMachine(typeof(d__39))] private IEnumerator FrameSequence(SpriteRenderer renderer, int frameIndex) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__39(0) { <>4__this = this, renderer = renderer }; } internal static void TriggerShieldAnimation() { if ((Object)(object)_instance != (Object)null) { _instance.PlayAnimation(); } else { Log.Warn("BossShieldAnimation: Cannot trigger instance is null"); } } internal static void StopShieldAnimation() { if ((Object)(object)_instance != (Object)null) { _instance.StopAnimation(); } } private void OnDestroy() { StopAnimationImmediate(); DestroyShieldRenderers(); if ((Object)(object)_instance == (Object)(object)this) { _instance = null; } } } internal class ExtraPins : MonoBehaviour { private const bool LogStateChanges = true; private const float BasicStompPinLXOffset = -1.3f; private const float BasicStompPinRXOffset = 1.3f; private const float BasicStompPinMXOffset = -1f; private const float BasicStompCloneXOffset = 3f; private const float BasicStompAfterSwipeRGroupOffset = 0f; private const float BasicStompAfterSwipeLGroupOffset = 0f; private const float StompAimLGroupXOffset = 1.8f; private const float StompAimRGroupXOffset = -1.8f; private const float DualStompPinLXOffset = 0f; private const float DualStompPinRXOffset = 0f; private const float DualStompPinMXOffset = -2f; private const float DualStompCloneXOffset = 3f; private const float StompDashLGroupXOffset = 1.8f; private const float StompDashRGroupXOffset = -1.8f; private const float DashStompPinLXOffset = 0f; private const float DashStompPinRXOffset = 0f; private const float DashStompPinMXOffset = -2f; private const float DashStompCloneXOffset = 3f; private const float SwipePinLYOffset = 0f; private const float SwipePinRYOffset = 4.4f; private const float SwipePinMYOffset = 0.5f; private const float SwipeCloneYOffset = -11.9f; private const float SwipeHighPinLYOffset = 0f; private const float SwipeHighPinRYOffset = 0f; private const float SwipeHighPinMYOffset = 0f; private const float SwipeHighCloneYOffset = -1.7f; private PlayMakerFSM _control; private GameObject Silk; private GameObject FingerBladeL; private GameObject FingerBladeR; private GameObject FingerBladeM; private GameObject FingerBladeClone; private bool _isSwipeHighActive; private GameObject[] ClonedBlades; private GameObject[] AllBlades; private string _handName = ""; private static string _lastMainAttack = ""; private static Dictionary _swipeDirectionByHand = new Dictionary(); private void Awake() { //IL_0143: 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) Log.Info("ExtraPins.Awake() on " + ((Object)((Component)this).gameObject).name); _handName = ((Object)((Component)this).gameObject).name; _control = FSMUtility.LocateMyFSM(((Component)this).gameObject, "Hand Control"); if ((Object)(object)_control == (Object)null) { Log.Error("ExtraPins: Could not find Hand Control FSM!"); return; } Silk = ((Component)((Component)this).gameObject.transform.parent).gameObject; Transform val = ((Component)this).gameObject.transform.Find("Finger Blade L"); Transform val2 = ((Component)this).gameObject.transform.Find("Finger Blade R"); Transform val3 = ((Component)this).gameObject.transform.Find("Finger Blade M"); if ((Object)(object)val == (Object)null || (Object)(object)val2 == (Object)null || (Object)(object)val3 == (Object)null) { Log.Error("ExtraPins: Could not find pins"); return; } FingerBladeL = ((Component)val).gameObject; FingerBladeR = ((Component)val2).gameObject; FingerBladeM = ((Component)val3).gameObject; FingerBladeClone = Object.Instantiate(FingerBladeM, ((Component)this).gameObject.transform); ((Object)FingerBladeClone).name = "Finger Blade M (Clone)"; FingerBladeClone.transform.localPosition = FingerBladeM.transform.localPosition + new Vector3(3f, 0f, 0f); ClonedBlades = (GameObject[])(object)new GameObject[1] { FingerBladeClone }; AllBlades = (GameObject[])(object)new GameObject[4] { FingerBladeL, FingerBladeR, FingerBladeM, FingerBladeClone }; SetupClonedPins(); GameObject[] allBlades = AllBlades; foreach (GameObject val4 in allBlades) { if ((Object)(object)val4.GetComponent() == (Object)null) { val4.AddComponent(); } } InjectStateLogging(); InjectAttackTracking(); ModifyStompAttacks(); ModifySwipeAttacks(); ModifySwipeHighAttacks(); ModifySwipeRandomFloat(); SyncSwipeDirection(); Log.Info("ExtraPins: Setup complete for " + _handName); } private void SetupClonedPins() { GameObject[] clonedBlades = ClonedBlades; for (int i = 0; i < clonedBlades.Length; i++) { PlayMakerFSM val = FSMUtility.LocateMyFSM(clonedBlades[i], "Control"); if ((Object)(object)val == (Object)null) { continue; } FsmState state = val.GetState("Init"); if (state != null && state.Actions.Length > 1) { state.RemoveAction(1); } FsmGameObject fsmGameObject = val.Fsm.GetFsmGameObject("Silk Boss"); if (fsmGameObject != null) { fsmGameObject.Value = Silk; } FsmState state2 = val.GetState("Pause"); if (state2 != null) { state2.AddTransition("STOMP", "Set Stomp"); state2.AddTransition("SWIPE L", "Set Swipe L"); state2.AddTransition("SWIPE R", "Set Swipe R"); state2.AddTransition("SWIPE L QUICK", "Set Swipe L Q"); state2.AddTransition("SWIPE R QUICK", "Set Swipe R Q"); state2.AddTransition("STOMP QUICK", "Set Stomp Q"); } FsmState state3 = val.GetState("Return End"); if (state3 != null && state2 != null) { FsmTransition[] transitions = state3.Transitions; foreach (FsmTransition val2 in transitions) { if (val2.EventName == "FINISHED") { val2.ToFsmState = state2; val2.ToState = "Pause"; } } } val.SetState("Pause"); } } private void InjectStateLogging() { string[] obj = new string[16] { "Stomp", "Stomp Basic", "Stomp Aim", "Stomp Aim L", "Stomp Aim R", "Stomp Dash L", "Stomp Dash R", "Swipe L", "Swipe R", "Swipe Dir", "Swipe High L", "Swipe High R", "Attacking", "Attack Ready Frame", "Idle", "Prepare" }; _ = _handName; string[] array = obj; foreach (string stateName in array) { if (_control.TryGetState(stateName, out FsmState state)) { state?.InsertAction(0, (FsmStateAction)(object)new InvokeMethod(delegate { })); } } } private void InjectAttackTracking() { if (_control.TryGetState("Swipe L", out FsmState state)) { state?.InsertAction(0, (FsmStateAction)(object)new InvokeMethod(delegate { _lastMainAttack = "Swipe L"; })); } if (_control.TryGetState("Swipe R", out FsmState state2)) { state2?.InsertAction(0, (FsmStateAction)(object)new InvokeMethod(delegate { _lastMainAttack = "Swipe R"; })); } if (_control.TryGetState("Swipe High L", out FsmState state3)) { state3?.InsertAction(0, (FsmStateAction)(object)new InvokeMethod(delegate { _lastMainAttack = "Swipe High L"; })); } if (_control.TryGetState("Swipe High R", out FsmState state4)) { state4?.InsertAction(0, (FsmStateAction)(object)new InvokeMethod(delegate { _lastMainAttack = "Swipe High R"; })); } if (_control.TryGetState("Idle", out FsmState state5)) { state5?.InsertAction(0, (FsmStateAction)(object)new InvokeMethod(delegate { _ = _lastMainAttack != ""; _lastMainAttack = ""; FingerBlades.ClearAnglePattern(); })); } if (_control.TryGetState("Stomp Aim", out FsmState state6)) { state6?.InsertAction(0, (FsmStateAction)(object)new InvokeMethod(delegate { FingerBlades.CheckAndSetAnglePattern(); })); } } private void ModifyStompAttacks() { FsmFloat attackX = _control.Fsm.GetFsmFloat("Attack X"); if (attackX == null) { return; } FsmState state = _control.GetState("Stomp"); if (state != null) { FsmState val = _control.CopyState("Stomp", "Stomp Basic"); if (_control.TryGetState("Stomp Aim", out FsmState state2) && state2 != null) { FsmTransition[] transitions = state2.Transitions; foreach (FsmTransition val2 in transitions) { if (val2.ToState == "Stomp") { val2.ToState = "Stomp Basic"; val2.ToFsmState = val; } } state2.AddAction((FsmStateAction)(object)new InvokeMethod(delegate { float num = 0f; if (_lastMainAttack == "Swipe R") { num = 0f; } else if (_lastMainAttack == "Swipe L") { num = 0f; } if (num != 0f) { FsmFloat obj5 = attackX; obj5.Value += num; } })); } ModifyStompState(val, attackX, -1.3f, 1.3f, -1f, 3f, "Basic"); } if (_control.TryGetState("Stomp Aim L", out FsmState state3) && state3 != null) { for (int j = 0; j < state3.Actions.Length; j++) { FsmStateAction obj = state3.Actions[j]; FloatAdd val3 = (FloatAdd)(object)((obj is FloatAdd) ? obj : null); if (val3 != null) { float value = val3.add.Value; val3.add.Value = value + 1.8f; break; } } } if (_control.TryGetState("Stomp Aim R", out FsmState state4) && state4 != null) { for (int k = 0; k < state4.Actions.Length; k++) { FsmStateAction obj2 = state4.Actions[k]; FloatAdd val4 = (FloatAdd)(object)((obj2 is FloatAdd) ? obj2 : null); if (val4 != null) { float value2 = val4.add.Value; val4.add.Value = value2 + -1.8f; break; } } } if (_control.TryGetState("Stomp Dash L", out FsmState state5) && state5 != null) { for (int l = 0; l < state5.Actions.Length; l++) { FsmStateAction obj3 = state5.Actions[l]; FloatAdd val5 = (FloatAdd)(object)((obj3 is FloatAdd) ? obj3 : null); if (val5 != null) { float value3 = val5.add.Value; val5.add.Value = value3 + 1.8f; break; } } } if (_control.TryGetState("Stomp Dash R", out FsmState state6) && state6 != null) { for (int m = 0; m < state6.Actions.Length; m++) { FsmStateAction obj4 = state6.Actions[m]; FloatAdd val6 = (FloatAdd)(object)((obj4 is FloatAdd) ? obj4 : null); if (val6 != null) { float value4 = val6.add.Value; val6.add.Value = value4 + -1.8f; break; } } } if (state != null) { ModifyStompState(state, attackX, 0f, 0f, -2f, 3f, "Dual/Dash"); } } private void ModifyStompState(FsmState stompState, FsmFloat attackX, float pinLOffset, float pinROffset, float pinMOffset, float cloneOffset, string stompType) { int num = -1; int num2 = -1; int num3 = -1; int num4 = 0; for (int i = 0; i < stompState.Actions.Length; i++) { if (stompState.Actions[i] is SetFsmFloat) { switch (num4) { case 0: num = i; break; case 1: num2 = i; break; case 2: num3 = i; break; } num4++; } } if (num3 >= 0 && pinMOffset != 0f) { stompState.InsertAction(num3, (FsmStateAction)(object)FloatAdder(attackX, pinMOffset)); } if (num2 >= 0 && pinROffset != 0f) { stompState.InsertAction(num2, (FsmStateAction)(object)FloatAdder(attackX, pinROffset)); } if (num >= 0 && pinLOffset != 0f) { stompState.InsertAction(num, (FsmStateAction)(object)FloatAdder(attackX, pinLOffset)); } stompState.AddAction((FsmStateAction)(object)FloatAdder(attackX, cloneOffset)); stompState.AddAction((FsmStateAction)(object)FloatSender(FingerBladeClone, "Attack X", attackX)); stompState.AddAction((FsmStateAction)(object)EventSender(FingerBladeClone, "STOMP")); } private void ModifySwipeAttacks() { FsmFloat fsmFloat = _control.Fsm.GetFsmFloat("Attack X"); FsmFloat fsmFloat2 = _control.Fsm.GetFsmFloat("Attack Y"); if (fsmFloat == null || fsmFloat2 == null) { return; } PlayMakerFSM val = FSMUtility.LocateMyFSM(FingerBladeM, "Control"); PlayMakerFSM val2 = FSMUtility.LocateMyFSM(FingerBladeClone, "Control"); if (_control.TryGetState("Swipe L", out FsmState state) && state != null) { int[] array = FindSetFsmFloatIndices(state, "Attack Y"); if (array.Length >= 3) { state.InsertAction(array[2], (FsmStateAction)(object)FloatAdder(fsmFloat2, 0.5f)); state.InsertAction(array[1], (FsmStateAction)(object)FloatAdder(fsmFloat2, 4.4f)); } } if (_control.TryGetState("Swipe R", out FsmState state2) && state2 != null) { int[] array2 = FindSetFsmFloatIndices(state2, "Attack Y"); if (array2.Length >= 3) { state2.InsertAction(array2[2], (FsmStateAction)(object)FloatAdder(fsmFloat2, 0.5f)); state2.InsertAction(array2[1], (FsmStateAction)(object)FloatAdder(fsmFloat2, 4.4f)); } } if ((Object)(object)val != (Object)null && (Object)(object)val2 != (Object)null) { SyncCloneWithPinM(val, val2, fsmFloat, fsmFloat2); } } private void SyncCloneWithPinM(PlayMakerFSM pinMControl, PlayMakerFSM cloneControl, FsmFloat attackX, FsmFloat attackY) { PlayMakerFSM pinMControl2 = pinMControl; PlayMakerFSM cloneControl2 = cloneControl; pinMControl2.Fsm.GetState("Set Swipe L")?.InsertAction(0, (FsmStateAction)(object)new InvokeMethod(delegate { FsmFloat fsmFloat13 = pinMControl2.Fsm.GetFsmFloat("Attack X"); FsmFloat fsmFloat14 = pinMControl2.Fsm.GetFsmFloat("Attack Y"); if (fsmFloat13 != null && fsmFloat14 != null) { FsmFloat fsmFloat15 = cloneControl2.Fsm.GetFsmFloat("Attack X"); FsmFloat fsmFloat16 = cloneControl2.Fsm.GetFsmFloat("Attack Y"); if (fsmFloat15 != null && fsmFloat16 != null) { fsmFloat15.Value = fsmFloat13.Value; float num4 = (_isSwipeHighActive ? (-1.7f) : (-11.9f)); fsmFloat16.Value = fsmFloat14.Value + num4; cloneControl2.SendEvent("SWIPE L"); } } })); pinMControl2.Fsm.GetState("Set Swipe R")?.InsertAction(0, (FsmStateAction)(object)new InvokeMethod(delegate { FsmFloat fsmFloat9 = pinMControl2.Fsm.GetFsmFloat("Attack X"); FsmFloat fsmFloat10 = pinMControl2.Fsm.GetFsmFloat("Attack Y"); if (fsmFloat9 != null && fsmFloat10 != null) { FsmFloat fsmFloat11 = cloneControl2.Fsm.GetFsmFloat("Attack X"); FsmFloat fsmFloat12 = cloneControl2.Fsm.GetFsmFloat("Attack Y"); if (fsmFloat11 != null && fsmFloat12 != null) { fsmFloat11.Value = fsmFloat9.Value; float num3 = (_isSwipeHighActive ? (-1.7f) : (-11.9f)); fsmFloat12.Value = fsmFloat10.Value + num3; cloneControl2.SendEvent("SWIPE R"); } } })); pinMControl2.Fsm.GetState("Set Swipe L Q")?.InsertAction(0, (FsmStateAction)(object)new InvokeMethod(delegate { FsmFloat fsmFloat5 = pinMControl2.Fsm.GetFsmFloat("Attack X"); FsmFloat fsmFloat6 = pinMControl2.Fsm.GetFsmFloat("Attack Y"); if (fsmFloat5 != null && fsmFloat6 != null) { FsmFloat fsmFloat7 = cloneControl2.Fsm.GetFsmFloat("Attack X"); FsmFloat fsmFloat8 = cloneControl2.Fsm.GetFsmFloat("Attack Y"); if (fsmFloat7 != null && fsmFloat8 != null) { fsmFloat7.Value = fsmFloat5.Value; float num2 = (_isSwipeHighActive ? (-1.7f) : (-11.9f)); fsmFloat8.Value = fsmFloat6.Value + num2; cloneControl2.SendEvent("SWIPE L QUICK"); } } })); pinMControl2.Fsm.GetState("Set Swipe R Q")?.InsertAction(0, (FsmStateAction)(object)new InvokeMethod(delegate { FsmFloat fsmFloat = pinMControl2.Fsm.GetFsmFloat("Attack X"); FsmFloat fsmFloat2 = pinMControl2.Fsm.GetFsmFloat("Attack Y"); if (fsmFloat != null && fsmFloat2 != null) { FsmFloat fsmFloat3 = cloneControl2.Fsm.GetFsmFloat("Attack X"); FsmFloat fsmFloat4 = cloneControl2.Fsm.GetFsmFloat("Attack Y"); if (fsmFloat3 != null && fsmFloat4 != null) { fsmFloat3.Value = fsmFloat.Value; float num = (_isSwipeHighActive ? (-1.7f) : (-11.9f)); fsmFloat4.Value = fsmFloat2.Value + num; cloneControl2.SendEvent("SWIPE R QUICK"); } } })); } private void ModifySwipeHighAttacks() { FsmFloat fsmFloat = _control.Fsm.GetFsmFloat("Attack X"); FsmFloat fsmFloat2 = _control.Fsm.GetFsmFloat("Attack Y"); if (fsmFloat == null || fsmFloat2 == null) { return; } if (_control.TryGetState("Swipe High L", out FsmState state) && state != null) { state.InsertAction(0, (FsmStateAction)(object)new InvokeMethod(delegate { _isSwipeHighActive = true; })); int[] array = FindSetFsmFloatIndices(state, "Attack Y"); _ = array.Length; _ = 3; } if (_control.TryGetState("Swipe High R", out FsmState state2) && state2 != null) { state2.InsertAction(0, (FsmStateAction)(object)new InvokeMethod(delegate { _isSwipeHighActive = true; })); int[] array2 = FindSetFsmFloatIndices(state2, "Attack Y"); _ = array2.Length; _ = 3; } if (_control.TryGetState("Swipe L", out FsmState state3)) { state3?.InsertAction(0, (FsmStateAction)(object)new InvokeMethod(delegate { _isSwipeHighActive = false; })); } if (_control.TryGetState("Swipe R", out FsmState state4)) { state4?.InsertAction(0, (FsmStateAction)(object)new InvokeMethod(delegate { _isSwipeHighActive = false; })); } } private void SyncSwipeDirection() { PlayMakerFSM pinLControl = FSMUtility.LocateMyFSM(FingerBladeL, "Control"); PlayMakerFSM val = FSMUtility.LocateMyFSM(FingerBladeR, "Control"); PlayMakerFSM val2 = FSMUtility.LocateMyFSM(FingerBladeM, "Control"); PlayMakerFSM val3 = FSMUtility.LocateMyFSM(FingerBladeClone, "Control"); if ((Object)(object)pinLControl == (Object)null || (Object)(object)val == (Object)null || (Object)(object)val2 == (Object)null) { Log.Warn("SyncSwipeDirection: Could not find Control FSM on one or more pins"); return; } FsmState state = pinLControl.Fsm.GetState("Swipe Dir"); if (state == null) { Log.Warn("SyncSwipeDirection: Could not find Swipe Dir state on Pin L"); return; } string capturedHandName = _handName; state.AddAction((FsmStateAction)(object)new InvokeMethod(delegate { switch (pinLControl.Fsm.ActiveStateName) { case "Swipe L": case "Swipe High L": _swipeDirectionByHand[capturedHandName] = "L"; break; case "Swipe R": case "Swipe High R": _swipeDirectionByHand[capturedHandName] = "R"; break; } })); ModifyPinSwipeDirToInherit(val, "Pin R", capturedHandName); ModifyPinSwipeDirToInherit(val2, "Pin M", capturedHandName); if ((Object)(object)val3 != (Object)null) { ModifyPinSwipeDirToInherit(val3, "Clone", capturedHandName); } } private void ModifyPinSwipeDirToInherit(PlayMakerFSM pinControl, string pinName, string handName) { string handName2 = handName; PlayMakerFSM pinControl2 = pinControl; FsmState state = pinControl2.Fsm.GetState("Swipe Dir"); if (state == null) { return; } state.Actions = (FsmStateAction[])(object)new FsmStateAction[1] { new InvokeMethod(delegate { string text = "L"; if (_swipeDirectionByHand.TryGetValue(handName2, out string value)) { text = value; } pinControl2.SendEvent(text); }) }; } private int[] FindSetFsmFloatIndices(FsmState state, string variableName) { List list = new List(); for (int i = 0; i < state.Actions.Length; i++) { FsmStateAction obj = state.Actions[i]; SetFsmFloat val = (SetFsmFloat)(object)((obj is SetFsmFloat) ? obj : null); if (val != null && val.variableName.Value == variableName) { list.Add(i); } } return list.ToArray(); } private int[] FindSendEventIndices(FsmState state) { List list = new List(); for (int i = 0; i < state.Actions.Length; i++) { if (state.Actions[i] is SendEvent) { list.Add(i); } } return list.ToArray(); } private FloatAdd FloatAdder(FsmFloat variable, float amount) { //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) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown return new FloatAdd { floatVariable = variable, add = FsmFloat.op_Implicit(amount), everyFrame = false }; } private SetFsmFloat FloatSender(GameObject target, string variableName, FsmFloat value) { //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) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_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_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_0029: Expected O, but got Unknown //IL_0029: 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_0045: 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_0054: Expected O, but got Unknown return new SetFsmFloat { gameObject = new FsmOwnerDefault { OwnerOption = (OwnerDefaultOption)1, GameObject = new FsmGameObject { Value = target } }, fsmName = FsmString.op_Implicit("Control"), variableName = FsmString.op_Implicit(variableName), setValue = value, everyFrame = false }; } private SendEvent EventSender(GameObject target, string eventName) { //IL_0011: 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) //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_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_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_0030: 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_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Expected O, but got Unknown //IL_0047: Expected O, but got Unknown //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Expected O, but got Unknown //IL_0062: Expected O, but got Unknown //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_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_007f: Expected O, but got Unknown //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Expected O, but got Unknown //IL_000b: Unknown result type (might be due to invalid IL or missing references) FsmEvent sendEvent = (FsmEvent)(((object)FsmEvent.GetFsmEvent(eventName)) ?? ((object)new FsmEvent(eventName))); return new SendEvent { eventTarget = new FsmEventTarget { target = (EventTarget)1, gameObject = new FsmOwnerDefault { OwnerOption = (OwnerDefaultOption)1, GameObject = new FsmGameObject { Value = target } }, fsmName = new FsmString { Value = "Control" } }, sendEvent = sendEvent, delay = new FsmFloat { Value = 0f }, everyFrame = false }; } private void ModifySwipeRandomFloat() { if (!_control.TryGetState("Swipe L", out FsmState state) || state == null) { return; } FsmStateAction[] actions = state.Actions; foreach (FsmStateAction obj in actions) { RandomFloatEither val = (RandomFloatEither)(object)((obj is RandomFloatEither) ? obj : null); if (val != null) { _ = val.value2.Value; val.value2.Value = 139.9f; _ = val.value1.Value; val.value1.Value = 135.5f; break; } } for (int j = 0; j < state.Actions.Length; j++) { FsmStateAction obj2 = state.Actions[j]; FloatAddRandom val2 = (FloatAddRandom)(object)((obj2 is FloatAddRandom) ? obj2 : null); if (val2 != null) { switch (j) { case 5: val2.addMin.Value = 10.5f; val2.addMax.Value = 11.5f; break; case 11: case 18: val2.addMin.Value = 11f; val2.addMax.Value = 12f; break; case 20: val2.addMin.Value = -0.1f; val2.addMax.Value = 0.3f; break; } } RandomFloat val3 = (RandomFloat)(object)((obj2 is RandomFloat) ? obj2 : null); if (val3 != null) { switch (j) { case 6: val3.min.Value = 132.8f; val3.max.Value = 133.2f; break; case 12: val3.min.Value = 141.8f; val3.max.Value = 142f; break; } } } if (!_control.TryGetState("Swipe R", out FsmState state2) || state2 == null) { return; } actions = state2.Actions; foreach (FsmStateAction obj3 in actions) { RandomFloatEither val4 = (RandomFloatEither)(object)((obj3 is RandomFloatEither) ? obj3 : null); if (val4 != null) { _ = val4.value2.Value; val4.value2.Value = 139.7f; _ = val4.value1.Value; val4.value1.Value = 135.5f; break; } } for (int k = 0; k < state2.Actions.Length; k++) { FsmStateAction obj4 = state2.Actions[k]; FloatAddRandom val5 = (FloatAddRandom)(object)((obj4 is FloatAddRandom) ? obj4 : null); if (val5 != null) { switch (k) { case 5: val5.addMin.Value = -10.5f; val5.addMax.Value = -11.5f; break; case 11: case 18: val5.addMin.Value = -11f; val5.addMax.Value = -12f; break; case 20: val5.addMin.Value = -0.2f; val5.addMax.Value = 0.2f; break; } } RandomFloat val6 = (RandomFloat)(object)((obj4 is RandomFloat) ? obj4 : null); if (val6 != null) { switch (k) { case 6: val6.min.Value = 132.8f; val6.max.Value = 133.2f; break; case 12: val6.min.Value = 141.8f; val6.max.Value = 141.9f; break; } } } if (_control.TryGetState("Swipe High L", out FsmState state3) && state3 != null) { for (int l = 0; l < state3.Actions.Length; l++) { FsmStateAction obj5 = state3.Actions[l]; SetFloatValue val7 = (SetFloatValue)(object)((obj5 is SetFloatValue) ? obj5 : null); if (val7 != null) { switch (l) { case 7: val7.floatValue.Value = 146.7f; break; case 19: val7.floatValue.Value = 140.8f; break; } } } } if (!_control.TryGetState("Swipe High R", out FsmState state4) || state4 == null) { return; } for (int m = 0; m < state4.Actions.Length; m++) { FsmStateAction obj6 = state4.Actions[m]; SetFloatValue val8 = (SetFloatValue)(object)((obj6 is SetFloatValue) ? obj6 : null); if (val8 != null) { switch (m) { case 13: val8.floatValue.Value = 141.7f; break; case 19: val8.floatValue.Value = 147.4f; break; } } } } } internal class FingerBlades : MonoBehaviour { public enum AnglePattern { None, Left, Right } [CompilerGenerated] private sealed class d__29 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public FingerBlades <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__29(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { int num = <>1__state; FingerBlades fingerBlades = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; goto IL_0042; case 1: <>1__state = -1; goto IL_0042; case 2: { <>1__state = -1; goto IL_009b; } IL_0042: if (fingerBlades._control.Fsm == null || fingerBlades._control.Fsm.States == null || fingerBlades._control.Fsm.States.Length == 0) { <>2__current = null; <>1__state = 1; return true; } if (!((Object)(object)fingerBlades._tink != (Object)null)) { break; } goto IL_009b; IL_009b: if (fingerBlades._tink.Fsm == null || fingerBlades._tink.Fsm.States == null || fingerBlades._tink.Fsm.States.Length == 0) { <>2__current = null; <>1__state = 2; return true; } break; } fingerBlades.ModifyFSM(); fingerBlades.ModifyTinkFSM(); ApplyInitialTimings(); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static float AnticPullWait_Default = 0.6f; public static float AnticPullWaitBool_Default = 0.5f; public static float AnticPause_Default = 0.14f; public static float AnticPullWait_P4 = 0.55f; public static float AnticPullWaitBool_P4 = 0.45f; public static float AnticPause_P4 = 0.13f; public static float TinkRecoilMultiplier = 0.15f; public static float AngleStompL_PinL = -38f; public static float AngleStompL_PinM = -25f; public static float AngleStompL_Clone = -11f; public static float AngleStompL_PinR = 0f; public static float AngleStompR_PinL = 0f; public static float AngleStompR_PinM = 11f; public static float AngleStompR_Clone = 25f; public static float AngleStompR_PinR = 38f; public static float AngleStompXOffset_PinL = 0f; public static float AngleStompXOffset_PinM = -0.1f; public static float AngleStompXOffset_Clone = 0.1f; public static float AngleStompXOffset_PinR = 0.2f; public static AnglePattern ActiveAnglePattern = AnglePattern.None; public static bool AngleStompsEnabled = false; public const float ArenaMinX = 22f; public const float ArenaMaxX = 55f; public const float ArenaThirdWidth = 11f; public static float AngleStompChance = 0.75f; private PlayMakerFSM _control; private PlayMakerFSM _tink; private void Awake() { _control = FSMUtility.LocateMyFSM(((Component)this).gameObject, "Control"); _tink = FSMUtility.LocateMyFSM(((Component)this).gameObject, "Tink"); if ((Object)(object)_control == (Object)null) { Log.Error("FingerBlades: Could not find Control FSM on " + ((Object)((Component)this).gameObject).name); return; } if ((Object)(object)_tink == (Object)null) { Log.Warn("FingerBlades: Could not find Tink FSM on " + ((Object)((Component)this).gameObject).name); } ((MonoBehaviour)this).StartCoroutine(ModifyFSMWhenReady()); } [IteratorStateMachine(typeof(d__29))] private IEnumerator ModifyFSMWhenReady() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__29(0) { <>4__this = this }; } private void ModifyTinkFSM() { if ((Object)(object)_tink == (Object)null) { Log.Warn("FingerBlades [" + ((Object)((Component)this).gameObject).name + "]: No Tink FSM to modify"); return; } string[] array = new string[4] { "Tink L", "Tink R", "Tink U", "Tink D" }; foreach (string text in array) { FsmState state = _tink.Fsm.GetState(text); if (state == null) { Log.Warn("FingerBlades [" + ((Object)((Component)this).gameObject).name + "]: Could not find state '" + text + "' in Tink FSM"); continue; } FsmStateAction[] actions = state.Actions; foreach (FsmStateAction obj in actions) { Translate val = (Translate)(object)((obj is Translate) ? obj : null); if (val != null) { float value = val.x.Value; float value2 = val.y.Value; if (value != 0f) { val.x.Value = value * TinkRecoilMultiplier; } if (value2 != 0f) { val.y.Value = value2 * TinkRecoilMultiplier; } break; } } } } private void ModifyFSM() { _control.Fsm.GetFsmFloat("Attack X"); _control.Fsm.GetFsmFloat("Attack Y"); _control.Fsm.GetFsmFloat("Attack Rotation"); _control.Fsm.GetFsmFloat("Z Pos"); FsmState state = _control.Fsm.GetState("Pull Out"); FsmState state2 = _control.Fsm.GetState("Antic Pause"); FsmState state3 = _control.Fsm.GetState("Tele To"); FsmState state4 = _control.Fsm.GetState("Attack Start Pause"); if (state == null || state2 == null || state3 == null) { Log.Error("FingerBlades: One or more FSM states not found!"); return; } SetActionField(state, 4, "time", 0.05f); SetActionField(state, 5, "time", 0.05f); SetActionField(state3, 8, "multiplyBy", 0.01f); if (state4 != null && state4.Actions.Length != 0) { FsmStateAction obj = state4.Actions[0]; RandomFloat val = (RandomFloat)(object)((obj is RandomFloat) ? obj : null); if (val != null) { val.min.Value = 0.55f; val.max.Value = 0.7f; } } FsmFloat fsmFloat = _control.Fsm.GetFsmFloat("Travel Time Multiplier"); if (fsmFloat != null) { fsmFloat.Value = 0.01f; } FsmFloat fsmFloat2 = _control.Fsm.GetFsmFloat("Wait Min"); FsmFloat fsmFloat3 = _control.Fsm.GetFsmFloat("Wait Max"); if (fsmFloat2 != null && fsmFloat3 != null) { FsmState[] states = _control.Fsm.States; for (int i = 0; i < states.Length; i++) { FsmStateAction[] actions = states[i].Actions; foreach (FsmStateAction obj2 in actions) { SetFloatValue val2 = (SetFloatValue)(object)((obj2 is SetFloatValue) ? obj2 : null); if (val2 != null) { if (((NamedVariable)val2.floatVariable).Name == "Wait Min" && val2.floatValue.Value > 0f) { _ = val2.floatValue.Value; val2.floatValue.Value = 0.15f; } else if (((NamedVariable)val2.floatVariable).Name == "Wait Max" && val2.floatValue.Value > 0f) { _ = val2.floatValue.Value; val2.floatValue.Value = 0.2f; } } } } } ApplyAngleStompRotation(); } private void ApplyAngleStompRotation() { FsmState state = _control.Fsm.GetState("Set Stomp"); if (state == null) { Log.Warn("FingerBlades [" + ((Object)((Component)this).gameObject).name + "]: Could not find Set Stomp state"); return; } FsmFloat attackRotation = _control.Fsm.GetFsmFloat("Attack Rotation"); FsmFloat attackX = _control.Fsm.GetFsmFloat("Attack X"); if (attackRotation == null) { Log.Warn("FingerBlades [" + ((Object)((Component)this).gameObject).name + "]: Could not find Attack Rotation variable"); return; } string pinName = ((Object)((Component)this).gameObject).name; state.InsertAction(1, (FsmStateAction)(object)new InvokeMethod(delegate { if (ActiveAnglePattern != 0) { float num = 0f; float num2 = 0f; float num3 = ((ActiveAnglePattern == AnglePattern.Left) ? 1f : 1f); if (ActiveAnglePattern == AnglePattern.Left) { if (pinName.Contains("Finger Blade L")) { num = AngleStompL_PinL; num2 = num3 * AngleStompXOffset_PinL; } else if (pinName.Contains("Finger Blade M") && pinName.Contains("Clone")) { num = AngleStompL_Clone; num2 = num3 * AngleStompXOffset_Clone; } else if (pinName.Contains("Finger Blade M")) { num = AngleStompL_PinM; num2 = num3 * AngleStompXOffset_PinM; } else if (pinName.Contains("Finger Blade R")) { num = AngleStompL_PinR; num2 = num3 * AngleStompXOffset_PinR; } } else if (ActiveAnglePattern == AnglePattern.Right) { if (pinName.Contains("Finger Blade L")) { num = AngleStompR_PinL; num2 = num3 * AngleStompXOffset_PinL; } else if (pinName.Contains("Finger Blade M") && pinName.Contains("Clone")) { num = AngleStompR_Clone; num2 = num3 * AngleStompXOffset_Clone; } else if (pinName.Contains("Finger Blade M")) { num = AngleStompR_PinM; num2 = num3 * AngleStompXOffset_PinM; } else if (pinName.Contains("Finger Blade R")) { num = AngleStompR_PinR; num2 = num3 * AngleStompXOffset_PinR; } } if (num != 0f) { FsmFloat obj = attackRotation; obj.Value += num; } if (num2 != 0f && attackX != null) { FsmFloat obj2 = attackX; obj2.Value += num2; } if (num == 0f) { _ = 0f; } } })); } public static void CheckAndSetAnglePattern() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) ActiveAnglePattern = AnglePattern.None; if (!AngleStompsEnabled) { return; } float num = 0f; try { HeroController instance = HeroController.instance; if (!((Object)(object)instance != (Object)null)) { Log.Warn("FingerBlades: HeroController.instance is null"); return; } num = ((Component)instance).gameObject.transform.position.x; } catch (Exception ex) { Log.Error("FingerBlades: Failed to get hero position: " + ex.Message); return; } float num2 = 33f; float num3 = 44f; if (num < num2) { if (Random.value < AngleStompChance) { ActiveAnglePattern = AnglePattern.Right; } } else if (num > num3 && Random.value < AngleStompChance) { ActiveAnglePattern = AnglePattern.Left; } } public static void ClearAnglePattern() { if (ActiveAnglePattern != 0) { ActiveAnglePattern = AnglePattern.None; } } public static void EnableAngleStomps() { AngleStompsEnabled = true; } public static void DisableAngleStomps() { AngleStompsEnabled = false; ActiveAnglePattern = AnglePattern.None; } private static void ApplyToAllFingerBlades(Action applyAction) { GameObject[] array = Object.FindObjectsOfType(true); foreach (GameObject val in array) { if (!((Object)val).name.StartsWith("Finger Blade")) { continue; } Transform parent = val.transform.parent; string text = ((parent != null) ? ((Object)parent).name : null) ?? ""; if (!(text != "Hand L") || !(text != "Hand R")) { PlayMakerFSM val2 = FSMUtility.LocateMyFSM(val, "Control"); if (((val2 != null) ? val2.Fsm : null) != null) { applyAction(val2, text, ((Object)val).name); } } } } public static void ApplyInitialTimings() { int modified = 0; ApplyToAllFingerBlades(delegate(PlayMakerFSM control, string hand, string blade) { //IL_00f4: Unknown result type (might be due to invalid IL or missing references) FsmState state = control.Fsm.GetState("Antic Pull"); FsmState state2 = control.Fsm.GetState("Antic Pause"); if (state != null) { FsmStateAction[] actions = state.Actions; foreach (FsmStateAction val in actions) { Wait val2 = (Wait)(object)((val is Wait) ? val : null); if (val2 != null) { val2.time.Value = AnticPullWait_Default; modified++; } else { WaitBool val3 = (WaitBool)(object)((val is WaitBool) ? val : null); if (val3 != null) { val3.time.Value = AnticPullWaitBool_Default; modified++; } } } } if (state2 != null && state2.Actions.Length > 3) { FsmStateAction val4 = state2.Actions[3]; FieldInfo field = ((object)val4).GetType().GetField("time"); if (field?.FieldType == typeof(FsmFloat)) { ((FsmFloat)field.GetValue(val4)).Value = AnticPause_Default; modified++; } } }); } public static void ApplyPhase4Timings() { int modified = 0; ApplyToAllFingerBlades(delegate(PlayMakerFSM control, string hand, string blade) { //IL_00f4: Unknown result type (might be due to invalid IL or missing references) FsmState state = control.Fsm.GetState("Antic Pull"); FsmState state2 = control.Fsm.GetState("Antic Pause"); if (state != null) { FsmStateAction[] actions = state.Actions; foreach (FsmStateAction val in actions) { Wait val2 = (Wait)(object)((val is Wait) ? val : null); if (val2 != null) { val2.time.Value = AnticPullWait_P4; modified++; } else { WaitBool val3 = (WaitBool)(object)((val is WaitBool) ? val : null); if (val3 != null) { val3.time.Value = AnticPullWaitBool_P4; modified++; } } } } if (state2 != null && state2.Actions.Length > 3) { FsmStateAction val4 = state2.Actions[3]; FieldInfo field = ((object)val4).GetType().GetField("time"); if (field?.FieldType == typeof(FsmFloat)) { ((FsmFloat)field.GetValue(val4)).Value = AnticPause_P4; modified++; } } }); } private void SetActionField(FsmState state, int index, string fieldName, object value) { //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Expected O, but got Unknown if (state.Actions.Length <= index || state.Actions[index] == null) { return; } FsmStateAction val = state.Actions[index]; FieldInfo field = ((object)val).GetType().GetField(fieldName); if (field != null) { try { if (field.FieldType == typeof(FsmFloat) && value is float value2) { field.SetValue(val, (object?)new FsmFloat { Value = value2 }); } else { field.SetValue(val, value); } return; } catch (Exception ex) { Log.Error($"Failed to set {fieldName} in {state.Name}[{index}]: {ex.Message}"); return; } } Log.Warn($"Field '{fieldName}' not found in action at index {index} of state '{state.Name}'"); } } internal static class Nuke { [CompilerGenerated] private sealed class d__57 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; private tk2dSpriteAnimationClip 5__2; private int 5__3; private int 5__4; private int 5__5; private int 5__6; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__57(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__2 = null; <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; Log.Info("PlayCastWithDynamicSpeed: COROUTINE STARTED"); if ((Object)(object)_bossAnimator == (Object)null || _originalCastFps <= 0f) { Log.Warn("Nuke: Cannot play Cast with dynamic speed - animator or fps not cached"); return false; } 5__2 = _bossAnimator.GetClipByName("Cast"); if (5__2 == null || 5__2.frames == null) { Log.Warn("Nuke: Cast clip not found"); return false; } 5__3 = 5__2.frames.Length; _bossAnimator.Play("Cast"); 5__4 = 0; goto IL_00d9; case 1: <>1__state = -1; 5__4++; goto IL_00d9; case 2: { <>1__state = -1; break; } IL_00d9: if (_bossAnimator.CurrentClip?.name != "Cast" && 5__4 < 10) { <>2__current = null; <>1__state = 1; return true; } if (_bossAnimator.CurrentClip?.name != "Cast") { Log.Warn("Nuke Cast: Animation never started! Aborting dynamic speed."); return false; } 5__5 = -1; 5__6 = 0; break; } if (_bossAnimator.Playing && _bossAnimator.CurrentClip?.name == "Cast") { 5__6++; int currentFrame = _bossAnimator.CurrentFrame; if (currentFrame != 5__5) { float num = ((currentFrame >= 6 && currentFrame < 5__3 - 6) ? 1.7f : 1.3f); 5__2.fps = _originalCastFps * num; 5__5 = currentFrame; } <>2__current = null; <>1__state = 2; return true; } Log.Info(string.Format("Nuke Cast: While loop EXITED after {0} iterations - Playing={1}, CurrentClip={2}", 5__6, _bossAnimator.Playing, _bossAnimator.CurrentClip?.name ?? "null")); 5__2.fps = _originalCastFps; Log.Info($"Nuke Cast: Animation complete, reset ClipFps to {_originalCastFps}"); Log.Info("PlayCastWithDynamicSpeed: COROUTINE ENDING"); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } internal const string PREPARE_STATE = "Nuke Prepare"; internal const string PREPARED_BRANCH_STATE = "Nuke Prepared Branch"; internal const string TRIPLE_STATE = "Nuke Triple"; internal const string TRIPLE_SUMMON_STATE = "Nuke Triple Summon"; internal const string SUMMON_STATE = "Nuke Summon"; internal const string CAST_STATE = "Nuke Cast"; internal const string RECOVER_STATE = "Nuke Recover"; internal const string TRIPLE_DASH_ANTIC_1 = "Nuke Triple Dash Antic 1"; internal const string TRIPLE_DASH_1 = "Nuke Triple Dash 1"; internal const string TRIPLE_SUMMON_1 = "Nuke Triple Summon 1"; internal const string TRIPLE_CAST_1 = "Nuke Triple Cast 1"; internal const string TRIPLE_DASH_ANTIC_2 = "Nuke Triple Dash Antic 2"; internal const string TRIPLE_DASH_2 = "Nuke Triple Dash 2"; internal const string TRIPLE_SUMMON_2 = "Nuke Triple Summon 2"; internal const string TRIPLE_CAST_2 = "Nuke Triple Cast 2"; internal const string TRIPLE_DASH_ANTIC_3 = "Nuke Triple Dash Antic 3"; internal const string TRIPLE_DASH_3 = "Nuke Triple Dash 3"; internal const string TRIPLE_SUMMON_3 = "Nuke Triple Summon 3"; internal const string TRIPLE_CAST_3 = "Nuke Triple Cast 3"; internal const string TRIPLE_DASH_ANTIC_4 = "Nuke Triple Dash Antic 4"; internal const string TRIPLE_DASH_4 = "Nuke Triple Dash 4"; internal const string TRIPLE_SUMMON_4 = "Nuke Triple Summon 4"; internal const string TRIPLE_CAST_4 = "Nuke Triple Cast 4"; internal const string TRIPLE_CAST_4_CLEANUP = "Nuke Triple Cast 4 Cleanup"; internal const string TRIPLE_CAST_4_DELAY = "Nuke Triple Cast 4 Delay"; private const string EVENT_ATTACK_PREPARED = "ATTACK PREPARED"; internal const string VAR_TRIPLE_NUKE = "Triple Nuke"; internal const string VAR_HAS_TRIPLE_NUKED = "Has Triple Nuked"; internal const float TRIPLE_CAST_TO_DASH_PAUSE = 0.01f; internal const float TRIPLE_DASH_SPEED = -50f; internal const float TRIPLE_DASH_ANTIC_DECEL = 0.9f; internal const float TRIPLE_DASH_DECEL = 0.92f; internal const float TRIPLE_FACE_PAUSE = 0.5f; internal const float TRIPLE_DASH_ANIM_SPEED = 1.2f; private const float ARENA_RIGHT_BOUNDARY = 50f; private const float ARENA_LEFT_BOUNDARY = 30f; private const float ARENA_MIDDLE_X = 40f; private static tk2dSpriteAnimator _bossAnimator; private static float _originalCastFps; private static float _originalDashAnticFps; private static float _originalDashFps; private static MonoBehaviour _coroutineRunner; private static PlayMakerFSM _controlFsm; private static Transform _bossTransform; private static GameObject _tripleTargetDummy; internal static void BuildAttackFSM(PlayMakerFSM attackControl, FsmState idleState, FsmBool tripleNukeBool, FsmBool hasTripleNukedBool) { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Expected O, but got Unknown //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_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02b2: Expected O, but got Unknown //IL_02c0: Unknown result type (might be due to invalid IL or missing references) //IL_02c5: Unknown result type (might be due to invalid IL or missing references) //IL_02d5: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: Unknown result type (might be due to invalid IL or missing references) //IL_02e9: Expected O, but got Unknown //IL_02eb: Unknown result type (might be due to invalid IL or missing references) //IL_02f0: Unknown result type (might be due to invalid IL or missing references) //IL_02fb: Unknown result type (might be due to invalid IL or missing references) //IL_0306: Unknown result type (might be due to invalid IL or missing references) //IL_030e: Expected O, but got Unknown //IL_031c: Unknown result type (might be due to invalid IL or missing references) //IL_0321: Unknown result type (might be due to invalid IL or missing references) //IL_032c: Unknown result type (might be due to invalid IL or missing references) //IL_0337: Unknown result type (might be due to invalid IL or missing references) //IL_0340: Expected O, but got Unknown //IL_034f: Unknown result type (might be due to invalid IL or missing references) //IL_0354: Unknown result type (might be due to invalid IL or missing references) //IL_035f: Unknown result type (might be due to invalid IL or missing references) //IL_036a: Unknown result type (might be due to invalid IL or missing references) //IL_0373: Expected O, but got Unknown //IL_0382: Unknown result type (might be due to invalid IL or missing references) //IL_0387: Unknown result type (might be due to invalid IL or missing references) //IL_0392: Unknown result type (might be due to invalid IL or missing references) //IL_039e: Unknown result type (might be due to invalid IL or missing references) //IL_03a6: Expected O, but got Unknown //IL_03b5: Unknown result type (might be due to invalid IL or missing references) //IL_03ba: Unknown result type (might be due to invalid IL or missing references) //IL_03c5: Unknown result type (might be due to invalid IL or missing references) //IL_03d0: Unknown result type (might be due to invalid IL or missing references) //IL_03d9: Expected O, but got Unknown //IL_03e8: Unknown result type (might be due to invalid IL or missing references) //IL_03ed: Unknown result type (might be due to invalid IL or missing references) //IL_03f8: Unknown result type (might be due to invalid IL or missing references) //IL_0403: Unknown result type (might be due to invalid IL or missing references) //IL_040c: Expected O, but got Unknown //IL_041b: Unknown result type (might be due to invalid IL or missing references) //IL_0420: Unknown result type (might be due to invalid IL or missing references) //IL_042b: Unknown result type (might be due to invalid IL or missing references) //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_043f: Expected O, but got Unknown //IL_044e: Unknown result type (might be due to invalid IL or missing references) //IL_0453: Unknown result type (might be due to invalid IL or missing references) //IL_045e: Unknown result type (might be due to invalid IL or missing references) //IL_0469: Unknown result type (might be due to invalid IL or missing references) //IL_0472: Expected O, but got Unknown //IL_0481: Unknown result type (might be due to invalid IL or missing references) //IL_0486: Unknown result type (might be due to invalid IL or missing references) //IL_0491: Unknown result type (might be due to invalid IL or missing references) //IL_049c: Unknown result type (might be due to invalid IL or missing references) //IL_04a5: Expected O, but got Unknown //IL_04b4: Unknown result type (might be due to invalid IL or missing references) //IL_04b9: Unknown result type (might be due to invalid IL or missing references) //IL_04c4: Unknown result type (might be due to invalid IL or missing references) //IL_04cf: Unknown result type (might be due to invalid IL or missing references) //IL_04d8: Expected O, but got Unknown //IL_04e7: Unknown result type (might be due to invalid IL or missing references) //IL_04ec: Unknown result type (might be due to invalid IL or missing references) //IL_04f7: Unknown result type (might be due to invalid IL or missing references) //IL_0502: Unknown result type (might be due to invalid IL or missing references) //IL_050b: Expected O, but got Unknown //IL_051a: Unknown result type (might be due to invalid IL or missing references) //IL_051f: Unknown result type (might be due to invalid IL or missing references) //IL_052a: Unknown result type (might be due to invalid IL or missing references) //IL_0535: Unknown result type (might be due to invalid IL or missing references) //IL_053e: Expected O, but got Unknown //IL_054d: Unknown result type (might be due to invalid IL or missing references) //IL_0552: Unknown result type (might be due to invalid IL or missing references) //IL_055d: Unknown result type (might be due to invalid IL or missing references) //IL_0568: Unknown result type (might be due to invalid IL or missing references) //IL_0571: Expected O, but got Unknown //IL_0580: Unknown result type (might be due to invalid IL or missing references) //IL_0585: Unknown result type (might be due to invalid IL or missing references) //IL_0590: Unknown result type (might be due to invalid IL or missing references) //IL_059b: Unknown result type (might be due to invalid IL or missing references) //IL_05a4: Expected O, but got Unknown //IL_05b3: Unknown result type (might be due to invalid IL or missing references) //IL_05b8: Unknown result type (might be due to invalid IL or missing references) //IL_05c3: Unknown result type (might be due to invalid IL or missing references) //IL_05ce: Unknown result type (might be due to invalid IL or missing references) //IL_05d7: Expected O, but got Unknown //IL_05e6: Unknown result type (might be due to invalid IL or missing references) //IL_05eb: Unknown result type (might be due to invalid IL or missing references) //IL_05f6: Unknown result type (might be due to invalid IL or missing references) //IL_0601: Unknown result type (might be due to invalid IL or missing references) //IL_060a: Expected O, but got Unknown //IL_0619: Unknown result type (might be due to invalid IL or missing references) //IL_061e: Unknown result type (might be due to invalid IL or missing references) //IL_0629: Unknown result type (might be due to invalid IL or missing references) //IL_0634: Unknown result type (might be due to invalid IL or missing references) //IL_063d: Expected O, but got Unknown //IL_064c: Unknown result type (might be due to invalid IL or missing references) //IL_0651: Unknown result type (might be due to invalid IL or missing references) //IL_065c: Unknown result type (might be due to invalid IL or missing references) //IL_0667: Unknown result type (might be due to invalid IL or missing references) //IL_0670: Expected O, but got Unknown //IL_067f: Unknown result type (might be due to invalid IL or missing references) //IL_0684: Unknown result type (might be due to invalid IL or missing references) //IL_068f: Unknown result type (might be due to invalid IL or missing references) //IL_069a: Unknown result type (might be due to invalid IL or missing references) //IL_06a3: Expected O, but got Unknown //IL_06b2: Unknown result type (might be due to invalid IL or missing references) //IL_06b7: Unknown result type (might be due to invalid IL or missing references) //IL_06c2: Unknown result type (might be due to invalid IL or missing references) //IL_06cd: Unknown result type (might be due to invalid IL or missing references) //IL_06d6: Expected O, but got Unknown //IL_06e5: Unknown result type (might be due to invalid IL or missing references) //IL_06ea: Unknown result type (might be due to invalid IL or missing references) //IL_06f5: Unknown result type (might be due to invalid IL or missing references) //IL_0700: Unknown result type (might be due to invalid IL or missing references) //IL_0709: Expected O, but got Unknown Fsm fsm = attackControl.Fsm; _bossAnimator = ((Component)attackControl).gameObject.GetComponent(); _coroutineRunner = (MonoBehaviour)(object)attackControl; _bossTransform = ((Component)attackControl).gameObject.transform; if ((Object)(object)_tripleTargetDummy == (Object)null) { _tripleTargetDummy = new GameObject("Nuke Triple Target Dummy"); _tripleTargetDummy.transform.SetParent(((Component)attackControl).gameObject.transform.parent); Object.DontDestroyOnLoad((Object)(object)_tripleTargetDummy); } _controlFsm = ((IEnumerable)((Component)attackControl).gameObject.GetComponents()).FirstOrDefault((Func)((PlayMakerFSM f) => f.FsmName == "Control")); if ((Object)(object)_controlFsm == (Object)null) { Log.Warn("Nuke.BuildAttackFSM: Could not find Control FSM on boss!"); } if ((Object)(object)_bossAnimator == (Object)null) { Log.Warn("Nuke.BuildAttackFSM: Could not find tk2dSpriteAnimator on boss!"); } else { tk2dSpriteAnimationClip clipByName = _bossAnimator.GetClipByName("Cast"); if (clipByName != null) { _originalCastFps = clipByName.fps; Log.Info($"Nuke: Cached Cast animation fps: {_originalCastFps}"); } tk2dSpriteAnimationClip clipByName2 = _bossAnimator.GetClipByName("Dash Antic"); if (clipByName2 != null) { _originalDashAnticFps = clipByName2.fps; Log.Info($"Nuke: Cached Dash Antic animation fps: {_originalDashAnticFps}"); } tk2dSpriteAnimationClip clipByName3 = _bossAnimator.GetClipByName("Dash"); if (clipByName3 != null) { _originalDashFps = clipByName3.fps; Log.Info($"Nuke: Cached Dash animation fps: {_originalDashFps}"); } } FsmState val = CreatePrepareState(fsm, tripleNukeBool); FsmState val2 = CreatePreparedBranchState(fsm, tripleNukeBool); FsmState val3 = CreateSummonState(fsm); FsmState val4 = CreateCastState(fsm); FsmState val5 = CreateRecoverState(fsm); FsmState val6 = CreateTripleState(fsm, tripleNukeBool, hasTripleNukedBool); FsmState val7 = CreateTripleSummonNState(fsm, "Nuke Triple Summon 1", 1); FsmState val8 = CreateTripleCastNState(fsm, "Nuke Triple Cast 1", 1); FsmState val9 = CreateTripleDashAnticState(fsm, "Nuke Triple Dash Antic 2", 2); FsmState val10 = CreateTripleDashState(fsm, "Nuke Triple Dash 2", 2); FsmState val11 = CreateTripleSummonNState(fsm, "Nuke Triple Summon 2", 2); FsmState val12 = CreateTripleCastNState(fsm, "Nuke Triple Cast 2", 2); FsmState val13 = CreateTripleDashAnticState(fsm, "Nuke Triple Dash Antic 3", 3); FsmState val14 = CreateTripleDashState(fsm, "Nuke Triple Dash 3", 3); FsmState val15 = CreateTripleSummonNState(fsm, "Nuke Triple Summon 3", 3); FsmState val16 = CreateTripleCastNState(fsm, "Nuke Triple Cast 3", 3); FsmState val17 = CreateTripleDashAnticState(fsm, "Nuke Triple Dash Antic 4", 4); FsmState val18 = CreateTripleDashState(fsm, "Nuke Triple Dash 4", 4); FsmState val19 = CreateTripleSummon4State(fsm); FsmState val20 = CreateTripleCast4State(fsm); FsmState val21 = CreateTripleCast4CleanupState(fsm, hasTripleNukedBool); FsmState val22 = CreateTripleCast4DelayState(fsm); val.Transitions = (FsmTransition[])(object)new FsmTransition[1] { new FsmTransition { FsmEvent = FsmEvent.GetFsmEvent("ATTACK PREPARED"), ToState = "Nuke Prepared Branch", ToFsmState = val2 } }; val2.Transitions = (FsmTransition[])(object)new FsmTransition[2] { new FsmTransition { FsmEvent = FsmEvent.GetFsmEvent("TRIPLE"), ToState = "Nuke Triple", ToFsmState = val6 }, new FsmTransition { FsmEvent = FsmEvent.Finished, ToState = "Nuke Summon", ToFsmState = val3 } }; val3.Transitions = (FsmTransition[])(object)new FsmTransition[1] { new FsmTransition { FsmEvent = FsmEvent.Finished, ToState = "Nuke Cast", ToFsmState = val4 } }; val4.Transitions = (FsmTransition[])(object)new FsmTransition[1] { new FsmTransition { FsmEvent = FsmEvent.Finished, ToState = "Nuke Recover", ToFsmState = val5 } }; val5.Transitions = (FsmTransition[])(object)new FsmTransition[1] { new FsmTransition { FsmEvent = FsmEvent.Finished, ToState = idleState.Name, ToFsmState = idleState } }; val6.Transitions = (FsmTransition[])(object)new FsmTransition[1] { new FsmTransition { FsmEvent = FsmEvent.Finished, ToState = "Nuke Triple Summon 1", ToFsmState = val7 } }; val7.Transitions = (FsmTransition[])(object)new FsmTransition[1] { new FsmTransition { FsmEvent = FsmEvent.Finished, ToState = "Nuke Triple Cast 1", ToFsmState = val8 } }; val8.Transitions = (FsmTransition[])(object)new FsmTransition[1] { new FsmTransition { FsmEvent = FsmEvent.Finished, ToState = "Nuke Triple Dash Antic 2", ToFsmState = val9 } }; val9.Transitions = (FsmTransition[])(object)new FsmTransition[1] { new FsmTransition { FsmEvent = FsmEvent.Finished, ToState = "Nuke Triple Dash 2", ToFsmState = val10 } }; val10.Transitions = (FsmTransition[])(object)new FsmTransition[1] { new FsmTransition { FsmEvent = FsmEvent.Finished, ToState = "Nuke Triple Summon 2", ToFsmState = val11 } }; val11.Transitions = (FsmTransition[])(object)new FsmTransition[1] { new FsmTransition { FsmEvent = FsmEvent.Finished, ToState = "Nuke Triple Cast 2", ToFsmState = val12 } }; val12.Transitions = (FsmTransition[])(object)new FsmTransition[1] { new FsmTransition { FsmEvent = FsmEvent.Finished, ToState = "Nuke Triple Dash Antic 3", ToFsmState = val13 } }; val13.Transitions = (FsmTransition[])(object)new FsmTransition[1] { new FsmTransition { FsmEvent = FsmEvent.Finished, ToState = "Nuke Triple Dash 3", ToFsmState = val14 } }; val14.Transitions = (FsmTransition[])(object)new FsmTransition[1] { new FsmTransition { FsmEvent = FsmEvent.Finished, ToState = "Nuke Triple Summon 3", ToFsmState = val15 } }; val15.Transitions = (FsmTransition[])(object)new FsmTransition[1] { new FsmTransition { FsmEvent = FsmEvent.Finished, ToState = "Nuke Triple Cast 3", ToFsmState = val16 } }; val16.Transitions = (FsmTransition[])(object)new FsmTransition[1] { new FsmTransition { FsmEvent = FsmEvent.Finished, ToState = "Nuke Triple Dash Antic 4", ToFsmState = val17 } }; val17.Transitions = (FsmTransition[])(object)new FsmTransition[1] { new FsmTransition { FsmEvent = FsmEvent.Finished, ToState = "Nuke Triple Dash 4", ToFsmState = val18 } }; val18.Transitions = (FsmTransition[])(object)new FsmTransition[1] { new FsmTransition { FsmEvent = FsmEvent.Finished, ToState = "Nuke Triple Summon 4", ToFsmState = val19 } }; val19.Transitions = (FsmTransition[])(object)new FsmTransition[1] { new FsmTransition { FsmEvent = FsmEvent.Finished, ToState = "Nuke Triple Cast 4", ToFsmState = val20 } }; val20.Transitions = (FsmTransition[])(object)new FsmTransition[1] { new FsmTransition { FsmEvent = FsmEvent.Finished, ToState = "Nuke Triple Cast 4 Cleanup", ToFsmState = val21 } }; val21.Transitions = (FsmTransition[])(object)new FsmTransition[1] { new FsmTransition { FsmEvent = FsmEvent.Finished, ToState = "Nuke Triple Cast 4 Delay", ToFsmState = val22 } }; val22.Transitions = (FsmTransition[])(object)new FsmTransition[1] { new FsmTransition { FsmEvent = FsmEvent.Finished, ToState = "Nuke Recover", ToFsmState = val5 } }; fsm.States = fsm.States.Append(val).Append(val2).Append(val3) .Append(val4) .Append(val5) .Append(val6) .Append(val7) .Append(val8) .Append(val9) .Append(val10) .Append(val11) .Append(val12) .Append(val13) .Append(val14) .Append(val15) .Append(val16) .Append(val17) .Append(val18) .Append(val19) .Append(val20) .Append(val21) .Append(val22) .ToArray(); } private static FsmState CreatePrepareState(Fsm fsm, FsmBool tripleNukeBool) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_001b: 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_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_0032: Expected O, but got Unknown //IL_0032: 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_0052: 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_0066: Expected O, but got Unknown //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_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_007f: Expected O, but got Unknown //IL_007f: 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_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Expected O, but got Unknown FsmState val = new FsmState(fsm); val.Name = "Nuke Prepare"; val.Actions = (FsmStateAction[])(object)new FsmStateAction[2] { (FsmStateAction)new SetFsmBool { gameObject = new FsmOwnerDefault { OwnerOption = (OwnerDefaultOption)0 }, fsmName = FsmString.op_Implicit("Control"), variableName = FsmString.op_Implicit("Attack Prepare"), setValue = FsmBool.op_Implicit(true), everyFrame = false }, (FsmStateAction)new SetVelocity2d { gameObject = new FsmOwnerDefault { OwnerOption = (OwnerDefaultOption)0 }, x = FsmFloat.op_Implicit(0f), y = FsmFloat.op_Implicit(0f), everyFrame = false } }; return val; } private static FsmState CreatePreparedBranchState(Fsm fsm, FsmBool tripleNukeBool) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_001b: 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_0027: 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_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown FsmState val = new FsmState(fsm); val.Name = "Nuke Prepared Branch"; val.Actions = (FsmStateAction[])(object)new FsmStateAction[1] { (FsmStateAction)new BoolTest { boolVariable = tripleNukeBool, isTrue = FsmEvent.GetFsmEvent("TRIPLE"), isFalse = FsmEvent.Finished, everyFrame = false } }; return val; } private static FsmState CreateTripleState(Fsm fsm, FsmBool tripleNukeBool, FsmBool hasTripleNukedBool) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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_004d: Expected O, but got Unknown Fsm fsm2 = fsm; FsmState val = new FsmState(fsm2); val.Name = "Nuke Triple"; val.Actions = (FsmStateAction[])(object)new FsmStateAction[2] { (FsmStateAction)new SetBoolValue { boolVariable = tripleNukeBool, boolValue = FsmBool.op_Implicit(false), everyFrame = false }, new InvokeMethod(delegate { Log.Info("=== TRIPLE NUKE STARTING ==="); Log.Info(" Boss will dash towards player 4 times, summoning a nuke each time"); Log.Info($" Dash animation speed: {1.2f:F2}x"); Log.Info("=== TRIPLE NUKE INITIALIZED ==="); fsm2.Event(FsmEvent.Finished); }) }; return val; } private static FsmState CreateTripleDashAnticState(Fsm fsm, string stateName, int nukeNumber) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_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) //IL_005b: Expected O, but got Unknown //IL_005b: 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_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Expected O, but got Unknown //IL_0071: 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_0094: 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_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Expected O, but got Unknown //IL_00b0: 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_00b6: 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_00c7: Expected O, but got Unknown //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Expected O, but got Unknown //IL_00dd: 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_00ec: Expected O, but got Unknown //IL_00ee: 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_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Expected O, but got Unknown //IL_0105: 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_011d: Expected O, but got Unknown FsmEvent @event = fsm.GetEvent("FINISHED"); FsmState val = new FsmState(fsm); val.Name = stateName; val.Actions = (FsmStateAction[])(object)new FsmStateAction[4] { new InvokeMethod(delegate { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0163: 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)_tripleTargetDummy != (Object)null && (Object)(object)_bossTransform != (Object)null) { float x = _bossTransform.position.x; float num; if (x > 50f) { num = 40f; Log.Info($"Triple Dash Antic {nukeNumber}: Boss at X={x:F1} (> {50f}), facing middle at X={num:F1}"); } else if (x < 30f) { num = 40f; Log.Info($"Triple Dash Antic {nukeNumber}: Boss at X={x:F1} (< {30f}), facing middle at X={num:F1}"); } else { HeroController instance = HeroController.instance; if ((Object)(object)instance != (Object)null) { num = ((Component)instance).gameObject.transform.position.x; Log.Info($"Triple Dash Antic {nukeNumber}: Boss at X={x:F1} (safe zone), facing player at X={num:F1}"); } else { num = 40f; Log.Warn($"Triple Dash Antic {nukeNumber}: No hero found, facing middle"); } } _tripleTargetDummy.transform.position = new Vector3(num, _bossTransform.position.y, 0f); } if ((Object)(object)_bossAnimator != (Object)null && _originalDashAnticFps > 0f) { tk2dSpriteAnimationClip clipByName = _bossAnimator.GetClipByName("Dash Antic"); if (clipByName != null) { clipByName.fps = _originalDashAnticFps * 1.2f; Log.Info($"Triple Dash Antic {nukeNumber}: Set clip.fps to {clipByName.fps} (original: {_originalDashAnticFps}, multiplier: {1.2f})"); } } }), (FsmStateAction)new FaceObjectV2 { objectA = new FsmOwnerDefault { OwnerOption = (OwnerDefaultOption)0 }, objectB = new FsmGameObject { Value = _tripleTargetDummy }, spriteFacesRight = FsmBool.op_Implicit(false), playNewAnimation = false, newAnimationClip = FsmString.op_Implicit(""), resetFrame = false, everyFrame = false, pauseBetweenTurns = 0.5f }, (FsmStateAction)new Tk2dPlayAnimationWithEvents { gameObject = new FsmOwnerDefault { OwnerOption = (OwnerDefaultOption)0 }, clipName = new FsmString { Value = "Dash Antic" }, animationTriggerEvent = null, animationCompleteEvent = @event }, (FsmStateAction)new DecelerateV2 { gameObject = new FsmOwnerDefault { OwnerOption = (OwnerDefaultOption)0 }, deceleration = FsmFloat.op_Implicit(0.9f), brakeOnExit = false } }; return val; } private static FsmState CreateTripleDashState(Fsm fsm, string stateName, int nukeNumber) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_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) //IL_005b: Expected O, but got Unknown //IL_005b: 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_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Expected O, but got Unknown //IL_0071: 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_0080: Expected O, but got Unknown //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0088: 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_0099: Expected O, but got Unknown //IL_0099: 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_00b1: Expected O, but got Unknown FsmEvent @event = fsm.GetEvent("FINISHED"); FsmState val = new FsmState(fsm); val.Name = stateName; val.Actions = (FsmStateAction[])(object)new FsmStateAction[3] { new InvokeMethod(delegate { //IL_00b3: 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) PlayTripleDashAudio(); if ((Object)(object)_bossAnimator != (Object)null && _originalDashAnticFps > 0f) { tk2dSpriteAnimationClip clipByName = _bossAnimator.GetClipByName("Dash Antic"); if (clipByName != null) { clipByName.fps = _originalDashAnticFps; } } if ((Object)(object)_bossAnimator != (Object)null && _originalDashFps > 0f) { tk2dSpriteAnimationClip clipByName2 = _bossAnimator.GetClipByName("Dash"); if (clipByName2 != null) { clipByName2.fps = _originalDashFps * 1.2f; Log.Info($"Triple Dash {nukeNumber}: Set Dash clip.fps to {clipByName2.fps}"); } } if ((Object)(object)_bossTransform != (Object)null) { float x = _bossTransform.localScale.x; float num = ((x > 0f) ? (-50f) : 50f); Rigidbody2D component = ((Component)_bossTransform).GetComponent(); if ((Object)(object)component != (Object)null) { component.velocity = new Vector2(num, 0f); Log.Info($"Triple Dash {nukeNumber}: Dashing with velocity X={num} (scale.x={x})"); } else { Log.Warn($"Triple Dash {nukeNumber}: Could not find Rigidbody2D!"); } } }), (FsmStateAction)new Tk2dPlayAnimationWithEvents { gameObject = new FsmOwnerDefault { OwnerOption = (OwnerDefaultOption)0 }, clipName = new FsmString { Value = "Dash" }, animationTriggerEvent = null, animationCompleteEvent = @event }, (FsmStateAction)new DecelerateV2 { gameObject = new FsmOwnerDefault { OwnerOption = (OwnerDefaultOption)0 }, deceleration = FsmFloat.op_Implicit(0.92f), brakeOnExit = false } }; return val; } private static FsmState CreateTripleSummonNState(Fsm fsm, string stateName, int nukeNumber) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown //IL_0038: 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_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) //IL_004f: Expected O, but got Unknown //IL_004f: 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_0067: Expected O, but got Unknown //IL_00b9: 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_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Expected O, but got Unknown FsmState val = new FsmState(fsm); val.Name = stateName; val.Actions = (FsmStateAction[])(object)new FsmStateAction[7] { new InvokeMethod(delegate { Log.Info($"=== TRIPLE SUMMON {nukeNumber} ENTERED ==="); }), (FsmStateAction)new DecelerateV2 { gameObject = new FsmOwnerDefault { OwnerOption = (OwnerDefaultOption)0 }, deceleration = FsmFloat.op_Implicit(0.92f), brakeOnExit = false }, new InvokeMethod(delegate { if ((Object)(object)_bossAnimator != (Object)null && _originalDashFps > 0f) { tk2dSpriteAnimationClip clipByName = _bossAnimator.GetClipByName("Dash"); if (clipByName != null) { clipByName.fps = _originalDashFps; } } PlayNukeSummonAudio(); Log.Info($"Triple Summon {nukeNumber}: Playing summon audio"); }), new InvokeMethod(delegate { NukeOrb.TriggerAttack(); Log.Info($"Triple Summon {nukeNumber}: Triggered NukeOrb attack"); }), new InvokeMethod(delegate { BossAnimation.PlayNukeSummon(); Log.Info($"Triple Summon {nukeNumber}: Called BossAnimation.PlayNukeSummon()"); }), new InvokeMethod(delegate { Log.Info($"Triple Summon {nukeNumber}: Started summon animation, waiting {1.1538461f:F3}s before FINISHED event"); }), (FsmStateAction)new Wait { time = FsmFloat.op_Implicit(1.1538461f), finishEvent = FsmEvent.Finished, realTime = false } }; return val; } private static FsmState CreateTripleSummon4State(Fsm fsm) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: 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_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Expected O, but got Unknown //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Expected O, but got Unknown //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Expected O, but got Unknown FsmState val = new FsmState(fsm); val.Name = "Nuke Triple Summon 4"; val.Actions = (FsmStateAction[])(object)new FsmStateAction[7] { new InvokeMethod(delegate { Log.Info("=== TRIPLE SUMMON 4 ENTERED ==="); }), (FsmStateAction)new DecelerateV2 { gameObject = new FsmOwnerDefault { OwnerOption = (OwnerDefaultOption)0 }, deceleration = FsmFloat.op_Implicit(0.92f), brakeOnExit = false }, new InvokeMethod(delegate { if ((Object)(object)_bossAnimator != (Object)null && _originalDashFps > 0f) { tk2dSpriteAnimationClip clipByName = _bossAnimator.GetClipByName("Dash"); if (clipByName != null) { clipByName.fps = _originalDashFps; } } PlayNukeSummonAudio(); Log.Info("Triple Summon 4: Playing summon audio"); }), new InvokeMethod(delegate { NukeOrb.TriggerAttack(); Log.Info("Triple Summon 4: Triggered NukeOrb attack"); }), new InvokeMethod(delegate { BossAnimation.PlayNukeSummon(); Log.Info("Triple Summon 4: Called BossAnimation.PlayNukeSummon()"); }), new InvokeMethod(delegate { Log.Info($"Triple Summon 4: Started summon animation, waiting {1.1538461f:F3}s before FINISHED event"); }), (FsmStateAction)new Wait { time = FsmFloat.op_Implicit(1.1538461f), finishEvent = FsmEvent.Finished, realTime = false } }; return val; } private static FsmState CreateTripleCastNState(Fsm fsm, string stateName, int nukeNumber) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //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_0050: 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_0063: Expected O, but got Unknown FsmState val = new FsmState(fsm); val.Name = stateName; val.Actions = (FsmStateAction[])(object)new FsmStateAction[2] { new InvokeCoroutine(PlayCastWithDynamicSpeed, wait: true), (FsmStateAction)new Wait { time = FsmFloat.op_Implicit(0.01f), finishEvent = FsmEvent.Finished, realTime = false } }; return val; } private static void PlayTripleDashAudio() { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Expected O, but got Unknown //IL_008a: Unknown result type (might be due to invalid IL or missing references) int num = Random.Range(1, 5); string text = $"silk_boss_move_{num}"; AudioClip val = AssetManager.Get(text); if ((Object)(object)val == (Object)null) { Log.Warn("Nuke: Dash audio clip '" + text + "' not found"); return; } GameObject val2 = new GameObject("NukeDashAudio_" + text); if ((Object)(object)_controlFsm != (Object)null && (Object)(object)((Component)_controlFsm).gameObject != (Object)null) { val2.transform.SetParent(((Component)_controlFsm).transform); val2.transform.localPosition = Vector3.zero; } AudioSource val3 = val2.AddComponent(); val3.clip = val; val3.volume = 1f; val3.pitch = 1.25f; val3.playOnAwake = false; val3.loop = false; val3.spatialBlend = 0f; if ((Object)(object)_controlFsm != (Object)null) { AudioSource componentInChildren = ((Component)_controlFsm).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { val3.outputAudioMixerGroup = componentInChildren.outputAudioMixerGroup; } } val2.AddComponent().Initialize(val3, val.length + 0.1f); val3.Play(); Log.Info("Triple Nuke: Playing dash audio " + text); } private static FsmState CreateSummonState(Fsm fsm) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_001b: 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_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_0032: Expected O, but got Unknown //IL_0032: 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_004a: Expected O, but got Unknown //IL_00c1: 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_00d6: 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: Expected O, but got Unknown FsmState val = new FsmState(fsm); val.Name = "Nuke Summon"; val.Actions = (FsmStateAction[])(object)new FsmStateAction[5] { (FsmStateAction)new DecelerateV2 { gameObject = new FsmOwnerDefault { OwnerOption = (OwnerDefaultOption)0 }, deceleration = FsmFloat.op_Implicit(0.92f), brakeOnExit = false }, new InvokeMethod(delegate { PlayNukeSummonAudio(); }), new InvokeMethod(delegate { NukeOrb.TriggerAttack(); Log.Info("Summon: Triggered NukeOrb attack from pool"); }), new InvokeMethod(delegate { BossAnimation.PlayNukeSummon(); Log.Info("Summon: Called BossAnimation.PlayNukeSummon()"); }), (FsmStateAction)new Wait { time = FsmFloat.op_Implicit(1.1538461f), finishEvent = FsmEvent.Finished, realTime = false } }; return val; } private static FsmState CreateCastState(Fsm fsm) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown FsmState val = new FsmState(fsm); val.Name = "Nuke Cast"; val.Actions = (FsmStateAction[])(object)new FsmStateAction[1] { new InvokeCoroutine(PlayCastWithDynamicSpeed, wait: true) }; return val; } [IteratorStateMachine(typeof(d__57))] private static IEnumerator PlayCastWithDynamicSpeed() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__57(0); } private static FsmState CreateRecoverState(Fsm fsm) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown //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_007d: 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_0090: Expected O, but got Unknown Fsm fsm2 = fsm; FsmState val = new FsmState(fsm2); val.Name = "Nuke Recover"; val.Actions = (FsmStateAction[])(object)new FsmStateAction[3] { new InvokeMethod(delegate { _ = (Object)(object)_bossAnimator != (Object)null; }), new InvokeMethod(delegate { PlayMakerFSM val2 = FSMUtility.LocateMyFSM(fsm2.GameObject, "Control"); if ((Object)(object)val2 != (Object)null) { val2.SendEvent("MOVE START"); } }), (FsmStateAction)new Wait { time = FsmFloat.op_Implicit(0.8f), finishEvent = FsmEvent.Finished, realTime = false } }; return val; } private static void PlayNukeSummonAudio() { string text = ((Random.value < 0.5f) ? "silkboss_nuke_summon_A" : "silkboss_nuke_summon_B"); PlayOneShotAudio(text); Log.Info("Nuke: Playing summon audio: " + text); } private static void PlayOneShotAudio(string clipName) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Expected O, but got Unknown //IL_0071: Unknown result type (might be due to invalid IL or missing references) AudioClip val = AssetManager.Get(clipName); if ((Object)(object)val == (Object)null) { Log.Warn("Nuke: Audio clip '" + clipName + "' not found"); return; } GameObject val2 = new GameObject("NukeAudio_" + clipName); if ((Object)(object)_controlFsm != (Object)null && (Object)(object)((Component)_controlFsm).gameObject != (Object)null) { val2.transform.SetParent(((Component)_controlFsm).transform); val2.transform.localPosition = Vector3.zero; } AudioSource val3 = val2.AddComponent(); val3.clip = val; val3.volume = 1f; val3.pitch = Random.Range(0.97f, 1f); val3.playOnAwake = false; val3.loop = false; val3.spatialBlend = 0f; if ((Object)(object)_controlFsm != (Object)null) { AudioSource componentInChildren = ((Component)_controlFsm).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { val3.outputAudioMixerGroup = componentInChildren.outputAudioMixerGroup; } } val2.AddComponent().Initialize(val3, val.length + 0.1f); val3.Play(); } private static FsmState CreateTripleCast4State(Fsm fsm) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: 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_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Expected O, but got Unknown //IL_005d: 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_0070: Expected O, but got Unknown FsmState val = new FsmState(fsm); val.Name = "Nuke Triple Cast 4"; val.Actions = (FsmStateAction[])(object)new FsmStateAction[2] { new InvokeMethod(delegate { Log.Info("=== TRIPLE CAST 4 ENTERED ==="); if ((Object)(object)_bossAnimator != (Object)null) { Log.Info(string.Format("Triple Cast 4: Animator BEFORE - Clip={0}, Playing={1}", _bossAnimator.CurrentClip?.name ?? "null", _bossAnimator.Playing)); _bossAnimator.Play("Cast"); Log.Info(string.Format("Triple Cast 4: Animator AFTER Play() - Clip={0}, Playing={1}", _bossAnimator.CurrentClip?.name ?? "null", _bossAnimator.Playing)); Log.Info($"Triple Cast 4: Now waiting {1.9f}s for animation to complete..."); } else { Log.Error("Triple Cast 4: _bossAnimator is NULL!"); } }), (FsmStateAction)new Wait { time = new FsmFloat { Value = 1.9f }, finishEvent = FsmEvent.Finished, realTime = false } }; return val; } private static FsmState CreateTripleCast4CleanupState(Fsm fsm, FsmBool hasTripleNukedBool) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: 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_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Expected O, but got Unknown //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_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_008d: Expected O, but got Unknown //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: 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_00a6: Expected O, but got Unknown //IL_00a6: 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_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Expected O, but got Unknown //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_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown //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_012b: 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_0140: Expected O, but got Unknown //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Expected O, but got Unknown FsmState val = new FsmState(fsm); val.Name = "Nuke Triple Cast 4 Cleanup"; val.Actions = (FsmStateAction[])(object)new FsmStateAction[6] { new InvokeMethod(delegate { Log.Info("=== TRIPLE CAST 4 CLEANUP ENTERED ==="); Log.Info("Triple Cast 4 Cleanup: Cast animation complete, now setting flags..."); }), (FsmStateAction)new SetFsmBool { gameObject = new FsmOwnerDefault { OwnerOption = (OwnerDefaultOption)0 }, fsmName = FsmString.op_Implicit("Attack Control"), variableName = FsmString.op_Implicit("Can Rubble Attack"), setValue = FsmBool.op_Implicit(true), everyFrame = false }, (FsmStateAction)new SetFsmBool { gameObject = new FsmOwnerDefault { OwnerOption = (OwnerDefaultOption)0 }, fsmName = FsmString.op_Implicit("Attack Control"), variableName = FsmString.op_Implicit("Can Spike Pull"), setValue = FsmBool.op_Implicit(true), everyFrame = false }, (FsmStateAction)new SetBoolValue { boolVariable = hasTripleNukedBool, boolValue = FsmBool.op_Implicit(true), everyFrame = false }, new InvokeMethod(delegate { Log.Info("Triple Cast 4 Cleanup: All flags set. Transitioning to Delay state..."); }), (FsmStateAction)new Wait { time = new FsmFloat { Value = 0.3f }, finishEvent = FsmEvent.Finished, realTime = false } }; return val; } private static FsmState CreateTripleCast4DelayState(Fsm fsm) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: 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_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Expected O, but got Unknown //IL_005d: 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_0070: Expected O, but got Unknown FsmState val = new FsmState(fsm); val.Name = "Nuke Triple Cast 4 Delay"; val.Actions = (FsmStateAction[])(object)new FsmStateAction[2] { new InvokeMethod(delegate { }), (FsmStateAction)new Wait { time = new FsmFloat { Value = 1f }, finishEvent = FsmEvent.Finished, realTime = false } }; return val; } } internal class NukeOrb : MonoBehaviour { [CompilerGenerated] private sealed class d__110 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public NukeOrb <>4__this; private float[] 5__2; private float 5__3; private float 5__4; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__110(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__2 = null; <>1__state = -2; } private bool MoveNext() { int num = <>1__state; NukeOrb nukeOrb = <>4__this; switch (num) { default: return false; case 0: { <>1__state = -1; 5__2 = new float[4]; for (int i = 0; i < 4; i++) { if ((Object)(object)nukeOrb._anticRuneFadeObjects[i] != (Object)null) { nukeOrb._anticRuneFadeObjects[i].SetActive(true); 5__2[i] = 0f; nukeOrb.SetSpriteAlpha(nukeOrb._anticRuneFadeSprites[i], 0f); } } 5__3 = 0.55f; 5__4 = 0f; break; } case 1: <>1__state = -1; break; } if (5__4 < 5__3) { 5__4 += Time.deltaTime; for (int j = 0; j < 4; j++) { float num2 = (float)j * 0.1f; float num3 = num2 + 0.1f; float num4 = num3 + 0.05f; float num5 = num4 + 0.1f; if (5__4 < num2) { 5__2[j] = 0f; } else if (5__4 < num3) { float num6 = (5__4 - num2) / 0.1f; 5__2[j] = Mathf.Clamp01(num6); } else if (5__4 < num4) { 5__2[j] = 1f; } else if (5__4 < num5) { float num7 = (5__4 - num4) / 0.1f; 5__2[j] = Mathf.Clamp01(1f - num7); } else { 5__2[j] = 0f; } nukeOrb.SetSpriteAlpha(nukeOrb._anticRuneFadeSprites[j], 5__2[j]); } <>2__current = null; <>1__state = 1; return true; } for (int k = 0; k < 4; k++) { nukeOrb.SetSpriteAlpha(nukeOrb._anticRuneFadeSprites[k], 0f); if ((Object)(object)nukeOrb._anticRuneFadeObjects[k] != (Object)null) { nukeOrb._anticRuneFadeObjects[k].SetActive(false); } } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__104 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public NukeOrb <>4__this; private float 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__104(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Expected O, but got Unknown //IL_0091: Unknown result type (might be due to invalid IL or missing references) int num = <>1__state; NukeOrb nukeOrb = <>4__this; switch (num) { default: return false; case 0: { <>1__state = -1; float delay = 0.38000003f; nukeOrb.ScheduleAudio("silkboss_nuke_explode", delay); <>2__current = (object)new WaitForSeconds(0.35f); <>1__state = 1; return true; } case 1: <>1__state = -1; nukeOrb._nukeExplosionFillObject.SetActive(true); nukeOrb.SetSpriteAlpha(nukeOrb._nukeExplosionFillSprite, 0f); nukeOrb._nukeExplosionFillObject.transform.localScale = Vector3.one; 5__2 = 0f; goto IL_00f8; case 2: <>1__state = -1; goto IL_00f8; case 3: { <>1__state = -1; break; } IL_00f8: if (5__2 < 0.25f) { 5__2 += Time.deltaTime; float num2 = Mathf.Clamp01(5__2 / 0.25f); float alpha = num2 * num2 * num2; nukeOrb.SetSpriteAlpha(nukeOrb._nukeExplosionFillSprite, alpha); <>2__current = null; <>1__state = 2; return true; } nukeOrb.SetSpriteAlpha(nukeOrb._nukeExplosionFillSprite, 1f); nukeOrb._nukeExplosionCoroutine = ((MonoBehaviour)nukeOrb).StartCoroutine(nukeOrb.AnimateNukeExplosion()); nukeOrb._nukeExplosionRuneCoroutine = ((MonoBehaviour)nukeOrb).StartCoroutine(nukeOrb.AnimateNukeExplosionRune()); 5__2 = 0f; break; } if (5__2 < 0.2f) { 5__2 += Time.deltaTime; float num3 = Mathf.Clamp01(5__2 / 0.2f); nukeOrb.SetSpriteAlpha(nukeOrb._nukeExplosionFillSprite, 1f - num3); <>2__current = null; <>1__state = 3; return true; } nukeOrb.SetSpriteAlpha(nukeOrb._nukeExplosionFillSprite, 0f); nukeOrb._nukeExplosionFillObject.SetActive(false); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__102 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public NukeOrb <>4__this; private float[] 5__2; private float 5__3; private float 5__4; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__102(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_02d7: Unknown result type (might be due to invalid IL or missing references) //IL_02e1: Expected O, but got Unknown int num = <>1__state; NukeOrb nukeOrb = <>4__this; GameObject obj; GameObject obj2; switch (num) { default: return false; case 0: { <>1__state = -1; 5__2 = new float[3]; for (int i = 0; i < 3; i++) { if ((Object)(object)nukeOrb._impactRingObjects[i] != (Object)null) { nukeOrb._impactRingObjects[i].SetActive(true); nukeOrb._impactRingObjects[i].transform.localScale = Vector3.one; 5__2[i] = 0f; nukeOrb.SetSpriteAlpha(nukeOrb._impactRingSprites[i], 0f); } } 5__3 = 0.3f; 5__4 = 0f; goto IL_025f; } case 1: <>1__state = -1; goto IL_025f; case 2: <>1__state = -1; 5__4 = 0f; break; case 3: { <>1__state = -1; break; } IL_025f: if (5__4 < 5__3) { 5__4 += Time.deltaTime; if (5__4 < 0.15f) { 5__2[0] = Mathf.Clamp01(5__4 / 0.15f); } else if (5__4 < 0.3f) { float num2 = (5__4 - 0.15f) / 0.15f; 5__2[0] = Mathf.Clamp01(1f - num2); } else { 5__2[0] = 0f; } if (5__4 < 0.15f) { 5__2[1] = 0f; } else if (5__4 < 0.3f) { float num3 = (5__4 - 0.15f) / 0.15f; 5__2[1] = Mathf.Clamp01(num3); } else if (5__4 < 0.45000002f) { float num4 = (5__4 - 0.3f) / 0.15f; 5__2[1] = Mathf.Clamp01(1f - num4); } else { 5__2[1] = 0f; } if (5__4 < 0.3f) { 5__2[2] = 0f; } else if (5__4 < 0.45000002f) { float num5 = (5__4 - 0.3f) / 0.15f; 5__2[2] = Mathf.Clamp01(num5); } else { 5__2[2] = 1f; } for (int j = 0; j < 3; j++) { nukeOrb.SetSpriteAlpha(nukeOrb._impactRingSprites[j], 5__2[j]); } <>2__current = null; <>1__state = 1; return true; } nukeOrb.SetSpriteAlpha(nukeOrb._impactRingSprites[0], 0f); obj = nukeOrb._impactRingObjects[0]; if (obj != null) { obj.SetActive(false); } nukeOrb.SetSpriteAlpha(nukeOrb._impactRingSprites[1], 0f); obj2 = nukeOrb._impactRingObjects[1]; if (obj2 != null) { obj2.SetActive(false); } nukeOrb.SetSpriteAlpha(nukeOrb._impactRingSprites[2], 1f); <>2__current = (object)new WaitForSeconds(0.5f); <>1__state = 2; return true; } if (5__4 < 0.3f) { 5__4 += Time.deltaTime; float num6 = Mathf.Clamp01(5__4 / 0.3f); nukeOrb.SetSpriteAlpha(nukeOrb._impactRingSprites[2], 1f - num6); <>2__current = null; <>1__state = 3; return true; } nukeOrb.SetSpriteAlpha(nukeOrb._impactRingSprites[2], 0f); GameObject obj3 = nukeOrb._impactRingObjects[2]; if (obj3 != null) { obj3.SetActive(false); } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__105 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public NukeOrb <>4__this; private float 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__105(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Expected O, but got Unknown int num = <>1__state; NukeOrb nukeOrb = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; nukeOrb._explosionShakeCoroutine = ((MonoBehaviour)nukeOrb).StartCoroutine(nukeOrb.RepeatedBigShakes()); nukeOrb.PlayHotSpringSmoke(); nukeOrb.PlayWebDebris(); nukeOrb._nukeExplosionObject.SetActive(true); nukeOrb.SetSpriteAlpha(nukeOrb._nukeExplosionSprite, 0f); nukeOrb._nukeExplosionObject.transform.localScale = Vector3.one; 5__2 = 0f; goto IL_00d2; case 1: <>1__state = -1; goto IL_00d2; case 2: <>1__state = -1; if ((Object)(object)nukeOrb._explosionHitboxObject != (Object)null) { nukeOrb._explosionHitboxObject.SetActive(false); } 5__2 = 0f; break; case 3: { <>1__state = -1; break; } IL_00d2: if (5__2 < 0.1f) { 5__2 += Time.deltaTime; float alpha = Mathf.Clamp01(5__2 / 0.1f); nukeOrb.SetSpriteAlpha(nukeOrb._nukeExplosionSprite, alpha); <>2__current = null; <>1__state = 1; return true; } nukeOrb.SetSpriteAlpha(nukeOrb._nukeExplosionSprite, 1f); nukeOrb.HideThrowEffect(); if ((Object)(object)nukeOrb._explosionHitboxObject != (Object)null) { nukeOrb._explosionHitboxObject.SetActive(true); nukeOrb.DealExplosionDamage(); } <>2__current = (object)new WaitForSeconds(0.1f); <>1__state = 2; return true; } if (5__2 < 0.4f) { 5__2 += Time.deltaTime; float num2 = Mathf.Clamp01(5__2 / 0.4f); nukeOrb.SetSpriteAlpha(nukeOrb._nukeExplosionSprite, 1f - num2); <>2__current = null; <>1__state = 3; return true; } nukeOrb.SetSpriteAlpha(nukeOrb._nukeExplosionSprite, 0f); nukeOrb._nukeExplosionObject.SetActive(false); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__109 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public NukeOrb <>4__this; private Vector3 5__2; private Vector3 5__3; private float 5__4; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__109(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0058: 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_007a: 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_010f: 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_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) int num = <>1__state; NukeOrb nukeOrb = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; nukeOrb._nukeExplosionRuneObject.SetActive(true); nukeOrb.SetSpriteAlpha(nukeOrb._nukeExplosionRuneSprite, 1f); nukeOrb._nukeExplosionRuneObject.transform.localScale = new Vector3(1f, 1f, 1f); 5__2 = nukeOrb._nukeExplosionRuneObject.transform.localPosition; 5__3 = 5__2 + new Vector3(0f, 4.3f, 0f); 5__4 = 0f; break; case 1: <>1__state = -1; break; } if (5__4 < 0.5f) { 5__4 += Time.deltaTime; float num2 = Mathf.Clamp01(5__4 / 0.5f); float num3 = 1f - Mathf.Pow(1f - num2, 4f); float num4 = Mathf.Lerp(1f, 1.95f, num3); nukeOrb._nukeExplosionRuneObject.transform.localScale = new Vector3(num4, num4, 1f); nukeOrb._nukeExplosionRuneObject.transform.localPosition = Vector3.Lerp(5__2, 5__3, num3); nukeOrb.SetSpriteAlpha(nukeOrb._nukeExplosionRuneSprite, 1f - num2); <>2__current = null; <>1__state = 1; return true; } nukeOrb.SetSpriteAlpha(nukeOrb._nukeExplosionRuneSprite, 0f); nukeOrb._nukeExplosionRuneObject.transform.localScale = new Vector3(1.95f, 1.95f, 1f); nukeOrb._nukeExplosionRuneObject.transform.localPosition = 5__3; nukeOrb._nukeExplosionRuneObject.SetActive(false); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__103 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public NukeOrb <>4__this; private float 5__2; private float 5__3; private float 5__4; private float 5__5; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__103(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0051: 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_0140: Unknown result type (might be due to invalid IL or missing references) int num = <>1__state; NukeOrb nukeOrb = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; nukeOrb._nukeImpactObject.SetActive(true); nukeOrb.SetSpriteAlpha(nukeOrb._nukeImpactSprite, 0f); nukeOrb._nukeImpactObject.transform.localScale = Vector3.one; 5__2 = 0.3f; 5__3 = 0f; 5__4 = 1f; 5__5 = 1.3f; goto IL_0102; case 1: <>1__state = -1; goto IL_0102; case 2: { <>1__state = -1; break; } IL_0102: if (5__3 < 5__2) { 5__3 += Time.deltaTime; float num2 = 5__3 / 5__2; nukeOrb.SetSpriteAlpha(nukeOrb._nukeImpactSprite, num2 * 0.6f); float num3 = Mathf.Lerp(5__4, 5__5, num2); nukeOrb._nukeImpactObject.transform.localScale = new Vector3(num3, num3, 1f); <>2__current = null; <>1__state = 1; return true; } nukeOrb.SetSpriteAlpha(nukeOrb._nukeImpactSprite, 0.6f); nukeOrb._nukeImpactObject.transform.localScale = new Vector3(5__5, 5__5, 1f); 5__3 = 0f; break; } if (5__3 < 0.4f) { 5__3 += Time.deltaTime; float num4 = Mathf.Clamp01(5__3 / 0.4f); nukeOrb.SetSpriteAlpha(nukeOrb._nukeImpactSprite, 0.6f * (1f - num4)); <>2__current = null; <>1__state = 2; return true; } nukeOrb.SetSpriteAlpha(nukeOrb._nukeImpactSprite, 0f); nukeOrb._nukeImpactObject.SetActive(false); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__96 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public NukeOrb <>4__this; private float 5__2; private float 5__3; private float 5__4; private float 5__5; private float 5__6; private float 5__7; private float 5__8; private float 5__9; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__96(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown //IL_0074: 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_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_017b: 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_0209: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) int num = <>1__state; NukeOrb nukeOrb = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.2f); <>1__state = 1; return true; case 1: { <>1__state = -1; float num2 = 17f / 26f; 5__2 = num2 * 0.5f; 5__3 = num2 * 0.5f; 5__4 = ((Component)nukeOrb).transform.position.x; 5__5 = ((Component)nukeOrb).transform.position.y; 5__6 = 5__5 - 0.2f; 5__7 = 5__5 + 0.2f; 5__8 = 0f; goto IL_015d; } case 2: <>1__state = -1; goto IL_015d; case 3: { <>1__state = -1; break; } IL_015d: if (5__8 < 5__2) { 5__8 += Time.deltaTime; float num3 = Mathf.Clamp01(5__8 / 5__2); float num4 = 1f - (1f - num3) * (1f - num3); float num5 = Mathf.Lerp(5__5, 5__6, num4); ((Component)nukeOrb).transform.position = new Vector3(5__4, num5, ((Component)nukeOrb).transform.position.z); <>2__current = null; <>1__state = 2; return true; } nukeOrb.TriggerSmallScreenShake(); 5__9 = ((Component)nukeOrb).transform.position.y; 5__8 = 0f; break; } if (5__8 < 5__3) { 5__8 += Time.deltaTime; float num6 = Mathf.Clamp01(5__8 / 5__3); float num7 = num6 * num6 * (3f - 2f * num6); float num8 = Mathf.Lerp(5__9, 5__7, num7); ((Component)nukeOrb).transform.position = new Vector3(5__4, num8, ((Component)nukeOrb).transform.position.z); <>2__current = null; <>1__state = 3; return true; } ((Component)nukeOrb).transform.position = new Vector3(5__4, 5__7, ((Component)nukeOrb).transform.position.z); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__99 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public NukeOrb <>4__this; public Action onLandingCallback; private float 5__2; private float 5__3; private float 5__4; private float 5__5; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__99(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0116: 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_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) int num = <>1__state; NukeOrb nukeOrb = <>4__this; switch (num) { default: return false; case 0: { <>1__state = -1; 5__2 = ((Component)nukeOrb).transform.position.y; 5__3 = 135.5f; float num2 = 5__2 - 5__3; if (num2 <= 0f) { Log.Warn($"NukeOrb [{((Object)((Component)nukeOrb).gameObject).name}]: Already at or below floor! startY={5__2:F2}, FLOOR_Y={135.5f}"); onLandingCallback?.Invoke(); return false; } _ = num2 / (14f / 135f); 5__4 = 14f / 135f; 5__5 = 0f; break; } case 1: <>1__state = -1; break; } if (5__5 < 5__4) { 5__5 += Time.deltaTime; float num3 = Mathf.Clamp01(5__5 / 5__4); float num4 = num3 * num3; float num5 = Mathf.Lerp(5__2, 5__3, num4); ((Component)nukeOrb).transform.position = new Vector3(((Component)nukeOrb).transform.position.x, num5, ((Component)nukeOrb).transform.position.z); <>2__current = null; <>1__state = 1; return true; } ((Component)nukeOrb).transform.position = new Vector3(((Component)nukeOrb).transform.position.x, 135.5f, ((Component)nukeOrb).transform.position.z); if ((Object)(object)nukeOrb._orbAnimator != (Object)null) { tk2dSpriteAnimationClip currentClip = nukeOrb._orbAnimator.CurrentClip; if (currentClip != null) { nukeOrb._orbAnimator.ClipFps = currentClip.fps * 1.3f; } } nukeOrb.PositionGroundEffects(); onLandingCallback?.Invoke(); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__94 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public float delay; public NukeOrb <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__94(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown int num = <>1__state; NukeOrb nukeOrb = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(delay); <>1__state = 1; return true; case 1: <>1__state = -1; nukeOrb.ShowOrb(); nukeOrb.PlaySummonAnimationWithTelegraph(); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__116 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public float delay; public NukeOrb <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__116(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown int num = <>1__state; NukeOrb nukeOrb = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(delay); <>1__state = 1; return true; case 1: <>1__state = -1; if (DeathHitEntered && ((Component)nukeOrb).gameObject.activeInHierarchy) { nukeOrb.CancelOrb(); } return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__138 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public float delay; public NukeOrb <>4__this; public string clipName; public float pitchMin; public float pitchMax; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__138(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown int num = <>1__state; NukeOrb nukeOrb = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(delay); <>1__state = 1; return true; case 1: <>1__state = -1; nukeOrb.PlayOneShotAudio(clipName, pitchMin, pitchMax); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__107 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public NukeOrb <>4__this; private int 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__107(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Expected O, but got Unknown int num = <>1__state; NukeOrb nukeOrb = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; 5__2 = 0; goto IL_008f; case 1: <>1__state = -1; goto IL_004d; case 2: <>1__state = -1; 5__2++; goto IL_008f; case 3: { <>1__state = -1; break; } IL_008f: if (5__2 >= 3) { break; } goto IL_004d; IL_004d: if (Time.timeScale == 0f) { <>2__current = null; <>1__state = 1; return true; } nukeOrb.TriggerBigScreenShake(); <>2__current = (object)new WaitForSeconds(0.1f); <>1__state = 2; return true; } if (Time.timeScale == 0f) { <>2__current = null; <>1__state = 3; return true; } nukeOrb.TriggerSmallScreenShake(); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__92 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public float delay; public NukeOrb <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__92(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown int num = <>1__state; NukeOrb nukeOrb = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(delay); <>1__state = 1; return true; case 1: <>1__state = -1; nukeOrb.PlayRockDebris(); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__93 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public float delay; public NukeOrb <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__93(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown int num = <>1__state; NukeOrb nukeOrb = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(delay); <>1__state = 1; return true; case 1: <>1__state = -1; nukeOrb.PlayThrowAudio(); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } internal const string STATE_INIT = "Init"; internal const string STATE_FORM = "Form"; internal const string STATE_THROW = "Throw"; internal const string STATE_EXPLODE_ANTIC = "Explode Antic"; internal const string STATE_EXPLODE = "Explode"; internal const string STATE_RESET = "Reset"; internal const string EVENT_ATTACK = "ATTACK"; internal const float FLOOR_Y = 135.5f; internal const float SUMMON_X_OFFSET = 4.8f; internal const float SUMMON_Y_OFFSET = 3.9f; internal const float EXPLOSION_Y_OFFSET = 0.75f; private const float SUMMON_DIP_HEIGHT = 0.2f; private const float SUMMON_RISE_HEIGHT = 0.4f; private const float SUMMON_FINAL_Y_OFFSET = 0.2f; private const float AUDIO_ANTICIPATION = 0.35f; private const int ORB_SUMMON_SORTING_ORDER = 0; private const int ORB_SUMMON_OVERLAY_SORTING_ORDER = 9; private const int ORB_SORTING_ORDER = 10; internal static int ExplosionFillSortingLayer = 0; internal static float SmashEffectYOffset = 0.5f; private static List _orbPool = new List(); private static int _poolSize = 3; internal static bool DeathHitEntered = false; private PlayMakerFSM _controlFsm; private GameObject _boss; private Transform _bossTransform; private tk2dSprite _orbSprite; private tk2dSpriteAnimator _orbAnimator; private bool _isInitialized; private GameObject _orbOverlayObject; private tk2dSprite _orbOverlaySprite; private tk2dSpriteAnimator _orbOverlayAnimator; private GameObject _throwEffectObject; private tk2dSprite _throwEffectSprite; private tk2dSpriteAnimator _throwEffectAnimator; private Vector3 _throwEffectWorldPosition; private const int IMPACT_RING_COUNT = 3; private GameObject[] _impactRingObjects = (GameObject[])(object)new GameObject[3]; private tk2dSprite[] _impactRingSprites = (tk2dSprite[])(object)new tk2dSprite[3]; private const int ANTIC_RUNE_FADE_COUNT = 4; private GameObject[] _anticRuneFadeObjects = (GameObject[])(object)new GameObject[4]; private tk2dSprite[] _anticRuneFadeSprites = (tk2dSprite[])(object)new tk2dSprite[4]; private GameObject _smashEffectObject; private tk2dSprite _smashEffectSprite; private tk2dSpriteAnimator _smashEffectAnimator; private GameObject _nukeImpactObject; private tk2dSprite _nukeImpactSprite; private GameObject _nukeExplosionFillObject; private tk2dSprite _nukeExplosionFillSprite; private GameObject _nukeExplosionObject; private tk2dSprite _nukeExplosionSprite; private GameObject _nukeExplosionRuneObject; private tk2dSprite _nukeExplosionRuneSprite; private GameObject _hotSpringSmokeObject; private GameObject _webDebrisObject; private GameObject _rockDebrisObject; private GameObject _foregroundRockDebrisObject; private GameObject _explosionHitboxObject; private CircleCollider2D _explosionHitboxCollider; private const float EXPLOSION_HITBOX_RADIUS = 11.6f; private const float EXPLOSION_HITBOX_DURATION = 0.1f; private int _facingDirection = 1; private float _summonX; private float _summonY; private Coroutine _nukeImpactCoroutine; private Coroutine _nukeExplosionFillCoroutine; private Coroutine _nukeExplosionCoroutine; private Coroutine _nukeExplosionRuneCoroutine; private Coroutine _impactRingCoroutine; private Coroutine _anticRuneFadeCoroutine; private Coroutine _throwMovementCoroutine; private Coroutine _telegraphCoroutine; private Coroutine _explosionShakeCoroutine; internal static void InitializePool(GameObject boss) { if ((Object)(object)boss == (Object)null) { Log.Error("NukeOrb: Cannot initialize pool - boss is null!"); return; } try { NukeParticles.LoadTextures(); } catch (Exception ex) { Log.Warn("NukeOrb: Failed to load particle textures: " + ex.Message + " - continuing without particles"); } foreach (NukeOrb item in _orbPool) { if ((Object)(object)item != (Object)null && (Object)(object)((Component)item).gameObject != (Object)null) { Object.Destroy((Object)(object)((Component)item).gameObject); } } _orbPool.Clear(); DeathHitEntered = false; Log.Info($"NukeOrb: Creating {_poolSize} new orbs"); for (int i = 0; i < _poolSize; i++) { try { NukeOrb component = CreateOrbGameObject(boss, i).GetComponent(); _orbPool.Add(component); } catch (Exception ex2) { Log.Error($"NukeOrb: Failed to create orb {i}: {ex2.Message}"); Log.Error("NukeOrb: Stack trace: " + ex2.StackTrace); } } Log.Info($"NukeOrb: Pool initialization complete. Pool now has {_orbPool.Count} orbs"); } internal static void ResetPool() { _orbPool.Clear(); DeathHitEntered = false; } internal static NukeOrb GetAvailableOrb() { if (_orbPool.Count == 0) { Log.Warn("NukeOrb: Pool is empty Was InitializePool() called?"); return null; } NukeOrb nukeOrb = _orbPool[0]; if ((Object)(object)nukeOrb == (Object)null || (Object)(object)((Component)nukeOrb).gameObject == (Object)null) { Log.Warn("NukeOrb: Pool contains destroyed orbs! Pool needs to be re-initialized."); _orbPool.Clear(); return null; } foreach (NukeOrb item in _orbPool) { if ((Object)(object)item != (Object)null && (Object)(object)((Component)item).gameObject != (Object)null && item.IsAvailable()) { return item; } } Log.Warn("NukeOrb: No available orbs in pool All orbs are in use."); return null; } internal static void TriggerAttack() { NukeOrb availableOrb = GetAvailableOrb(); if ((Object)(object)availableOrb != (Object)null) { availableOrb.SendAttackEvent(); } } private static GameObject CreateOrbGameObject(GameObject boss, int index) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown //IL_003d: 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_0065: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject($"Nuke Orb {index}"); val.transform.SetParent(boss.transform); val.layer = LayerMask.NameToLayer("Attack"); val.transform.localPosition = Vector3.zero; Vector3 localPosition = val.transform.localPosition; localPosition.z = 0f; val.transform.localPosition = localPosition; NukeOrb nukeOrb = val.AddComponent(); nukeOrb._boss = boss; nukeOrb._bossTransform = boss.transform; nukeOrb._orbSprite = val.AddComponent(); nukeOrb._orbAnimator = val.AddComponent(); tk2dSpriteCollectionData spriteCollection = NukeOrbAnimation.GetSpriteCollection(); if ((Object)(object)spriteCollection != (Object)null) { ((tk2dBaseSprite)nukeOrb._orbSprite).SetSprite(spriteCollection, NukeOrbAnimation.GetOrbInitialSpriteId()); nukeOrb._orbAnimator.Library = null; } ((tk2dBaseSprite)nukeOrb._orbSprite).SortingOrder = 0; nukeOrb.CreateOrbOverlayChild(); nukeOrb.CreateThrowEffectChild(); nukeOrb.CreateImpactRingChildren(); nukeOrb.CreateAnticRuneFadeChildren(); nukeOrb.CreateExplosionEffectChildren(); nukeOrb.SetupAnimations(); nukeOrb.SetupFSM(); nukeOrb._isInitialized = true; val.SetActive(false); return val; } private void CreateOrbOverlayChild() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_0039: Unknown result type (might be due to invalid IL or missing references) if (NukeOrbAnimation.IsOverlayAvailable()) { _orbOverlayObject = new GameObject("Orb Summon Overlay"); _orbOverlayObject.transform.SetParent(((Component)this).transform); _orbOverlayObject.transform.localPosition = Vector3.zero; _orbOverlaySprite = _orbOverlayObject.AddComponent(); _orbOverlayAnimator = _orbOverlayObject.AddComponent(); tk2dSpriteCollectionData spriteCollection = NukeOrbAnimation.GetSpriteCollection(); if ((Object)(object)spriteCollection != (Object)null) { ((tk2dBaseSprite)_orbOverlaySprite).SetSprite(spriteCollection, NukeOrbAnimation.GetOrbOverlayInitialSpriteId()); _orbOverlayAnimator.Library = null; } ((tk2dBaseSprite)_orbOverlaySprite).SortingOrder = 9; _orbOverlayObject.SetActive(false); } } private void CreateThrowEffectChild() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown //IL_0031: Unknown result type (might be due to invalid IL or missing references) _throwEffectObject = new GameObject("Throw Effect"); _throwEffectObject.transform.SetParent(_bossTransform); _throwEffectObject.transform.localPosition = Vector3.zero; _throwEffectSprite = _throwEffectObject.AddComponent(); _throwEffectAnimator = _throwEffectObject.AddComponent(); tk2dSpriteCollectionData spriteCollection = NukeOrbAnimation.GetSpriteCollection(); if ((Object)(object)spriteCollection != (Object)null) { ((tk2dBaseSprite)_throwEffectSprite).SetSprite(spriteCollection, NukeOrbAnimation.GetEffectInitialSpriteId()); } ((tk2dBaseSprite)_throwEffectSprite).SortingOrder = 11; _throwEffectObject.SetActive(false); } private void CreateImpactRingChildren() { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Expected O, but got Unknown //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Expected O, but got Unknown tk2dSpriteCollectionData spriteCollection = NukeOrbAnimation.GetSpriteCollection(); if (!((Object)(object)spriteCollection == (Object)null)) { int impactRingStartId = NukeOrbAnimation.GetImpactRingStartId(); for (int i = 0; i < 3; i++) { _impactRingObjects[i] = new GameObject($"Impact Ring {i}"); _impactRingObjects[i].transform.SetParent(((Component)this).transform); _impactRingSprites[i] = _impactRingObjects[i].AddComponent(); ((tk2dBaseSprite)_impactRingSprites[i]).SetSprite(spriteCollection, impactRingStartId + i); ((tk2dBaseSprite)_impactRingSprites[i]).SortingOrder = 10; _impactRingObjects[i].SetActive(false); } _smashEffectObject = new GameObject("Smash Effect"); _smashEffectObject.transform.SetParent(((Component)this).transform); _smashEffectSprite = _smashEffectObject.AddComponent(); _smashEffectAnimator = _smashEffectObject.AddComponent(); int explodeEffectStartId = NukeOrbAnimation.GetExplodeEffectStartId(); ((tk2dBaseSprite)_smashEffectSprite).SetSprite(spriteCollection, explodeEffectStartId); ((tk2dBaseSprite)_smashEffectSprite).SortingOrder = 10; NukeOrbAnimation.SetupEffectAnimator(_smashEffectAnimator); _smashEffectObject.SetActive(false); } } private void CreateAnticRuneFadeChildren() { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Expected O, but got Unknown tk2dSpriteCollectionData spriteCollection = NukeOrbAnimation.GetSpriteCollection(); if (!((Object)(object)spriteCollection == (Object)null)) { int anticRuneFadeStartId = NukeOrbAnimation.GetAnticRuneFadeStartId(); for (int i = 0; i < 4; i++) { _anticRuneFadeObjects[i] = new GameObject($"Antic Rune Fade {i}"); _anticRuneFadeObjects[i].transform.SetParent(((Component)this).transform); _anticRuneFadeSprites[i] = _anticRuneFadeObjects[i].AddComponent(); ((tk2dBaseSprite)_anticRuneFadeSprites[i]).SetSprite(spriteCollection, anticRuneFadeStartId + i); ((tk2dBaseSprite)_anticRuneFadeSprites[i]).SortingOrder = 10; _anticRuneFadeObjects[i].SetActive(false); } } } private void CreateExplosionEffectChildren() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Expected O, but got Unknown //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Expected O, but got Unknown //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Expected O, but got Unknown //IL_02de: Unknown result type (might be due to invalid IL or missing references) //IL_02e8: Expected O, but got Unknown //IL_0348: Unknown result type (might be due to invalid IL or missing references) tk2dSpriteCollectionData spriteCollection = NukeOrbAnimation.GetSpriteCollection(); if ((Object)(object)spriteCollection == (Object)null) { return; } _nukeImpactObject = new GameObject("Nuke Impact"); _nukeImpactObject.transform.SetParent(((Component)this).transform); _nukeImpactSprite = _nukeImpactObject.AddComponent(); ((tk2dBaseSprite)_nukeImpactSprite).SetSprite(spriteCollection, NukeOrbAnimation.GetNukeImpactSpriteId()); ((tk2dBaseSprite)_nukeImpactSprite).SortingOrder = 10; _nukeImpactObject.SetActive(false); _nukeExplosionFillObject = new GameObject("Nuke Explosion Fill"); _nukeExplosionFillObject.transform.SetParent(((Component)this).transform); _nukeExplosionFillSprite = _nukeExplosionFillObject.AddComponent(); ((tk2dBaseSprite)_nukeExplosionFillSprite).SetSprite(spriteCollection, NukeOrbAnimation.GetNukeExplosionFillSpriteId()); ((tk2dBaseSprite)_nukeExplosionFillSprite).SortingOrder = ExplosionFillSortingLayer; _nukeExplosionFillObject.SetActive(false); _nukeExplosionObject = new GameObject("Nuke Explosion"); _nukeExplosionObject.transform.SetParent(((Component)this).transform); _nukeExplosionSprite = _nukeExplosionObject.AddComponent(); ((tk2dBaseSprite)_nukeExplosionSprite).SetSprite(spriteCollection, NukeOrbAnimation.GetNukeExplosionSpriteId()); ((tk2dBaseSprite)_nukeExplosionSprite).SortingOrder = 10; _nukeExplosionObject.SetActive(false); _nukeExplosionRuneObject = new GameObject("Nuke Explosion Rune"); _nukeExplosionRuneObject.transform.SetParent(((Component)this).transform); _nukeExplosionRuneSprite = _nukeExplosionRuneObject.AddComponent(); ((tk2dBaseSprite)_nukeExplosionRuneSprite).SetSprite(spriteCollection, NukeOrbAnimation.GetNukeExplosionRuneSpriteId()); ((tk2dBaseSprite)_nukeExplosionRuneSprite).SortingOrder = 10; _nukeExplosionRuneObject.SetActive(false); try { _hotSpringSmokeObject = NukeParticles.CreateHotSpringSmokeSystem(((Component)this).transform); if ((Object)(object)_hotSpringSmokeObject == (Object)null) { Log.Warn("NukeOrb: HotSpringSmoke creation returned null - particles will be disabled"); } } catch (Exception ex) { Log.Error("NukeOrb: Failed to create HotSpringSmoke: " + ex.Message); _hotSpringSmokeObject = null; } try { _webDebrisObject = NukeParticles.CreateWebDebrisSystem(((Component)this).transform); if ((Object)(object)_webDebrisObject == (Object)null) { Log.Warn("NukeOrb: WebDebris creation returned null - particles will be disabled"); } } catch (Exception ex2) { Log.Error("NukeOrb: Failed to create WebDebris: " + ex2.Message); _webDebrisObject = null; } try { _rockDebrisObject = NukeParticles.CreateRockDebrisSystem(((Component)this).transform); if ((Object)(object)_rockDebrisObject == (Object)null) { Log.Warn("NukeOrb: RockDebris creation returned null - particles will be disabled"); } } catch (Exception ex3) { Log.Error("NukeOrb: Failed to create RockDebris: " + ex3.Message); _rockDebrisObject = null; } try { _foregroundRockDebrisObject = NukeParticles.CreateForegroundRockDebrisSystem(((Component)this).transform); if ((Object)(object)_foregroundRockDebrisObject == (Object)null) { Log.Warn("NukeOrb: ForegroundRockDebris creation returned null - particles will be disabled"); } } catch (Exception ex4) { Log.Error("NukeOrb: Failed to create ForegroundRockDebris: " + ex4.Message); _foregroundRockDebrisObject = null; } _explosionHitboxObject = new GameObject("Explosion Hitbox"); _explosionHitboxObject.transform.SetParent(((Component)this).transform); _explosionHitboxObject.layer = 22; _explosionHitboxCollider = _explosionHitboxObject.AddComponent(); _explosionHitboxCollider.radius = 11.6f; ((Collider2D)_explosionHitboxCollider).isTrigger = true; ((Collider2D)_explosionHitboxCollider).offset = new Vector2(0f, -3.8f); _explosionHitboxObject.AddComponent().eventName = "BREAK HERO PROJECTILE"; _explosionHitboxObject.SetActive(false); } private void SetupAnimations() { if ((Object)(object)_orbAnimator != (Object)null) { NukeOrbAnimation.SetupOrbAnimator(_orbAnimator); } if ((Object)(object)_throwEffectAnimator != (Object)null) { NukeOrbAnimation.SetupEffectAnimator(_throwEffectAnimator); } if ((Object)(object)_orbOverlayAnimator != (Object)null) { NukeOrbAnimation.SetupOrbOverlayAnimator(_orbOverlayAnimator); } } private void SetupFSM() { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Expected O, but got Unknown _controlFsm = ((Component)this).gameObject.AddComponent(); _controlFsm.FsmName = "Control"; Fsm fsm = _controlFsm.Fsm; fsm.Name = "Nuke Orb Control"; FsmEvent val = FsmEvent.GetFsmEvent("ATTACK"); if (val == null) { val = new FsmEvent("ATTACK"); } FsmState val2 = NukeOrbStates.CreateInitState(fsm, this); FsmState val3 = NukeOrbStates.CreateFormState(fsm, this); FsmState val4 = NukeOrbStates.CreateThrowState(fsm, this); FsmState val5 = NukeOrbStates.CreateExplodeAnticState(fsm, this); FsmState val6 = NukeOrbStates.CreateExplodeState(fsm, this); FsmState val7 = NukeOrbStates.CreateResetState(fsm, this); NukeOrbStates.SetupTransitions(val2, val3, val4, val5, val6, val7); fsm.States = (FsmState[])(object)new FsmState[6] { val2, val3, val4, val5, val6, val7 }; fsm.StartState = "Init"; fsm.Events = (FsmEvent[])(object)new FsmEvent[2] { val, FsmEvent.Finished }; fsm.InitData(); } internal int GetBossFacingDirection() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_bossTransform == (Object)null) { return 1; } if (!(_bossTransform.localScale.x >= 0f)) { return -1; } return 1; } internal void PositionNextToBoss() { //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_003b: 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) //IL_004f: 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_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_bossTransform == (Object)null)) { _facingDirection = GetBossFacingDirection(); float num = -4.8f * (float)_facingDirection; Vector3 position = _bossTransform.position; ((Component)this).transform.position = new Vector3(position.x + num, position.y + 3.9f, position.z - 0.11f); _summonX = ((Component)this).transform.position.x; _summonY = ((Component)this).transform.position.y; ((Component)this).transform.SetParent((Transform)null); PositionGroundEffects(); } } private void PositionGroundEffects() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0025: 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_00e4: 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_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0162: 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_01a0: 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_01df: Unknown result type (might be due to invalid IL or missing references) new Vector3(((Component)this).transform.position.x, 135.5f, ((Component)this).transform.position.z); float num = 135.5f - ((Component)this).transform.position.y; Vector3 localPosition = default(Vector3); ((Vector3)(ref localPosition))..ctor(0f, num + 1.5f + 0.75f, 0f); Vector3 localPosition2 = default(Vector3); ((Vector3)(ref localPosition2))..ctor(0f, num + 4.6f + SmashEffectYOffset + 0.75f, 0f); Vector3 localPosition3 = default(Vector3); ((Vector3)(ref localPosition3))..ctor(0f, num + 3.7f + 0.75f, 0f); Vector3 localPosition4 = default(Vector3); ((Vector3)(ref localPosition4))..ctor(0f, num + 2.5f + 0.75f, 0f); for (int i = 0; i < 3; i++) { if ((Object)(object)_impactRingObjects[i] != (Object)null) { _impactRingObjects[i].transform.localPosition = localPosition; } } for (int j = 0; j < 4; j++) { if ((Object)(object)_anticRuneFadeObjects[j] != (Object)null) { _anticRuneFadeObjects[j].transform.localPosition = localPosition; } } if ((Object)(object)_smashEffectObject != (Object)null) { _smashEffectObject.transform.localPosition = localPosition2; } if ((Object)(object)_nukeImpactObject != (Object)null) { _nukeImpactObject.transform.localPosition = localPosition; } if ((Object)(object)_nukeExplosionFillObject != (Object)null) { _nukeExplosionFillObject.transform.localPosition = localPosition; } if ((Object)(object)_nukeExplosionObject != (Object)null) { _nukeExplosionObject.transform.localPosition = localPosition3; } if ((Object)(object)_nukeExplosionRuneObject != (Object)null) { _nukeExplosionRuneObject.transform.localPosition = localPosition4; } if ((Object)(object)_explosionHitboxObject != (Object)null) { _explosionHitboxObject.transform.localPosition = localPosition; } } internal void HideOrb() { if ((Object)(object)_orbSprite != (Object)null) { SetSpriteAlpha(_orbSprite, 0f); } if ((Object)(object)_orbOverlayObject != (Object)null) { _orbOverlayObject.SetActive(false); } } internal void ShowOrb() { if ((Object)(object)_orbSprite != (Object)null) { SetSpriteAlpha(_orbSprite, 1f); } if ((Object)(object)_orbOverlayObject != (Object)null) { _orbOverlayObject.SetActive(true); } if ((Object)(object)_orbOverlaySprite != (Object)null) { SetSpriteAlpha(_orbOverlaySprite, 1f); } } internal void PlaySummonAnimation() { if ((Object)(object)_orbAnimator != (Object)null) { _orbAnimator.Play("Orb Summon"); } } internal void StartDelayedSummon(float delay) { HideOrb(); ((MonoBehaviour)this).StartCoroutine(DelayedSummonCoroutine(delay)); float delay2 = delay + 1.1071429f - 0f; ((MonoBehaviour)this).StartCoroutine(ScheduleThrowAudioCoroutine(delay2)); float num = delay + 1.1071429f - 0.5f; if (num > 0f) { ((MonoBehaviour)this).StartCoroutine(ScheduleRockDebrisCoroutine(num)); } else { PlayRockDebris(); } } [IteratorStateMachine(typeof(d__92))] private IEnumerator ScheduleRockDebrisCoroutine(float delay) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__92(0) { <>4__this = this, delay = delay }; } [IteratorStateMachine(typeof(d__93))] private IEnumerator ScheduleThrowAudioCoroutine(float delay) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__93(0) { <>4__this = this, delay = delay }; } [IteratorStateMachine(typeof(d__94))] private IEnumerator DelayedSummonCoroutine(float delay) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__94(0) { <>4__this = this, delay = delay }; } internal void PlaySummonAnimationWithTelegraph() { if ((Object)(object)_orbAnimator != (Object)null) { _orbAnimator.Play("Orb Summon"); } if ((Object)(object)_orbOverlayAnimator != (Object)null && NukeOrbAnimation.IsOverlayAvailable()) { _orbOverlayAnimator.Play("Orb Summon Overlay"); } TriggerSmallScreenShake(); _telegraphCoroutine = ((MonoBehaviour)this).StartCoroutine(AnimateSummonFloat()); } [IteratorStateMachine(typeof(d__96))] private IEnumerator AnimateSummonFloat() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__96(0) { <>4__this = this }; } internal void PlayThrowAnimation() { PlayThrowAnimationWithLandingCallback(null); } internal void PlayThrowAnimationWithLandingCallback(Action onLandingCallback) { //IL_005c: 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_0082: 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_00a2: Unknown result type (might be due to invalid IL or missing references) float delay = Mathf.Max(0f, -0.24629629f); ScheduleAudio("silkboss_nuke_impact", delay); if ((Object)(object)_orbAnimator != (Object)null) { _orbAnimator.Play("Orb Throw"); } if ((Object)(object)_throwEffectObject != (Object)null) { _throwEffectWorldPosition = new Vector3(((Component)this).transform.position.x, ((Component)this).transform.position.y + 1f, ((Component)this).transform.position.z); _throwEffectObject.transform.position = _throwEffectWorldPosition; _throwEffectObject.SetActive(true); if ((Object)(object)_throwEffectAnimator != (Object)null) { _throwEffectAnimator.Play("Throw Effect"); } } _throwMovementCoroutine = ((MonoBehaviour)this).StartCoroutine(AnimateThrowToFloor(onLandingCallback)); } [IteratorStateMachine(typeof(d__99))] private IEnumerator AnimateThrowToFloor(Action onLandingCallback) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__99(0) { <>4__this = this, onLandingCallback = onLandingCallback }; } internal void PlayExplodeAnticEffects() { TriggerBigScreenShake(); PositionGroundEffects(); _impactRingCoroutine = ((MonoBehaviour)this).StartCoroutine(AnimateImpactRings()); _anticRuneFadeCoroutine = ((MonoBehaviour)this).StartCoroutine(AnimateAnticRuneFade()); if ((Object)(object)_smashEffectObject != (Object)null && (Object)(object)_smashEffectAnimator != (Object)null) { _smashEffectObject.SetActive(true); _smashEffectAnimator.Play("Explode Effect"); } if ((Object)(object)_nukeImpactObject != (Object)null) { _nukeImpactCoroutine = ((MonoBehaviour)this).StartCoroutine(AnimateNukeImpact()); } if ((Object)(object)_nukeExplosionFillObject != (Object)null) { _nukeExplosionFillCoroutine = ((MonoBehaviour)this).StartCoroutine(AnimateExplosionSequence()); } } internal void PlayExplodeEffects() { } [IteratorStateMachine(typeof(d__102))] private IEnumerator AnimateImpactRings() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__102(0) { <>4__this = this }; } [IteratorStateMachine(typeof(d__103))] private IEnumerator AnimateNukeImpact() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__103(0) { <>4__this = this }; } [IteratorStateMachine(typeof(d__104))] private IEnumerator AnimateExplosionSequence() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__104(0) { <>4__this = this }; } [IteratorStateMachine(typeof(d__105))] private IEnumerator AnimateNukeExplosion() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__105(0) { <>4__this = this }; } private void DealExplosionDamage() { //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_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0105: 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_011f: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: 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_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: 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_016a: 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_0145: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) HeroController instance = HeroController.instance; if ((Object)(object)instance == (Object)null) { Log.Warn("NukeOrb [" + ((Object)((Component)this).gameObject).name + "]: HeroController.instance is NULL"); return; } GameObject gameObject = ((Component)instance).gameObject; if ((Object)(object)_explosionHitboxObject == (Object)null) { Log.Warn("NukeOrb [" + ((Object)((Component)this).gameObject).name + "]: _explosionHitboxObject is NULL"); return; } Collider2D component = _explosionHitboxObject.GetComponent(); if ((Object)(object)component == (Object)null) { Log.Warn("NukeOrb [" + ((Object)((Component)this).gameObject).name + "]: Hitbox Collider2D is NULL"); return; } Collider2D val = gameObject.GetComponent(); if ((Object)(object)val == (Object)null) { val = gameObject.GetComponentInChildren(); if ((Object)(object)val == (Object)null) { Log.Warn("NukeOrb [" + ((Object)((Component)this).gameObject).name + "]: Hero Collider2D is NULL (checked component and children)"); return; } } Bounds bounds = component.bounds; Bounds bounds2 = val.bounds; if (((Bounds)(ref bounds)).min.x <= ((Bounds)(ref bounds2)).max.x && ((Bounds)(ref bounds)).max.x >= ((Bounds)(ref bounds2)).min.x && ((Bounds)(ref bounds)).min.y <= ((Bounds)(ref bounds2)).max.y && ((Bounds)(ref bounds)).max.y >= ((Bounds)(ref bounds2)).min.y) { try { float x = ((Bounds)(ref bounds)).center.x; float x2 = ((Bounds)(ref bounds2)).center.x; CollisionSide val2 = (CollisionSide)((x < x2) ? 1 : 2); instance.TakeDamage(gameObject, val2, 2, (HazardType)1, (DamagePropertyFlags)0); return; } catch (Exception arg) { Log.Error($"NukeOrb [{((Object)((Component)this).gameObject).name}]: TakeDamage threw exception: {arg}"); return; } } Vector2 val3 = new Vector2(((Bounds)(ref bounds)).center.x, ((Bounds)(ref bounds)).center.y); Vector2 val4 = default(Vector2); ((Vector2)(ref val4))..ctor(((Bounds)(ref bounds2)).center.x, ((Bounds)(ref bounds2)).center.y); Vector2.Distance(val3, val4); } [IteratorStateMachine(typeof(d__107))] private IEnumerator RepeatedBigShakes() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__107(0) { <>4__this = this }; } private void HideThrowEffect() { if ((Object)(object)_throwEffectObject != (Object)null) { if ((Object)(object)_throwEffectAnimator != (Object)null) { _throwEffectAnimator.Stop(); } _throwEffectObject.SetActive(false); } else { Log.Warn("NukeOrb [" + ((Object)((Component)this).gameObject).name + "]: _throwEffectObject is null when trying to hide!"); } if ((Object)(object)_orbSprite != (Object)null) { SetSpriteAlpha(_orbSprite, 0f); } } [IteratorStateMachine(typeof(d__109))] private IEnumerator AnimateNukeExplosionRune() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__109(0) { <>4__this = this }; } [IteratorStateMachine(typeof(d__110))] private IEnumerator AnimateAnticRuneFade() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__110(0) { <>4__this = this }; } private void SetSpriteAlpha(tk2dSprite sprite, float alpha) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)sprite != (Object)null) { Color color = ((tk2dBaseSprite)sprite).color; color.a = alpha; ((tk2dBaseSprite)sprite).color = color; } } internal void StopOrbAnimator() { if ((Object)(object)_orbAnimator != (Object)null) { _orbAnimator.Stop(); } } internal void StopAnimations() { if ((Object)(object)_orbAnimator != (Object)null) { _orbAnimator.Stop(); tk2dSpriteAnimation library = _orbAnimator.Library; tk2dSpriteAnimationClip val = ((library != null) ? library.GetClipByName("Orb Throw") : null); if (val != null) { _orbAnimator.ClipFps = val.fps; } } if ((Object)(object)_orbOverlayAnimator != (Object)null) { _orbOverlayAnimator.Stop(); } if ((Object)(object)_orbOverlayObject != (Object)null) { _orbOverlayObject.SetActive(false); } if ((Object)(object)_smashEffectAnimator != (Object)null) { _smashEffectAnimator.Stop(); } if (_nukeImpactCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(_nukeImpactCoroutine); } if (_nukeExplosionFillCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(_nukeExplosionFillCoroutine); } if (_nukeExplosionCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(_nukeExplosionCoroutine); } if (_nukeExplosionRuneCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(_nukeExplosionRuneCoroutine); } if (_impactRingCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(_impactRingCoroutine); } if (_anticRuneFadeCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(_anticRuneFadeCoroutine); } if (_throwMovementCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(_throwMovementCoroutine); } if (_telegraphCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(_telegraphCoroutine); } if (_explosionShakeCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(_explosionShakeCoroutine); } if ((Object)(object)_throwEffectObject != (Object)null) { _throwEffectObject.SetActive(false); } if ((Object)(object)_smashEffectObject != (Object)null) { _smashEffectObject.SetActive(false); } for (int i = 0; i < 3; i++) { if ((Object)(object)_impactRingObjects[i] != (Object)null) { _impactRingObjects[i].SetActive(false); } } for (int j = 0; j < 4; j++) { if ((Object)(object)_anticRuneFadeObjects[j] != (Object)null) { _anticRuneFadeObjects[j].SetActive(false); } } if ((Object)(object)_nukeImpactObject != (Object)null) { _nukeImpactObject.SetActive(false); } if ((Object)(object)_nukeExplosionFillObject != (Object)null) { _nukeExplosionFillObject.SetActive(false); } if ((Object)(object)_nukeExplosionObject != (Object)null) { _nukeExplosionObject.SetActive(false); } if ((Object)(object)_nukeExplosionRuneObject != (Object)null) { _nukeExplosionRuneObject.SetActive(false); } if ((Object)(object)_explosionHitboxObject != (Object)null) { _explosionHitboxObject.SetActive(false); } StopHotSpringSmoke(clearParticles: true); } internal void CancelOrb() { //IL_0034: 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) StopAnimations(); ((MonoBehaviour)this).StopAllCoroutines(); if ((Object)(object)_orbSprite != (Object)null) { ((tk2dBaseSprite)_orbSprite).color = new Color(1f, 1f, 1f, 0f); } if ((Object)(object)_orbOverlayObject != (Object)null) { _orbOverlayObject.SetActive(false); } if ((Object)(object)_orbOverlaySprite != (Object)null) { ((tk2dBaseSprite)_orbOverlaySprite).color = new Color(1f, 1f, 1f, 0f); } ReparentToBoss(); ((Component)this).gameObject.SetActive(false); if ((Object)(object)_controlFsm != (Object)null && _controlFsm.Fsm != null) { _controlFsm.Fsm.SetState("Init"); } } internal void ScheduleEarlyDeathCheck(float delay) { ((MonoBehaviour)this).StartCoroutine(EarlyDeathCheckCoroutine(delay)); } [IteratorStateMachine(typeof(d__116))] private IEnumerator EarlyDeathCheckCoroutine(float delay) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__116(0) { <>4__this = this, delay = delay }; } internal void ReparentToBoss() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_bossTransform != (Object)null) { ((Component)this).transform.SetParent(_bossTransform); ((Component)this).transform.localPosition = Vector3.zero; } } internal float GetThrowTargetY() { return 135.5f; } internal float GetSummonX() { return _summonX; } internal bool IsAvailable() { if (!_isInitialized || (Object)(object)_controlFsm == (Object)null) { Log.Debug($"NukeOrb [{((Object)((Component)this).gameObject).name}]: Not available - initialized={_isInitialized}, fsm={(Object)(object)_controlFsm != (Object)null}"); return false; } string activeStateName = _controlFsm.Fsm.ActiveStateName; bool flag = activeStateName == "Init" || string.IsNullOrEmpty(activeStateName); Log.Debug($"NukeOrb [{((Object)((Component)this).gameObject).name}]: IsAvailable check - state='{activeStateName}', available={flag}"); return flag; } internal void SendAttackEvent() { if ((Object)(object)_controlFsm != (Object)null) { ((Component)this).gameObject.SetActive(true); _controlFsm.SendEvent("ATTACK"); } } internal void ForceReset() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) StopAnimations(); if ((Object)(object)_controlFsm != (Object)null) { ((Component)this).gameObject.SetActive(false); ((Component)this).transform.localPosition = Vector3.zero; _controlFsm.Fsm.SetState("Init"); } } internal tk2dSprite GetSprite() { return _orbSprite; } internal GameObject GetThrowEffectObject() { return _throwEffectObject; } private void TriggerSmallScreenShake() { if (Time.timeScale != 0f && (Object)(object)GameCameras.instance?.cameraShakeFSM != (Object)null) { GameCameras.instance.cameraShakeFSM.SendEvent("EnemyKillShake"); } } private void TriggerBigScreenShake() { if (Time.timeScale != 0f && (Object)(object)GameCameras.instance?.cameraShakeFSM != (Object)null) { GameCameras.instance.cameraShakeFSM.SendEvent("BigShake"); } } private void PlayHotSpringSmoke() { //IL_0016: 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_0040: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_hotSpringSmokeObject != (Object)null) { Vector3 worldPosition = default(Vector3); ((Vector3)(ref worldPosition))..ctor(((Component)this).transform.position.x, 135.5f, ((Component)this).transform.position.z); NukeParticles.PlayHotSpringSmoke(_hotSpringSmokeObject, worldPosition); } else { Log.Warn("NukeOrb [" + ((Object)((Component)this).gameObject).name + "]: Hot spring smoke object is null!"); } } private void StopHotSpringSmoke(bool clearParticles = false) { if ((Object)(object)_hotSpringSmokeObject != (Object)null) { NukeParticles.StopHotSpringSmoke(_hotSpringSmokeObject, clearParticles); } } private void PlayWebDebris() { //IL_0016: 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_0040: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_webDebrisObject != (Object)null) { Vector3 worldPosition = default(Vector3); ((Vector3)(ref worldPosition))..ctor(((Component)this).transform.position.x, 135.5f, ((Component)this).transform.position.z); NukeParticles.PlayWebDebris(_webDebrisObject, worldPosition); } else { Log.Warn("NukeOrb [" + ((Object)((Component)this).gameObject).name + "]: Web debris object is null"); } } private void StopWebDebris(bool clearParticles = false) { if ((Object)(object)_webDebrisObject != (Object)null) { NukeParticles.StopWebDebris(_webDebrisObject, clearParticles); } } private void PlayRockDebris() { if ((Object)(object)_rockDebrisObject != (Object)null) { NukeParticles.PlayRockDebris(_rockDebrisObject); } else { Log.Warn("NukeOrb [" + ((Object)((Component)this).gameObject).name + "]: Rock debris object is null"); } if ((Object)(object)_foregroundRockDebrisObject != (Object)null) { NukeParticles.PlayForegroundRockDebris(_foregroundRockDebrisObject); } else { Log.Warn("NukeOrb [" + ((Object)((Component)this).gameObject).name + "]: Foreground rock debris object is null!"); } } private void StopRockDebris(bool clearParticles = false) { if ((Object)(object)_rockDebrisObject != (Object)null) { NukeParticles.StopRockDebris(_rockDebrisObject, clearParticles); } if ((Object)(object)_foregroundRockDebrisObject != (Object)null) { NukeParticles.StopForegroundRockDebris(_foregroundRockDebrisObject, clearParticles); } } private void PlayThrowAudio() { string clipName = ((Random.value < 0.5f) ? "silkboss_nuke_throw_A" : "silkboss_nuke_throw_B"); PlayOneShotAudio(clipName, 0.98f); } private void PlayImpactAudio() { PlayOneShotAudio("silkboss_nuke_impact"); } private void PlayExplosionAudio() { PlayOneShotAudio("silkboss_nuke_explode"); } private void PlayOneShotAudio(string clipName, float pitchMin = 0.97f, float pitchMax = 1f) { //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_006c: 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) AudioClip val = AssetManager.Get(clipName); if ((Object)(object)val == (Object)null) { Log.Warn("NukeOrb [" + ((Object)((Component)this).gameObject).name + "]: Audio clip '" + clipName + "' not found"); return; } GameObject val2 = new GameObject("NukeOrbAudio_" + clipName); val2.transform.SetParent(((Component)this).transform); val2.transform.localPosition = Vector3.zero; AudioSource val3 = val2.AddComponent(); val3.clip = val; val3.volume = 1f; val3.pitch = Random.Range(pitchMin, pitchMax); val3.playOnAwake = false; val3.loop = false; val3.spatialBlend = 0f; Transform bossTransform = _bossTransform; AudioSource val4 = ((bossTransform != null) ? ((Component)bossTransform).GetComponentInChildren() : null); if ((Object)(object)val4 != (Object)null) { val3.outputAudioMixerGroup = val4.outputAudioMixerGroup; } val2.AddComponent().Initialize(val3, val.length / pitchMin + 0.1f); val3.Play(); } private void ScheduleAudio(string clipName, float delay, float pitchMin = 0.97f, float pitchMax = 1f) { if (delay <= 0f) { PlayOneShotAudio(clipName, pitchMin, pitchMax); } else { ((MonoBehaviour)this).StartCoroutine(PlayAudioAfterDelay(clipName, delay, pitchMin, pitchMax)); } } [IteratorStateMachine(typeof(d__138))] private IEnumerator PlayAudioAfterDelay(string clipName, float delay, float pitchMin, float pitchMax) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__138(0) { <>4__this = this, clipName = clipName, delay = delay, pitchMin = pitchMin, pitchMax = pitchMax }; } } internal class AudioPauseHandler : MonoBehaviour { private AudioSource _audioSource; private bool _wasPaused; private float _lifetime; private float _elapsedRealTime; public void Initialize(AudioSource source, float lifetime) { _audioSource = source; _lifetime = lifetime; _elapsedRealTime = 0f; _wasPaused = Time.timeScale == 0f; } private void Update() { if ((Object)(object)_audioSource == (Object)null) { Object.Destroy((Object)(object)((Component)this).gameObject); return; } _elapsedRealTime += Time.unscaledDeltaTime; bool flag = Time.timeScale == 0f; if (flag && !_wasPaused) { if (_audioSource.isPlaying) { _audioSource.Pause(); } } else if (!flag && _wasPaused && !_audioSource.isPlaying && _audioSource.time > 0f) { _audioSource.UnPause(); } _wasPaused = flag; if (_elapsedRealTime >= _lifetime && !flag) { Object.Destroy((Object)(object)((Component)this).gameObject); } } } internal static class NukeOrbAnimation { private struct FrameDefinition { public int X; public int Y; public int Width; public int Height; public FrameDefinition(int x, int y, int width, int height) { X = x; Y = y; Width = width; Height = height; } } internal const string ORB_SUMMON_CLIP = "Orb Summon"; internal const string ORB_SUMMON_OVERLAY_CLIP = "Orb Summon Overlay"; internal const string ORB_THROW_CLIP = "Orb Throw"; internal const string ORB_EXPLODE_CLIP = "Orb Explode"; internal const string THROW_EFFECT_CLIP = "Throw Effect"; internal const string EXPLODE_EFFECT_CLIP = "Explode Effect"; internal const string IMPACT_RING_CLIP = "Impact Ring"; private const int ATLAS3_WIDTH = 4096; private const int ATLAS3_HEIGHT = 4096; private const int ATLASNUKE_WIDTH = 4096; private const int ATLASNUKE_HEIGHT = 4096; private static tk2dSpriteCollectionData? _spriteCollection; private static Material? _atlas3Material; private static int _atlas3MaterialId = -1; private static Material? _atlasNukeMaterial; private static int _atlasNukeMaterialId = -1; private static bool _initialized = false; private static int _orbSummonStartId = -1; private static int _orbSummonOverlayStartId = -1; private static int _orbThrowStartId = -1; private static int _throwEffectStartId = -1; private static int _explodeEffectStartId = -1; private static int _impactRingStartId = -1; private static int _anticRuneFadeStartId = -1; private static int _nukeImpactSpriteId = -1; private static int _nukeExplosionRuneSpriteId = -1; private static int _nukeExplosionFillSpriteId = -1; private static int _nukeExplosionSpriteId = -1; private const int ORB_SUMMON_FRAME_COUNT = 21; private const int ORB_THROW_FRAME_COUNT = 9; private const int THROW_EFFECT_FRAME_COUNT = 6; private const int EXPLODE_EFFECT_FRAME_COUNT = 7; private const int IMPACT_RING_FRAME_COUNT = 3; private const int ANTIC_RUNE_FADE_FRAME_COUNT = 4; internal const float ORB_SUMMON_SCALE = 0.0162f; internal const float ORB_THROW_SCALE = 0.0162f; internal const float THROW_EFFECT_SCALE = 0.019f; internal const float EXPLODE_EFFECT_SCALE = 0.06f; internal const float IMPACT_RING_SCALE = 0.0385f; internal const float NUKE_IMPACT_SCALE = 0.0285f; internal const float NUKE_EXPLOSION_RUNE_SCALE = 0.0415f; internal const float NUKE_EXPLOSION_FILL_SCALE = 0.038f; internal const float NUKE_EXPLOSION_SCALE = 0.06f; internal const float ANTIC_RUNE_FADE_SCALE = 0.035f; private static readonly string[] ExplodeEffectFiles = new string[7] { "nuke_smash_effect00", "nuke_smash_effect01", "nuke_smash_effect02", "nuke_smash_effect03", "nuke_smash_effect04", "nuke_smash_effect05", "nuke_smash_effect06" }; private static readonly string[] ImpactRingFiles = new string[3] { "nuke_impact_ring00", "nuke_impact_ring01", "nuke_impact_ring02" }; private static readonly string[] AnticRuneFadeFiles = new string[4] { "nuke_antic_rune_fade00", "nuke_antic_rune_fade01", "nuke_antic_rune_fade02", "nuke_antic_rune_fade03" }; private const string NUKE_IMPACT_FILE = "nuke_impact"; private const string NUKE_EXPLOSION_RUNE_FILE = "nuke_explosion_rune"; private const string NUKE_EXPLOSION_FILL_FILE = "nuke_explosion_fill"; private const string NUKE_EXPLOSION_FILE = "nuke_explosion"; private static readonly FrameDefinition[] OrbSummonFrames = new FrameDefinition[21] { new FrameDefinition(2921, 2633, 365, 365), new FrameDefinition(1, 2998, 365, 365), new FrameDefinition(366, 2998, 365, 365), new FrameDefinition(729, 2998, 365, 365), new FrameDefinition(1094, 2998, 365, 365), new FrameDefinition(1460, 2998, 365, 365), new FrameDefinition(1825, 2998, 365, 365), new FrameDefinition(2191, 2998, 365, 365), new FrameDefinition(2567, 2998, 343, 365), new FrameDefinition(2912, 2998, 376, 365), new FrameDefinition(3288, 2998, 443, 365), new FrameDefinition(3731, 2998, 365, 365), new FrameDefinition(1, 2633, 365, 365), new FrameDefinition(366, 2633, 365, 365), new FrameDefinition(729, 2633, 365, 365), new FrameDefinition(1094, 2633, 365, 365), new FrameDefinition(1459, 2633, 365, 365), new FrameDefinition(1825, 2633, 365, 365), new FrameDefinition(2191, 2633, 365, 365), new FrameDefinition(2556, 2633, 365, 365), new FrameDefinition(1, 1, 1, 1) }; private static readonly FrameDefinition[] OrbThrowFrames = new FrameDefinition[9] { new FrameDefinition(1, 1954, 312, 680), new FrameDefinition(312, 1954, 312, 680), new FrameDefinition(625, 1954, 312, 680), new FrameDefinition(936, 1954, 411, 680), new FrameDefinition(1347, 1954, 581, 680), new FrameDefinition(1928, 1954, 722, 680), new FrameDefinition(2650, 1954, 1035, 680), new FrameDefinition(3685, 1709, 411, 680), new FrameDefinition(3685, 1709, 411, 680) }; private static readonly FrameDefinition[] ThrowEffectFrames = new FrameDefinition[6] { new FrameDefinition(3427, 2, 317, 102), new FrameDefinition(3427, 375, 468, 102), new FrameDefinition(3427, 109, 600, 127), new FrameDefinition(3427, 242, 600, 127), new FrameDefinition(3427, 485, 600, 127), new FrameDefinition(1, 1, 1, 1) }; private static Dictionary _separateImageMaterialIds = new Dictionary(); internal static void Initialize(tk2dSpriteAnimator bossAnimator) { if (_initialized && (Object)(object)_spriteCollection != (Object)null) { tk2dSprite component = ((Component)bossAnimator).GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)((tk2dBaseSprite)component).Collection == (Object)(object)_spriteCollection) { Log.Info("NukeOrbAnimation: Already initialized with same collection"); return; } Log.Info("NukeOrbAnimation: Resetting for reinitialization"); Reset(); } tk2dSprite component2 = ((Component)bossAnimator).GetComponent(); if ((Object)(object)component2 == (Object)null) { Log.Error("NukeOrbAnimation: Could not get tk2dSprite from animator!"); return; } _spriteCollection = ((tk2dBaseSprite)component2).Collection; FindOrCreateAtlas3Material(); if (_atlas3MaterialId < 0) { Log.Error("NukeOrbAnimation: Failed to get atlas3"); return; } FindOrCreateAtlasNukeMaterial(); AddAllSpriteDefinitions(); _initialized = true; Log.Info("NukeOrbAnimation: Initialization complete"); } internal static void Reset() { _spriteCollection = null; _atlas3Material = null; _atlas3MaterialId = -1; _atlasNukeMaterial = null; _atlasNukeMaterialId = -1; _initialized = false; _orbSummonStartId = -1; _orbSummonOverlayStartId = -1; _orbThrowStartId = -1; _throwEffectStartId = -1; _explodeEffectStartId = -1; _impactRingStartId = -1; _anticRuneFadeStartId = -1; _nukeImpactSpriteId = -1; _nukeExplosionRuneSpriteId = -1; _nukeExplosionFillSpriteId = -1; _nukeExplosionSpriteId = -1; _separateImageMaterialIds.Clear(); } private static void FindOrCreateAtlas3Material() { //IL_00a1: 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_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Expected O, but got Unknown if ((Object)(object)_spriteCollection == (Object)null) { return; } for (int i = 0; i < _spriteCollection.materials.Length; i++) { Material val = _spriteCollection.materials[i]; object obj; if (val == null) { obj = null; } else { Texture mainTexture = val.mainTexture; obj = ((mainTexture != null) ? ((Object)mainTexture).name : null); } if (obj == null) { obj = ""; } if (((string)obj).ToLower().Contains("atlas3")) { _atlas3MaterialId = i; _atlas3Material = val; return; } } Texture2D val2 = AssetManager.Get("atlas3"); if ((Object)(object)val2 == (Object)null) { Log.Error("NukeOrbAnimation: Could not get atlas3 texture from AssetManager!"); return; } _atlas3Material = new Material(_spriteCollection.materials[0].shader) { mainTexture = (Texture)(object)val2, name = "atlas3_orb" }; _atlas3MaterialId = _spriteCollection.materials.Length; _spriteCollection.materials = _spriteCollection.materials.Append(_atlas3Material).ToArray(); _spriteCollection.materialInsts = _spriteCollection.materialInsts.Append(_atlas3Material).ToArray(); } private static void FindOrCreateAtlasNukeMaterial() { //IL_00a1: 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_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Expected O, but got Unknown if ((Object)(object)_spriteCollection == (Object)null) { return; } for (int i = 0; i < _spriteCollection.materials.Length; i++) { Material val = _spriteCollection.materials[i]; object obj; if (val == null) { obj = null; } else { Texture mainTexture = val.mainTexture; obj = ((mainTexture != null) ? ((Object)mainTexture).name : null); } if (obj == null) { obj = ""; } if (((string)obj).ToLower().Contains("atlasnuke")) { _atlasNukeMaterialId = i; _atlasNukeMaterial = val; return; } } Texture2D val2 = AssetManager.Get("atlasnuke"); if ((Object)(object)val2 == (Object)null) { Log.Warn("NukeOrbAnimation: Could not get atlasnuke texture from AssetManager - overlay effect disabled"); return; } _atlasNukeMaterial = new Material(_spriteCollection.materials[0].shader) { mainTexture = (Texture)(object)val2, name = "atlasnuke_overlay" }; _atlasNukeMaterialId = _spriteCollection.materials.Length; _spriteCollection.materials = _spriteCollection.materials.Append(_atlasNukeMaterial).ToArray(); _spriteCollection.materialInsts = _spriteCollection.materialInsts.Append(_atlasNukeMaterial).ToArray(); } private static int CreateMaterialFromImage(string imageName) { //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_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Expected O, but got Unknown if ((Object)(object)_spriteCollection == (Object)null) { return -1; } if (_separateImageMaterialIds.TryGetValue(imageName, out var value)) { return value; } Texture2D val = AssetManager.Get(imageName); if ((Object)(object)val == (Object)null) { Log.Error("NukeOrbAnimation: Could not get texture '" + imageName + "' from AssetManager!"); return -1; } Material element = new Material(_spriteCollection.materials[0].shader) { mainTexture = (Texture)(object)val, name = "mat_" + imageName }; int num = _spriteCollection.materials.Length; _spriteCollection.materials = _spriteCollection.materials.Append(element).ToArray(); _spriteCollection.materialInsts = _spriteCollection.materialInsts.Append(element).ToArray(); _separateImageMaterialIds[imageName] = num; return num; } private static void AddAllSpriteDefinitions() { if ((Object)(object)_spriteCollection == (Object)null || (Object)(object)_atlas3Material == (Object)null) { return; } tk2dSpriteDefinition[] spriteDefinitions = _spriteCollection.spriteDefinitions; int num = spriteDefinitions.Length; int num2 = 36; int num3 = 14; int num4 = 4; int num5 = ((_atlasNukeMaterialId >= 0) ? 21 : 0); int num6 = num2 + num3 + num4 + num5; _orbSummonStartId = num; _orbThrowStartId = num + 21; _throwEffectStartId = num + 21 + 9; int num7 = (_explodeEffectStartId = num + num2); _impactRingStartId = num7 + 7; _anticRuneFadeStartId = num7 + 7 + 3; int num8 = (_nukeImpactSpriteId = num7 + num3); _nukeExplosionRuneSpriteId = num8 + 1; _nukeExplosionFillSpriteId = num8 + 2; _nukeExplosionSpriteId = num8 + 3; if (_atlasNukeMaterialId >= 0) { _orbSummonOverlayStartId = num8 + num4; } tk2dSpriteDefinition[] array = (tk2dSpriteDefinition[])(object)new tk2dSpriteDefinition[num + num6]; for (int i = 0; i < num; i++) { array[i] = spriteDefinitions[i]; } float texWidth = 4096f; float texHeight = 4096f; for (int j = 0; j < 21; j++) { FrameDefinition frame = OrbSummonFrames[j]; int num9 = _orbSummonStartId + j; array[num9] = CreateAtlas3SpriteDefinition($"orb_summon_{j:D2}", frame, texWidth, texHeight, 0.0162f); } for (int k = 0; k < 9; k++) { FrameDefinition frame2 = OrbThrowFrames[k]; int num10 = _orbThrowStartId + k; array[num10] = CreateAtlas3SpriteDefinition($"orb_throw_{k:D2}", frame2, texWidth, texHeight, 0.0162f); } for (int l = 0; l < 6; l++) { FrameDefinition frame3 = ThrowEffectFrames[l]; int num11 = _throwEffectStartId + l; array[num11] = CreateAtlas3SpriteDefinition($"throw_effect_{l:D2}", frame3, texWidth, texHeight, 0.019f); } for (int m = 0; m < 7; m++) { string imageName = ExplodeEffectFiles[m]; int num12 = _explodeEffectStartId + m; array[num12] = CreateSeparateImageSpriteDefinition($"explode_effect_{m:D2}", imageName, 0.06f); } for (int n = 0; n < 3; n++) { string imageName2 = ImpactRingFiles[n]; int num13 = _impactRingStartId + n; array[num13] = CreateSeparateImageSpriteDefinition($"impact_ring_{n:D2}", imageName2, 0.0385f); } for (int num14 = 0; num14 < 4; num14++) { string imageName3 = AnticRuneFadeFiles[num14]; int num15 = _anticRuneFadeStartId + num14; array[num15] = CreateSeparateImageSpriteDefinition($"antic_rune_fade_{num14:D2}", imageName3, 0.035f); } array[_nukeImpactSpriteId] = CreateSeparateImageSpriteDefinition("nuke_impact", "nuke_impact", 0.0285f); array[_nukeExplosionRuneSpriteId] = CreateSeparateImageSpriteDefinition("nuke_explosion_rune", "nuke_explosion_rune", 0.0415f); array[_nukeExplosionFillSpriteId] = CreateSeparateImageSpriteDefinition("nuke_explosion_fill", "nuke_explosion_fill", 0.038f); array[_nukeExplosionSpriteId] = CreateSeparateImageSpriteDefinition("nuke_explosion", "nuke_explosion", 0.06f); if (_atlasNukeMaterialId >= 0 && _orbSummonOverlayStartId >= 0) { float texWidth2 = 4096f; float texHeight2 = 4096f; for (int num16 = 0; num16 < 21; num16++) { FrameDefinition frame4 = OrbSummonFrames[num16]; int num17 = _orbSummonOverlayStartId + num16; array[num17] = CreateAtlasNukeSpriteDefinition($"orb_summon_overlay_{num16:D2}", frame4, texWidth2, texHeight2, 0.0162f); } Log.Info("NukeOrbAnimation: Added overlay sprites from atlasnuke"); } _spriteCollection.spriteDefinitions = array; _ = _orbSummonOverlayStartId; _ = 0; } private static tk2dSpriteDefinition CreateAtlas3SpriteDefinition(string name, FrameDefinition frame, float texWidth, float texHeight, float scale) { float uvX = (float)frame.X / texWidth; float uvY = (float)frame.Y / texHeight; float uvW = (float)frame.Width / texWidth; float uvH = (float)frame.Height / texHeight; float num = (float)frame.Width / 2f * scale; float num2 = (float)frame.Height / 2f * scale; float left = 0f - num; float right = num; float bottom = 0f - num2; float top = num2; return CreateSpriteDefinitionInternal(name, _atlas3MaterialId, _atlas3Material, uvX, uvY, uvW, uvH, left, right, bottom, top); } private static tk2dSpriteDefinition CreateAtlasNukeSpriteDefinition(string name, FrameDefinition frame, float texWidth, float texHeight, float scale) { float uvX = (float)frame.X / texWidth; float uvY = (float)frame.Y / texHeight; float uvW = (float)frame.Width / texWidth; float uvH = (float)frame.Height / texHeight; float num = (float)frame.Width / 2f * scale; float num2 = (float)frame.Height / 2f * scale; float left = 0f - num; float right = num; float bottom = 0f - num2; float top = num2; return CreateSpriteDefinitionInternal(name, _atlasNukeMaterialId, _atlasNukeMaterial, uvX, uvY, uvW, uvH, left, right, bottom, top); } private static tk2dSpriteDefinition CreateSeparateImageSpriteDefinition(string name, string imageName, float scale) { //IL_0020: 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_002d: Expected O, but got Unknown int num = CreateMaterialFromImage(imageName); if (num < 0) { Log.Error("NukeOrbAnimation: Failed to create material for '" + imageName + "'"); return new tk2dSpriteDefinition { name = name }; } Material val = _spriteCollection.materials[num]; Texture mainTexture = val.mainTexture; float uvX = 0f; float uvY = 0f; float uvW = 1f; float uvH = 1f; float num2 = (float)mainTexture.width / 2f * scale; float num3 = (float)mainTexture.height / 2f * scale; float left = 0f - num2; float right = num2; float bottom = 0f - num3; float top = num3; return CreateSpriteDefinitionInternal(name, num, val, uvX, uvY, uvW, uvH, left, right, bottom, top); } private static tk2dSpriteDefinition CreateSpriteDefinitionInternal(string name, int materialId, Material material, float uvX, float uvY, float uvW, float uvH, float left, float right, float bottom, float top) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown //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_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //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_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_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_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //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_0105: 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_0147: 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) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0167: 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_0186: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0197: 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_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_01ea: 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_020a: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) tk2dSpriteDefinition val = new tk2dSpriteDefinition(); val.name = name; val.materialId = materialId; val.material = material; val.materialInst = material; val.positions = (Vector3[])(object)new Vector3[4] { new Vector3(left, bottom, 0f), new Vector3(right, bottom, 0f), new Vector3(left, top, 0f), new Vector3(right, top, 0f) }; val.uvs = (Vector2[])(object)new Vector2[4] { new Vector2(uvX, uvY), new Vector2(uvX + uvW, uvY), new Vector2(uvX, uvY + uvH), new Vector2(uvX + uvW, uvY + uvH) }; val.indices = new int[6] { 0, 2, 1, 2, 3, 1 }; val.boundsData = (Vector3[])(object)new Vector3[2] { new Vector3(0f, 0f, 0f), new Vector3(right - left, top - bottom, 0f) }; val.untrimmedBoundsData = (Vector3[])(object)new Vector3[2] { new Vector3(0f, 0f, 0f), new Vector3(right - left, top - bottom, 0f) }; val.normals = (Vector3[])(object)new Vector3[4] { Vector3.back, Vector3.back, Vector3.back, Vector3.back }; val.tangents = (Vector4[])(object)new Vector4[4] { new Vector4(1f, 0f, 0f, 1f), new Vector4(1f, 0f, 0f, 1f), new Vector4(1f, 0f, 0f, 1f), new Vector4(1f, 0f, 0f, 1f) }; return val; } internal static void SetupOrbAnimator(tk2dSpriteAnimator orbAnimator) { //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) if (!_initialized || (Object)(object)_spriteCollection == (Object)null) { Log.Error("NukeOrbAnimation: Not initialized Call Initialize first."); return; } if ((Object)(object)orbAnimator.Library == (Object)null) { GameObject val = new GameObject("Orb Animation Library"); val.transform.SetParent(((Component)orbAnimator).transform); tk2dSpriteAnimation val2 = val.AddComponent(); val2.clips = (tk2dSpriteAnimationClip[])(object)new tk2dSpriteAnimationClip[0]; orbAnimator.Library = val2; } tk2dSpriteAnimationClip element = CreateAnimationClip("Orb Summon", _orbSummonStartId, 21, 18f, (WrapMode)2); tk2dSpriteAnimationClip element2 = CreateAnimationClip("Orb Throw", _orbThrowStartId, 9, 23f, (WrapMode)2); tk2dSpriteAnimationClip element3 = CreateAnimationClip("Orb Explode", _explodeEffectStartId, 7, 18f, (WrapMode)2); orbAnimator.Library.clips = orbAnimator.Library.clips.Append(element).Append(element2).Append(element3) .ToArray(); } internal static void SetupEffectAnimator(tk2dSpriteAnimator effectAnimator) { //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) if (!_initialized || (Object)(object)_spriteCollection == (Object)null) { Log.Error("NukeOrbAnimation: Not initialized! Call Initialize first."); return; } if ((Object)(object)effectAnimator.Library == (Object)null) { GameObject val = new GameObject("Effect Animation Library"); val.transform.SetParent(((Component)effectAnimator).transform); tk2dSpriteAnimation val2 = val.AddComponent(); val2.clips = (tk2dSpriteAnimationClip[])(object)new tk2dSpriteAnimationClip[0]; effectAnimator.Library = val2; } tk2dSpriteAnimationClip element = CreateAnimationClip("Throw Effect", _throwEffectStartId, 6, 20f, (WrapMode)2); tk2dSpriteAnimationClip element2 = CreateAnimationClip("Explode Effect", _explodeEffectStartId, 7, 18f, (WrapMode)2); tk2dSpriteAnimationClip element3 = CreateAnimationClip("Impact Ring", _impactRingStartId, 3, 12f, (WrapMode)2); effectAnimator.Library.clips = effectAnimator.Library.clips.Append(element).Append(element2).Append(element3) .ToArray(); } private static tk2dSpriteAnimationClip CreateAnimationClip(string name, int startSpriteId, int frameCount, float fps, WrapMode wrapMode) { //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) //IL_000c: 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_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Expected O, but got Unknown tk2dSpriteAnimationClip val = new tk2dSpriteAnimationClip { name = name, fps = fps, wrapMode = wrapMode, frames = (tk2dSpriteAnimationFrame[])(object)new tk2dSpriteAnimationFrame[frameCount] }; for (int i = 0; i < frameCount; i++) { val.frames[i] = new tk2dSpriteAnimationFrame { spriteId = startSpriteId + i, spriteCollection = _spriteCollection }; } return val; } internal static tk2dSpriteCollectionData? GetSpriteCollection() { return _spriteCollection; } internal static int GetOrbInitialSpriteId() { if (_orbSummonStartId < 0) { return 0; } return _orbSummonStartId; } internal static int GetEffectInitialSpriteId() { if (_throwEffectStartId < 0) { return 0; } return _throwEffectStartId; } internal static int GetNukeImpactSpriteId() { return _nukeImpactSpriteId; } internal static int GetNukeExplosionRuneSpriteId() { return _nukeExplosionRuneSpriteId; } internal static int GetNukeExplosionFillSpriteId() { return _nukeExplosionFillSpriteId; } internal static int GetNukeExplosionSpriteId() { return _nukeExplosionSpriteId; } internal static int GetExplodeEffectStartId() { return _explodeEffectStartId; } internal static int GetImpactRingStartId() { return _impactRingStartId; } internal static int GetAnticRuneFadeStartId() { return _anticRuneFadeStartId; } internal static int GetAnticRuneFadeFrameCount() { return 4; } internal static bool IsOverlayAvailable() { return _orbSummonOverlayStartId >= 0; } internal static int GetOrbOverlayInitialSpriteId() { if (_orbSummonOverlayStartId < 0) { return 0; } return _orbSummonOverlayStartId; } internal static void SetupOrbOverlayAnimator(tk2dSpriteAnimator overlayAnimator) { //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) if (!_initialized || (Object)(object)_spriteCollection == (Object)null || _orbSummonOverlayStartId < 0) { Log.Warn("NukeOrbAnimation: Overlay not available skipping overlay animator setup"); return; } if ((Object)(object)overlayAnimator.Library == (Object)null) { GameObject val = new GameObject("Orb Overlay Animation Library"); val.transform.SetParent(((Component)overlayAnimator).transform); tk2dSpriteAnimation val2 = val.AddComponent(); val2.clips = (tk2dSpriteAnimationClip[])(object)new tk2dSpriteAnimationClip[0]; overlayAnimator.Library = val2; } tk2dSpriteAnimationClip element = CreateAnimationClip("Orb Summon Overlay", _orbSummonOverlayStartId, 21, 18f, (WrapMode)2); overlayAnimator.Library.clips = overlayAnimator.Library.clips.Append(element).ToArray(); } } internal static class NukeOrbStates { internal const float ThrowDistance = 8f; private const float THROW_FPS = 27f; private const int THROW_TOTAL_FRAMES = 9; private const int THROW_LAND_FRAME = 4; private const float BASE_THROW_LAND_TIME = 4f / 27f; internal const float THROW_LAND_TIME = 14f / 135f; private const float THROW_GROUND_TIME = 5f / 27f; private const float SUMMON_FPS = 21f; private const int SUMMON_TOTAL_FRAMES = 18; private const int TELEGRAPH_START_FRAME = 15; internal const float TELEGRAPH_START_TIME = 0.71428573f; internal const float SUMMON_DURATION = 1.1071429f; internal const float SUMMON_START_DELAY = 0.35f; private const float THROW_GROUND_FPS_MULTIPLIER = 1.3f; private const float THROW_GROUND_TIME_FAST = 0.14245014f; private const float THROW_DURATION = 0.24615383f; private const float EXPLODE_ANTIC_DURATION = 1f; private const float EXPLODE_DURATION = 1.5f; internal static FsmState CreateInitState(Fsm fsm, NukeOrb orb) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown FsmState val = new FsmState(fsm); val.Name = "Init"; val.Actions = (FsmStateAction[])(object)new FsmStateAction[1] { new InvokeMethod(delegate { }) }; return val; } internal static FsmState CreateFormState(Fsm fsm, NukeOrb orb) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown //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_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_0057: Expected O, but got Unknown //IL_0057: 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_006a: Expected O, but got Unknown NukeOrb orb2 = orb; FsmState val = new FsmState(fsm); val.Name = "Form"; val.Actions = (FsmStateAction[])(object)new FsmStateAction[2] { new InvokeMethod(delegate { ((Component)orb2).gameObject.SetActive(true); orb2.PositionNextToBoss(); orb2.StartDelayedSummon(0.35f); orb2.ScheduleEarlyDeathCheck(0.65f); }), (FsmStateAction)new Wait { time = new FsmFloat { Value = 1.457143f }, finishEvent = FsmEvent.Finished, realTime = false } }; return val; } internal static FsmState CreateThrowState(Fsm fsm, NukeOrb orb) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown //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_0051: 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_0064: Expected O, but got Unknown NukeOrb orb2 = orb; FsmState val = new FsmState(fsm); val.Name = "Throw"; val.Actions = (FsmStateAction[])(object)new FsmStateAction[2] { new InvokeMethod(delegate { if (NukeOrb.DeathHitEntered) { orb2.CancelOrb(); } else { orb2.PlayThrowAnimationWithLandingCallback(delegate { orb2.PlayExplodeAnticEffects(); }); } }), (FsmStateAction)new Wait { time = FsmFloat.op_Implicit(0.24615383f), finishEvent = FsmEvent.Finished, realTime = false } }; return val; } internal static FsmState CreateExplodeAnticState(Fsm fsm, NukeOrb orb) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: 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_0057: 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_006a: Expected O, but got Unknown FsmState val = new FsmState(fsm); val.Name = "Explode Antic"; val.Actions = (FsmStateAction[])(object)new FsmStateAction[2] { new InvokeMethod(delegate { }), (FsmStateAction)new Wait { time = FsmFloat.op_Implicit(1f), finishEvent = FsmEvent.Finished, realTime = false } }; return val; } internal static FsmState CreateExplodeState(Fsm fsm, NukeOrb orb) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown //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_0051: 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_0064: Expected O, but got Unknown NukeOrb orb2 = orb; FsmState val = new FsmState(fsm); val.Name = "Explode"; val.Actions = (FsmStateAction[])(object)new FsmStateAction[2] { new InvokeMethod(delegate { orb2.PlayExplodeEffects(); }), (FsmStateAction)new Wait { time = FsmFloat.op_Implicit(1.5f), finishEvent = FsmEvent.Finished, realTime = false } }; return val; } internal static FsmState CreateResetState(Fsm fsm, NukeOrb orb) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown //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_004c: 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_0064: Expected O, but got Unknown NukeOrb orb2 = orb; FsmState val = new FsmState(fsm); val.Name = "Reset"; val.Actions = (FsmStateAction[])(object)new FsmStateAction[2] { new InvokeMethod(delegate { orb2.StopAnimations(); orb2.ReparentToBoss(); ((Component)orb2).gameObject.SetActive(false); }), (FsmStateAction)new SendEvent { sendEvent = FsmEvent.Finished, delay = FsmFloat.op_Implicit(0f), everyFrame = false } }; return val; } internal static void SetupTransitions(FsmState initState, FsmState formState, FsmState throwState, FsmState explodeAnticState, FsmState explodeState, FsmState resetState) { //IL_0022: 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_002e: 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_0041: Expected O, but got Unknown //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005f: 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_0072: Expected O, but got Unknown //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_0090: 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_00a3: Expected O, but got Unknown //IL_00b1: 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_00c1: 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_00d5: Expected O, but got Unknown //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: 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_0108: Expected O, but got Unknown //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0127: 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_013a: Expected O, but got Unknown //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown FsmEvent val = FsmEvent.GetFsmEvent("ATTACK"); if (val == null) { val = new FsmEvent("ATTACK"); } initState.Transitions = (FsmTransition[])(object)new FsmTransition[1] { new FsmTransition { FsmEvent = val, ToState = "Form", ToFsmState = formState } }; formState.Transitions = (FsmTransition[])(object)new FsmTransition[1] { new FsmTransition { FsmEvent = FsmEvent.Finished, ToState = "Throw", ToFsmState = throwState } }; throwState.Transitions = (FsmTransition[])(object)new FsmTransition[1] { new FsmTransition { FsmEvent = FsmEvent.Finished, ToState = "Explode Antic", ToFsmState = explodeAnticState } }; explodeAnticState.Transitions = (FsmTransition[])(object)new FsmTransition[1] { new FsmTransition { FsmEvent = FsmEvent.Finished, ToState = "Explode", ToFsmState = explodeState } }; explodeState.Transitions = (FsmTransition[])(object)new FsmTransition[1] { new FsmTransition { FsmEvent = FsmEvent.Finished, ToState = "Reset", ToFsmState = resetState } }; resetState.Transitions = (FsmTransition[])(object)new FsmTransition[1] { new FsmTransition { FsmEvent = FsmEvent.Finished, ToState = "Init", ToFsmState = initState } }; } } internal static class NukeParticles { internal const int SMOKE_PARTICLE_LIMIT = 200; internal const float SMOKE_AREA_SIZE = 17f; internal const float SMOKE_MAX_OPACITY = 0.13f; internal const float SMOKE_PARTICLE_SIZE = 3f; internal const float SMOKE_LIFETIME = 1.35f; internal const float SMOKE_LIFETIME_VARIANCE = 0.5f; internal const string SMOKE_SORTING_LAYER = "Default"; internal const int SMOKE_SORTING_ORDER = 100; internal const float SMOKE_Z_POSITION = 5f; internal const int WEB_PARTICLE_LIMIT = 90; internal const float WEB_PARTICLE_SIZE = 0.75f; internal const float WEB_SIZE_VARIATION = 0.25f; internal const float WEB_MAX_OPACITY = 1f; internal const float WEB_LIFETIME_MIN = 1f; internal const float WEB_LIFETIME_MAX = 1.6f; internal const float WEB_FADE_TIME = 0.3f; internal const float WEB_ROTATION_RANGE = 200f; internal const string WEB_SORTING_LAYER = "Default"; internal const int WEB_SORTING_ORDER = 110; internal const float WEB_Z_POSITION = -5f; internal const float WEB_Y_OFFSET = -2f; internal const float WEB_AREA_SIZE = 18f; internal const float WEB_GRAVITY = 0.3f; internal const float WEB_SPAWN_DELAY = 0.1f; internal const string ROCK_SORTING_LAYER = "Default"; internal const int ROCK_SORTING_ORDER = -1; internal const float ROCK_X_MIN = 20f; internal const float ROCK_X_MAX = 60f; internal const float ROCK_SPAWN_Y = 190f; internal const float ROCK_SIZE = 0.3f; internal const float ROCK_SIZE_MIN = 1f; internal const float ROCK_SIZE_MAX = 4.7f; internal const float ROCK_FALL_SPEED = 35f; internal const float ROCK_SPAWN_RATE = 20f; internal const float ROCK_SPAWN_RATE_DOUBLED = 40f; internal const float ROCK_LIFETIME = 2f; internal const float ROCK_Z_POSITION = 0.1f; internal const string ROCK_FG_SORTING_LAYER = "Default"; internal const int ROCK_FG_SORTING_ORDER = 200; internal const float ROCK_FG_SIZE = 0.3f; internal const float ROCK_FG_SIZE_MAX = 4f; internal const float ROCK_FG_SPAWN_RATE = 10f; internal const float ROCK_FG_SPAWN_RATE_DOUBLED = 20f; internal const float ROCK_FG_COLOR_BRIGHTNESS = 0.2f; private static Texture2D _smokeTexture; private static Texture2D _webTexture; private static Texture2D _rockTexture; private static bool _textureLoaded; internal static void Reset() { _smokeTexture = null; _webTexture = null; _rockTexture = null; _textureLoaded = false; Log.Info("NukeParticles: Reset complete - textures will reload on next use"); } internal static void LoadTextures() { if (_textureLoaded) { return; } _textureLoaded = true; try { _smokeTexture = AssetManager.Get("hot_spring_smoke"); if ((Object)(object)_smokeTexture != (Object)null) { Log.Info($"NukeParticles: Loaded hot_spring_smoke texture ({((Texture)_smokeTexture).width}x{((Texture)_smokeTexture).height})"); } else { Log.Warn("NukeParticles: hot_spring_smoke texture not found"); } _webTexture = AssetManager.Get("web_particle"); if ((Object)(object)_webTexture != (Object)null) { Log.Info($"NukeParticles: Loaded web_particle texture ({((Texture)_webTexture).width}x{((Texture)_webTexture).height})"); } else { Log.Warn("NukeParticles: web_particle texture not found"); } _rockTexture = AssetManager.Get("rock_particles"); if ((Object)(object)_rockTexture != (Object)null) { Log.Info($"NukeParticles: Loaded rock_particles texture ({((Texture)_rockTexture).width}x{((Texture)_rockTexture).height})"); } else { Log.Warn("NukeParticles: rock_particles texture not found"); } } catch (Exception ex) { Log.Error("NukeParticles: Exception loading textures: " + ex.Message); _smokeTexture = null; _webTexture = null; _rockTexture = null; } } internal static GameObject CreateHotSpringSmokeSystem(Transform parent, string name = "HotSpringSmoke") { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Expected O, but got Unknown //IL_0021: 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_015a: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Expected O, but got Unknown //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_027a: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_028d: Unknown result type (might be due to invalid IL or missing references) //IL_02bb: Unknown result type (might be due to invalid IL or missing references) //IL_02c0: Unknown result type (might be due to invalid IL or missing references) //IL_02e3: Unknown result type (might be due to invalid IL or missing references) //IL_02e8: Unknown result type (might be due to invalid IL or missing references) //IL_02f9: Unknown result type (might be due to invalid IL or missing references) //IL_02fe: Unknown result type (might be due to invalid IL or missing references) //IL_030f: Unknown result type (might be due to invalid IL or missing references) //IL_0314: Unknown result type (might be due to invalid IL or missing references) //IL_0319: Unknown result type (might be due to invalid IL or missing references) //IL_0323: Expected O, but got Unknown //IL_031e: 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_0087: 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_00ae: 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_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: 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_03a7: Unknown result type (might be due to invalid IL or missing references) //IL_03ae: Expected O, but got Unknown GameObject val = null; try { LoadTextures(); val = new GameObject(name); val.transform.SetParent(parent, false); val.transform.localPosition = Vector3.zero; ParticleSystem val2 = val.AddComponent(); if ((Object)(object)val2 == (Object)null) { Log.Error("NukeParticles [" + name + "]: Failed to add ParticleSystem component"); Object.Destroy((Object)(object)val); return null; } val2.Stop(true, (ParticleSystemStopBehavior)0); try { MainModule main = val2.main; ((MainModule)(ref main)).duration = 2f; ((MainModule)(ref main)).loop = false; ((MainModule)(ref main)).startDelay = MinMaxCurve.op_Implicit(0f); ((MainModule)(ref main)).startLifetime = new MinMaxCurve(0.85f, 1.85f); ((MainModule)(ref main)).startSpeed = MinMaxCurve.op_Implicit(0.715f); ((MainModule)(ref main)).startSize = MinMaxCurve.op_Implicit(3f); ((MainModule)(ref main)).startRotation = new MinMaxCurve(-MathF.PI, MathF.PI); ((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(new Color(0.9f, 0.9f, 0.9f, 0.13f)); ((MainModule)(ref main)).gravityModifier = MinMaxCurve.op_Implicit(-0.05f); ((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)1; ((MainModule)(ref main)).maxParticles = 200; ((MainModule)(ref main)).playOnAwake = false; } catch (Exception ex) { Log.Error("NukeParticles [" + name + "]: Failed to configure main module: " + ex.Message); } try { EmissionModule emission = val2.emission; ((EmissionModule)(ref emission)).enabled = false; } catch (Exception ex2) { Log.Error("NukeParticles [" + name + "]: Failed to configure emission: " + ex2.Message); } try { ShapeModule shape = val2.shape; ((ShapeModule)(ref shape)).enabled = true; ((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)10; ((ShapeModule)(ref shape)).radius = 11.049999f; ((ShapeModule)(ref shape)).radiusThickness = 1f; } catch (Exception ex3) { Log.Error("NukeParticles [" + name + "]: Failed to configure shape: " + ex3.Message); } try { ColorOverLifetimeModule colorOverLifetime = val2.colorOverLifetime; ((ColorOverLifetimeModule)(ref colorOverLifetime)).enabled = true; Gradient val3 = new Gradient(); val3.SetKeys((GradientColorKey[])(object)new GradientColorKey[2] { new GradientColorKey(Color.white, 0f), new GradientColorKey(Color.white, 1f) }, (GradientAlphaKey[])(object)new GradientAlphaKey[4] { new GradientAlphaKey(1f, 0f), new GradientAlphaKey(1f, 0.5f), new GradientAlphaKey(0.5f, 0.75f), new GradientAlphaKey(0f, 1f) }); ((ColorOverLifetimeModule)(ref colorOverLifetime)).color = MinMaxGradient.op_Implicit(val3); } catch (Exception ex4) { Log.Error("NukeParticles [" + name + "]: Failed to configure color over lifetime: " + ex4.Message); } try { SizeOverLifetimeModule sizeOverLifetime = val2.sizeOverLifetime; ((SizeOverLifetimeModule)(ref sizeOverLifetime)).enabled = true; ((SizeOverLifetimeModule)(ref sizeOverLifetime)).size = new MinMaxCurve(1f, new AnimationCurve((Keyframe[])(object)new Keyframe[3] { new Keyframe(0f, 0.8f), new Keyframe(0.5f, 1.2f), new Keyframe(1f, 1.5f) })); } catch (Exception ex5) { Log.Error("NukeParticles [" + name + "]: Failed to configure size over lifetime: " + ex5.Message); } try { ParticleSystemRenderer component = val.GetComponent(); if ((Object)(object)component != (Object)null) { Material val4 = null; Shader val5 = Shader.Find("Sprites/Default"); if ((Object)(object)val5 == (Object)null) { val5 = Shader.Find("Particles/Standard Unlit"); } if ((Object)(object)val5 == (Object)null) { val5 = Shader.Find("Legacy Shaders/Particles/Alpha Blended"); } if ((Object)(object)val5 != (Object)null) { val4 = new Material(val5); if ((Object)(object)_smokeTexture != (Object)null) { val4.mainTexture = (Texture)(object)_smokeTexture; } else { Texture2D mainTexture = CreateCircleTexture(64); val4.mainTexture = (Texture)(object)mainTexture; } ((Renderer)component).material = val4; } else { Log.Error("NukeParticles [" + name + "]: Could not find any suitable shader!"); } component.renderMode = (ParticleSystemRenderMode)0; ((Renderer)component).sortingLayerName = "Default"; ((Renderer)component).sortingOrder = 100; component.minParticleSize = 0f; component.maxParticleSize = 7f; } } catch (Exception ex6) { Log.Error("NukeParticles [" + name + "]: Failed to configure renderer: " + ex6.Message); } val.SetActive(false); Log.Info("NukeParticles: Created HotSpringSmoke system '" + name + "' successfully"); return val; } catch (Exception ex7) { Log.Error("NukeParticles: Failed to create HotSpringSmoke system: " + ex7.Message); if ((Object)(object)val != (Object)null) { Object.Destroy((Object)(object)val); } return null; } } private static Texture2D CreateCircleTexture(int size) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Expected O, but got Unknown //IL_002a: 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_006a: Unknown result type (might be due to invalid IL or missing references) Texture2D val = new Texture2D(size, size, (TextureFormat)4, false); float num = (float)size / 2f; float num2 = (float)size / 2f; for (int i = 0; i < size; i++) { for (int j = 0; j < size; j++) { float num3 = Vector2.Distance(new Vector2((float)j, (float)i), new Vector2(num, num)); float num4 = Mathf.Clamp01(1f - num3 / num2); num4 *= num4; val.SetPixel(j, i, new Color(1f, 1f, 1f, num4)); } } val.Apply(); return val; } internal static void PlayHotSpringSmoke(GameObject smokeSystem, Vector3 worldPosition) { //IL_0014: 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_0030: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)smokeSystem == (Object)null) { return; } try { smokeSystem.SetActive(true); Vector3 position = default(Vector3); ((Vector3)(ref position))..ctor(worldPosition.x, worldPosition.y, 5f); smokeSystem.transform.position = position; ParticleSystem component = smokeSystem.GetComponent(); if ((Object)(object)component != (Object)null) { component.Clear(); component.Play(); component.Emit(200); ParticleDebugHelper particleDebugHelper = smokeSystem.GetComponent(); if ((Object)(object)particleDebugHelper == (Object)null) { particleDebugHelper = smokeSystem.AddComponent(); } particleDebugHelper.StartParticleCountCheck(component); } } catch (Exception) { } } internal static void StopHotSpringSmoke(GameObject smokeSystem, bool clearParticles = false) { if ((Object)(object)smokeSystem == (Object)null) { return; } try { ParticleSystem component = smokeSystem.GetComponent(); if ((Object)(object)component != (Object)null) { if (clearParticles) { component.Stop(true, (ParticleSystemStopBehavior)0); } else { component.Stop(true, (ParticleSystemStopBehavior)1); } } } catch (Exception ex) { Log.Error("NukeParticles.StopHotSpringSmoke: " + ex.Message); } } internal static GameObject CreateWebDebrisSystem(Transform parent, string name = "WebDebris") { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Expected O, but got Unknown //IL_0021: 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) //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_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Unknown result type (might be due to invalid IL or missing references) //IL_0298: 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_02d1: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: Expected O, but got Unknown //IL_02e2: Unknown result type (might be due to invalid IL or missing references) //IL_02ec: Unknown result type (might be due to invalid IL or missing references) //IL_02f1: Unknown result type (might be due to invalid IL or missing references) //IL_02f8: 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_0307: Unknown result type (might be due to invalid IL or missing references) //IL_031e: Unknown result type (might be due to invalid IL or missing references) //IL_0323: Unknown result type (might be due to invalid IL or missing references) //IL_0331: Unknown result type (might be due to invalid IL or missing references) //IL_0336: Unknown result type (might be due to invalid IL or missing references) //IL_0347: Unknown result type (might be due to invalid IL or missing references) //IL_034c: Unknown result type (might be due to invalid IL or missing references) //IL_035a: Unknown result type (might be due to invalid IL or missing references) //IL_0388: Unknown result type (might be due to invalid IL or missing references) //IL_038d: Unknown result type (might be due to invalid IL or missing references) //IL_03c3: Unknown result type (might be due to invalid IL or missing references) //IL_03d9: 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_0087: 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_00ae: 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_00da: 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_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0488: Unknown result type (might be due to invalid IL or missing references) //IL_048f: Expected O, but got Unknown //IL_045e: Unknown result type (might be due to invalid IL or missing references) //IL_0465: Expected O, but got Unknown GameObject val = null; try { LoadTextures(); val = new GameObject(name); val.transform.SetParent(parent, false); val.transform.localPosition = Vector3.zero; ParticleSystem val2 = val.AddComponent(); if ((Object)(object)val2 == (Object)null) { Log.Error("NukeParticles [" + name + "]: Failed to add ParticleSystem component"); Object.Destroy((Object)(object)val); return null; } val2.Stop(true, (ParticleSystemStopBehavior)0); try { MainModule main = val2.main; ((MainModule)(ref main)).duration = 2f; ((MainModule)(ref main)).loop = false; ((MainModule)(ref main)).startDelay = MinMaxCurve.op_Implicit(0f); ((MainModule)(ref main)).startLifetime = new MinMaxCurve(1f, 1.6f); ((MainModule)(ref main)).startSpeed = MinMaxCurve.op_Implicit(0.3f); ((MainModule)(ref main)).startSize = new MinMaxCurve(0.75f, 0.9375f); ((MainModule)(ref main)).startRotation = new MinMaxCurve(-MathF.PI, MathF.PI); ((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(new Color(1f, 1f, 1f, 1f)); ((MainModule)(ref main)).gravityModifier = new MinMaxCurve(0.3f, 0.5f); ((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)1; ((MainModule)(ref main)).maxParticles = 90; ((MainModule)(ref main)).playOnAwake = false; } catch (Exception ex) { Log.Error("NukeParticles [" + name + "]: Failed to configure web main module: " + ex.Message); } try { EmissionModule emission = val2.emission; ((EmissionModule)(ref emission)).enabled = false; } catch (Exception ex2) { Log.Error("NukeParticles [" + name + "]: Failed to configure web emission: " + ex2.Message); } try { ShapeModule shape = val2.shape; ((ShapeModule)(ref shape)).enabled = true; ((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)10; ((ShapeModule)(ref shape)).radius = 9.900001f; ((ShapeModule)(ref shape)).radiusThickness = 1f; ((ShapeModule)(ref shape)).arc = 180f; ((ShapeModule)(ref shape)).arcMode = (ParticleSystemShapeMultiModeValue)0; ((ShapeModule)(ref shape)).rotation = new Vector3(0f, 0f, 0f); ((ShapeModule)(ref shape)).arcSpread = 0f; ((ShapeModule)(ref shape)).rotation = new Vector3(0f, 0f, 0f); } catch (Exception ex3) { Log.Error("NukeParticles [" + name + "]: Failed to configure web shape: " + ex3.Message); } try { RotationOverLifetimeModule rotationOverLifetime = val2.rotationOverLifetime; ((RotationOverLifetimeModule)(ref rotationOverLifetime)).enabled = true; ((RotationOverLifetimeModule)(ref rotationOverLifetime)).separateAxes = false; float num = MathF.PI * 100f / 117f; ((RotationOverLifetimeModule)(ref rotationOverLifetime)).z = new MinMaxCurve((0f - num) * 1.5f, num * 1.5f); } catch (Exception ex4) { Log.Error("NukeParticles [" + name + "]: Failed to configure web rotation: " + ex4.Message); } try { ColorOverLifetimeModule colorOverLifetime = val2.colorOverLifetime; ((ColorOverLifetimeModule)(ref colorOverLifetime)).enabled = true; float num2 = 1.3f; float num3 = 1f - 0.3f / num2; num3 = Mathf.Clamp(num3, 0.3f, 0.7f); Gradient val3 = new Gradient(); val3.SetKeys((GradientColorKey[])(object)new GradientColorKey[2] { new GradientColorKey(Color.white, 0f), new GradientColorKey(Color.white, 1f) }, (GradientAlphaKey[])(object)new GradientAlphaKey[3] { new GradientAlphaKey(1f, 0f), new GradientAlphaKey(1f, num3), new GradientAlphaKey(0f, 1f) }); ((ColorOverLifetimeModule)(ref colorOverLifetime)).color = MinMaxGradient.op_Implicit(val3); } catch (Exception ex5) { Log.Error("NukeParticles [" + name + "]: Failed to configure web color: " + ex5.Message); } try { TextureSheetAnimationModule textureSheetAnimation = val2.textureSheetAnimation; ((TextureSheetAnimationModule)(ref textureSheetAnimation)).enabled = true; ((TextureSheetAnimationModule)(ref textureSheetAnimation)).mode = (ParticleSystemAnimationMode)0; ((TextureSheetAnimationModule)(ref textureSheetAnimation)).numTilesX = 1; ((TextureSheetAnimationModule)(ref textureSheetAnimation)).numTilesY = 4; ((TextureSheetAnimationModule)(ref textureSheetAnimation)).animation = (ParticleSystemAnimationType)0; ((TextureSheetAnimationModule)(ref textureSheetAnimation)).frameOverTime = new MinMaxCurve(0f, 0.99f); ((TextureSheetAnimationModule)(ref textureSheetAnimation)).startFrame = new MinMaxCurve(0f, 0.99f); ((TextureSheetAnimationModule)(ref textureSheetAnimation)).cycleCount = 1; } catch (Exception ex6) { Log.Error("NukeParticles [" + name + "]: Failed to configure web texture sheet: " + ex6.Message); } try { ParticleSystemRenderer component = val.GetComponent(); if ((Object)(object)component != (Object)null) { Shader val4 = Shader.Find("Sprites/Default"); if ((Object)(object)val4 == (Object)null) { val4 = Shader.Find("Particles/Standard Unlit"); } if ((Object)(object)val4 != (Object)null && (Object)(object)_webTexture != (Object)null) { Material val5 = new Material(val4); val5.mainTexture = (Texture)(object)_webTexture; ((Renderer)component).material = val5; } else if ((Object)(object)val4 != (Object)null) { Material val6 = new Material(val4); val6.mainTexture = (Texture)(object)CreateCircleTexture(32); ((Renderer)component).material = val6; Log.Warn("NukeParticles [" + name + "]: Web texture missing, using fallback"); } else { Log.Error("NukeParticles [" + name + "]: Could not find shader for web particles!"); } component.renderMode = (ParticleSystemRenderMode)0; ((Renderer)component).sortingLayerName = "Default"; ((Renderer)component).sortingOrder = 110; component.minParticleSize = 0f; component.maxParticleSize = 5f; } } catch (Exception ex7) { Log.Error("NukeParticles [" + name + "]: Failed to configure web renderer: " + ex7.Message); } val.SetActive(false); return val; } catch (Exception ex8) { Log.Error("NukeParticles: Failed to create WebDebris system: " + ex8.Message); if ((Object)(object)val != (Object)null) { Object.Destroy((Object)(object)val); } return null; } } internal static void PlayWebDebris(GameObject webSystem, Vector3 worldPosition) { //IL_0014: 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_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)webSystem == (Object)null) { return; } try { webSystem.SetActive(true); Vector3 position = default(Vector3); ((Vector3)(ref position))..ctor(worldPosition.x, worldPosition.y + -2f, -5f); webSystem.transform.position = position; ParticleDebugHelper particleDebugHelper = webSystem.GetComponent(); if ((Object)(object)particleDebugHelper == (Object)null) { particleDebugHelper = webSystem.AddComponent(); } particleDebugHelper.StartDelayedEmit(webSystem.GetComponent(), 90, 0.1f, position); } catch (Exception ex) { Log.Error("NukeParticles.PlayWebDebris: " + ex.Message); } } internal static void StopWebDebris(GameObject webSystem, bool clearParticles = false) { if ((Object)(object)webSystem == (Object)null) { return; } try { ParticleSystem component = webSystem.GetComponent(); if ((Object)(object)component != (Object)null) { if (clearParticles) { component.Stop(true, (ParticleSystemStopBehavior)0); } else { component.Stop(true, (ParticleSystemStopBehavior)1); } } } catch (Exception ex) { Log.Error("NukeParticles.StopWebDebris: " + ex.Message); } } internal static GameObject CreateRockDebrisSystem(Transform parent, string name = "RockDebris") { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Expected O, but got Unknown //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_018a: 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_01e8: 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_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Unknown result type (might be due to invalid IL or missing references) //IL_0289: 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_02c4: Unknown result type (might be due to invalid IL or missing references) //IL_02da: 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_0087: 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_00a9: 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_00d5: 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_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0389: Unknown result type (might be due to invalid IL or missing references) //IL_0390: Expected O, but got Unknown //IL_035f: Unknown result type (might be due to invalid IL or missing references) //IL_0366: Expected O, but got Unknown GameObject val = null; try { LoadTextures(); val = new GameObject(name); val.transform.SetParent(parent, false); val.transform.localPosition = Vector3.zero; ParticleSystem val2 = val.AddComponent(); if ((Object)(object)val2 == (Object)null) { Log.Error("NukeParticles [" + name + "]: Failed to add ParticleSystem component"); Object.Destroy((Object)(object)val); return null; } val2.Stop(true, (ParticleSystemStopBehavior)0); try { MainModule main = val2.main; ((MainModule)(ref main)).duration = 5f; ((MainModule)(ref main)).loop = true; ((MainModule)(ref main)).startDelay = MinMaxCurve.op_Implicit(0.3f); ((MainModule)(ref main)).startLifetime = MinMaxCurve.op_Implicit(2f); ((MainModule)(ref main)).startSpeed = MinMaxCurve.op_Implicit(0f); ((MainModule)(ref main)).startSize = new MinMaxCurve(0.3f, 1.41f); ((MainModule)(ref main)).startRotation = new MinMaxCurve(-MathF.PI, MathF.PI); ((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(Color.white); ((MainModule)(ref main)).gravityModifier = MinMaxCurve.op_Implicit(0f); ((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)1; ((MainModule)(ref main)).maxParticles = 500; ((MainModule)(ref main)).playOnAwake = false; } catch (Exception ex) { Log.Error("NukeParticles [" + name + "]: Failed to configure rock main module: " + ex.Message); } try { EmissionModule emission = val2.emission; ((EmissionModule)(ref emission)).enabled = true; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(20f); } catch (Exception ex2) { Log.Error("NukeParticles [" + name + "]: Failed to configure rock emission: " + ex2.Message); } try { ShapeModule shape = val2.shape; ((ShapeModule)(ref shape)).enabled = true; ((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)12; ((ShapeModule)(ref shape)).radius = 20f; ((ShapeModule)(ref shape)).rotation = new Vector3(0f, 0f, 0f); } catch (Exception ex3) { Log.Error("NukeParticles [" + name + "]: Failed to configure rock shape: " + ex3.Message); } try { VelocityOverLifetimeModule velocityOverLifetime = val2.velocityOverLifetime; ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).enabled = true; ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).space = (ParticleSystemSimulationSpace)1; ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).x = MinMaxCurve.op_Implicit(0f); ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).y = MinMaxCurve.op_Implicit(-35f); ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).z = MinMaxCurve.op_Implicit(0f); } catch (Exception ex4) { Log.Error("NukeParticles [" + name + "]: Failed to configure rock velocity: " + ex4.Message); } try { RotationOverLifetimeModule rotationOverLifetime = val2.rotationOverLifetime; ((RotationOverLifetimeModule)(ref rotationOverLifetime)).enabled = false; } catch (Exception ex5) { Log.Error("NukeParticles [" + name + "]: Failed to disable rock rotation: " + ex5.Message); } try { TextureSheetAnimationModule textureSheetAnimation = val2.textureSheetAnimation; ((TextureSheetAnimationModule)(ref textureSheetAnimation)).enabled = true; ((TextureSheetAnimationModule)(ref textureSheetAnimation)).mode = (ParticleSystemAnimationMode)0; ((TextureSheetAnimationModule)(ref textureSheetAnimation)).numTilesX = 1; ((TextureSheetAnimationModule)(ref textureSheetAnimation)).numTilesY = 4; ((TextureSheetAnimationModule)(ref textureSheetAnimation)).animation = (ParticleSystemAnimationType)0; ((TextureSheetAnimationModule)(ref textureSheetAnimation)).frameOverTime = new MinMaxCurve(0f, 0.99f); ((TextureSheetAnimationModule)(ref textureSheetAnimation)).startFrame = new MinMaxCurve(0f, 0.99f); ((TextureSheetAnimationModule)(ref textureSheetAnimation)).cycleCount = 1; } catch (Exception ex6) { Log.Error("NukeParticles [" + name + "]: Failed to configure rock texture sheet: " + ex6.Message); } try { ParticleSystemRenderer component = val.GetComponent(); if ((Object)(object)component != (Object)null) { Shader val3 = Shader.Find("Sprites/Default"); if ((Object)(object)val3 == (Object)null) { val3 = Shader.Find("Particles/Standard Unlit"); } if ((Object)(object)val3 != (Object)null && (Object)(object)_rockTexture != (Object)null) { Material val4 = new Material(val3); val4.mainTexture = (Texture)(object)_rockTexture; ((Renderer)component).material = val4; } else if ((Object)(object)val3 != (Object)null) { Material val5 = new Material(val3); val5.mainTexture = (Texture)(object)CreateCircleTexture(32); ((Renderer)component).material = val5; Log.Warn("NukeParticles [" + name + "]: Rock texture missing, using fallback"); } else { Log.Error("NukeParticles [" + name + "]: Could not find shader for rock particles!"); } component.renderMode = (ParticleSystemRenderMode)0; ((Renderer)component).sortingLayerName = "Default"; ((Renderer)component).sortingOrder = -1; component.minParticleSize = 0f; component.maxParticleSize = 10f; } } catch (Exception ex7) { Log.Error("NukeParticles [" + name + "]: Failed to configure rock renderer: " + ex7.Message); } val.SetActive(false); return val; } catch (Exception ex8) { Log.Error("NukeParticles: Failed to create RockDebris system: " + ex8.Message); if ((Object)(object)val != (Object)null) { Object.Destroy((Object)(object)val); } return null; } } internal static void PlayRockDebris(GameObject rockSystem) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)rockSystem == (Object)null) { return; } try { rockSystem.SetActive(true); float num = 40f; rockSystem.transform.position = new Vector3(num, 190f, 0.1f); ParticleSystem component = rockSystem.GetComponent(); if ((Object)(object)component != (Object)null) { EmissionModule emission = component.emission; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(20f); component.Clear(); component.Play(); ParticleDebugHelper particleDebugHelper = rockSystem.GetComponent(); if ((Object)(object)particleDebugHelper == (Object)null) { particleDebugHelper = rockSystem.AddComponent(); } particleDebugHelper.StartRockPhaseControl(component, 0.4f, 1.7f, 40f); } } catch (Exception ex) { Log.Error("NukeParticles.PlayRockDebris: " + ex.Message); } } internal static void StopRockDebris(GameObject rockSystem, bool clearParticles = false) { if ((Object)(object)rockSystem == (Object)null) { return; } try { ParticleSystem component = rockSystem.GetComponent(); if ((Object)(object)component != (Object)null) { if (clearParticles) { component.Stop(true, (ParticleSystemStopBehavior)0); } else { component.Stop(true, (ParticleSystemStopBehavior)1); } } } catch (Exception ex) { Log.Error("NukeParticles.StopRockDebris: " + ex.Message); } } internal static GameObject CreateForegroundRockDebrisSystem(Transform parent, string name = "ForegroundRockDebris") { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Expected O, but got Unknown //IL_0021: 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_015a: Unknown result type (might be due to invalid IL or missing references) //IL_016b: 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_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_026a: 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_029d: Unknown result type (might be due to invalid IL or missing references) //IL_02a2: 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_02ee: 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_0087: 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_00a9: 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_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: 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_039d: Unknown result type (might be due to invalid IL or missing references) //IL_03a4: Expected O, but got Unknown //IL_0373: Unknown result type (might be due to invalid IL or missing references) //IL_037a: Expected O, but got Unknown GameObject val = null; try { LoadTextures(); val = new GameObject(name); val.transform.SetParent(parent, false); val.transform.localPosition = Vector3.zero; ParticleSystem val2 = val.AddComponent(); if ((Object)(object)val2 == (Object)null) { Log.Error("NukeParticles [" + name + "]: Failed to add ParticleSystem component"); Object.Destroy((Object)(object)val); return null; } val2.Stop(true, (ParticleSystemStopBehavior)0); try { MainModule main = val2.main; ((MainModule)(ref main)).duration = 5f; ((MainModule)(ref main)).loop = true; ((MainModule)(ref main)).startDelay = MinMaxCurve.op_Implicit(0f); ((MainModule)(ref main)).startLifetime = MinMaxCurve.op_Implicit(2f); ((MainModule)(ref main)).startSpeed = MinMaxCurve.op_Implicit(0f); ((MainModule)(ref main)).startSize = new MinMaxCurve(0.3f, 1.2f); ((MainModule)(ref main)).startRotation = new MinMaxCurve(-MathF.PI, MathF.PI); ((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(new Color(0.2f, 0.2f, 0.2f, 1f)); ((MainModule)(ref main)).gravityModifier = MinMaxCurve.op_Implicit(0f); ((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)1; ((MainModule)(ref main)).maxParticles = 500; ((MainModule)(ref main)).playOnAwake = false; } catch (Exception ex) { Log.Error("NukeParticles [" + name + "]: Failed to configure FG rock main module: " + ex.Message); } try { EmissionModule emission = val2.emission; ((EmissionModule)(ref emission)).enabled = true; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(10f); } catch (Exception ex2) { Log.Error("NukeParticles [" + name + "]: Failed to configure FG rock emission: " + ex2.Message); } try { ShapeModule shape = val2.shape; ((ShapeModule)(ref shape)).enabled = true; ((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)12; ((ShapeModule)(ref shape)).radius = 20f; ((ShapeModule)(ref shape)).rotation = new Vector3(0f, 0f, 0f); } catch (Exception ex3) { Log.Error("NukeParticles [" + name + "]: Failed to configure FG rock shape: " + ex3.Message); } try { VelocityOverLifetimeModule velocityOverLifetime = val2.velocityOverLifetime; ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).enabled = true; ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).space = (ParticleSystemSimulationSpace)1; ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).x = MinMaxCurve.op_Implicit(0f); ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).y = MinMaxCurve.op_Implicit(-35f); ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).z = MinMaxCurve.op_Implicit(0f); } catch (Exception ex4) { Log.Error("NukeParticles [" + name + "]: Failed to configure FG rock velocity: " + ex4.Message); } try { RotationOverLifetimeModule rotationOverLifetime = val2.rotationOverLifetime; ((RotationOverLifetimeModule)(ref rotationOverLifetime)).enabled = false; } catch (Exception ex5) { Log.Error("NukeParticles [" + name + "]: Failed to disable FG rock rotation: " + ex5.Message); } try { TextureSheetAnimationModule textureSheetAnimation = val2.textureSheetAnimation; ((TextureSheetAnimationModule)(ref textureSheetAnimation)).enabled = true; ((TextureSheetAnimationModule)(ref textureSheetAnimation)).mode = (ParticleSystemAnimationMode)0; ((TextureSheetAnimationModule)(ref textureSheetAnimation)).numTilesX = 1; ((TextureSheetAnimationModule)(ref textureSheetAnimation)).numTilesY = 4; ((TextureSheetAnimationModule)(ref textureSheetAnimation)).animation = (ParticleSystemAnimationType)0; ((TextureSheetAnimationModule)(ref textureSheetAnimation)).frameOverTime = new MinMaxCurve(0f, 0.99f); ((TextureSheetAnimationModule)(ref textureSheetAnimation)).startFrame = new MinMaxCurve(0f, 0.99f); ((TextureSheetAnimationModule)(ref textureSheetAnimation)).cycleCount = 1; } catch (Exception ex6) { Log.Error("NukeParticles [" + name + "]: Failed to configure FG rock texture sheet: " + ex6.Message); } try { ParticleSystemRenderer component = val.GetComponent(); if ((Object)(object)component != (Object)null) { Shader val3 = Shader.Find("Sprites/Default"); if ((Object)(object)val3 == (Object)null) { val3 = Shader.Find("Particles/Standard Unlit"); } if ((Object)(object)val3 != (Object)null && (Object)(object)_rockTexture != (Object)null) { Material val4 = new Material(val3); val4.mainTexture = (Texture)(object)_rockTexture; ((Renderer)component).material = val4; } else if ((Object)(object)val3 != (Object)null) { Material val5 = new Material(val3); val5.mainTexture = (Texture)(object)CreateCircleTexture(32); ((Renderer)component).material = val5; Log.Warn("NukeParticles [" + name + "]: Rock texture missing, using fallback"); } component.renderMode = (ParticleSystemRenderMode)0; ((Renderer)component).sortingLayerName = "Default"; ((Renderer)component).sortingOrder = 200; component.minParticleSize = 0f; component.maxParticleSize = 10f; } } catch (Exception ex7) { Log.Error("NukeParticles [" + name + "]: Failed to configure FG rock renderer: " + ex7.Message); } val.SetActive(false); return val; } catch (Exception ex8) { Log.Error("NukeParticles: Failed to create ForegroundRockDebris system: " + ex8.Message); if ((Object)(object)val != (Object)null) { Object.Destroy((Object)(object)val); } return null; } } internal static void PlayForegroundRockDebris(GameObject rockSystem) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)rockSystem == (Object)null) { return; } try { rockSystem.SetActive(true); float num = 40f; rockSystem.transform.position = new Vector3(num, 190f, 0.1f); ParticleSystem component = rockSystem.GetComponent(); if ((Object)(object)component != (Object)null) { EmissionModule emission = component.emission; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(10f); component.Clear(); component.Play(); Log.Info($"NukeParticles: Started FG rock debris at Y={190f}, rate={10f}/s"); ParticleDebugHelper particleDebugHelper = rockSystem.GetComponent(); if ((Object)(object)particleDebugHelper == (Object)null) { particleDebugHelper = rockSystem.AddComponent(); } particleDebugHelper.StartRockPhaseControl(component, 0.4f, 1.7f, 20f); } } catch (Exception ex) { Log.Error("NukeParticles.PlayForegroundRockDebris: " + ex.Message); } } internal static void StopForegroundRockDebris(GameObject rockSystem, bool clearParticles = false) { if ((Object)(object)rockSystem == (Object)null) { return; } try { ParticleSystem component = rockSystem.GetComponent(); if ((Object)(object)component != (Object)null) { if (clearParticles) { component.Stop(true, (ParticleSystemStopBehavior)0); } else { component.Stop(true, (ParticleSystemStopBehavior)1); } } } catch (Exception ex) { Log.Error("NukeParticles.StopForegroundRockDebris: " + ex.Message); } } } internal class ParticleDebugHelper : MonoBehaviour { [CompilerGenerated] private sealed class d__3 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public ParticleSystem ps; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__3(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = null; <>1__state = 1; return true; case 1: <>1__state = -1; <>2__current = null; <>1__state = 2; return true; case 2: <>1__state = -1; <>2__current = null; <>1__state = 3; return true; case 3: <>1__state = -1; if ((Object)(object)ps != (Object)null) { <>2__current = (object)new WaitForSeconds(0.5f); <>1__state = 4; return true; } break; case 4: <>1__state = -1; _ = (Object)(object)ps != (Object)null; break; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__2 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public float delay; public ParticleSystem ps; public int count; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__2(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(delay); <>1__state = 1; return true; case 1: <>1__state = -1; if ((Object)(object)ps != (Object)null) { ps.Clear(); ps.Play(); ps.Emit(count); } return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__7 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public float phase1Duration; public ParticleSystem ps; public float doubledRate; public float phase2Duration; public ParticleDebugHelper <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__7(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown //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_0079: 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_0094: Expected O, but got Unknown int num = <>1__state; ParticleDebugHelper particleDebugHelper = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(phase1Duration); <>1__state = 1; return true; case 1: <>1__state = -1; if ((Object)(object)ps != (Object)null && ps.isPlaying) { EmissionModule emission = ps.emission; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(doubledRate); <>2__current = (object)new WaitForSeconds(phase2Duration); <>1__state = 2; return true; } break; case 2: <>1__state = -1; if ((Object)(object)ps != (Object)null) { ps.Stop(true, (ParticleSystemStopBehavior)1); } break; } particleDebugHelper._rockPhaseCoroutine = null; return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private Coroutine _rockPhaseCoroutine; public void StartParticleCountCheck(ParticleSystem ps) { ((MonoBehaviour)this).StartCoroutine(CheckParticleCountDelayed(ps)); } public void StartDelayedEmit(ParticleSystem ps, int count, float delay, Vector3 position) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) ((MonoBehaviour)this).StartCoroutine(DelayedEmitCoroutine(ps, count, delay, position)); } [IteratorStateMachine(typeof(d__2))] private IEnumerator DelayedEmitCoroutine(ParticleSystem ps, int count, float delay, Vector3 position) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__2(0) { ps = ps, count = count, delay = delay }; } [IteratorStateMachine(typeof(d__3))] private IEnumerator CheckParticleCountDelayed(ParticleSystem ps) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__3(0) { ps = ps }; } public void StartRockPhaseControl(ParticleSystem ps, float phase1Duration, float phase2Duration, float doubledRate) { if (_rockPhaseCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(_rockPhaseCoroutine); } _rockPhaseCoroutine = ((MonoBehaviour)this).StartCoroutine(RockPhaseControlCoroutine(ps, phase1Duration, phase2Duration, doubledRate)); } public void StopRockPhaseControl() { if (_rockPhaseCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(_rockPhaseCoroutine); _rockPhaseCoroutine = null; } } [IteratorStateMachine(typeof(d__7))] private IEnumerator RockPhaseControlCoroutine(ParticleSystem ps, float phase1Duration, float phase2Duration, float doubledRate) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__7(0) { <>4__this = this, ps = ps, phase1Duration = phase1Duration, phase2Duration = phase2Duration, doubledRate = doubledRate }; } } [RequireComponent(typeof(tk2dSpriteAnimator))] [RequireComponent(typeof(Rigidbody2D))] [RequireComponent(typeof(PlayMakerFSM))] internal class SilkBoss : MonoBehaviour { [CompilerGenerated] private sealed class d__122 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public SilkBoss <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__122(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown int num = <>1__state; SilkBoss silkBoss = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(8f); <>1__state = 1; return true; case 1: <>1__state = -1; if (!silkBoss._webBarrageInProgress || silkBoss._barrageAudioAnimReverted) { return false; } silkBoss._barrageAudioAnimReverted = true; if (silkBoss._castAnimSpeedCoroutine != null) { ((MonoBehaviour)silkBoss).StopCoroutine(silkBoss._castAnimSpeedCoroutine); silkBoss._castAnimSpeedCoroutine = null; } if ((Object)(object)silkBoss._anim != (Object)null && silkBoss._castAnimClip != null) { silkBoss._anim.ClipFps = silkBoss._originalCastAnimFps; } silkBoss.StopBarrageLongScream(); if (silkBoss._webCastState != null && silkBoss._originalWebCastAudioClips != null) { FsmStateAction[] actions = silkBoss._webCastState.Actions; foreach (FsmStateAction obj in actions) { PlayAudioEventRandom val = (PlayAudioEventRandom)(object)((obj is PlayAudioEventRandom) ? obj : null); if (val != null && val.audioClips != null) { val.audioClips.Values = silkBoss._originalWebCastAudioClips; break; } } } return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__127 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public SilkBoss <>4__this; private float 5__2; private int 5__3; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__127(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Expected O, but got Unknown //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Expected O, but got Unknown int num = <>1__state; SilkBoss silkBoss = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; silkBoss.StartBarrageRumbleLoop(); goto IL_0054; case 1: <>1__state = -1; goto IL_0054; case 2: <>1__state = -1; if (!silkBoss._webBarrageInProgress) { return false; } goto IL_00b5; case 3: <>1__state = -1; goto IL_00b5; case 4: <>1__state = -1; if (!silkBoss._webBarrageInProgress) { return false; } goto IL_0130; case 5: { <>1__state = -1; goto IL_0130; } IL_00b5: if (Time.timeScale == 0f) { <>2__current = null; <>1__state = 3; return true; } GameCameras.instance.cameraShakeFSM.SendEvent("BigShake"); 5__2 = Time.time + 8f; 5__3 = 0; break; IL_0130: if (Time.timeScale == 0f) { <>2__current = null; <>1__state = 5; return true; } if (Time.timeScale > 0f) { GameCameras.instance.cameraShakeFSM.SendEvent("AverageShake"); 5__3++; } break; IL_0054: if (Time.timeScale == 0f) { <>2__current = null; <>1__state = 1; return true; } GameCameras.instance.cameraShakeFSM.SendEvent("AverageShake"); <>2__current = (object)new WaitForSeconds(0.8f); <>1__state = 2; return true; } if (silkBoss._webBarrageInProgress && Time.time < 5__2) { <>2__current = (object)new WaitForSeconds(0.5f); <>1__state = 4; return true; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__126 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public SilkBoss <>4__this; private int 5__2; private int 5__3; private float 5__4; private float 5__5; private int 5__6; private float 5__7; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__126(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { int num = <>1__state; SilkBoss silkBoss = <>4__this; switch (num) { default: return false; case 0: { <>1__state = -1; if (silkBoss._castAnimClip == null || silkBoss._castAnimClip.frames == null || (Object)(object)silkBoss._anim == (Object)null) { Log.Warn("ControlCastAnimationSpeed: Required references are null"); return false; } 5__2 = silkBoss._castAnimClip.frames.Length; 5__3 = 5; float num2 = 0.7f; float num3 = 0.21f; 5__4 = silkBoss._originalCastAnimFps * num2; 5__5 = silkBoss._originalCastAnimFps * num3; 5__6 = -1; 5__7 = -1f; break; } case 1: <>1__state = -1; break; } if (silkBoss._webBarrageInProgress) { if (silkBoss._anim.CurrentClip != null && silkBoss._anim.CurrentClip.name == "Cast") { int currentFrame = silkBoss._anim.CurrentFrame; float num4 = ((currentFrame < 5__3 || currentFrame >= 5__2 - 5__3) ? 5__4 : 5__5); if (Math.Abs(5__7 - num4) > 0.1f) { silkBoss._anim.ClipFps = num4; 5__7 = num4; if (currentFrame != 5__6) { 5__6 = currentFrame; } } } else if (5__7 != silkBoss._originalCastAnimFps && 5__7 > 0f) { silkBoss._anim.ClipFps = silkBoss._originalCastAnimFps; 5__7 = silkBoss._originalCastAnimFps; } <>2__current = null; <>1__state = 1; return true; } if ((Object)(object)silkBoss._anim != (Object)null) { silkBoss._anim.ClipFps = silkBoss._originalCastAnimFps; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__128 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public SilkBoss <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__128(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown int num = <>1__state; SilkBoss silkBoss = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(2f); <>1__state = 1; return true; case 1: <>1__state = -1; silkBoss.DestroyBarragePatterns(); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__129 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public float waitTime; public SilkBoss <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__129(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown int num = <>1__state; SilkBoss silkBoss = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(waitTime); <>1__state = 1; return true; case 1: <>1__state = -1; if (silkBoss._webBarrageInProgress) { silkBoss.EndWebBarrage(); } return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__121 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public GameObject audioObject; public float fadeDuration; private AudioSource 5__2; private float 5__3; private float 5__4; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__121(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__2 = null; <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; if ((Object)(object)audioObject == (Object)null) { return false; } 5__2 = audioObject.GetComponent(); if ((Object)(object)5__2 == (Object)null) { Object.Destroy((Object)(object)audioObject); return false; } 5__3 = 5__2.volume; 5__4 = 0f; break; case 1: <>1__state = -1; break; } if (5__4 < fadeDuration) { 5__4 += Time.deltaTime; float num = 5__4 / fadeDuration; 5__2.volume = Mathf.Lerp(5__3, 0f, num); <>2__current = null; <>1__state = 1; return true; } 5__2.volume = 0f; 5__2.Stop(); Object.Destroy((Object)(object)audioObject); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__124 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public SilkBoss <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__124(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { int num = <>1__state; SilkBoss silkBoss = <>4__this; if (num != 0) { return false; } <>1__state = -1; ((MonoBehaviour)silkBoss).StartCoroutine(silkBoss.FireWebstrandBarrageWeb(1.8f, 1, 1)); ((MonoBehaviour)silkBoss).StartCoroutine(silkBoss.FireWebstrandBarrageWeb(2.7f, 1, 1)); ((MonoBehaviour)silkBoss).StartCoroutine(silkBoss.FireWebstrandBarrageWeb(3.6f, 1, 1)); ((MonoBehaviour)silkBoss).StartCoroutine(silkBoss.FireWebstrandBarrageWeb(4.5f, 1, 1)); ((MonoBehaviour)silkBoss).StartCoroutine(silkBoss.FireWebstrandBarrageWeb(5.4f, 1, 1)); ((MonoBehaviour)silkBoss).StartCoroutine(silkBoss.FireWebstrandBarrageWeb(6.3f, 1, 1)); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__140 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__140(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(1.6f); <>1__state = 1; return true; case 1: { <>1__state = -1; GameObject val = GameObject.Find("Boss Scene/Strand Patterns"); if ((Object)(object)val == (Object)null) { Log.Error("P6 Triple Web: Could not find Strand Patterns"); return false; } List list = new List(); foreach (Transform item2 in val.transform) { Transform item = item2; list.Add(item); } if (list.Count == 0) { Log.Error("P6 Triple Web: No patterns found in Strand Patterns"); return false; } int index = Random.Range(0, list.Count); GameObject gameObject = ((Component)list[index]).gameObject; PlayMakerFSM val2 = gameObject.GetComponent(); if ((Object)(object)val2 == (Object)null) { PlayMakerFSM[] components = gameObject.GetComponents(); if (components.Length != 0) { val2 = components[0]; } } if ((Object)(object)val2 != (Object)null) { val2.SendEvent("ATTACK"); } else { Log.Error("P6 Triple Web: No FSM found on " + ((Object)gameObject).name); } return false; } } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__141 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public float delay; public SilkBoss <>4__this; public int webNumber; public int totalWebs; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__141(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown int num = <>1__state; SilkBoss silkBoss = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(delay); <>1__state = 1; return true; case 1: { <>1__state = -1; if (!silkBoss._webBarrageInProgress) { return false; } GameObject val = GameObject.Find("Boss Scene/Strand Patterns"); if ((Object)(object)val == (Object)null) { Log.Error("P5 Web Barrage: Could not find Strand Patterns"); return false; } GameObject nextBarragePattern = silkBoss.GetNextBarragePattern(val); if ((Object)(object)nextBarragePattern == (Object)null) { Log.Error($"P5 Web Barrage: Could not get pattern for web {webNumber}/{totalWebs}"); return false; } PlayMakerFSM val2 = nextBarragePattern.GetComponent(); if ((Object)(object)val2 == (Object)null) { PlayMakerFSM[] components = nextBarragePattern.GetComponents(); if (components.Length != 0) { val2 = components[0]; } } if ((Object)(object)val2 != (Object)null) { val2.SendEvent("ATTACK"); } else { Log.Error("P5 Web Barrage: No FSM found on " + ((Object)nextBarragePattern).name); } return false; } } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__62 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public SilkBoss <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__62(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Expected O, but got Unknown int num = <>1__state; SilkBoss silkBoss = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; silkBoss._p6DamageReductionActive = true; Log.Info($"SilkBoss: P6 damage reduction active for {8f}s"); <>2__current = (object)new WaitForSeconds(8f); <>1__state = 1; return true; case 1: <>1__state = -1; silkBoss._p6DamageReductionActive = false; silkBoss._p6DamageReductionCoroutine = null; Log.Info("SilkBoss: P6 damage reduction expired"); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__119 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public SilkBoss <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__119(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown //IL_00a3: 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_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Expected O, but got Unknown int num = <>1__state; SilkBoss silkBoss = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.2f); <>1__state = 1; return true; case 1: { <>1__state = -1; if (!silkBoss._webBarrageInProgress || silkBoss._longScreamClips == null || silkBoss._longScreamClips.Length == 0) { return false; } int num2 = Random.Range(0, silkBoss._longScreamClips.Length); AudioClip val = silkBoss._longScreamClips[num2]; GameObject val2 = silkBoss.FindAudioPlayerPrefab(); if ((Object)(object)val2 == (Object)null) { Log.Warn("PlayDelayedLongScream: Audio Player prefab not found!"); return false; } silkBoss._barrageLongScreamAudioInstance = Object.Instantiate(val2, ((Component)silkBoss).transform.position, Quaternion.identity); AudioSource component = silkBoss._barrageLongScreamAudioInstance.GetComponent(); if ((Object)(object)component != (Object)null) { component.pitch = 1f; component.volume = 1f; component.PlayOneShot(val); <>2__current = (object)new WaitForSeconds(val.length + 0.1f); <>1__state = 2; return true; } break; } case 2: <>1__state = -1; if ((Object)(object)silkBoss._barrageLongScreamAudioInstance != (Object)null) { Object.Destroy((Object)(object)silkBoss._barrageLongScreamAudioInstance); silkBoss._barrageLongScreamAudioInstance = null; } break; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__130 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public float delay; public SilkBoss <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__130(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown int num = <>1__state; SilkBoss silkBoss = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(delay); <>1__state = 1; return true; case 1: <>1__state = -1; if (silkBoss._canWebStrandAttackBool != null) { silkBoss._canWebStrandAttackBool.Value = true; } silkBoss._reEnableWebStrandCoroutine = null; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__14 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public SilkBoss <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__14(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { int num = <>1__state; SilkBoss silkBoss = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <>2__current = AssetManager.ManuallyLoadBundles(); <>1__state = 1; return true; case 1: <>1__state = -1; <>2__current = AssetManager.Initialize(); <>1__state = 2; return true; case 2: <>1__state = -1; silkBoss.GetComponents(); silkBoss.ChangeTextures(); BossAnimation.Initialize(silkBoss._anim); BossShieldAnimation.Initialize(((Component)silkBoss).gameObject); silkBoss.IncreaseHealth(); silkBoss.ModifyFsm(); NukeOrbAnimation.Initialize(silkBoss._anim); NukeOrb.InitializePool(((Component)silkBoss).gameObject); <>2__current = silkBoss.WaitAndReplaceTitleCard(); <>1__state = 3; return true; case 3: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__117 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public float delay; public SilkBoss <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__117(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown int num = <>1__state; SilkBoss silkBoss = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(delay); <>1__state = 1; return true; case 1: <>1__state = -1; silkBoss.StopBarrageRumbleLoop(); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__15 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public SilkBoss <>4__this; private GameObject 5__2; private int 5__3; private int 5__4; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__15(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Expected O, but got Unknown int num = <>1__state; SilkBoss silkBoss = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; 5__2 = null; 5__3 = 0; 5__4 = 100; break; case 1: <>1__state = -1; 5__3++; break; } while ((Object)(object)5__2 == (Object)null && 5__3 < 5__4) { 5__2 = GameObject.Find("Boss Title"); if ((Object)(object)5__2 == (Object)null) { <>2__current = (object)new WaitForSeconds(0.1f); <>1__state = 1; return true; } } if ((Object)(object)5__2 == (Object)null) { Log.Error("Boss Title object never appeared after 10 seconds!"); return false; } silkBoss.ReplaceTitleCard(); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__64 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public SilkBoss <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__64(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown int num = <>1__state; SilkBoss silkBoss = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; break; case 1: <>1__state = -1; break; } if (silkBoss._hasTripleNukedBool == null || !silkBoss._hasTripleNukedBool.Value) { <>2__current = (object)new WaitForSeconds(0.1f); <>1__state = 1; return true; } FsmState state = silkBoss._attackcontrol.GetState("Attack Choice"); if (state != null) { for (int i = 0; i < state.Actions.Length; i++) { FsmStateAction obj = state.Actions[i]; BoolTestMulti val = (BoolTestMulti)(object)((obj is BoolTestMulti) ? obj : null); if (val != null) { val.trueEvent = FsmEvent.GetFsmEvent("WEB ATTACK"); break; } } } else { Log.Warn("WatchForTripleNukeComplete: Could not find Attack Choice state for BoolTestMulti revert"); } if (silkBoss._canWebStrandAttackBool != null) { silkBoss._canWebStrandAttackBool.Value = true; } else { Log.Warn("WatchForTripleNukeComplete: 'Can Web Strand Attack' FsmBool not cached"); } if (silkBoss._didWebStrandAttackBool != null) { silkBoss._didWebStrandAttackBool.Value = false; } else { Log.Warn("WatchForTripleNukeComplete: 'Did Web Strand Attack' FsmBool not cached"); } silkBoss._p6TripleWebActive = true; return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private const float GroundY = 13f; private tk2dSpriteAnimator _anim; private Rigidbody2D _body; private PlayMakerFSM _control; private PlayMakerFSM _attackcontrol; private PlayMakerFSM _stuncontrol; private PlayMakerFSM _phasecontrol; private PlayMakerFSM[] _rubblefields = Array.Empty(); private PlayMakerFSM _handcontrol; private Transform _heroTransform; private static bool _harmonyPatchApplied; private static Harmony? _harmonyInstance; private int _dashComboCount; private bool _isP4; private bool _hasDoublePinCombo; private bool _handVariationActive = true; private SendRandomEventV4? _handPtnChoiceRandomizer; private float _originalHandPtnWeight4 = 1f; private float _originalHandPtnWeight5 = 1f; private List _swpStompSwpEvents = new List(); private List _stompSwpStompEvents = new List(); private List _swpStompSwpOriginalEvents = new List(); private List _stompSwpStompOriginalEvents = new List(); private Wait? _swpStompSwpWait2; private Wait? _swpStompSwpWait4; private Wait? _stompSwpStompWait2; private Wait? _stompSwpStompWait4; private float _swpStompSwpWait2Original; private float _swpStompSwpWait4Original; private float _stompSwpStompWait2Original; private float _stompSwpStompWait4Original; private bool _currentVariationActive; private bool _silkNukeInjected; private FsmBool? _tripleNukeBool; private FsmBool? _hasTripleNukedBool; private SendRandomEventV4? _attackChoiceRandomizer; private int _nukeEventIndex = -1; private bool _tripleNukeEnabled; private bool _p5Reached; private bool _p5WebBarrageTriggered; private int _p5DamageDealt; private int _lastKnownHP; private bool _webBarrageInProgress; private bool _webBarragePending; private List _barragePatternClones = new List(); private FsmBool? _didWebStrandAttackBool; private FsmBool? _canWebStrandAttackBool; private FsmState? _webPrepareState; private FsmState? _webRecoverState; private Wait? _webRecoverWait; private float _originalWebRecoverWait = 1f; private AudioClip[]? _longScreamClips; private object[]? _originalWebCastAudioClips; private FsmState? _webCastState; private tk2dSpriteAnimationClip? _castAnimClip; private float _originalCastAnimFps; private float[]? _originalCastFrameDurations; private HealthManager? _healthManager; private const float BARRAGE_DAMAGE_REDUCTION = 0.7f; private bool _p6DamageReductionActive; private Coroutine? _p6DamageReductionCoroutine; private const float P6DamageReductionDuration = 8f; private bool _webBarrageScreenShakeStarted; private Coroutine? _barrageScreenShakeCoroutine; private float _barrageDoubleEntryTime; private const float BarrageMinDuration = 12f; private const float BarrageAudioAnimRevertTime = 8f; private Coroutine? _barrageAudioAnimRevertCoroutine; private bool _barrageAudioAnimReverted; private Coroutine? _castAnimSpeedCoroutine; private Coroutine? _barrageDelayedAudioCoroutine; private GameObject? _barrageLongScreamAudioInstance; private GameObject? _barrageRumbleAudioInstance; private Coroutine? _barrageRumbleCoroutine; private Coroutine? _reEnableWebStrandCoroutine; private const float BarrageWebStrandCooldown = 7f; private Dictionary _webStrandUnparentTimes = new Dictionary(); private bool _lastPatternWasOdd; private int _barragePatternIndex; private int[] _barragePatternSequence = new int[8] { 1, 2, 3, 4, 5, 6, 7, 8 }; private GameObject? _p6Pattern3Clone; private bool _p6TripleWebActive; internal static SilkBoss? Instance { get; private set; } internal bool IsBarrageDamageReductionActive { get { if (!_webBarrageInProgress) { return _p6DamageReductionActive; } return true; } } private void Awake() { Log.Info("SilkBoss.Awake() called"); Instance = this; ApplyBarrageDamageReductionPatch(); ((MonoBehaviour)this).StartCoroutine(SetupBoss()); } private static void ApplyBarrageDamageReductionPatch() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown if (_harmonyPatchApplied) { return; } try { _harmonyInstance = new Harmony("com.silkboss.barragedamagereduction"); _harmonyInstance.PatchAll(typeof(HealthManagerBarragePatch).Assembly); _harmonyPatchApplied = true; } catch (Exception arg) { Log.Error($"SilkBoss: Failed to apply Harmony patch: {arg}"); } } [IteratorStateMachine(typeof(d__14))] private IEnumerator SetupBoss() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__14(0) { <>4__this = this }; } [IteratorStateMachine(typeof(d__15))] private IEnumerator WaitAndReplaceTitleCard() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__15(0) { <>4__this = this }; } private void GetComponents() { _anim = ((Component)this).GetComponent(); _body = ((Component)this).GetComponent(); _control = FSMUtility.LocateMyFSM(((Component)this).gameObject, "Control"); _attackcontrol = FSMUtility.LocateMyFSM(((Component)this).gameObject, "Attack Control"); _phasecontrol = FSMUtility.LocateMyFSM(((Component)this).gameObject, "Phase Control"); _stuncontrol = FSMUtility.LocateMyFSM(((Component)this).gameObject, "Stun Control"); _rubblefields = (from name in new string[3] { "Rubble Field R", "Rubble Field M", "Rubble Field L" } select GameObject.Find(name) into go where (Object)(object)go != (Object)null select FSMUtility.LocateMyFSM(go, "FSM") into fsm where (Object)(object)fsm != (Object)null select fsm).ToArray(); _heroTransform = ((Component)HeroController.instance).gameObject.transform; } private void ChangeTextures() { tk2dSpriteCollectionData collection = ((tk2dBaseSprite)((Component)this).GetComponent()).Collection; for (int i = 0; i < collection.materials.Length; i++) { collection.materials[i].mainTexture = (Texture)(object)AssetManager.Get($"atlas{i}"); } } private void IncreaseHealth() { if ((Object)(object)_phasecontrol == (Object)null) { Log.Error("Phase Control FSM not found!"); return; } Dictionary dictionary = new Dictionary { { "Set P1", 100 }, { "Set P2", 250 }, { "Set P3", 340 }, { "Set P4", 310 }, { "Set P5", 440 }, { "Set P6", 470 } }; for (int i = 1; i <= 6; i++) { string text = $"P{i} HP"; FsmInt val = _phasecontrol.FsmVariables.FindFsmInt(text); if (val != null) { string key = $"Set P{i}"; if (dictionary.ContainsKey(key)) { val.Value = dictionary[key]; } } } } private void ModifyFsm() { CloneWebPatterns(); DashCombo(); SpeedupBehaviours(); SpeedupWebstrand(); ModifySpikePull(); PinCombo(); HandAttackVariation(); P4PinSpeedup(); SilkNuke(); ModifyP5(); ReplaceTitleCard(); ModifyRoarP6(); ModifyP6(); ModifyMoveRestartP6(); ModifyPatternAlternation(); try { ModifyStun(); } catch (Exception arg) { Log.Error($"ModifyStun threw exception: {arg}"); } } private void CloneWebPatterns() { } private GameObject? ClonePattern(GameObject strandPatternsObj, string sourceName, string targetName) { //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown if ((Object)(object)strandPatternsObj.transform.Find(targetName) != (Object)null) { return null; } Transform val = strandPatternsObj.transform.Find(sourceName); if ((Object)(object)val == (Object)null) { Log.Error("ClonePattern: Could not find " + sourceName); return null; } GameObject val2 = Object.Instantiate(((Component)val).gameObject, strandPatternsObj.transform); ((Object)val2).name = targetName; PlayMakerFSM val3 = FSMUtility.LocateMyFSM(val2, "silk_boss_pattern_control"); if ((Object)(object)val3 == (Object)null) { PlayMakerFSM[] components = val2.GetComponents(); if (components.Length != 0) { val3 = components[0]; } } if ((Object)(object)val3 != (Object)null) { FsmGameObject val4 = val3.FsmVariables.FindFsmGameObject("Silk Boss"); if (val4 != null) { val4.Value = ((Component)this).gameObject; } } foreach (Transform item in val2.transform) { Transform val5 = item; if (!((Object)val5).name.Contains("WebStrand") && !((Object)val5).name.Contains("Web Strand")) { continue; } PlayMakerFSM val6 = FSMUtility.LocateMyFSM(((Component)val5).gameObject, "Control"); if ((Object)(object)val6 != (Object)null) { FsmGameObject val7 = val6.FsmVariables.FindFsmGameObject("Silk Boss"); if (val7 != null) { val7.Value = ((Component)this).gameObject; } } } return val2; } private void CreateBarragePatterns() { GameObject val = GameObject.Find("Boss Scene/Strand Patterns"); if ((Object)(object)val == (Object)null) { Log.Warn("CreateBarragePatterns: Could not find 'Boss Scene/Strand Patterns'"); return; } _barragePatternClones.Clear(); GameObject val2 = ClonePattern(val, "Pattern 1", "Pattern 3"); if ((Object)(object)val2 != (Object)null) { _barragePatternClones.Add(val2); ApplyPatternTweaks(val2); } GameObject val3 = ClonePattern(val, "Pattern 1", "Pattern 5"); if ((Object)(object)val3 != (Object)null) { _barragePatternClones.Add(val3); ApplyPatternTweaks(val3); } GameObject val4 = ClonePattern(val, "Pattern 1", "Pattern 7"); if ((Object)(object)val4 != (Object)null) { _barragePatternClones.Add(val4); ApplyPatternTweaks(val4); } GameObject val5 = ClonePattern(val, "Pattern 2", "Pattern 4"); if ((Object)(object)val5 != (Object)null) { _barragePatternClones.Add(val5); ApplyPatternTweaks(val5); } GameObject val6 = ClonePattern(val, "Pattern 2", "Pattern 6"); if ((Object)(object)val6 != (Object)null) { _barragePatternClones.Add(val6); ApplyPatternTweaks(val6); } GameObject val7 = ClonePattern(val, "Pattern 2", "Pattern 8"); if ((Object)(object)val7 != (Object)null) { _barragePatternClones.Add(val7); ApplyPatternTweaks(val7); } } private void ApplyPatternTweaks(GameObject pattern) { //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Expected O, but got Unknown //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Expected O, but got Unknown string name = ((Object)pattern).name; PlayMakerFSM val = FSMUtility.LocateMyFSM(pattern, "silk_boss_pattern_control"); if ((Object)(object)val == (Object)null) { PlayMakerFSM[] components = pattern.GetComponents(); if (components.Length != 0) { val = components[0]; } } if ((Object)(object)val != (Object)null && val.TryGetState("Web Burst Start", out FsmState state) && state != null && state.Actions.Length != 0) { FsmStateAction val2 = state.Actions[0]; FieldInfo field = ((object)val2).GetType().GetField("delay"); if (field != null && field.FieldType == typeof(FsmFloat)) { FsmFloat val3 = (FsmFloat)field.GetValue(val2); if (val3 != null) { val3.Value = 0.3f; } } } if ((Object)(object)val != (Object)null) { string capturedPatternName = name; if (val.TryGetState("Random Shift", out FsmState state2)) { state2?.InsertAction(0, (FsmStateAction)(object)new InvokeMethod(delegate { _webStrandUnparentTimes[capturedPatternName] = Time.time; })); } if (val.TryGetState("Reparent", out FsmState state3)) { state3?.InsertAction(0, (FsmStateAction)(object)new InvokeMethod(delegate { if (_webStrandUnparentTimes.TryGetValue(capturedPatternName, out var _)) { _ = Time.time; } })); } } foreach (Transform item in pattern.transform) { Transform val4 = item; if (((Object)val4).name.Contains("WebStrand") || ((Object)val4).name.Contains("Web Strand")) { ApplyWebStrandTweaks(((Component)val4).gameObject, name); } } } private void ApplyWebStrandTweaks(GameObject webStrand, string patternName) { Animator val = webStrand.GetComponent(); if ((Object)(object)val == (Object)null) { val = webStrand.GetComponentInChildren(true); } Transform obj = webStrand.transform.Find("web_strand_single"); Transform obj2 = ((obj != null) ? obj.Find("hair") : null); SpriteRenderer[] array = ((obj2 != null) ? ((Component)obj2).GetComponentsInChildren(true) : null); PlayMakerFSM val2 = FSMUtility.LocateMyFSM(webStrand, "Control"); if ((Object)(object)val2 == (Object)null || (Object)(object)val == (Object)null) { return; } Animator capturedAnimator = val; SpriteRenderer[] capturedRenderers = array; if (val2.TryGetState("Appear", out FsmState state)) { state?.InsertAction(0, (FsmStateAction)(object)new InvokeMethod(delegate { capturedAnimator.speed = 0.8f; SetAlpha(0.8f); })); } if (val2.TryGetState("Burst Start", out FsmState state2) && state2 != null) { state2.InsertAction(0, (FsmStateAction)(object)new InvokeMethod(delegate { capturedAnimator.speed = 1.45f; SetAlpha(0.9f); })); if (state2.Actions.Length > 2) { FsmStateAction obj3 = state2.Actions[1]; Wait val3 = (Wait)(object)((obj3 is Wait) ? obj3 : null); if (val3 != null) { val3.time.Value = 1f; } } } if (val2.TryGetState("Burst", out FsmState state3)) { state3?.InsertAction(0, (FsmStateAction)(object)new InvokeMethod(delegate { capturedAnimator.speed = 1f; SetAlpha(1f); })); } if (val2.TryGetState("Inactive", out FsmState state4)) { state4?.InsertAction(0, (FsmStateAction)(object)new InvokeMethod(delegate { capturedAnimator.speed = 1f; SetAlpha(1f); })); } if (!val2.TryGetState("Appear Pause", out FsmState state5) || state5 == null) { return; } FsmStateAction[] actions = state5.Actions; foreach (FsmStateAction obj4 in actions) { WaitRandom val4 = (WaitRandom)(object)((obj4 is WaitRandom) ? obj4 : null); if (val4 != null) { val4.timeMin.Value = 0.1f; val4.timeMax.Value = 0.1f; } } void SetAlpha(float alpha) { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0058: 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_0031: 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) if (capturedRenderers != null) { SpriteRenderer[] array2 = capturedRenderers; foreach (SpriteRenderer val5 in array2) { if ((Object)(object)((Renderer)val5).material != (Object)null) { Color color = ((Renderer)val5).material.color; color.a = alpha; ((Renderer)val5).material.color = color; } Color color2 = val5.color; color2.a = alpha; val5.color = color2; } } } } private void DestroyBarragePatterns() { foreach (GameObject barragePatternClone in _barragePatternClones) { if ((Object)(object)barragePatternClone != (Object)null) { _ = ((Object)barragePatternClone).name; Object.Destroy((Object)(object)barragePatternClone); } } _barragePatternClones.Clear(); } private void DashCombo() { FsmState val = null; FsmState val2 = null; FsmState[] fsmStates = _attackcontrol.FsmStates; foreach (FsmState val3 in fsmStates) { if (val3.Name == "Move Restart 3") { val = val3; } else if (val3.Name == "DashAttack Prepare") { val2 = val3; } } if (val != null && val2 != null) { List list = val.Actions.ToList(); list.Add((FsmStateAction)(object)new InvokeMethod(delegate { float num = (_isP4 ? 0.75f : 0.5f); if (_dashComboCount < 1 && Random.value < num) { _dashComboCount++; _attackcontrol.SetState("DashAttack Prepare"); } else { _ = _dashComboCount; _ = 0; _dashComboCount = 0; } })); val.Actions = list.ToArray(); } _phasecontrol.GetState("Set P4")?.AddAction((FsmStateAction)(object)new InvokeMethod(delegate { _isP4 = true; })); } private void SpeedupBehaviours() { //IL_0435: Unknown result type (might be due to invalid IL or missing references) //IL_043c: Expected O, but got Unknown string[] array = new string[2] { "DashSlash Antic", "DashSlash" }; foreach (string text in array) { tk2dSpriteAnimationClip clipByName = _anim.Library.GetClipByName(text); if (clipByName != null) { clipByName.fps = 15f; } } _attackcontrol.GetState("Rubble Pull Recover").GetAction().time = FsmFloat.op_Implicit(0.75f); _attackcontrol.GetState("Move Restart 4").GetAction().time = FsmFloat.op_Implicit(0.25f); _attackcontrol.GetState("Move Restart 3").GetAction().time = FsmFloat.op_Implicit(0.25f); _attackcontrol.GetState("Move Restart 2").GetAction().time = FsmFloat.op_Implicit(0.5f); _attackcontrol.GetState("Move Restart").GetAction().time = FsmFloat.op_Implicit(0.2f); _attackcontrol.GetState("Slash End").GetAction().time = FsmFloat.op_Implicit(0.5f); _attackcontrol.GetState("Idle").GetAction().time = FsmFloat.op_Implicit(0.2f); _attackcontrol.GetState("Spike Lift Intro").GetAction().time = FsmFloat.op_Implicit(3f); _attackcontrol.GetState("Attack Choice").GetAction(2).weights[0] = FsmFloat.op_Implicit(0.52f); _attackcontrol.GetState("Attack Choice").GetAction(2).weights[1] = FsmFloat.op_Implicit(0.28f); _attackcontrol.GetState("Attack Choice").GetAction(2).weights[2] = FsmFloat.op_Implicit(0.2f); _control.GetState("Dash Recover").GetAction().time = FsmFloat.op_Implicit(0.3f); _control.GetState("Attack Prepare").GetAction().time = FsmFloat.op_Implicit(0.7f); _phasecontrol.GetState("Rubble M").GetAction().time = FsmFloat.op_Implicit(2.4f); _phasecontrol.GetState("Rubble M").GetAction().sendEvent = FsmString.op_Implicit("ATTACK"); _phasecontrol.GetState("Rubble Sides").GetAction().time = FsmFloat.op_Implicit(3f); _attackcontrol.GetState("Dash Attack").GetAction().accelerationFactor = FsmFloat.op_Implicit(6f); _attackcontrol.GetState("Dash Attack").GetAction().targetSpeed = FsmFloat.op_Implicit(-60f); PlayMakerFSM[] rubblefields = _rubblefields; foreach (PlayMakerFSM fsm in rubblefields) { fsm.GetState("Set Attack").GetAction().floatValue = FsmFloat.op_Implicit(1.7f); fsm.GetState("Set Attack Long").GetAction().floatValue = FsmFloat.op_Implicit(3f); } GameObject val = GameObject.Find("Boss Scene/Strand Patterns"); if (!((Object)(object)val != (Object)null)) { return; } array = new string[2] { "Pattern 1", "Pattern 2" }; foreach (string text2 in array) { Transform val2 = val.transform.Find(text2); if ((Object)(object)val2 == (Object)null) { continue; } PlayMakerFSM val3 = FSMUtility.LocateMyFSM(((Component)val2).gameObject, "silk_boss_pattern_control"); if ((Object)(object)val3 == (Object)null) { PlayMakerFSM[] components = ((Component)val2).gameObject.GetComponents(); if (components.Length != 0) { val3 = components[0]; } } if (!((Object)(object)val3 != (Object)null) || !val3.TryGetState("Web Burst Start", out FsmState state) || state == null || state.Actions.Length == 0) { continue; } FsmStateAction val4 = state.Actions[0]; FieldInfo field = ((object)val4).GetType().GetField("delay"); if (field != null && field.FieldType == typeof(FsmFloat)) { FsmFloat val5 = (FsmFloat)field.GetValue(val4); if (val5 != null) { val5.Value = 0.3f; } } } } private void SpeedupWebstrand() { //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Expected O, but got Unknown int num = 0; GameObject val = GameObject.Find("Boss Scene/Strand Patterns"); if ((Object)(object)val == (Object)null) { Log.Warn("Could not find 'Boss Scene/Strand Patterns'"); return; } string[] array = new string[2] { "Pattern 1", "Pattern 2" }; foreach (string text in array) { Transform val2 = val.transform.Find(text); if ((Object)(object)val2 == (Object)null) { continue; } foreach (Transform item in val2) { Transform val3 = item; if (!((Object)val3).name.Contains("WebStrand") && !((Object)val3).name.Contains("Web Strand")) { continue; } Animator val4 = ((Component)val3).GetComponent(); if ((Object)(object)val4 == (Object)null) { val4 = ((Component)val3).GetComponentInChildren(true); } Transform obj = val3.Find("web_strand_single"); Transform obj2 = ((obj != null) ? obj.Find("hair") : null); SpriteRenderer[] array2 = ((obj2 != null) ? ((Component)obj2).GetComponentsInChildren(true) : null); _ = array2?.LongLength; PlayMakerFSM val5 = FSMUtility.LocateMyFSM(((Component)val3).gameObject, "Control"); if ((Object)(object)val5 == (Object)null || (Object)(object)val4 == (Object)null) { continue; } Animator capturedAnimator = val4; SpriteRenderer[] capturedRenderers = array2; if (val5.TryGetState("Appear Pause", out FsmState state) && state != null) { FsmStateAction[] actions = state.Actions; foreach (FsmStateAction obj3 in actions) { WaitRandom val6 = (WaitRandom)(object)((obj3 is WaitRandom) ? obj3 : null); if (val6 != null) { val6.timeMin.Value = 0.1f; val6.timeMax.Value = 0.1f; } } } if (val5.TryGetState("Appear", out FsmState state2)) { state2?.InsertAction(0, (FsmStateAction)(object)new InvokeMethod(delegate { capturedAnimator.speed = 0.8f; SetAlpha(0.8f); })); } if (val5.TryGetState("Burst Start", out FsmState state3) && state3 != null) { state3.InsertAction(0, (FsmStateAction)(object)new InvokeMethod(delegate { capturedAnimator.speed = 1.45f; SetAlpha(0.9f); })); if (state3.Actions.Length > 2) { FsmStateAction obj4 = state3.Actions[1]; Wait val7 = (Wait)(object)((obj4 is Wait) ? obj4 : null); if (val7 != null) { val7.time.Value = 0.1f; } } } if (val5.TryGetState("Burst", out FsmState state4)) { state4?.InsertAction(0, (FsmStateAction)(object)new InvokeMethod(delegate { capturedAnimator.speed = 1f; SetAlpha(1f); })); } if (val5.TryGetState("Inactive", out FsmState state5)) { state5?.InsertAction(0, (FsmStateAction)(object)new InvokeMethod(delegate { capturedAnimator.speed = 1f; SetAlpha(1f); })); } num++; void SetAlpha(float alpha) { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0058: 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_0031: 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) if (capturedRenderers != null) { SpriteRenderer[] array3 = capturedRenderers; foreach (SpriteRenderer val8 in array3) { if ((Object)(object)((Renderer)val8).material != (Object)null) { Color color = ((Renderer)val8).material.color; color.a = alpha; ((Renderer)val8).material.color = color; } Color color2 = val8.color; color2.a = alpha; val8.color = color2; } } } } } } private void ModifySpikePull() { FsmBool canSpikePull = _attackcontrol.Fsm.GetFsmBool("Can Spike Pull"); FsmBool didSpikePull = _attackcontrol.Fsm.GetFsmBool("Did Spike Pull"); FsmBool canRubbleAttack = _attackcontrol.Fsm.GetFsmBool("Can Rubble Attack"); if (canSpikePull == null || didSpikePull == null || canRubbleAttack == null) { Log.Error("Could not find required variables!"); return; } FsmState state = _attackcontrol.GetState("Rubble Attack?"); if (state == null) { Log.Error("Could not find Rubble Attack? state!"); return; } if (state.Actions.Length <= 6) { Log.Error($"Rubble Attack? state only has {state.Actions.Length} actions!"); return; } FsmStateAction val = state.Actions[6]; SendRandomEventV4 rubbleRandomizer = (SendRandomEventV4)(object)((val is SendRandomEventV4) ? val : null); if (rubbleRandomizer == null) { Log.Error("Action at index 6 is not SendRandomEventV4, it's " + ((object)state.Actions[6])?.GetType().Name); return; } val = state.Actions[4]; SendRandomEventV4 finishedRandomizer = (SendRandomEventV4)(object)((val is SendRandomEventV4) ? val : null); if (finishedRandomizer == null) { Log.Error("Action at index 4 is not SendRandomEventV4, it's " + ((object)state.Actions[6])?.GetType().Name); return; } if (rubbleRandomizer.events != null) { _ = rubbleRandomizer.events.LongLength; } _phasecontrol.GetState("Set P2")?.InsertAction(0, (FsmStateAction)(object)new InvokeMethod(delegate { canSpikePull.Value = true; didSpikePull.Value = false; canRubbleAttack.Value = true; if (rubbleRandomizer.events != null && rubbleRandomizer.events.Length != 0) { rubbleRandomizer.events[0] = FsmEvent.GetFsmEvent("FINISHED"); } FingerBlades.EnableAngleStomps(); })); _phasecontrol.GetState("Set P4")?.InsertAction(0, (FsmStateAction)(object)new InvokeMethod(delegate { canSpikePull.Value = false; if ((Object)(object)_stuncontrol != (Object)null) { Object.Destroy((Object)(object)FSMUtility.LocateMyFSM(((Component)this).gameObject, "Stun Control")); _stuncontrol = null; } if (rubbleRandomizer.events != null && rubbleRandomizer.events.Length != 0) { rubbleRandomizer.events[0] = FsmEvent.GetFsmEvent("RUBBLE PULL"); } if (rubbleRandomizer.weights != null && rubbleRandomizer.weights.Length > 1) { rubbleRandomizer.weights[0].Value = 0.75f; rubbleRandomizer.weights[1].Value = 0.25f; } if (rubbleRandomizer.eventMax != null && rubbleRandomizer.eventMax.Length > 1) { rubbleRandomizer.eventMax[0].Value = 2; rubbleRandomizer.eventMax[1].Value = 1; } if (rubbleRandomizer.missedMax != null && rubbleRandomizer.missedMax.Length > 1) { rubbleRandomizer.missedMax[0].Value = 1; rubbleRandomizer.missedMax[1].Value = 2; } })); _phasecontrol.GetState("Set P5")?.InsertAction(0, (FsmStateAction)(object)new InvokeMethod(delegate { canSpikePull.Value = false; if (finishedRandomizer.weights != null && finishedRandomizer.weights.Length > 1) { finishedRandomizer.weights[0].Value = 0.65f; finishedRandomizer.weights[1].Value = 0.35f; finishedRandomizer.eventMax[0].Value = 2; finishedRandomizer.missedMax[1].Value = 2; } })); } private void PinCombo() { FsmState swpStompSwp = _attackcontrol.GetState("Swp Stomp Swp"); FsmState stompSwpStomp = _attackcontrol.GetState("Stomp Swp Stomp"); if (swpStompSwp == null || stompSwpStomp == null) { Log.Error("Could not find pin combo states!"); return; } _phasecontrol.GetState("Set P4")?.AddAction((FsmStateAction)(object)new InvokeMethod(delegate { if (swpStompSwp.Actions.Length > 5) { SetActionTime(swpStompSwp.Actions[3], 0.7f, "Swp Stomp Swp[3] (was [2])"); SetActionTime(swpStompSwp.Actions[5], 1.05f, "Swp Stomp Swp[5] (was [4])"); } if (stompSwpStomp.Actions.Length > 5) { SetActionTime(stompSwpStomp.Actions[3], 0.65f, "Stomp Swp Stomp[3] (was [2])"); SetActionTime(stompSwpStomp.Actions[5], 0.9f, "Stomp Swp Stomp[5] (was [4])"); } })); _phasecontrol.GetState("Set P5")?.AddAction((FsmStateAction)(object)new InvokeMethod(delegate { //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_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Expected O, but got Unknown //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) //IL_005b: 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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Expected O, but got Unknown //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_00f5: 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_0108: 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_011f: Unknown result type (might be due to invalid IL or missing references) //IL_012f: 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: Expected O, but got Unknown FsmStateAction obj = swpStompSwp.Actions[4]; SendEventByName val = (SendEventByName)(object)((obj is SendEventByName) ? obj : null); if (val != null) { swpStompSwp.AddAction((FsmStateAction)new Wait { time = FsmFloat.op_Implicit(0.9f), finishEvent = null, realTime = false }); swpStompSwp.AddAction((FsmStateAction)new SendEventByName { eventTarget = val.eventTarget, sendEvent = FsmString.op_Implicit("STOMP"), delay = FsmFloat.op_Implicit(0f), everyFrame = false }); } else { Log.Error("Could not find SendEventByName at index 4 in Swp Stomp Swp (found " + (((object)swpStompSwp.Actions[4])?.GetType().Name ?? "null") + ")"); } FsmStateAction obj2 = stompSwpStomp.Actions[4]; SendEventByName val2 = (SendEventByName)(object)((obj2 is SendEventByName) ? obj2 : null); if (val2 != null) { stompSwpStomp.AddAction((FsmStateAction)new Wait { time = FsmFloat.op_Implicit(0.9f), finishEvent = null, realTime = false }); stompSwpStomp.AddAction((FsmStateAction)new SendEventByName { eventTarget = val2.eventTarget, sendEvent = FsmString.op_Implicit("SWIPE"), delay = FsmFloat.op_Implicit(0f), everyFrame = false }); } else { Log.Error("Could not find SendEventByName at index 4 in Stomp Swp Stomp (found " + (((object)stompSwpStomp.Actions[4])?.GetType().Name ?? "null") + ")"); } })); } private void SetActionTime(FsmStateAction action, float value, string debugName) { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Expected O, but got Unknown if (action == null) { Log.Warn(debugName + " action is null"); return; } FieldInfo field = ((object)action).GetType().GetField("time"); if (field != null) { if (field.FieldType == typeof(FsmFloat)) { FsmFloat val = (FsmFloat)field.GetValue(action); if (val != null) { val.Value = value; } } else if (field.FieldType == typeof(float)) { field.SetValue(action, value); } } else { Log.Warn(debugName + " has no 'time' field"); } } private void HandAttackVariation() { FsmState state = _attackcontrol.GetState("Hand Ptn Choice"); if (state == null) { Log.Warn("HandAttackVariation: Could not find 'Hand Ptn Choice' state"); return; } if (state.Actions.Length > 1) { FsmStateAction obj = state.Actions[1]; SendRandomEventV4 val = (SendRandomEventV4)(object)((obj is SendRandomEventV4) ? obj : null); if (val != null) { _handPtnChoiceRandomizer = val; if (val.weights != null && val.weights.Length > 5) { _originalHandPtnWeight4 = val.weights[4].Value; _originalHandPtnWeight5 = val.weights[5].Value; val.weights[4].Value = 1.9f; val.weights[5].Value = 1.9f; } goto IL_00ab; } } Log.Warn("HandAttackVariation: Could not find SendRandomEventV4 at index 1 in Hand Ptn Choice"); goto IL_00ab; IL_00ab: FsmState state2 = _attackcontrol.GetState("Swp Stomp Swp"); FsmState state3 = _attackcontrol.GetState("Stomp Swp Stomp"); if (state2 == null || state3 == null) { Log.Warn("HandAttackVariation: Could not find combo states"); return; } FsmStateAction[] actions = state2.Actions; foreach (FsmStateAction obj2 in actions) { SendEventByName val2 = (SendEventByName)(object)((obj2 is SendEventByName) ? obj2 : null); if (val2 != null) { _swpStompSwpEvents.Add(val2); _swpStompSwpOriginalEvents.Add(val2.sendEvent.Value); } } actions = state3.Actions; foreach (FsmStateAction obj3 in actions) { SendEventByName val3 = (SendEventByName)(object)((obj3 is SendEventByName) ? obj3 : null); if (val3 != null) { _stompSwpStompEvents.Add(val3); _stompSwpStompOriginalEvents.Add(val3.sendEvent.Value); } } if (state2.Actions.Length > 4) { FsmStateAction obj4 = state2.Actions[2]; Wait val4 = (Wait)(object)((obj4 is Wait) ? obj4 : null); if (val4 != null) { _swpStompSwpWait2 = val4; _swpStompSwpWait2Original = val4.time.Value; } FsmStateAction obj5 = state2.Actions[4]; Wait val5 = (Wait)(object)((obj5 is Wait) ? obj5 : null); if (val5 != null) { _swpStompSwpWait4 = val5; _swpStompSwpWait4Original = val5.time.Value; } } if (state3.Actions.Length > 4) { FsmStateAction obj6 = state3.Actions[2]; Wait val6 = (Wait)(object)((obj6 is Wait) ? obj6 : null); if (val6 != null) { _stompSwpStompWait2 = val6; _stompSwpStompWait2Original = val6.time.Value; } FsmStateAction obj7 = state3.Actions[4]; Wait val7 = (Wait)(object)((obj7 is Wait) ? obj7 : null); if (val7 != null) { _stompSwpStompWait4 = val7; _stompSwpStompWait4Original = val7.time.Value; } } state2.InsertAction(0, (FsmStateAction)(object)new InvokeMethod(delegate { if (_handVariationActive && Random.value < 0.4f) { _currentVariationActive = true; foreach (SendEventByName swpStompSwpEvent in _swpStompSwpEvents) { if (swpStompSwpEvent.sendEvent.Value == "STOMP") { swpStompSwpEvent.sendEvent.Value = "STOMP"; } else if (swpStompSwpEvent.sendEvent.Value == "STOMP QUICK") { swpStompSwpEvent.sendEvent.Value = "STOMP QUICK"; } } if (_swpStompSwpWait2 != null) { _swpStompSwpWait2.time.Value = 1.05f; } if (_swpStompSwpWait4 != null) { _swpStompSwpWait4.time.Value = 1.4f; } } else { _currentVariationActive = false; } })); state3.InsertAction(0, (FsmStateAction)(object)new InvokeMethod(delegate { if (_handVariationActive && Random.value < 0.7f) { _currentVariationActive = true; foreach (SendEventByName stompSwpStompEvent in _stompSwpStompEvents) { if (stompSwpStompEvent.sendEvent.Value == "STOMP") { stompSwpStompEvent.sendEvent.Value = "STOMP"; } else if (stompSwpStompEvent.sendEvent.Value == "STOMP QUICK") { stompSwpStompEvent.sendEvent.Value = "STOMP QUICK"; } } if (_stompSwpStompWait2 != null) { _stompSwpStompWait2.time.Value = 1.05f; } if (_stompSwpStompWait4 != null) { _stompSwpStompWait4.time.Value = 1.4f; } } else { _currentVariationActive = false; } })); FsmState state4 = _attackcontrol.GetState("Wait For Hands Ready"); if (state4 != null) { state4.InsertAction(0, (FsmStateAction)(object)new InvokeMethod(delegate { RevertHandComboEvents(); })); } else { state.InsertAction(0, (FsmStateAction)(object)new InvokeMethod(delegate { RevertHandComboEvents(); })); } _phasecontrol.GetState("Rubble M")?.InsertAction(0, (FsmStateAction)(object)new InvokeMethod(delegate { _handVariationActive = false; if (_handPtnChoiceRandomizer != null && _handPtnChoiceRandomizer.weights != null && _handPtnChoiceRandomizer.weights.Length > 5) { _handPtnChoiceRandomizer.weights[4].Value = _originalHandPtnWeight4; _handPtnChoiceRandomizer.weights[5].Value = _originalHandPtnWeight5; } RevertHandComboEvents(); })); } private void RevertHandComboEvents() { if (_currentVariationActive) { for (int i = 0; i < _swpStompSwpEvents.Count && i < _swpStompSwpOriginalEvents.Count; i++) { _swpStompSwpEvents[i].sendEvent.Value = _swpStompSwpOriginalEvents[i]; } for (int j = 0; j < _stompSwpStompEvents.Count && j < _stompSwpStompOriginalEvents.Count; j++) { _stompSwpStompEvents[j].sendEvent.Value = _stompSwpStompOriginalEvents[j]; } if (_swpStompSwpWait2 != null) { _swpStompSwpWait2.time.Value = _swpStompSwpWait2Original; } if (_swpStompSwpWait4 != null) { _swpStompSwpWait4.time.Value = _swpStompSwpWait4Original; } if (_stompSwpStompWait2 != null) { _stompSwpStompWait2.time.Value = _stompSwpStompWait2Original; } if (_stompSwpStompWait4 != null) { _stompSwpStompWait4.time.Value = _stompSwpStompWait4Original; } _currentVariationActive = false; } } private void P4PinSpeedup() { if (!((Object)(object)_phasecontrol == (Object)null)) { _phasecontrol.GetState("Set P4")?.AddAction((FsmStateAction)(object)new InvokeMethod(delegate { FingerBlades.ApplyPhase4Timings(); })); } } private void SilkNuke() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //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_006b: Expected O, but got Unknown //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Expected O, but got Unknown //IL_00b3: 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_00c4: Expected O, but got Unknown //IL_00c9: 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_00d6: Expected O, but got Unknown //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Expected O, but got Unknown //IL_0236: 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_023c: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Expected O, but got Unknown //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_025d: 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_0279: Unknown result type (might be due to invalid IL or missing references) //IL_0285: Expected O, but got Unknown //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_028d: 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_0293: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Expected O, but got Unknown //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02bf: Unknown result type (might be due to invalid IL or missing references) //IL_02cb: Unknown result type (might be due to invalid IL or missing references) //IL_02d7: Expected O, but got Unknown //IL_02da: Unknown result type (might be due to invalid IL or missing references) //IL_02df: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: Unknown result type (might be due to invalid IL or missing references) //IL_02e5: Unknown result type (might be due to invalid IL or missing references) //IL_02f1: Expected O, but got Unknown //IL_02f1: Unknown result type (might be due to invalid IL or missing references) //IL_0301: Unknown result type (might be due to invalid IL or missing references) //IL_0311: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0329: Expected O, but got Unknown _tripleNukeBool = new FsmBool("Triple Nuke") { Value = false }; _attackcontrol.FsmVariables.BoolVariables = _attackcontrol.FsmVariables.BoolVariables.Append(_tripleNukeBool).ToArray(); _hasTripleNukedBool = new FsmBool("Has Triple Nuked") { Value = false }; _attackcontrol.FsmVariables.BoolVariables = _attackcontrol.FsmVariables.BoolVariables.Append(_hasTripleNukedBool).ToArray(); FsmInt element = new FsmInt("Nuke Count") { Value = 0 }; FsmInt nukeMax = new FsmInt("Nuke Max") { Value = 1 }; FsmInt element2 = new FsmInt("Nuke Missed Max") { Value = 3 }; _attackcontrol.FsmVariables.IntVariables = _attackcontrol.FsmVariables.IntVariables.Append(element).Append(nukeMax).Append(element2) .ToArray(); FsmState val = ((IEnumerable)_attackcontrol.FsmStates).FirstOrDefault((Func)((FsmState s) => s.Name == "Idle")); if (val == null) { Log.Error("SilkNuke: Could not find Idle state!"); return; } Nuke.BuildAttackFSM(_attackcontrol, val, _tripleNukeBool, _hasTripleNukedBool); FsmEvent nukeEvent = FsmEvent.GetFsmEvent("NUKE ATTACK"); FsmState val2 = ((IEnumerable)_attackcontrol.FsmStates).FirstOrDefault((Func)((FsmState s) => s.Name == "Nuke Prepare")); if (val2 == null) { Log.Error("SilkNuke: Could not find Nuke Prepare state after building!"); return; } FsmTransition toNukeTransition = new FsmTransition { FsmEvent = nukeEvent, ToState = "Nuke Prepare", ToFsmState = val2 }; FsmState state = _phasecontrol.GetState("Set P4"); if (state == null) { Log.Warn("SilkNuke: Set P4 state not found!"); return; } state.AddAction((FsmStateAction)(object)new InvokeMethod(delegate { //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Expected O, but got Unknown //IL_012b: 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_0138: Expected O, but got Unknown if (!_silkNukeInjected) { _silkNukeInjected = true; FsmState state4 = _attackcontrol.GetState("Attack Choice"); if (state4 == null) { Log.Error("SilkNuke: Attack Choice state not found!"); } else { state4.Transitions = state4.Transitions.Append(toNukeTransition).ToArray(); SendRandomEventV4 val3 = null; for (int i = 0; i < state4.Actions.Length; i++) { FsmStateAction obj = state4.Actions[i]; SendRandomEventV4 val4 = (SendRandomEventV4)(object)((obj is SendRandomEventV4) ? obj : null); if (val4 != null) { val3 = val4; break; } } if (val3 == null) { Log.Error("SilkNuke: SendRandomEventV4 not found in Attack Choice!"); } else { _attackChoiceRandomizer = val3; if (val3.weights != null && val3.weights.Length >= 2) { val3.weights[0].Value = 0.36f; val3.weights[1].Value = 0.22f; val3.weights[2].Value = 0.19f; } if (val3.eventMax != null && val3.eventMax.Length >= 2) { val3.eventMax[0].Value = 2; } FsmFloat element3 = new FsmFloat("Nuke Weight") { Value = 0.23f }; FsmInt element4 = new FsmInt("Nuke Missed Max") { Value = 3 }; FsmInt orCreateInt = _attackcontrol.GetOrCreateInt("Ms NUKE ATTACK"); FsmInt orCreateInt2 = _attackcontrol.GetOrCreateInt("Ct NUKE ATTACK"); int num = Array.IndexOf(_attackcontrol.FsmVariables.IntVariables, orCreateInt); int num2 = Array.IndexOf(_attackcontrol.FsmVariables.IntVariables, orCreateInt2); _nukeEventIndex = val3.events.Length; val3.events = val3.events.Append(nukeEvent).ToArray(); val3.weights = val3.weights.Append(element3).ToArray(); val3.eventMax = val3.eventMax.Append(nukeMax).ToArray(); val3.missedMax = val3.missedMax.Append(element4).ToArray(); FieldInfo field = typeof(SendRandomEventV4).GetField("trackingInts", BindingFlags.Instance | BindingFlags.NonPublic); FieldInfo field2 = typeof(SendRandomEventV4).GetField("trackingIntsMissed", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { int[] value = ((int[])field.GetValue(val3)).Concat(new int[1] { num }).ToArray(); field.SetValue(val3, value); } else { Log.Error("SilkNuke: Could not find trackingInts field via reflection!"); } if (field2 != null) { int[] value2 = ((int[])field2.GetValue(val3)).Concat(new int[1] { num2 }).ToArray(); field2.SetValue(val3, value2); } else { Log.Error("SilkNuke: Could not find trackingIntsMissed field via reflection!"); } } } } })); FsmState state2 = _phasecontrol.GetState("Set P6"); if (state2 != null) { state2.AddAction((FsmStateAction)new SetFsmBool { gameObject = new FsmOwnerDefault { OwnerOption = (OwnerDefaultOption)0 }, fsmName = FsmString.op_Implicit("Attack Control"), variableName = FsmString.op_Implicit("Did Web Strand Attack"), setValue = FsmBool.op_Implicit(false), everyFrame = false }); state2.InsertAction(2, (FsmStateAction)new SetFsmBool { gameObject = new FsmOwnerDefault { OwnerOption = (OwnerDefaultOption)0 }, fsmName = FsmString.op_Implicit("Attack Control"), variableName = FsmString.op_Implicit("Can Rubble Attack"), setValue = FsmBool.op_Implicit(false), everyFrame = false }); state2.InsertAction(3, (FsmStateAction)new SetFsmBool { gameObject = new FsmOwnerDefault { OwnerOption = (OwnerDefaultOption)0 }, fsmName = FsmString.op_Implicit("Attack Control"), variableName = FsmString.op_Implicit("Can Spike Pull"), setValue = FsmBool.op_Implicit(false), everyFrame = false }); state2.AddAction((FsmStateAction)(object)new InvokeMethod(delegate { if (_p6DamageReductionCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(_p6DamageReductionCoroutine); } _p6DamageReductionCoroutine = ((MonoBehaviour)this).StartCoroutine(P6DamageReductionWindow()); })); state2.AddAction((FsmStateAction)(object)new InvokeMethod(delegate { EnableTripleNuke(); })); } FsmState state3 = _phasecontrol.GetState("Death Hit"); if (state3 != null) { NukeOrb.DeathHitEntered = false; state3.InsertAction(0, (FsmStateAction)(object)new InvokeMethod(delegate { NukeOrb.DeathHitEntered = true; })); state3.InsertAction(4, (FsmStateAction)(object)new InvokeMethod(delegate { PlayOneShotAudio("Hornet_Shaw"); })); } else { Log.Warn("SilkNuke: Could not find Death Hit state in Phase Control FSM"); } } [IteratorStateMachine(typeof(d__62))] private IEnumerator P6DamageReductionWindow() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__62(0) { <>4__this = this }; } private void EnableTripleNuke() { if (_tripleNukeEnabled) { return; } if (_tripleNukeBool == null) { Log.Warn("EnableTripleNuke: Triple Nuke bool not initialized"); return; } _tripleNukeEnabled = true; FsmState state = _attackcontrol.GetState("Attack Choice"); if (state != null) { for (int i = 0; i < state.Actions.Length; i++) { FsmStateAction obj = state.Actions[i]; BoolTestMulti val = (BoolTestMulti)(object)((obj is BoolTestMulti) ? obj : null); if (val != null) { val.trueEvent = FsmEvent.GetFsmEvent("NUKE ATTACK"); break; } } } else { Log.Warn("EnableTripleNuke: Could not find Attack Choice state for BoolTestMulti modification"); } FsmState state2 = _attackcontrol.GetState("Roar"); if (state2 != null) { state2.AddAction((FsmStateAction)(object)new InvokeMethod(delegate { if (_tripleNukeBool != null && !_tripleNukeBool.Value) { _tripleNukeBool.Value = true; } })); } else { Log.Warn("EnableTripleNuke: Could not find Roar state to add hook"); _tripleNukeBool.Value = true; Log.Warn("EnableTripleNuke: Fallback - Triple Nuke bool set to TRUE immediately"); } ((MonoBehaviour)this).StartCoroutine(WatchForTripleNukeComplete()); } [IteratorStateMachine(typeof(d__64))] private IEnumerator WatchForTripleNukeComplete() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__64(0) { <>4__this = this }; } private void ModifyP5() { //IL_02a2: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_02a8: Unknown result type (might be due to invalid IL or missing references) //IL_02ad: Unknown result type (might be due to invalid IL or missing references) //IL_02bd: Expected O, but got Unknown //IL_02bd: 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_02d0: Expected O, but got Unknown FsmState state = _phasecontrol.GetState("Set P5"); if (state == null) { Log.Error("ModifyP5: Could not find Set P5 state!"); return; } _didWebStrandAttackBool = _attackcontrol.FsmVariables.FindFsmBool("Did Web Strand Attack"); _ = _didWebStrandAttackBool; _canWebStrandAttackBool = _attackcontrol.FsmVariables.FindFsmBool("Can Web Strand Attack"); _ = _canWebStrandAttackBool; _webRecoverState = _attackcontrol.GetState("Web Recover"); if (_webRecoverState != null) { _webRecoverWait = _webRecoverState.GetAction(); if (_webRecoverWait != null) { _originalWebRecoverWait = _webRecoverWait.time.Value; } } _webCastState = _attackcontrol.GetState("Web Cast"); if (_webCastState != null) { PlayAudioEventRandom val = null; for (int i = 0; i < _webCastState.Actions.Length; i++) { FsmStateAction obj = _webCastState.Actions[i]; PlayAudioEventRandom val2 = (PlayAudioEventRandom)(object)((obj is PlayAudioEventRandom) ? obj : null); if (val2 == null) { continue; } val = val2; if (val2.audioClips != null && val2.audioClips.Values != null) { _originalWebCastAudioClips = (object[])val2.audioClips.Values.Clone(); object[] originalWebCastAudioClips = _originalWebCastAudioClips; for (int j = 0; j < originalWebCastAudioClips.Length; j++) { _ = originalWebCastAudioClips[j] is AudioClip; } } break; } _castAnimClip = _anim.Library.GetClipByName("Cast"); if (_castAnimClip != null) { _originalCastAnimFps = _castAnimClip.fps; if (_castAnimClip.frames != null && _castAnimClip.frames.Length != 0) { _originalCastFrameDurations = new float[_castAnimClip.frames.Length]; for (int k = 0; k < _castAnimClip.frames.Length; k++) { _originalCastFrameDurations[k] = 1f; } } } else { Log.Warn("ModifyP5: Could not find 'Cast' animation clip"); } List list = new List(); AudioClip[] array = Resources.FindObjectsOfTypeAll(); foreach (AudioClip val3 in array) { if ((Object)(object)val3 != (Object)null && ((Object)val3).name != null) { string text = ((Object)val3).name.ToLower(); if (text.Contains("long") && text.Contains("scream_a")) { list.Add(val3); } } } _longScreamClips = list.ToArray(); PlayAudioEventRandom capturedAudioAction = val; _webCastState.InsertAction(0, (FsmStateAction)new Wait { time = new FsmFloat { Value = 3f }, finishEvent = null, realTime = false }); _webCastState.InsertAction(1, (FsmStateAction)(object)new InvokeMethod(delegate { if (_webBarrageInProgress) { BossShieldAnimation.TriggerShieldAnimation(); } if (capturedAudioAction == null) { Log.Warn("Web Cast: capturedAudioAction is null!"); } else if (capturedAudioAction.audioClips == null) { Log.Warn("Web Cast: audioClips is null!"); } else if (_webBarrageInProgress && !_barrageAudioAnimReverted && _longScreamClips != null && _longScreamClips.Length != 0) { capturedAudioAction.audioClips.Values = new object[0]; if (_barrageDelayedAudioCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(_barrageDelayedAudioCoroutine); } _barrageDelayedAudioCoroutine = ((MonoBehaviour)this).StartCoroutine(PlayDelayedLongScream()); } else if ((!_webBarrageInProgress || _barrageAudioAnimReverted) && _originalWebCastAudioClips != null && (capturedAudioAction.audioClips.Values == null || capturedAudioAction.audioClips.Values.Length == 0)) { capturedAudioAction.audioClips.Values = _originalWebCastAudioClips; } })); } else { Log.Warn("ModifyP5: Could not find Web Cast state"); } _webPrepareState = _attackcontrol.GetState("Web Prepare"); if (_webPrepareState != null) { _webPrepareState.InsertAction(0, (FsmStateAction)(object)new InvokeMethod(delegate { if (_webBarragePending) { OnWebPrepareEntered(); } })); } else { Log.Error("ModifyP5: Could not find 'Web Prepare' state!"); } FsmState state2 = _attackcontrol.GetState("Double"); if (state2 != null) { state2.InsertAction(0, (FsmStateAction)(object)new InvokeMethod(delegate { if (_webBarrageInProgress) { _barrageDoubleEntryTime = Time.time; ((MonoBehaviour)this).StartCoroutine(FireBarrageWebs()); } })); } else { Log.Error("ModifyP5: Could not find 'Double' state!"); } if (_webRecoverState != null) { _webRecoverState.InsertAction(0, (FsmStateAction)(object)new InvokeMethod(delegate { if (_webBarrageInProgress) { float num = Time.time - _barrageDoubleEntryTime; if (num >= 12f) { EndWebBarrage(); } else { float waitTime = 12f - num; ((MonoBehaviour)this).StartCoroutine(DelayedEndBarrage(waitTime)); } } })); } _attackcontrol.GetState("Catch")?.InsertAction(0, (FsmStateAction)(object)new InvokeMethod(delegate { if (_webBarrageInProgress) { BossShieldAnimation.StopShieldAnimation(); StopBarrageLongScream(); EndWebBarrage(); } })); _attackcontrol.GetState("Idle")?.InsertAction(0, (FsmStateAction)(object)new InvokeMethod(delegate { CheckP5DamageThreshold(); })); _healthManager = ((Component)this).gameObject.GetComponent(); state.AddAction((FsmStateAction)(object)new InvokeMethod(delegate { _p5Reached = true; _p5WebBarrageTriggered = false; _p5DamageDealt = 0; _lastKnownHP = (((Object)(object)_healthManager != (Object)null) ? _healthManager.hp : 0); })); SetupWebStrandUnparentLogging(); } private GameObject? FindAudioPlayerPrefab() { string[] array = new string[4] { "Audio Player Actor Simple", "Audio Player Actor", "Audio Player", "AudioPlayer" }; foreach (string prefabName in array) { GameObject val = ((IEnumerable)Resources.FindObjectsOfTypeAll()).FirstOrDefault((Func)((GameObject go) => ((Object)go).name == prefabName)); if ((Object)(object)val != (Object)null) { return val; } } GameObject val2 = AssetManager.Get("Audio Player Actor Simple"); if ((Object)(object)val2 != (Object)null) { return val2; } Log.Warn("FindAudioPlayerPrefab: No audio player prefab found!"); return null; } private void PlayOneShotAudio(string clipName) { //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_0047: 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_0057: Unknown result type (might be due to invalid IL or missing references) AudioClip val = AssetManager.Get(clipName); if ((Object)(object)val == (Object)null) { Log.Warn("SilkBoss: Audio clip '" + clipName + "' not found"); return; } GameObject val2 = new GameObject("SilkBossAudio_" + clipName); val2.transform.SetParent(((Component)this).transform); val2.transform.localPosition = Vector3.zero; AudioSource val3 = val2.AddComponent(); val3.clip = val; val3.volume = 1f; val3.pitch = 1f; val3.playOnAwake = false; val3.loop = false; val3.spatialBlend = 0f; AudioSource componentInChildren = ((Component)this).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { val3.outputAudioMixerGroup = componentInChildren.outputAudioMixerGroup; } val2.AddComponent().Initialize(val3, val.length + 0.1f); val3.Play(); } private void StartBarrageRumbleLoop() { //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_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Expected O, but got Unknown //IL_0114: Unknown result type (might be due to invalid IL or missing references) StopBarrageRumbleLoop(); GameObject val = ((IEnumerable)Resources.FindObjectsOfTypeAll()).FirstOrDefault((Func)((GameObject go) => ((Object)go).name == "Audio Loop Rumble")); if ((Object)(object)val != (Object)null) { _barrageRumbleAudioInstance = Object.Instantiate(val, ((Component)this).transform.position, Quaternion.identity); ((Object)_barrageRumbleAudioInstance).name = "Barrage Rumble Audio"; AudioSource component = _barrageRumbleAudioInstance.GetComponent(); if ((Object)(object)component != (Object)null) { component.loop = true; component.volume = 1f; component.pitch = 1f; component.Play(); _barrageRumbleCoroutine = ((MonoBehaviour)this).StartCoroutine(StopRumbleAfterDelay(13f)); return; } } AudioClip val2 = ((IEnumerable)Resources.FindObjectsOfTypeAll()).FirstOrDefault((Func)((AudioClip c) => (Object)(object)c != (Object)null && ((Object)c).name == "chorus_under_rocks_shake_loop")); if ((Object)(object)val2 == (Object)null) { Log.Warn("StartBarrageRumbleLoop: chorus_under_rocks_shake_loop AudioClip not found!"); return; } _barrageRumbleAudioInstance = new GameObject("Barrage Rumble Audio"); _barrageRumbleAudioInstance.transform.position = ((Component)this).transform.position; AudioSource obj = _barrageRumbleAudioInstance.AddComponent(); obj.clip = val2; obj.loop = true; obj.volume = 1f; obj.pitch = 1f; obj.spatialBlend = 1f; obj.minDistance = 39f; obj.maxDistance = 70f; obj.rolloffMode = (AudioRolloffMode)2; obj.Play(); _barrageRumbleCoroutine = ((MonoBehaviour)this).StartCoroutine(StopRumbleAfterDelay(12f)); } [IteratorStateMachine(typeof(d__117))] private IEnumerator StopRumbleAfterDelay(float delay) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__117(0) { <>4__this = this, delay = delay }; } private void StopBarrageRumbleLoop() { if (_barrageRumbleCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(_barrageRumbleCoroutine); _barrageRumbleCoroutine = null; } if ((Object)(object)_barrageRumbleAudioInstance != (Object)null) { AudioSource component = _barrageRumbleAudioInstance.GetComponent(); if ((Object)(object)component != (Object)null) { component.Stop(); } Object.Destroy((Object)(object)_barrageRumbleAudioInstance); _barrageRumbleAudioInstance = null; } } [IteratorStateMachine(typeof(d__119))] private IEnumerator PlayDelayedLongScream() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__119(0) { <>4__this = this }; } private void StopBarrageLongScream() { if (_barrageDelayedAudioCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(_barrageDelayedAudioCoroutine); _barrageDelayedAudioCoroutine = null; } if ((Object)(object)_barrageLongScreamAudioInstance != (Object)null) { ((MonoBehaviour)this).StartCoroutine(FadeOutAndDestroyAudio(_barrageLongScreamAudioInstance, 0.4f)); _barrageLongScreamAudioInstance = null; } } [IteratorStateMachine(typeof(d__121))] private IEnumerator FadeOutAndDestroyAudio(GameObject audioObject, float fadeDuration) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__121(0) { audioObject = audioObject, fadeDuration = fadeDuration }; } [IteratorStateMachine(typeof(d__122))] private IEnumerator BarrageAudioAnimRevertCoroutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__122(0) { <>4__this = this }; } private void OnWebPrepareEntered() { _webBarragePending = false; _webBarrageInProgress = true; PlayMakerFSM.BroadcastEvent("ATTACK CLEAR"); _barragePatternIndex = 0; if (_didWebStrandAttackBool != null) { _didWebStrandAttackBool.Value = true; } if (_reEnableWebStrandCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(_reEnableWebStrandCoroutine); _reEnableWebStrandCoroutine = null; } if (_canWebStrandAttackBool != null) { _canWebStrandAttackBool.Value = false; } if (_castAnimSpeedCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(_castAnimSpeedCoroutine); } _castAnimSpeedCoroutine = ((MonoBehaviour)this).StartCoroutine(ControlCastAnimationSpeed()); _barrageAudioAnimReverted = false; if (_barrageAudioAnimRevertCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(_barrageAudioAnimRevertCoroutine); } _barrageAudioAnimRevertCoroutine = ((MonoBehaviour)this).StartCoroutine(BarrageAudioAnimRevertCoroutine()); CreateBarragePatterns(); if (_webRecoverWait != null) { _webRecoverWait.time.Value = 4.2f; } if (_barrageScreenShakeCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(_barrageScreenShakeCoroutine); } _barrageScreenShakeCoroutine = ((MonoBehaviour)this).StartCoroutine(BarrageScreenShakeCoroutine()); _webBarrageScreenShakeStarted = true; } [IteratorStateMachine(typeof(d__124))] private IEnumerator FireBarrageWebs() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__124(0) { <>4__this = this }; } private void EndWebBarrage() { if (_webBarrageInProgress) { _webBarrageInProgress = false; BossShieldAnimation.StopShieldAnimation(); if (_webRecoverWait != null) { float value = Mathf.Max(0.3f, _originalWebRecoverWait - 0.35f); _webRecoverWait.time.Value = value; } if (_barrageAudioAnimRevertCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(_barrageAudioAnimRevertCoroutine); _barrageAudioAnimRevertCoroutine = null; } if (_castAnimSpeedCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(_castAnimSpeedCoroutine); _castAnimSpeedCoroutine = null; } if ((Object)(object)_anim != (Object)null && _castAnimClip != null) { _anim.ClipFps = _originalCastAnimFps; } if (_barrageScreenShakeCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(_barrageScreenShakeCoroutine); _barrageScreenShakeCoroutine = null; } _webBarrageScreenShakeStarted = false; StopBarrageRumbleLoop(); StopBarrageLongScream(); _barragePatternIndex = 0; ((MonoBehaviour)this).StartCoroutine(DelayedDestroyBarragePatterns()); if (_reEnableWebStrandCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(_reEnableWebStrandCoroutine); } _reEnableWebStrandCoroutine = ((MonoBehaviour)this).StartCoroutine(ReEnableWebStrandAfterDelay(7f)); PlayMakerFSM val = FSMUtility.LocateMyFSM(((Component)this).gameObject, "Control"); if ((Object)(object)val != (Object)null) { val.SendEvent("MOVE START"); } } } [IteratorStateMachine(typeof(d__126))] private IEnumerator ControlCastAnimationSpeed() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__126(0) { <>4__this = this }; } [IteratorStateMachine(typeof(d__127))] private IEnumerator BarrageScreenShakeCoroutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__127(0) { <>4__this = this }; } [IteratorStateMachine(typeof(d__128))] private IEnumerator DelayedDestroyBarragePatterns() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__128(0) { <>4__this = this }; } [IteratorStateMachine(typeof(d__129))] private IEnumerator DelayedEndBarrage(float waitTime) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__129(0) { <>4__this = this, waitTime = waitTime }; } [IteratorStateMachine(typeof(d__130))] private IEnumerator ReEnableWebStrandAfterDelay(float delay) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__130(0) { <>4__this = this, delay = delay }; } private void SetupWebStrandUnparentLogging() { GameObject val = GameObject.Find("Boss Scene/Strand Patterns"); if ((Object)(object)val == (Object)null) { Log.Warn("ModifyP5: Could not find Strand Patterns for unparent logging"); return; } string[] array = new string[2] { "Pattern 1", "Pattern 2" }; foreach (string text in array) { Transform val2 = val.transform.Find(text); if ((Object)(object)val2 == (Object)null) { Log.Warn("ModifyP5: Could not find " + text); continue; } PlayMakerFSM[] components = ((Component)val2).gameObject.GetComponents(); PlayMakerFSM val3 = null; PlayMakerFSM[] array2 = components; foreach (PlayMakerFSM val4 in array2) { if (val4.FsmName == "silk_boss_pattern_control" || val4.FsmName.Contains("pattern")) { val3 = val4; } } if ((Object)(object)val3 == (Object)null && components.Length != 0) { val3 = components[0]; } if ((Object)(object)val3 == (Object)null) { Log.Warn("ModifyP5: No FSM found on " + text); continue; } FsmState[] fsmStates = val3.FsmStates; for (int j = 0; j < fsmStates.Length; j++) { _ = fsmStates[j]; } string capturedPatternName = text; if (val3.TryGetState("Random Shift", out FsmState state) && state != null) { state.InsertAction(0, (FsmStateAction)(object)new InvokeMethod(delegate { _webStrandUnparentTimes[capturedPatternName] = Time.time; })); } else { Log.Warn("ModifyP5: Could not find Random Shift state on " + text); } if (val3.TryGetState("Reparent", out FsmState state2) && state2 != null) { state2.InsertAction(0, (FsmStateAction)(object)new InvokeMethod(delegate { if (_webStrandUnparentTimes.TryGetValue(capturedPatternName, out var _)) { _ = Time.time; } })); } else { Log.Warn("ModifyP5: Could not find Reparent state on " + text); } } } private void CheckP5DamageThreshold() { if (!_p5Reached || _p5WebBarrageTriggered || !((Object)(object)_healthManager != (Object)null)) { return; } int hp = _healthManager.hp; if (hp < _lastKnownHP) { int num = _lastKnownHP - hp; _p5DamageDealt += num; _lastKnownHP = hp; } if (_p5DamageDealt >= 160 && !_p5WebBarrageTriggered) { _p5WebBarrageTriggered = true; if (_canWebStrandAttackBool != null) { _canWebStrandAttackBool.Value = true; } if (_didWebStrandAttackBool != null) { _didWebStrandAttackBool.Value = false; } _webBarragePending = true; } } private void ReplaceTitleCard() { //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_0146: 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_0189: Unknown result type (might be due to invalid IL or missing references) GameObject val = GameObject.Find("Boss Title"); if ((Object)(object)val == (Object)null) { Log.Error("Could not find 'Boss Title' object"); return; } Transform val2 = val.transform.Find("Title Text"); if ((Object)(object)val2 == (Object)null) { Log.Error("Could not find 'Title Text' child"); return; } Transform val3 = val2.Find("Silk_Title_Image"); if ((Object)(object)val3 == (Object)null) { Log.Error("Could not find 'Silk_Title_Image' child"); return; } Transform val4 = val2.Find("Silk_Title_Text"); if ((Object)(object)val4 == (Object)null) { Log.Error("Could not find 'Silk_Title_Text' child"); return; } LanguageCode val5 = Language.CurrentLanguage(); string text = ((object)(LanguageCode)(ref val5)).ToString(); Log.Info("Current language: " + text); string text2 = "Silk_Title_Image_" + text; Texture2D val6 = AssetManager.Get(text2); if ((Object)(object)val6 == (Object)null) { Log.Info("Language-specific texture '" + text2 + "' not found, using default..."); text2 = "Silk_Title_Image"; val6 = AssetManager.Get(text2); } if ((Object)(object)val6 == (Object)null) { Log.Error("Could not load custom title image texture"); return; } Log.Info("Loaded custom texture: " + text2); SpriteRenderer component = ((Component)val3).GetComponent(); if ((Object)(object)component != (Object)null) { Sprite sprite = Sprite.Create(val6, new Rect(0f, 0f, (float)((Texture)val6).width, (float)((Texture)val6).height), new Vector2(0.5f, 0.5f), 100f); component.sprite = sprite; Log.Info("Replaced title card sprite"); val3.localScale = new Vector3(0.75f, 0.75f, 1f); Log.Info("Scaled title card%"); } else { Log.Error("Silk_Title_Image does not have a SpriteRenderer component"); } ActivatePerLanguage component2 = ((Component)val2).GetComponent(); if ((Object)(object)component2 != (Object)null) { ((Behaviour)component2).enabled = false; Log.Info("Disabled ActivatePerLanguage component"); } ((Component)val3).gameObject.SetActive(true); ((Component)val4).gameObject.SetActive(false); } private void ModifyRoarP6() { FsmState state = _phasecontrol.GetState("Set P6"); if (state == null) { Log.Error("ModifyRoarP6: Could not find Set P6 state"); return; } state.AddAction((FsmStateAction)(object)new InvokeMethod(delegate { RoarAnticPitch(1.04f); })); } private void ModifyMoveRestartP6() { FsmState state = _phasecontrol.GetState("Set P6"); if (state == null) { Log.Error("ModifyMoveRestartP6: Could not find Set P6 state"); return; } state.AddAction((FsmStateAction)(object)new InvokeMethod(delegate { _attackcontrol.GetState("Move Restart").GetAction().time = FsmFloat.op_Implicit(0.75f); })); } private void RoarAnticPitch(float pitch) { FsmState state = _attackcontrol.GetState("Roar"); if (state == null) { Log.Warn("Roar state not found"); return; } for (int i = 0; i < state.Actions.Length; i++) { FsmStateAction obj = state.Actions[i]; PlayAudioEventRandom val = (PlayAudioEventRandom)(object)((obj is PlayAudioEventRandom) ? obj : null); if (val != null) { ((PlayAudioEventBase)val).pitchMin.Value = pitch; ((PlayAudioEventBase)val).pitchMax.Value = pitch; break; } } } private void ModifyP6() { FsmState state = _phasecontrol.GetState("Set P6"); if (state == null) { Log.Error("ModifyP6: Could not find Set P6 state"); return; } FsmState state2 = _attackcontrol.GetState("Double"); if (state2 == null) { Log.Error("ModifyP6: Could not double"); return; } SendEventByName doubleSendEvent = null; FsmStateAction[] actions = state2.Actions; foreach (FsmStateAction obj in actions) { SendEventByName val = (SendEventByName)(object)((obj is SendEventByName) ? obj : null); if (val != null) { doubleSendEvent = val; } } if (doubleSendEvent == null) { Log.Error("ModifyP6: Could not find SendEventByName in Double state"); return; } state2.InsertAction(0, (FsmStateAction)(object)new InvokeMethod(delegate { if (_p6TripleWebActive && !_webBarrageInProgress) { ((MonoBehaviour)this).StartCoroutine(FireThirdWebAttack()); } })); state.AddAction((FsmStateAction)(object)new InvokeMethod(delegate { if (_webBarrageInProgress) { EndWebBarrage(); } if (_webBarragePending) { _webBarragePending = false; } GameObject val2 = GameObject.Find("Boss Scene/Strand Patterns"); if ((Object)(object)val2 == (Object)null) { Log.Error("P6: Could not find Strand Patterns"); } else { Transform val3 = val2.transform.Find("Pattern 3"); if ((Object)(object)val3 != (Object)null) { Object.Destroy((Object)(object)((Component)val3).gameObject); } _p6Pattern3Clone = ClonePattern(val2, "Pattern 1", "Pattern 3"); if ((Object)(object)_p6Pattern3Clone != (Object)null) { ApplyPatternTweaks(_p6Pattern3Clone); } doubleSendEvent.delay.Value = 0.8f; if (_webRecoverWait != null) { _webRecoverWait.time.Value = 1.1f; _originalWebRecoverWait = 1.1f; } else { Log.Warn("P6: _webRecoverWait is null, cannot set Web Recover Wait"); } } })); } [IteratorStateMachine(typeof(d__140))] private IEnumerator FireThirdWebAttack() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__140(0); } [IteratorStateMachine(typeof(d__141))] private IEnumerator FireWebstrandBarrageWeb(float delay, int webNumber, int totalWebs) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__141(0) { <>4__this = this, delay = delay, webNumber = webNumber, totalWebs = totalWebs }; } private GameObject? GetNextBarragePattern(GameObject strandPatterns) { if (_barragePatternIndex >= _barragePatternSequence.Length) { _barragePatternIndex = 0; } int num = _barragePatternSequence[_barragePatternIndex]; string text = $"Pattern {num}"; Transform val = strandPatterns.transform.Find(text); if ((Object)(object)val == (Object)null) { Log.Warn("P5 Web Barrage: Could not find '" + text + "', trying next in sequence"); _barragePatternIndex++; return GetNextBarragePattern(strandPatterns); } _barragePatternIndex++; return ((Component)val).gameObject; } private void ModifyPatternAlternation() { int num = 0; FsmState state = _attackcontrol.GetState("Activate Strands"); if (state != null) { if (HookPatternSelectionState(state, "Activate Strands")) { num++; } } else { Log.Warn("ModifyPatternAlternation: Could not find 'Activate Strands' state"); } FsmState state2 = _attackcontrol.GetState("Double"); if (state2 != null) { if (HookPatternSelectionState(state2, "Double")) { num++; } } else { Log.Warn("ModifyPatternAlternation: Could not find 'Double' state"); } if (num <= 0) { Log.Error("ModifyPatternAlternation: Failed to hook any states"); } } private bool HookPatternSelectionState(FsmState state, string stateName) { string stateName2 = stateName; GetRandomChild val = null; int num = -1; for (int i = 0; i < state.Actions.Length; i++) { FsmStateAction obj = state.Actions[i]; GetRandomChild val2 = (GetRandomChild)(object)((obj is GetRandomChild) ? obj : null); if (val2 != null) { val = val2; num = i; break; } } if (val == null) { Log.Warn("ModifyPatternAlternation: Could not find GetRandomChild in '" + stateName2 + "' state"); return false; } FsmGameObject patternVar = val.storeResult; state.InsertAction(num + 1, (FsmStateAction)(object)new InvokeMethod(delegate { //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Expected O, but got Unknown if (patternVar == null) { Log.Warn("PatternAlternation [" + stateName2 + "]: patternVar is null"); } else if (_webBarrageInProgress) { GameObject val3 = GameObject.Find("Boss Scene/Strand Patterns"); if ((Object)(object)val3 == (Object)null) { Log.Warn("PatternAlternation [" + stateName2 + "] BARRAGE: Could not find Strand Patterns"); } else { GameObject nextBarragePattern = GetNextBarragePattern(val3); if ((Object)(object)nextBarragePattern != (Object)null) { if ((Object)(object)patternVar.Value != (Object)null) { _ = ((Object)patternVar.Value).name; } patternVar.Value = nextBarragePattern; } else { Log.Warn("PatternAlternation [" + stateName2 + "] BARRAGE: GetNextBarragePattern returned null"); } } } else if ((Object)(object)patternVar.Value == (Object)null) { Log.Warn("PatternAlternation [" + stateName2 + "]: patternVar.Value is null"); } else { string name = ((Object)patternVar.Value).name; bool flag = IsOddPattern(name); if (flag == _lastPatternWasOdd) { GameObject val4 = GameObject.Find("Boss Scene/Strand Patterns"); if ((Object)(object)val4 == (Object)null) { Log.Warn("PatternAlternation [" + stateName2 + "]: Could not find Strand Patterns"); _lastPatternWasOdd = flag; } else { List list = new List(); foreach (Transform item in val4.transform) { Transform val5 = item; string name2 = ((Object)val5).name; if (IsOddPattern(name2) != _lastPatternWasOdd) { list.Add(((Component)val5).gameObject); } } if (list.Count > 0) { int index = Random.Range(0, list.Count); GameObject val6 = list[index]; patternVar.Value = val6; bool lastPatternWasOdd = IsOddPattern(((Object)val6).name); _lastPatternWasOdd = lastPatternWasOdd; } else { _lastPatternWasOdd = flag; } } } else { _lastPatternWasOdd = flag; } } })); return true; } private bool IsOddPattern(string patternName) { if (patternName.EndsWith("1") || patternName.EndsWith("3") || patternName.EndsWith("5") || patternName.EndsWith("7")) { return true; } return false; } private void ModifyStun() { if ((Object)(object)_stuncontrol == (Object)null) { Log.Warn("ModifyStun: _stuncontrol is null"); return; } FsmFloat val = _stuncontrol.FsmVariables.FindFsmFloat("Stun Hit Max"); if (val != null) { try { FieldInfo field = typeof(NamedVariable).GetField("castVariable", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { object? value = field.GetValue(val); FsmInt val2 = (FsmInt)((value is FsmInt) ? value : null); if (val2 != null) { val2.Value = 21; } } } catch (Exception ex) { Log.Warn("ModifyStun: Failed to access CastVariable via reflection: " + ex.Message); } ((NamedVariable)val).UseVariable = false; ((NamedVariable)val).RawValue = 21; } else { Log.Warn("ModifyStun: FsmFloat 'Stun Hit Max' not found"); } FsmInt val3 = _stuncontrol.FsmVariables.FindFsmInt("Stun Hit Max"); if (val3 != null) { val3.Value = 21; } FsmState state = _stuncontrol.GetState("Max Check"); if (state != null) { for (int i = 0; i < state.Actions.Length; i++) { FsmStateAction obj = state.Actions[i]; FloatCompare val4 = (FloatCompare)(object)((obj is FloatCompare) ? obj : null); if (val4 != null) { try { ((NamedVariable)val4.float2).RawValue = 21; ((NamedVariable)val4.float2).UseVariable = false; break; } catch (Exception ex2) { Log.Warn("ModifyStun: Failed to modify FloatCompare.float2: " + ex2.Message); break; } } } } else { Log.Warn("ModifyStun: Max Check state not found"); } } private void OnDestroy() { if ((Object)(object)Instance == (Object)(object)this) { Instance = null; } NukeOrb.ResetPool(); NukeOrbAnimation.Reset(); NukeParticles.Reset(); BossShieldAnimation.Reset(); BossAnimation.Reset(); AssetManager.UnloadManualBundles(); Log.Info("SilkBoss: OnDestroy complete"); } internal static int ApplyBarrageDamageReduction(int originalDamage) { int num = Mathf.RoundToInt((float)originalDamage * 0.3f); return Mathf.Max(1, num); } } [HarmonyPatch(typeof(HealthManager), "Hit")] internal static class HealthManagerBarragePatch { [HarmonyPrefix] private static void Prefix(HealthManager __instance, ref HitInstance hitInstance) { if ((Object)(object)SilkBoss.Instance != (Object)null && SilkBoss.Instance.IsBarrageDamageReductionActive && (Object)(object)((Component)__instance).gameObject == (Object)(object)((Component)SilkBoss.Instance).gameObject) { hitInstance.DamageDealt = SilkBoss.ApplyBarrageDamageReduction(hitInstance.DamageDealt); } } } }