using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using HutongGames.PlayMaker; using Microsoft.CodeAnalysis; using Silksong.AssetHelper.ManagedAssets; using TeamCherry.Localization; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.ResourceManagement.AsyncOperations; using UnityEngine.ResourceManagement.ResourceProviders; using UnityEngine.SceneManagement; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace TagTheFleas { public class BoidSimulation : MonoBehaviour { [CompilerGenerated] private sealed class <>c__DisplayClass12_0 { public GameObject go; internal bool b__1(GameObject other) { return (Object)(object)other != (Object)(object)go; } } [CompilerGenerated] private sealed class <>c__DisplayClass12_1 { public Vector3 p; internal float b__2(GameObject other) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) Vector3 val = p - other.transform.position; return ((Vector3)(ref val)).sqrMagnitude; } } [CompilerGenerated] private sealed class d__12 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public BoidSimulation <>4__this; private float 5__1; private WaitForSeconds 5__2; private List 5__3; private Vector3 5__4; private List.Enumerator <>s__5; private <>c__DisplayClass12_0 <>8__6; private Vector3 5__7; private Rigidbody2D 5__8; private (Vector3 position, Vector2 velocity, bool collided) 5__9; private <>c__DisplayClass12_1 <>8__10; private Vector3 5__11; private int 5__12; private List 5__13; private float 5__14; private float 5__15; private float 5__16; private float 5__17; private float 5__18; private Vector3 5__19; private Vector3 5__20; private float 5__21; private Vector3 5__22; private Vector3 5__23; private Vector3 5__24; private Vector3 5__25; private Vector3 5__26; private Vector3 5__27; private Vector3 5__28; private List.Enumerator <>s__29; private GameObject 5__30; private Rigidbody2D 5__31; private Vector3 5__32; private float 5__33; private HealthManager 5__34; private PlayMakerFSM 5__35; private AudioSource 5__36; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__12(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__2 = null; 5__3 = null; <>s__5 = default(List.Enumerator); <>8__6 = null; 5__8 = null; <>8__10 = null; 5__13 = null; <>s__29 = default(List.Enumerator); 5__30 = null; 5__31 = null; 5__34 = null; 5__35 = null; 5__36 = null; <>1__state = -2; } private bool MoveNext() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Expected O, but got Unknown //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_0777: 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_0165: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_0258: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_027a: Unknown result type (might be due to invalid IL or missing references) //IL_029a: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_05dd: 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: Unknown result type (might be due to invalid IL or missing references) //IL_05fb: Unknown result type (might be due to invalid IL or missing references) //IL_0601: Unknown result type (might be due to invalid IL or missing references) //IL_0606: Unknown result type (might be due to invalid IL or missing references) //IL_0612: Unknown result type (might be due to invalid IL or missing references) //IL_0618: Unknown result type (might be due to invalid IL or missing references) //IL_061d: Unknown result type (might be due to invalid IL or missing references) //IL_0622: Unknown result type (might be due to invalid IL or missing references) //IL_02eb: Unknown result type (might be due to invalid IL or missing references) //IL_02fc: Unknown result type (might be due to invalid IL or missing references) //IL_0301: Unknown result type (might be due to invalid IL or missing references) //IL_0308: Unknown result type (might be due to invalid IL or missing references) //IL_0319: Unknown result type (might be due to invalid IL or missing references) //IL_031e: Unknown result type (might be due to invalid IL or missing references) //IL_0335: Unknown result type (might be due to invalid IL or missing references) //IL_033a: Unknown result type (might be due to invalid IL or missing references) //IL_0346: Unknown result type (might be due to invalid IL or missing references) //IL_034c: Unknown result type (might be due to invalid IL or missing references) //IL_0351: Unknown result type (might be due to invalid IL or missing references) //IL_0356: Unknown result type (might be due to invalid IL or missing references) //IL_035a: Unknown result type (might be due to invalid IL or missing references) //IL_035f: Unknown result type (might be due to invalid IL or missing references) //IL_0366: Unknown result type (might be due to invalid IL or missing references) //IL_036c: Unknown result type (might be due to invalid IL or missing references) //IL_0371: Unknown result type (might be due to invalid IL or missing references) //IL_0380: Unknown result type (might be due to invalid IL or missing references) //IL_038a: Unknown result type (might be due to invalid IL or missing references) //IL_038f: Unknown result type (might be due to invalid IL or missing references) //IL_0396: Unknown result type (might be due to invalid IL or missing references) //IL_03a1: Unknown result type (might be due to invalid IL or missing references) //IL_03a6: Unknown result type (might be due to invalid IL or missing references) //IL_03b5: Unknown result type (might be due to invalid IL or missing references) //IL_03bf: Unknown result type (might be due to invalid IL or missing references) //IL_03c4: Unknown result type (might be due to invalid IL or missing references) //IL_03cb: Unknown result type (might be due to invalid IL or missing references) //IL_03da: Unknown result type (might be due to invalid IL or missing references) //IL_03e4: Unknown result type (might be due to invalid IL or missing references) //IL_03e9: Unknown result type (might be due to invalid IL or missing references) //IL_03f0: Unknown result type (might be due to invalid IL or missing references) //IL_03f6: Unknown result type (might be due to invalid IL or missing references) //IL_03fb: Unknown result type (might be due to invalid IL or missing references) //IL_0401: Unknown result type (might be due to invalid IL or missing references) //IL_0406: Unknown result type (might be due to invalid IL or missing references) //IL_040b: Unknown result type (might be due to invalid IL or missing references) //IL_06ca: Unknown result type (might be due to invalid IL or missing references) //IL_06d0: Unknown result type (might be due to invalid IL or missing references) //IL_06d6: Unknown result type (might be due to invalid IL or missing references) //IL_06db: Unknown result type (might be due to invalid IL or missing references) //IL_06e0: Unknown result type (might be due to invalid IL or missing references) //IL_06e5: Unknown result type (might be due to invalid IL or missing references) //IL_06ec: Unknown result type (might be due to invalid IL or missing references) //IL_06f2: Unknown result type (might be due to invalid IL or missing references) //IL_06fd: Unknown result type (might be due to invalid IL or missing references) //IL_0702: Unknown result type (might be due to invalid IL or missing references) //IL_0707: Unknown result type (might be due to invalid IL or missing references) //IL_0713: Unknown result type (might be due to invalid IL or missing references) //IL_0718: Unknown result type (might be due to invalid IL or missing references) //IL_0722: Unknown result type (might be due to invalid IL or missing references) //IL_0743: Unknown result type (might be due to invalid IL or missing references) //IL_074e: Unknown result type (might be due to invalid IL or missing references) //IL_065b: Unknown result type (might be due to invalid IL or missing references) //IL_0661: Unknown result type (might be due to invalid IL or missing references) //IL_0666: Unknown result type (might be due to invalid IL or missing references) //IL_066b: Unknown result type (might be due to invalid IL or missing references) //IL_0699: Unknown result type (might be due to invalid IL or missing references) //IL_06a8: Unknown result type (might be due to invalid IL or missing references) //IL_06b3: Unknown result type (might be due to invalid IL or missing references) //IL_06bd: Unknown result type (might be due to invalid IL or missing references) //IL_06c2: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = 0.2f; 5__2 = new WaitForSeconds(5__1); <>4__this.StartTimer(); break; case 1: <>1__state = -1; 5__3 = null; break; } if (FleaSpawner.boidRun) { 5__3 = FleaSpawner.fleaData.Keys.Where((GameObject go) => (Object)(object)go != (Object)null).ToList(); 5__4 = ((Component)HeroController.instance).transform.position; <>s__5 = 5__3.GetEnumerator(); try { while (<>s__5.MoveNext()) { <>8__6 = new <>c__DisplayClass12_0(); <>8__6.go = <>s__5.Current; 5__7 = Vector3.zero; 5__8 = <>8__6.go.GetComponent(); if ((Object)(object)5__8 == (Object)null) { continue; } 5__9 = FleaSpawner.fleaData[<>8__6.go]; if (!5__9.collided) { <>8__10 = new <>c__DisplayClass12_1(); <>8__10.p = <>8__6.go.transform.position; 5__11 = new Vector3(5__8.linearVelocityX, 5__8.linearVelocityY, 0f); 5__12 = Mathf.Min(5, 5__3.Count - 1); 5__13 = 5__3.Where((GameObject other) => (Object)(object)other != (Object)(object)<>8__6.go).OrderBy(delegate(GameObject other) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) Vector3 val2 = <>8__10.p - other.transform.position; return ((Vector3)(ref val2)).sqrMagnitude; }).Take(5__12) .ToList(); Vector3 val; if (5__13.Count > 0) { 5__22 = Vector3.zero; 5__23 = Vector3.zero; <>s__29 = 5__13.GetEnumerator(); try { while (<>s__29.MoveNext()) { 5__30 = <>s__29.Current; 5__22 += 5__30.transform.position; 5__31 = 5__30.GetComponent(); 5__23 += new Vector3(5__31.linearVelocityX, 5__31.linearVelocityY, 0f); 5__31 = null; 5__30 = null; } } finally { ((IDisposable)<>s__29).Dispose(); } <>s__29 = default(List.Enumerator); 5__22 /= (float)5__13.Count; 5__23 /= (float)5__13.Count; 5__24 = 5__13[0].transform.position; val = <>8__10.p - 5__24; 5__25 = ((Vector3)(ref val)).normalized; 5__26 = (5__23 - 5__11) * TagTheFleas.alignStrength.Value * 10f; 5__27 = (5__22 - <>8__10.p) * TagTheFleas.cohesionStrength.Value * 10f; 5__28 = 5__25 * TagTheFleas.separationStrength.Value * 50f; 5__7 = 5__26 + 5__27 + 5__28; } 5__14 = 10f; 5__15 = 0f; 5__16 = 0f; 5__17 = 142f; 5__18 = <>8__10.p.x - 5__17; if (5__18 < 5__14) { 5__15 += 1f / Mathf.Max(5__18, 0.01f); } 5__17 = 70f; 5__18 = <>8__10.p.y - (<>8__10.p.x - 140f) * 0.62f - 5__17; if (5__18 < 5__14) { 5__16 += 1f / Mathf.Max(5__18, 0.01f); } 5__17 = 182f; 5__18 = 5__17 - <>8__10.p.x; if (5__18 < 5__14) { 5__15 -= 1f / Mathf.Max(5__18, 0.01f); } 5__17 = 120f; 5__18 = 5__17 - <>8__10.p.y; if (5__18 < 5__14) { 5__16 -= 1f / Mathf.Max(5__18, 0.01f); } 5__19 = new Vector3(5__15, 5__16, 0f) * TagTheFleas.wallStrength.Value * 500f; 5__20 = Vector3.zero; val = <>8__10.p - 5__4; 5__21 = ((Vector3)(ref val)).sqrMagnitude; if (5__21 < TagTheFleas.playerRunRadius.Value * TagTheFleas.playerRunRadius.Value) { 5__32 = <>8__10.p - 5__4; 5__33 = 1f - Mathf.Sqrt(5__21) / TagTheFleas.playerRunRadius.Value; 5__20 = ((Vector3)(ref 5__32)).normalized * TagTheFleas.fleeStrength.Value * 5__33 * 50f; } 5__7 += 5__20 + 5__19; 5__11 += 5__7 * 5__1; 5__8.linearVelocity = Vector2.ClampMagnitude(Vector2.op_Implicit(5__11), 20f); FleaSpawner.fleaData[<>8__6.go] = (<>8__10.p, 5__8.linearVelocity, false); <>8__10 = null; 5__13 = null; } else { 5__8.linearVelocity = Vector2.zero; } 5__8 = null; <>8__6 = null; } } finally { ((IDisposable)<>s__5).Dispose(); } <>s__5 = default(List.Enumerator); if (FleaSpawner.fleaData.Count == 0) { TagTheFleas.Log.LogInfo((object)"All fleas tagged"); 5__34 = FleaSpawner.giantFlea.GetComponent(); if (FleaSpawner.boidRun) { 5__34.hp = 1; } 5__35 = PlayMakerFSM.FindFsmOnGameObject(FleaSpawner.giantFlea, "Control"); if (5__35.Fsm.ActiveStateName == "Leave" && FleaSpawner.boidRun) { FleaSpawner.boidRun = false; TagTheFleas.boidCoroutineStarted = false; if ((Object)(object)FleaSpawner.musicInstance != (Object)null) { 5__36 = FleaSpawner.musicInstance.GetComponentInChildren(); if ((Object)(object)5__36 != (Object)null) { ((MonoBehaviour)<>4__this).StartCoroutine(<>4__this.FadeOutMusic(5__36, 5f)); } 5__36 = null; } return false; } 5__34 = null; 5__35 = null; } <>2__current = 5__2; <>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 d__14 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public AudioSource src; public float duration; public BoidSimulation <>4__this; private float 5__1; private float 5__2; private IEnumerator <>s__3; private Transform 5__4; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__14(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>s__3 = null; 5__4 = null; <>1__state = -2; } private bool MoveNext() { //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; TagTheFleas.Log.LogInfo((object)"Giant flea left"); <>4__this.StopTimer(); <>4__this.SaveBoidTime(Mathf.CeilToInt(<>4__this.elapsedTime / (float)TagTheFleas.numFleas.Value)); 5__1 = src.volume; 5__2 = 0f; break; case 1: <>1__state = -1; break; } if (5__2 < duration) { 5__2 += Time.deltaTime; src.volume = Mathf.Lerp(5__1, 0f, 5__2 / duration); <>2__current = null; <>1__state = 1; return true; } src.volume = 0f; Object.Destroy((Object)(object)((Component)src).gameObject); Object.Destroy((Object)(object)TagTheFleas.playGround); ((MonoBehaviour)<>4__this).StartCoroutine(FleaGameArena.instance.CamZoom(1f)); <>s__3 = ((Component)HeroController.instance).transform.GetEnumerator(); try { while (<>s__3.MoveNext()) { 5__4 = (Transform)<>s__3.Current; if (((Object)5__4).name == "Vignette") { ((Component)5__4).gameObject.SetActive(true); } 5__4 = null; } } finally { if (<>s__3 is IDisposable disposable) { disposable.Dispose(); } } <>s__3 = null; return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static BoidSimulation instance; private float elapsedTime = 0f; public static bool timerRunning = false; public static string filePath = Path.Combine(PluginDirectory, "ScoreBoard", "BoidTimes.txt"); public static string PluginDirectory => Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); private void Awake() { if ((Object)(object)instance == (Object)null) { instance = this; } } private void Update() { if (timerRunning) { elapsedTime += Time.deltaTime; } } private void SaveBoidTime(int time) { string text = $"{DateTime.Now:yyyy-MM-dd HH:mm:ss},{time}"; File.AppendAllText(filePath, text + "\n"); } private void OnGUI() { //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Expected O, but got Unknown //IL_0079: Unknown result type (might be due to invalid IL or missing references) if (timerRunning) { int num = 200; int num2 = 60; Rect val = default(Rect); ((Rect)(ref val))..ctor(10f, (float)(Screen.height - num2), (float)num, (float)num2); int num3 = Mathf.FloorToInt(elapsedTime / 60f); int num4 = Mathf.FloorToInt(elapsedTime % 60f); GUIStyle val2 = new GUIStyle(GUI.skin.label); val2.fontSize = 60; val2.alignment = (TextAnchor)3; GUI.Label(val, $"{num3:00}:{num4:00}", val2); } } private void StartTimer() { elapsedTime = 0f; timerRunning = true; } private void StopTimer() { timerRunning = false; } [IteratorStateMachine(typeof(d__12))] public IEnumerator Boid() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__12(0) { <>4__this = this }; } public static void SetBoidCollided(GameObject go) { if (FleaSpawner.fleaData.ContainsKey(go)) { (Vector3, Vector2, bool) value = FleaSpawner.fleaData[go]; value.Item3 = true; FleaSpawner.fleaData[go] = value; } } [IteratorStateMachine(typeof(d__14))] private IEnumerator FadeOutMusic(AudioSource src, float duration) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__14(0) { <>4__this = this, src = src, duration = duration }; } } public class FleaGameArena : MonoBehaviour { [CompilerGenerated] private sealed class d__5 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public FleaGameArena <>4__this; private GameObject 5__1; private GameObject 5__2; private GameObject 5__3; private GameObject 5__4; private GameObject 5__5; private GameObject 5__6; private BoxCollider2D 5__7; private int 5__8; private int 5__9; private int 5__10; private int 5__11; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__5(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; 5__2 = null; 5__3 = null; 5__4 = null; 5__5 = null; 5__6 = null; 5__7 = null; <>1__state = -2; } private bool MoveNext() { //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Expected O, but got Unknown //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Expected O, but got Unknown //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Expected O, but got Unknown //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Expected O, but got Unknown //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Expected O, but got Unknown //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Expected O, but got Unknown //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Expected O, but got Unknown //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Expected O, but got Unknown //IL_0299: Unknown result type (might be due to invalid IL or missing references) //IL_02c5: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: Unknown result type (might be due to invalid IL or missing references) //IL_0319: Unknown result type (might be due to invalid IL or missing references) //IL_0334: Unknown result type (might be due to invalid IL or missing references) //IL_036d: Unknown result type (might be due to invalid IL or missing references) //IL_0388: Unknown result type (might be due to invalid IL or missing references) //IL_03c1: Unknown result type (might be due to invalid IL or missing references) //IL_03dc: Unknown result type (might be due to invalid IL or missing references) //IL_0472: Unknown result type (might be due to invalid IL or missing references) //IL_047c: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = null; <>1__state = 1; return true; case 1: <>1__state = -1; TagTheFleas.playGround = new GameObject("Play Ground"); TagTheFleas.playGround.transform.SetParent(TagTheFleas.tagGameGO.transform); <>4__this.walls = new GameObject("Arena Walls"); <>4__this.walls.transform.SetParent(TagTheFleas.playGround.transform); 5__1 = new GameObject("Wall Sound"); 5__1.transform.SetParent(<>4__this.walls.transform); <>4__this.musicSource = 5__1.AddComponent(); 5__1.SetActive(true); <>4__this.musicSource.loop = false; <>4__this.musicSource.volume = 1f; <>4__this.musicSource.clip = ((IEnumerable)Resources.FindObjectsOfTypeAll()).FirstOrDefault((Func)((AudioClip c) => ((Object)c).name == "sword_hit_snow_1")); 5__2 = new GameObject("Left Wall"); 5__2.transform.SetParent(<>4__this.walls.transform); 5__3 = new GameObject("Right Wall"); 5__3.transform.SetParent(<>4__this.walls.transform); 5__4 = new GameObject("Roof"); 5__4.transform.SetParent(<>4__this.walls.transform); 5__5 = new GameObject("Platform"); 5__5.transform.SetParent(<>4__this.walls.transform); 5__6 = new GameObject("Colliders"); 5__6.transform.SetParent(<>4__this.walls.transform); 5__6.layer = LayerMask.NameToLayer("Terrain"); 5__6.transform.position = new Vector3(142f, 95f, 0.5855f); 5__7 = 5__6.AddComponent(); 5__7.size = new Vector2(2f, 60f); ((Collider2D)5__7).offset = new Vector2(2.1f, 0f); ((Collider2D)5__7).isTrigger = false; 5__7 = 5__6.AddComponent(); 5__7.size = new Vector2(1f, 60f); ((Collider2D)5__7).offset = new Vector2(38.7f, 0f); ((Collider2D)5__7).isTrigger = false; 5__7 = 5__6.AddComponent(); 5__7.size = new Vector2(50f, 1f); ((Collider2D)5__7).offset = new Vector2(18.5f, 21f); ((Collider2D)5__7).isTrigger = false; 5__7 = 5__6.AddComponent(); 5__7.size = new Vector2(50f, 1f); ((Collider2D)5__7).offset = new Vector2(18.5f, -24.6f); ((Collider2D)5__7).isTrigger = false; 5__8 = 1; goto IL_0455; case 2: <>1__state = -1; <>4__this.SpawnLift(FleaGameObjects.cachedLiftGO, 5__5, 142f + 5f * (float)5__8, 70f); 5__8++; goto IL_0455; case 3: <>1__state = -1; <>4__this.SpawnLift(FleaGameObjects.cachedLiftGO, 5__2, 142f, 30f + 4f * (float)5__9); 5__9++; goto IL_04cc; case 4: <>1__state = -1; <>4__this.SpawnLift(FleaGameObjects.cachedLiftGO, 5__3, 182f, 30f + 4f * (float)5__10 + 60f); 5__10++; goto IL_0541; case 5: { <>1__state = -1; <>4__this.SpawnLift(FleaGameObjects.cachedLiftGO, 5__4, 142f + 5f * (float)5__11, 118f); 5__11++; break; } IL_0541: if (5__10 < 8) { <>2__current = null; <>1__state = 4; return true; } 5__11 = 1; break; IL_0455: if (5__8 < 2) { <>2__current = null; <>1__state = 2; return true; } 5__9 = 8; goto IL_04cc; IL_04cc: if (5__9 < 23) { <>2__current = (object)new WaitForSeconds(0.2f); <>1__state = 3; return true; } 5__10 = 0; goto IL_0541; } if (5__11 < 9) { <>2__current = null; <>1__state = 5; return true; } ((MonoBehaviour)<>4__this).StartCoroutine(FleaSpawner.instance.FleasEnterArena()); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__9 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public float zoom; public FleaGameArena <>4__this; private float 5__1; private float 5__2; private float 5__3; private float 5__4; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__9(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = 0.5f; 5__2 = 0f; 5__3 = GameCameras.instance.tk2dCam.ZoomFactor; break; case 1: <>1__state = -1; 5__2 += Time.deltaTime; 5__4 = 5__2 / 5__1; GameCameras.instance.tk2dCam.ZoomFactor = Mathf.Lerp(5__3, zoom, 5__4); <>2__current = null; <>1__state = 2; return true; case 2: <>1__state = -1; break; } if (5__2 < 5__1) { <>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 d__7 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public FleaGameArena <>4__this; private GameObject 5__1; private int 5__2; private GameObject 5__3; private Vector3 5__4; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__7(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; 5__3 = null; <>1__state = -2; } private bool MoveNext() { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Expected O, but got Unknown //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = null; <>1__state = 1; return true; case 1: <>1__state = -1; 5__1 = new GameObject("Updrafts"); 5__1.transform.SetParent(TagTheFleas.playGround.transform); 5__2 = 0; while (5__2 < 5) { 5__3 = ManagedAssetExtensions.InstantiateAsset(TagTheFleas.upDraftGO); 5__3.transform.parent = 5__1.transform; ((Object)5__3).name = $"Updraft {5__2 + 1}"; 5__4 = new Vector3(153f + (float)5__2 * 6f, 68f + (float)5__2 * 5f, -0.1f); 5__3.transform.position = 5__4; 5__3.transform.rotation = Quaternion.identity; 5__3.SetActive(true); 5__3.transform.localScale = new Vector3(2f, 10f, 1f); 5__3 = null; 5__2++; } return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__8 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public FleaGameArena <>4__this; private GameObject 5__1; private int 5__2; private GameObject 5__3; private Vector3 5__4; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__8(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; 5__3 = null; <>1__state = -2; } private bool MoveNext() { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Expected O, but got Unknown //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_0125: 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_0114: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = null; <>1__state = 1; return true; case 1: <>1__state = -1; 5__1 = new GameObject("Drifters"); 5__1.transform.SetParent(TagTheFleas.playGround.transform); 5__2 = 0; while (5__2 < 2) { 5__3 = Object.Instantiate(FleaGameObjects.cachedDrifterGO); 5__3.transform.parent = 5__1.transform; ((Object)5__3).name = $"Peaks Drifter {5__2 + 1}"; 5__4 = Vector3.one; if (5__2 == 0) { 5__4 = new Vector3(160f, 102f, -0.1f); } else if (5__2 == 1) { 5__4 = new Vector3(162f, 92f, -0.1f); } 5__3.transform.position = 5__4; 5__3.SetActive(true); 5__3 = null; 5__2++; } return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static FleaGameArena instance; private AudioSource musicSource; private GameObject walls; private void Awake() { if ((Object)(object)instance == (Object)null) { instance = this; } } public void BuildArena() { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Expected O, but got Unknown //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Expected O, but got Unknown //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Expected O, but got Unknown ((MonoBehaviour)this).StartCoroutine(CamZoom(TagTheFleas.camZoomLevel.Value)); foreach (Transform item in ((Component)HeroController.instance).transform) { Transform val = item; if (((Object)val).name == "Vignette") { ((Component)val).gameObject.SetActive(false); } } if ((Object)(object)TagTheFleas.playGround != (Object)null) { Object.Destroy((Object)(object)TagTheFleas.playGround); } ((MonoBehaviour)this).StartCoroutine(BuildWallsFromLifts()); ((MonoBehaviour)this).StartCoroutine(InstallUpdrafts()); ((MonoBehaviour)this).StartCoroutine(PutPeaksDrifters()); GameObject val2 = ManagedAssetExtensions.InstantiateAsset(TagTheFleas.scoreBoardGO); val2.transform.position = new Vector3(191f, 111.5f, 0f); foreach (Transform item2 in val2.transform) { Transform val3 = item2; if (((Object)((Component)val3).gameObject).name.Contains("(2)")) { ((Component)val3).gameObject.SetActive(true); } } GameObject val4 = GameObject.Find("Flea Festival Score Board(Clone)"); ((Object)val4).name = "Score Container"; val4.transform.SetParent(TagTheFleas.tagGameGO.transform); foreach (Transform item3 in val4.transform) { Transform val5 = item3; if (((Object)((Component)val5).gameObject).name.Contains("Divider")) { Object.Destroy((Object)(object)((Component)val5).gameObject); } } } [IteratorStateMachine(typeof(d__5))] private IEnumerator BuildWallsFromLifts() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__5(0) { <>4__this = this }; } private void SpawnLift(GameObject cachedLiftGO, GameObject wall, float targetX, float targetY) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) GameObject val = Object.Instantiate(cachedLiftGO.gameObject, wall.transform); val.transform.position = new Vector3(targetX, targetY, 0.5855f); ((Component)val.transform.GetChild(6)).gameObject.SetActive(false); ((Component)val.transform.GetChild(7)).gameObject.SetActive(false); ((Component)val.transform.GetChild(10)).gameObject.SetActive(false); musicSource.Play(); } [IteratorStateMachine(typeof(d__7))] private IEnumerator InstallUpdrafts() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__7(0) { <>4__this = this }; } [IteratorStateMachine(typeof(d__8))] private IEnumerator PutPeaksDrifters() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__8(0) { <>4__this = this }; } [IteratorStateMachine(typeof(d__9))] public IEnumerator CamZoom(float zoom) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__9(0) { <>4__this = this, zoom = zoom }; } } public class FleaGameObjects : MonoBehaviour { [CompilerGenerated] private sealed class d__7 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public FleaGameObjects <>4__this; private GameObject 5__1; private string 5__2; private AsyncOperationHandle 5__3; private Scene 5__4; private IEnumerator <>s__5; private Transform 5__6; private IEnumerator <>s__7; private Transform 5__8; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__7(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) 5__1 = null; 5__2 = null; 5__3 = default(AsyncOperationHandle); <>s__5 = null; 5__6 = null; <>s__7 = null; 5__8 = null; <>1__state = -2; } private bool MoveNext() { //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Expected O, but got Unknown //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_02ed: Unknown result type (might be due to invalid IL or missing references) //IL_02f2: Unknown result type (might be due to invalid IL or missing references) //IL_02f6: Unknown result type (might be due to invalid IL or missing references) //IL_02fb: Unknown result type (might be due to invalid IL or missing references) //IL_033d: Unknown result type (might be due to invalid IL or missing references) //IL_0343: 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_00b6: Expected O, but got Unknown //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Expected O, but got Unknown //IL_0236: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Expected O, but got Unknown //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_02bb: Unknown result type (might be due to invalid IL or missing references) //IL_02c0: Unknown result type (might be due to invalid IL or missing references) //IL_02c7: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; ((ManagedAssetBase)(object)TagTheFleas.upDraftGO).Load(); ((ManagedAssetBase)(object)TagTheFleas.fleaGO).Load(); ((ManagedAssetBase)(object)TagTheFleas.fleaAwooGO).Load(); ((ManagedAssetBase)(object)TagTheFleas.giantFleaGO).Load(); ((ManagedAssetBase)(object)TagTheFleas.scoreBoardGO).Load(); <>2__current = (object)new WaitUntil((Func)(() => ((ManagedAssetBase)(object)TagTheFleas.upDraftGO).IsLoaded && ((ManagedAssetBase)(object)TagTheFleas.fleaGO).IsLoaded && ((ManagedAssetBase)(object)TagTheFleas.fleaAwooGO).IsLoaded && ((ManagedAssetBase)(object)TagTheFleas.giantFleaGO).IsLoaded && ((ManagedAssetBase)(object)TagTheFleas.scoreBoardGO).IsLoaded)); <>1__state = 1; return true; case 1: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.1f); <>1__state = 2; return true; case 2: <>1__state = -1; 5__1 = ManagedAssetExtensions.InstantiateAsset(TagTheFleas.scoreBoardGO); 5__1.transform.position = new Vector3(70f, 4.8f, 0f); <>2__current = null; <>1__state = 3; return true; case 3: <>1__state = -1; <>s__5 = 5__1.transform.GetEnumerator(); try { while (<>s__5.MoveNext()) { 5__6 = (Transform)<>s__5.Current; if (((Object)((Component)5__6).gameObject).name == "Pin_examples") { ((Component)5__6).gameObject.SetActive(true); } 5__6 = null; } } finally { if (<>s__5 is IDisposable disposable2) { disposable2.Dispose(); } } <>s__5 = null; 5__1 = ManagedAssetExtensions.InstantiateAsset(TagTheFleas.scoreBoardGO); 5__1.transform.position = new Vector3(191f, 111.5f, 0f); <>2__current = null; <>1__state = 4; return true; case 4: <>1__state = -1; <>s__7 = 5__1.transform.GetEnumerator(); try { while (<>s__7.MoveNext()) { 5__8 = (Transform)<>s__7.Current; if (((Object)((Component)5__8).gameObject).name == "Pin_examples") { ((Component)5__8).gameObject.SetActive(true); } 5__8 = null; } } finally { if (<>s__7 is IDisposable disposable) { disposable.Dispose(); } } <>s__7 = null; 5__2 = "Scenes/Aqueduct_05_festival"; 5__3 = Addressables.LoadSceneAsync((object)5__2, (LoadSceneMode)1, true, 100, (SceneReleaseMode)0); <>2__current = 5__3; <>1__state = 5; return true; case 5: { <>1__state = -1; SceneInstance result = 5__3.Result; 5__4 = ((SceneInstance)(ref result)).Scene; festiveMusic = Object.Instantiate(GameObject.Find("Main")); ((Object)festiveMusic).name = "Flea Game Music"; Object.DontDestroyOnLoad((Object)(object)festiveMusic); festiveMusic.SetActive(false); <>2__current = Addressables.UnloadSceneAsync(5__3, true); <>1__state = 6; return true; } case 6: <>1__state = -1; TagTheFleas.Log.LogInfo((object)"Non-scene objects cached in"); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__8 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public FleaGameObjects <>4__this; private Scene 5__1; private GameObject[] <>s__2; private int <>s__3; private GameObject 5__4; private IEnumerator <>s__5; private Transform 5__6; private GameObject 5__7; private float 5__8; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__8(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>s__2 = null; 5__4 = null; <>s__5 = null; 5__6 = null; 5__7 = null; <>1__state = -2; } private bool MoveNext() { //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_017b: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = null; <>1__state = 1; return true; case 1: <>1__state = -1; 5__1 = SceneManager.GetActiveScene(); <>s__2 = ((Scene)(ref 5__1)).GetRootGameObjects(); for (<>s__3 = 0; <>s__3 < <>s__2.Length; <>s__3++) { 5__4 = <>s__2[<>s__3]; if (((Object)5__4).name == "chair_lift (7)") { <>s__5 = 5__4.transform.GetEnumerator(); try { while (<>s__5.MoveNext()) { 5__6 = (Transform)<>s__5.Current; if (((Object)5__6).name.Contains("main_carriage")) { cachedLiftGO = ((Component)5__6).gameObject; break; } 5__6 = null; } } finally { if (<>s__5 is IDisposable disposable) { disposable.Dispose(); } } <>s__5 = null; } if (((Object)5__4).name == "Peak_Break_white_ball (6)") { 5__7 = Object.Instantiate(5__4.gameObject); ((Object)5__7.gameObject).name = "Hornet Detector"; 5__8 = 5__4.gameObject.transform.position.z; 5__7.transform.position = new Vector3(162f, 80f, 5__8); 5__7.transform.localScale = new Vector3(2f, 2f, 1f); 5__7 = null; } if (((Object)5__4).name.Contains("Peaks Drifter")) { cachedDrifterGO = 5__4.gameObject; drifterHit = cachedDrifterGO.GetComponent(); } 5__4 = null; } <>s__2 = null; TagTheFleas.Log.LogInfo((object)"Peak_05 objects cached in"); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static FleaGameObjects instance; public static GameObject festiveMusic; public static GameObject cachedLiftGO; public static GameObject cachedDrifterGO; public static EnemyHitEffectsRegular drifterHit; private void Awake() { if ((Object)(object)instance == (Object)null) { instance = this; } } public void CacheFleaGameObjects() { ((MonoBehaviour)this).StartCoroutine(CacheNonSceneObjects()); ((MonoBehaviour)this).StartCoroutine(CachePeak05Objects()); } [IteratorStateMachine(typeof(d__7))] private IEnumerator CacheNonSceneObjects() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__7(0) { <>4__this = this }; } [IteratorStateMachine(typeof(d__8))] private IEnumerator CachePeak05Objects() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__8(0) { <>4__this = this }; } } public class FleaSpawner : MonoBehaviour { [CompilerGenerated] private sealed class d__11 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public GameObject flea; public FleaSpawner <>4__this; private Rigidbody2D 5__1; private float 5__2; private float 5__3; private tk2dSprite 5__4; private float 5__5; private float 5__6; private float 5__7; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__11(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; 5__4 = null; <>1__state = -2; } private bool MoveNext() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Expected O, but got Unknown //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(1f); <>1__state = 1; return true; case 1: <>1__state = -1; 5__1 = flea.GetComponent(); 5__2 = Random.Range(0f, 5f); 5__3 = Random.Range(0f, 10f); 5__1.linearVelocityX = 5__2; 5__1.linearVelocityY = 5__3; 5__4 = flea.GetComponent(); 5__5 = 2f; 5__6 = 0f; break; case 2: <>1__state = -1; 5__6 += Time.deltaTime; 5__7 = 5__6 / 5__5; 5__1.linearVelocityX = Mathf.Lerp(5__2, 0f, 5__7); 5__1.linearVelocityY = Mathf.Lerp(5__3, 0f, 5__7); ((tk2dBaseSprite)5__4).color = new Color(1f, 1f, 1f, Mathf.Lerp(0f, 1f, 5__7)); flea.transform.localRotation = Quaternion.Euler(0f, Mathf.Lerp(-90f, 0f, 5__7), 0f); flea.transform.localScale = new Vector3(1f, Mathf.Lerp(0f, 1f, 5__7), 1f); break; } if (5__6 < 5__5) { <>2__current = null; <>1__state = 2; return true; } 5__1.linearVelocityX = Random.Range(5f, 20f); 5__1.linearVelocityY = Random.Range(10f, 15f); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__9 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public FleaSpawner <>4__this; private GameObject 5__1; private GameObject 5__2; private HealthManager 5__3; private tk2dSprite 5__4; private AudioSource 5__5; private int 5__6; private Vector3 5__7; private GameObject 5__8; private PlayMakerFixedUpdate 5__9; private Rigidbody2D 5__10; private CircleCollider2D 5__11; private FlyAwayOnTag 5__12; private EnemyHitEffectsRegular 5__13; private EnemyHitEffectsRegular 5__14; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__9(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; 5__2 = null; 5__3 = null; 5__4 = null; 5__5 = null; 5__8 = null; 5__9 = null; 5__10 = null; 5__11 = null; 5__12 = null; 5__13 = null; 5__14 = null; <>1__state = -2; } private bool MoveNext() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Unknown result type (might be due to invalid IL or missing references) //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_05d5: Unknown result type (might be due to invalid IL or missing references) //IL_05df: Expected O, but got Unknown //IL_053d: Unknown result type (might be due to invalid IL or missing references) //IL_0560: Unknown result type (might be due to invalid IL or missing references) //IL_02b4: Unknown result type (might be due to invalid IL or missing references) //IL_0319: Unknown result type (might be due to invalid IL or missing references) //IL_047b: 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_04d2: Unknown result type (might be due to invalid IL or missing references) //IL_0517: Unknown result type (might be due to invalid IL or missing references) //IL_0521: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = new GameObject("Tag Fleas"); 5__1.transform.SetParent(TagTheFleas.playGround.transform); 5__2 = ManagedAssetExtensions.InstantiateAsset(TagTheFleas.fleaAwooGO); ((Object)5__2.gameObject).name = "Awoo"; callOutFSM = PlayMakerFSM.FindFsmOnGameObject(5__2, "Call Out"); <>4__this.awooSource = 5__2.GetComponent(); 5__2.SetActive(false); giantFlea = ManagedAssetExtensions.InstantiateAsset(TagTheFleas.giantFleaGO); ((Object)giantFlea.gameObject).name = "Giant Flea"; giantFlea.transform.SetParent(5__1.transform); giantFlea.transform.position = new Vector3(152f, 82f, 0f); 5__3 = giantFlea.GetComponent(); 5__3.hp = 9999; 5__4 = giantFlea.GetComponentInChildren(); ((tk2dBaseSprite)5__4).color = new Color(1f, 1f, 1f, 0f); ((Behaviour)5__4).enabled = true; giantFlea.transform.localRotation = Quaternion.Euler(0f, -90f, 0f); giantFlea.transform.localScale = new Vector3(1f, 0.01f, 1f); giantFleaReady = false; giantFlea.SetActive(true); ((MonoBehaviour)<>4__this).StartCoroutine(<>4__this.GiantFleaAppear(giantFlea)); 5__6 = 0; break; case 1: <>1__state = -1; fleaData[5__8] = (5__7, new Vector2(Random.Range(-1f, 1f), Random.Range(-1f, 1f)), false); 5__8 = null; 5__9 = null; 5__10 = null; 5__11 = null; 5__12 = null; 5__13 = null; 5__14 = null; 5__6++; break; } if (5__6 < TagTheFleas.numFleas.Value) { 5__7 = new Vector3(146f + Random.Range(0f, 1f), 72f + Random.Range(1f, 8f), Random.Range(-0.2f, 0.2f)); 5__8 = ManagedAssetExtensions.InstantiateAsset(TagTheFleas.fleaGO); 5__8.transform.SetParent(5__1.transform); ((Object)5__8).name = $"Tag Flea {5__6 + 1}"; if ((Object)(object)<>4__this.awooSource != (Object)null) { 5__8.AddComponent(); } 5__8.transform.position = 5__7; Physics2D.IgnoreLayerCollision(5__8.layer, 17, false); 5__9 = 5__8.GetComponent(); ((Behaviour)5__9).enabled = false; 5__10 = 5__8.GetComponent(); 5__10.gravityScale = 0f; 5__10.linearVelocity = Vector2.zero; 5__10.constraints = (RigidbodyConstraints2D)4; 5__10.collisionDetectionMode = (CollisionDetectionMode2D)1; 5__8.layer = LayerMask.NameToLayer("Enemies"); 5__11 = 5__8.GetComponent(); if ((Object)(object)5__11 == (Object)null) { 5__11 = 5__8.AddComponent(); } ((Behaviour)5__11).enabled = true; ((Collider2D)5__11).isTrigger = false; CircleCollider2D obj = 5__11; obj.radius *= 0.5f; 5__12 = 5__8.AddComponent(); 5__12.Init(5__8); 5__13 = 5__8.gameObject.AddComponent(); 5__14 = giantFlea.GetComponent(); if ((Object)(object)5__14.Profile != (Object)null) { 5__13.Profile = 5__14.Profile; } 5__3 = 5__8.gameObject.AddComponent(); 5__3.IsInvincible = true; 5__4 = 5__8.GetComponent(); ((tk2dBaseSprite)5__4).color = new Color(1f, 1f, 1f, 0f); ((Behaviour)5__4).enabled = true; 5__8.transform.localRotation = Quaternion.Euler(0f, -90f, 0f); 5__8.transform.localScale = new Vector3(1f, 0.01f, 1f); 5__8.SetActive(true); ((MonoBehaviour)<>4__this).StartCoroutine(<>4__this.FleaAppear(5__8)); <>2__current = (object)new WaitForSeconds(Random.Range(0.05f, 0.1f)); <>1__state = 1; return true; } musicInstance = new GameObject("Flea Game Music"); musicInstance.transform.SetParent(TagTheFleas.playGround.transform); 5__5 = musicInstance.AddComponent(); musicInstance.SetActive(true); 5__5.loop = true; 5__5.volume = 1f; 5__5.clip = ((IEnumerable)Resources.FindObjectsOfTypeAll()).FirstOrDefault((Func)((AudioClip c) => ((Object)c).name == "Pinstress Battle")); 5__5.Play(); boidRun = true; ((MonoBehaviour)<>4__this).StartCoroutine(BoidSimulation.instance.Boid()); TagTheFleas.Log.LogInfo((object)"Fleas spawned, starting the game"); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__10 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public GameObject flea; public FleaSpawner <>4__this; private PlayMakerFSM 5__1; private tk2dSprite 5__2; private float 5__3; private float 5__4; private float 5__5; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__10(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; 5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0285: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Unknown result type (might be due to invalid IL or missing references) //IL_02c0: Unknown result type (might be due to invalid IL or missing references) //IL_02d1: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = PlayMakerFSM.FindFsmOnGameObject(flea, "Control"); if ((Object)(object)5__1 != (Object)null) { ((Behaviour)5__1).enabled = true; <>2__current = null; <>1__state = 1; return true; } goto IL_0098; case 1: <>1__state = -1; 5__1.SetState("Idle"); ((Behaviour)5__1).enabled = false; goto IL_0098; case 2: { <>1__state = -1; 5__4 += Time.deltaTime; 5__5 = 5__4 / 5__3; ((tk2dBaseSprite)5__2).color = new Color(1f, 1f, 1f, Mathf.Lerp(0f, 1f, 5__5)); flea.transform.localRotation = Quaternion.Euler(0f, Mathf.Lerp(90f, 0f, 5__5), Mathf.Lerp(-30f, 0f, 5__5)); flea.transform.localScale = new Vector3(1f, Mathf.Lerp(0f, 1f, 5__5), 1f); flea.transform.position = new Vector3(Mathf.Lerp(152f, 153f, 5__5), Mathf.Lerp(82f, 81f, 5__5), 0f); break; } IL_0098: 5__2 = flea.GetComponentInChildren(); flea.transform.localRotation = Quaternion.Euler(0f, -90f, 0f); flea.transform.localScale = new Vector3(1f, 0.01f, 1f); flea.transform.position = new Vector3(152f, 82f, 0f); 5__3 = 0.5f; 5__4 = 0f; break; } if (5__4 < 5__3) { <>2__current = null; <>1__state = 2; return true; } flea.transform.localRotation = Quaternion.identity; flea.transform.localScale = Vector3.one; flea.transform.position = new Vector3(153f, 81f, 0f); ((tk2dBaseSprite)5__2).color = Color.white; giantFleaReady = true; if ((Object)(object)5__1 != (Object)null) { ((Behaviour)5__1).enabled = 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(); } } public static FleaSpawner instance; public static PlayMakerFSM callOutFSM; private AudioSource awooSource; public static GameObject musicInstance; public static GameObject giantFlea; public static bool boidRun = true; public static bool giantFleaReady = false; public static Dictionary fleaData = new Dictionary(); private void Awake() { if ((Object)(object)instance == (Object)null) { instance = this; } } [IteratorStateMachine(typeof(d__9))] public IEnumerator FleasEnterArena() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__9(0) { <>4__this = this }; } [IteratorStateMachine(typeof(d__10))] private IEnumerator GiantFleaAppear(GameObject flea) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__10(0) { <>4__this = this, flea = flea }; } [IteratorStateMachine(typeof(d__11))] private IEnumerator FleaAppear(GameObject flea) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__11(0) { <>4__this = this, flea = flea }; } } public class FlyAwayOnTag : MonoBehaviour { [CompilerGenerated] private sealed class d__4 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public GameObject obj; public FlyAwayOnTag <>4__this; private EnemyHitEffectsRegular 5__1; private HitInstance 5__2; private PlayMakerFSM 5__3; private Collider2D[] <>s__4; private int <>s__5; private Collider2D 5__6; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__4(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) 5__1 = null; 5__2 = default(HitInstance); 5__3 = null; <>s__4 = null; 5__6 = null; <>1__state = -2; } private bool MoveNext() { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Expected O, but got Unknown //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Expected O, but got Unknown //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: 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_00f7: 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_014d: Expected O, but got Unknown //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Expected O, but got Unknown switch (<>1__state) { 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; <>s__4 = obj.GetComponentsInChildren(); for (<>s__5 = 0; <>s__5 < <>s__4.Length; <>s__5++) { 5__6 = <>s__4[<>s__5]; ((Behaviour)5__6).enabled = false; 5__6 = null; } <>s__4 = null; 5__1 = obj.gameObject.GetComponent(); 5__2 = new HitInstance { DamageDealt = 1 }; 5__1.ReceiveHitEffect(5__2, Vector2.zero); ((Behaviour)5__1).enabled = true; 5__3 = PlayMakerFSM.FindFsmOnGameObject(obj, "Behaviour"); ((Behaviour)5__3).enabled = false; 5__3.Fsm = new Fsm(FleaSpawner.callOutFSM.Fsm, (FsmVariables)null); 5__3.FsmName = FleaSpawner.callOutFSM.FsmName; 5__3.Fsm.InitData(); ((Behaviour)5__3).enabled = true; <>2__current = (object)new WaitForSeconds(Random.Range(0.1f, 1f)); <>1__state = 2; return true; case 2: <>1__state = -1; 5__3.SendEvent("TOUCH"); <>2__current = (object)new WaitForSeconds(6f); <>1__state = 3; return true; case 3: <>1__state = -1; Object.Destroy((Object)(object)obj); FleaSpawner.fleaData.Remove(obj); 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 GameObject obj; private bool tagged; public void Init(GameObject gameObject) { obj = gameObject; } private void OnTriggerEnter2D(Collider2D col) { if (!tagged && LayerMask.LayerToName(((Component)col).gameObject.layer).Contains("Attack")) { tagged = true; ((MonoBehaviour)this).StartCoroutine(TagFlea(obj)); BoidSimulation.SetBoidCollided(obj); } } [IteratorStateMachine(typeof(d__4))] private IEnumerator TagFlea(GameObject obj) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__4(0) { <>4__this = this, obj = obj }; } } [BepInPlugin("lagerthon.TagTheFleas", "Tag Flea Game", "1.0.2")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class TagTheFleas : BaseUnityPlugin { public static TagTheFleas instance; public static ManualLogSource Log; private static ConfigEntry scoreResetKey; public static ConfigEntry gameName; public static ConfigEntry sethName; public static ConfigEntry vogName; public static ConfigEntry leaderName; public static ConfigEntry shortName; public static ConfigEntry tallName; public static ConfigEntry krattName; public static ConfigEntry enableMod; public static ManagedAsset fleaGO; public static ManagedAsset fleaAwooGO; public static ManagedAsset giantFleaGO; public static ManagedAsset upDraftGO; public static ManagedAsset scoreBoardGO; public static ManagedAsset scoreContainerGO; public static GameObject playGround; public static bool boidCoroutineStarted = false; public static ConfigEntry numFleas; public static ConfigEntry alignStrength; public static ConfigEntry cohesionStrength; public static ConfigEntry separationStrength; public static ConfigEntry playerRunRadius; public static ConfigEntry fleeStrength; public static ConfigEntry wallStrength; public static ConfigEntry camZoomLevel; public static GameObject tagGameGO; public static int[] times = new int[0]; public static string filePath = Path.Combine(PluginDirectory, "ScoreBoard", "BoidTimes.txt"); public static string PluginDirectory => Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); private void Awake() { //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Expected O, but got Unknown //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Expected O, but got Unknown //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Expected O, but got Unknown //IL_0246: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Expected O, but got Unknown //IL_0283: Unknown result type (might be due to invalid IL or missing references) //IL_028d: Expected O, but got Unknown //IL_02c0: Unknown result type (might be due to invalid IL or missing references) //IL_02ca: Expected O, but got Unknown //IL_02fd: Unknown result type (might be due to invalid IL or missing references) //IL_0307: Expected O, but got Unknown //IL_033a: Unknown result type (might be due to invalid IL or missing references) //IL_0344: Expected O, but got Unknown //IL_048f: Unknown result type (might be due to invalid IL or missing references) //IL_0499: Expected O, but got Unknown //IL_04e9: Unknown result type (might be due to invalid IL or missing references) //IL_0517: Unknown result type (might be due to invalid IL or missing references) //IL_051d: Expected O, but got Unknown Log = ((BaseUnityPlugin)this).Logger; if ((Object)(object)instance == (Object)null) { instance = this; } enableMod = ((BaseUnityPlugin)this).Config.Bind("Enable Mod", "Enable Mod", true, "Key used to enable or disable the mod"); gameName = ((BaseUnityPlugin)this).Config.Bind("Names", "Game", "Tag", "Changes game's name"); scoreResetKey = ((BaseUnityPlugin)this).Config.Bind("Score Reset", "Reset flea game score", new KeyboardShortcut((KeyCode)304, Array.Empty()), "Key to reset flea game scores"); sethName = ((BaseUnityPlugin)this).Config.Bind("Names", "Seth", "Seth The Legend", "Changes Seth's name"); vogName = ((BaseUnityPlugin)this).Config.Bind("Names", "Vog", "Warrior", "Changes Vog' name"); leaderName = ((BaseUnityPlugin)this).Config.Bind("Names", "Mooshka", "Leader", "Changes Mooshka's name"); shortName = ((BaseUnityPlugin)this).Config.Bind("Names", "Grishkin", "Potion Master", "Changes Grishkin's name"); tallName = ((BaseUnityPlugin)this).Config.Bind("Names", "Varga", "Lazy", "Changes Varga's name"); krattName = ((BaseUnityPlugin)this).Config.Bind("Names", "Kratt", "Kreep", "Changes Kratt's name"); numFleas = ((BaseUnityPlugin)this).Config.Bind("Fleas", "Number of fleas to spawn", 10, new ConfigDescription("Set how many fleas to spawn. Your computer's performance will matter a lot on how many fleas it can handle.", (AcceptableValueBase)(object)new AcceptableValueRange(5, 50), Array.Empty())); alignStrength = ((BaseUnityPlugin)this).Config.Bind("Flea Boid", "Strength Velocity Align", 1f, new ConfigDescription("How strongly fleas fly together.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 1f), Array.Empty())); cohesionStrength = ((BaseUnityPlugin)this).Config.Bind("Flea Boid", "Strength Attraction", 1f, new ConfigDescription("How strongly fleas attract each other.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 1f), Array.Empty())); wallStrength = ((BaseUnityPlugin)this).Config.Bind("Flea Boid", "Strength Wall", 50f, new ConfigDescription("How strongly fleas fly away from the walls.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 1f), Array.Empty())); separationStrength = ((BaseUnityPlugin)this).Config.Bind("Flea Boid", "Strength Separation", 5f, new ConfigDescription("How strongly a flea repel its nearest flea.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 1f), Array.Empty())); fleeStrength = ((BaseUnityPlugin)this).Config.Bind("Flea Boid", "Strength flee", 10f, new ConfigDescription("How strongly fleas fly away from Hornet.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 1f), Array.Empty())); playerRunRadius = ((BaseUnityPlugin)this).Config.Bind("Flea Boid", "Distance from Hornet", 10f, new ConfigDescription("From how far fleas can detect Hornet.", (AcceptableValueBase)(object)new AcceptableValueRange(5f, 50f), Array.Empty())); camZoomLevel = ((BaseUnityPlugin)this).Config.Bind("Visuals", "Camera Zoom Level", 0.5f, new ConfigDescription("Zooms out the camera when the game begins", (AcceptableValueBase)(object)new AcceptableValueRange(0.1f, 1f), Array.Empty())); upDraftGO = ManagedAsset.FromSceneAsset("bone_east_08", "Updraft Region (9)"); if (upDraftGO != null) { Log.LogInfo((object)("Found: " + upDraftGO.Key)); } fleaGO = ManagedAsset.FromSceneAsset("bone_10", "Black Thread States Thread Only Variant/Normal World/Caravan/Fleas/Group1/Caravan Troupe Flea Saved 1"); if (fleaGO != null) { Log.LogInfo((object)("Found: " + fleaGO.Key)); } fleaAwooGO = ManagedAsset.FromSceneAsset("dock_16", "Flea Rescue Sleeping"); if (fleaAwooGO != null) { Log.LogInfo((object)("Found: " + fleaAwooGO.Key)); } giantFleaGO = ManagedAsset.FromSceneAsset("arborium_08", "Giant Flea Scene/Giant Flea"); if (giantFleaGO != null) { Log.LogInfo((object)("Found: " + giantFleaGO.Key)); } scoreBoardGO = ManagedAsset.FromSceneAsset("aqueduct_05_festival", "Caravan_States/Flea Festival/Flea Festival Scoreboard"); if (scoreBoardGO != null) { Log.LogInfo((object)("Found: " + scoreBoardGO.Key)); } tagGameGO = new GameObject("Tag Game"); Object.DontDestroyOnLoad((Object)(object)tagGameGO); tagGameGO.AddComponent(); tagGameGO.AddComponent(); tagGameGO.AddComponent(); tagGameGO.AddComponent(); tagGameGO.transform.position = new Vector3(0f, 0f, 0f); tagGameGO.SetActive(true); SceneManager.sceneLoaded += OnSceneLoaded; Harmony val = new Harmony("lagerthon.TagTheFleas"); val.PatchAll(); Log.LogInfo((object)"Tag Flea Game loaded"); } private void Update() { //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) KeyboardShortcut value = scoreResetKey.Value; if (((KeyboardShortcut)(ref value)).IsDown()) { if (File.Exists(filePath)) { File.WriteAllText(filePath, ""); } times = new int[0]; } } private void OnSceneLoaded(Scene scene, LoadSceneMode mode) { if (!enableMod.Value) { return; } if ((Object)(object)playGround != (Object)null) { Object.Destroy((Object)(object)playGround); FleaSpawner.fleaData.Clear(); ((MonoBehaviour)this).StartCoroutine(FleaGameArena.instance.CamZoom(1f)); } BoidSimulation.timerRunning = false; if (!(((Scene)(ref scene)).name == "Peak_05")) { return; } Log.LogInfo((object)"Hornet in Peak 05, caching flea game objects"); FleaSpawner.giantFleaReady = false; string directoryName = Path.GetDirectoryName(filePath); if (!Directory.Exists(directoryName)) { Directory.CreateDirectory(directoryName); } if (!File.Exists(filePath)) { File.WriteAllText(filePath, string.Empty); } if (File.Exists(filePath)) { times = (from t in File.ReadAllLines(filePath).Select(delegate(string line) { string[] array = line.Split(','); if (array.Length < 2) { return null; } int result; return int.TryParse(array[1], out result) ? new int?(result) : null; }) where t.HasValue select t.Value).ToArray(); } FleaGameObjects.instance.CacheFleaGameObjects(); } } [HarmonyPatch(typeof(Breakable), "Break")] public class BreakablePatch { private static void Postfix(Breakable __instance) { if (((Object)((Component)__instance).gameObject).name.Contains("Hornet Detector")) { FleaGameArena.instance.BuildArena(); TagTheFleas.Log.LogInfo((object)"Snow ball broke, spawning flea game objects"); } } } [HarmonyPatch(typeof(AlertRange), "IsHeroInRange")] public class AlertRangePatch { private static bool Prefix(AlertRange __instance, ref bool __result) { if (!FleaSpawner.giantFleaReady) { return true; } Transform parent = ((Component)__instance).transform.parent; if ((Object)(object)parent != (Object)null && ((Object)parent).name.Contains("Giant Flea")) { __result = true; return false; } return true; } } [HarmonyPatch(typeof(ScoreBoardUI), "Refresh")] public class ScoreBoardUIPatch { private static int[] times; private static void Postfix(ScoreBoardUI __instance, Transform[] ___columns) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Expected O, but got Unknown //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Expected O, but got Unknown //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Expected O, but got Unknown //IL_0107: Unknown result type (might be due to invalid IL or missing references) Scene activeScene = SceneManager.GetActiveScene(); if (((Scene)(ref activeScene)).name != "Peak_05") { return; } times = TagTheFleas.times; foreach (Transform item in ((Component)__instance).transform) { Transform val = item; if (!(((Object)val).name == "Container")) { continue; } foreach (Transform item2 in ((Component)val).transform) { Transform val2 = item2; if (((Object)val2).name.Contains("Juggle") || ((Object)val2).name.Contains("Bounce") || ((Object)val2).name.Contains("Divider")) { ((Component)val2).gameObject.SetActive(false); } if (((Object)val2).name == "Back") { ((Component)val2).transform.localScale = new Vector3(1f, 3.5f, 1f); } if (((Object)val2).name == "Title Dodge") { ((Object)val2).name = "Title Tag"; } } } Transform val3 = ___columns[2]; ((Object)val3).name = "Column Tag"; foreach (Transform item3 in val3) { Transform val4 = item3; ScoreBoardUIBadge component = ((Component)val4).GetComponent(); if ((Object)(object)component == (Object)null) { continue; } FieldInfo field = typeof(ScoreBoardUIBadge).GetField("score", BindingFlags.Instance | BindingFlags.NonPublic); if (field == null) { continue; } int num = 0; string name = ((Object)val4).name; string text = name; if (text != null) { if (text.Contains("Lech")) { num = ((times.Length != 0) ? times.Max() : 0); } else { string text2 = text; if (text2.Contains("Tall")) { num = ((times.Length != 0) ? Mathf.CeilToInt((float)(times.Max() + times.Min()) / 2f) : 0); } else { string text3 = text; if (text3.Contains("Leader")) { num = ((times.Length != 0) ? Mathf.CeilToInt((float)times.Average()) : 0); } else { string text4 = text; if (text4.Contains("Short")) { num = ((times.Length != 0) ? times[Random.Range(0, times.Length)] : 0); } } } } } field.SetValue(component, num); } PlayerData.instance.fleaGames_dodging_played = true; PlayerData.instance.fleaGames_dodging_highscore = ((times.Length != 0) ? Mathf.CeilToInt((float)times[times.Length - 1]) : 0); ScoreBoardUIBadgeBase[] componentsInChildren = ((Component)val3).GetComponentsInChildren(true); List list = (from b in componentsInChildren orderby b.Score, (b is ScoreBoardUIBadgeHero) ? 1 : 0 select b).ToList(); for (int i = 0; i < list.Count; i++) { ((Component)list[i]).transform.SetSiblingIndex(i); } } } [HarmonyPatch] internal class SethChampConstPatch { private static int[] times; private static MethodBase TargetMethod() { MethodInfo method = typeof(Constants).GetMethod("GetConstantValue"); return method.MakeGenericMethod(typeof(int)); } private static bool Prefix(string variableName, ref int __result) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) Scene activeScene = SceneManager.GetActiveScene(); if (((Scene)(ref activeScene)).name != "Peak_05") { return true; } int[] array = TagTheFleas.times; if (variableName.Contains("FLEA_FESTIVAL_SETH")) { __result = ((array.Length != 0) ? array.Min() : 0); return false; } if (variableName.Contains("FLEA_FESTIVAL_CHAMP")) { if (array.Length == 0) { __result = 0; } else { int key = (from t in array group t by t into g orderby g.Count() descending, g.Key select g).First().Key; __result = key; } return false; } return true; } } [HarmonyPatch(typeof(Language), "Get", new Type[] { typeof(string), typeof(string) })] public static class LanguagePatch { private static readonly Dictionary> CaravanOverrides = new Dictionary> { { "FESTIVAL_BOARD_TITLE_DODGE", () => TagTheFleas.gameName.Value } }; private static readonly Dictionary> TitleOverrides = new Dictionary> { { "SETH_MAIN", () => TagTheFleas.sethName.Value }, { "FLEA_TRACKER_MAIN", () => TagTheFleas.vogName.Value }, { "FLEAMASTER_MAIN", () => TagTheFleas.leaderName.Value }, { "FLEAMEMBER_SHORT_MAIN", () => TagTheFleas.shortName.Value }, { "FLEAMEMBER_TALL_MAIN", () => TagTheFleas.tallName.Value }, { "FLEA_LECH_MAIN", () => TagTheFleas.krattName.Value } }; [HarmonyPostfix] public static void Postfix(string key, string sheetTitle, ref string __result) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) Scene activeScene = SceneManager.GetActiveScene(); if (((Scene)(ref activeScene)).name != "Peak_05") { return; } Func value2; if (!(sheetTitle == "Caravan")) { if (sheetTitle == "Titles" && TitleOverrides.TryGetValue(key, out Func value)) { __result = value(); } } else if (CaravanOverrides.TryGetValue(key, out value2)) { __result = value2(); } } } }