Decompiled source of KnightInSilksong v0.6.0
KIS.dll
Decompiled a day ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text.RegularExpressions; using System.Threading.Tasks; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using GlobalEnums; using GlobalSettings; using HarmonyLib; using HutongGames.PlayMaker; using HutongGames.PlayMaker.Actions; using InControl; using KIS; using KIS.Utils; using Knight; using Microsoft.CodeAnalysis; using Newtonsoft.Json; using PrepatcherPlugin; using TMProOld; using TeamCherry.Localization; using ToJ; using UnityEngine; using UnityEngine.Audio; using UnityEngine.Events; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: IgnoresAccessChecksTo("Accessibility")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp-firstpass")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: IgnoresAccessChecksTo("Coffee.SoftMaskForUGUI")] [assembly: IgnoresAccessChecksTo("com.rlabrecque.steamworks.net")] [assembly: IgnoresAccessChecksTo("ConditionalExpression")] [assembly: IgnoresAccessChecksTo("GalaxyCSharp")] [assembly: IgnoresAccessChecksTo("Knight")] [assembly: IgnoresAccessChecksTo("Newtonsoft.Json")] [assembly: IgnoresAccessChecksTo("Newtonsoft.Json.UnityConverters.Addressables")] [assembly: IgnoresAccessChecksTo("Newtonsoft.Json.UnityConverters")] [assembly: IgnoresAccessChecksTo("Newtonsoft.Json.UnityConverters.Mathematics")] [assembly: IgnoresAccessChecksTo("PlayMaker")] [assembly: IgnoresAccessChecksTo("SharpDX.DirectInput")] [assembly: IgnoresAccessChecksTo("SharpDX")] [assembly: IgnoresAccessChecksTo("TeamCherry.BuildBot")] [assembly: IgnoresAccessChecksTo("TeamCherry.Cinematics")] [assembly: IgnoresAccessChecksTo("TeamCherry.Localization")] [assembly: IgnoresAccessChecksTo("TeamCherry.NestedFadeGroup")] [assembly: IgnoresAccessChecksTo("TeamCherry.SharedUtils")] [assembly: IgnoresAccessChecksTo("TeamCherry.Splines")] [assembly: IgnoresAccessChecksTo("TeamCherry.TK2D")] [assembly: IgnoresAccessChecksTo("Unity.Addressables")] [assembly: IgnoresAccessChecksTo("Unity.Burst")] [assembly: IgnoresAccessChecksTo("Unity.Burst.Unsafe")] [assembly: IgnoresAccessChecksTo("Unity.Collections")] [assembly: IgnoresAccessChecksTo("Unity.Collections.LowLevel.ILSupport")] [assembly: IgnoresAccessChecksTo("Unity.InputSystem")] [assembly: IgnoresAccessChecksTo("Unity.InputSystem.ForUI")] [assembly: IgnoresAccessChecksTo("Unity.Mathematics")] [assembly: IgnoresAccessChecksTo("Unity.MemoryProfiler")] [assembly: IgnoresAccessChecksTo("Unity.Profiling.Core")] [assembly: IgnoresAccessChecksTo("Unity.Recorder.Base")] [assembly: IgnoresAccessChecksTo("Unity.Recorder")] [assembly: IgnoresAccessChecksTo("Unity.ResourceManager")] [assembly: IgnoresAccessChecksTo("Unity.ScriptableBuildPipeline")] [assembly: IgnoresAccessChecksTo("Unity.TextMeshPro")] [assembly: IgnoresAccessChecksTo("Unity.Timeline")] [assembly: IgnoresAccessChecksTo("UnityEngine.AMDModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.ARModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.NVIDIAModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.UI")] [assembly: IgnoresAccessChecksTo("XblPCSandbox")] [assembly: IgnoresAccessChecksTo("XGamingRuntime")] [assembly: IgnoresAccessChecksTo("zlib.net")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("KIS")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("0.6.0.0")] [assembly: AssemblyInformationalVersion("0.6.0+8019a2edf7d42d4a3b2650c103350776973ed3a0")] [assembly: AssemblyProduct("KIS")] [assembly: AssemblyTitle("KnightInSilkSong")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.6.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; } } } public class SendDreamImpact : FsmStateAction { [CompilerGenerated] private sealed class <DelayText>d__7 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public NeedolinTextOwner needolinTextOwner; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <DelayText>d__7(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; if ((Object)(object)needolinTextOwner == (Object)null) { return false; } needolinTextOwner.AddNeedolinText(); <>2__current = (object)new WaitForSeconds(0.2f); <>1__state = 1; return true; case 1: <>1__state = -1; NeedolinMsgBox._instance.ClearAllText(); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public FsmOwnerDefault target = new FsmOwnerDefault { ownerOption = (OwnerDefaultOption)1 }; private NeedolinTextOwner needolinTextOwner; public DreamHelper dreamHelper = ((Component)HeroController.instance).GetComponent<DreamHelper>(); public override void Reset() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown ((FsmStateAction)this).Reset(); target = new FsmOwnerDefault(); } public override void OnEnter() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) ((FsmStateAction)this).OnEnter(); target.ownerOption = (OwnerDefaultOption)1; target.gameObject = base.fsm.GetVariable<FsmGameObject>("Collider"); GameObject safe = FSMUtility.GetSafe(target, (FsmStateAction)(object)this); ("ONENTER " + (object)safe).LogInfo(); if ((Object)(object)safe != (Object)null) { HealthManager component = safe.GetComponent<HealthManager>(); if ((Object)(object)component != (Object)null) { safe.LogInfo(); if (!dreamHelper.Exist(component)) { DoDreamImpact(safe); dreamHelper.Add(component); } } } ((FsmStateAction)this).Finish(); } public void DoDreamImpact(GameObject safe) { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Expected O, but got Unknown int num = (PlayerData.instance.equippedCharm_30 ? 66 : 33); HeroController.instance.AddMPCharge(num); Recoil component = safe.GetComponent<Recoil>(); if ((Object)(object)component != (Object)null) { bool flag = HeroController.instance.transform.localScale.x <= 0f; component.RecoilByDirection((!flag) ? 2 : 0, 2f); } SpriteFlash component2 = safe.GetComponent<SpriteFlash>(); if ((Object)(object)component2 != (Object)null) { component2.flashDreamImpact(); } needolinTextOwner = safe.GetComponent<NeedolinTextOwner>(); if ((Object)(object)needolinTextOwner != (Object)null) { needolinTextOwner.OnAddText.AddListener(new UnityAction(RemoveText)); needolinTextOwner.AddNeedolinText(); } } private void RemoveText() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown needolinTextOwner.RemoveNeedolinText(); needolinTextOwner.OnAddText.RemoveListener(new UnityAction(RemoveText)); } [IteratorStateMachine(typeof(<DelayText>d__7))] public IEnumerator DelayText(NeedolinTextOwner needolinTextOwner) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <DelayText>d__7(0) { needolinTextOwner = needolinTextOwner }; } } public static class GameObjectUtils { public static T GetAddComponent<T>(this GameObject go) where T : Component { T val = go.GetComponent<T>(); if ((Object)(object)val == (Object)null) { val = go.AddComponent<T>(); } return val; } public static bool RemoveComponent<T>(this GameObject go) where T : Component { T component = go.GetComponent<T>(); if ((Object)(object)component != (Object)null) { Object.DestroyImmediate((Object)(object)component); return true; } return false; } public static T copyComponent<T>(this GameObject to, GameObject from) where T : Component { if ((Object)(object)from == (Object)null) { return default(T); } T component = from.GetComponent<T>(); T addComponent = to.GetAddComponent<T>(); if ((Object)(object)component == (Object)null) { return default(T); } FieldInfo[] fields = typeof(T).GetFields(BindingFlags.IgnoreCase | BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy | BindingFlags.InvokeMethod | BindingFlags.CreateInstance | BindingFlags.GetField | BindingFlags.SetField | BindingFlags.GetProperty | BindingFlags.SetProperty | BindingFlags.PutDispProperty | BindingFlags.PutRefDispProperty | BindingFlags.ExactBinding | BindingFlags.SuppressChangeType | BindingFlags.OptionalParamBinding | BindingFlags.IgnoreReturn); foreach (FieldInfo fieldInfo in fields) { fieldInfo.SetValue(addComponent, fieldInfo.GetValue(component)); } return addComponent; } public static void SetScale(this GameObject gameObject, float scaleX, float scaleY) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) Vector3 localScale = gameObject.transform.localScale; localScale.x = scaleX; localScale.y = scaleY; gameObject.transform.localScale = localScale; } public static GameObject FindGameObjectInChildren(this GameObject gameObject, string name, bool useBaseName = false) { if ((Object)(object)gameObject == (Object)null) { return null; } Transform[] componentsInChildren = gameObject.GetComponentsInChildren<Transform>(true); foreach (Transform val in componentsInChildren) { if (val.GetName(useBaseName) == name) { return ((Component)val).gameObject; } } return null; } public static List<GameObject> FindGameObjectsInChildren(this GameObject gameObject, string name, bool useBaseName = false) { if ((Object)(object)gameObject == (Object)null) { return null; } List<GameObject> list = new List<GameObject>(); Transform[] componentsInChildren = gameObject.GetComponentsInChildren<Transform>(true); foreach (Transform val in componentsInChildren) { if (val.GetName(useBaseName) == name) { list.Add(((Component)val).gameObject); } } return list; } public static void Log(this GameObject gameObject) { //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_008a: 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_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)gameObject == (Object)null) { return; } KnightInSilksong.logger.LogInfo((object)((Object)gameObject).GetName()); KnightInSilksong.logger.LogInfo((object)gameObject.GetPath()); KnightInSilksong.logger.LogInfo((object)("Layer : " + gameObject.layer)); ManualLogSource logger = KnightInSilksong.logger; Vector3 val = gameObject.transform.position; logger.LogInfo((object)("Position : " + ((object)(Vector3)(ref val)).ToString())); ManualLogSource logger2 = KnightInSilksong.logger; Quaternion rotation = gameObject.transform.rotation; logger2.LogInfo((object)("Rotation : " + ((object)(Quaternion)(ref rotation)).ToString())); ManualLogSource logger3 = KnightInSilksong.logger; val = gameObject.transform.localScale; logger3.LogInfo((object)("Scale : " + ((object)(Vector3)(ref val)).ToString())); Component[] components = gameObject.GetComponents<Component>(); foreach (Component val2 in components) { KnightInSilksong.logger.LogInfo((object)("Component : " + ((object)val2).GetType())); if (val2 is PlayMakerFSM) { KnightInSilksong.logger.LogInfo((object)("---- Fsm name :" + ((PlayMakerFSM)((val2 is PlayMakerFSM) ? val2 : null)).FsmName)); } } } public static void LogWithChildren(this GameObject gameObject) { if (!((Object)(object)gameObject == (Object)null)) { gameObject.Log(); Transform[] componentsInChildren = gameObject.GetComponentsInChildren<Transform>(true); for (int i = 0; i < componentsInChildren.Length; i++) { ((Component)componentsInChildren[i]).gameObject.Log(); } } } public static void PrintAllActiveGameObjectsInScene() { GameObject[] array = Object.FindObjectsByType<GameObject>((FindObjectsSortMode)0); for (int i = 0; i < array.Length; i++) { array[i].Log(); } } public static GameObject Find(this GameObject go, string name) { for (int i = 0; i < go.transform.childCount; i++) { GameObject gameObject = ((Component)go.transform.GetChild(i)).gameObject; if (((Object)gameObject).name == name) { return gameObject; } } for (int j = 0; j < go.transform.childCount; j++) { GameObject val = ((Component)go.transform.GetChild(j)).gameObject.Find(name); if ((Object)(object)val != (Object)null) { return val; } } return null; } public static void FindAllChildren(this GameObject go, List<GameObject> allGoList) { for (int i = 0; i < go.transform.childCount; i++) { allGoList.Add(((Component)go.transform.GetChild(i)).gameObject); } for (int j = 0; j < go.transform.childCount; j++) { ((Component)go.transform.GetChild(j)).gameObject.FindAllChildren(allGoList); } } public static void DisableChildren(this GameObject go) { for (int i = 0; i < go.transform.childCount; i++) { ((Component)go.transform.GetChild(i)).gameObject.SetActive(false); } } public static List<GameObject> GetAllGameObjects(this Scene scene) { List<GameObject> list = new List<GameObject>(); GameObject[] rootGameObjects = ((Scene)(ref scene)).GetRootGameObjects(); foreach (GameObject val in rootGameObjects) { list.Add(val); val.FindAllChildren(list); } return list; } public static GameObject GetGameObjectByName(this Scene scene, string name, bool useBaseName = false) { GameObject[] rootGameObjects = ((Scene)(ref scene)).GetRootGameObjects(); foreach (GameObject val in rootGameObjects) { if (val.GetName(useBaseName) == name) { return val; } GameObject val2 = val.FindGameObjectInChildren(name, useBaseName); if ((Object)(object)val2 != (Object)null) { return val2; } } return null; } public static GameObject[] GetRootGameObjects() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) Scene activeScene = SceneManager.GetActiveScene(); return ((Scene)(ref activeScene)).GetRootGameObjects(); } public static GameObject GetGameObjectInScene(string name, bool useBaseName = false) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return SceneManager.GetActiveScene().GetGameObjectByName(name, useBaseName); } public static List<GameObject> GetAllGameObjectsInScene() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return SceneManager.GetActiveScene().GetAllGameObjects(); } public static string GetName(this Transform transform, bool useBaseName = false) { return ((Component)transform).gameObject.GetName(useBaseName); } public static string GetName(this GameObject go, bool useBaseName = false) { string text = ((Object)go).name; if (useBaseName) { text = text.ToLower(); text.Replace("(clone)", ""); text = text.Trim(); text.Replace("cln", ""); text = text.Trim(); text = Regex.Replace(text, "\\([0-9+]+\\)", ""); text = text.Trim(); text = Regex.Replace(text, "[0-9+]+$", ""); text = text.Trim(); text.Replace("(clone)", ""); text = text.Trim(); } return text; } public static string GetPath(this GameObject go, bool useBaseName = false) { string text = go.GetName(useBaseName); GameObject val = go; while ((Object)(object)val.transform.parent != (Object)null && (Object)(object)((Component)val.transform.parent).gameObject != (Object)null) { val = ((Component)val.transform.parent).gameObject; text = val.GetName(useBaseName) + "/" + text; } return text; } } public enum Tool { Silk_Spear, Thread_Sphere, Parry, Silk_Charge, Silk_Bomb, Silk_Boss_Needle, Straight_Pin, Tri_Pin, Sting_Shard, Tack, Harpoon, Curve_Claws, Curve_Claws_Upgraded, Shakra_Ring, Pimpilo, Conch_Drill, WebShot_Forge, WebShot_Architect, WebShot_Weaver, Screw_Attack, Cogwork_Saw, Cogwork_Flier, Rosary_Cannon, Lightning_Rod, Flintstone, Silk_Snare, Flea_Brew, Lifeblood_Syringe, Extractor, Mosscreep_Tool_1, Mosscreep_Tool_2, Lava_Charm, Bell_Bind, Poison_Pouch, Fractured_Mask, Multibind, White_Ring, Brolly_Spike, Quickbind, Spool_Extender, Reserve_Bind, Dazzle_Bind, Dazzle_Bind_Upgraded, Revenge_Crystal, Thief_Claw, Zap_Imbuement, Quick_Sling, Maggot_Charm, Longneedle, Wisp_Lantern, Flea_Charm, Pinstress_Tool, Compass, Bone_Necklace, Rosary_Magnet, Weighted_Anklet, Barbed_Wire, Dead_Mans_Purse, Shell_Satchel, Magnetite_Dice, Scuttlebrace, Wallcling, Musician_Charm, Sprintmaster, Thief_Charm } public enum Charm { WaywardCompass = 2, GatheringSwarm = 1, StalwartShell = 4, SoulCatcher = 20, ShamanStone = 19, SoulEater = 21, Dashmaster = 31, Sprintmaster = 37, Grubsong = 3, GrubberflysElegy = 35, UnbreakableHeart = 23, UnbreakableGreed = 24, UnbreakableStrength = 25, SpellTwister = 33, SteadyBody = 14, HeavyBlow = 15, QuickSlash = 32, Longnail = 18, MarkOfPride = 13, FuryOfTheFallen = 6, ThornsOfAgony = 12, BaldurShell = 5, Flukenest = 11, DefendersCrest = 10, GlowingWomb = 22, QuickFocus = 7, DeepFocus = 34, LifebloodHeart = 8, LifebloodCore = 9, JonisBlessing = 27, Hiveblood = 29, SporeShroom = 17, SharpShadow = 16, ShapeOfUnn = 28, NailmastersGlory = 26, Weaversong = 39, DreamWielder = 30, Dreamshield = 38, Grimmchild = 40, VoidHeart = 36 } public static class KISHelper { public static Action OnReturnToMenu; public static Action OnQuitApp; internal const HeroDeathCocoonTypes knight_death_cocoon = 1073741824; public static string GetSaveDataDirectory(int slot) { return Path.Combine(Paths.ConfigPath, "shownyoung-KIS", "Slot" + slot); } public static Texture2D LoadTexture(Stream stream) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown byte[] array = new byte[stream.Length]; stream.Read(array, 0, array.Length); stream.Close(); Texture2D val = new Texture2D(2, 2); if (ImageConversion.LoadImage(val, array)) { return val; } return null; } public static Texture2D LoadTexture(string path) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown FileStream fileStream = new FileStream(path, FileMode.Open, FileAccess.Read); byte[] array = new byte[fileStream.Length]; fileStream.Read(array, 0, array.Length); fileStream.Close(); Texture2D val = new Texture2D(2, 2); if (ImageConversion.LoadImage(val, array)) { return val; } return null; } public static GameObject GetCurrentHero() { return FsmVariables.GlobalVariables.FindFsmGameObject("Hero").Value; } public static Component GetComponent(GameObject gameObject, string type) { return gameObject.GetComponent(type); } public static Component GetAnyComponent<T1, T2>(this GameObject gameObject) where T1 : Component where T2 : Component { T1 component = gameObject.GetComponent<T1>(); if ((Object)(object)component != (Object)null) { return (Component)(object)component; } T2 component2 = gameObject.GetComponent<T2>(); if ((Object)(object)component2 != (Object)null) { return (Component)(object)component2; } return null; } public static Component GetAnotherComponent(this Component monoBehaviour) { bool flag = false; string? fullName = ((object)monoBehaviour).GetType().FullName; if (fullName.StartsWith("Knight")) { flag = true; } string text = fullName.Split(".").Last(); if (!flag) { return ((Component)HeroController.instance).GetComponent(text); } return ((Component)HeroController.instance).GetComponent(text); } public static void LogInfo(this object msg) { if (KnightInSilksong.allowLog.Value) { KnightInSilksong.logger.LogInfo(msg); } } public static void LogWarning(this object msg) { if (KnightInSilksong.allowLog.Value) { KnightInSilksong.logger.LogWarning(msg); } } public static void LogError(this object msg) { if (KnightInSilksong.allowLog.Value) { KnightInSilksong.logger.LogError(msg); } } public static void LogDebug(this object msg) { if (KnightInSilksong.allowLog.Value) { KnightInSilksong.logger.LogDebug(msg); } } public static void LogFatal(this object msg) { if (KnightInSilksong.allowLog.Value) { KnightInSilksong.logger.LogFatal(msg); } } public static string GetToolName(this Tool tool) { return Enum.GetName(typeof(Tool), tool).Replace("_", " "); } public static string GetCharmName(this Charm charm) { int num = (int)charm; return "gotCharm_" + num; } public static void CheckForDamageHero(this HeroBox heroBox, GameObject gameObject) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Expected I4, but got Unknown //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) DamageHero component = gameObject.GetComponent<DamageHero>(); if (!((Object)(object)component != (Object)null) || heroBox.heroCtrl.cState.shadowDashing) { return; } heroBox.damageDealt = component.damageDealt; heroBox.hazardType = (int)component.hazardType; heroBox.damagingObject = gameObject; if (component.OverrideCollisionSide) { heroBox.collisionSide = component.CollisionSide; } else { float num = gameObject.transform.position.x; float num2 = ((Component)heroBox).transform.position.x; if (component.InvertCollisionSide) { float num3 = num2; float num4 = num; num = num3; num2 = num4; } heroBox.collisionSide = (CollisionSide)((!(num > num2)) ? 1 : 2); } if (!HeroBox.IsHitTypeBuffered(heroBox.hazardType)) { heroBox.ApplyBufferedHit(); } else { heroBox.isHitBuffered = true; } } } public abstract class IModule { public virtual void Init() { } public virtual void Unload() { } } internal static class ModuleManager { private static Dictionary<Type, IModule> modules = new Dictionary<Type, IModule>(); private static bool initialized = false; public static T GetInstance<T>() where T : IModule { if (modules.ContainsKey(typeof(T))) { return (T)modules[typeof(T)]; } return null; } public static void Init() { if (!initialized) { foreach (Type item in from t in Assembly.GetExecutingAssembly().GetTypes() where typeof(IModule).IsAssignableFrom(t) && !t.IsInterface && !t.IsAbstract select t) { try { modules.Add(item, (IModule)Activator.CreateInstance(item)); } catch { KnightInSilksong.logger.LogError((object)("Fail to Create " + item.FullName)); } } initialized = true; } foreach (KeyValuePair<Type, IModule> module in modules) { module.Value.Init(); } } public static void Unload() { foreach (KeyValuePair<Type, IModule> module in modules) { module.Value.Unload(); } } } public class MoreLanguge : IModule { public static Dictionary<(string, string), string> langs = new Dictionary<(string, string), string>(); public override void Init() { base.Init(); } } internal class PreProcess : IModule { public static PreProcess Instance; internal bool shader_initialized; private Dictionary<string, string> material_shader_map; private Dictionary<string, Shader> shaders = new Dictionary<string, Shader>(); public Sprite charm_icon; public HashSet<AudioMixer> share_mixer_group = new HashSet<AudioMixer>(); public PreProcess() { Instance = this; } public override void Init() { using (StreamReader streamReader = new StreamReader(Assembly.GetExecutingAssembly().GetManifestResourceStream("KIS.Resources.MaterialShaderMap.json"))) { string text = streamReader.ReadToEnd(); material_shader_map = JsonConvert.DeserializeObject<Dictionary<string, string>>(text); } charm_icon = KnightInSilksong.Instance.hk.LoadAsset<Sprite>("GG_bound_charm_prompt"); SceneManager.activeSceneChanged += CheckShaders; SSizeKnight(); SSizeHud(); SSizeCharm(); SSizetk2dCollectionData(); SetAuidoVolume(); } private void SSizetk2dCollectionData() { foreach (KeyValuePair<string, GameObject> loaded_go in KnightInSilksong.loaded_gos) { tk2dSpriteCollectionData[] componentsInChildren = loaded_go.Value.GetComponentsInChildren<tk2dSpriteCollectionData>(true); foreach (tk2dSpriteCollectionData obj in componentsInChildren) { obj.spriteCollectionName += "(Hollownest)"; ((Object)obj).name = obj.spriteCollectionName; } } } private void SSizeCharm() { if ((Object)(object)KnightInSilksong.Instance.charm == (Object)null) { return; } GameObject charm = KnightInSilksong.Instance.charm; Renderer[] componentsInChildren = charm.GetComponentsInChildren<Renderer>(true); foreach (Renderer obj in componentsInChildren) { obj.sortingGroupID = 1048575; obj.sortingLayerID = 59515797; } BuildEquippedCharms componentInChildren = charm.GetComponentInChildren<BuildEquippedCharms>(true); if ((Object)(object)componentInChildren != (Object)null) { foreach (GameObject gameObject in componentInChildren.gameObjectList) { componentsInChildren = gameObject.GetComponentsInChildren<Renderer>(true); foreach (Renderer obj2 in componentsInChildren) { obj2.sortingGroupID = 1048575; obj2.sortingLayerID = 59515797; } } } componentsInChildren = KnightInSilksong.loaded_gos["Charm Equip Msg"].GetComponentsInChildren<Renderer>(true); foreach (Renderer obj3 in componentsInChildren) { obj3.sortingGroupID = 1048575; obj3.sortingLayerID = 59515797; } } private void SSizeHud() { if (!((Object)(object)KnightInSilksong.Instance.hud_canvas == (Object)null)) { GameObject hud_canvas = KnightInSilksong.Instance.hud_canvas; ((Behaviour)FSMUtility.LocateMyFSM(hud_canvas, "Globalise")).enabled = true; hud_canvas.FindGameObjectInChildren("Geo Counter").SetActive(false); } } private void SSizeKnight() { if (!((Object)(object)KnightInSilksong.Instance.knight == (Object)null)) { GameObject knight = KnightInSilksong.Instance.knight; SetErrorCollider2D(); SetErrorFsm(); knight.GetComponent<tk2dSpriteAnimator>().Library.GetClipByName("Prostrate Rise").frames[1].triggerEvent = true; knight.GetComponent<tk2dSpriteAnimator>().Library.GetClipByName("Prostrate Rise").frames[18].triggerEvent = true; knight.GetComponent<Rigidbody2D>().constraints = (RigidbodyConstraints2D)4; knight.AddComponent<KeepHornet>(); knight.AddComponent<DreamHelper>(); KnightInSilksong.loaded_gos["Grimmchild"].tag = "Grimmchild"; KnightInSilksong.loaded_gos["Weaverling"].tag = "Weaverling"; KnightInSilksong.loaded_gos["Knight Hatchling"].tag = "Knight Hatchling"; KnightInSilksong.loaded_gos["Orbit Shield"].tag = "Orbit Shield"; } } private void CheckShaders(Scene arg0, Scene arg1) { SetShaders(); if (shaders.ContainsKey("Sprites/Default-ColorFlash") && !shader_initialized) { shader_initialized = true; KnightInSilksong.logger.LogInfo((object)"Shader Find OK"); SceneManager.activeSceneChanged -= CheckShaders; SetErrorShaders(); } } private void SetShaders() { Shader[] array = Resources.FindObjectsOfTypeAll<Shader>(); foreach (Shader val in array) { if ((Object)(object)val != (Object)null && val.isSupported && !shaders.ContainsKey(((Object)val).name)) { KnightInSilksong.logger.LogInfo((object)(((Object)val).name + " " + val.isSupported)); shaders.Add(((Object)val).name, val); } } } public Shader GetShader(string name) { if (!shaders.ContainsKey(name)) { return null; } return shaders[name]; } private void SetErrorShaders() { _ = KnightInSilksong.Instance.hk; HashSet<Material> hashSet = new HashSet<Material>(); foreach (KeyValuePair<string, GameObject> loaded_go in KnightInSilksong.loaded_gos) { GameObject value = loaded_go.Value; SpriteRenderer[] componentsInChildren = value.GetComponentsInChildren<SpriteRenderer>(true); foreach (SpriteRenderer val in componentsInChildren) { hashSet.Add(((Renderer)val).sharedMaterial); } ParticleSystemRenderer[] componentsInChildren2 = value.GetComponentsInChildren<ParticleSystemRenderer>(true); foreach (ParticleSystemRenderer val2 in componentsInChildren2) { hashSet.Add(((Renderer)val2).sharedMaterial); } tk2dSpriteCollectionData[] componentsInChildren3 = value.GetComponentsInChildren<tk2dSpriteCollectionData>(true); for (int i = 0; i < componentsInChildren3.Length; i++) { Material[] materials = componentsInChildren3[i].materials; foreach (Material item in materials) { hashSet.Add(item); } } ChangeFontByLanguage[] componentsInChildren4 = value.GetComponentsInChildren<ChangeFontByLanguage>(true); foreach (ChangeFontByLanguage val3 in componentsInChildren4) { if ((Object)(object)val3.fontJA != (Object)null) { hashSet.Add(((TMP_Asset)val3.fontJA).material); } if ((Object)(object)val3.fontKO != (Object)null) { hashSet.Add(((TMP_Asset)val3.fontKO).material); } if ((Object)(object)val3.fontRU != (Object)null) { hashSet.Add(((TMP_Asset)val3.fontRU).material); } if ((Object)(object)val3.fontZH != (Object)null) { hashSet.Add(((TMP_Asset)val3.fontZH).material); } if ((Object)(object)val3.defaultFont != (Object)null) { hashSet.Add(((TMP_Asset)val3.defaultFont).material); } } TextMeshPro[] componentsInChildren5 = value.GetComponentsInChildren<TextMeshPro>(true); for (int i = 0; i < componentsInChildren5.Length; i++) { Material[] materials = ((TMP_Text)componentsInChildren5[i]).fontSharedMaterials; foreach (Material item2 in materials) { hashSet.Add(item2); } } } foreach (Material item3 in hashSet) { if ((Object)(object)item3 == (Object)null) { "Null Material".LogInfo(); continue; } if (!material_shader_map.ContainsKey(((Object)item3).name)) { KnightInSilksong.logger.LogError((object)("Cant Find The Material " + ((Object)item3).name + " In Map")); continue; } Shader shader = GetShader(material_shader_map[((Object)item3).name]); if ((Object)(object)shader == (Object)null) { switch (material_shader_map[((Object)item3).name]) { case "tk2d/BlendVertexColor": shader = GetShader("tk2d/BlendVertexColor (addressable)"); break; case "UI/BlendModes/Lighten": shader = GetShader("UI/BlendModes/Screen"); break; case "UI/BlendModes/Multiply": shader = GetShader("UI/BlendModes/Screen"); break; case "UI/BlendModes/VividLight": shader = GetShader("UI/BlendModes/Screen"); break; } if ((Object)(object)shader == (Object)null) { KnightInSilksong.logger.LogError((object)("Cant Find The Shader " + material_shader_map[((Object)item3).name] + " For " + ((Object)item3).name)); } } item3.shader = shader; } } private void SetErrorCollider2D() { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0044: 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) foreach (KeyValuePair<string, GameObject> loaded_go in KnightInSilksong.loaded_gos) { Collider2D[] componentsInChildren = loaded_go.Value.GetComponentsInChildren<Collider2D>(true); foreach (Collider2D obj in componentsInChildren) { obj.callbackLayers = LayerMask.op_Implicit(-1); obj.contactCaptureLayers = LayerMask.op_Implicit(-1); obj.forceReceiveLayers = LayerMask.op_Implicit(-1); obj.forceSendLayers = LayerMask.op_Implicit(-1); } } } private void SetAuidoVolume() { foreach (KeyValuePair<string, GameObject> loaded_go in KnightInSilksong.loaded_gos) { AudioSource[] componentsInChildren = loaded_go.Value.GetComponentsInChildren<AudioSource>(true); foreach (AudioSource val in componentsInChildren) { if ((Object)(object)val != (Object)null && (Object)(object)val.outputAudioMixerGroup != (Object)null && (Object)(object)val.outputAudioMixerGroup.audioMixer != (Object)null) { share_mixer_group.Add(val.outputAudioMixerGroup.audioMixer); } } } } private void SetErrorFsm() { foreach (KeyValuePair<string, GameObject> loaded_go in KnightInSilksong.loaded_gos) { PlayMakerFSM[] componentsInChildren = loaded_go.Value.GetComponentsInChildren<PlayMakerFSM>(true); foreach (PlayMakerFSM val in componentsInChildren) { val.eventHandlerComponentsAdded = false; if (val.UsesTemplate) { val.fsmTemplate.fsm.GetAddVariable<FsmBool>("FromKnight", (object)true); val.fsmTemplate.fsm.preprocessed = false; } else { val.GetAddVariable<FsmBool>("FromKnight", (object)true); val.fsm.preprocessed = false; } } } } public static void SetDeathInfo() { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0054: 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_002b: 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_0096: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_0188: 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_0151: Unknown result type (might be due to invalid IL or missing references) HeroCorpseMarkerProxy instance = HeroCorpseMarkerProxy.Instance; HeroController instance2 = HeroController.instance; if (Object.op_Implicit((Object)(object)instance)) { PlayerDataAccess.HeroCorpseScene = instance.TargetSceneName; PlayerDataAccess.HeroCorpseMarkerGuid = instance.TargetGuid; PlayerDataAccess.HeroDeathScenePos = instance.TargetScenePos; } else { Vector3 position = instance2.transform.position; PlayerDataAccess.HeroCorpseScene = instance2.gm.GetSceneNameString(); HeroCorpseMarker closest = HeroCorpseMarker.GetClosest(Vector2.op_Implicit(position)); if (Object.op_Implicit((Object)(object)closest)) { PlayerDataAccess.HeroCorpseMarkerGuid = closest.Guid.ToByteArray(); PlayerDataAccess.HeroDeathScenePos = closest.Position; } else { PlayerDataAccess.HeroCorpseMarkerGuid = null; PlayerDataAccess.HeroDeathScenePos = Vector2.op_Implicit(position); } } tk2dTileMap tilemap = instance2.gm.tilemap; PlayerDataAccess.HeroDeathSceneSize = new Vector2((float)tilemap.width, (float)tilemap.height); instance2.gm.gameMap.PositionCompassAndCorpse(); PlayerDataAccess.IsSilkSpoolBroken = true; PlayerDataAccess.HeroCorpseType = (HeroDeathCocoonTypes)0; int num = PlayerData.instance.geoPool; bool isEquipped = ((ToolBase)Gameplay.DeadPurseTool).IsEquipped; if (isEquipped) { int num2 = Mathf.RoundToInt((float)num * Gameplay.DeadPurseHoldPercent); num -= num2; PlayerDataAccess.geo = num2; } else { PlayerDataAccess.geo = 0; } PlayerDataAccess.HeroCorpseMoneyPool = Mathf.RoundToInt((float)num); if (instance2.playerData.IsAnyCursed) { PlayerDataAccess.HeroCorpseType = (HeroDeathCocoonTypes)(PlayerDataAccess.HeroCorpseType | 2); } if (isEquipped && PlayerDataAccess.HeroCorpseMoneyPool >= 10) { PlayerDataAccess.HeroCorpseType = (HeroDeathCocoonTypes)(PlayerDataAccess.HeroCorpseType | 1); } PlayerDataAccess.HeroCorpseType = (HeroDeathCocoonTypes)(PlayerDataAccess.HeroCorpseType | 0x40000000); PlayerData instance3 = PlayerData.instance; instance3.shadeScene = PlayerDataAccess.HeroCorpseScene; instance3.shadePositionX = PlayerDataAccess.HeroDeathScenePos.x; instance3.shadePositionY = PlayerDataAccess.HeroDeathScenePos.y; instance3.geoPool = PlayerDataAccess.HeroCorpseMoneyPool; } } [RequireComponent(typeof(SpriteRenderer))] internal class CheckKnight : MonoBehaviour { private SpriteRenderer render; private void Awake() { render = ((Component)this).GetComponent<SpriteRenderer>(); } private void Update() { if (KnightInSilksong.IsKnight) { if ((Object)(object)render != (Object)null) { ((Renderer)render).enabled = true; } } else if ((Object)(object)render != (Object)null) { ((Renderer)render).enabled = false; } } } public class DoAction : MonoBehaviour { public Action<DoAction> action; public void DoActionNow() { action?.Invoke(this); } } public class DreamHelper : MonoBehaviour { public class DreamInfo { public HealthManager hm; public float cd; } public List<DreamInfo> dream_cds = new List<DreamInfo>(); public const float general_cd = 0.2f; public bool Exist(HealthManager hm) { if ((Object)(object)hm == (Object)null) { return true; } foreach (DreamInfo dream_cd in dream_cds) { if ((Object)(object)dream_cd.hm == (Object)(object)hm) { return true; } } return false; } public void Add(HealthManager hm) { if (!((Object)(object)hm == (Object)null)) { dream_cds.Add(new DreamInfo { hm = hm, cd = 0.2f }); } } public void Update() { for (int num = dream_cds.Count - 1; num >= 0; num--) { if ((Object)(object)dream_cds[num].hm == (Object)null) { dream_cds.RemoveAt(num); } else { dream_cds[num].cd -= Time.deltaTime; if (dream_cds[num].cd < 0f) { dream_cds.RemoveAt(num); } } } } } internal class KeepHornet : MonoBehaviour { private Vector3 offset; private Vector2 boxSize; private Vector2 boxOffset; private Rigidbody2D hornet_rb; private Vector2 scale; internal static bool test; internal GameObject Hornet => ((Component)HeroController.instance).gameObject; private void Awake() { hornet_rb = Hornet.GetComponent<Rigidbody2D>(); } private void Start() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) ((Component)this).transform.position = Hornet.transform.position; } private void OnEnable() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_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_00ac: 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) ((Component)this).transform.position = Hornet.transform.position; BoxCollider2D component = Hornet.GetComponent<BoxCollider2D>(); offset = Vector2.op_Implicit(((Collider2D)component).offset); boxSize = component.size; scale = new Vector2(Math.Abs(Extensions.GetScaleX(Hornet.transform)), Math.Abs(Extensions.GetScaleY(Hornet.transform))); component.size = ((Component)this).GetComponent<BoxCollider2D>().size; ((Collider2D)component).offset = ((Collider2D)((Component)this).GetComponent<BoxCollider2D>()).offset; Extensions.SetScale2D(Hornet.transform, Vector2.op_Implicit(((Component)this).transform.localScale)); ((Behaviour)Hornet.GetComponent<HeroWaterController>()).enabled = false; foreach (string item in new List<string>(5) { "Slash", "AltSlash", "DownSlash", "UpSlash", "WallSlash" }) { ((Component)this).gameObject.FindGameObjectInChildren("Attacks").FindGameObjectInChildren(item).FindGameObjectInChildren("Clash Tink") .tag = "Nail Attack"; } } private void Update() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) Hornet.transform.position = ((Component)this).transform.position; LookingStateSync(); } private void LookingStateSync() { HeroControllerStates cState = HeroController.instance.cState; HeroControllerStates cState2 = HeroController.instance.cState; cState2.lookingUp = cState.lookingUp; cState2.lookingUpAnim = cState.lookingUpAnim; cState2.lookingDown = cState.lookingDown; cState2.lookingDownAnim = cState.lookingDownAnim; } private void FixedUpdate() { if (Mathf.Abs(hornet_rb.linearVelocityY) > 1f) { hornet_rb.linearVelocityY = 0f; } if (Mathf.Abs(hornet_rb.linearVelocityX) > 1f) { hornet_rb.linearVelocityX = 0f; } } private void OnDisable() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) BoxCollider2D component = Hornet.GetComponent<BoxCollider2D>(); ((Collider2D)component).offset = Vector2.op_Implicit(offset); component.size = boxSize; ((Behaviour)Hornet.GetComponent<HeroWaterController>()).enabled = true; Extensions.SetScale2D(Hornet.transform, new Vector2((float)((Extensions.GetScaleX(Hornet.transform) > 0f) ? 1 : (-1)) * scale.x, scale.y)); } } internal class TrueCharmDisable : MonoBehaviour { private void OnDisable() { if (((Component)this).gameObject.activeSelf) { Patch_InventoryItemSelectableDirectional_Awake.ToggleCharm(); } } } public class GeneralPatch { } [HarmonyPatch(/*Could not decode attribute arguments.*/)] public class Patch_BounceBallon_Bounce : GeneralPatch { public static bool Prefix() { if (KnightInSilksong.IsKnight) { HeroController.instance.ShroomBounce(); return false; } return true; } } [HarmonyPatch(typeof(BouncePod), "DoBounceOff")] public class Patch_BouncePod_DoBounceOff : GeneralPatch { private static bool Prefix() { if (KnightInSilksong.IsKnight) { HeroController.instance.ShroomBounce(); return false; } return true; } } [HarmonyPatch(/*Could not decode attribute arguments.*/)] public class Patch_BuildEquippedCharms_BuildCharmList : GeneralPatch { public static bool Prefix(BuildEquippedCharms __instance) { if (KnightInSilksong.IsKnight) { __instance.equippedCharms = PlayerData.instance.equippedCharms; } return true; } public static void Postfix(BuildEquippedCharms __instance) { if (KnightInSilksong.IsKnight && PlayerData.instance.charmSlotsFilled >= PlayerData.instance.charmSlots) { try { __instance.instanceList.Remove(__instance.nextDot); } catch { } } } } [HarmonyPatch(typeof(InventoryItemSelectableDirectional), "Awake")] public class Patch_InventoryItemSelectableDirectional_Awake : GeneralPatch { public static GameObject charmButton; private static DoAction button_action; public static void Postfix(InventoryItemSelectableDirectional __instance) { //IL_00e2: Unknown result type (might be due to invalid IL or missing references) if (!(((Object)((Component)__instance).gameObject).name == "Change Crest Button")) { return; } InventoryItemSelectableButtonEvent val = (InventoryItemSelectableButtonEvent)(object)((__instance is InventoryItemSelectableButtonEvent) ? __instance : null); if (val != null) { charmButton = Object.Instantiate<GameObject>(((Component)__instance).gameObject, ((Component)__instance).gameObject.transform.parent); Extensions.SetPosition2D(charmButton.transform, -7.8865f, -5.53f); ((InventoryItemSelectableDirectional)val).Selectables[3] = (InventoryItemSelectable)(object)charmButton.GetComponent<InventoryItemSelectableDirectional>(); charmButton.GetComponent<InventoryItemSelectableDirectional>().Selectables[2] = (InventoryItemSelectable)(object)__instance; Object.Destroy((Object)(object)charmButton.FindGameObjectInChildren("Change Crest Action")); GameObject gameObject = charmButton.FindGameObjectInChildren("Parent"); GameObject val2 = gameObject.FindGameObjectInChildren("Button Icon Locked"); GameObject obj = gameObject.FindGameObjectInChildren("Button Icon Regular"); Object.Destroy((Object)(object)val2); ((Object)obj).name = "Charm Icon"; Extensions.SetScale2D(obj.transform, new Vector2(0.5f, 0.5f)); obj.GetComponent<SpriteRenderer>().sprite = ModuleManager.GetInstance<PreProcess>().charm_icon; InventoryItemSelectableDirectional component = charmButton.GetComponent<InventoryItemSelectableDirectional>(); InventoryItemSelectableButtonEvent val3 = (InventoryItemSelectableButtonEvent)(object)((component is InventoryItemSelectableButtonEvent) ? component : null); if (val3 != null) { button_action = charmButton.AddComponent<DoAction>(); DoAction doAction = button_action; doAction.action = (Action<DoAction>)Delegate.Combine(doAction.action, new Action<DoAction>(ToggleCharm)); val3.ButtonActivated = (Action)Delegate.Combine(val3.ButtonActivated, new Action(button_action.DoActionNow)); } charmButton.SetActive(KnightInSilksong.IsKnight); KnightInSilksong instance = KnightInSilksong.Instance; instance.OnToggleKnight = (Action<bool>)Delegate.Combine(instance.OnToggleKnight, (Action<bool>)delegate(bool value) { charmButton.SetActive(value); }); } } public static void ToggleCharm(DoAction doAction = null) { DoAction doAction2 = ((!((Object)(object)doAction == (Object)null)) ? doAction : button_action); GameObject gameObject = ((Component)doAction2).gameObject; InventoryItemToolManager component = ((Component)gameObject.transform.parent.parent).GetComponent<InventoryItemToolManager>(); bool activeSelf = KnightInSilksong.Instance.charm_instance.activeSelf; component.FadeToolGroup(activeSelf); ((Component)component).gameObject.FindGameObjectInChildren("Crest List").SetActive(activeSelf); ((Component)gameObject.transform.parent).gameObject.SetActive(activeSelf); KnightInSilksong.Instance.charm_instance.SetActive(!activeSelf); if (!activeSelf) { PlayMakerFSM val = FSMUtility.LocateMyFSM(KnightInSilksong.Instance.charm_instance, "UI Charms"); if (val.GetValidState("Inventory Closed").actions.Length == 0) { val.AddCustomAction("Inventory Closed", (Action)delegate { "Try Toggle Charm from Inventory Closed".LogInfo(); ToggleCharm(); }); val.RemoveTransition("Left", "TO LEFT"); val.RemoveTransition("Right", "TO RIGHT"); val.InsertCustomAction("Left", delegate(PlayMakerFSM fsm) { if (fsm.GetVariable<FsmInt>("Collection Pos").value == 1) { fsm.SendEvent("FINISHED"); } }, 1); val.InsertCustomAction("Right", delegate(PlayMakerFSM fsm) { if (fsm.GetVariable<FsmInt>("Collection Pos").value == 40) { fsm.SendEvent("FINISHED"); } }, 1); KnightInSilksong.Instance.charm_instance.AddComponent<TrueCharmDisable>(); ((Component)KnightInSilksong.Instance.charm_instance.transform.Find("Equipped Charms/Next Dot/Sprite Next")).gameObject.SetActive(false); } val.FsmVariables.GetFsmInt("New Charm ID").value = 1; } FSMUtility.SendEventToGameObject(KnightInSilksong.Instance.charm_instance, "UP", true); FSMUtility.SendEventToGameObject(KnightInSilksong.Instance.charm_instance, "ACTIVATE", true); ((Behaviour)((Component)component).GetComponent<InventoryPaneInput>()).enabled = false; } } [HarmonyPatch(typeof(CallMethodProper), "PreCache")] internal class PatchCallMethodProper : GeneralPatch { public static bool Prefix(CallMethodProper __instance) { return true; } public static void Postfix(CallMethodProper __instance) { } private static void Log(object msg) { KnightInSilksong.logger.LogInfo(msg); } private static void Orig_PreCache(CallMethodProper __instance) { GameObject ownerDefaultTarget = ((FsmStateAction)__instance).Fsm.GetOwnerDefaultTarget(__instance.gameObject); if ((Object)(object)ownerDefaultTarget == (Object)null) { Log("ownerDefaultTarget is null "); return; } ref MonoBehaviour component = ref __instance.component; Component component2 = ownerDefaultTarget.GetComponent(__instance.behaviour.Value); component = (MonoBehaviour)(object)((component2 is MonoBehaviour) ? component2 : null); if ((Object)(object)__instance.component == (Object)null) { Log("component is null "); return; } __instance.cachedType = ((object)__instance.component).GetType(); try { __instance.cachedMethodInfo = __instance.cachedType.GetMethod(__instance.methodName.Value); } catch (AmbiguousMatchException) { Type[] types = __instance.parameters.Select((FsmVar fsmVar) => fsmVar.RealType).ToArray(); __instance.cachedMethodInfo = __instance.cachedType.GetMethod(__instance.methodName.Value, types); } if (__instance.cachedMethodInfo == null) { __instance.errorString = __instance.errorString + " CallMethodProper Method Name is invalid: " + __instance.behaviour.Value + "::" + __instance.methodName.Value + "\n"; } else { __instance.cachedParameterInfo = __instance.cachedMethodInfo.GetParameters(); } } } [HarmonyPatch(typeof(CallMethodProper), "DoMethodCall")] internal class PatchDoMethodCall : GeneralPatch { public static bool Prefix(CallMethodProper __instance) { try { Modified_DoMethodCall(__instance); } catch (Exception msg) { Log(((Object)((FsmStateAction)__instance).fsm.GameObject).name + " " + ((FsmStateAction)__instance).fsm.name + " " + ((FsmStateAction)__instance).State.name + " " + __instance.behaviour.value + __instance.methodName.value); Log(msg); } return false; } public static void Postfix(CallMethodProper __instance) { } private static void Log(object msg) { KnightInSilksong.logger.LogInfo(msg); } public static void WarpToDreamGate(GameManager gm) { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0044: 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_006b: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Expected O, but got Unknown gm.entryGateName = "dreamGate"; gm.targetScene = PlayerData.instance.GetString("dreamGateScene"); gm.entryDelay = 0f; gm.cameraCtrl.FreezeInPlace(false); gm.BeginSceneTransition(new SceneLoadInfo { AlwaysUnloadUnusedAssets = true, EntryGateName = "dreamGate", PreventCameraFadeOut = true, SceneName = PlayerData.instance.GetString("dreamGateScene"), Visualization = (SceneLoadVisualizations)2 }); } private static void Modified_DoMethodCall(CallMethodProper __instance) { //IL_0733: Unknown result type (might be due to invalid IL or missing references) //IL_0739: Invalid comparison between Unknown and I4 if (string.IsNullOrEmpty(__instance.behaviour.Value) || string.IsNullOrEmpty(__instance.methodName.Value)) { ((FsmStateAction)__instance).Finish(); return; } if (__instance.behaviour.value == "CharmIconList" && __instance.methodName.value == "GetSprite") { if ((Object)(object)CharmIconList.Instance != (Object)null) { __instance.parameters[0].UpdateValue(); __instance.storeResult.SetValue((object)CharmIconList.Instance.GetSprite(__instance.parameters[0].intValue)); } ((FsmStateAction)__instance).Finish(); return; } if (KnightInSilksong.IsKnight) { FsmVar[] parameters = __instance.parameters; for (int i = 0; i < parameters.Length; i++) { parameters[i].UpdateValue(); } if (__instance.behaviour.value == "HeroController") { if (__instance.methodName.value == "TakeQuickDamage") { bool isInvincible = PlayerData.instance.isInvincible; PlayerData.instance.isInvincible = false; __instance.parameters[0].UpdateValue(); HeroController.instance.TakeDamage((GameObject)null, (CollisionSide)4, __instance.parameters[0].intValue, 4096); PlayerData.instance.isInvincible = isInvincible; ((FsmStateAction)__instance).Finish(); return; } if (__instance.methodName.value == "TakeQuickDamageSimple") { bool isInvincible2 = PlayerData.instance.isInvincible; PlayerData.instance.isInvincible = false; __instance.parameters[0].UpdateValue(); HeroController.instance.TakeDamage((GameObject)null, (CollisionSide)4, __instance.parameters[0].intValue, 4096); PlayerData.instance.isInvincible = isInvincible2; ((FsmStateAction)__instance).Finish(); return; } if (__instance.methodName.value == "CancelDamageRecoilSimple") { __instance.methodName.value = "CancelDamageRecoil"; } else { if (__instance.methodName.value == "WillDoBellBindHit") { __instance.storeResult.SetValue((object)false); ((FsmStateAction)__instance).Finish(); return; } if (__instance.methodName.value == "ActivateVoidAcid") { ((FsmStateAction)__instance).Finish(); return; } if (__instance.methodName.value == "CanTakeDamage") { bool flag = false; flag |= Traverse.Create((object)HeroController.instance).Method("CanTakeDamage", Array.Empty<object>()).GetValue<bool>(); __instance.storeResult.SetValue((object)flag); ((FsmStateAction)__instance).Finish(); return; } if (__instance.methodName.value == "GetEntryGateName") { string entryGateName = GameManager.instance.GetEntryGateName(); __instance.storeResult.SetValue((object)entryGateName); ((FsmStateAction)__instance).Finish(); return; } if (__instance.methodName.value == "AddSilk") { __instance.parameters[0].UpdateValue(); __instance.parameters[1].UpdateValue(); HeroController.instance.AddSilk(__instance.parameters[0].intValue, __instance.parameters[1].boolValue); ((FsmStateAction)__instance).Finish(); return; } if (__instance.methodName.value == "EnterUpdraft") { if (PlayerDataAccess.hasBrolly) { PlayerData.instance.SetBool("infiniteAirJump", true); } } else if (__instance.methodName.value == "ExitUpdraft") { if (PlayerDataAccess.hasBrolly) { PlayerData.instance.SetBool("infiniteAirJump", false); } } else if (__instance.methodName.value == "StartAnimationControlToIdle") { HeroController.instance.StartAnimationControlToIdle(); } else { if (__instance.methodName.value == "AddToMaxSilkRegen") { __instance.parameters[0].UpdateValue(); HeroController.instance.AddToMaxSilkRegen(__instance.parameters[0].intValue); ((FsmStateAction)__instance).Finish(); return; } if (__instance.methodName.value == "CocoonBroken") { HeroController.instance.CocoonBroken(); ((FsmStateAction)__instance).Finish(); return; } if (__instance.methodName.value == "AddGeo") { HeroController.instance.AddGeo(__instance.parameters[0].intValue); ((FsmStateAction)__instance).Finish(); return; } if (__instance.methodName.value == "AddGeoQuietly") { HeroController.instance.AddGeoQuietly(__instance.parameters[0].intValue); ((FsmStateAction)__instance).Finish(); return; } if (__instance.methodName.value == "AddGeoToCounter") { HeroController.instance.AddGeoToCounter(__instance.parameters[0].intValue); ((FsmStateAction)__instance).Finish(); return; } } } } if (__instance.behaviour.value == "GameManager" && __instance.methodName.value == "WarpToDreamGate") { WarpToDreamGate(GameManager.instance); ((FsmStateAction)__instance).Finish(); return; } } GameObject ownerDefaultTarget = ((FsmStateAction)__instance).Fsm.GetOwnerDefaultTarget(__instance.gameObject); if ((Object)(object)ownerDefaultTarget == (Object)null) { return; } ref MonoBehaviour component = ref __instance.component; Component component2 = ownerDefaultTarget.GetComponent(__instance.behaviour.Value); component = (MonoBehaviour)(object)((component2 is MonoBehaviour) ? component2 : null); if ((Object)(object)__instance.component == (Object)null) { ((FsmStateAction)__instance).LogWarning("CallMethodProper: " + ((Object)ownerDefaultTarget).name + " missing behaviour: " + __instance.behaviour.Value); return; } if (__instance.cachedMethodInfo == null || !__instance.cachedMethodInfo.Name.Equals(__instance.methodName.Value)) { __instance.errorString = string.Empty; if (!__instance.DoCache()) { Debug.LogError((object)__instance.errorString, (Object)(object)((FsmStateAction)__instance).Owner); ((FsmStateAction)__instance).Finish(); return; } } object value = null; if (__instance.cachedParameterInfo.Length == 0) { try { value = __instance.cachedMethodInfo.Invoke(__instance.component, null); } catch (TargetException) { value = __instance.cachedMethodInfo.Invoke(((Component)(object)__instance.component).GetAnotherComponent(), null); } catch (Exception ex2) { Debug.LogError((object)("CallMethodProper error on " + ((FsmStateAction)__instance).Fsm.OwnerName + " -> " + ex2), (Object)(object)((FsmStateAction)__instance).Owner); } } else { for (int j = 0; j < __instance.parameters.Length; j++) { FsmVar val = __instance.parameters[j]; val.UpdateValue(); __instance.parametersArray[j] = val.GetValue(); } try { value = __instance.cachedMethodInfo.Invoke(__instance.component, __instance.parametersArray); } catch (TargetParameterCountException) { ParameterInfo[] parameters2 = __instance.cachedMethodInfo.GetParameters(); Debug.LogErrorFormat((Object)(object)((FsmStateAction)__instance).Owner, "Count did not match. Required: {0}, Was: {1}, Method: {2}", new object[3] { parameters2.Length, __instance.parametersArray.Length, __instance.cachedMethodInfo.Name }); } catch (TargetException) { value = __instance.cachedMethodInfo.Invoke(((Component)(object)__instance.component).GetAnotherComponent(), __instance.parametersArray); } catch (Exception ex5) { Debug.LogError((object)("CallMethodProper error on " + ((FsmStateAction)__instance).Fsm.OwnerName + " -> " + ex5), (Object)(object)((FsmStateAction)__instance).Owner); } } if ((int)__instance.storeResult.Type != -1) { __instance.storeResult.SetValue(value); } } } [HarmonyPatch(/*Could not decode attribute arguments.*/)] public class Patch_CameraLockArea_IsInApplicableGameState : GeneralPatch { public static bool Prefix(ref bool __result) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Invalid comparison between Unknown and I4 if (KnightInSilksong.IsKnight && (Object)(object)GameManager.UnsafeInstance != (Object)null && (int)GameManager.UnsafeInstance.GameState == 6) { __result = true; return false; } return true; } } [HarmonyPatch(/*Could not decode attribute arguments.*/)] public class Patch_CharmDisplay_Start : GeneralPatch { public static void Postfix(CharmDisplay __instance) { if (!KnightInSilksong.IsKnight) { return; } Sprite val = null; PlayerData instance = PlayerData.instance; switch (__instance.id) { case 23: if (instance.brokenCharm_23) { val = __instance.brokenGlassHP; } break; case 24: if (instance.brokenCharm_24) { val = __instance.brokenGlassGeo; } break; case 25: if (instance.brokenCharm_25) { val = __instance.brokenGlassAttack; } break; case 36: val = ((instance.royalCharmState <= 3) ? __instance.whiteCharm : __instance.blackCharm); break; } if ((Object)(object)val != (Object)null) { if (Object.op_Implicit((Object)(object)__instance.spriteRenderer)) { __instance.spriteRenderer.sprite = val; } if (Object.op_Implicit((Object)(object)__instance.flashSpriteRenderer)) { __instance.flashSpriteRenderer.sprite = val; } } } } [HarmonyPatch(/*Could not decode attribute arguments.*/)] public class Patch_CharmIconList_GetSprite : GeneralPatch { public static bool Prefix(CharmIconList __instance, int id, ref Sprite __result) { if (KnightInSilksong.IsKnight) { PlayerData instance = PlayerData.instance; switch (id) { case 23: if (instance.fragileHealth_unbreakable) { __result = __instance.unbreakableHeart; return false; } break; case 24: if (instance.fragileGreed_unbreakable) { __result = __instance.unbreakableGreed; return false; } break; case 25: if (instance.fragileStrength_unbreakable) { __result = __instance.unbreakableStrength; return false; } break; case 40: switch (instance.grimmChildLevel) { case 1: __result = __instance.grimmchildLevel1; return false; case 2: __result = __instance.grimmchildLevel2; return false; case 3: __result = __instance.grimmchildLevel3; return false; case 4: __result = __instance.grimmchildLevel4; return false; case 5: __result = __instance.nymmCharm; return false; } break; } } return true; } } [HarmonyPatch(typeof(CheckHeroPerformanceRegion), "SendEvents")] public class Patch_CheckHeroPerformanceRegion_SendEvents : GeneralPatch { public static bool Prefix(AffectedState affectedState) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Invalid comparison between Unknown and I4 if (!KnightInSilksong.IsKnight) { return true; } if ((int)affectedState == 2) { HeroPerformanceRegion.IsPerforming = false; } return true; } } [HarmonyPatch(typeof(CheckHeroPerformanceRegionBase), "DoAction")] public class Patch_CheckHeroPerformanceRegionBase_DoAction : GeneralPatch { public static void Postfix(CheckHeroPerformanceRegionBase __instance) { if (KnightInSilksong.IsKnight && FSMUtility.LocateMyFSM(((Component)HeroController.instance).gameObject, "Dream Nail").ActiveStateName == "Slash") { HeroPerformanceRegion.IsPerforming = true; __instance.delay = 0.001f; } } } [HarmonyPatch(typeof(CheckHeroPerformanceRegionV2), "SendEvents")] public class Patch_CheckHeroPerformanceRegionV2_SendEvents : GeneralPatch { public static bool Prefix(AffectedState affectedState) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Invalid comparison between Unknown and I4 if (!KnightInSilksong.IsKnight) { return true; } if ((int)affectedState == 2) { HeroPerformanceRegion.IsPerforming = false; } return true; } } [HarmonyPatch] public class PatchCogMultiHitter : GeneralPatch { [CompilerGenerated] private sealed class <DelayEndForKnight>d__5 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public CogMultiHitter __instance; public HeroController hc; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <DelayEndForKnight>d__5(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.35f); <>1__state = 1; return true; case 1: <>1__state = -1; __instance.multiHitRumble.CancelShake(); if (Object.op_Implicit((Object)(object)__instance.jitter)) { __instance.jitter.StopJitter(); } DamageKnightDirectly(__instance, hc); <>2__current = (object)new WaitForSeconds(0.2f); <>1__state = 2; return true; case 2: <>1__state = -1; ((Component)__instance.heroGrindEffect).gameObject.SetActive(false); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static DefaultDict<CogMultiHitter, HeroController> cog_hc_dict = new DefaultDict<CogMultiHitter, HeroController>(() => null); public static HeroController damagingKnight; [HarmonyPrefix] [HarmonyPatch(/*Could not decode attribute arguments.*/)] public static bool CogMultiHitter_OnTriggerEnter2D_Prefix(CogMultiHitter __instance, Collider2D other) { if (KnightInSilksong.IsKnight) { OnTriggerEnter2DForKnight(__instance, other); return false; } return true; } [HarmonyPrefix] [HarmonyPatch(/*Could not decode attribute arguments.*/)] public static bool CogMultiHitter_CancelDelay_Prefix(CogMultiHitter __instance) { if (KnightInSilksong.IsKnight && Object.op_Implicit((Object)(object)cog_hc_dict[__instance])) { cog_hc_dict[__instance].OnHazardRespawn -= __instance.OnHeroHazardRespawn; } return true; } public static void OnTriggerEnter2DForKnight(CogMultiHitter __instance, Collider2D other) { //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) if (Time.timeAsDouble < __instance.canDamageTime || ((Component)other).gameObject.layer != 20) { return; } HeroController componentInParent = ((Component)other).GetComponentInParent<HeroController>(); if (!componentInParent.isHeroInPosition || componentInParent.playerData.isInvincible) { return; } __instance.CancelDelay(); cog_hc_dict[__instance] = componentInParent; componentInParent.OnHazardRespawn += __instance.OnHeroHazardRespawn; Vector3 position = ((Component)componentInParent).transform.position; float angleToTarget; if (__instance.useSelfForAngle) { angleToTarget = __instance.GetAngleToTarget(Vector2.op_Implicit(position), Vector2.op_Implicit(((Component)__instance).transform.position)); } else { GameObject[] array = GameObject.FindGameObjectsWithTag("Cog Grind Marker"); Transform val = null; float num = float.PositiveInfinity; GameObject[] array2 = array; foreach (GameObject val2 in array2) { if (!((Object)(object)val2 == (Object)(object)((Component)__instance).gameObject)) { Transform transform = val2.transform; Vector3 val3 = position - transform.position; float sqrMagnitude = ((Vector3)(ref val3)).sqrMagnitude; if (!(sqrMagnitude > num)) { num = sqrMagnitude; val = transform; } } } angleToTarget = __instance.GetAngleToTarget(Vector2.op_Implicit(position), Vector2.op_Implicit(Object.op_Implicit((Object)(object)val) ? val.position : ((Component)__instance).transform.position)); } EventRegister.SendEvent(EventRegisterEvents.CogDamage, ((Component)__instance).gameObject); ObjectPoolExtensions.Spawn(__instance.hitEffectPrefab, position); EventRegister.SendEvent(EventRegisterEvents.HeroDamaged, (GameObject)null); StaticVariableList.SetValue("Wound Sender Override", (object)((Component)__instance).gameObject, 0); FSMUtility.SendEventToGameObject(((Component)componentInParent).gameObject, "WOUND START", false); componentInParent.CancelAttack(); componentInParent.CancelBounce(); __instance.multiHitRumble.DoShake((Object)(object)__instance, false); if (Object.op_Implicit((Object)(object)__instance.jitter)) { __instance.jitter.StartJitter(); } if (Object.op_Implicit((Object)(object)__instance.cogAnimator)) { __instance.cogAnimator.FreezePosition = true; } Extensions.SetPosition2D(__instance.heroGrindEffect, Vector2.op_Implicit(position)); Extensions.SetRotation2D(__instance.heroGrindEffect, angleToTarget); ((Component)__instance.heroGrindEffect).gameObject.SetActive(true); ((AudioEvent)(ref __instance.heroDamageAudio)).SpawnAndPlayOneShot(position, (Action)null); __instance.delayRoutine = ((MonoBehaviour)__instance).StartCoroutine(DelayEndForKnight(__instance, componentInParent)); } [IteratorStateMachine(typeof(<DelayEndForKnight>d__5))] public static IEnumerator DelayEndForKnight(CogMultiHitter __instance, HeroController hc) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <DelayEndForKnight>d__5(0) { __instance = __instance, hc = hc }; } public static void DamageKnightDirectly(CogMultiHitter __instance, HeroController hc) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) hc.playerData.isInvincible = false; hc.cState.focusing = false; hc.TakeDamage(((Component)__instance).gameObject, (CollisionSide)((!(((Component)__instance).transform.position.x > ((Component)hc).transform.position.x)) ? 1 : 2), 1, 2); } } [HarmonyPatch(/*Could not decode attribute arguments.*/)] public class Patch_ConveyorZone_OnTriggerEnter2D : GeneralPatch { public static bool Prefix(ConveyorZone __instance, Collider2D collision) { if (KnightInSilksong.IsKnight) { if (!__instance.activated) { return true; } __instance.hasEntered = true; __instance.conveyorMovement = ((Component)collision).GetComponent<ConveyorMovement>(); if (Object.op_Implicit((Object)(object)__instance.conveyorMovement)) { __instance.conveyorMovement.StartConveyorMove(__instance.speed, 0f); } HeroController component = ((Component)collision).GetComponent<HeroController>(); if (Object.op_Implicit((Object)(object)component)) { if (__instance.vertical) { ((Component)component).GetComponent<ConveyorMovementHero>().StartConveyorMove(0f, __instance.speed); component.cState.onConveyorV = true; } else { component.SetConveyorSpeed(__instance.speed); component.cState.inConveyorZone = true; } } return false; } return true; } } [HarmonyPatch(/*Could not decode attribute arguments.*/)] public class Patch_ConveyorZone_OnTriggerExit2D : GeneralPatch { public static bool Prefix(ConveyorZone __instance, Collider2D collision) { if (KnightInSilksong.IsKnight) { if (__instance.activated) { __instance.hasEntered = false; ConveyorMovement component = ((Component)collision).GetComponent<ConveyorMovement>(); if (Object.op_Implicit((Object)(object)component)) { component.StopConveyorMove(); } HeroController component2 = ((Component)collision).GetComponent<HeroController>(); if (Object.op_Implicit((Object)(object)component2)) { ((Component)component2).GetComponent<ConveyorMovementHero>().StopConveyorMove(); component2.cState.inConveyorZone = false; component2.cState.onConveyorV = false; } } return false; } return true; } } [HarmonyPatch(/*Could not decode attribute arguments.*/)] public class Patch_ConveyorZone_OnDisable : GeneralPatch { public static bool Prefix(ConveyorZone __instance) { if (KnightInSilksong.IsKnight && __instance.hasEntered) { if (Object.op_Implicit((Object)(object)__instance.conveyorMovement)) { __instance.conveyorMovement.StopConveyorMove(); } HeroController instance = HeroController.instance; if (Object.op_Implicit((Object)(object)instance)) { ((Component)instance).GetComponent<ConveyorMovementHero>().StopConveyorMove(); instance.cState.inConveyorZone = false; instance.cState.onConveyorV = false; } __instance.hasEntered = false; __instance.conveyorMovement = null; __instance.hc = null; } return true; } } [HarmonyPatch(/*Could not decode attribute arguments.*/)] public class Patch_CustomSceneManager_Start : GeneralPatch { public static bool Prefix(CustomSceneManager __instance) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) if ((PlayerDataAccess.HeroCorpseType & 0x40000000) != 0) { __instance.heroCorpsePrefab = KnightInSilksong.loaded_gos["Hollow Shade"]; } return true; } public static void Postfix(CustomSceneManager __instance) { } } [HarmonyPatch(/*Could not decode attribute arguments.*/)] public class Patch_DamageEffectTicker_DoFlashOnEnemy : GeneralPatch { public static void Postfix(DamageEffectTicker __instance, GameObject enemy) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) if (!KnightInSilksong.IsKnight || (int)__instance.enemySpriteFlash != 0) { return; } string name = ((Object)__instance).name; SpriteFlash component = enemy.GetComponent<SpriteFlash>(); if ((Object)(object)component != (Object)null) { if (name.Contains("Spore")) { component.flashSporeQuick(); } else if (name.Contains("Dung")) { component.flashDungQuick(); } } } } [HarmonyPatch(/*Could not decode attribute arguments.*/)] public class Patch_DamageHero_TryClashTinkCollider : GeneralPatch { public static bool Prefix(DamageHero __instance, Collider2D collision) { //IL_001d: 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_01a2: Unknown result type (might be due to invalid IL or missing references) if (KnightInSilksong.IsKnight) { string tag = ((Component)collision).gameObject.tag; Transform transform = ((Component)collision).transform; Vector3 position = transform.position; if (!Object.op_Implicit((Object)(object)transform.parent)) { return true; } if (tag == "Nail Attack") { if (!__instance.canClashTink || __instance.nailClashRoutine != null || __instance.preventClashTink || ((Component)collision).gameObject.layer != 16) { ("Cant Clash " + ((Object)((Component)collision).gameObject).name + " " + ((Object)__instance).name).LogInfo(); (!__instance.canClashTink + " " + (__instance.nailClashRoutine != null) + " " + __instance.preventClashTink).LogInfo(); return false; } ("Clash yes" + ((Object)((Component)collision).gameObject).name + " " + ((Object)__instance).name).LogInfo(); HeroController instance = HeroController.instance; if (tag == "Nail Attack" && !__instance.noClashFreeze && instance.parryInvulnTimer < Mathf.Epsilon) { ("try freeze " + ((Object)((Component)collision).gameObject).name).LogInfo(); GameManager.instance.FreezeMoment((FreezeMomentTypes)3, (Action)null); } float num = 0f; PlayMakerFSM val = FSMUtility.LocateMyFSM(((Component)((Component)collision).gameObject.transform.parent).gameObject, "damages_enemy"); if ((Object)(object)val != (Object)null) { num = val.GetVariable<FsmFloat>("direction").Value; } __instance.nailClashRoutine = ((MonoBehaviour)__instance).StartCoroutine(__instance.NailClash(num, tag, position)); return false; } } return true; } } [HarmonyPatch(/*Could not decode attribute arguments.*/)] public class Patch_DamageHero_OnDamaged : GeneralPatch { public static bool Prefix(DamageHero __instance) { if (KnightInSilksong.IsKnight) { return false; } return true; } } [HarmonyPatch(/*Could not decode attribute arguments.*/)] public class Patch_DamageHeroDirectly_OnEnter : GeneralPatch { public static bool Prefix(DamageHeroDirectly __instance) { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Expected I4, but got Unknown //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Expected I4, but got Unknown if (KnightInSilksong.IsKnight) { GameObject ownerDefaultTarget = ((FsmStateAction)__instance).Fsm.GetOwnerDefaultTarget(__instance.damager); if ((Object)(object)ownerDefaultTarget == (Object)null) { ((FsmStateAction)__instance).Finish(); return false; } PlayerData.instance.isInvincible = false; HazardType val = (HazardType)1; if (__instance.spikeHazard) { val = (HazardType)2; } else if (__instance.sinkHazard) { val = (HazardType)9; } if (ownerDefaultTarget.transform.position.x > ((Component)HeroController.instance).gameObject.transform.position.x) { HeroController.instance.TakeDamage(ownerDefaultTarget.gameObject, (CollisionSide)2, __instance.damageAmount.Value, (int)val); } else { HeroController.instance.TakeDamage(ownerDefaultTarget.gameObject, (CollisionSide)1, __instance.damageAmount.Value, (int)val); } ((FsmStateAction)__instance).Finish(); return false; } return true; } } [HarmonyPatch(/*Could not decode attribute arguments.*/)] public class Patch_DamageHeroDirectlyV2_OnEnter : GeneralPatch { public static bool Prefix(DamageHeroDirectlyV2 __instance) { if (KnightInSilksong.IsKnight) { ModifiedOnEnter(__instance); return false; } return true; } public static void ModifiedOnEnter(DamageHeroDirectlyV2 __instance) { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Invalid comparison between Unknown and I4 //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_007c: 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_01de: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) GameObject ownerDefaultTarget = ((FsmStateAction)__instance).Fsm.GetOwnerDefaultTarget(__instance.damager); if ((Object)(object)ownerDefaultTarget == (Object)null) { return; } HeroController instance = HeroController.instance; PlayerDataAccess.isInvincible = false; _ = (HazardType)(object)__instance.hazardType.Value; if (((NamedVariable)__instance.overrideDirection).IsNone) { DamageDirection val = (DamageDirection)(object)__instance.damageDirection.Value; if ((int)val != 0) { if ((int)val == 1) { if (__instance.invertDirection.Value) { if (instance.transform.localScale.x > 0f) { instance.TakeDamage(ownerDefaultTarget.gameObject, (CollisionSide)2, __instance.damageAmount.Value, ((NamedVariable)__instance.hazardType).ToInt()); } else { instance.TakeDamage(ownerDefaultTarget.gameObject, (CollisionSide)1, __instance.damageAmount.Value, ((NamedVariable)__instance.hazardType).ToInt()); } } else if (instance.transform.localScale.x < 0f) { instance.TakeDamage(ownerDefaultTarget.gameObject, (CollisionSide)2, __instance.damageAmount.Value, ((NamedVariable)__instance.hazardType).ToInt()); } else { instance.TakeDamage(ownerDefaultTarget.gameObject, (CollisionSide)1, __instance.damageAmount.Value, ((NamedVariable)__instance.hazardType).ToInt()); } } } else if (__instance.invertDirection.Value) { if (ownerDefaultTarget.transform.position.x < ((Component)instance).gameObject.transform.position.x) { instance.TakeDamage(ownerDefaultTarget.gameObject, (CollisionSide)2, __instance.damageAmount.Value, ((NamedVariable)__instance.hazardType).ToInt()); } else { instance.TakeDamage(ownerDefaultTarget.gameObject, (CollisionSide)1, __instance.damageAmount.Value, ((NamedVariable)__instance.hazardType).ToInt()); } } else if (ownerDefaultTarget.transform.position.x > ((Component)instance).gameObject.transform.position.x) { instance.TakeDamage(ownerDefaultTarget.gameObject, (CollisionSide)2, __instance.damageAmount.Value, ((NamedVariable)__instance.hazardType).ToInt()); } else { instance.TakeDamage(ownerDefaultTarget.gameObject, (CollisionSide)1, __instance.damageAmount.Value, ((NamedVariable)__instance.hazardType).ToInt()); } } else { instance.TakeDamage(ownerDefaultTarget.gameObject, (CollisionSide)(object)__instance.overrideDirection.Value, __instance.damageAmount.Value, ((NamedVariable)__instance.hazardType).ToInt()); } ((FsmStateAction)__instance).Finish(); } } [HarmonyPatch(typeof(Extensions), "SetPosition2D", new Type[] { typeof(Transform), typeof(float), typeof(float) })] public class Patch_Extensions_SetPosition2D : GeneralPatch { public static bool Prefix(Transform t, float x, float y) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) if (KnightInSilksong.IsKnight && (Object)(object)t == (Object)(object)HeroController.instance.transform) { Transform transform = HeroController.instance.transform; transform.position = new Vector3(x, y, transform.position.z); } return true; } } [HarmonyPatch(typeof(Extensions), "SetPosition2D", new Type[] { typeof(Transform), typeof(Vector2) })] public class Patch_Extensions_SetPosition2D2 : GeneralPatch { public static bool Prefix(Transform t, ref Vector2 position) { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) if (KnightInSilksong.IsKnight && (Object)(object)t == (Object)(object)HeroController.instance.transform) { Transform transform = HeroController.instance.transform; transform.position = new Vector3(position.x, position.y, transform.position.z); } return true; } } [HarmonyPatch(typeof(FSMUtility), "SendEventToGameObject", new Type[] { typeof(GameObject), typeof(FsmEvent), typeof(bool) })] public class Patch_FSMUtility_SendEventToGameObject : GeneralPatch { public static bool Prefix(GameObject go, FsmEvent ev, bool isRecursive = false) { if (KnightInSilksong.IsKnight && (Object)(object)HeroController.instance != (Object)null && (Object)(object)go == (Object)(object)((Component)HeroController.instance).gameObject) { FSMUtility.SendEventToGameObject(((Component)HeroController.instance).gameObject, ev, isRecursive); return false; } return true; } } [HarmonyPatch(/*Could not decode attribute arguments.*/)] public class Patch_GameCameras_HUDOut : GeneralPatch { public static void Postfix(GameCameras __instance) { if (KnightInSilksong.IsKnight) { FSMUtility.SendEventToGameObject(KnightInSilksong.Instance.hud_instance, "OUT", false); "Hud OUT".LogInfo(); } } } [HarmonyPatch(/*Could not decode attribute arguments.*/)] public class Patch_GameCameras_HUDIn : GeneralPatch { public static void Postfix(GameCameras __instance) { if (KnightInSilksong.IsKnight) { FSMUtility.SendEventToGameObject(KnightInSilksong.Instance.hud_instance, "IN", false); "Hud IN".LogInfo(); } } } [HarmonyPatch(/*Could not decode attribute arguments.*/)] public class Patch_GameManager_PositionHeroAtSceneEntrance : GeneralPatch { public static void Postfix(GameManager __instance) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) if (KnightInSilksong.IsKnight) { HeroController.instance.transform.position = HeroController.instance.transform.position; } } } [HarmonyPatch(typeof(GameManager), "SetIsInventoryOpen", new Type[] { typeof(bool) })] public class Patch_GameManager_SetIsInventoryOpen : GeneralPatch { public static void Postfix(GameManager __instance, bool value) { if (KnightInSilksong.IsKnight) { if (value) { __instance.SetTimeScale(1f); HeroController.instance.RelinquishControl(); } else { HeroController.instance.RegainControl(); } } } } [HarmonyPatch(/*Could not decode attribute arguments.*/)] public class Patch_GameManager_ReturnToMainMenu : GeneralPatch { public static bool Prefix(GameManager __instance) { if (KnightInSilksong.IsKnight) { KnightInSilksong.Instance.ToggleKnight(); KnightInSilksong.return_to_main_menu = true; "return to Main Menu".LogInfo(); } KISHelper.OnReturnToMenu?.Invoke(); return true; } } [HarmonyPatch(typeof(GameManager), "StartNewGame", new Type[] { typeof(bool), typeof(bool) })] public class Patch_GameManager_StartNewGame : GeneralPatch { public static bool Prefix(GameManager __instance, bool permadeathMode, bool bossRushMode) { int profileID = __instance.profileID; if (profileID == 0) { return true; } KnightInSilksong.Instance.current_data = SlotData.CreateSave(profileID, KnightInSilksong.default_sync.Value); return true; } public static void Postfix(GameManager __instance, bool permadeathMode, bool bossRushMode) { } } [HarmonyPatch(typeof(GameManager), "SetLoadedGameData", new Type[] { typeof(SaveGameData), typeof(int) })] public class Patch_GameManager_SetLoadedGameData : GeneralPatch { public static bool Prefix(GameManager __instance, SaveGameData saveGameData, int saveSlot) { if (saveSlot == 0) { return true; } KnightInSilksong.Instance.current_data = new SlotData(saveSlot); KnightInSilksong.Instance.current_data.LoadSave(); return true; } public static void Postfix(GameManager __instance, SaveGameData saveGameData, int saveSlot) { } } [HarmonyPatch(typeof(GameManager), "SaveGame", new Type[] { typeof(int), typeof(Action<bool>), typeof(bool), typeof(AutoSaveName) })] public class Patch_GameManager_SaveGame : GeneralPatch { public static bool Prefix(GameManager __instance, int saveSlot, ref Action<bool> ogCallback, bool withAutoSave, AutoSaveName autoSaveName) { if (saveSlot == 0) { return true; } Action<bool> ogCallbackCopy = ogCallback; ogCallback = delegate(bool didSave) { ogCallbackCopy?.Invoke(didSave); if (didSave) { KnightInSilksong.Instance.current_data.SaveSave(); } }; return true; } } [HarmonyPatch(/*Could not decode attribute arguments.*/)] public class Patch_GameManager_ClearSaveFile : GeneralPatch { public static bool Prefix(GameManager __instance, int saveSlot, Action<bool> callback) { return true; } public static void Postfix(GameManager __instance, int saveSlot, Action<bool> callback) { SlotData.DeleteSave(saveSlot); } } [HarmonyPatch(/*Could not decode attribute arguments.*/)] public class Patch_GameSettings_LoadAudioSettings : GeneralPatch { public static void Postfix(GameSettings __instance) { AudioMixer master = KnightInSilksong.Master; float masterVolume = __instance.masterVolume; float soundVolume = __instance.soundVolume; float num = Helper.LinearToDecibel(masterVolume / 10f); master.SetFloat("MasterVolume", num); num = Helper.LinearToDecibel(soundVolume / 10f); master.SetFloat("SFXVolume", num); "LoadAudioSettings OK".LogInfo(); } } [HarmonyPatch(typeof(GameObject), "GetComponentByName")] internal class PatchGetComponent : GeneralPatch { public static bool Prefix(GameObject __instance, ref Component __result, ref string type) { switch (type) { case "HeroController": __result = __instance.GetAnyComponent<HeroController, HeroController>(); return false; case "HeroAudioController": __result = __instance.GetAnyComponent<HeroAudioController, HeroAudioController>(); return false; case "HeroAnimationController": __result = __instance.GetAnyComponent<HeroAnimationController, HeroAnimationController>(); return false; case "HeroBox": __result = __instance.GetAnyComponent<HeroBox, HeroBox>(); return false; case "NailSlash": __result = __instance.GetAnyComponent<NailSlash, NailSlash>(); return false; default: return true; } } } [HarmonyPatch(/*Could not decode attribute arguments.*/)] public class Patch_GetHero_OnEnter : GeneralPatch { public static HashSet<(string, string)> blacklist = new HashSet<(string, string)> { ("RestBench", "Bench Control") }; public static bool Prefix(GetHero __instance) { return true; } public static void Postfix(GetHero __instance) { } } [HarmonyPatch(/*Could not decode attribute arguments.*/)] public class Patch_GetHeroCState_DoAction : GeneralPatch { public static bool Prefix(GetHeroCState __instance) { if (KnightInSilksong.IsKnight && !((NamedVariable)__instance.VariableName).IsNone && !((NamedVariable)__instance.StoreValue).IsNone && __instance.VariableName.Value == "parrying") { bool flag = false; HeroController instance = HeroController.instance; flag = instance.playerData.equippedCharm_5 && instance.playerData.blockerHits > 0 && instance.cState.focusing; __instance.StoreValue.Value = flag; return false; } return true; } } [HarmonyPatch(/*Could not decode attribute arguments.*/)] public class Patch_GetNailDamage_OnEnter : GeneralPatch { public static bool Prefix(GetNailDamage __instance) { if (KnightInSilksong.IsKnight) { KnightOnEnter(__instance); return false; } return true; } public static void KnightOnEnter(GetNailDamage __instance) { if (!((NamedVariable)__instance.storeValue).IsNone) { if (BossSequenceController.BoundNail) { __instance.storeValue.Value = Mathf.Min(PlayerData.instance.nailDamage, BossSequenceController.BoundNailDamage); } else { __instance.storeValue.Value = PlayerData.instance.nailDamage; } } ((FsmStateAction)__instance).Finish(); } } public static class KnightGetHornetPD { private static HashSet<string> knight_get_hornet_pd_list = new HashSet<string> { "geo" }; public static bool IsFromHornet(string name) { return knight_get_hornet_pd_list.Contains(name); } } [HarmonyPatch(/*Could not decode attribute arguments.*/)] public class Patch_GetPlayerDataBool_OnEnter : GeneralPatch { public static bool Prefix(GetPlayerDataBool __instance) { if (KnightInSilksong.IsKnight && ((FsmStateAction)__instance).fsm.GetVariable<FsmBool>("FromKnight") != null && !KnightGetHornetPD.IsFromHornet(__instance.boolName.Value)) { if (__instance.boolName.value == "EncounteredLostLace") { (((FsmStateAction)__instance).fsm.name + " " + ((FsmStateAction)__instance).State.name + " GetPlayerDataBool").LogInfo(); } __instance.storeValue.Value = PlayerData.instance.GetBool(__instance.boolName.Value); ((FsmStateAction)__instance).Finish(); return false; } return true; } public static void Postfix(GetPlayerDataBool __instance) { } } [HarmonyPatch(/*Could not decode attribute arguments.*/)] public class Patch_GetPlayerDataFloat_OnEnter : GeneralPatch { public static bool Prefix(GetPlayerDataFloat __instance) { if (KnightInSilksong.IsKnight && ((FsmStateAction)__instance).fsm.GetVariable<FsmBool>("FromKnight") != null && !KnightGetHornetPD.IsFromHornet(__instance.floatName.Value)) { __instance.storeValue.Value = PlayerData.instance.GetFloat(__instance.floatName.Value); ((FsmStateAction)__instance).Finish(); return false; } return true; } public static void Postfix(GetPlayerDataFloat __instance) { } } [HarmonyPatch(/*Could not decode attribute arguments.*/)] public class Patch_GetPlayerDataInt_OnEnter : GeneralPatch { public static bool Prefix(GetPlayerDataInt __instance) { if (KnightInSilksong.IsKnight && ((FsmStateAction)__instance).fsm.GetVariable<FsmBool>("FromKnight") != null && !KnightGetHornetPD.IsFromHornet(__instance.intName.Value)) { __instance.storeValue.Value = PlayerData.instance.GetInt(__instance.intName.Value); ((FsmStateAction)__instance).Finish(); return false; } return true; } public static void Postfix(GetPlayerDataInt __instance) { } } [HarmonyPatch(/*Could not decode attribute arguments.*/)] public class Patch_GetPlayerDataString_OnEnter : GeneralPatch { public static bool Prefix(GetPlayerDataString __instance) { if (KnightInSilksong.IsKnight && ((FsmStateAction)__instance).fsm.GetVariable<FsmBool>("FromKnight") != null && KnightGetHornetPD.IsFromHornet(__instance.stringName.Value)) { __instance.storeValue.Value = PlayerData.instance.GetString(__instance.stringName.Value); ((FsmStateAction)__instance).Finish(); return false; } return true; } public static void Postfix(GetPlayerDataString __instance) { } } [HarmonyPatch(/*Could not decode attribute arguments.*/)] public class Patch_GetPlayerDataVector3_OnEnter : GeneralPatch { public static bool Prefix(GetPlayerDataVector3 __instance) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) if (KnightInSilksong.IsKnight && ((FsmStateAction)__instance).fsm.GetVariable<FsmBool>("FromKnight") != null && !KnightGetHornetPD.IsFromHornet(__instance.vector3Name.Value)) { __instance.storeValue.Value = PlayerData.instance.GetVector3(__instance.vector3Name.Value); ((FsmStateAction)__instance).Finish(); return false; } return true; } public static void Postfix(GetPlayerDataVector3 __instance) { } } [HarmonyPatch(/*Could not decode attribute arguments.*/)] public class Patch_PlayerDataBoolTest_OnEnter : GeneralPatch { private static List<string> in_knight_bool = new List<string> { "isInvincible" }; public static bool Prefix(PlayerDataBoolTest __instance) { if (KnightInSilksong.IsKnight && (((FsmStateAction)__instance).fsm.GetVariable<FsmBool>("FromKnight") != null || Extensions.IsAny(__instance.boolName.Value, in_knight_bool.ToArray()))) { bool @bool = PlayerData.instance.GetBool(__instance.boolName.Value); ((FsmStateAction)__instance).fsm.Event(@bool ? __instance.isTrue : __instance.isFalse); ((FsmStateAction)__instance).Finish(); return false; } return true; } public static void Postfix(PlayerDataBoolTest __instance) { } } [HarmonyPatch(/*Could not decode attribute arguments.*/)] public class Patch_PlayerDataBoolAllTrue_DoAllTrue : GeneralPatch { public static bool Prefix(PlayerDataBoolAllTrue __instance) { if (KnightInSilksong.IsKnight && ((FsmStateAction)__instance).fsm.GetVariable<FsmBool>("FromKnight") != null) { bool flag = true; for (int i = 0; i < __instance.stringVariables.Length; i++) { if (!PlayerData.instance.GetBool(__instance.stringVariables[i].Value)) { flag = false; break; } } if (flag) { ((FsmStateAction)__instance).Fsm.Event(__instance.trueEvent); } else { ((FsmStateAction)__instance).Fsm.Event(__instance.falseEvent); } __inst
Knight.dll
Decompiled a day ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using GlobalEnums; using HutongGames.PlayMaker; using InControl; using Microsoft.CodeAnalysis; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: IgnoresAccessChecksTo("Accessibility")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp-firstpass")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: IgnoresAccessChecksTo("Coffee.SoftMaskForUGUI")] [assembly: IgnoresAccessChecksTo("com.rlabrecque.steamworks.net")] [assembly: IgnoresAccessChecksTo("ConditionalExpression")] [assembly: IgnoresAccessChecksTo("GalaxyCSharp")] [assembly: IgnoresAccessChecksTo("Newtonsoft.Json")] [assembly: IgnoresAccessChecksTo("Newtonsoft.Json.UnityConverters.Addressables")] [assembly: IgnoresAccessChecksTo("Newtonsoft.Json.UnityConverters")] [assembly: IgnoresAccessChecksTo("Newtonsoft.Json.UnityConverters.Mathematics")] [assembly: IgnoresAccessChecksTo("PlayMaker")] [assembly: IgnoresAccessChecksTo("SharpDX.DirectInput")] [assembly: IgnoresAccessChecksTo("SharpDX")] [assembly: IgnoresAccessChecksTo("TeamCherry.BuildBot")] [assembly: IgnoresAccessChecksTo("TeamCherry.Cinematics")] [assembly: IgnoresAccessChecksTo("TeamCherry.Localization")] [assembly: IgnoresAccessChecksTo("TeamCherry.NestedFadeGroup")] [assembly: IgnoresAccessChecksTo("TeamCherry.SharedUtils")] [assembly: IgnoresAccessChecksTo("TeamCherry.Splines")] [assembly: IgnoresAccessChecksTo("TeamCherry.TK2D")] [assembly: IgnoresAccessChecksTo("Unity.Addressables")] [assembly: IgnoresAccessChecksTo("Unity.Burst")] [assembly: IgnoresAccessChecksTo("Unity.Burst.Unsafe")] [assembly: IgnoresAccessChecksTo("Unity.Collections")] [assembly: IgnoresAccessChecksTo("Unity.Collections.LowLevel.ILSupport")] [assembly: IgnoresAccessChecksTo("Unity.InputSystem")] [assembly: IgnoresAccessChecksTo("Unity.InputSystem.ForUI")] [assembly: IgnoresAccessChecksTo("Unity.Mathematics")] [assembly: IgnoresAccessChecksTo("Unity.MemoryProfiler")] [assembly: IgnoresAccessChecksTo("Unity.Profiling.Core")] [assembly: IgnoresAccessChecksTo("Unity.Recorder.Base")] [assembly: IgnoresAccessChecksTo("Unity.Recorder")] [assembly: IgnoresAccessChecksTo("Unity.ResourceManager")] [assembly: IgnoresAccessChecksTo("Unity.ScriptableBuildPipeline")] [assembly: IgnoresAccessChecksTo("Unity.TextMeshPro")] [assembly: IgnoresAccessChecksTo("Unity.Timeline")] [assembly: IgnoresAccessChecksTo("UnityEngine.AccessibilityModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.AIModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.AMDModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.AndroidJNIModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.AnimationModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.ARModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.AssetBundleModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.AudioModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.ClothModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.ClusterInputModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.ClusterRendererModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.ContentLoadModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.CoreModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.CrashReportingModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.DirectorModule")] [assembly: IgnoresAccessChecksTo("UnityEngine")] [assembly: IgnoresAccessChecksTo("UnityEngine.DSPGraphModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.GameCenterModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.GIModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.GraphicsStateCollectionSerializerModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.GridModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.HierarchyCoreModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.HotReloadModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.ImageConversionModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.IMGUIModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.InputForUIModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.InputLegacyModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.InputModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.JSONSerializeModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.LocalizationModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.MarshallingModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.MultiplayerModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.NVIDIAModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.ParticleSystemModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.PerformanceReportingModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.Physics2DModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.PhysicsModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.PropertiesModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.ScreenCaptureModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.ShaderVariantAnalyticsModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.SharedInternalsModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.SpriteMaskModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.SpriteShapeModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.StreamingModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.SubstanceModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.SubsystemsModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.TerrainModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.TerrainPhysicsModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.TextCoreFontEngineModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.TextCoreTextEngineModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.TextRenderingModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.TilemapModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.TLSModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.UI")] [assembly: IgnoresAccessChecksTo("UnityEngine.UIElementsModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.UIModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.UmbraModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.UnityAnalyticsCommonModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.UnityAnalyticsModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.UnityConnectModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.UnityCurlModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.UnityTestProtocolModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.UnityWebRequestAssetBundleModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.UnityWebRequestAudioModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.UnityWebRequestModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.UnityWebRequestTextureModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.UnityWebRequestWWWModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.VehiclesModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.VFXModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.VideoModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.VirtualTexturingModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.VRModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.WindModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.XRModule")] [assembly: IgnoresAccessChecksTo("XblPCSandbox")] [assembly: IgnoresAccessChecksTo("XGamingRuntime")] [assembly: IgnoresAccessChecksTo("zlib.net")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("Knight")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+8019a2edf7d42d4a3b2650c103350776973ed3a0")] [assembly: AssemblyProduct("Knight")] [assembly: AssemblyTitle("Knight")] [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.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace Knight { public class HeroAnimationController : MonoBehaviour { public tk2dSpriteAnimator animator; private HeroController heroCtrl; private HeroControllerStates cState; private PlayerData pd; [HideInInspector] public bool playLanding; private bool playRunToIdle; private bool playDashToIdle; private bool playBackDashToIdleEnd; public bool wasAttacking; private bool wasFacingRight; [HideInInspector] public bool setEntryAnim; private bool changedClipFromLastFrame; private bool attackComplete; public ActorStates actorState { get; private set; } public ActorStates prevActorState { get; private set; } public ActorStates stateBeforeControl { get; private set; } public bool controlEnabled { get; private set; } private void Awake() { animator = ((Component)this).GetComponent<tk2dSpriteAnimator>(); heroCtrl = ((Component)this).GetComponent<HeroController>(); cState = heroCtrl.cState; } private void Start() { //IL_0018: 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_0036: Invalid comparison between Unknown and I4 pd = PlayerData.instance; ResetAll(); actorState = heroCtrl.hero_state; if (controlEnabled) { if ((int)heroCtrl.hero_state == 3) { PlayFromFrame("Airborne", 7); } else { PlayIdle(); } } else { animator.Stop(); } } private void Update() { if (controlEnabled) { UpdateAnimation(); } else if (cState.facingRight) { wasFacingRight = true; } else { wasFacingRight = false; } if (pd.betaEnd) { animator.Play("Run"); } } private void ResetAll() { playLanding = false; playRunToIdle = false; playDashToIdle = false; wasFacingRight = false; controlEnabled = true; } private void ResetPlays() { playLanding = false; playRunToIdle = false; playDashToIdle = false; } public void UpdateState(ActorStates newState) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Invalid comparison between Unknown and I4 //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Invalid comparison between Unknown and I4 //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Invalid comparison between Unknown and I4 //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Invalid comparison between Unknown and I4 if (controlEnabled && newState != actorState) { if ((int)actorState == 3 && (int)newState == 1 && !playLanding) { playLanding = true; } if ((int)actorState == 2 && (int)newState == 1 && !playRunToIdle && !cState.inWalkZone && !cState.attacking) { playRunToIdle = true; } prevActorState = actorState; actorState = newState; } } public void PlayClip(string clipName) { if (controlEnabled) { if (clipName == "Exit Door To Idle") { animator.AnimationCompleted = AnimationCompleteDelegate; } Play(clipName); } } private void UpdateAnimation() { //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Invalid comparison between Unknown and I4 //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Invalid comparison between Unknown and I4 //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Invalid comparison between Unknown and I4 //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Invalid comparison between Unknown and I4 //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Invalid comparison between Unknown and I4 //IL_044b: Unknown result type (might be due to invalid IL or missing references) //IL_0451: Invalid comparison between Unknown and I4 //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Invalid comparison between Unknown and I4 //IL_04d1: Unknown result type (might be due to invalid IL or missing references) //IL_04d7: Invalid comparison between Unknown and I4 //IL_052c: Unknown result type (might be due to invalid IL or missing references) //IL_0532: Invalid comparison between Unknown and I4 //IL_025f: Unknown result type (might be due to invalid IL or missing references) //IL_060c: Unknown result type (might be due to invalid IL or missing references) //IL_0612: Invalid comparison between Unknown and I4 //IL_027a: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Invalid comparison between Unknown and I4 //IL_0622: Unknown result type (might be due to invalid IL or missing references) //IL_0628: Invalid comparison between Unknown and I4 changedClipFromLastFrame = false; if (playLanding) { Play("Land"); animator.AnimationCompleted = AnimationCompleteDelegate; playLanding = false; } if (playRunToIdle) { Play("Run To Idle"); animator.AnimationCompleted = AnimationCompleteDelegate; playRunToIdle = false; } if (playBackDashToIdleEnd) { Play("Backdash Land 2"); animator.AnimationCompleted = AnimationCompleteDelegate; playBackDashToIdleEnd = false; } if (playDashToIdle) { Play("Dash To Idle"); animator.AnimationCompleted = AnimationCompleteDelegate; playDashToIdle = false; } if ((int)actorState == 7) { if (cState.recoilFrozen) { Play("Stun"); } else if (cState.recoiling) { Play("Recoil"); } else if (cState.transitioning) { if (cState.onGround) { if ((int)heroCtrl.transitionState == 1) { if (!animator.IsPlaying("Run")) { if (!pd.equippedCharm_37) { Play("Run"); } else { Play("Sprint"); } } } else if ((int)heroCtrl.transitionState == 3) { if (!pd.equippedCharm_37) { if (!animator.IsPlaying("Run")) { PlayFromFrame("Run", 3); } } else { Play("Sprint"); } } } else if ((int)heroCtrl.transitionState == 1) { if (!animator.IsPlaying("Airborne")) { PlayFromFrame("Airborne", 7); } } else if ((int)heroCtrl.transitionState == 2) { if (!animator.IsPlaying("Airborne")) { PlayFromFrame("Airborne", 7); } } else if ((int)heroCtrl.transitionState == 3 && !setEntryAnim) { if ((int)heroCtrl.gatePosition == 0) { PlayFromFrame("Airborne", 7); } else if ((int)heroCtrl.gatePosition == 3) { PlayFromFrame("Airborne", 3); } setEntryAnim = true; } } } else if (setEntryAnim) { setEntryAnim = false; } else if (cState.dashing) { if (heroCtrl.dashingDown) { if (cState.shadowDashing) { if (pd.equippedCharm_16) { Play("Shadow Dash Down Sharp"); } else { Play("Shadow Dash Down"); } } else { Play("Dash Down"); } } else if (cState.shadowDashing) { if (pd.equippedCharm_16) { Play("Shadow Dash Sharp"); } else { Play("Shadow Dash"); } } else { Play("Dash"); } } else if (cState.backDashing) { Play("Back Dash"); } else if (cState.attacking) { if (cState.upAttacking) { Play("UpSlash"); } else if (cState.downAttacking) { Play("DownSlash"); } else if (cState.wallSliding) { Play("Wall Slash"); } else if (!cState.altAttack) { Play("Slash"); } else { Play("SlashAlt"); } } else if (cState.casting) { Play("Fireball"); } else if (cState.wallSliding) { Play("Wall Slide"); } else if ((int)actorState == 1) { if (cState.lookingUpAnim && !animator.IsPlaying("LookUp")) { Play("LookUp"); } else if (CanPlayLookDown()) { Play("LookDown"); } else if (!cState.lookingUpAnim && !cState.lookingDownAnim && CanPlayIdle()) { PlayIdle(); } } else if ((int)actorState == 2) { if (!animator.IsPlaying("Turn")) { if (cState.inWalkZone) { if (!animator.IsPlaying("Walk")) { Play("Walk"); } } else { PlayRun(); } } } else if ((int)actorState == 3) { if (cState.swimming) { Play("Swim"); } else if (heroCtrl.wallLocked) { Play("Walljump"); } else if (cState.doubleJumping) { Play("Double Jump"); } else if (cState.jumping) { if (!animator.IsPlaying("Airborne")) { PlayFromFrame("Airborne", 0); } } else if (cState.falling) { if (!animator.IsPlaying("Airborne")) { PlayFromFrame("Airborne", 5); } } else if (!animator.IsPlaying("Airborne")) { PlayFromFrame("Airborne", 3); } } else if ((int)actorState == 6) { Play("Dash Down Land"); } else if ((int)actorState == 5) { Play("HardLand"); } if (cState.facingRight) { if (!wasFacingRight && cState.onGround && canPlayTurn()) { Play("Turn"); } wasFacingRight = true; } else { if (wasFacingRight && cState.onGround && canPlayTurn()) { Play("Turn"); } wasFacingRight = false; } if (cState.attacking) { wasAttacking = true; } else { wasAttacking = false; } ResetPlays(); } private bool CanPlayIdle() { if (!animator.IsPlaying("Land") && !animator.IsPlaying("Run To Idle") && !animator.IsPlaying("Dash To Idle") && !animator.IsPlaying("Backdash Land") && !animator.IsPlaying("Backdash Land 2") && !animator.IsPlaying("LookUpEnd") && !animator.IsPlaying("LookDownEnd") && !animator.IsPlaying("Exit Door To Idle") && !animator.IsPlaying("Wake Up Ground") && !animator.IsPlaying("Hazard Respawn")) { return true; } return false; } private bool CanPlayLookDown() { if (cState.lookingDownAnim && !animator.IsPlaying("Lookup")) { return true; } return false; } private bool canPlayTurn() { if (!animator.IsPlaying("Wake Up Ground") && !animator.IsPlaying("Hazard Respawn")) { return true; } return false; } private void AnimationCompleteDelegate(tk2dSpriteAnimator sprite, tk2dSpriteAnimationClip clip) { if (clip.name == "Land") { PlayIdle(); } if (clip.name == "Run To Idle") { PlayIdle(); } if (clip.name == "Backdash To Idle") { PlayIdle(); } if (clip.name == "Dash To Idle") { PlayIdle(); } if (clip.name == "Exit Door To Idle") { PlayIdle(); } } public void PlayIdle() { if (pd.health == 1 && pd.healthBlue < 1) { if (pd.equippedCharm_6) { animator.Play("Idle"); } else { animator.Play("Idle Hurt"); } } else if (animator.IsPlaying("LookUp")) { animator.Play("LookUpEnd"); } else if (animator.IsPlaying("LookDown")) { animator.Play("LookDownEnd"); } else if (heroCtrl.wieldingLantern) { animator.Play("Lantern Idle"); } else { animator.Play("Idle"); } } private void PlayRun() { if (heroCtrl.wieldingLantern) { animator.Play("Lantern Run"); } else if (pd.equippedCharm_37) { Play("Sprint"); } else if (wasAttacking) { animator.PlayFromFrame("Run", 3); } else { animator.Play("Run"); } } private void Play(string clipName) { if (clipName != animator.CurrentClip.name) { changedClipFromLastFrame = true; } animator.Play(clipName); } private void PlayFromFrame(string clipName, int frame) { if (clipName != animator.CurrentClip.name) { changedClipFromLastFrame = true; } animator.PlayFromFrame(clipName, frame); } public void StopControl() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) if (controlEnabled) { controlEnabled = false; stateBeforeControl = actorState; } } public void StartControl() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) actorState = heroCtrl.hero_state; controlEnabled = true; PlayIdle(); } public void StartControlWithoutSettingState() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Invalid comparison between Unknown and I4 //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Invalid comparison between Unknown and I4 controlEnabled = true; if ((int)stateBeforeControl == 2 && (int)actorState == 2) { actorState = (ActorStates)1; } } public void FinishedDash() { playDashToIdle = true; } public void StopAttack() { if (animator.IsPlaying("UpSlash") || animator.IsPlaying("DownSlash")) { animator.Stop(); } } public float GetCurrentClipDuration() { return (float)animator.CurrentClip.frames.Length / animator.CurrentClip.fps; } public float GetClipDuration(string clipName) { if ((Object)(object)animator == (Object)null) { animator = ((Component)this).GetComponent<tk2dSpriteAnimator>(); } tk2dSpriteAnimationClip clipByName = animator.GetClipByName(clipName); if (clipByName == null) { Debug.LogError((object)("HeroAnim: Could not find animation clip with the name " + clipName)); return -1f; } return (float)clipByName.frames.Length / clipByName.fps; } } public class HeroAudioController : MonoBehaviour { [CompilerGenerated] private sealed class <FadeInVolume>d__23 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public AudioSource src; public float duration; private float <elapsedTime>5__2; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <FadeInVolume>d__23(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; <elapsedTime>5__2 = 0f; src.volume = 0f; break; case 1: <>1__state = -1; break; } if (<elapsedTime>5__2 < duration) { <elapsedTime>5__2 += Time.deltaTime; float num = <elapsedTime>5__2 / duration; src.volume = Mathf.Lerp(0f, 1f, num); <>2__current = null; <>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 HeroController heroCtrl; [Header("Sound Effects")] public AudioSource softLanding; public AudioSource hardLanding; public AudioSource jump; public AudioSource takeHit; public AudioSource backDash; public AudioSource dash; public AudioSource footStepsRun; public AudioSource footStepsWalk; public AudioSource wallslide; public AudioSource nailArtCharge; public AudioSource nailArtReady; public AudioSource falling; public AudioSource walljump; private Coroutine fallingCo; private void Awake() { heroCtrl = ((Component)this).GetComponent<HeroController>(); } public void PlaySound(HeroSounds soundEffect) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Expected I4, but got Unknown if (heroCtrl.cState.isPaused) { return; } switch ((int)soundEffect) { case 4: RandomizePitch(jump, 0.9f, 1.1f); softLanding.Play(); break; case 5: hardLanding.Play(); break; case 2: RandomizePitch(jump, 0.9f, 1.1f); jump.Play(); break; case 3: RandomizePitch(walljump, 0.9f, 1.1f); walljump.Play(); break; case 8: takeHit.Play(); break; case 7: dash.Play(); break; case 9: wallslide.Play(); break; case 6: backDash.Play(); break; case 0: if (!footStepsRun.isPlaying && !softLanding.isPlaying) { footStepsRun.Play(); } break; case 1: if (!footStepsWalk.isPlaying && !softLanding.isPlaying) { footStepsWalk.Play(); } break; case 10: nailArtCharge.Play(); break; case 11: nailArtReady.Play(); break; case 12: fallingCo = ((MonoBehaviour)this).StartCoroutine(FadeInVolume(falling, 0.7f)); falling.Play(); break; } } public void StopSound(HeroSounds soundEffect) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Invalid comparison between Unknown and I4 //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected I4, but got Unknown if ((int)soundEffect != 0) { if ((int)soundEffect != 1) { switch (soundEffect - 9) { case 0: wallslide.Stop(); break; case 1: nailArtCharge.Stop(); break; case 2: nailArtReady.Stop(); break; case 3: falling.Stop(); if (fallingCo != null) { ((MonoBehaviour)this).StopCoroutine(fallingCo); } break; } } else { footStepsWalk.Stop(); } } else { footStepsRun.Stop(); } } public void StopAllSounds() { softLanding.Stop(); hardLanding.Stop(); jump.Stop(); takeHit.Stop(); backDash.Stop(); dash.Stop(); footStepsRun.Stop(); footStepsWalk.Stop(); wallslide.Stop(); nailArtCharge.Stop(); nailArtReady.Stop(); falling.Stop(); } public void PauseAllSounds() { softLanding.Pause(); hardLanding.Pause(); jump.Pause(); takeHit.Pause(); backDash.Pause(); dash.Pause(); footStepsRun.Pause(); footStepsWalk.Pause(); wallslide.Pause(); nailArtCharge.Pause(); nailArtReady.Pause(); falling.Pause(); } public void UnPauseAllSounds() { softLanding.UnPause(); hardLanding.UnPause(); jump.UnPause(); takeHit.UnPause(); backDash.UnPause(); dash.UnPause(); footStepsRun.UnPause(); footStepsWalk.UnPause(); wallslide.UnPause(); nailArtCharge.UnPause(); nailArtReady.UnPause(); falling.UnPause(); } private void RandomizePitch(AudioSource src, float minPitch, float maxPitch) { float pitch = Random.Range(minPitch, maxPitch); src.pitch = pitch; } private void ResetPitch(AudioSource src) { src.pitch = 1f; } [IteratorStateMachine(typeof(<FadeInVolume>d__23))] private IEnumerator FadeInVolume(AudioSource src, float duration) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <FadeInVolume>d__23(0) { src = src, duration = duration }; } } public class HeroBox : MonoBehaviour { public static bool inactive; private HeroController heroCtrl; private GameObject damagingObject; private bool isHitBuffered; private int damageDealt; private int hazardType; private CollisionSide collisionSide; private void Start() { heroCtrl = HeroController.instance; } private void OnTriggerEnter2D(Collider2D otherCollider) { if (!inactive) { CheckForDamage(otherCollider); } } private void OnTriggerStay2D(Collider2D otherCollider) { if (!inactive) { CheckForDamage(otherCollider); } } private void CheckForDamage(Collider2D otherCollider) { //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_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Expected I4, but got Unknown //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) if (FSMUtility.ContainsFSM(((Component)otherCollider).gameObject, "damages_hero")) { PlayMakerFSM obj = FSMUtility.LocateFSM(((Component)otherCollider).gameObject, "damages_hero"); int @int = FSMUtility.GetInt(obj, "damageDealt"); int int2 = FSMUtility.GetInt(obj, "hazardType"); if (((Component)otherCollider).transform.position.x > ((Component)this).transform.position.x) { heroCtrl.TakeDamage(((Component)otherCollider).gameObject, (CollisionSide)2, @int, int2); } else { heroCtrl.TakeDamage(((Component)otherCollider).gameObject, (CollisionSide)1, @int, int2); } return; } DamageHero component = ((Component)otherCollider).gameObject.GetComponent<DamageHero>(); if ((Object)(object)component != (Object)null && !heroCtrl.cState.shadowDashing) { damageDealt = component.damageDealt; hazardType = (int)component.hazardType; damagingObject = ((Component)otherCollider).gameObject; collisionSide = (CollisionSide)((!(damagingObject.transform.position.x > ((Component)this).transform.position.x)) ? 1 : 2); if (!IsHitTypeBuffered(hazardType)) { ApplyBufferedHit(); } else { isHitBuffered = true; } } } private static bool IsHitTypeBuffered(int hazardType) { return hazardType == 0; } private void LateUpdate() { if (isHitBuffered) { ApplyBufferedHit(); } } private void ApplyBufferedHit() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) heroCtrl.TakeDamage(damagingObject, collisionSide, damageDealt, hazardType); isHitBuffered = false; } } public class HeroController : MonoBehaviour { public delegate void HeroInPosition(bool forceDirect); public delegate void TakeDamageEvent(); public delegate void HeroDeathEvent(); [CompilerGenerated] private sealed class <BetaLeave>d__466 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public HeroController <>4__this; public EndBeta betaEndTrigger; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <BetaLeave>d__466(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Expected O, but got Unknown //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Expected O, but got Unknown int num = <>1__state; HeroController heroController = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; if (!heroController.playerData.betaEnd) { heroController.endBeta = betaEndTrigger; heroController.IgnoreInput(); heroController.playerData.disablePause = true; heroController.SetState((ActorStates)7); heroController.ResetInput(); heroController.tilemapTestActive = false; <>2__current = (object)new WaitForSeconds(0.66f); <>1__state = 1; return true; } break; case 1: <>1__state = -1; GameObject.Find("Beta Ender").GetComponent<SimpleSpriteFade>().FadeIn(); heroController.ResetMotion(); <>2__current = (object)new WaitForSeconds(1.25f); <>1__state = 2; return true; case 2: <>1__state = -1; heroController.playerData.betaEnd = true; break; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <BetaReturn>d__467 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public HeroController <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <BetaReturn>d__467(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Expected O, but got Unknown int num = <>1__state; HeroController heroController = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; heroController.rb2d.velocity = new Vector2(heroController.RUN_SPEED, 0f); if (!heroController.cState.facingRight) { heroController.FlipSprite(); } GameObject.Find("Beta Ender").GetComponent<SimpleSpriteFade>().FadeOut(); heroController.animCtrl.PlayClip("Run"); <>2__current = (object)new WaitForSeconds(1.4f); <>1__state = 1; return true; case 1: <>1__state = -1; heroController.SetState((ActorStates)0); heroController.SetStartingMotionState(); heroController.AcceptInput(); heroController.playerData.betaEnd = false; heroController.playerData.disablePause = false; heroController.tilemapTestActive = true; if ((Object)(object)heroController.endBeta != (Object)null) { heroController.endBeta.Reactivate(); } 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 <CheckForTerrainThunk>d__562 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public HeroController <>4__this; public AttackDirection attackDir; private bool <terrainHit>5__2; private float <thunkTimer>5__3; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <CheckForTerrainThunk>d__562(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_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_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Expected I4, but got Unknown //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_0276: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Unknown result type (might be due to invalid IL or missing references) //IL_0299: 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_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02ac: 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_02b3: Invalid comparison between Unknown and I4 int num = <>1__state; HeroController heroController = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <terrainHit>5__2 = false; <thunkTimer>5__3 = heroController.NAIL_TERRAIN_CHECK_TIME; break; case 1: <>1__state = -1; break; } if (<thunkTimer>5__3 > 0f) { if (!<terrainHit>5__2) { float num2 = 0.25f; float num3 = (((int)attackDir != 0) ? 1.5f : 2f); float num4 = 1f; if (heroController.playerData.equippedCharm_18) { num4 += 0.2f; } if (heroController.playerData.equippedCharm_13) { num4 += 0.3f; } num3 *= num4; Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(0.45f, 0.45f); Bounds bounds = heroController.col2d.bounds; float x = ((Bounds)(ref bounds)).center.x; bounds = heroController.col2d.bounds; Vector2 val2 = default(Vector2); ((Vector2)(ref val2))..ctor(x, ((Bounds)(ref bounds)).center.y + num2); bounds = heroController.col2d.bounds; float x2 = ((Bounds)(ref bounds)).center.x; bounds = heroController.col2d.bounds; Vector2 val3 = default(Vector2); ((Vector2)(ref val3))..ctor(x2, ((Bounds)(ref bounds)).max.y); bounds = heroController.col2d.bounds; float x3 = ((Bounds)(ref bounds)).center.x; bounds = heroController.col2d.bounds; Vector2 val4 = default(Vector2); ((Vector2)(ref val4))..ctor(x3, ((Bounds)(ref bounds)).min.y); int num5 = 33554688; RaycastHit2D val5 = default(RaycastHit2D); AttackDirection val6 = attackDir; switch ((int)val6) { case 0: val5 = (((!heroController.cState.facingRight || heroController.cState.wallSliding) && (heroController.cState.facingRight || !heroController.cState.wallSliding)) ? Physics2D.BoxCast(val2, val, 0f, Vector2.left, num3, num5) : Physics2D.BoxCast(val2, val, 0f, Vector2.right, num3, num5)); break; case 1: val5 = Physics2D.BoxCast(val3, val, 0f, Vector2.up, num3, num5); break; case 2: val5 = Physics2D.BoxCast(val4, val, 0f, Vector2.down, num3, num5); break; } if ((Object)(object)((RaycastHit2D)(ref val5)).collider != (Object)null && !((RaycastHit2D)(ref val5)).collider.isTrigger) { NonThunker component = ((Component)((RaycastHit2D)(ref val5)).collider).gameObject.GetComponent<NonThunker>(); if (!((Object)(object)component != (Object)null) || !component.active) { <terrainHit>5__2 = true; ObjectPoolExtensions.Spawn(heroController.nailTerrainImpactEffectPrefab, Vector2.op_Implicit(((RaycastHit2D)(ref val5)).point), Quaternion.Euler(0f, 0f, Random.Range(0f, 360f))); val6 = attackDir; if ((int)val6 != 0) { if ((int)val6 == 1) { heroController.RecoilDown(); } } else if (heroController.cState.facingRight) { heroController.RecoilLeft(); } else { heroController.RecoilRight(); } } } <thunkTimer>5__3 -= Time.deltaTime; } <>2__current = null; <>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] private sealed class <Die>d__525 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public HeroController <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <Die>d__525(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0084: Unknown result type (might be due to invalid IL or missing references) int num = <>1__state; HeroController heroController = <>4__this; switch (num) { default: return false; case 0: { <>1__state = -1; if (heroController.OnDeath != null) { heroController.OnDeath(); } if (heroController.cState.dead) { return false; } heroController.playerData.disablePause = true; heroController.boundsChecking = false; heroController.StopTilemapTest(); heroController.cState.onConveyor = false; heroController.cState.onConveyorV = false; heroController.rb2d.velocity = new Vector2(0f, 0f); heroController.CancelRecoilHorizontal(); string currentMapZone = heroController.gm.GetCurrentMapZone(); if (currentMapZone == "DREAM_WORLD" || currentMapZone == "GODS_GLORY") { heroController.RelinquishControl(); heroController.StopAnimationControl(); heroController.AffectedByGravity(gravityApplies: false); heroController.playerData.isInvincible = true; heroController.ResetHardLandingTimer(); ((Renderer)heroController.renderer).enabled = false; heroController.heroDeathPrefab.SetActive(true); return false; } if (heroController.playerData.permadeathMode == 1) { heroController.playerData.permadeathMode = 2; } heroController.AffectedByGravity(gravityApplies: false); HeroBox.inactive = true; heroController.rb2d.isKinematic = true; heroController.SetState((ActorStates)7); heroController.cState.dead = true; heroController.ResetMotion(); heroController.ResetHardLandingTimer(); ((Renderer)heroController.renderer).enabled = false; ((Component)heroController).gameObject.layer = 2; heroController.heroDeathPrefab.SetActive(true); <>2__current = null; <>1__state = 1; return true; } case 1: <>1__state = -1; ((MonoBehaviour)heroController).StartCoroutine(heroController.gm.PlayerDead(heroController.DEATH_WAIT)); 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 <DieFromHazard>d__526 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public HeroController <>4__this; public HazardType hazardType; public float angle; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <DieFromHazard>d__526(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Invalid comparison between Unknown and I4 //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Invalid comparison between Unknown and I4 //IL_00ee: 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) int num = <>1__state; HeroController heroController = <>4__this; switch (num) { default: return false; case 0: { <>1__state = -1; if (heroController.cState.hazardDeath) { break; } heroController.playerData.disablePause = true; heroController.SetHeroParent(null); heroController.StopTilemapTest(); heroController.SetState((ActorStates)7); heroController.cState.hazardDeath = true; heroController.ResetMotion(); heroController.ResetHardLandingTimer(); heroController.AffectedByGravity(gravityApplies: false); ((Renderer)heroController.renderer).enabled = false; ((Component)heroController).gameObject.layer = 2; HazardType val = hazardType; if ((int)val != 2) { if ((int)val == 3) { GameObject obj = ObjectPoolExtensions.Spawn(heroController.acidDeathPrefab); obj.transform.position = heroController.transform.position; obj.transform.localScale = heroController.transform.localScale; } } else { GameObject obj2 = ObjectPoolExtensions.Spawn(heroController.spikeDeathPrefab); obj2.transform.position = heroController.transform.position; FSMUtility.SetFloat(obj2.GetComponent<PlayMakerFSM>(), "Spike Direction", angle * 57.29578f); } <>2__current = null; <>1__state = 1; return true; } case 1: <>1__state = -1; ((MonoBehaviour)heroController).StartCoroutine(heroController.gm.PlayerDeadFromHazard(0f)); break; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <EnterScene>d__464 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public HeroController <>4__this; public TransitionPoint enterGate; public float delayBeforeEnter; private float <x2>5__2; private float <y2>5__3; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <EnterScene>d__464(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_0303: Unknown result type (might be due to invalid IL or missing references) //IL_0309: Unknown result type (might be due to invalid IL or missing references) //IL_051d: Unknown result type (might be due to invalid IL or missing references) //IL_052c: Unknown result type (might be due to invalid IL or missing references) //IL_0531: Unknown result type (might be due to invalid IL or missing references) //IL_053f: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0429: Unknown result type (might be due to invalid IL or missing references) //IL_0433: Expected O, but got Unknown //IL_09d2: Unknown result type (might be due to invalid IL or missing references) //IL_09dc: Expected O, but got Unknown //IL_0321: Unknown result type (might be due to invalid IL or missing references) //IL_0327: Invalid comparison between Unknown and I4 //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Expected O, but got Unknown //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Expected O, but got Unknown //IL_02a9: Unknown result type (might be due to invalid IL or missing references) //IL_02b5: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_027e: Expected O, but got Unknown //IL_0461: Unknown result type (might be due to invalid IL or missing references) //IL_046b: Expected O, but got Unknown //IL_0633: Unknown result type (might be due to invalid IL or missing references) //IL_063d: Expected O, but got Unknown //IL_066c: Unknown result type (might be due to invalid IL or missing references) //IL_0676: Expected O, but got Unknown //IL_06df: Unknown result type (might be due to invalid IL or missing references) //IL_06e4: Unknown result type (might be due to invalid IL or missing references) //IL_06eb: Unknown result type (might be due to invalid IL or missing references) //IL_06f6: Unknown result type (might be due to invalid IL or missing references) //IL_0700: Expected O, but got Unknown //IL_06ab: Unknown result type (might be due to invalid IL or missing references) //IL_06b5: Expected O, but got Unknown //IL_0808: Unknown result type (might be due to invalid IL or missing references) //IL_0812: Expected O, but got Unknown //IL_0841: Unknown result type (might be due to invalid IL or missing references) //IL_084b: Expected O, but got Unknown //IL_08ba: Unknown result type (might be due to invalid IL or missing references) //IL_08bf: Unknown result type (might be due to invalid IL or missing references) //IL_08c6: Unknown result type (might be due to invalid IL or missing references) //IL_08d1: Unknown result type (might be due to invalid IL or missing references) //IL_08db: Expected O, but got Unknown //IL_0880: Unknown result type (might be due to invalid IL or missing references) //IL_088a: Expected O, but got Unknown //IL_0a0b: Unknown result type (might be due to invalid IL or missing references) //IL_0a15: Expected O, but got Unknown //IL_054a: Unknown result type (might be due to invalid IL or missing references) //IL_0550: Invalid comparison between Unknown and I4 //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Expected O, but got Unknown //IL_02e7: Unknown result type (might be due to invalid IL or missing references) //IL_02f1: Expected O, but got Unknown //IL_04cc: Unknown result type (might be due to invalid IL or missing references) //IL_04d1: Unknown result type (might be due to invalid IL or missing references) //IL_04ad: Unknown result type (might be due to invalid IL or missing references) //IL_04b2: Unknown result type (might be due to invalid IL or missing references) //IL_0a57: Unknown result type (might be due to invalid IL or missing references) //IL_0a61: Expected O, but got Unknown //IL_071f: Unknown result type (might be due to invalid IL or missing references) //IL_0725: Invalid comparison between Unknown and I4 //IL_057a: Unknown result type (might be due to invalid IL or missing references) //IL_05ab: Unknown result type (might be due to invalid IL or missing references) //IL_04d8: Unknown result type (might be due to invalid IL or missing references) //IL_04fb: Unknown result type (might be due to invalid IL or missing references) //IL_0505: Expected O, but got Unknown //IL_0ac5: Unknown result type (might be due to invalid IL or missing references) //IL_0acf: Expected O, but got Unknown //IL_0aa2: Unknown result type (might be due to invalid IL or missing references) //IL_0aac: Expected O, but got Unknown //IL_08fa: Unknown result type (might be due to invalid IL or missing references) //IL_0900: Invalid comparison between Unknown and I4 //IL_074f: Unknown result type (might be due to invalid IL or missing references) //IL_0780: Unknown result type (might be due to invalid IL or missing references) //IL_05ec: Unknown result type (might be due to invalid IL or missing references) //IL_05f6: Expected O, but got Unknown //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_03a4: Unknown result type (might be due to invalid IL or missing references) //IL_07c1: Unknown result type (might be due to invalid IL or missing references) //IL_07cb: Expected O, but got Unknown //IL_03fb: Unknown result type (might be due to invalid IL or missing references) //IL_0405: Expected O, but got Unknown //IL_0974: Unknown result type (might be due to invalid IL or missing references) //IL_0979: Unknown result type (might be due to invalid IL or missing references) //IL_097f: Unknown result type (might be due to invalid IL or missing references) //IL_0984: Unknown result type (might be due to invalid IL or missing references) //IL_09a3: Unknown result type (might be due to invalid IL or missing references) //IL_09ad: Expected O, but got Unknown int num = <>1__state; HeroController heroController = <>4__this; float clipDuration; switch (num) { default: return false; case 0: <>1__state = -1; heroController.IgnoreInputWithoutReset(); heroController.ResetMotion(); heroController.airDashed = false; heroController.doubleJumped = false; heroController.ResetHardLandingTimer(); heroController.ResetAttacksDash(); heroController.AffectedByGravity(gravityApplies: false); heroController.sceneEntryGate = enterGate; heroController.SetState((ActorStates)7); heroController.transitionState = (HeroTransitionState)2; heroController.vignetteFSM.SendEvent("RESET"); if (!heroController.cState.transitioning) { heroController.cState.transitioning = true; } heroController.gatePosition = enterGate.GetGatePosition(); if ((int)heroController.gatePosition == 0) { heroController.cState.onGround = false; heroController.enteringVertically = true; heroController.exitedSuperDashing = false; ((Renderer)heroController.renderer).enabled = false; float num2 = ((Component)enterGate).transform.position.x + enterGate.entryOffset.x; float num3 = ((Component)enterGate).transform.position.y + enterGate.entryOffset.y; Extensions.SetPosition2D(heroController.transform, num2, num3); if (heroController.heroInPosition != null) { heroController.heroInPosition(forceDirect: false); } <>2__current = (object)new WaitForSeconds(0.165f); <>1__state = 1; return true; } if ((int)heroController.gatePosition == 3) { heroController.cState.onGround = false; heroController.enteringVertically = true; heroController.exitedSuperDashing = false; if (enterGate.alwaysEnterRight) { heroController.FaceRight(); } if (enterGate.alwaysEnterLeft) { heroController.FaceLeft(); } <x2>5__2 = ((Component)enterGate).transform.position.x + enterGate.entryOffset.x; <y2>5__3 = ((Component)enterGate).transform.position.y + enterGate.entryOffset.y + 3f; Extensions.SetPosition2D(heroController.transform, <x2>5__2, <y2>5__3); if (heroController.heroInPosition != null) { heroController.heroInPosition(forceDirect: false); } <>2__current = (object)new WaitForSeconds(0.165f); <>1__state = 6; return true; } if ((int)heroController.gatePosition == 2) { heroController.cState.onGround = true; heroController.enteringVertically = false; heroController.SetState((ActorStates)7); float num4 = ((Component)enterGate).transform.position.x + enterGate.entryOffset.x; float num5 = heroController.FindGroundPointY(num4 + 2f, ((Component)enterGate).transform.position.y); Extensions.SetPosition2D(heroController.transform, num4, num5); if (heroController.heroInPosition != null) { heroController.heroInPosition(forceDirect: true); } heroController.FaceRight(); <>2__current = (object)new WaitForSeconds(0.165f); <>1__state = 10; return true; } if ((int)heroController.gatePosition == 1) { heroController.cState.onGround = true; heroController.enteringVertically = false; heroController.SetState((ActorStates)7); float num6 = ((Component)enterGate).transform.position.x + enterGate.entryOffset.x; float num7 = heroController.FindGroundPointY(num6 - 2f, ((Component)enterGate).transform.position.y); Extensions.SetPosition2D(heroController.transform, num6, num7); if (heroController.heroInPosition != null) { heroController.heroInPosition(forceDirect: true); } heroController.FaceLeft(); <>2__current = (object)new WaitForSeconds(0.165f); <>1__state = 15; return true; } if ((int)heroController.gatePosition != 4) { return false; } if (enterGate.alwaysEnterRight) { heroController.FaceRight(); } if (enterGate.alwaysEnterLeft) { heroController.FaceLeft(); } heroController.cState.onGround = true; heroController.enteringVertically = false; heroController.SetState((ActorStates)1); heroController.SetState((ActorStates)7); heroController.exitedSuperDashing = false; heroController.animCtrl.PlayClip("Idle"); Extensions.SetPosition2D(heroController.transform, Vector2.op_Implicit(heroController.FindGroundPoint(Vector2.op_Implicit(((Component)enterGate).transform.position)))); if (heroController.heroInPosition != null) { heroController.heroInPosition(forceDirect: false); } <>2__current = (object)new WaitForEndOfFrame(); <>1__state = 20; return true; case 1: <>1__state = -1; if (!enterGate.customFade) { heroController.gm.FadeSceneIn(); } if (delayBeforeEnter > 0f) { <>2__current = (object)new WaitForSeconds(delayBeforeEnter); <>1__state = 2; return true; } goto IL_020c; case 2: <>1__state = -1; goto IL_020c; case 3: <>1__state = -1; goto IL_0244; case 4: <>1__state = -1; heroController.FinishedEnteringScene(); return false; case 5: <>1__state = -1; heroController.transitionState = (HeroTransitionState)3; if ((int)heroController.transitionState != 0) { heroController.FinishedEnteringScene(); } break; case 6: <>1__state = -1; if (delayBeforeEnter > 0f) { <>2__current = (object)new WaitForSeconds(delayBeforeEnter); <>1__state = 7; return true; } goto IL_0443; case 7: <>1__state = -1; goto IL_0443; case 8: <>1__state = -1; goto IL_047b; case 9: <>1__state = -1; heroController.transition_vel = new Vector2(heroController.rb2d.velocity.x, 0f); heroController.AffectedByGravity(gravityApplies: true); heroController.transitionState = (HeroTransitionState)4; break; case 10: <>1__state = -1; if (!enterGate.customFade) { heroController.gm.FadeSceneIn(); } if (delayBeforeEnter > 0f) { <>2__current = (object)new WaitForSeconds(delayBeforeEnter); <>1__state = 11; return true; } goto IL_064e; case 11: <>1__state = -1; goto IL_064e; case 12: <>1__state = -1; goto IL_0687; case 13: <>1__state = -1; heroController.FinishedEnteringScene(); break; case 14: <>1__state = -1; heroController.FinishedEnteringScene(setHazardMarker: true, preventRunBob: true); break; case 15: <>1__state = -1; if (!enterGate.customFade) { heroController.gm.FadeSceneIn(); } if (delayBeforeEnter > 0f) { <>2__current = (object)new WaitForSeconds(delayBeforeEnter); <>1__state = 16; return true; } goto IL_0823; case 16: <>1__state = -1; goto IL_0823; case 17: <>1__state = -1; goto IL_085c; case 18: <>1__state = -1; heroController.FinishedEnteringScene(); break; case 19: <>1__state = -1; heroController.FinishedEnteringScene(setHazardMarker: true, preventRunBob: true); break; case 20: <>1__state = -1; if (delayBeforeEnter > 0f) { <>2__current = (object)new WaitForSeconds(delayBeforeEnter); <>1__state = 21; return true; } goto IL_09ed; case 21: <>1__state = -1; goto IL_09ed; case 22: <>1__state = -1; goto IL_0a26; case 23: <>1__state = -1; goto IL_0ae0; case 24: <>1__state = -1; goto IL_0ae0; case 25: { <>1__state = -1; goto IL_0ae0; } IL_0ae0: heroController.FinishedEnteringScene(); break; IL_064e: if (enterGate.entryDelay > 0f) { <>2__current = (object)new WaitForSeconds(enterGate.entryDelay); <>1__state = 12; return true; } goto IL_0687; IL_09ed: if (enterGate.entryDelay > 0f) { <>2__current = (object)new WaitForSeconds(enterGate.entryDelay); <>1__state = 22; return true; } goto IL_0a26; IL_0244: ((Renderer)heroController.renderer).enabled = true; if (heroController.exitedQuake) { heroController.IgnoreInput(); heroController.proxyFSM.SendEvent("HeroCtrl-EnterQuake"); <>2__current = (object)new WaitForSeconds(0.25f); <>1__state = 4; return true; } heroController.rb2d.velocity = new Vector2(0f, heroController.SPEED_TO_ENTER_SCENE_DOWN); heroController.transitionState = (HeroTransitionState)3; heroController.transitionState = (HeroTransitionState)4; heroController.AffectedByGravity(gravityApplies: true); if (enterGate.hardLandOnExit) { heroController.cState.willHardLand = true; } <>2__current = (object)new WaitForSeconds(0.33f); <>1__state = 5; return true; IL_0a26: if (!enterGate.customFade) { heroController.gm.FadeSceneIn(); } _ = Time.realtimeSinceStartup; if (enterGate.dontWalkOutOfDoor) { <>2__current = (object)new WaitForSeconds(0.33f); <>1__state = 23; return true; } clipDuration = heroController.animCtrl.GetClipDuration("Exit Door To Idle"); heroController.animCtrl.PlayClip("Exit Door To Idle"); if (clipDuration > 0f) { <>2__current = (object)new WaitForSeconds(clipDuration); <>1__state = 24; return true; } <>2__current = (object)new WaitForSeconds(0.33f); <>1__state = 25; return true; IL_0687: if (heroController.exitedSuperDashing) { heroController.IgnoreInput(); heroController.proxyFSM.SendEvent("HeroCtrl-EnterSuperDash"); <>2__current = (object)new WaitForSeconds(0.25f); <>1__state = 13; return true; } heroController.transition_vel = new Vector2(heroController.RUN_SPEED, 0f); heroController.transitionState = (HeroTransitionState)3; <>2__current = (object)new WaitForSeconds(0.33f); <>1__state = 14; return true; IL_020c: if (enterGate.entryDelay > 0f) { <>2__current = (object)new WaitForSeconds(enterGate.entryDelay); <>1__state = 3; return true; } goto IL_0244; IL_0443: if (enterGate.entryDelay > 0f) { <>2__current = (object)new WaitForSeconds(enterGate.entryDelay); <>1__state = 8; return true; } goto IL_047b; IL_0823: if (enterGate.entryDelay > 0f) { <>2__current = (object)new WaitForSeconds(enterGate.entryDelay); <>1__state = 17; return true; } goto IL_085c; IL_085c: if (heroController.exitedSuperDashing) { heroController.IgnoreInput(); heroController.proxyFSM.SendEvent("HeroCtrl-EnterSuperDash"); <>2__current = (object)new WaitForSeconds(0.25f); <>1__state = 18; return true; } heroController.transition_vel = new Vector2(0f - heroController.RUN_SPEED, 0f); heroController.transitionState = (HeroTransitionState)3; <>2__current = (object)new WaitForSeconds(0.33f); <>1__state = 19; return true; IL_047b: if (!enterGate.customFade) { heroController.gm.FadeSceneIn(); } if (heroController.cState.facingRight) { heroController.transition_vel = new Vector2(heroController.SPEED_TO_ENTER_SCENE_HOR, heroController.SPEED_TO_ENTER_SCENE_UP); } else { heroController.transition_vel = new Vector2(0f - heroController.SPEED_TO_ENTER_SCENE_HOR, heroController.SPEED_TO_ENTER_SCENE_UP); } heroController.transitionState = (HeroTransitionState)3; Extensions.SetPosition2D(heroController.transform, <x2>5__2, <y2>5__3); <>2__current = (object)new WaitForSeconds(heroController.TIME_TO_ENTER_SCENE_BOT); <>1__state = 9; return true; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <FirstFadeIn>d__529 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public HeroController <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <FirstFadeIn>d__529(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown int num = <>1__state; HeroController heroController = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.25f); <>1__state = 1; return true; case 1: <>1__state = -1; heroController.gm.FadeSceneIn(); heroController.fadedSceneIn = true; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <HazardRespawn>d__469 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public HeroController <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <HazardRespawn>d__469(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Expected O, but got Unknown //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Expected O, but got Unknown int num = <>1__state; HeroController heroController = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; heroController.cState.hazardDeath = false; heroController.cState.onGround = true; heroController.cState.hazardRespawning = true; heroController.ResetMotion(); heroController.ResetHardLandingTimer(); heroController.ResetAttacks(); heroController.ResetInput(); heroController.cState.recoiling = false; heroController.enteringVertically = false; heroController.airDashed = false; heroController.doubleJumped = false; Extensions.SetPosition2D(heroController.transform, Vector2.op_Implicit(heroController.FindGroundPoint(Vector2.op_Implicit(heroController.playerData.hazardRespawnLocation), useExtended: true))); ((Component)heroController).gameObject.layer = 9; ((Renderer)heroController.renderer).enabled = true; <>2__current = (object)new WaitForEndOfFrame(); <>1__state = 1; return true; case 1: { <>1__state = -1; if (heroController.playerData.hazardRespawnFacingRight) { heroController.FaceRight(); } else { heroController.FaceLeft(); } if (heroController.heroInPosition != null) { heroController.heroInPosition(forceDirect: false); } ((MonoBehaviour)heroController).StartCoroutine(heroController.Invulnerable(heroController.INVUL_TIME * 2f)); heroController.OnHazardRespawn?.Invoke(); GameCameras.instance.cameraFadeFSM.SendEvent("RESPAWN"); float clipDuration = heroController.animCtrl.GetClipDuration("Hazard Respawn"); heroController.animCtrl.PlayClip("Hazard Respawn"); <>2__current = (object)new WaitForSeconds(clipDuration); <>1__state = 2; return true; } case 2: <>1__state = -1; heroController.cState.hazardRespawning = false; heroController.rb2d.interpolation = (RigidbodyInterpolation2D)1; heroController.FinishedEnteringScene(setHazardMarker: false); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <Invulnerable>d__528 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public HeroController <>4__this; public float duration; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <Invulnerable>d__528(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Expected O, but got Unknown //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Expected O, but got Unknown int num = <>1__state; HeroController heroController = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; heroController.cState.invulnerable = true; <>2__current = (object)new WaitForSeconds(heroController.DAMAGE_FREEZE_DOWN); <>1__state = 1; return true; case 1: <>1__state = -1; heroController.invPulse.StartInvulnerablePulse(); <>2__current = (object)new WaitForSeconds(duration); <>1__state = 2; return true; case 2: <>1__state = -1; heroController.invPulse.StopInvulnerablePulse(); heroController.cState.invulnerable = false; heroController.cState.recoiling = false; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <Respawn>d__468 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public HeroController <>4__this; private Transform <spawnPoint>5__2; private PlayMakerFSM <benchFSM>5__3; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <Respawn>d__468(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <spawnPoint>5__2 = null; <benchFSM>5__3 = null; <>1__state = -2; } private bool MoveNext() { //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Expected O, but got Unknown //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Expected O, but got Unknown //IL_0331: Unknown result type (might be due to invalid IL or missing references) //IL_033b: Expected O, but got Unknown int num = <>1__state; HeroController heroController = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; heroController.playerData = PlayerData.instance; heroController.playerData.disablePause = true; ((Component)heroController).gameObject.layer = 9; ((Renderer)heroController.renderer).enabled = true; heroController.rb2d.isKinematic = false; heroController.cState.dead = false; heroController.cState.onGround = true; heroController.cState.hazardDeath = false; heroController.cState.recoiling = false; heroController.enteringVertically = false; heroController.airDashed = false; heroController.doubleJumped = false; heroController.CharmUpdate(); heroController.MaxHealth(); heroController.ClearMP(); heroController.ResetMotion(); heroController.ResetHardLandingTimer(); heroController.ResetAttacks(); heroController.ResetInput(); heroController.CharmUpdate(); <spawnPoint>5__2 = heroController.LocateSpawnPoint(); if ((Object)(object)<spawnPoint>5__2 != (Object)null) { Extensions.SetPosition2D(heroController.transform, Vector2.op_Implicit(heroController.FindGroundPoint(Vector2.op_Implicit(((Component)<spawnPoint>5__2).transform.position)))); PlayMakerFSM component2 = ((Component)<spawnPoint>5__2).GetComponent<PlayMakerFSM>(); if ((Object)(object)component2 != (Object)null) { FSMUtility.GetVector3(component2, "Adjust Vector"); } else if (heroController.verboseMode) { Debug.Log((object)"Could not find Bench Control FSM on respawn point. Ignoring Adjustment offset."); } } else { Debug.LogError((object)("Couldn't find the respawn point named " + heroController.playerData.respawnMarkerName + " within objects tagged with RespawnPoint")); } if (heroController.verboseMode) { Debug.Log((object)("HC Respawn Type: " + heroController.playerData.respawnType)); } GameCameras.instance.cameraFadeFSM.SendEvent("RESPAWN"); <benchFSM>5__3 = FSMUtility.LocateFSM(((Component)<spawnPoint>5__2).gameObject, "Bench Control"); if (heroController.playerData.respawnType == 1 && (Object)(object)<benchFSM>5__3 != (Object)null) { heroController.AffectedByGravity(gravityApplies: false); <benchFSM>5__3.FsmVariables.GetFsmBool("RespawnResting").Value = true; <>2__current = (object)new WaitForEndOfFrame(); <>1__state = 1; return true; } <>2__current = (object)new WaitForEndOfFrame(); <>1__state = 2; return true; case 1: <>1__state = -1; if (heroController.heroInPosition != null) { heroController.heroInPosition(forceDirect: false); } heroController.proxyFSM.SendEvent("HeroCtrl-Respawned"); heroController.FinishedEnteringScene(); <benchFSM>5__3.SendEvent("RESPAWN"); break; case 2: { <>1__state = -1; heroController.IgnoreInput(); RespawnMarker component = ((Component)<spawnPoint>5__2).GetComponent<RespawnMarker>(); if (Object.op_Implicit((Object)(object)component)) { if (component.respawnFacingRight) { heroController.FaceRight(); } else { heroController.FaceLeft(); } } else { Debug.LogError((object)"Spawn point does not contain a RespawnMarker"); } if (heroController.heroInPosition != null) { heroController.heroInPosition(forceDirect: false); } if (heroController.gm.GetSceneNameString() != "GG_Atrium" && (!Object.op_Implicit((Object)(object)component) || !component.customWakeUp)) { float clipDuration = heroController.animCtrl.GetClipDuration("Wake Up Ground"); heroController.animCtrl.PlayClip("Wake Up Ground"); heroController.StopAnimationControl(); heroController.controlReqlinquished = true; <>2__current = (object)new WaitForSeconds(clipDuration); <>1__state = 3; return true; } goto IL_0358; } case 3: { <>1__state = -1; heroController.StartAnimationControl(); heroController.controlReqlinquished = false; goto IL_0358; } IL_0358: heroController.proxyFSM.SendEvent("HeroCtrl-Respawned"); heroController.FinishedEnteringScene(); break; } heroController.playerData.disablePause = false; heroController.playerData.isInvincible = false; return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <StartRecoil>d__527 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public HeroController <>4__this; public CollisionSide impactSide; public bool spawnDamageEffect; public int damageAmount; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <StartRecoil>d__527(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Invalid comparison between Unknown and I4 //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Invalid comparison between Unknown and I4 //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_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) int num = <>1__state; HeroController heroController = <>4__this; switch (num) { default: return false; case 0: { <>1__state = -1; if (heroController.cState.recoiling) { return false; } heroController.playerData.disablePause = true; heroController.ResetMotion(); heroController.AffectedByGravity(gravityApplies: false); CollisionSide val = impactSide; if ((int)val != 1) { if ((int)val == 2) { heroController.recoilVector = new Vector2(0f - heroController.RECOIL_VELOCITY, heroController.RECOIL_VELOCITY * 0.5f); if (!heroController.cState.facingRight) { heroController.FlipSprite(); } } else { heroController.recoilVector = Vector2.zero; } } else { heroController.recoilVector = new Vector2(heroController.RECOIL_VELOCITY, heroController.RECOIL_VELOCITY * 0.5f); if (heroController.cState.facingRight) { heroController.FlipSprite(); } } heroController.SetState((ActorStates)7); heroController.cState.recoilFrozen = true; if (spawnDamageEffect) { heroController.damageEffectFSM.SendEvent("DAMAGE"); if (damageAmount > 1) { Object.Instantiate<GameObject>(heroController.takeHitDoublePrefab, heroController.transform.position, heroController.transform.rotation); } } if (heroController.playerData.equippedCharm_4) { ((MonoBehaviour)heroController).StartCoroutine(heroController.Invulnerable(heroController.INVUL_TIME_STAL)); } else { ((MonoBehaviour)heroController).StartCoroutine(heroController.Invulnerable(heroController.INVUL_TIME)); } <>2__current = (heroController.takeDamageCoroutine = ((MonoBehaviour)heroController).StartCoroutine(heroController.gm.FreezeMoment(heroController.DAMAGE_FREEZE_DOWN, heroController.DAMAGE_FREEZE_WAIT, heroController.DAMAGE_FREEZE_UP, 0.0001f, (Action)null))); <>1__state = 1; return true; } case 1: <>1__state = -1; heroController.cState.recoilFrozen = false; heroController.cState.recoiling = true; heroController.playerData.disablePause = false; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <TilemapTestPause>d__560 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public HeroController <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <TilemapTestPause>d__560(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown int num = <>1__state; HeroController heroController = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.1f); <>1__state = 1; return true; case 1: <>1__state = -1; heroController.tilemapTestActive = 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 bool verboseMode; public float RUN_SPEED; public float RUN_SPEED_CH; public float RUN_SPEED_CH_COMBO; public float WALK_SPEED; public float UNDERWATER_SPEED; public float JUMP_SPEED; public float JUMP_SPEED_UNDERWATER; public float MIN_JUMP_SPEED; public int JUMP_STEPS; public int JUMP_STEPS_MIN; public int JUMP_TIME; public int DOUBLE_JUMP_STEPS; public int WJLOCK_STEPS_SHORT; public int WJLOCK_STEPS_LONG; public float WJ_KICKOFF_SPEED; public int WALL_STICKY_STEPS; public float DASH_SPEED; public float DASH_SPEED_SHARP; public float DASH_TIME; public int DASH_QUEUE_STEPS; public float BACK_DASH_SPEED; public float BACK_DASH_TIME; public float SHADOW_DASH_SPEED; public float SHADOW_DASH_TIME; public float SHADOW_DASH_COOLDOWN; public float SUPER_DASH_SPEED; public float DASH_COOLDOWN; public float DASH_COOLDOWN_CH; public float BACKDASH_COOLDOWN; public float WALLSLIDE_SPEED; public float WALLSLIDE_DECEL; public float NAIL_CHARGE_TIME_DEFAULT; public float NAIL_CHARGE_TIME_CHARM; public float CYCLONE_HORIZONTAL_SPEED; public float SWIM_ACCEL; public float SWIM_MAX_SPEED; public float TIME_TO_ENTER_SCENE_BOT; public float TIME_TO_ENTER_SCENE_HOR; public float SPEED_TO_ENTER_SCENE_HOR; public float SPEED_TO_ENTER_SCENE_UP; public float SPEED_TO_ENTER_SCENE_DOWN; public float DEFAULT_GRAVITY; public float UNDERWATER_GRAVITY; public float ATTACK_DURATION; public float ATTACK_DURATION_CH; public float ALT_ATTACK_RESET; public float ATTACK_RECOVERY_TIME; public float ATTACK_COOLDOWN_TIME; public float ATTACK_COOLDOWN_TIME_CH; public float BOUNCE_TIME; public float BOUNCE_SHROOM_TIME; public float BOUNCE_VELOCITY; public float SHROOM_BOUNCE_VELOCITY; public float RECOIL_HOR_TIME; public float RECOIL_HOR_VELOCITY; public float RECOIL_HOR_VELOCITY_LONG; public float RECOIL_HOR_STEPS; public float RECOIL_DOWN_VELOCITY; public float RUN_PUFF_TIME; public float BIG_FALL_TIME; public float HARD_LANDING_TIME; public float DOWN_DASH_TIME; public float MAX_FALL_VELOCITY; public float MAX_FALL_VELOCITY_UNDERWATER; public float RECOIL_DURATION; public float RECOIL_DURATION_STAL; public float RECOIL_VELOCITY; public float DAMAGE_FREEZE_DOWN; public float DAMAGE_FREEZE_WAIT; public float DAMAGE_FREEZE_UP; public float INVUL_TIME; public float INVUL_TIME_STAL; public float INVUL_TIME_PARRY; public float INVUL_TIME_QUAKE; public float INVUL_TIME_CYCLONE; public float CAST_TIME; public float CAST_RECOIL_TIME; public float CAST_RECOIL_VELOCITY; public float WALLSLIDE_CLIP_DELAY; public int GRUB_SOUL_MP; public int GRUB_SOUL_MP_COMBO; private int JUMP_QUEUE_STEPS = 2; private int JUMP_RELEASE_QUEUE_STEPS = 2; private int DOUBLE_JUMP_QUEUE_STEPS = 10; private int ATTACK_QUEUE_STEPS = 5; private float DELAY_BEFORE_ENTER = 0.1f; private float LOOK_DELAY = 0.85f; private float LOOK_ANIM_DELAY = 0.25f; private float DEATH_WAIT = 2.85f; private float HAZARD_DEATH_CHECK_TIME = 3f; private float FLOATING_CHECK_TIME = 0.18f; private float NAIL_TERRAIN_CHECK_TIME = 0.12f; private float BUMP_VELOCITY = 4f; private float BUMP_VELOCITY_DASH = 5f; private int LANDING_BUFFER_STEPS = 5; private int LEDGE_BUFFER_STEPS = 2; private int HEAD_BUMP_STEPS = 3; private float MANTIS_CHARM_SCALE = 1.35f; private float FIND_GROUND_POINT_DISTANCE = 10f; private float FIND_GROUND_POINT_DISTANCE_EXT = 50f; public ActorStates hero_state; public ActorStates prev_hero_state; public HeroTransitionState transitionState; public DamageMode damageMode; public float move_input; public float vertical_input; public float controller_deadzone = 0.2f; public Vector2 current_velocity; private bool isGameplayScene; public bool isEnteringFirstLevel; public Vector2 slashOffset; public Vector2 upSlashOffset; public Vector2 downwardSlashOffset; public Vector2 spell1Offset; private int jump_steps; private int jumped_steps; private int doubleJump_steps; private float dash_timer; private float back_dash_timer; private float shadow_dash_timer; private float attack_time; private float attack_cooldown; private Vector2 transition_vel; private float altAttackTime; private float lookDelayTimer; private float bounceTimer; private float recoilHorizontalTimer; private float runPuffTimer; private float hardLandingTimer; private float dashLandingTimer; private float recoilTimer; private int recoilSteps; private int landingBufferSteps; private int dashQueueSteps; private bool dashQueuing; private float shadowDashTimer; private float dashCooldownTimer; private float nailChargeTimer; private int wallLockSteps; private float wallslideClipTimer; private float hardLandFailSafeTimer; private float hazardDeathTimer; private float floatingBufferTimer; private float attackDuration; public float parryInvulnTimer; [Space(6f)] [Header("Slash Prefabs")] public GameObject slashPrefab; public GameObject slashAltPrefab; public GameObject upSlashPrefab; public GameObject downSlashPrefab; public GameObject wallSlashPrefab; public NailSlash normalSlash; public NailSlash alternateSlash; public NailSlash upSlash; public NailSlash downSlash; public NailSlash wallSlash; public PlayMakerFSM normalSlashFsm; public PlayMakerFSM alternateSlashFsm; public PlayMakerFSM upSlashFsm; public PlayMakerFSM downSlashFsm; public PlayMakerFSM wallSlashFsm; [Space(6f)] [Header("Effect Prefabs")] public GameObject nailTerrainImpactEffectPrefab; public GameObject spell1Prefab; public GameObject takeHitPrefab; public GameObject takeHitDoublePrefab; public GameObject softLandingEffectPrefab; public GameObject hardLandingEffectPrefab; public GameObject runEffectPrefab; public GameObject backDashPrefab; public GameObject jumpEffectPrefab; public GameObject jumpTrailPrefab; public GameObject fallEffectPrefab; public ParticleSystem wallslideDustPrefab; public GameObject artChargeEffect; public GameObject artChargedEffect; public GameObject artChargedFlash; public tk2dSpriteAnimator artChargedEffectAnim; public GameObject shadowdashBurstPrefab; public GameObject shadowdashDownBurstPrefab; public GameObject dashParticlesPrefab; public GameObject shadowdashParticlesPrefab; public GameObject shadowRingPrefab; public GameObject shadowRechargePrefab; public GameObject dJumpWingsPrefab; public GameObject dJumpFlashPrefab; public ParticleSystem dJumpFeathers; public GameObject wallPuffPrefab; public GameObject sharpShadowPrefab; public GameObject grubberFlyBeamPrefabL; public GameObject grubberFlyBeamPrefabR; public GameObject grubberFlyBeamPrefabU; public GameObject grubberFlyBeamPrefabD; public GameObject grubberFlyBeamPrefabL_fury; public GameObject grubberFlyBeamPrefabR_fury; public GameObject grubberFlyBeamPrefabU_fury; public GameObject grubberFlyBeamPrefabD_fury; public GameObject carefreeShield; [Space(6f)] [Header("Hero Death")] public GameObject corpsePrefab; public GameObject spikeDeathPrefab; public GameObject acidDeathPrefab; public GameObject lavaDeathPrefab; public GameObject heroDeathPrefab; [Space(6f)] [Header("Hero Other")] public GameObject cutscenePrefab; private GameManager gm; private Rigidbody2D rb2d; private Collider2D col2d; private MeshRenderer renderer; private Transform transform; private HeroAnimationController animCtrl; public HeroControllerStates cState; public PlayerData playerData; private HeroAudioController audioCtrl; private AudioSource audioSource; [HideInInspector] public UIManager ui; private InputHandler inputHandler; public PlayMakerFSM damageEffectFSM; private ParticleSystem dashParticleSystem; private InvulnerablePulse invPulse; private SpriteFlash spriteFlash; public AudioSource footStepsRunAudioSource; public AudioSource footStepsWalkAudioSource; private float prevGravityScale; private Vector2 recoilVector; private Vector2 lastInputState; public GatePosition gatePosition; private bool runMsgSent; private bool hardLanded; private bool fallRumble; public bool acceptingInput; private bool fallTrailGenerated; private bool drainMP; private float drainMP_timer; private float drainMP_time; private float MP_drained; private float drainMP_seconds; private float focusMP_amount; private float dashBumpCorrection; public bool controlReqlinquished; public bool enterWithoutInput; public bool lookingUpAnim; public bool lookingDownAnim; public bool carefreeShieldEquipped; private int hitsSinceShielded; private EndBeta endBeta; private int jumpQueueSteps; private bool jumpQueuing; private int doubleJumpQueueSteps; private bool doubleJumpQueuing; private int jumpReleaseQueueSteps; private bool jumpReleaseQueuing; private int attackQueueSteps; private bool attackQueuing; public bool touchingWallL; public bool touchingWallR; public bool wallSlidingL; public bool wallSlidingR; private bool airDashed; public bool dashingDown; public bool wieldingLantern; private bool startWithWallslide; private bool startWithJump; private bool startWithFullJump; private bool startWithDash; private bool startWithAttack; private bool nailArt_cyclone; private bool wallSlashing; private bool doubleJumped; public bool inAcid; private bool wallJumpedR; private bool wallJumpedL; public bool wallLocked; private float currentWalljumpSpeed; private float walljumpSpeedDecel; private int wallUnstickSteps; private bool recoilLarge; public float conveyorSpeed; public float conveyorSpeedV; private bool enteringVertically; private bool playingWallslideClip; private bool playedMantisClawClip; public bool exitedSuperDashing; public bool exitedQuake; private bool fallCheckFlagged; private int ledgeBufferSteps; private int headBumpSteps; private float nailChargeTime; public bool takeNoDamage; private bool joniBeam; public bool fadedSceneIn; private bool stopWalkingOut; private bool boundsChecking; private bool blockerFix; [SerializeField] private Vector2[] positionHistory; private bool tilemapTestActive; private Vector2 groundRayOriginC; private Vector2 groundRayOriginL; private Vector2 groundRayOriginR; private Coroutine takeDamageCoroutine; private Coroutine tilemapTestCoroutine; public AudioClip footstepsRunDust; public AudioClip footstepsRunGrass; public AudioClip footstepsRunBone; public AudioClip footstepsRunSpa; public AudioClip footstepsRunMetal; public AudioClip footstepsRunWater; public AudioClip footstepsWalkDust; public AudioClip footstepsWalkGrass; public AudioClip footstepsWalkBone; public AudioClip footstepsWalkSpa; public AudioClip footstepsWalkMetal; public AudioClip nailArtCharge; public AudioClip nailArtChargeComplete; public AudioClip block