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 FraudLace.Modifiers; using FraudLace.Patches; using HarmonyLib; using HutongGames.PlayMaker; using HutongGames.PlayMaker.Actions; using JetBrains.Annotations; using Microsoft.CodeAnalysis; using Silksong.FsmUtil.Actions; using TMProOld; using TeamCherry.Localization; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.ResourceManagement.AsyncOperations; using UnityEngine.ResourceManagement.ResourceProviders; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("FraudLace")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("FraudLace")] [assembly: AssemblyTitle("FraudLace")] [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 Silksong.FsmUtil.Actions { public class DelegateAction : FsmStateAction { public Action? Method; public TArg? Arg; public override void Reset() { Method = null; ((FsmStateAction)this).Reset(); } public override void OnEnter() { if (Method != null && Arg != null) { Method(Arg); } if (!((object)Arg is Action action) || action != new Action(base.Finish)) { ((FsmStateAction)this).Finish(); } } } } namespace FraudLace { internal static class AssetManager { [CompilerGenerated] private sealed class <>c__DisplayClass6_0 { public string prefabName; internal bool b__0(Transform obj) { return ((Object)obj).name == prefabName; } } [CompilerGenerated] private sealed class d__5 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__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 d__7 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; private string 5__1; private string 5__2; private RuntimePlatform <>s__3; private Dictionary.Enumerator <>s__4; private string 5__5; private string[] 5__6; private bool 5__7; private string 5__8; private AssetBundleCreateRequest 5__9; private AssetBundle 5__10; private IEnumerator <>s__11; private AssetBundle 5__12; private string[] <>s__13; private int <>s__14; private string 5__15; private string[] <>s__16; private int <>s__17; private string 5__18; private AssetBundleRequest 5__19; private Object 5__20; private string[] <>s__21; private int <>s__22; private string 5__23; private string[] <>s__24; private int <>s__25; private string 5__26; private AssetBundleRequest 5__27; private Object 5__28; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__7(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 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(); } } 5__1 = null; 5__2 = null; <>s__4 = default(Dictionary.Enumerator); 5__5 = null; 5__6 = null; 5__8 = null; 5__9 = null; 5__10 = null; <>s__11 = null; 5__12 = null; <>s__13 = null; 5__15 = null; <>s__16 = null; 5__18 = null; 5__19 = null; 5__20 = null; <>s__21 = null; 5__23 = null; <>s__24 = null; 5__26 = null; 5__27 = null; 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) { } 5__1 = key; 5__2 = Path.Combine(Addressables.RuntimePath, 5__1); <>s__4 = BundleAssets.GetEnumerator(); <>1__state = -3; goto IL_04bf; } case 1: <>1__state = -4; 5__20 = 5__19.asset; AssetManager.TryAdd(5__20); Debug.Log((object)5__20.name); goto IL_023c; case 2: <>1__state = -3; 5__10 = 5__9.assetBundle; _manuallyLoadedBundles.Add(5__10); <>s__21 = 5__10.GetAllAssetNames(); <>s__22 = 0; goto IL_0481; case 3: { <>1__state = -3; 5__28 = 5__27.asset; AssetManager.TryAdd(5__28); 5__27 = null; 5__28 = null; goto IL_043b; } IL_0481: if (<>s__22 < <>s__21.Length) { 5__23 = <>s__21[<>s__22]; <>s__24 = 5__6; <>s__25 = 0; goto IL_0451; } <>s__21 = null; 5__8 = null; 5__9 = null; 5__10 = null; 5__5 = null; 5__6 = null; goto IL_04bf; IL_023c: <>s__16 = null; if (5__7) { goto IL_027b; } 5__15 = null; <>s__14++; goto IL_0268; IL_027b: <>s__13 = null; if (5__7) { goto IL_02a9; } 5__12 = null; goto IL_0299; IL_0451: if (<>s__25 < <>s__24.Length) { 5__26 = <>s__24[<>s__25]; if (5__23.GetAssetRoot() == 5__26) { 5__27 = 5__10.LoadAssetAsync(5__23); <>2__current = 5__27; <>1__state = 3; return true; } goto IL_043b; } <>s__24 = null; 5__23 = null; <>s__22++; goto IL_0481; IL_0268: if (<>s__14 < <>s__13.Length) { 5__15 = <>s__13[<>s__14]; <>s__16 = 5__6; for (<>s__17 = 0; <>s__17 < <>s__16.Length; <>s__17++) { 5__18 = <>s__16[<>s__17]; if (5__15.GetAssetRoot() == 5__18) { 5__7 = true; 5__19 = 5__12.LoadAssetAsync(5__15); <>2__current = 5__19; <>1__state = 1; return true; } 5__18 = null; } goto IL_023c; } goto IL_027b; IL_0299: if (<>s__11.MoveNext()) { 5__12 = <>s__11.Current; <>s__13 = 5__12.GetAllAssetNames(); <>s__14 = 0; goto IL_0268; } goto IL_02a9; IL_043b: 5__26 = null; <>s__25++; goto IL_0451; IL_02a9: <>m__Finally2(); <>s__11 = null; if (5__7) { Debug.Log((object)("Bundle " + 5__5 + " already loaded!")); goto IL_04bf; } 5__8 = Path.Combine(5__2, 5__5 + ".bundle"); 5__9 = AssetBundle.LoadFromFileAsync(5__8); <>2__current = 5__9; <>1__state = 2; return true; IL_04bf: if (<>s__4.MoveNext()) { <>s__4.Current.Deconstruct(out key, out string[] value); 5__5 = key; 5__6 = value; 5__7 = false; <>s__11 = AssetBundle.GetAllLoadedAssetBundles().GetEnumerator(); <>1__state = -4; goto IL_0299; } <>m__Finally1(); <>s__4 = default(Dictionary.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 d__6 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; private Dictionary.Enumerator <>s__1; private string 5__2; private string[] 5__3; private string 5__4; private AsyncOperationHandle 5__5; private AsyncOperationHandle 5__6; private SceneInstance 5__7; private Scene 5__8; private GameObject[] <>s__9; private int <>s__10; private GameObject 5__11; private string[] <>s__12; private int <>s__13; private <>c__DisplayClass6_0 <>8__14; private GameObject 5__15; private GameObject 5__16; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public 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.Enumerator); 5__2 = null; 5__3 = null; 5__4 = null; 5__5 = default(AsyncOperationHandle); 5__6 = default(AsyncOperationHandle); 5__7 = default(SceneInstance); <>s__9 = null; 5__11 = null; <>s__12 = null; <>8__14 = null; 5__15 = null; 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)5__5.Status == 1) { 5__7 = 5__5.Result; 5__8 = ((SceneInstance)(ref 5__7)).Scene; <>s__9 = ((Scene)(ref 5__8)).GetRootGameObjects(); for (<>s__10 = 0; <>s__10 < <>s__9.Length; <>s__10++) { 5__11 = <>s__9[<>s__10]; <>s__12 = 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)5__11.GetComponentsInChildren(true)).FirstOrDefault((Func)((Transform obj) => ((Object)obj).name == <>8__14.prefabName)); 5__15 = ((obj2 != null) ? ((Component)obj2).gameObject : null); if (Object.op_Implicit((Object)(object)5__15)) { 5__15.SetActive(false); 5__16 = Object.Instantiate(5__15); ((Object)5__16).name = <>8__14.prefabName; Object.DontDestroyOnLoad((Object)(object)5__16); AssetManager.TryAdd(5__16); 5__16 = null; } 5__15 = null; <>8__14 = null; } <>s__12 = null; 5__11 = null; } <>s__9 = null; 5__7 = default(SceneInstance); } else { Debug.Log((object)5__5.OperationException); } 5__6 = Addressables.UnloadSceneAsync(5__5, true); <>2__current = 5__6; <>1__state = 2; return true; case 2: <>1__state = -3; 5__4 = null; 5__5 = default(AsyncOperationHandle); 5__6 = default(AsyncOperationHandle); 5__2 = null; 5__3 = null; break; } if (<>s__1.MoveNext()) { <>s__1.Current.Deconstruct(out string key, out string[] value); 5__2 = key; 5__3 = value; 5__4 = "Scenes/" + 5__2; 5__5 = Addressables.LoadSceneAsync((object)5__4, (LoadSceneMode)1, true, 100, (SceneReleaseMode)0); <>2__current = 5__5; <>1__state = 1; return true; } <>m__Finally1(); <>s__1 = default(Dictionary.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 ScenePrefabs = new Dictionary { ["Cradle_03"] = new string[1] { "Boss Scene" }, ["Bone_Steel_Servant"] = new string[1] { "Abyss Mass" } }; private static readonly Dictionary BundleAssets = new Dictionary { ["blackthread_assets_all"] = new string[1] { "Black Thread Start Enemy Effect" }, ["animations_assets_areacradle"] = new string[1] { "abyss_water_70_percent0001" }, ["tk2danimations_assets_areabone"] = new string[1] { "Abyss Mass Anim" }, ["sfxstatic_assets_areacradle"] = new string[2] { "silk_boss_web_attack_buildup", "silk_boss_web_attack_burst" } }; private static List _manuallyLoadedBundles = new List(); private static readonly Dictionary> Assets = new Dictionary>(); internal static string GetAssetRoot(this string assetPath) { return assetPath.Split("/").Last().Replace(".asset", "") .Replace(".prefab", "") .Replace(".wav", "") .Replace(".controller", ""); } [IteratorStateMachine(typeof(d__5))] internal static IEnumerator Init() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__5(0); } [IteratorStateMachine(typeof(d__6))] private static IEnumerator LoadScenePrefabs() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__6(0); } [IteratorStateMachine(typeof(d__7))] internal static IEnumerator LoadBundleAssets() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new 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 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 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()); } } else { Assets.Add(type, new Dictionary { [name] = (Object)(object)asset }); Debug.Log((object)$"Added new sub-dictionary of type \"{type}\" with initial asset \"{name}\"."); } } internal static void UnloadAll() { foreach (Dictionary value in Assets.Values) { foreach (Object value2 in value.Values) { Object.DestroyImmediate(value2); } } Assets.Clear(); GC.Collect(); } internal static void UnloadManualBundles() { foreach (AssetBundle manuallyLoadedBundle in _manuallyLoadedBundles) { string bundleName = ((Object)manuallyLoadedBundle).name; AssetBundleUnloadOperation val = manuallyLoadedBundle.UnloadAsync(true); ((AsyncOperation)val).completed += delegate { Debug.Log((object)("Successfully unloaded bundle \"" + bundleName + "\"")); }; } _manuallyLoadedBundles.Clear(); foreach (KeyValuePair 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(string assetName) where T : Object { Type typeFromHandle = typeof(T); if (Assets.ContainsKey(typeFromHandle)) { Dictionary dictionary = Assets[typeFromHandle]; if (dictionary != null) { if (dictionary.ContainsKey(assetName)) { Object val = dictionary[assetName]; if (val != (Object)null) { return (T)(object)((val is T) ? val : null); } 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 Constants { public static int LLHP1 => 3600; public static int LLHP2 => 3000; public static int LLHP3 => 2200; public static int LLHP4 => 1200; public static int globcount => 7; public static int tendrilcount => 6; public static float commondelay => 0.1f; public static float chargedelay => 0.4f; public static float bulletdelay => 0.02f; public static float fasterfall => 3f; public static string FraudLaceNotes_EN => "This pretentious crybaby covered herself in void and claims herself to be the final boss. I shall beat her out of this emo phase."; } internal static class ActionUtil { public static FsmOwnerDefault GOtoFOD(FsmGameObject target) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Expected O, but got Unknown return new FsmOwnerDefault { ownerOption = (OwnerDefaultOption)1, gameObject = target }; } public static void ClearActionsAfter(this FsmState source, int index) { FsmStateAction[] array = source.Actions; if (index < 0 || index >= array.Length) { throw new ArgumentOutOfRangeException("index", "Index is out of range of the actions array."); } Array.Resize(ref array, index + 1); source.Actions = array; } public static void CloneActionsAndTransitions(FsmState source, FsmState target) { FsmStateAction[] actions = source.Actions; FsmTransition[] transitions = source.Transitions; target.Actions = (FsmStateAction[])(object)new FsmStateAction[actions.Length]; target.Transitions = (FsmTransition[])(object)new FsmTransition[transitions.Length]; for (int i = 0; i < actions.Length; i++) { FsmStateAction originalActions = actions[i]; target.Actions[i] = CloneAction(originalActions); } for (int j = 0; j < transitions.Length; j++) { FsmTransition originaltransitions = transitions[j]; target.Transitions[j] = CloneTransition(originaltransitions); } } internal static FsmStateAction CloneAction(FsmStateAction originalActions) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown Type type = ((object)originalActions).GetType(); FsmStateAction val = (FsmStateAction)Activator.CreateInstance(type); FieldInfo[] fields = type.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); FieldInfo[] array = fields; foreach (FieldInfo fieldInfo in array) { fieldInfo.SetValue(val, fieldInfo.GetValue(originalActions)); } return val; } private static FsmTransition CloneTransition(FsmTransition originaltransitions) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown Type type = ((object)originaltransitions).GetType(); FsmTransition val = (FsmTransition)Activator.CreateInstance(type); FieldInfo[] fields = type.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); FieldInfo[] array = fields; foreach (FieldInfo fieldInfo in array) { fieldInfo.SetValue(val, fieldInfo.GetValue(originaltransitions)); } return val; } internal static FsmStateAction RandomFloatAdder(FsmFloat target, float min, float max) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000d: 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_0026: Expected O, but got Unknown return (FsmStateAction)new FloatAddRandom { floatVariable = target, addMin = FsmFloat.op_Implicit(min), addMax = FsmFloat.op_Implicit(max) }; } internal static FsmStateAction RandomFloatSetter(FsmFloat target, float min, float max) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0012: 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_0026: Expected O, but got Unknown return (FsmStateAction)new RandomFloat { min = FsmFloat.op_Implicit(min), max = FsmFloat.op_Implicit(max), storeResult = target }; } internal static FsmStateAction FloatAdder(FsmFloat target, float value) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown return (FsmStateAction)new FloatAdd { floatVariable = target, add = FsmFloat.op_Implicit(value) }; } internal static FsmStateAction FloatSetter(FsmFloat target, FsmFloat value) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown return (FsmStateAction)new SetFloatValue { floatVariable = target, floatValue = value, everyFrame = false }; } internal static FsmStateAction RandomIntSetter(FsmInt target, int min, int max) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0012: 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_0026: Expected O, but got Unknown return (FsmStateAction)new RandomInt { min = FsmInt.op_Implicit(min), max = FsmInt.op_Implicit(max), storeResult = target }; } internal static FsmStateAction IntAdder(FsmInt target, int value) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown return (FsmStateAction)new IntAdd { intVariable = target, add = FsmInt.op_Implicit(value) }; } internal static FsmStateAction IntSetter(FsmInt target, FsmInt value) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown return (FsmStateAction)new SetIntValue { intVariable = target, intValue = value, everyFrame = false }; } internal static FsmStateAction IntComparer(FsmInt Int1, FsmInt Int2, FsmEvent greatevent, FsmEvent equalevent, FsmEvent lessevent) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown return (FsmStateAction)new IntCompare { integer1 = Int1, integer2 = Int2, equal = equalevent, greaterThan = greatevent, lessThan = lessevent, everyFrame = false }; } internal static FsmStateAction BoolSetter(FsmBool target, bool value) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000d: 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_0021: Expected O, but got Unknown return (FsmStateAction)new SetBoolValue { boolVariable = target, boolValue = FsmBool.op_Implicit(value), everyFrame = false }; } internal static FsmStateAction BoolSender(GameObject target, string name, FsmBool value) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Expected O, but got Unknown return (FsmStateAction)new SetFsmBool { gameObject = GOtoFOD(FsmGameObject.op_Implicit(target)), fsmName = FsmString.op_Implicit("Control"), variableName = FsmString.op_Implicit(name), setValue = value, everyFrame = false }; } internal static FsmStateAction FloatSender(GameObject target, string name, FsmFloat num) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Expected O, but got Unknown return (FsmStateAction)new SetFsmFloat { gameObject = GOtoFOD(FsmGameObject.op_Implicit(target)), fsmName = FsmString.op_Implicit("Control"), variableName = FsmString.op_Implicit(name), setValue = num, everyFrame = false }; } internal static FsmStateAction EventSender(FsmGameObject target, FsmString pinevent) { return EventSenderWithDelay(target, pinevent, 0f); } internal static FsmStateAction EventSenderWithDelay(FsmGameObject target, FsmString pinevent, float delay) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_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_0024: Expected O, but got Unknown //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Expected O, but got Unknown return (FsmStateAction)new SendEventByName { eventTarget = new FsmEventTarget { target = (EventTarget)1, gameObject = GOtoFOD(target) }, sendEvent = pinevent, delay = FsmFloat.op_Implicit(delay), everyFrame = false }; } internal static FsmStateAction SelfEventSender(FsmString pinevent) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Expected O, but got Unknown return (FsmStateAction)new SendEventByName { eventTarget = new FsmEventTarget { target = (EventTarget)0 }, sendEvent = pinevent, delay = FsmFloat.op_Implicit(0f), everyFrame = false }; } internal static FsmStateAction SelfAnimatorPosition(FsmFloat x, FsmFloat y, FsmFloat z) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Expected O, but got Unknown return (FsmStateAction)new AnimatePositionTo { gameObject = new FsmOwnerDefault { OwnerOption = (OwnerDefaultOption)0 }, toValue = new FsmVector3 { UseVariable = true, Value = new Vector3(x.value, y.value, z.value) }, objectTransform = null, localSpace = false, time = FsmFloat.op_Implicit(2f), finishEvent = FsmEvent.Finished }; } internal static FsmStateAction Waiter(float seconds) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected O, but got Unknown return (FsmStateAction)new Wait { time = FsmFloat.op_Implicit(seconds), finishEvent = FsmEvent.Finished }; } internal static FsmStateAction WaiterWithEvent(float seconds, FsmEvent waitevent) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown return (FsmStateAction)new Wait { time = FsmFloat.op_Implicit(seconds), finishEvent = waitevent }; } internal static FsmStateAction PositionGetter(FsmGameObject target, FsmFloat x, FsmFloat y) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003f: 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_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Expected O, but got Unknown return (FsmStateAction)new GetPosition { gameObject = GOtoFOD(target), vector = FsmVector3.op_Implicit(new Vector3(0f, 0f, 0f)), x = x, y = y, z = FsmFloat.op_Implicit(0f), everyFrame = false, space = (Space)0 }; } internal static FsmStateAction GOActivator(GameObject target, bool sw) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Expected O, but got Unknown return (FsmStateAction)new ActivateGameObject { gameObject = GOtoFOD(FsmGameObject.op_Implicit(target)), activate = FsmBool.op_Implicit(sw), recursive = FsmBool.op_Implicit(false), resetOnExit = false, everyFrame = false }; } internal static FsmStateAction SimpleRandomEvent(FsmEvent[] events, FsmFloat[] weights, FsmInt[] eventmax, FsmInt[] missedmax, FsmBool active) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown return (FsmStateAction)new SendRandomEventV4 { events = events, weights = weights, eventMax = eventmax, missedMax = missedmax, activeBool = active }; } } public static class FsmUtil { [PublicAPI] public static PlayMakerFSM? GetFsmPreprocessed(this GameObject go, string fsmName) { PlayMakerFSM[] components = go.GetComponents(); foreach (PlayMakerFSM val in components) { if (val.FsmName == fsmName) { val.Preprocess(); return val; } } return null; } private static TVal? GetItemFromArray(TVal[] origArray, Func isItemCheck) where TVal : class { foreach (TVal val in origArray) { if (isItemCheck(val)) { return val; } } return null; } private static TVal[] GetItemsFromArray(TVal[] origArray, Func 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[] 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(this PlayMakerFSM fsm, string stateName, int index) where TAction : FsmStateAction { return fsm.GetState(stateName).GetAction(index); } [PublicAPI] public static TAction? GetAction(this Fsm fsm, string stateName, int index) where TAction : FsmStateAction { return fsm.GetState(stateName).GetAction(index); } [PublicAPI] public static TAction? GetAction(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(this PlayMakerFSM fsm, string stateName) where TAction : FsmStateAction { return fsm.GetState(stateName).GetActionsOfType(); } [PublicAPI] public static TAction[] GetActionsOfType(this Fsm fsm, string stateName) where TAction : FsmStateAction { return fsm.GetState(stateName).GetActionsOfType(); } [PublicAPI] public static TAction[] GetActionsOfType(this FsmState state) where TAction : FsmStateAction { return Array.ConvertAll(GetItemsFromArray(state.Actions, (FsmStateAction x) => x is TAction), (FsmStateAction x) => (TAction)(object)x); } [PublicAPI] public static TAction? GetFirstActionOfType(this PlayMakerFSM fsm, string stateName) where TAction : FsmStateAction { return fsm.GetState(stateName).GetFirstActionOfType(); } [PublicAPI] public static TAction? GetFirstActionOfType(this Fsm fsm, string stateName) where TAction : FsmStateAction { return fsm.GetState(stateName).GetFirstActionOfType(); } [PublicAPI] public static TAction? GetFirstActionOfType(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(num); } [PublicAPI] public static TAction? GetLastActionOfType(this PlayMakerFSM fsm, string stateName) where TAction : FsmStateAction { return fsm.GetState(stateName).GetLastActionOfType(); } [PublicAPI] public static TAction? GetLastActionOfType(this Fsm fsm, string stateName) where TAction : FsmStateAction { return fsm.GetState(stateName).GetLastActionOfType(); } [PublicAPI] public static TAction? GetLastActionOfType(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(num); } private static TVal[] AddItemToArray(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); } } [PublicAPI] public static void AddMethod(this PlayMakerFSM fsm, string stateName, Action method) { fsm.GetState(stateName).AddMethod(method); } [PublicAPI] public static void AddMethod(this Fsm fsm, string stateName, Action method) { fsm.GetState(stateName).AddMethod(method); } [PublicAPI] public static void AddMethod(this FsmState state, Action method) { DelegateAction delegateAction = new DelegateAction { Method = method }; delegateAction.Arg = (FsmStateAction?)(object)delegateAction; state.AddAction((FsmStateAction)(object)delegateAction); } [PublicAPI] public static void AddLambdaMethod(this PlayMakerFSM fsm, string stateName, Action method) { fsm.GetState(stateName).AddLambdaMethod(method); } [PublicAPI] public static void AddLambdaMethod(this Fsm fsm, string stateName, Action method) { fsm.GetState(stateName).AddLambdaMethod(method); } [PublicAPI] public static void AddLambdaMethod(this FsmState state, Action method) { DelegateAction delegateAction = new DelegateAction { Method = method }; delegateAction.Arg = ((FsmStateAction)delegateAction).Finish; state.AddAction((FsmStateAction)(object)delegateAction); } private static TVal[] InsertItemIntoArray(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 InsertMethod(this PlayMakerFSM fsm, string stateName, Action method, int index) { fsm.GetState(stateName).InsertMethod(index, method); } [PublicAPI] public static void InsertMethod(this PlayMakerFSM fsm, string stateName, int index, Action method) { fsm.GetState(stateName).InsertMethod(index, method); } [PublicAPI] public static void InsertMethod(this Fsm fsm, string stateName, Action method, int index) { fsm.GetState(stateName).InsertMethod(index, method); } [PublicAPI] public static void InsertMethod(this Fsm fsm, string stateName, int index, Action method) { fsm.GetState(stateName).InsertMethod(index, method); } [PublicAPI] public static void InsertMethod(this FsmState state, Action method, int index) { state.InsertMethod(index, method); } [PublicAPI] public static void InsertMethod(this FsmState state, int index, Action method) { DelegateAction delegateAction = new DelegateAction { Method = method }; delegateAction.Arg = (FsmStateAction?)(object)delegateAction; state.InsertAction((FsmStateAction)(object)delegateAction, index); } [PublicAPI] public static void InsertLambdaMethod(this PlayMakerFSM fsm, string stateName, Action method, int index) { fsm.GetState(stateName).InsertLambdaMethod(index, method); } [PublicAPI] public static void InsertLambdaMethod(this PlayMakerFSM fsm, string stateName, int index, Action method) { fsm.GetState(stateName).InsertLambdaMethod(index, method); } [PublicAPI] public static void InsertLambdaMethod(this Fsm fsm, string stateName, Action method, int index) { fsm.GetState(stateName).InsertLambdaMethod(index, method); } [PublicAPI] public static void InsertLambdaMethod(this Fsm fsm, string stateName, int index, Action method) { fsm.GetState(stateName).InsertLambdaMethod(index, method); } [PublicAPI] public static void InsertLambdaMethod(this FsmState state, Action method, int index) { state.InsertLambdaMethod(index, method); } [PublicAPI] public static void InsertLambdaMethod(this FsmState state, int index, Action method) { DelegateAction delegateAction = new DelegateAction { Method = method }; delegateAction.Arg = ((FsmStateAction)delegateAction).Finish; state.InsertAction((FsmStateAction)(object)delegateAction, 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[] origArray, Func 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(); } [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(this PlayMakerFSM fsm) { fsm.Fsm.RemoveActionsOfType(); } [PublicAPI] public static void RemoveActionsOfType(this Fsm fsm) { FsmState[] states = fsm.States; foreach (FsmState state in states) { state.RemoveActionsOfType(); } } [PublicAPI] public static void RemoveActionsOfType(this PlayMakerFSM fsm, string stateName) { fsm.GetState(stateName).RemoveActionsOfType(); } [PublicAPI] public static void RemoveActionsOfType(this Fsm fsm, string stateName) { fsm.GetState(stateName).RemoveActionsOfType(); } [PublicAPI] public static void RemoveActionsOfType(this FsmState state) { state.Actions = RemoveItemsFromArray(state.Actions, (FsmStateAction x) => x is TAction); } [PublicAPI] public static void RemoveFirstActionOfType(this PlayMakerFSM fsm, string stateName) { fsm.GetState(stateName).RemoveFirstActionOfType(); } [PublicAPI] public static void RemoveFirstActionOfType(this Fsm fsm, string stateName) { fsm.GetState(stateName).RemoveFirstActionOfType(); } [PublicAPI] public static void RemoveFirstActionOfType(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(this PlayMakerFSM fsm, string stateName) { fsm.GetState(stateName).RemoveLastActionOfType(); } [PublicAPI] public static void RemoveLastActionOfType(this Fsm fsm, string stateName) { fsm.GetState(stateName).RemoveLastActionOfType(); } [PublicAPI] public static void RemoveLastActionOfType(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(this PlayMakerFSM fsm) { fsm.Fsm.DisableActionsOfType(); } [PublicAPI] public static void DisableActionsOfType(this Fsm fsm) { FsmState[] states = fsm.States; foreach (FsmState state in states) { state.DisableActionsOfType(); } } [PublicAPI] public static void DisableActionsOfType(this PlayMakerFSM fsm, string stateName) { fsm.GetState(stateName).DisableActionsOfType(); } [PublicAPI] public static void DisableActionsOfType(this Fsm fsm, string stateName) { fsm.GetState(stateName).DisableActionsOfType(); } [PublicAPI] public static void DisableActionsOfType(this FsmState state) { FsmStateAction[] actions = state.Actions; foreach (FsmStateAction val in actions) { if (val is TAction) { val.Enabled = false; } } } private static TVar[] MakeNewVariableArray(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(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(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(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(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(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(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(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(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(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(fsm.Variables.GameObjectVariables, name); fsm.Variables.GameObjectVariables = array; return array[^1]; } private static TVar? FindInVariableArray(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(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(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(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(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(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(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(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(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(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(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); } } internal static class ImageUtil { public static byte[] GetBytesFromResources(this Assembly asm, string fileName) { string[] manifestResourceNames = asm.GetManifestResourceNames(); string[] array = manifestResourceNames; foreach (string text in array) { if (!text.EndsWith(fileName)) { continue; } using Stream stream = asm.GetManifestResourceStream(text); if (stream == null) { continue; } byte[] array2 = new byte[stream.Length]; stream.Read(array2, 0, array2.Length); stream.Dispose(); return array2; } return null; } public static Texture2D GetTextureFromResources(string fileName) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Expected O, but got Unknown Texture2D val = new Texture2D(2, 2); byte[] bytesFromResources = Assembly.GetCallingAssembly().GetBytesFromResources(fileName); if (bytesFromResources == null) { return null; } ImageConversion.LoadImage(val, bytesFromResources); val.Apply(); return val; } } public class InvokeCoroutine : FsmStateAction { [CompilerGenerated] private sealed class d__3 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public InvokeCoroutine <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__3(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { 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 _coroutine; private readonly bool _wait; public InvokeCoroutine(Func coroutine, bool wait) { _coroutine = coroutine; _wait = wait; } [IteratorStateMachine(typeof(d__3))] private IEnumerator Coroutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__3(0) { <>4__this = this }; } public override void OnEnter() { ((FsmStateAction)this).Fsm.Owner.StartCoroutine(_wait ? Coroutine() : _coroutine()); if (!_wait) { ((FsmStateAction)this).Finish(); } } } public class InvokeMethod : FsmStateAction { private readonly Action _action; public InvokeMethod(Action action) { _action = action; } public override void OnEnter() { _action(); ((FsmStateAction)this).Finish(); } } public class Audioplayer { [CompilerGenerated] private sealed class <>c__DisplayClass0_0 { public GameObject audio; public Vector3 origin; public AudioClip clip; public float delay; } public void PlayOneShotDelay(GameObject audio, Vector3 origin, AudioClip clip, float delay) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) <>c__DisplayClass0_0 CS$<>8__locals0 = new <>c__DisplayClass0_0(); CS$<>8__locals0.audio = audio; CS$<>8__locals0.origin = origin; CS$<>8__locals0.clip = clip; CS$<>8__locals0.delay = delay; ((MonoBehaviour)GameManager.instance).StartCoroutine(PlayAndRecycle()); [IteratorStateMachine(typeof(<>c__DisplayClass0_0.<g__PlayAndRecycle|0>d))] IEnumerator PlayAndRecycle() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <>c__DisplayClass0_0.<g__PlayAndRecycle|0>d(0) { <>4__this = CS$<>8__locals0 }; } } public void PlayOneShot(GameObject audio, Vector3 origin, AudioClip clip) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) PlayOneShotDelay(audio, origin, clip, 0.1f); } } [RequireComponent(typeof(tk2dSpriteAnimator))] [RequireComponent(typeof(PlayMakerFSM))] internal class FraudLaceBoss : MonoBehaviour { [CompilerGenerated] private sealed class d__19 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public FraudLaceBoss <>4__this; object? IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object? IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__19(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.5f); <>1__state = 1; return true; case 1: <>1__state = -1; ((Component)<>4__this).gameObject.GetComponent().hp = Constants.LLHP1; <>4__this._control.fsm.GetFsmInt("P2 HP").Value = Constants.LLHP2; <>4__this._control.fsm.GetFsmInt("P3 HP").Value = Constants.LLHP3; <>4__this._control.fsm.GetFsmInt("P4 HP").Value = Constants.LLHP4; <>4__this._phase.fsm.GetFsmInt("P2 HP").Value = Constants.LLHP2; <>4__this._phase.fsm.GetFsmInt("P3 HP").Value = Constants.LLHP3; <>4__this._phase.GetState("Can Die?").AddMethod(delegate { if (Object.op_Implicit((Object)(object)<>4__this.voidhole1)) { Object.Destroy((Object)(object)<>4__this.voidhole1); } }); 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? LLaceAnim; private PlayMakerFSM? _control; private PlayMakerFSM? _bullet; private PlayMakerFSM? _phase; private PlayMakerFSM? _title; private GameObject? LLace; private GameObject? title; private GameObject? scene; private GameObject? abysswave; private GameObject? whipG; private GameObject? whipA; private GameObject? glob; private GameObject? voidhole1; private GameObject? web; private List? AllModifiers; private void Awake() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) ((Component)this).gameObject.transform.localScale = new Vector3(1.2f, 1.2f, 1.2f); ComponentGetter(); ((MonoBehaviour)this).StartCoroutine(Health()); ApplyAllModifiers(); } private void ComponentGetter() { //IL_0114: Unknown result type (might be due to invalid IL or missing references) LLaceAnim = ((Component)this).GetComponent(); _control = FSMUtility.LocateMyFSM(((Component)this).gameObject, "Control"); _bullet = FSMUtility.LocateMyFSM(((Component)this).gameObject, "Summon Bullets"); _phase = FSMUtility.LocateMyFSM(((Component)this).gameObject, "Death Control"); scene = ((Component)((Component)this).gameObject.transform.parent).gameObject; LLace = ((Component)this).gameObject; whipG = ((Component)((Component)this).gameObject.transform.Find("Whip Attack G")).gameObject; whipA = ((Component)((Component)this).gameObject.transform.Find("Whip Attack A")).gameObject; web = ((Component)scene.transform.Find("Black Thread Attack (deprecated)")).gameObject; FsmState? state = _control.GetState("Vomit Fire"); glob = ((state != null) ? state.GetAction(4).gameObject.Value : null); voidhole1 = VoidholeSetup(new Vector3(30f, 16f, 0f)); title = ((Component)scene.transform.Find("Boss Title")).gameObject; abysswave = ((Component)scene.transform.Find("Abyss Wave")).gameObject; _title = FSMUtility.LocateMyFSM(title, "Title Control"); } private GameObject VoidholeSetup(Vector3 pos) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) GameObject val = Object.Instantiate(ImportLoader.GetVoidHole(), pos, Quaternion.Euler(0f, 0f, -90f)); val.transform.localScale = new Vector3(2.5f, 2.5f, 2.5f); GameObject val2 = Object.Instantiate(ImportLoader.GetVoidAura(), pos + new Vector3(-2f, 2.5f, 0f), Quaternion.Euler(0f, 0f, 180f)); GameObject val3 = Object.Instantiate(ImportLoader.GetVoidAura(), pos + new Vector3(-2f, -2f, 0f), Quaternion.identity); GameObject[] array = (GameObject[])(object)new GameObject[2] { val2, val3 }; foreach (GameObject val4 in array) { val4.transform.localScale = new Vector3(0.23f, 2f, 2f); Object.Destroy((Object)(object)((Component)val4.transform.Find("Edge R")).gameObject); Object.Destroy((Object)(object)((Component)val4.transform.Find("Edge L")).gameObject); val4.transform.SetParent(val.transform); val4.SetActive(true); } return val; } private void ApplyAllModifiers() { AllModifiers = new List(14) { new SpeedModifier(_control, LLaceAnim), new TripleSlashModifier(_control, voidhole1), new WhipsModifier(_control, whipG, whipA, voidhole1), new GroundTendrilsModifier(_control), new AttackChoiceModifier(_control), new JumpSlashModifier(_control, LLace, glob), new ChargeModifier(_control, voidhole1), new CircleSlashModifier(_control, _bullet), new SpitModifier(_control, voidhole1), new ShootModifier(_control, _bullet, voidhole1), new TitleModifier(_title, title), new VoidHole(voidhole1), new VoidRain(_control, glob, abysswave), new VoidWebs(_control, web) }; foreach (ModifierBase allModifier in AllModifiers) { allModifier.StartModifier(); } _control.GetState("P2 Shift 1").AddMethod(delegate { foreach (ModifierBase allModifier2 in AllModifiers) { allModifier2.Phase2Modifier(); } }); _control.GetState("P3 Roar").AddMethod(delegate { foreach (ModifierBase allModifier3 in AllModifiers) { allModifier3.Phase3Modifier(); } }); _control.GetState("P4 Shift 1").AddMethod(delegate { foreach (ModifierBase allModifier4 in AllModifiers) { allModifier4.Phase4Modifier(); } }); } [IteratorStateMachine(typeof(d__19))] private IEnumerator Health() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__19(0) { <>4__this = this }; } } internal class ImportLoader : MonoBehaviour { [CompilerGenerated] private sealed class d__8 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public ImportLoader <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__8(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 = AssetManager.LoadBundleAssets(); <>1__state = 1; return true; case 1: <>1__state = -1; voidaura = ((Component)AssetManager.Get("Boss Scene").transform.Find("Soul_Snare").Find("Void Portal").Find("Hole")).gameObject; voidsound = AssetManager.Get("Black Thread Start Enemy Effect"); voidhole = AssetManager.Get("Abyss Mass"); voidholeanim = AssetManager.Get("Abyss Mass Anim"); webaudio = AssetManager.Get("silk_boss_web_attack_buildup"); webaudio2 = AssetManager.Get("silk_boss_web_attack_burst"); Object.Destroy((Object)(object)((Component)voidaura.transform.Find("Hole")).gameObject); Object.Destroy((Object)(object)((Component)voidaura.transform.Find("Pt Shade")).gameObject); Object.Destroy((Object)(object)((Component)voidaura.transform.Find("abyss_water_top")).gameObject); Object.Destroy((Object)(object)((Component)voidhole.transform.Find("Enemy Physics Pusher (Abyss Mass)")).gameObject); Object.Destroy((Object)(object)voidhole.GetComponent()); voidauraanim = AssetManager.Get("abyss_water_70_percent0001"); voidaura.GetComponent().runtimeAnimatorController = voidauraanim; voidhole.GetComponent().Library = voidholeanim.GetComponent(); <>4__this.ApplyTextureToTk2dSprite(voidhole, holeTex); Debug.Log((object)"EVERYTHING loaded in!"); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } internal static GameObject? voidaura; internal static GameObject? voidsound; internal static GameObject? voidhole; internal static GameObject voidholeanim; internal static AudioClip webaudio; internal static AudioClip webaudio2; internal static RuntimeAnimatorController voidauraanim; internal static Texture2D holeTex = ImageUtil.GetTextureFromResources("voidhole.png"); [IteratorStateMachine(typeof(d__8))] private IEnumerator Start() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__8(0) { <>4__this = this }; } internal static GameObject GetVoidAura() { return voidaura; } internal static GameObject GetVoidSound() { return voidsound; } internal static GameObject GetVoidHole() { return voidhole; } internal static AudioClip GetWebAudio() { return webaudio; } internal static AudioClip GetWebAudio2() { return webaudio2; } private void OnDestroy() { AssetManager.UnloadManualBundles(); } private void ChangeTextures(GameObject target, Texture2D texture) { tk2dSprite component = ((Component)this).GetComponent(); tk2dSpriteCollectionData collection = ((tk2dBaseSprite)component).Collection; for (int i = 0; i < collection.materials.Length; i++) { collection.materials[i].mainTexture = (Texture)(object)AssetManager.Get($"atlas{i}"); } } public void ApplyTextureToTk2dSprite(GameObject target, Texture2D texture) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown tk2dSprite component = target.GetComponent(); tk2dSpriteCollectionSize component2 = ((Component)component).GetComponent(); ((tk2dBaseSprite)component).CurrentSprite.material.mainTexture = (Texture)(object)texture; Material material = new Material(Shader.Find("tk2d/BlendVertexColor")) { mainTexture = (Texture)(object)texture }; ((Component)component).GetComponent().material = material; ((tk2dBaseSprite)component).ForceBuild(); } } [BepInPlugin("FraudLace", "FraudLace", "1.0.0")] public class Plugin : BaseUnityPlugin { private static Harmony _harmony; 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 FraudLace (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 FraudLace.Patches { internal static class LanguagePatches { [HarmonyPostfix] [HarmonyPatch(typeof(Language), "Get", new Type[] { typeof(string), typeof(string) })] private static void ChangeLLaceTitle(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 == "LOST_LACE_MAIN") { LanguageCode val = Language.CurrentLanguage(); if (1 == 0) { } string text = (((int)val == 44) ? "Fraud Lace" : (((int)val != 117) ? __result : "중2병에 빠진 레이스")); if (1 == 0) { } text2 = text; } else { text2 = __result; } if (1 == 0) { } __result = text2; } } internal static class MainPatches { [CompilerGenerated] private sealed class d__9 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IEnumerator result; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__9(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 GameObject mothersilk; internal static GameObject LostLace; internal static GameObject bullet; internal static GameObject gtendril; 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 PatchLostLace(GameManager __instance) { GameManager __instance2 = __instance; __instance2.GetSaveStatsForSlot(PlayerData.instance.profileID, (Action)delegate { ((Component)__instance2).gameObject.AddComponent(); _harmony.PatchAll(typeof(LanguagePatches)); }); } [HarmonyPrefix] [HarmonyPatch(typeof(PlayMakerFSM), "Start")] private static void ModifyLace(PlayMakerFSM __instance) { if (((Object)__instance).name == "Lost Lace Boss" && !Object.op_Implicit((Object)(object)((Component)__instance).gameObject.GetComponent())) { ((Component)__instance).gameObject.AddComponent(); LostLace = ((Component)__instance).gameObject; mothersilk = ((Component)((Component)__instance).gameObject.transform.parent.Find("Abyss_Cocoon_Silk")).gameObject; } if (((Object)__instance).name.Contains("Lost Lace Summon Bullet") && !Object.op_Implicit((Object)(object)((Component)__instance).gameObject.GetComponent())) { bullet = ((Component)__instance).gameObject; ((Component)__instance).gameObject.AddComponent(); } if (((Object)__instance).name.Contains("Lost Lace Ground Tendril") && !Object.op_Implicit((Object)(object)gtendril)) { gtendril = ((Component)__instance).gameObject; } } [IteratorStateMachine(typeof(d__9))] [HarmonyPostfix] [HarmonyPatch(typeof(GameManager), "ReturnToMainMenu")] private static IEnumerator Unpatch(IEnumerator result) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__9(0) { result = result }; } } } namespace FraudLace.Modifiers { internal class AttackChoiceModifier : ModifierBase { [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] private PlayMakerFSM <_control>P; public AttackChoiceModifier(PlayMakerFSM _control) { <_control>P = _control; base..ctor(); } internal override void StartModifier() { FsmState state = <_control>P.GetState("Attack Choice"); state.RemoveAction(11); state.GetAction(10).activeBool = FsmBool.op_Implicit(false); } internal override void Phase2Modifier() { } internal override void Phase3Modifier() { } internal override void Phase4Modifier() { } } internal class ChargeModifier : ModifierBase { [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] private PlayMakerFSM <_control>P; [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] private GameObject P; public ChargeModifier(PlayMakerFSM _control, GameObject voidhole) { <_control>P = _control; P = voidhole; base..ctor(); } internal override void StartModifier() { FsmInt intVariable = <_control>P.GetIntVariable("Charges Performed"); FsmInt val = <_control>P.AddIntVariable("Charge Count"); FsmFloat val2 = <_control>P.AddFloatVariable("Charge Speed"); FsmFloat floatVariable = <_control>P.GetFloatVariable("Charge Time"); val.value = 4; FsmState state = <_control>P.GetState("Charge Break"); FsmState state2 = <_control>P.AddState("Long Charge"); FsmState state3 = <_control>P.AddState("Quick Charge"); state2.AddTransition("FINISHED", "Charge"); state3.AddTransition("FINISHED", "Charge"); FsmEvent val3 = state.AddTransition("L", "Long Charge"); FsmEvent val4 = state.AddTransition("R", "Quick Charge"); state.InsertAction(1, ActionUtil.SimpleRandomEvent((FsmEvent[])(object)new FsmEvent[2] { val3, val4 }, (FsmFloat[])(object)new FsmFloat[2] { FsmFloat.op_Implicit(0.5f), FsmFloat.op_Implicit(0.5f) }, (FsmInt[])(object)new FsmInt[2] { FsmInt.op_Implicit(1), FsmInt.op_Implicit(1) }, (FsmInt[])(object)new FsmInt[2] { FsmInt.op_Implicit(1), FsmInt.op_Implicit(1) }, <_control>P.GetBoolVariable("Phase 2"))); state2.AddActions(ActionUtil.IntSetter(val, FsmInt.op_Implicit(4)), ActionUtil.FloatSetter(floatVariable, FsmFloat.op_Implicit(0.5f))); state3.AddActions(ActionUtil.IntSetter(val, FsmInt.op_Implicit(8)), ActionUtil.FloatSetter(floatVariable, FsmFloat.op_Implicit(0.15f))); FsmEvent fsmEvent = FsmEvent.GetFsmEvent("COMBO"); FsmEvent fsmEvent2 = FsmEvent.GetFsmEvent("FINISHED"); <_control>P.GetState("Charge Crossup?").RemoveAction(2); <_control>P.GetState("Cross To New Move?").RemoveAction(0); <_control>P.GetState("Charge Crossup?").InsertAction(2, ActionUtil.IntComparer(intVariable, val, fsmEvent, fsmEvent, null)); <_control>P.GetState("Cross To New Move?").InsertAction(0, ActionUtil.IntComparer(intVariable, val, fsmEvent2, null, fsmEvent2)); <_control>P.GetState("Charge").GetAction(0).speed = FsmFloat.op_Implicit(100f); <_control>P.GetState("Crossup Antic").RemoveAction(3); Debug.Log((object)"Charge Edit Done!"); } internal override void Phase2Modifier() { } internal override void Phase3Modifier() { <_control>P.GetState("Will Counter?").AddMethod(delegate { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) float x = HeroController.instance.transform.position.x; float x2 = P.transform.position.x; P.GetComponent().linearDamping = 0.5f; P.GetComponent().AddForce(new Vector2((x - x2) * 0.5f, 0f), (ForceMode2D)1); }); } internal override void Phase4Modifier() { } } internal class CircleSlashModifier : ModifierBase { [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] private PlayMakerFSM <_bullet>P; private GameObject circle; internal int phase; public CircleSlashModifier(PlayMakerFSM _control, PlayMakerFSM _bullet) { <_bullet>P = _bullet; base..ctor(); } internal override void StartModifier() { <_bullet>P.GetState("Catcher Start").InsertAction(4, (FsmStateAction)(object)new InvokeMethod(BlackSlash)); <_bullet>P.GetState("Remaining Catchers").InsertAction(10, (FsmStateAction)(object)new InvokeMethod(BlackSlash)); <_bullet>P.GetState("Remaining Catchers").InsertAction(6, (FsmStateAction)(object)new InvokeMethod(BlackSlash)); <_bullet>P.GetState("Remaining Catchers").InsertAction(2, (FsmStateAction)(object)new InvokeMethod(BlackSlash)); void BlackSlash() { GameObject value = <_bullet>P.fsm.GetFsmGameObject("Projectile").value; if (!Object.op_Implicit((Object)(object)value.GetComponent())) { value.AddComponent(); } if (Object.op_Implicit((Object)(object)value.GetComponent())) { value.GetComponent().Dimmer(phase); } } } internal override void Phase2Modifier() { phase++; } internal override void Phase3Modifier() { phase++; } internal override void Phase4Modifier() { phase++; } } internal class BlackSlasher : MonoBehaviour { private SpriteRenderer circle1; private SpriteRenderer circle2; private SpriteRenderer circle3; private void Awake() { //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) circle1 = ((Component)((Component)this).gameObject.transform.Find("pointer glow")).gameObject.GetComponent(); circle2 = ((Component)((Component)this).gameObject.transform.Find("pointer glow").Find("haze2")).gameObject.GetComponent(); circle3 = ((Component)((Component)this).gameObject.transform.Find("cross slash range")).gameObject.GetComponent(); circle1.color = Color.black; circle2.color = Color.black; circle3.color = Color.black; Object.Destroy((Object)(object)((Component)((Component)this).gameObject.transform.Find("pointer glow").Find("Burst")).gameObject); } internal void Dimmer(int phase) { if (phase == 1) { ((Component)((Component)this).gameObject.transform.Find("pointer glow")).gameObject.SetActive(false); } if (phase == 2) { ((Component)((Component)this).gameObject.transform.Find("pointer glow")).gameObject.SetActive(true); ((Component)((Component)this).gameObject.transform.Find("cross slash range")).gameObject.SetActive(false); } if (phase == 3) { ((Component)((Component)this).gameObject.transform.Find("cross slash range")).gameObject.SetActive(false); ((Component)((Component)this).gameObject.transform.Find("pointer glow")).gameObject.SetActive(false); } } } internal class SpitModifier : ModifierBase { [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] private PlayMakerFSM <_control>P; [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] private GameObject P; private FsmState? Fire; public SpitModifier(PlayMakerFSM _control, GameObject voidhole) { <_control>P = _control; P = voidhole; base..ctor(); } internal override void StartModifier() { FsmState? state = <_control>P.GetState("Vomit Start"); if (state != null) { state.GetAction(3).intValue = FsmInt.op_Implicit(Constants.globcount); } Fire = <_control>P.GetState("Vomit Fire"); Fire.GetAction(8).add = FsmFloat.op_Implicit(4.5f); Fire.GetAction(9).add = FsmFloat.op_Implicit(-4.5f); Fire.GetAction(11).time = FsmFloat.op_Implicit(0.03f); } internal override void Phase2Modifier() { Fire.InsertAction(0, ActionUtil.RandomFloatSetter(<_control>P.fsm.GetFsmFloat("Velocity Y"), 18f, 28f)); Debug.Log((object)"GlobSpit P2"); } internal override void Phase3Modifier() { Fire.AddActions(ActionUtil.EventSender(FsmGameObject.op_Implicit(P), FsmString.op_Implicit("VOMIT"))); } internal override void Phase4Modifier() { } } internal class GroundTendrilsModifier : ModifierBase { [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] private PlayMakerFSM <_control>P; private FsmBool T2; public GroundTendrilsModifier(PlayMakerFSM _control) { <_control>P = _control; base..ctor(); } internal override void StartModifier() { FsmState? state = <_control>P.GetState("Summon Tendril"); if (state != null) { state.GetAction(1).intValue = FsmInt.op_Implicit(Constants.tendrilcount); } FsmState? state2 = <_control>P.GetState("Summon Loop"); if (state2 != null) { state2.GetAction(0).addMin = FsmFloat.op_Implicit(-7f); } FsmState? state3 = <_control>P.GetState("Summon Loop"); if (state3 != null) { state3.GetAction(0).addMax = FsmFloat.op_Implicit(-7f); } FsmState? state4 = <_control>P.GetState("Summon Loop"); if (state4 != null) { state4.GetAction(3).addMin = FsmFloat.op_Implicit(7f); } FsmState? state5 = <_control>P.GetState("Summon Loop"); if (state5 != null) { state5.GetAction(3).addMax = FsmFloat.op_Implicit(7f); } FsmState state6 = <_control>P.AddState("Tendril Again?"); FsmState state7 = <_control>P.AddState("Tendril Again Delay"); T2 = <_control>P.fsm.AddBoolVariable("Tendril Two"); T2.value = true; FsmEvent val = state6.AddTransition("FINISHED", "Attack Choice"); FsmEvent val2 = state6.AddTransition("RETENDRIL", "Tendril Again Delay"); FsmEvent val3 = state7.AddTransition("FINISHED", "Summon Tendril"); <_control>P.ChangeTransition("Summon Thwip", "FINISHED", "Tendril Again?"); state6.AddActions(ActionUtil.SimpleRandomEvent((FsmEvent[])(object)new FsmEvent[2] { val, val2 }, (FsmFloat[])(object)new FsmFloat[2] { FsmFloat.op_Implicit(0.5f), FsmFloat.op_Implicit(0.5f) }, (FsmInt[])(object)new FsmInt[2] { FsmInt.op_Implicit(1), FsmInt.op_Implicit(1) }, (FsmInt[])(object)new FsmInt[2] { FsmInt.op_Implicit(1), FsmInt.op_Implicit(1) }, T2)); state7.AddAction(ActionUtil.Waiter(0.75f)); } internal override void Phase2Modifier() { T2.value = true; } internal override void Phase3Modifier() { } internal override void Phase4Modifier() { } } internal class JumpSlashModifier : ModifierBase { [CompilerGenerated] private sealed class d__8 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public JumpSlashModifier <>4__this; private int 5__1; private GameObject 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__8(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = 0; break; case 1: <>1__state = -1; 5__2 = Object.Instantiate(<>4__this.P, <>4__this.P.transform.position, Quaternion.identity); 5__2.SetActive(true); 5__2 = null; 5__1++; break; } if (5__1 < 4) { <>2__current = (object)new WaitForSeconds(0.2f); <>1__state = 1; return true; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] private PlayMakerFSM <_control>P; [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] private GameObject P; [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] private GameObject P; public JumpSlashModifier(PlayMakerFSM _control, GameObject lace, GameObject glob) { <_control>P = _control; P = lace; P = glob; base..ctor(); } internal override void StartModifier() { FsmState state = <_control>P.GetState("J Slash Multi"); state.GetAction(7).speed = FsmFloat.op_Implicit(100f); state.AddAction((FsmStateAction)(object)new InvokeCoroutine(JumpGlobspawn, wait: false)); <_control>P.GetState("Downstab").GetAction(0).speed = FsmFloat.op_Implicit(80f); } internal override void Phase2Modifier() { <_control>P.GetState("Downstab Land").ChangeTransition("FINISHED", "Slam"); } internal override void Phase3Modifier() { } internal override void Phase4Modifier() { } [IteratorStateMachine(typeof(d__8))] private IEnumerator JumpGlobspawn() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__8(0) { <>4__this = this }; } } internal class ShootModifier : ModifierBase { [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] private PlayMakerFSM <_control>P; [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] private PlayMakerFSM <_bullet>P; [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] private GameObject P; private int bulletcount; public ShootModifier(PlayMakerFSM _control, PlayMakerFSM _bullet, GameObject voidhole) { <_control>P = _control; <_bullet>P = _bullet; P = voidhole; bulletcount = 20; base..ctor(); } internal override void StartModifier() { <_bullet>P.GetState("Set Amount").GetAction(0).intValue = FsmInt.op_Implicit(bulletcount); <_bullet>P.GetState("Start Pause").GetAction(0).time = FsmFloat.op_Implicit(Constants.bulletdelay); <_bullet>P.GetState("Repeat Pause").GetAction(0).time = FsmFloat.op_Implicit(Constants.bulletdelay); } internal override void Phase2Modifier() { bulletcount = 15; <_bullet>P.GetState("Set Pos").GetAction(0).min = FsmFloat.op_Implicit(8f); } internal override void Phase3Modifier() { <_control>P.GetState("Bullet S Type").RemoveAction(1); <_control>P.GetState("Bullet S Type").InsertAction(0, ActionUtil.EventSender(FsmGameObject.op_Implicit(P), FsmString.op_Implicit("SHOT"))); } internal override void Phase4Modifier() { } } [RequireComponent(typeof(PlayMakerFSM))] internal class Bullets : MonoBehaviour { private void Awake() { FsmState state = FSMUtility.LocateMyFSM(((Component)this).gameObject, "Control").GetState("Antic"); state.GetAction(1).time = FsmFloat.op_Implicit(0.5f); state.GetAction(2).offsetY = FsmFloat.op_Implicit(0f); state.GetAction(2).pause = FsmFloat.op_Implicit(0.4f); } } internal class SpeedModifier : ModifierBase { [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] private PlayMakerFSM <_control>P; [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] private tk2dSpriteAnimator <_anim>P; public SpeedModifier(PlayMakerFSM _control, tk2dSpriteAnimator _anim) { <_control>P = _control; <_anim>P = _anim; base..ctor(); } internal override void StartModifier() { string[] array = new string[15] { "Charge Antic", "Charge", "Quick Slash", "Combo Slash Triple", "Downstab Antic Q", "Tendril Whip G", "Tendril Whip End G", "Cast Roar", "Tendril Summon", "CrossSlash Antic", "Stomp Antic", "Stomp End", "Downstab End", "Fireball Cast A", "Fireball Cast G" }; foreach (string text in array) { tk2dSpriteAnimationClip clipByName = <_anim>P.Library.GetClipByName(text); if (clipByName != null) { clipByName.fps = 24f; } } string[] array2 = new string[8] { "Rising Slash Multi", "Dive In Ground", "Dive Out Ground", "Evade", "Forward Hop", "Quick Slash", "Combo Slash Triple", "Charge Crossup" }; foreach (string text2 in array2) { tk2dSpriteAnimationClip clipByName2 = <_anim>P.Library.GetClipByName(text2); if (clipByName2 != null) { clipByName2.fps = 36f; } } <_control>P.fsm.GetFsmFloat("Idle Time").Value = Constants.commondelay; <_control>P.RemoveAction("P2 Shift 1", 4); <_control>P.RemoveAction("P3 Start", 10); <_control>P.RemoveAction("P4 Shift 1", 4); <_control>P.GetState("Charge Antic").GetAction(7).time = FsmFloat.op_Implicit(Constants.commondelay); <_control>P.GetState("Charge Break").GetAction(1).time = FsmFloat.op_Implicit(Constants.chargedelay); <_control>P.GetState("Vomit Cooldown").GetAction(0).time = FsmFloat.op_Implicit(Constants.commondelay); <_control>P.GetState("Vomit Start").GetAction(2).time = FsmFloat.op_Implicit(Constants.commondelay); <_control>P.GetState("Bounce Back").GetAction(6).gravityScale = FsmFloat.op_Implicit(Constants.fasterfall); <_control>P.GetState("CS Antic").GetAction(3).time = FsmFloat.op_Implicit(Constants.commondelay); <_control>P.GetState("CS Summon").GetAction(3).time = FsmFloat.op_Implicit(Constants.commondelay); } internal override void Phase2Modifier() { } internal override void Phase3Modifier() { } internal override void Phase4Modifier() { } } internal class TripleSlashModifier : ModifierBase { [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] private PlayMakerFSM <_control>P; public TripleSlashModifier(PlayMakerFSM _control, GameObject voidhole) { <_control>P = _control; base..ctor(); } internal override void StartModifier() { FsmState state = <_control>P.AddState("Slash Again?"); FsmEvent val = state.AddTransition("FINISHED", "Will Counter?"); FsmEvent val2 = state.AddTransition("RESLASH", "ComboSlash 1"); <_control>P.ChangeTransition("ComboSlash 7", "FINISHED", "Slash Again?"); <_control>P.ChangeTransition("Combo Strike Finisher", "FINISHED", "Slash Again?"); state.AddAction(ActionUtil.SimpleRandomEvent((FsmEvent[])(object)new FsmEvent[2] { val, val2 }, (FsmFloat[])(object)new FsmFloat[2] { FsmFloat.op_Implicit(0.7f), FsmFloat.op_Implicit(0.3f) }, (FsmInt[])(object)new FsmInt[2] { FsmInt.op_Implicit(1), FsmInt.op_Implicit(1) }, (FsmInt[])(object)new FsmInt[2] { FsmInt.op_Implicit(1), FsmInt.op_Implicit(1) }, FsmBool.op_Implicit(false))); } internal override void Phase2Modifier() { } internal override void Phase3Modifier() { } internal override void Phase4Modifier() { } } internal class VoidRain : ModifierBase { [CompilerGenerated] private sealed class d__8 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public VoidRain <>4__this; private int 5__1; private float 5__2; private float 5__3; private GameObject 5__4; private GameObject 5__5; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__8(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__4 = null; 5__5 = null; <>1__state = -2; } private bool MoveNext() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = 0; break; case 1: <>1__state = -1; 5__2 = Random.Range(3f, 28f); 5__3 = Random.Range(28f, 55f); 5__4 = Object.Instantiate(<>4__this.P, new Vector3(5__2, 10f + 3f * Mathf.Sqrt(5__2 - 3f), 0f), Quaternion.identity); 5__4.GetComponent().gravityScale = 0.3f; 5__4.SetActive(true); 5__5 = Object.Instantiate(<>4__this.P, new Vector3(5__3, 10f + 3f * Mathf.Sqrt(56f - 5__2), 0f), Quaternion.identity); 5__5.GetComponent().gravityScale = 0.3f; 5__5.SetActive(true); 5__4 = null; 5__5 = null; 5__1++; break; } if (5__1 < 40) { <>2__current = (object)new WaitForSeconds(0.15f); <>1__state = 1; return true; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] private PlayMakerFSM <_control>P; [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] private GameObject P; [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] private GameObject P; public VoidRain(PlayMakerFSM _control, GameObject glob, GameObject waver) { <_control>P = _control; P = glob; P = waver; base..ctor(); } internal override void StartModifier() { Debug.Log((object)"Rain Modify start"); FsmInt val = <_control>P.fsm.AddIntVariable("raindrops"); FsmFloat val2 = <_control>P.fsm.AddFloatVariable("rainx"); FsmState state = <_control>P.GetState("Abyss Wave Start"); state.AddActions(new InvokeCoroutine(Rainspawn, wait: false)); } internal override void Phase2Modifier() { } internal override void Phase3Modifier() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) Transform transform = P.transform; transform.position += new Vector3(0f, -2f, 0f); } internal override void Phase4Modifier() { } [IteratorStateMachine(typeof(d__8))] private IEnumerator Rainspawn() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__8(0) { <>4__this = this }; } } internal class VoidWebs : ModifierBase { [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] private PlayMakerFSM <_control>P; [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] private GameObject P; private PlayMakerFSM webcontrol; private int webcounter; private int webmax; private GameObject audio; private AudioClip webaudio; private Audioplayer player; public VoidWebs(PlayMakerFSM _control, GameObject webs) { <_control>P = _control; P = webs; webcounter = 4; webmax = 3; player = new Audioplayer(); base..ctor(); } internal override void StartModifier() { //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) webaudio = ImportLoader.GetWebAudio(); audio = ObjectPool.instance.startupPools.First((StartupPool o) => ((Object)o.prefab).name == "Audio Player Actor").prefab; for (int i = 0; i < 5; i++) { Transform child = P.transform.GetChild(i); if (((Object)child).name.Contains("Lost_Lace_Black_Thread_Appear_Set")) { FsmState state = FSMUtility.LocateMyFSM(((Component)child).gameObject, "Control").GetState("Attack"); state.GetAction(2).min = FsmFloat.op_Implicit(-10f); state.GetAction(2).max = FsmFloat.op_Implicit(10f); Transform val = child.Find("Thread_Parent"); float y = val.position.y; val.position = new Vector3(3f + (float)i * 12f, y, 0f); for (int j = 0; j < 4; j++) { Transform child2 = val.GetChild(j); float y2 = child2.position.y; child2.position = new Vector3(3f + (float)i * 12f + (float)j * 3f, y2 - 2f, 0f); } Object.Destroy((Object)(object)((Component)val.GetChild(4)).gameObject); } } } internal override void Phase2Modifier() { P.SetActive(true); webcontrol = FSMUtility.LocateMyFSM(P, "Control"); FsmState state = <_control>P.GetState("To Attack"); state.InsertAction(0, (FsmStateAction)(object)new InvokeMethod(Websender)); void Websender() { //IL_005f: Unknown result type (might be due to invalid IL or missing references) webcounter++; if (webcounter > webmax && <_control>P.GetStringVariable("Next Event").value != "CROSS SLASH") { player.PlayOneShot(audio, new Vector3(10f, 30f, 0f), webaudio); webcontrol.SendEvent("ATTACK"); webcounter = Random.Range(0, 2); } } } internal override void Phase3Modifier() { webmax = 4; } internal override void Phase4Modifier() { } } internal class WhipsModifier : ModifierBase { [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] private PlayMakerFSM <_control>P; [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] private GameObject P; [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] private GameObject P; [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] private GameObject P; private FsmState Gwhip; private FsmState Awhip; public WhipsModifier(PlayMakerFSM _control, GameObject whipG, GameObject whipA, GameObject voidhole) { <_control>P = _control; P = whipG; P = whipA; P = voidhole; base..ctor(); } internal override void StartModifier() { //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) Gwhip = <_control>P.GetState("Tendril G Whip"); Awhip = <_control>P.GetState("Tendril A Whip"); for (int i = 1; i < 4; i++) { GameObject val = Object.Instantiate(P, P.transform); Gwhip.AddAction(ActionUtil.GOActivator(val, sw: true)); val.transform.Rotate(new Vector3(0f, 0f, 90f * (float)i)); GameObject val2 = Object.Instantiate(P, P.transform); Awhip.AddAction(ActionUtil.GOActivator(val2, sw: true)); val2.transform.Rotate(new Vector3(0f, 0f, 90f * (float)i + 45f)); } } internal override void Phase2Modifier() { } internal override void Phase3Modifier() { Gwhip.AddActions(ActionUtil.EventSender(FsmGameObject.op_Implicit(P), FsmString.op_Implicit("WHIP"))); Awhip.AddActions(ActionUtil.EventSender(FsmGameObject.op_Implicit(P), FsmString.op_Implicit("WHIP"))); } internal override void Phase4Modifier() { } } internal abstract class ModifierBase : MonoBehaviour { internal abstract void StartModifier(); internal abstract void Phase2Modifier(); internal abstract void Phase3Modifier(); internal abstract void Phase4Modifier(); } internal class TitleModifier : ModifierBase { [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] private PlayMakerFSM <_control>P; [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] private GameObject P; public TitleModifier(PlayMakerFSM _control, GameObject title) { <_control>P = _control; <title>P = title; base..ctor(); } internal override void StartModifier() { //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) GameObject titletext = ((Component)<title>P.transform.Find("Title Text").Find("Silk_Title_Text").Find("Title Main")).gameObject; GameObject voidefx = Object.Instantiate<GameObject>(ImportLoader.GetVoidSound(), titletext.transform); voidefx.transform.position = new Vector3(25f, 18f, 0f); voidefx.transform.localScale = new Vector3(3f, 3f, 3f); FsmState state = <_control>P.AddState("Turn Void"); FsmState state2 = <_control>P.AddState("Black Letter"); <_control>P.GetState("Title Up").GetAction<Wait>(1).time = FsmFloat.op_Implicit(0.8f); <_control>P.GetState("Title Up").ChangeTransition("FINISHED", "Turn Void"); state.AddTransition("FINISHED", "Black Letter"); state.AddAction(ActionUtil.Waiter(0.3f)); state.AddMethod(delegate { voidefx.SetActive(true); }); state2.AddMethod(delegate { //IL_000c: Unknown result type (might be due to invalid IL or missing references) ((Graphic)titletext.GetComponent<TextMeshPro>()).color = Color.black; }); state2.AddAction(ActionUtil.Waiter(1f)); state2.AddTransition("FINISHED", "Title Down"); } internal override void Phase2Modifier() { } internal override void Phase3Modifier() { } internal override void Phase4Modifier() { } } internal class VoidHole : ModifierBase { [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] private GameObject <voidhole>P; public VoidHole(GameObject voidhole) { <voidhole>P = voidhole; base..ctor(); } internal override void StartModifier() { } internal override void Phase2Modifier() { } internal override void Phase3Modifier() { <voidhole>P.AddComponent<VoidHoleAttack>(); <voidhole>P.SetActive(true); } internal override void Phase4Modifier() { <voidhole>P.AddComponent<VoidHoleExpansion>(); } } internal class VoidHoleAttack : MonoBehaviour { [CompilerGenerated] private sealed class <RadialShoot>d__12 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public VoidHoleAttack <>4__this; private float <spread>5__1; private int <times>5__2; private int <i>5__3; private float <deg>5__4; private float <rad>5__5; private GameObject <pellet>5__6; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <RadialShoot>d__12(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <pellet>5__6 = null; <>1__state = -2; } private bool MoveNext() { //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Expected O, but got Unknown //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; Debug.Log((object)"Trying to Shoot!"); <spread>5__1 = 0f + Random.Range(0f, 5f); <times>5__2 = 0; break; case 1: <>1__state = -1; <i>5__3 = 0; while (<i>5__3 < 18) { <deg>5__4 = (float)(<i>5__3 * 20) + <spread>5__1; <rad>5__5 = <deg>5__4 * (MathF.PI / 180f); <pellet>5__6 = Object.Instantiate<GameObject>(<>4__this.bullet, ((Component)<>4__this).gameObject.transform.position, Quaternion.Euler(0f, 0f, <deg>5__4)); <pellet>5__6.transform.localScale = new Vector3(0.7f, 0.7f, 0.7f); <pellet>5__6.SetActive(true); <pellet>5__6.GetComponent<Rigidbody2D>().linearVelocity = Vector2.op_Implicit(new Vector3(Mathf.Cos(<rad>5__5), Mathf.Sin(<rad>5__5), 0f) * 20f); <pellet>5__6.GetComponent<Rigidbody2D>().gravityScale = 0f; <pellet>5__6 = null; <i>5__3++; } <spread>5__1 += 10f; <times>5__2++; break; } if (<times>5__2 < 3) { <>2__current = (object)new WaitForSeconds(0.5f); <>1__state = 1; return true; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private PlayMakerFSM _control; private AudioClip spit; private GameObject tendril; private GameObject tendril2; private GameObject tendril3; private GameObject tendril4; private GameObject tendril5; private GameObject tendril6; private GameObject audio; private GameObject bullet; private Audioplayer player = new Audioplayer(); private void Awake() { //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Expected O, but got Unknown _control = FSMUtility.LocateMyFSM(((Component)this).gameObject, "Control"); GameObject val = GameObject.Find("GlobalPool(Clone)"); bullet = Object.Instantiate<GameObject>(((Component)val.transform.Find("Abyss Bullet(Clone)")).gameObject); GameObject[] tendrils = (GameObject[])(object)new GameObject[6] { tendril, tendril2, tendril3, tendril4, tendril5, tendril6 }; for (int i = 0; i < 6; i++) { tendrils[i] = Object.Instantiate<GameObject>(((Component)MainPatches.LostLace.transform.Find("Whip Attack G")).gameObject); } audio = ObjectPool.instance.startupPools.First((StartupPool o) => ((Object)o.prefab).name == "Audio Player Actor").prefab; spit = (AudioClip)FSMUtility.LocateMyFSM(((Component)val.transform.Find("Lost Lace Summon Bullet(Clone)")).gameObject, "Control").GetState("Fire").GetAction<PlayAudioEvent>(2) .audioClip.value; ((Component)this).gameObject.GetComponent<HealthManager>().hp = 9999; FsmState state = _control.GetState("Roar"); FsmState state2 = _control.GetState("Attack Type"); FsmState state3 = _control.GetState("Shot"); FsmState state4 = _control.GetState("Whip"); FsmState state5 = _control.GetState("Idle"); FsmState state6 = _control.GetState("Attack End"); _control.GetFloatVariable("Idle Time").value = 0.1f; state5.RemoveAction(1); state.RemoveAction(9); state.RemoveAction(5); state.RemoveAction(2); state5.ChangeTransition("FINISHED", "Attack Type"); state2.RemoveAction(2); state2.RemoveAction(1); _control.GetState("Dormant").AddTransition("FINISHED", "Wake"); state3.RemoveAction(0); state4.RemoveAction(2); state3.AddAction((FsmStateAction)(object)new InvokeCoroutine(RadialShoot, wait: true)); state4.AddMethod(delegate { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) float num = Random.Range(0f, 30f); player.PlayOneShot(audio, new Vector3(10f, 30f, 0f), spit); for (int k = 0; k < 6; k++) { float num2 = (float)(k * 60) + num; float num3 = num2 * (MathF.PI / 180f); GameObject val2 = tendrils[k]; val2.transform.position = ((Component)this).gameObject.transform.position; val2.transform.rotation = Quaternion.Euler(0f, 0f, num2); val2.transform.localScale = ((Component)this).gameObject.transform.localScale * 0.3f + new Vector3(0f, 1f, 0f); val2.SetActive(true); } }); state6.AddMethod(delegate { for (int j = 0; j < 6; j++) { tendrils[j].SetActive(false); } }); } [IteratorStateMachine(typeof(<RadialShoot>d__12))] private IEnumerator RadialShoot() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <RadialShoot>d__12(0) { <>4__this = this }; } } internal class VoidHoleExpansion : MonoBehaviour { [CompilerGenerated] private sealed class <>c__DisplayClass7_0 { public VoidHoleExpansion <>4__this; public HealthManager holehealth; public bool Prevented; public GameObject deatheffect; internal bool <ExpandUntilDoom>b__0() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) Transform transform = ((Component)<>4__this).gameObject.transform; transform.localScale += Vector3.one * 0.8f * Time.deltaTime; if (holehealth.hp < 250) { ((Component)<>4__this).gameObject.transform.localScale = new Vector3(2f, 2f, 2f); Prevented = true; deatheffect.SetActive(true); ((MonoBehaviour)<>4__this).StartCoroutine(<>4__this.DoomCooldown(initial: false)); holehealth.hp = 9999; return true; } return ((Component)<>4__this).gameObject.transform.localScale.x >= 99f; } } [CompilerGenerated] private sealed class <DoomCooldown>d__8 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public bool initial; public VoidHoleExpansion <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <DoomCooldown>d__8(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(initial ? 1f : Random.Range(18f, 20f)); <>1__state = 1; return true; case 1: <>1__state = -1; ((MonoBehaviour)<>4__this).StartCoroutine(<>4__this.ExpandUntilDoom()); 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 <ExpandUntilDoom>d__7 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public VoidHoleExpansion <>4__this; private <>c__DisplayClass7_0 <>8__1; private Animator <anim>5__2; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <ExpandUntilDoom>d__7(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = null; <anim>5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Expected O, but got Unknown //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>8__1 = new <>c__DisplayClass7_0(); <>8__1.<>4__this = <>4__this; <>8__1.holehealth = ((Component)<>4__this).gameObject.GetComponent<HealthManager>(); <>8__1.deatheffect = ((Component)((Component)<>4__this).gameObject.transform.Find("Death Effects")).gameObject; <>8__1.holehealth.hp = 400; <>8__1.Prevented = false; <>4__this.player.PlayOneShot(<>4__this.audio, new Vector3(10f, 30f, 0f), <>4__this.scream); <anim>5__2 = <>4__this.mothersilk.GetComponent<Animator>(); <anim>5__2.Play("ground_idle_to_scream"); Debug.Log((object)"Starting Doom Sequence..."); <>2__current = (object)new WaitUntil((Func<bool>)delegate { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) Transform transform = ((Component)<>8__1.<>4__this).gameObject.transform; transform.localScale += Vector3.one * 0.8f * Time.deltaTime; if (<>8__1.holehealth.hp < 250) { ((Component)<>8__1.<>4__this).gameObject.transform.localScale = new Vector3(2f, 2f, 2f); <>8__1.Prevented = true; <>8__1.deatheffect.SetActive(true); ((MonoBehaviour)<>8__1.<>4__this).StartCoroutine(<>8__1.<>4__this.DoomCooldown(initial: false)); <>8__1.holehealth.hp = 9999; return true; } return ((Component)<>8__1.<>4__this).gameObject.transform.localScale.x >= 99f; }); <>1__state = 1; return true; case 1: <>1__state = -1; if (<>8__1.Prevented) { <>2__current = (object)new WaitForSeconds(1f); <>1__state = 2; return true; } Debug.Log((object)"You just died!"); break; case 2: <>1__state = -1; <>8__1.deatheffect.SetActive(false); <anim>5__2.Play("ground_scream_to_idle"); break; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private PlayMakerFSM _control; private GameObject mothersilk; private GameObject audio; private AudioClip scream; private int holehealth; private Audioplayer player = new Audioplayer(); private void Awake() { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Expected O, but got Unknown mothersilk = MainPatches.mothersilk; scream = (AudioClip)FSMUtility.LocateMyFSM(MainPatches.LostLace, "Control").GetState("Wave Pause").GetAction<PlayAudioEvent>(2) .audioClip.value; audio = ObjectPool.instance.startupPools.First((StartupPool o) => ((Object)o.prefab).name == "Audio Player Actor").prefab; ((MonoBehaviour)this).StartCoroutine(DoomCooldown(initial: true)); } [IteratorStateMachine(typeof(<ExpandUntilDoom>d__7))] private IEnumerator ExpandUntilDoom() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <ExpandUntilDoom>d__7(0) { <>4__this = this }; } [IteratorStateMachine(typeof(<DoomCooldown>d__8))] private IEnumerator DoomCooldown(bool initial) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <DoomCooldown>d__8(0) { <>4__this = this, initial = initial }; } } }