Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of SkarrQueen v1.0.5
SkarrQueen/SkarrQueen.dll
Decompiled 6 months ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using HarmonyLib; using HutongGames.PlayMaker; using HutongGames.PlayMaker.Actions; using JetBrains.Annotations; using Microsoft.CodeAnalysis; using SkarrQueen.Behaviours; using SkarrQueen.Patches; using TeamCherry.Localization; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.ResourceManagement.AsyncOperations; using UnityEngine.ResourceManagement.ResourceProviders; using UnityEngine.SceneManagement; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("SkarrQueen")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+e320c7be0dd0b7fc0d5645173c0259d2636c198f")] [assembly: AssemblyProduct("SkarrQueen")] [assembly: AssemblyTitle("SkarrQueen")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [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 BepInEx { [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)] [Conditional("CodeGeneration")] internal sealed class BepInAutoPluginAttribute : Attribute { public BepInAutoPluginAttribute(string? id = null, string? name = null, string? version = null) { } } } namespace BepInEx.Preloader.Core.Patching { [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)] [Conditional("CodeGeneration")] internal sealed class PatcherAutoPluginAttribute : Attribute { public PatcherAutoPluginAttribute(string? id = null, string? name = null, string? version = null) { } } } namespace SkarrQueen { internal static class AssetManager { [CompilerGenerated] private sealed class <>c__DisplayClass6_0 { public string prefabName; internal bool <LoadScenePrefabs>b__0(Transform obj) { return ((Object)obj).name == prefabName; } } [CompilerGenerated] private sealed class <Init>d__5 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <Init>d__5(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; <>2__current = LoadScenePrefabs(); <>1__state = 1; return true; case 1: <>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 <LoadBundleAssets>d__7 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; private string <platformFolder>5__1; private string <bundlesPath>5__2; private RuntimePlatform <>s__3; private Dictionary<string, string[]>.Enumerator <>s__4; private string <bundleName>5__5; private string[] <assetNames>5__6; private bool <bundleAlreadyLoaded>5__7; private string <bundlePath>5__8; private AssetBundleCreateRequest <bundleLoadRequest>5__9; private AssetBundle <bundle>5__10; private IEnumerator<AssetBundle> <>s__11; private AssetBundle <loadedBundle>5__12; private string[] <>s__13; private int <>s__14; private string <assetPath>5__15; private string[] <>s__16; private int <>s__17; private string <assetName>5__18; private AssetBundleRequest <loadAssetRequest>5__19; private Object <loadedAsset>5__20; private string[] <>s__21; private int <>s__22; private string <assetPath>5__23; private string[] <>s__24; private int <>s__25; private string <assetName>5__26; private AssetBundleRequest <assetLoadRequest>5__27; private Object <loadedAsset>5__28; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <LoadBundleAssets>d__7(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { int num = <>1__state; if ((uint)(num - -4) <= 1u || (uint)(num - 1) <= 2u) { try { if (num == -4 || num == 1) { try { } finally { <>m__Finally2(); } } } finally { <>m__Finally1(); } } <platformFolder>5__1 = null; <bundlesPath>5__2 = null; <>s__4 = default(Dictionary<string, string[]>.Enumerator); <bundleName>5__5 = null; <assetNames>5__6 = null; <bundlePath>5__8 = null; <bundleLoadRequest>5__9 = null; <bundle>5__10 = null; <>s__11 = null; <loadedBundle>5__12 = null; <>s__13 = null; <assetPath>5__15 = null; <>s__16 = null; <assetName>5__18 = null; <loadAssetRequest>5__19 = null; <loadedAsset>5__20 = null; <>s__21 = null; <assetPath>5__23 = null; <>s__24 = null; <assetName>5__26 = null; <assetLoadRequest>5__27 = null; <loadedAsset>5__28 = null; <>1__state = -2; } private bool MoveNext() { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_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_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Invalid comparison between Unknown and I4 //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Invalid comparison between Unknown and I4 //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Invalid comparison between Unknown and I4 try { string key; switch (<>1__state) { default: return false; case 0: { <>1__state = -1; <>s__3 = Application.platform; if (1 == 0) { } RuntimePlatform val = <>s__3; key = (((int)val == 1) ? "StandaloneOSX" : (((int)val == 2) ? "StandaloneWindows64" : (((int)val != 13) ? "" : "StandaloneLinux64"))); if (1 == 0) { } <platformFolder>5__1 = key; <bundlesPath>5__2 = Path.Combine(Addressables.RuntimePath, <platformFolder>5__1); <>s__4 = BundleAssets.GetEnumerator(); <>1__state = -3; goto IL_04bf; } case 1: <>1__state = -4; <loadedAsset>5__20 = <loadAssetRequest>5__19.asset; AssetManager.TryAdd<Object>(<loadedAsset>5__20); Debug.Log((object)<loadedAsset>5__20.name); goto IL_023c; case 2: <>1__state = -3; <bundle>5__10 = <bundleLoadRequest>5__9.assetBundle; _manuallyLoadedBundles.Add(<bundle>5__10); <>s__21 = <bundle>5__10.GetAllAssetNames(); <>s__22 = 0; goto IL_0481; case 3: { <>1__state = -3; <loadedAsset>5__28 = <assetLoadRequest>5__27.asset; AssetManager.TryAdd<Object>(<loadedAsset>5__28); <assetLoadRequest>5__27 = null; <loadedAsset>5__28 = null; goto IL_043b; } IL_0481: if (<>s__22 < <>s__21.Length) { <assetPath>5__23 = <>s__21[<>s__22]; <>s__24 = <assetNames>5__6; <>s__25 = 0; goto IL_0451; } <>s__21 = null; <bundlePath>5__8 = null; <bundleLoadRequest>5__9 = null; <bundle>5__10 = null; <bundleName>5__5 = null; <assetNames>5__6 = null; goto IL_04bf; IL_023c: <>s__16 = null; if (<bundleAlreadyLoaded>5__7) { goto IL_027b; } <assetPath>5__15 = null; <>s__14++; goto IL_0268; IL_027b: <>s__13 = null; if (<bundleAlreadyLoaded>5__7) { goto IL_02a9; } <loadedBundle>5__12 = null; goto IL_0299; IL_0451: if (<>s__25 < <>s__24.Length) { <assetName>5__26 = <>s__24[<>s__25]; if (<assetPath>5__23.GetAssetRoot() == <assetName>5__26) { <assetLoadRequest>5__27 = <bundle>5__10.LoadAssetAsync(<assetPath>5__23); <>2__current = <assetLoadRequest>5__27; <>1__state = 3; return true; } goto IL_043b; } <>s__24 = null; <assetPath>5__23 = null; <>s__22++; goto IL_0481; IL_0268: if (<>s__14 < <>s__13.Length) { <assetPath>5__15 = <>s__13[<>s__14]; <>s__16 = <assetNames>5__6; for (<>s__17 = 0; <>s__17 < <>s__16.Length; <>s__17++) { <assetName>5__18 = <>s__16[<>s__17]; if (<assetPath>5__15.GetAssetRoot() == <assetName>5__18) { <bundleAlreadyLoaded>5__7 = true; <loadAssetRequest>5__19 = <loadedBundle>5__12.LoadAssetAsync(<assetPath>5__15); <>2__current = <loadAssetRequest>5__19; <>1__state = 1; return true; } <assetName>5__18 = null; } goto IL_023c; } goto IL_027b; IL_0299: if (<>s__11.MoveNext()) { <loadedBundle>5__12 = <>s__11.Current; <>s__13 = <loadedBundle>5__12.GetAllAssetNames(); <>s__14 = 0; goto IL_0268; } goto IL_02a9; IL_043b: <assetName>5__26 = null; <>s__25++; goto IL_0451; IL_02a9: <>m__Finally2(); <>s__11 = null; if (<bundleAlreadyLoaded>5__7) { Debug.Log((object)("Bundle " + <bundleName>5__5 + " already loaded!")); goto IL_04bf; } <bundlePath>5__8 = Path.Combine(<bundlesPath>5__2, <bundleName>5__5 + ".bundle"); <bundleLoadRequest>5__9 = AssetBundle.LoadFromFileAsync(<bundlePath>5__8); <>2__current = <bundleLoadRequest>5__9; <>1__state = 2; return true; IL_04bf: if (<>s__4.MoveNext()) { <>s__4.Current.Deconstruct(out key, out string[] value); <bundleName>5__5 = key; <assetNames>5__6 = value; <bundleAlreadyLoaded>5__7 = false; <>s__11 = AssetBundle.GetAllLoadedAssetBundles().GetEnumerator(); <>1__state = -4; goto IL_0299; } <>m__Finally1(); <>s__4 = default(Dictionary<string, string[]>.Enumerator); return false; } } 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; ((IDisposable)<>s__4).Dispose(); } private void <>m__Finally2() { <>1__state = -3; if (<>s__11 != null) { <>s__11.Dispose(); } } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <LoadScenePrefabs>d__6 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; private Dictionary<string, string[]>.Enumerator <>s__1; private string <sceneName>5__2; private string[] <prefabNames>5__3; private string <loadScenePath>5__4; private AsyncOperationHandle<SceneInstance> <loadSceneHandle>5__5; private AsyncOperationHandle<SceneInstance> <unloadSceneHandle>5__6; private SceneInstance <sceneInstance>5__7; private Scene <scene>5__8; private GameObject[] <>s__9; private int <>s__10; private GameObject <rootObj>5__11; private string[] <>s__12; private int <>s__13; private <>c__DisplayClass6_0 <>8__14; private GameObject <prefab>5__15; private GameObject <prefabCopy>5__16; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <LoadScenePrefabs>d__6(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) int num = <>1__state; if (num == -3 || (uint)(num - 1) <= 1u) { try { } finally { <>m__Finally1(); } } <>s__1 = default(Dictionary<string, string[]>.Enumerator); <sceneName>5__2 = null; <prefabNames>5__3 = null; <loadScenePath>5__4 = null; <loadSceneHandle>5__5 = default(AsyncOperationHandle<SceneInstance>); <unloadSceneHandle>5__6 = default(AsyncOperationHandle<SceneInstance>); <sceneInstance>5__7 = default(SceneInstance); <>s__9 = null; <rootObj>5__11 = null; <>s__12 = null; <>8__14 = null; <prefab>5__15 = null; <prefabCopy>5__16 = null; <>1__state = -2; } private bool MoveNext() { //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Invalid comparison between Unknown and I4 //IL_02e7: Unknown result type (might be due to invalid IL or missing references) //IL_02f3: 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_0106: 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_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Unknown result type (might be due to invalid IL or missing references) try { switch (<>1__state) { default: return false; case 0: <>1__state = -1; AudioManager.BlockAudioChange = true; <>s__1 = ScenePrefabs.GetEnumerator(); <>1__state = -3; break; case 1: <>1__state = -3; if ((int)<loadSceneHandle>5__5.Status == 1) { <sceneInstance>5__7 = <loadSceneHandle>5__5.Result; <scene>5__8 = ((SceneInstance)(ref <sceneInstance>5__7)).Scene; <>s__9 = ((Scene)(ref <scene>5__8)).GetRootGameObjects(); for (<>s__10 = 0; <>s__10 < <>s__9.Length; <>s__10++) { <rootObj>5__11 = <>s__9[<>s__10]; <>s__12 = <prefabNames>5__3; for (<>s__13 = 0; <>s__13 < <>s__12.Length; <>s__13++) { <>8__14 = new <>c__DisplayClass6_0(); <>8__14.prefabName = <>s__12[<>s__13]; Transform? obj2 = ((IEnumerable<Transform>)<rootObj>5__11.GetComponentsInChildren<Transform>(true)).FirstOrDefault((Func<Transform, bool>)((Transform obj) => ((Object)obj).name == <>8__14.prefabName)); <prefab>5__15 = ((obj2 != null) ? ((Component)obj2).gameObject : null); if (Object.op_Implicit((Object)(object)<prefab>5__15)) { <prefab>5__15.SetActive(false); <prefabCopy>5__16 = Object.Instantiate<GameObject>(<prefab>5__15); ((Object)<prefabCopy>5__16).name = <>8__14.prefabName; Object.DontDestroyOnLoad((Object)(object)<prefabCopy>5__16); AssetManager.TryAdd<GameObject>(<prefabCopy>5__16); <prefabCopy>5__16 = null; } <prefab>5__15 = null; <>8__14 = null; } <>s__12 = null; <rootObj>5__11 = null; } <>s__9 = null; <sceneInstance>5__7 = default(SceneInstance); } else { Debug.Log((object)<loadSceneHandle>5__5.OperationException); } <unloadSceneHandle>5__6 = Addressables.UnloadSceneAsync(<loadSceneHandle>5__5, true); <>2__current = <unloadSceneHandle>5__6; <>1__state = 2; return true; case 2: <>1__state = -3; <loadScenePath>5__4 = null; <loadSceneHandle>5__5 = default(AsyncOperationHandle<SceneInstance>); <unloadSceneHandle>5__6 = default(AsyncOperationHandle<SceneInstance>); <sceneName>5__2 = null; <prefabNames>5__3 = null; break; } if (<>s__1.MoveNext()) { <>s__1.Current.Deconstruct(out string key, out string[] value); <sceneName>5__2 = key; <prefabNames>5__3 = value; <loadScenePath>5__4 = "Scenes/" + <sceneName>5__2; <loadSceneHandle>5__5 = Addressables.LoadSceneAsync((object)<loadScenePath>5__4, (LoadSceneMode)1, true, 100, (SceneReleaseMode)0); <>2__current = <loadSceneHandle>5__5; <>1__state = 1; return true; } <>m__Finally1(); <>s__1 = default(Dictionary<string, string[]>.Enumerator); AudioManager.BlockAudioChange = false; return false; } 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; ((IDisposable)<>s__1).Dispose(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static readonly Dictionary<string, string[]> ScenePrefabs = new Dictionary<string, string[]> { ["Bone_East_18b"] = new string[1] { "Boss Scene" } }; private static readonly Dictionary<string, string[]> BundleAssets = new Dictionary<string, string[]>(); private static List<AssetBundle> _manuallyLoadedBundles = new List<AssetBundle>(); private static readonly Dictionary<Type, Dictionary<string, Object>> Assets = new Dictionary<Type, Dictionary<string, Object>>(); internal static string GetAssetRoot(this string assetPath) { return assetPath.Split("/").Last().Replace(".asset", "") .Replace(".prefab", "") .Replace(".wav", ""); } [IteratorStateMachine(typeof(<Init>d__5))] internal static IEnumerator Init() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <Init>d__5(0); } [IteratorStateMachine(typeof(<LoadScenePrefabs>d__6))] private static IEnumerator LoadScenePrefabs() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <LoadScenePrefabs>d__6(0); } [IteratorStateMachine(typeof(<LoadBundleAssets>d__7))] internal static IEnumerator LoadBundleAssets() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <LoadBundleAssets>d__7(0); } private static bool Has(string assetName) { foreach (var (_, dictionary2) in Assets) { foreach (var (text2, val2) in dictionary2) { if (assetName == text2 && Object.op_Implicit(val2)) { return true; } } } return false; } private static void TryAdd<T>(T asset) where T : Object { string name = ((Object)asset).name; if (Has(name)) { Debug.Log((object)("Asset \"" + name + "\" has already been loaded!")); return; } Type type = ((object)asset).GetType(); if (Assets.ContainsKey(type)) { Dictionary<string, Object> dictionary = Assets[type]; if (dictionary != null) { if (dictionary.ContainsKey(name)) { Object val = dictionary[name]; if (val != (Object)null) { Debug.Log((object)$"There is already an asset \"{name}\" of type \"{type}\"!"); return; } Debug.Log((object)$"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 { Debug.Log((object)$"Adding asset \"{name}\" of type \"{type}\"."); Assets[type].Add(name, (Object)(object)asset); } } else { Debug.Log((object)$"Failed to get sub-dictionary of type \"{type}\"!"); Assets.Add(type, new Dictionary<string, Object>()); } } else { Assets.Add(type, new Dictionary<string, Object> { [name] = (Object)(object)asset }); Debug.Log((object)$"Added new sub-dictionary of type \"{type}\" with initial asset \"{name}\"."); } } internal static void UnloadAll() { foreach (Dictionary<string, Object> 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; AssetBundleUnloadOperation val = manuallyLoadedBundle.UnloadAsync(true); ((AsyncOperation)val).completed += delegate { Debug.Log((object)("Successfully unloaded bundle \"" + bundleName + "\"")); }; } _manuallyLoadedBundles.Clear(); foreach (KeyValuePair<string, Object> item in Assets[typeof(GameObject)]) { item.Deconstruct(out var _, out var value); Object val2 = value; GameObject val3 = (GameObject)(object)((val2 is GameObject) ? val2 : null); if (val3 != null && val3.activeSelf) { Debug.Log((object)("Recycling all instances of prefab \"" + ((Object)val3).name + "\"")); ObjectPoolExtensions.RecycleAll(val3); } } } internal static T? Get<T>(string assetName) where T : Object { Type typeFromHandle = typeof(T); if (Assets.ContainsKey(typeFromHandle)) { Dictionary<string, Object> 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); } Debug.Log((object)("Failed to get asset \"" + assetName + "\"; asset is null!")); return default(T); } Debug.Log((object)$"Sub-dictionary for type \"{typeFromHandle}\" does not contain key \"{assetName}\"!"); return default(T); } Debug.Log((object)$"Failed to get asset \"{assetName}\"; sub-dictionary of key \"{typeFromHandle}\" is null!"); return default(T); } Debug.Log((object)$"Could not find a sub-dictionary of type \"{typeFromHandle}\"!"); return default(T); } } public static class FsmUtil { [PublicAPI] public static PlayMakerFSM? GetFsmPreprocessed(this GameObject go, string fsmName) { PlayMakerFSM[] components = go.GetComponents<PlayMakerFSM>(); foreach (PlayMakerFSM val in components) { if (val.FsmName == fsmName) { val.Preprocess(); return val; } } return null; } private static TVal? GetItemFromArray<TVal>(TVal[] origArray, Func<TVal, bool> isItemCheck) where TVal : class { foreach (TVal val in origArray) { if (isItemCheck(val)) { return val; } } return null; } private static TVal[] GetItemsFromArray<TVal>(TVal[] origArray, Func<TVal, bool> isItemCheck) where TVal : class { int num = 0; foreach (TVal arg in origArray) { if (isItemCheck(arg)) { num++; } } if (num == origArray.Length) { return origArray; } if (num == 0) { return Array.Empty<TVal>(); } TVal[] array = new TVal[num]; int num2 = 0; foreach (TVal val in origArray) { if (isItemCheck(val)) { array[num2] = val; num2++; } } return array; } [PublicAPI] public static FsmState? GetState(this PlayMakerFSM fsm, string stateName) { string stateName2 = stateName; return GetItemFromArray(fsm.FsmStates, (FsmState x) => x.Name == stateName2); } [PublicAPI] public static FsmState? GetState(this Fsm fsm, string stateName) { string stateName2 = stateName; return GetItemFromArray(fsm.States, (FsmState x) => x.Name == stateName2); } [PublicAPI] public static FsmTransition? GetTransition(this PlayMakerFSM fsm, string stateName, string eventName) { return fsm.GetState(stateName).GetTransition(eventName); } [PublicAPI] public static FsmTransition? GetTransition(this Fsm fsm, string stateName, string eventName) { return fsm.GetState(stateName).GetTransition(eventName); } [PublicAPI] public static FsmTransition? GetTransition(this FsmState state, string eventName) { string eventName2 = eventName; return GetItemFromArray(state.Transitions, (FsmTransition x) => x.EventName == eventName2); } [PublicAPI] public static FsmTransition? GetGlobalTransition(this PlayMakerFSM fsm, string globalEventName) { return fsm.Fsm.GetGlobalTransition(globalEventName); } [PublicAPI] public static FsmTransition? GetGlobalTransition(this Fsm fsm, string globalEventName) { string globalEventName2 = globalEventName; return GetItemFromArray(fsm.GlobalTransitions, (FsmTransition x) => x.EventName == globalEventName2); } [PublicAPI] public static TAction? GetAction<TAction>(this PlayMakerFSM fsm, string stateName, int index) where TAction : FsmStateAction { return fsm.GetState(stateName).GetAction<TAction>(index); } [PublicAPI] public static TAction? GetAction<TAction>(this Fsm fsm, string stateName, int index) where TAction : FsmStateAction { return fsm.GetState(stateName).GetAction<TAction>(index); } [PublicAPI] public static TAction? GetAction<TAction>(this FsmState state, int index) where TAction : FsmStateAction { FsmStateAction obj = state.Actions[index]; return (TAction)(object)((obj is TAction) ? obj : null); } [PublicAPI] public static FsmStateAction? GetStateAction(this PlayMakerFSM fsm, string stateName, int index) { return fsm.GetState(stateName).GetStateAction(index); } [PublicAPI] public static FsmStateAction? GetStateAction(this Fsm fsm, string stateName, int index) { return fsm.GetState(stateName).GetStateAction(index); } [PublicAPI] public static FsmStateAction? GetStateAction(this FsmState state, int index) { return state.Actions[index]; } [PublicAPI] public static TAction[] GetActionsOfType<TAction>(this PlayMakerFSM fsm, string stateName) where TAction : FsmStateAction { return fsm.GetState(stateName).GetActionsOfType<TAction>(); } [PublicAPI] public static TAction[] GetActionsOfType<TAction>(this Fsm fsm, string stateName) where TAction : FsmStateAction { return fsm.GetState(stateName).GetActionsOfType<TAction>(); } [PublicAPI] public static TAction[] GetActionsOfType<TAction>(this FsmState state) where TAction : FsmStateAction { return GetItemsFromArray(state.Actions, (FsmStateAction x) => x is TAction) as TAction[]; } [PublicAPI] public static TAction? GetFirstActionOfType<TAction>(this PlayMakerFSM fsm, string stateName) where TAction : FsmStateAction { return fsm.GetState(stateName).GetFirstActionOfType<TAction>(); } [PublicAPI] public static TAction? GetFirstActionOfType<TAction>(this Fsm fsm, string stateName) where TAction : FsmStateAction { return fsm.GetState(stateName).GetFirstActionOfType<TAction>(); } [PublicAPI] public static TAction? GetFirstActionOfType<TAction>(this FsmState state) where TAction : FsmStateAction { int num = -1; for (int i = 0; i < state.Actions.Length; i++) { if (state.Actions[i] is TAction) { num = i; break; } } if (num == -1) { return default(TAction); } return state.GetAction<TAction>(num); } [PublicAPI] public static TAction? GetLastActionOfType<TAction>(this PlayMakerFSM fsm, string stateName) where TAction : FsmStateAction { return fsm.GetState(stateName).GetLastActionOfType<TAction>(); } [PublicAPI] public static TAction? GetLastActionOfType<TAction>(this Fsm fsm, string stateName) where TAction : FsmStateAction { return fsm.GetState(stateName).GetLastActionOfType<TAction>(); } [PublicAPI] public static TAction? GetLastActionOfType<TAction>(this FsmState state) where TAction : FsmStateAction { int num = -1; for (int num2 = state.Actions.Length - 1; num2 >= 0; num2--) { if (state.Actions[num2] is TAction) { num = num2; break; } } if (num == -1) { return default(TAction); } return state.GetAction<TAction>(num); } private static TVal[] AddItemToArray<TVal>(TVal[] origArray, TVal value) { TVal[] array = new TVal[origArray.Length + 1]; origArray.CopyTo(array, 0); array[origArray.Length] = value; return array; } [PublicAPI] public static FsmState AddState(this PlayMakerFSM fsm, string stateName) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected O, but got Unknown return fsm.Fsm.AddState(new FsmState(fsm.Fsm) { Name = stateName }); } [PublicAPI] public static FsmState AddState(this Fsm fsm, string stateName) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown return fsm.AddState(new FsmState(fsm) { Name = stateName }); } [PublicAPI] public static FsmState AddState(this PlayMakerFSM fsm, FsmState state) { return fsm.Fsm.AddState(state); } [PublicAPI] public static FsmState AddState(this Fsm fsm, FsmState state) { FsmState[] states = fsm.States; FsmState[] array2 = (fsm.States = AddItemToArray(states, state)); fsm.SaveActions(); return array2[states.Length]; } [PublicAPI] public static FsmState CopyState(this PlayMakerFSM fsm, string fromState, string toState) { return fsm.Fsm.CopyState(fromState, toState); } [PublicAPI] public static FsmState CopyState(this Fsm fsm, string fromState, string toState) { //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_0024: Expected O, but got Unknown FsmState state = fsm.GetState(fromState); if (state != null) { state.SaveActions(); } FsmState val = new FsmState(state) { Name = toState }; FsmTransition[] transitions = val.Transitions; foreach (FsmTransition val2 in transitions) { val2.ToFsmState = fsm.GetState(val2.ToState); } fsm.AddState(val); return val; } [PublicAPI] public static FsmEvent AddTransition(this PlayMakerFSM fsm, string stateName, string eventName, string toState) { return fsm.GetState(stateName).AddTransition(eventName, toState); } [PublicAPI] public static FsmEvent AddTransition(this Fsm fsm, string stateName, string eventName, string toState) { return fsm.GetState(stateName).AddTransition(eventName, toState); } [PublicAPI] public static FsmEvent AddTransition(this FsmState state, string eventName, string toState) { //IL_000e: 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_001b: 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_003b: Expected O, but got Unknown FsmEvent fsmEvent = FsmEvent.GetFsmEvent(eventName); FsmTransition[] transitions = AddItemToArray(state.Transitions, new FsmTransition { ToState = toState, ToFsmState = state.Fsm.GetState(toState), FsmEvent = fsmEvent }); state.Transitions = transitions; return fsmEvent; } [PublicAPI] public static FsmEvent AddGlobalTransition(this PlayMakerFSM fsm, string globalEventName, string toState) { return fsm.Fsm.AddGlobalTransition(globalEventName, toState); } [PublicAPI] public static FsmEvent AddGlobalTransition(this Fsm fsm, string globalEventName, string toState) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown //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_0023: 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_003e: Expected O, but got Unknown FsmEvent val = new FsmEvent(globalEventName) { IsGlobal = true }; FsmTransition[] globalTransitions = AddItemToArray(fsm.GlobalTransitions, new FsmTransition { ToState = toState, ToFsmState = fsm.GetState(toState), FsmEvent = val }); fsm.GlobalTransitions = globalTransitions; return val; } [PublicAPI] public static void AddAction(this PlayMakerFSM fsm, string stateName, FsmStateAction action) { fsm.GetState(stateName).AddAction(action); } [PublicAPI] public static void AddAction(this Fsm fsm, string stateName, FsmStateAction action) { fsm.GetState(stateName).AddAction(action); } [PublicAPI] public static void AddAction(this FsmState state, FsmStateAction action) { FsmStateAction[] actions = AddItemToArray(state.Actions, action); state.Actions = actions; action.Init(state); } [PublicAPI] public static void AddActions(this PlayMakerFSM fsm, string stateName, params FsmStateAction[] actions) { fsm.GetState(stateName).AddActions(actions); } [PublicAPI] public static void AddActions(this Fsm fsm, string stateName, params FsmStateAction[] actions) { fsm.GetState(stateName).AddActions(actions); } [PublicAPI] public static void AddActions(this FsmState state, params FsmStateAction[] actions) { foreach (FsmStateAction action in actions) { state.AddAction(action); } } private static TVal[] InsertItemIntoArray<TVal>(TVal[] origArray, TVal value, int index) { int num = origArray.Length; if (index < 0 || index > num + 1) { throw new ArgumentOutOfRangeException($"Index {index} was out of range for array with length {num}!"); } TVal[] array = new TVal[num + 1]; for (int i = 0; i < index; i++) { array[i] = origArray[i]; } array[index] = value; for (int i = index; i < num; i++) { array[i + 1] = origArray[i]; } return array; } [PublicAPI] public static void InsertAction(this PlayMakerFSM fsm, string stateName, FsmStateAction action, int index) { fsm.GetState(stateName).InsertAction(index, action); } [PublicAPI] public static void InsertAction(this PlayMakerFSM fsm, string stateName, int index, FsmStateAction action) { fsm.GetState(stateName).InsertAction(index, action); } [PublicAPI] public static void InsertAction(this Fsm fsm, string stateName, FsmStateAction action, int index) { fsm.GetState(stateName).InsertAction(index, action); } [PublicAPI] public static void InsertAction(this Fsm fsm, string stateName, int index, FsmStateAction action) { fsm.GetState(stateName).InsertAction(index, action); } [PublicAPI] public static void InsertAction(this FsmState state, FsmStateAction action, int index) { state.InsertAction(index, action); } [PublicAPI] public static void InsertAction(this FsmState state, int index, FsmStateAction action) { FsmStateAction[] actions = InsertItemIntoArray(state.Actions, action, index); state.Actions = actions; action.Init(state); } [PublicAPI] public static void InsertActions(this PlayMakerFSM fsm, string stateName, int index, params FsmStateAction[] actions) { fsm.GetState(stateName).InsertActions(index, actions); } [PublicAPI] public static void InsertActions(this Fsm fsm, string stateName, int index, params FsmStateAction[] actions) { fsm.GetState(stateName).InsertActions(index, actions); } [PublicAPI] public static void InsertActions(this FsmState state, int index, params FsmStateAction[] actions) { foreach (FsmStateAction action in actions) { state.InsertAction(action, index); index++; } } [PublicAPI] public static void ReplaceAction(this PlayMakerFSM fsm, string stateName, FsmStateAction action, int index) { fsm.GetState(stateName).ReplaceAction(index, action); } [PublicAPI] public static void ReplaceAction(this PlayMakerFSM fsm, string stateName, int index, FsmStateAction action) { fsm.GetState(stateName).ReplaceAction(index, action); } [PublicAPI] public static void ReplaceAction(this Fsm fsm, string stateName, FsmStateAction action, int index) { fsm.GetState(stateName).ReplaceAction(index, action); } [PublicAPI] public static void ReplaceAction(this Fsm fsm, string stateName, int index, FsmStateAction action) { fsm.GetState(stateName).ReplaceAction(index, action); } [PublicAPI] public static void ReplaceAction(this FsmState state, FsmStateAction action, int index) { state.ReplaceAction(index, action); } [PublicAPI] public static void ReplaceAction(this FsmState state, int index, FsmStateAction action) { state.Actions[index] = action; action.Init(state); } [PublicAPI] public static void ReplaceAllActions(this PlayMakerFSM fsm, string stateName, params FsmStateAction[] actions) { fsm.GetState(stateName).ReplaceAllActions(actions); } [PublicAPI] public static void ReplaceAllActions(this Fsm fsm, string stateName, params FsmStateAction[] actions) { fsm.GetState(stateName).ReplaceAllActions(actions); } [PublicAPI] public static void ReplaceAllActions(this FsmState state, params FsmStateAction[] actions) { state.Actions = actions; foreach (FsmStateAction val in actions) { val.Init(state); } } [PublicAPI] public static bool ChangeTransition(this PlayMakerFSM fsm, string stateName, string eventName, string toState) { return fsm.GetState(stateName).ChangeTransition(eventName, toState); } [PublicAPI] public static bool ChangeTransition(this Fsm fsm, string stateName, string eventName, string toState) { return fsm.GetState(stateName).ChangeTransition(eventName, toState); } [PublicAPI] public static bool ChangeTransition(this FsmState state, string eventName, string toState) { FsmTransition transition = state.GetTransition(eventName); if (transition == null) { return false; } transition.ToState = toState; transition.ToFsmState = state.Fsm.GetState(toState); return true; } [PublicAPI] public static bool ChangeGlobalTransition(this PlayMakerFSM fsm, string globalEventName, string toState) { return fsm.Fsm.ChangeGlobalTransition(globalEventName, toState); } [PublicAPI] public static bool ChangeGlobalTransition(this Fsm fsm, string globalEventName, string toState) { FsmTransition globalTransition = fsm.GetGlobalTransition(globalEventName); if (globalTransition == null) { return false; } globalTransition.ToState = toState; globalTransition.ToFsmState = fsm.GetState(toState); return true; } private static TVal[] RemoveItemsFromArray<TVal>(TVal[] origArray, Func<TVal, bool> shouldBeRemovedCallback) { int num = 0; foreach (TVal arg in origArray) { if (shouldBeRemovedCallback(arg)) { num++; } } if (num == 0) { return origArray; } TVal[] array = new TVal[origArray.Length - num]; for (int num2 = origArray.Length - 1; num2 >= 0; num2--) { TVal val = origArray[num2]; if (shouldBeRemovedCallback(val)) { num--; } else { array[num2 - num] = val; } } return array; } [PublicAPI] public static void RemoveState(this PlayMakerFSM fsm, string stateName) { fsm.Fsm.RemoveState(stateName); } [PublicAPI] public static void RemoveState(this Fsm fsm, string stateName) { string stateName2 = stateName; fsm.States = RemoveItemsFromArray(fsm.States, (FsmState x) => x.Name == stateName2); } [PublicAPI] public static void RemoveTransition(this PlayMakerFSM fsm, string stateName, string eventName) { fsm.GetState(stateName).RemoveTransition(eventName); } [PublicAPI] public static void RemoveTransition(this Fsm fsm, string stateName, string eventName) { fsm.GetState(stateName).RemoveTransition(eventName); } [PublicAPI] public static void RemoveTransition(this FsmState state, string eventName) { string eventName2 = eventName; state.Transitions = RemoveItemsFromArray(state.Transitions, (FsmTransition x) => x.EventName == eventName2); } [PublicAPI] public static void RemoveGlobalTransition(this PlayMakerFSM fsm, string globalEventName) { fsm.Fsm.RemoveGlobalTransition(globalEventName); } [PublicAPI] public static void RemoveGlobalTransition(this Fsm fsm, string globalEventName) { string globalEventName2 = globalEventName; fsm.GlobalTransitions = RemoveItemsFromArray(fsm.GlobalTransitions, (FsmTransition x) => x.EventName == globalEventName2); } [PublicAPI] public static void RemoveTransitionsTo(this PlayMakerFSM fsm, string toState) { fsm.Fsm.RemoveTransitionsTo(toState); } [PublicAPI] public static void RemoveTransitionsTo(this Fsm fsm, string toState) { FsmState[] states = fsm.States; foreach (FsmState state in states) { state.RemoveTransitionsTo(toState); } } [PublicAPI] public static void RemoveTransitionsTo(this PlayMakerFSM fsm, string stateName, string toState) { fsm.GetState(stateName).RemoveTransitionsTo(toState); } [PublicAPI] public static void RemoveTransitionsTo(this Fsm fsm, string stateName, string toState) { fsm.GetState(stateName).RemoveTransitionsTo(toState); } [PublicAPI] public static void RemoveTransitionsTo(this FsmState state, string toState) { string toState2 = toState; state.Transitions = RemoveItemsFromArray(state.Transitions, (FsmTransition x) => x.ToState == toState2); } [PublicAPI] public static void RemoveTransitions(this PlayMakerFSM fsm, string stateName) { fsm.GetState(stateName).RemoveTransitions(); } [PublicAPI] public static void RemoveTransitions(this Fsm fsm, string stateName) { fsm.GetState(stateName).RemoveTransitions(); } [PublicAPI] public static void RemoveTransitions(this FsmState state) { state.Transitions = Array.Empty<FsmTransition>(); } [PublicAPI] public static bool RemoveAction(this PlayMakerFSM fsm, string stateName, int index) { return fsm.GetState(stateName).RemoveAction(index); } [PublicAPI] public static bool RemoveAction(this Fsm fsm, string stateName, int index) { return fsm.GetState(stateName).RemoveAction(index); } [PublicAPI] public static bool RemoveAction(this FsmState state, int index) { FsmStateAction[] actions = state.Actions; if (index < 0 || index >= actions.Length) { return false; } FsmStateAction[] array = (FsmStateAction[])(object)new FsmStateAction[actions.Length - 1]; int num = array.Length; for (int i = 0; i < index; i++) { array[i] = actions[i]; } for (int i = index; i < num; i++) { array[i] = actions[i + 1]; } state.Actions = array; return true; } [PublicAPI] public static void RemoveActionsOfType<TAction>(this PlayMakerFSM fsm) { fsm.Fsm.RemoveActionsOfType<TAction>(); } [PublicAPI] public static void RemoveActionsOfType<TAction>(this Fsm fsm) { FsmState[] states = fsm.States; foreach (FsmState state in states) { state.RemoveActionsOfType<TAction>(); } } [PublicAPI] public static void RemoveActionsOfType<TAction>(this PlayMakerFSM fsm, string stateName) { fsm.GetState(stateName).RemoveActionsOfType<TAction>(); } [PublicAPI] public static void RemoveActionsOfType<TAction>(this Fsm fsm, string stateName) { fsm.GetState(stateName).RemoveActionsOfType<TAction>(); } [PublicAPI] public static void RemoveActionsOfType<TAction>(this FsmState state) { state.Actions = RemoveItemsFromArray(state.Actions, (FsmStateAction x) => x is TAction); } [PublicAPI] public static void RemoveFirstActionOfType<TAction>(this PlayMakerFSM fsm, string stateName) { fsm.GetState(stateName).RemoveFirstActionOfType<TAction>(); } [PublicAPI] public static void RemoveFirstActionOfType<TAction>(this Fsm fsm, string stateName) { fsm.GetState(stateName).RemoveFirstActionOfType<TAction>(); } [PublicAPI] public static void RemoveFirstActionOfType<TAction>(this FsmState state) { int num = -1; for (int i = 0; i < state.Actions.Length; i++) { if (state.Actions[i] is TAction) { num = i; break; } } if (num != -1) { state.RemoveAction(num); } } [PublicAPI] public static void RemoveLastActionOfType<TAction>(this PlayMakerFSM fsm, string stateName) { fsm.GetState(stateName).RemoveLastActionOfType<TAction>(); } [PublicAPI] public static void RemoveLastActionOfType<TAction>(this Fsm fsm, string stateName) { fsm.GetState(stateName).RemoveLastActionOfType<TAction>(); } [PublicAPI] public static void RemoveLastActionOfType<TAction>(this FsmState state) { int num = -1; for (int num2 = state.Actions.Length - 1; num2 >= 0; num2--) { if (state.Actions[num2] is TAction) { num = num2; break; } } if (num != -1) { state.RemoveAction(num); } } [PublicAPI] public static bool DisableAction(this PlayMakerFSM fsm, string stateName, int index) { return fsm.GetState(stateName).DisableAction(index); } [PublicAPI] public static bool DisableAction(this Fsm fsm, string stateName, int index) { return fsm.GetState(stateName).DisableAction(index); } [PublicAPI] public static bool DisableAction(this FsmState state, int index) { if (index < 0 || index >= state.Actions.Length) { return false; } state.Actions[index].Enabled = false; return true; } [PublicAPI] public static bool DisableActions(this PlayMakerFSM fsm, string stateName, params int[] indices) { return fsm.GetState(stateName).DisableActions(indices); } [PublicAPI] public static bool DisableActions(this Fsm fsm, string stateName, params int[] indices) { return fsm.GetState(stateName).DisableActions(indices); } [PublicAPI] public static bool DisableActions(this FsmState state, params int[] indices) { bool flag = true; foreach (int index in indices) { flag = flag && state.DisableAction(index); } return flag; } [PublicAPI] public static void DisableActionsOfType<TAction>(this PlayMakerFSM fsm) { fsm.Fsm.DisableActionsOfType<TAction>(); } [PublicAPI] public static void DisableActionsOfType<TAction>(this Fsm fsm) { FsmState[] states = fsm.States; foreach (FsmState state in states) { state.DisableActionsOfType<TAction>(); } } [PublicAPI] public static void DisableActionsOfType<TAction>(this PlayMakerFSM fsm, string stateName) { fsm.GetState(stateName).DisableActionsOfType<TAction>(); } [PublicAPI] public static void DisableActionsOfType<TAction>(this Fsm fsm, string stateName) { fsm.GetState(stateName).DisableActionsOfType<TAction>(); } [PublicAPI] public static void DisableActionsOfType<TAction>(this FsmState state) { FsmStateAction[] actions = state.Actions; foreach (FsmStateAction val in actions) { if (val is TAction) { val.Enabled = false; } } } private static TVar[] MakeNewVariableArray<TVar>(TVar[] orig, string name) where TVar : NamedVariable, new() { TVar[] array = new TVar[orig.Length + 1]; orig.CopyTo(array, 0); int num = orig.Length; TVar val = new TVar(); ((NamedVariable)val).Name = name; array[num] = val; return array; } [PublicAPI] public static FsmFloat AddFloatVariable(this PlayMakerFSM fsm, string name) { return fsm.Fsm.AddFloatVariable(name); } [PublicAPI] public static FsmFloat AddFloatVariable(this Fsm fsm, string name) { FsmFloat[] array = MakeNewVariableArray<FsmFloat>(fsm.Variables.FloatVariables, name); fsm.Variables.FloatVariables = array; return array[^1]; } [PublicAPI] public static FsmInt AddIntVariable(this PlayMakerFSM fsm, string name) { return fsm.Fsm.AddIntVariable(name); } [PublicAPI] public static FsmInt AddIntVariable(this Fsm fsm, string name) { FsmInt[] array = MakeNewVariableArray<FsmInt>(fsm.Variables.IntVariables, name); fsm.Variables.IntVariables = array; return array[^1]; } [PublicAPI] public static FsmBool AddBoolVariable(this PlayMakerFSM fsm, string name) { return fsm.Fsm.AddBoolVariable(name); } [PublicAPI] public static FsmBool AddBoolVariable(this Fsm fsm, string name) { FsmBool[] array = MakeNewVariableArray<FsmBool>(fsm.Variables.BoolVariables, name); fsm.Variables.BoolVariables = array; return array[^1]; } [PublicAPI] public static FsmString AddStringVariable(this PlayMakerFSM fsm, string name) { return fsm.Fsm.AddStringVariable(name); } [PublicAPI] public static FsmString AddStringVariable(this Fsm fsm, string name) { FsmString[] array = MakeNewVariableArray<FsmString>(fsm.Variables.StringVariables, name); fsm.Variables.StringVariables = array; return array[^1]; } [PublicAPI] public static FsmVector2 AddVector2Variable(this PlayMakerFSM fsm, string name) { return fsm.Fsm.AddVector2Variable(name); } [PublicAPI] public static FsmVector2 AddVector2Variable(this Fsm fsm, string name) { FsmVector2[] array = MakeNewVariableArray<FsmVector2>(fsm.Variables.Vector2Variables, name); fsm.Variables.Vector2Variables = array; return array[^1]; } [PublicAPI] public static FsmVector3 AddVector3Variable(this PlayMakerFSM fsm, string name) { return fsm.Fsm.AddVector3Variable(name); } [PublicAPI] public static FsmVector3 AddVector3Variable(this Fsm fsm, string name) { FsmVector3[] array = MakeNewVariableArray<FsmVector3>(fsm.Variables.Vector3Variables, name); fsm.Variables.Vector3Variables = array; return array[^1]; } [PublicAPI] public static FsmColor AddColorVariable(this PlayMakerFSM fsm, string name) { return fsm.Fsm.AddColorVariable(name); } [PublicAPI] public static FsmColor AddColorVariable(this Fsm fsm, string name) { FsmColor[] array = MakeNewVariableArray<FsmColor>(fsm.Variables.ColorVariables, name); fsm.Variables.ColorVariables = array; return array[^1]; } [PublicAPI] public static FsmRect AddRectVariable(this PlayMakerFSM fsm, string name) { return fsm.Fsm.AddRectVariable(name); } [PublicAPI] public static FsmRect AddRectVariable(this Fsm fsm, string name) { FsmRect[] array = MakeNewVariableArray<FsmRect>(fsm.Variables.RectVariables, name); fsm.Variables.RectVariables = array; return array[^1]; } [PublicAPI] public static FsmQuaternion AddQuaternionVariable(this PlayMakerFSM fsm, string name) { return fsm.Fsm.AddQuaternionVariable(name); } [PublicAPI] public static FsmQuaternion AddQuaternionVariable(this Fsm fsm, string name) { FsmQuaternion[] array = MakeNewVariableArray<FsmQuaternion>(fsm.Variables.QuaternionVariables, name); fsm.Variables.QuaternionVariables = array; return array[^1]; } [PublicAPI] public static FsmGameObject AddGameObjectVariable(this PlayMakerFSM fsm, string name) { return fsm.Fsm.AddGameObjectVariable(name); } [PublicAPI] public static FsmGameObject AddGameObjectVariable(this Fsm fsm, string name) { FsmGameObject[] array = MakeNewVariableArray<FsmGameObject>(fsm.Variables.GameObjectVariables, name); fsm.Variables.GameObjectVariables = array; return array[^1]; } private static TVar? FindInVariableArray<TVar>(TVar[] orig, string name) where TVar : NamedVariable, new() { foreach (TVar val in orig) { if (((NamedVariable)val).Name == name) { return val; } } return default(TVar); } [PublicAPI] public static FsmFloat? FindFloatVariable(this PlayMakerFSM fsm, string name) { return fsm.Fsm.FindFloatVariable(name); } [PublicAPI] public static FsmFloat? FindFloatVariable(this Fsm fsm, string name) { return FindInVariableArray<FsmFloat>(fsm.Variables.FloatVariables, name); } [PublicAPI] public static FsmInt? FindIntVariable(this PlayMakerFSM fsm, string name) { return fsm.Fsm.FindIntVariable(name); } [PublicAPI] public static FsmInt? FindIntVariable(this Fsm fsm, string name) { return FindInVariableArray<FsmInt>(fsm.Variables.IntVariables, name); } [PublicAPI] public static FsmBool? FindBoolVariable(this PlayMakerFSM fsm, string name) { return fsm.Fsm.FindBoolVariable(name); } [PublicAPI] public static FsmBool? FindBoolVariable(this Fsm fsm, string name) { return FindInVariableArray<FsmBool>(fsm.Variables.BoolVariables, name); } [PublicAPI] public static FsmString? FindStringVariable(this PlayMakerFSM fsm, string name) { return fsm.Fsm.FindStringVariable(name); } [PublicAPI] public static FsmString? FindStringVariable(this Fsm fsm, string name) { return FindInVariableArray<FsmString>(fsm.Variables.StringVariables, name); } [PublicAPI] public static FsmVector2? FindVector2Variable(this PlayMakerFSM fsm, string name) { return fsm.Fsm.FindVector2Variable(name); } [PublicAPI] public static FsmVector2? FindVector2Variable(this Fsm fsm, string name) { return FindInVariableArray<FsmVector2>(fsm.Variables.Vector2Variables, name); } [PublicAPI] public static FsmVector3? FindVector3Variable(this PlayMakerFSM fsm, string name) { return fsm.Fsm.FindVector3Variable(name); } [PublicAPI] public static FsmVector3? FindVector3Variable(this Fsm fsm, string name) { return FindInVariableArray<FsmVector3>(fsm.Variables.Vector3Variables, name); } [PublicAPI] public static FsmColor? FindColorVariable(this PlayMakerFSM fsm, string name) { return fsm.Fsm.FindColorVariable(name); } [PublicAPI] public static FsmColor? FindColorVariable(this Fsm fsm, string name) { return FindInVariableArray<FsmColor>(fsm.Variables.ColorVariables, name); } [PublicAPI] public static FsmRect? FindRectVariable(this PlayMakerFSM fsm, string name) { return fsm.Fsm.FindRectVariable(name); } [PublicAPI] public static FsmRect? FindRectVariable(this Fsm fsm, string name) { return FindInVariableArray<FsmRect>(fsm.Variables.RectVariables, name); } [PublicAPI] public static FsmQuaternion? FindQuaternionVariable(this PlayMakerFSM fsm, string name) { return fsm.Fsm.FindQuaternionVariable(name); } [PublicAPI] public static FsmQuaternion? FindQuaternionVariable(this Fsm fsm, string name) { return FindInVariableArray<FsmQuaternion>(fsm.Variables.QuaternionVariables, name); } [PublicAPI] public static FsmGameObject? FindGameObjectVariable(this PlayMakerFSM fsm, string name) { return fsm.Fsm.FindGameObjectVariable(name); } [PublicAPI] public static FsmGameObject? FindGameObjectVariable(this Fsm fsm, string name) { return FindInVariableArray<FsmGameObject>(fsm.Variables.GameObjectVariables, name); } [PublicAPI] public static FsmFloat GetFloatVariable(this PlayMakerFSM fsm, string name) { return fsm.Fsm.GetFloatVariable(name); } [PublicAPI] public static FsmFloat GetFloatVariable(this Fsm fsm, string name) { FsmFloat val = fsm.FindFloatVariable(name); if (val != null) { return val; } return fsm.AddFloatVariable(name); } [PublicAPI] public static FsmInt GetIntVariable(this PlayMakerFSM fsm, string name) { return fsm.Fsm.GetIntVariable(name); } [PublicAPI] public static FsmInt GetIntVariable(this Fsm fsm, string name) { FsmInt val = fsm.FindIntVariable(name); if (val != null) { return val; } return fsm.AddIntVariable(name); } [PublicAPI] public static FsmBool GetBoolVariable(this PlayMakerFSM fsm, string name) { return fsm.Fsm.GetBoolVariable(name); } [PublicAPI] public static FsmBool GetBoolVariable(this Fsm fsm, string name) { FsmBool val = fsm.FindBoolVariable(name); if (val != null) { return val; } return fsm.AddBoolVariable(name); } [PublicAPI] public static FsmString GetStringVariable(this PlayMakerFSM fsm, string name) { return fsm.Fsm.GetStringVariable(name); } [PublicAPI] public static FsmString GetStringVariable(this Fsm fsm, string name) { FsmString val = fsm.FindStringVariable(name); if (val != null) { return val; } return fsm.AddStringVariable(name); } [PublicAPI] public static FsmVector2 GetVector2Variable(this PlayMakerFSM fsm, string name) { return fsm.Fsm.GetVector2Variable(name); } [PublicAPI] public static FsmVector2 GetVector2Variable(this Fsm fsm, string name) { FsmVector2 val = fsm.FindVector2Variable(name); if (val != null) { return val; } return fsm.AddVector2Variable(name); } [PublicAPI] public static FsmVector3 GetVector3Variable(this PlayMakerFSM fsm, string name) { return fsm.Fsm.GetVector3Variable(name); } [PublicAPI] public static FsmVector3 GetVector3Variable(this Fsm fsm, string name) { FsmVector3 val = fsm.FindVector3Variable(name); if (val != null) { return val; } return fsm.AddVector3Variable(name); } [PublicAPI] public static FsmColor GetColorVariable(this PlayMakerFSM fsm, string name) { return fsm.Fsm.GetColorVariable(name); } [PublicAPI] public static FsmColor GetColorVariable(this Fsm fsm, string name) { FsmColor val = fsm.FindColorVariable(name); if (val != null) { return val; } return fsm.AddColorVariable(name); } [PublicAPI] public static FsmRect GetRectVariable(this PlayMakerFSM fsm, string name) { return fsm.Fsm.GetRectVariable(name); } [PublicAPI] public static FsmRect GetRectVariable(this Fsm fsm, string name) { FsmRect val = fsm.FindRectVariable(name); if (val != null) { return val; } return fsm.AddRectVariable(name); } [PublicAPI] public static FsmQuaternion GetQuaternionVariable(this PlayMakerFSM fsm, string name) { return fsm.Fsm.GetQuaternionVariable(name); } [PublicAPI] public static FsmQuaternion GetQuaternionVariable(this Fsm fsm, string name) { FsmQuaternion val = fsm.FindQuaternionVariable(name); if (val != null) { return val; } return fsm.AddQuaternionVariable(name); } [PublicAPI] public static FsmGameObject GetGameObjectVariable(this PlayMakerFSM fsm, string name) { return fsm.Fsm.GetGameObjectVariable(name); } [PublicAPI] public static FsmGameObject GetGameObjectVariable(this Fsm fsm, string name) { FsmGameObject val = fsm.FindGameObjectVariable(name); if (val != null) { return val; } return fsm.AddGameObjectVariable(name); } } public class InvokeCoroutine : FsmStateAction { [CompilerGenerated] private sealed class <Coroutine>d__3 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public InvokeCoroutine <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <Coroutine>d__3(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; <>2__current = <>4__this._coroutine(); <>1__state = 1; return true; case 1: <>1__state = -1; ((FsmStateAction)<>4__this).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<IEnumerator> _coroutine; private readonly bool _wait; public InvokeCoroutine(Func<IEnumerator> coroutine, bool wait) { _coroutine = coroutine; _wait = wait; } [IteratorStateMachine(typeof(<Coroutine>d__3))] private IEnumerator Coroutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <Coroutine>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(); } } [BepInPlugin("SkarrQueen", "SkarrQueen", "1.0.0")] public class Plugin : BaseUnityPlugin { private static Harmony _harmony; private static bool QueenScene; private static HeroController? hornet; private void Awake() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown Debug.Log((object)"Plugin SkarrQueen (1.0.0) has loaded!"); _harmony = new Harmony("1.0.0"); MainPatches.Initialize(); _harmony.PatchAll(typeof(MainPatches)); } private void OnDestroy() { _harmony.UnpatchSelf(); AssetManager.UnloadAll(); } } } namespace SkarrQueen.Patches { internal static class BossPatches { [HarmonyPrefix] [HarmonyPatch(typeof(BattleScene), "Awake")] private static void ModifyQueen(BattleScene __instance) { GameObject.Find("Hunter Queen Boss").AddComponent<SkarrQueenKarmelita>(); } [HarmonyPostfix] [HarmonyPatch(typeof(Language), "Get", new Type[] { typeof(string), typeof(string) })] private static void ChangeSkarrTitle(string key, string sheetTitle, ref string __result) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Invalid comparison between Unknown and I4 //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Invalid comparison between Unknown and I4 if (1 == 0) { } string text2; if (key == "HUNTER_QUEEN_SUPER") { LanguageCode val = Language.CurrentLanguage(); if (1 == 0) { } string text = (((int)val == 44) ? "SkarrQueen" : (((int)val != 117) ? __result : "스카르여왕")); if (1 == 0) { } text2 = text; } else { text2 = __result; } if (1 == 0) { } __result = text2; } } internal static class MainPatches { [CompilerGenerated] private sealed class <Unpatch>d__4 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IEnumerator result; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <Unpatch>d__4(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_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown _harmony = new Harmony("MainPatches"); } [HarmonyPrefix] [HarmonyPatch(typeof(GameManager), "Awake")] private static void InitAssetManager(GameManager __instance) { ((MonoBehaviour)__instance).StartCoroutine(AssetManager.Init()); } [HarmonyPostfix] [HarmonyPatch(typeof(GameManager), "SetLoadedGameData", new Type[] { typeof(SaveGameData), typeof(int) })] private static void CheckPatchSkarr(GameManager __instance) { GameManager __instance2 = __instance; __instance2.GetSaveStatsForSlot(PlayerData.instance.profileID, (Action<SaveStats, string>)delegate(SaveStats saveStats, string _) { if (saveStats.IsAct3) { _harmony.PatchAll(typeof(BossPatches)); ((Component)__instance2).gameObject.AddComponent<TrapLoader>(); } }); } [IteratorStateMachine(typeof(<Unpatch>d__4))] [HarmonyPostfix] [HarmonyPatch(typeof(GameManager), "ReturnToMainMenu")] private static IEnumerator Unpatch(IEnumerator result) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <Unpatch>d__4(0) { result = result }; } } } namespace SkarrQueen.Behaviours { [RequireComponent(typeof(tk2dSpriteAnimator))] [RequireComponent(typeof(Rigidbody2D))] [RequireComponent(typeof(PlayMakerFSM))] internal class SkarrQueenKarmelita : MonoBehaviour { [CompilerGenerated] private sealed class <InstaP3>d__19 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public SkarrQueenKarmelita <>4__this; private FsmState <Choice>5__1; private FsmState <Roar>5__2; private List<FsmStateAction> <roaraction>5__3; private SendRandomEventV4 <sendrandom>5__4; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <InstaP3>d__19(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <Choice>5__1 = null; <Roar>5__2 = null; <roaraction>5__3 = null; <sendrandom>5__4 = null; <>1__state = -2; } private bool MoveNext() { 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; <>4__this._control.Fsm.GetFsmBool("Double Throws").Value = true; <>4__this._control.Fsm.GetFsmFloat("Idle Min").Value = 0.25f; <>4__this._control.Fsm.GetFsmFloat("Idle Max").Value = 0.25f; <>4__this._control.Fsm.GetFsmInt("P2 HP").Value = 1600; <>4__this._control.Fsm.GetFsmInt("P3 HP").Value = 800; <Choice>5__1 = <>4__this._control.FsmStates.First((FsmState state) => state.Name == "Attack Choice"); <Roar>5__2 = <>4__this._control.FsmStates.First((FsmState state) => state.Name == "Battle Roar Antic"); <roaraction>5__3 = <Roar>5__2.Actions.ToList(); <roaraction>5__3.Insert(0, (FsmStateAction)(object)new InvokeMethod(<>4__this.PlaceUnbreakableTraps)); <Roar>5__2.Actions = <roaraction>5__3.ToArray(); FsmStateAction val = <Choice>5__1.Actions[12]; <sendrandom>5__4 = (SendRandomEventV4)(object)((val is SendRandomEventV4) ? val : null); if (<sendrandom>5__4 != null) { <sendrandom>5__4.activeBool = FsmBool.op_Implicit(false); <sendrandom>5__4.eventMax = (FsmInt[])(object)new FsmInt[6] { FsmInt.op_Implicit(1), FsmInt.op_Implicit(2), FsmInt.op_Implicit(2), FsmInt.op_Implicit(1), FsmInt.op_Implicit(1), FsmInt.op_Implicit(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(); } } private tk2dSpriteAnimator _anim = null; private Rigidbody2D _body = null; private PlayMakerFSM _control = null; private Transform _heroTransform = null; private FsmInt MaxCharge = new FsmInt("Max Charge"); private FsmInt ChargeCount = new FsmInt("Charged"); private FsmFloat ChargeSpeed = new FsmFloat("Charge Speed"); private FsmInt MaxBounce = new FsmInt("Max Bounce"); private FsmInt BounceCount = new FsmInt("Bounced"); private FsmFloat BouncePower = new FsmFloat("Bounce Power"); private FsmInt MaxCombo = new FsmInt("Max Combo"); private FsmInt ComboCount = new FsmInt("Combod"); private FsmEvent Charge = new FsmEvent("CHARGE"); private FsmEvent Bounce = new FsmEvent("BOUNCE"); private FsmEvent Combo = new FsmEvent("NEXT"); private void Awake() { Debug.Log((object)"Queen is LOADED!!!!"); SetupBoss(); } private void SetupBoss() { GetComponents(); IncreaseHealth(); ((MonoBehaviour)this).StartCoroutine(InstaP3()); ComboAttacks(); ModifyBlades(); ModifyPhase2(); } private void GetComponents() { //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Expected O, but got Unknown _anim = ((Component)this).GetComponent<tk2dSpriteAnimator>(); _body = ((Component)this).GetComponent<Rigidbody2D>(); ((Component)this).gameObject.GetComponent<DamageHero>().damageDealt = 2; _control = FSMUtility.LocateMyFSM(((Component)this).gameObject, "Control"); foreach (Transform item in ((Component)this).gameObject.transform) { Transform val = item; DamageHero component = ((Component)val).gameObject.GetComponent<DamageHero>(); if ((Object)(object)component != (Object)null) { component.damageDealt = 2; } } ((Component)((Component)this).gameObject.transform.Find("BallSlash")).gameObject.GetComponent<DamageHero>().damageDealt = 2; } private void IncreaseHealth() { HealthManager component = ((Component)this).GetComponent<HealthManager>(); component.hp = 100; component.hp = 2000; } [IteratorStateMachine(typeof(<InstaP3>d__19))] private IEnumerator InstaP3() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <InstaP3>d__19(0) { <>4__this = this }; } private void ComboAttacks() { //IL_0437: Unknown result type (might be due to invalid IL or missing references) //IL_043c: Unknown result type (might be due to invalid IL or missing references) //IL_044c: Unknown result type (might be due to invalid IL or missing references) //IL_045c: Expected O, but got Unknown //IL_047d: Unknown result type (might be due to invalid IL or missing references) //IL_0482: Unknown result type (might be due to invalid IL or missing references) //IL_0492: Unknown result type (might be due to invalid IL or missing references) //IL_04a2: Expected O, but got Unknown //IL_04c2: Unknown result type (might be due to invalid IL or missing references) //IL_04c7: Unknown result type (might be due to invalid IL or missing references) //IL_04d3: Unknown result type (might be due to invalid IL or missing references) //IL_04e4: Expected O, but got Unknown //IL_04e8: Unknown result type (might be due to invalid IL or missing references) //IL_04ed: Unknown result type (might be due to invalid IL or missing references) //IL_04f9: Unknown result type (might be due to invalid IL or missing references) //IL_050e: Expected O, but got Unknown //IL_0512: Unknown result type (might be due to invalid IL or missing references) //IL_0517: Unknown result type (might be due to invalid IL or missing references) //IL_0523: Unknown result type (might be due to invalid IL or missing references) //IL_0534: Expected O, but got Unknown //IL_0538: Unknown result type (might be due to invalid IL or missing references) //IL_053d: Unknown result type (might be due to invalid IL or missing references) //IL_0549: Unknown result type (might be due to invalid IL or missing references) //IL_055e: Expected O, but got Unknown //IL_0562: Unknown result type (might be due to invalid IL or missing references) //IL_0567: Unknown result type (might be due to invalid IL or missing references) //IL_0573: Unknown result type (might be due to invalid IL or missing references) //IL_0584: Expected O, but got Unknown //IL_060a: Unknown result type (might be due to invalid IL or missing references) //IL_060f: Unknown result type (might be due to invalid IL or missing references) //IL_061b: Unknown result type (might be due to invalid IL or missing references) //IL_062c: Expected O, but got Unknown //IL_062f: 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_0640: Unknown result type (might be due to invalid IL or missing references) //IL_0655: Expected O, but got Unknown //IL_0658: Unknown result type (might be due to invalid IL or missing references) //IL_065d: Unknown result type (might be due to invalid IL or missing references) //IL_0669: Unknown result type (might be due to invalid IL or missing references) //IL_0675: Unknown result type (might be due to invalid IL or missing references) //IL_0680: Unknown result type (might be due to invalid IL or missing references) //IL_068c: Unknown result type (might be due to invalid IL or missing references) //IL_069d: Expected O, but got Unknown //IL_06ad: Unknown result type (might be due to invalid IL or missing references) //IL_06b2: Unknown result type (might be due to invalid IL or missing references) //IL_06bb: Unknown result type (might be due to invalid IL or missing references) //IL_06c7: Unknown result type (might be due to invalid IL or missing references) //IL_06d6: Expected O, but got Unknown //IL_06d6: Unknown result type (might be due to invalid IL or missing references) //IL_06db: Unknown result type (might be due to invalid IL or missing references) //IL_06e3: Unknown result type (might be due to invalid IL or missing references) //IL_06ef: Unknown result type (might be due to invalid IL or missing references) //IL_06fd: Expected O, but got Unknown //IL_06fd: Unknown result type (might be due to invalid IL or missing references) //IL_0702: Unknown result type (might be due to invalid IL or missing references) //IL_070b: Unknown result type (might be due to invalid IL or missing references) //IL_071a: Expected O, but got Unknown //IL_0747: Unknown result type (might be due to invalid IL or missing references) //IL_074c: Unknown result type (might be due to invalid IL or missing references) //IL_075c: Unknown result type (might be due to invalid IL or missing references) //IL_076c: Expected O, but got Unknown //IL_0867: Unknown result type (might be due to invalid IL or missing references) //IL_086c: Unknown result type (might be due to invalid IL or missing references) //IL_0878: Unknown result type (might be due to invalid IL or missing references) //IL_0889: Expected O, but got Unknown //IL_08a5: Unknown result type (might be due to invalid IL or missing references) //IL_08aa: Unknown result type (might be due to invalid IL or missing references) //IL_08b6: Unknown result type (might be due to invalid IL or missing references) //IL_08c2: Unknown result type (might be due to invalid IL or missing references) //IL_08cd: Unknown result type (might be due to invalid IL or missing references) //IL_08d9: Unknown result type (might be due to invalid IL or missing references) //IL_08ea: Expected O, but got Unknown //IL_0923: Unknown result type (might be due to invalid IL or missing references) //IL_0928: Unknown result type (might be due to invalid IL or missing references) //IL_0931: Unknown result type (might be due to invalid IL or missing references) //IL_093d: Unknown result type (might be due to invalid IL or missing references) //IL_094c: Expected O, but got Unknown //IL_094c: Unknown result type (might be due to invalid IL or missing references) //IL_0951: Unknown result type (might be due to invalid IL or missing references) //IL_095a: Unknown result type (might be due to invalid IL or missing references) //IL_0966: Unknown result type (might be due to invalid IL or missing references) //IL_0974: Expected O, but got Unknown //IL_0974: Unknown result type (might be due to invalid IL or missing references) //IL_0979: Unknown result type (might be due to invalid IL or missing references) //IL_0982: Unknown result type (might be due to invalid IL or missing references) //IL_098e: Unknown result type (might be due to invalid IL or missing references) //IL_099d: Expected O, but got Unknown //IL_0a7c: Unknown result type (might be due to invalid IL or missing references) //IL_0a81: Unknown result type (might be due to invalid IL or missing references) //IL_0a8a: Unknown result type (might be due to invalid IL or missing references) //IL_0a96: Unknown result type (might be due to invalid IL or missing references) //IL_0aa4: Expected O, but got Unknown //IL_0c44: Unknown result type (might be due to invalid IL or missing references) //IL_0c49: Unknown result type (might be due to invalid IL or missing references) //IL_0c52: Unknown result type (might be due to invalid IL or missing references) //IL_0c61: Expected O, but got Unknown //IL_0c61: Unknown result type (might be due to invalid IL or missing references) //IL_0c66: Unknown result type (might be due to invalid IL or missing references) //IL_0c6e: Unknown result type (might be due to invalid IL or missing references) //IL_0c7c: Expected O, but got Unknown //IL_0c8c: Unknown result type (might be due to invalid IL or missing references) //IL_0c91: Unknown result type (might be due to invalid IL or missing references) //IL_0c9d: Unknown result type (might be due to invalid IL or missing references) //IL_0cae: Expected O, but got Unknown //IL_0cb1: Unknown result type (might be due to invalid IL or missing references) //IL_0cb6: Unknown result type (might be due to invalid IL or missing references) //IL_0cc2: Unknown result type (might be due to invalid IL or missing references) //IL_0cd4: Expected O, but got Unknown //IL_0cd7: Unknown result type (might be due to invalid IL or missing references) //IL_0cdc: Unknown result type (might be due to invalid IL or missing references) //IL_0ce8: Unknown result type (might be due to invalid IL or missing references) //IL_0cfa: Expected O, but got Unknown //IL_0cfd: Unknown result type (might be due to invalid IL or missing references) //IL_0d02: Unknown result type (might be due to invalid IL or missing references) //IL_0d0e: Unknown result type (might be due to invalid IL or missing references) //IL_0d1a: Unknown result type (might be due to invalid IL or missing references) //IL_0d25: Unknown result type (might be due to invalid IL or missing references) //IL_0d31: Unknown result type (might be due to invalid IL or missing references) //IL_0d41: Expected O, but got Unknown FsmState val = _control.FsmStates.First((FsmState state) => state.Name == "Jump Back"); FsmState val2 = _control.FsmStates.First((FsmState state) => state.Name == "Dash Grind"); FsmState val3 = _control.FsmStates.First((FsmState state) => state.Name == "Start Idle"); FsmState val4 = _control.FsmStates.First((FsmState state) => state.Name == "Jump Launch"); FsmState val5 = _control.FsmStates.First((FsmState state) => state.Name == "Spear Slam"); FsmState val6 = _control.FsmStates.First((FsmState state) => state.Name == "Soft Land"); FsmState toFsmState = _control.FsmStates.First((FsmState state) => state.Name == "Jump Back Dir"); FsmState toFsmState2 = _control.FsmStates.First((FsmState state) => state.Name == "Throw Antic"); FsmState val7 = _control.FsmStates.First((FsmState state) => state.Name == "Slash Antic"); FsmState val8 = _control.FsmStates.First((FsmState state) => state.Name == "Cyclone Antic"); FsmState toFsmState3 = _control.FsmStates.First((FsmState state) => state.Name == "Launch Antic"); FsmState toFsmState4 = _control.FsmStates.First((FsmState state) => state.Name == "Jump Antic"); FsmState val9 = _control.FsmStates.First((FsmState state) => state.Name == "Double Throw?"); FsmState val10 = _control.FsmStates.First((FsmState state) => state.Name == "Slash End"); FsmState val11 = _control.FsmStates.First((FsmState state) => state.Name == "Cyclone 4"); FsmState val12 = _control.AddState("Cyclone End"); FsmState val13 = _control.FsmStates.First((FsmState state) => state.Name == "Throw Land"); FsmState val14 = _control.FsmStates.First((FsmState state) => state.Name == "Dash Grind Spin 3"); FsmState toFsmState5 = _control.FsmStates.First((FsmState state) => state.Name == "Spin Attack Land"); FsmState val15 = _control.AddState("Charge Again"); FsmState val16 = _control.AddState("Bounce Again"); FsmState val17 = _control.AddState("ReBounce"); FsmState val18 = _control.AddState("Combo Throw"); FsmState val19 = _control.AddState("Combo Slash"); FsmState val20 = _control.AddState("Combo Spin"); FsmState val21 = _control.AddState("Combo Air"); MaxBounce.Value = 2; MaxCharge.Value = 2; MaxCombo.Value = 2; List<FsmStateAction> list = val7.Actions.ToList(); list.Insert(0, (FsmStateAction)new Wait { time = FsmFloat.op_Implicit(0.5f), finishEvent = FsmEvent.Finished }); val7.Actions = list.ToArray(); List<FsmStateAction> list2 = val8.Actions.ToList(); list2.Insert(0, (FsmStateAction)new Wait { time = FsmFloat.op_Implicit(0.5f), finishEvent = FsmEvent.Finished }); val8.Actions = list2.ToArray(); List<FsmStateAction> list3 = val3.Actions.ToList(); list3.Insert(0, (FsmStateAction)new SetIntValue { intVariable = ChargeCount, intValue = FsmInt.op_Implicit(0) }); list3.Insert(0, (FsmStateAction)new SetFloatValue { floatVariable = ChargeSpeed, floatValue = FsmFloat.op_Implicit(-40f) }); list3.Insert(0, (FsmStateAction)new SetIntValue { intVariable = BounceCount, intValue = FsmInt.op_Implicit(0) }); list3.Insert(0, (FsmStateAction)new SetFloatValue { floatVariable = BouncePower, floatValue = FsmFloat.op_Implicit(65f) }); list3.Insert(0, (FsmStateAction)new SetIntValue { intVariable = ComboCount, intValue = FsmInt.op_Implicit(0) }); val3.Actions = list3.ToArray(); FsmStateAction obj = val2.Actions[4]; AccelerateToXByScale val22 = (AccelerateToXByScale)(object)((obj is AccelerateToXByScale) ? obj : null); if (val22 != null) { val22.accelerationFactor = FsmFloat.op_Implicit(10f); val22.targetSpeed = ChargeSpeed; } FsmStateAction obj2 = val.Actions[0]; SetVelocityByScale val23 = (SetVelocityByScale)(object)((obj2 is SetVelocityByScale) ? obj2 : null); if (val23 != null) { val23.speed = FsmFloat.op_Implicit(100f); } List<FsmStateAction> list4 = val15.Actions.ToList(); list4.Add((FsmStateAction)new IntAdd { intVariable = ChargeCount, add = FsmInt.op_Implicit(1) }); list4.Add((FsmStateAction)new FloatAdd { floatVariable = ChargeSpeed, add = FsmFloat.op_Implicit(-10f) }); list4.Add((FsmStateAction)new IntCompare { integer1 = ChargeCount, integer2 = MaxCharge, equal = FsmEvent.Finished, lessThan = Charge, greaterThan = Combo }); val15.Actions = list4.ToArray(); FsmTransition val24 = new FsmTransition { ToFsmState = toFsmState, ToState = "Jump Back Dir", FsmEvent = Charge }; FsmTransition val25 = new FsmTransition { ToFsmState = val3, ToState = "Start Idle", FsmEvent = FsmEvent.Finished }; FsmTransition val26 = new FsmTransition { ToFsmState = toFsmState3, FsmEvent = Combo }; val15.Transitions = (FsmTransition[])(object)new FsmTransition[3] { val24, val25, val26 }; List<FsmStateAction> list5 = val14.Actions.ToList(); list4.Add((FsmStateAction)new Wait { time = FsmFloat.op_Implicit(0.1f), finishEvent = FsmEvent.Finished }); val14.Actions = list5.ToArray(); FsmTransition val27 = val14.Transitions.First((FsmTransition tran) => tran.EventName == "FINISHED"); val27.toState = "Charge Again"; val27.toFsmState = val15; List<FsmStateAction> list6 = val17.Actions.ToList(); FsmStateAction[] actions = val4.Actions; foreach (FsmStateAction val28 in actions) { if (!(val28 is Tk2dPlayAnimationWithEvents)) { list6.Add(val28); } } FsmTransition[] transitions = val4.Transitions; foreach (FsmTransition val29 in transitions) { val17.Transitions = (FsmTransition[])(object)new FsmTransition[1] { val29 }; } val17.Actions = list6.ToArray(); List<FsmStateAction> list7 = val16.Actions.ToList(); list7.Add((FsmStateAction)new IntAdd { intVariable = BounceCount, add = FsmInt.op_Implicit(1) }); list7.Add((FsmStateAction)(object)new InvokeMethod(SmallerSlam)); list7.Add((FsmStateAction)new IntCompare { integer1 = BounceCount, integer2 = MaxBounce, equal = FsmEvent.Finished, lessThan = Bounce, greaterThan = Combo }); val16.Actions = list7.ToArray(); FsmStateAction obj3 = val4.Actions[1]; SetVelocityByScale val30 = (SetVelocityByScale)(object)((obj3 is SetVelocityByScale) ? obj3 : null); if (val30 != null) { val30.ySpeed = BouncePower; } FsmTransition val31 = new FsmTransition { ToFsmState = val17, ToState = "ReBounce", FsmEvent = Bounce }; FsmTransition val32 = new FsmTransition { ToFsmState = toFsmState5, ToState = "Spin Attack Land", FsmEvent = FsmEvent.Finished }; FsmTransition val33 = new FsmTransition { ToFsmState = val8, ToState = "Cyclone Antic", FsmEvent = Combo }; val16.Transitions = (FsmTransition[])(object)new FsmTransition[3] { val31, val32, val33 }; FsmTransition val34 = val5.Transitions.First((FsmTransition tran) => tran.EventName == "FINISHED"); val34.toState = "Bounce Again"; val34.toFsmState = val16; FsmTransition val35 = val6.Transitions.First((FsmTransition tran) => tran.EventName == "FINISHED"); val35.toState = "Bounce Again"; val35.toFsmState = val16; List<FsmStateAction> list8 = val12.Actions.ToList(); FsmStateAction[] actions2 = val10.Actions; foreach (FsmStateAction item in actions2) { list8.Add(item); } FsmTransition val36 = new FsmTransition { ToFsmState = val20, ToState = "Combo Spin", FsmEvent = FsmEvent.Finished }; val12.Transitions = (FsmTransition[])(object)new FsmTransition[1] { val36 }; val12.Actions = list8.ToArray(); FsmTransition val37 = val11.Transitions.First((FsmTransition tran) => tran.EventName == "FINISHED"); val37.toState = "Cyclone End"; val37.toFsmState = val12; FsmState[] array = (FsmState[])(object)new FsmState[4] { val9, val10, val12, val13 }; foreach (FsmState val38 in array) { FsmTransition val39 = val38.Transitions.First((FsmTransition transition) => transition.EventName == "FINISHED"); switch (val38.name) { case "Double Throw?": val39.toState = "Combo Throw"; val39.toFsmState = val18; break; case "Slash End": val39.toState = "Combo Slash"; val39.toFsmState = val19; break; case "Cyclone End": val39.toState = "Combo Spin"; val39.toFsmState = val20; break; case "Throw Land": val39.toState = "Combo Air"; val39.toFsmState = val21; break; } } FsmState[] array2 = (FsmState[])(object)new FsmState[4] { val18, val19, val20, val21 }; foreach (FsmState val40 in array2) { FsmTransition val41 = new FsmTransition { ToFsmState = toFsmState2, FsmEvent = Combo }; FsmTransition val42 = new FsmTransition { ToFsmState = val3, FsmEvent = FsmEvent.Finished }; List<FsmStateAction> list9 = val40.Actions.ToList(); list9.Add((FsmStateAction)new IntAdd { intVariable = ComboCount, add = FsmInt.op_Implicit(1) }); list9.Add((FsmStateAction)new SetIntValue { intVariable = ChargeCount, intValue = FsmInt.op_Implicit(10) }); list9.Add((FsmStateAction)new SetIntValue { intVariable = BounceCount, intValue = FsmInt.op_Implicit(10) }); list9.Add((FsmStateAction)new IntCompare { integer1 = ComboCount, integer2 = MaxCombo, equal = FsmEvent.Finished, lessThan = Combo, greaterThan = FsmEvent.Finished }); val40.Actions = list9.ToArray(); switch (val40.name) { case "Combo Throw": val41.toState = "Jump Back Dir"; val41.toFsmState = toFsmState; break; case "Combo Slash": val41.toState = "Jump Antic"; val41.toFsmState = toFsmState4; break; case "Combo Spin": val41.toState = "Throw Antic"; val41.toFsmState = toFsmState2; break; case "Combo Air": val41.toState = "Slash Antic"; val41.toFsmState = val7; break; } val40.Transitions = (FsmTransition[])(object)new FsmTransition[2] { val41, val42 }; } } private void SmallerSlam() { if (BounceCount.Value % 3 != 0) { BouncePower.Value = 35f; } else { BouncePower.Value = 65f; } } private void ModifyPhase2() { //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Expected O, but got Unknown //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: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Expected O, but got Unknown //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_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown FsmState val = _control.FsmStates.First((FsmState state) => state.Name == "P2 Roar"); FsmStateAction obj = val.Actions[5]; SetFloatValue val2 = (SetFloatValue)(object)((obj is SetFloatValue) ? obj : null); if (val2 != null) { val2.floatValue = FsmFloat.op_Implicit(0.1f); } FsmStateAction obj2 = val.Actions[6]; SetFloatValue val3 = (SetFloatValue)(object)((obj2 is SetFloatValue) ? obj2 : null); if (val3 != null) { val3.floatValue = FsmFloat.op_Implicit(0.1f); } List<FsmStateAction> list = val.Actions.ToList(); list.Add((FsmStateAction)new IntAdd { intVariable = MaxCharge, add = FsmInt.op_Implicit(2) }); list.Add((FsmStateAction)new IntAdd { intVariable = MaxBounce, add = FsmInt.op_Implicit(1) }); list.Add((FsmStateAction)new IntAdd { intVariable = MaxCombo, add = FsmInt.op_Implicit(2) }); list.Add((FsmStateAction)(object)new InvokeMethod(ModifyBladesP2)); val.Actions = list.ToArray(); ModifyPhase3(); } private void ModifyBlades() { FsmState val = _control.FsmStates.First((FsmState state) => state.Name == "Throw L"); FsmState val2 = _control.FsmStates.First((FsmState state) => state.Name == "Throw R"); FsmState val3 = _control.FsmStates.First((FsmState state) => state.Name == "Rethrow L"); FsmState val4 = _control.FsmStates.First((FsmState state) => state.Name == "Rethrow R"); FsmState[] array = (FsmState[])(object)new FsmState[4] { val, val2, val3, val4 }; foreach (FsmState val5 in array) { FsmStateAction obj = val5.Actions[1]; SetVelocityAsAngle val6 = (SetVelocityAsAngle)(object)((obj is SetVelocityAsAngle) ? obj : null); if (val6 != null) { val6.speed = FsmFloat.op_Implicit(60f); } FsmStateAction obj2 = val5.Actions[5]; SetVelocityAsAngle val7 = (SetVelocityAsAngle)(object)((obj2 is SetVelocityAsAngle) ? obj2 : null); if (val7 != null) { val7.speed = FsmFloat.op_Implicit(40f); } } } private void ModifyBladesP2() { FsmState val = _control.FsmStates.First((FsmState state) => state.Name == "Throw L"); FsmState val2 = _control.FsmStates.First((FsmState state) => state.Name == "Throw R"); FsmState val3 = _control.FsmStates.First((FsmState state) => state.Name == "Air Sickles"); FsmState val4 = _control.FsmStates.First((FsmState state) => state.Name == "Rethrow L"); FsmState val5 = _control.FsmStates.First((FsmState state) => state.Name == "Rethrow R"); FsmState[] array = (FsmState[])(object)new FsmState[5] { val, val2, val3, val4, val5 }; foreach (FsmState val6 in array) { List<FsmStateAction> list = val6.Actions.ToList(); list.Insert(5, (FsmStateAction)(object)new InvokeMethod(AddTrapToBlade)); list.Insert(3, (FsmStateAction)(object)new InvokeMethod(AddTrapToBlade)); val6.Actions = list.ToArray(); } } private void AddTrapToBlade() { GameObject value = _control.Fsm.GetFsmGameObject("Sickle").Value; _control.Fsm.GetFsmGameObject("Sickle").Value.GetComponent<DamageHero>().damageDealt = 2; if (!Object.op_Implicit((Object)(object)value.GetComponent<BladeEditor>())) { value.AddComponent<BladeEditor>(); } } private void ModifyPhase3() { //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Expected O, but got Unknown //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: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Expected O, but got Unknown //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_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown FsmState val = _control.FsmStates.First((FsmState state) => state.Name == "P3 Roar"); FsmStateAction obj = val.Actions[5]; SetFloatValue val2 = (SetFloatValue)(object)((obj is SetFloatValue) ? obj : null); if (val2 != null) { val2.floatValue = FsmFloat.op_Implicit(0f); } FsmStateAction obj2 = val.Actions[6]; SetFloatValue val3 = (SetFloatValue)(object)((obj2 is SetFloatValue) ? obj2 : null); if (val3 != null) { val3.floatValue = FsmFloat.op_Implicit(0f); } List<FsmStateAction> list = val.Actions.ToList(); list.Add((FsmStateAction)new IntAdd { intVariable = MaxCharge, add = FsmInt.op_Implicit(2) }); list.Add((FsmStateAction)new IntAdd { intVariable = MaxBounce, add = FsmInt.op_Implicit(1) }); list.Add((FsmStateAction)new IntAdd { intVariable = MaxCombo, add = FsmInt.op_Implicit(5) }); list.Add((FsmStateAction)(object)new InvokeMethod(StartPhase3)); val.Actions = list.ToArray(); } private void StartPhase3() { FsmState val = _control.FsmStates.First((FsmState state) => state.Name == "Spin Antic"); FsmState val2 = _control.FsmStates.First((FsmState state) => state.Name == "Launch Spin"); FsmState val3 = _control.FsmStates.First((FsmState state) => state.Name == "Rethrow 2"); FsmState toFsmState = _control.FsmStates.First((FsmState state) => state.Name == "Combo Throw"); FsmTransition val4 = val3.Transitions.First((FsmTransition transition) => transition.EventName == "FINISHED"); val4.toState = "Combo Throw"; val4.toFsmState = toFsmState; List<FsmStateAction> list = val.Actions.ToList(); list.Insert(0, (FsmStateAction)(object)new InvokeMethod(PlaceTrapCondition)); val.Actions = list.ToArray(); List<FsmStateAction> list2 = val2.Actions.ToList(); list2.Insert(0, (FsmStateAction)(object)new InvokeMethod(PlaceTrap)); val2.Actions = list2.ToArray(); } private void PlaceTrap() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) GameObject val = Object.Instantiate<GameObject>(TrapLoader.GetTrap()); val.transform.position = ((Component)this).gameObject.transform.position; val.SetActive(true); } private void PlaceTrapCondition() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) if (BounceCount.Value >= 3) { GameObject val = Object.Instantiate<GameObject>(TrapLoader.GetTrap()); val.transform.position = ((Component)this).gameObject.transform.position; val.SetActive(true); } } private void PlaceUnbreakableTraps() { //IL_002b: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < 10; i++) { GameObject val = Object.Instantiate<GameObject>(TrapLoader.GetTrap()); val.transform.position = new Vector3(135f + (float)(3 * i), 36f, 0f); val.AddComponent<PermanentTrap>(); val.SetActive(true); } } private void OnDestroy() { } } internal class TrapLoader : MonoBehaviour { [CompilerGenerated] private sealed class <Start>d__1 : IEnumerator<object>, IEn