using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using Newtonsoft.Json; using TMPro; using ULTRAKILL.Portal; using ULTRAKILL.Portal.Geometry; using Ultrarogue; using Ultrarogue.Characters; using Ultrarogue.Items; using Ultrarogue.SceneStuff; using Unity.AI.Navigation; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.AddressableAssets.ResourceLocators; using UnityEngine.Events; using UnityEngine.ResourceManagement.AsyncOperations; using UnityEngine.ResourceManagement.ResourceLocations; using UnityEngine.ResourceManagement.ResourceProviders; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: AssemblyCompany("Ultrarogue")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+61e70fc5f36b0587681a9c82cb132806303c81d2")] [assembly: AssemblyProduct("My first plugin")] [assembly: AssemblyTitle("Ultrarogue")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } public class AssetsManager { [CompilerGenerated] private sealed class d__21 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; private AsyncOperationHandle 5__1; private List 5__2; private int 5__3; private IEnumerator <>s__4; private IResourceLocator 5__5; private List 5__6; private AsyncOperationHandle> 5__7; private List.Enumerator <>s__8; private IResourceLocation 5__9; private AsyncOperationHandle 5__10; private SpawnableObject 5__11; private Dictionary>.Enumerator <>s__12; private KeyValuePair> 5__13; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__21(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { case -3: case 2: try { } finally { <>m__Finally1(); } break; case -4: case 3: try { } finally { <>m__Finally2(); } break; } 5__1 = default(AsyncOperationHandle); 5__2 = null; <>s__4 = null; 5__5 = null; 5__6 = null; 5__7 = default(AsyncOperationHandle>); <>s__8 = default(List.Enumerator); 5__9 = null; 5__10 = default(AsyncOperationHandle); 5__11 = null; <>s__12 = default(Dictionary>.Enumerator); 5__13 = default(KeyValuePair>); <>1__state = -2; } private bool MoveNext() { //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_0049: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0124: 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_0142: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_02ad: Invalid comparison between Unknown and I4 //IL_02c8: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_0301: Unknown result type (might be due to invalid IL or missing references) //IL_0330: Unknown result type (might be due to invalid IL or missing references) //IL_02e6: Unknown result type (might be due to invalid IL or missing references) //IL_0243: 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_024f: Unknown result type (might be due to invalid IL or missing references) //IL_03ca: Unknown result type (might be due to invalid IL or missing references) try { switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = Addressables.InitializeAsync(); <>2__current = 5__1; <>1__state = 1; return true; case 1: <>1__state = -1; 5__2 = new List(); <>s__4 = Addressables.ResourceLocators.GetEnumerator(); <>1__state = -3; goto IL_0168; case 2: <>1__state = -3; if ((int)5__7.Status == 1) { 5__2.AddRange(5__7.Result); } Addressables.Release>(5__7); 5__6 = null; 5__7 = default(AsyncOperationHandle>); 5__5 = null; goto IL_0168; case 3: { <>1__state = -4; if ((int)5__10.Status != 1) { break; } 5__11 = 5__10.Result; if ((int)5__11.spawnableObjectType == 1) { if (!enemiesByType.ContainsKey(5__11.enemyType)) { enemiesByType[5__11.enemyType] = new List(); } enemiesByType[5__11.enemyType].Add(5__11); 5__3++; 5__10 = default(AsyncOperationHandle); 5__11 = null; 5__9 = null; } break; } IL_0168: while (<>s__4.MoveNext()) { 5__5 = <>s__4.Current; 5__6 = 5__5.Keys.ToList(); if (5__6.Count == 0) { continue; } 5__7 = Addressables.LoadResourceLocationsAsync((IList)5__6, (MergeMode)1, typeof(SpawnableObject)); <>2__current = 5__7; <>1__state = 2; return true; } <>m__Finally1(); <>s__4 = null; 5__2 = (from l in 5__2 group l by l.InternalId into g select g.First()).ToList(); Plugin.Logger.LogInfo((object)$"Found {5__2.Count} SpawnableObject locations"); 5__3 = 0; <>s__8 = 5__2.GetEnumerator(); <>1__state = -4; break; } if (<>s__8.MoveNext()) { 5__9 = <>s__8.Current; 5__10 = Addressables.LoadAssetAsync(5__9); <>2__current = 5__10; <>1__state = 3; return true; } <>m__Finally2(); <>s__8 = default(List.Enumerator); Plugin.Logger.LogInfo((object)$"Loaded {5__3} enemy SpawnableObjects across {enemiesByType.Count} type(s)."); <>s__12 = enemiesByType.GetEnumerator(); try { while (<>s__12.MoveNext()) { 5__13 = <>s__12.Current; Plugin.Logger.LogInfo((object)$" {5__13.Key}: {5__13.Value.Count} variant(s)"); 5__13 = default(KeyValuePair>); } } finally { ((IDisposable)<>s__12).Dispose(); } <>s__12 = default(Dictionary>.Enumerator); OnLoadComplete(); return false; } catch { //try-fault ((IDisposable)this).Dispose(); throw; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } private void <>m__Finally1() { <>1__state = -1; if (<>s__4 != null) { <>s__4.Dispose(); } } private void <>m__Finally2() { <>1__state = -1; ((IDisposable)<>s__8).Dispose(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__20 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; private AsyncOperationHandle 5__1; private List 5__2; private IEnumerator <>s__3; private IResourceLocator 5__4; private List 5__5; private AsyncOperationHandle> 5__6; private List.Enumerator <>s__7; private IResourceLocation 5__8; private AsyncOperationHandle 5__9; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__20(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { case -3: case 2: try { } finally { <>m__Finally1(); } break; case -4: case 3: try { } finally { <>m__Finally2(); } break; } 5__1 = default(AsyncOperationHandle); 5__2 = null; <>s__3 = null; 5__4 = null; 5__5 = null; 5__6 = default(AsyncOperationHandle>); <>s__7 = default(List.Enumerator); 5__8 = null; 5__9 = default(AsyncOperationHandle); <>1__state = -2; } private bool MoveNext() { //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_0049: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Invalid comparison between Unknown and I4 //IL_0270: Unknown result type (might be due to invalid IL or missing references) //IL_0276: Invalid comparison between Unknown and I4 //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_015b: 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_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) try { switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = Addressables.InitializeAsync(); <>2__current = 5__1; <>1__state = 1; return true; case 1: <>1__state = -1; 5__2 = new List(); <>s__3 = Addressables.ResourceLocators.GetEnumerator(); <>1__state = -3; goto IL_0168; case 2: <>1__state = -3; if ((int)5__6.Status == 1) { 5__2.AddRange(5__6.Result); } Addressables.Release>(5__6); 5__5 = null; 5__6 = default(AsyncOperationHandle>); 5__4 = null; goto IL_0168; case 3: { <>1__state = -4; if ((int)5__9.Status == 1) { descriptors.Add(5__9.Result); } 5__9 = default(AsyncOperationHandle); 5__8 = null; break; } IL_0168: while (<>s__3.MoveNext()) { 5__4 = <>s__3.Current; 5__5 = 5__4.Keys.ToList(); if (5__5.Count == 0) { continue; } 5__6 = Addressables.LoadResourceLocationsAsync((IList)5__5, (MergeMode)1, typeof(WeaponDescriptor)); <>2__current = 5__6; <>1__state = 2; return true; } <>m__Finally1(); <>s__3 = null; 5__2 = (from l in 5__2 group l by l.InternalId into g select g.First()).ToList(); Plugin.Logger.LogInfo((object)$"Found {5__2.Count} WeaponDescriptor locations"); <>s__7 = 5__2.GetEnumerator(); <>1__state = -4; break; } if (<>s__7.MoveNext()) { 5__8 = <>s__7.Current; 5__9 = Addressables.LoadAssetAsync(5__8); <>2__current = 5__9; <>1__state = 3; return true; } <>m__Finally2(); <>s__7 = default(List.Enumerator); OnLoadComplete(); return false; } catch { //try-fault ((IDisposable)this).Dispose(); throw; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } private void <>m__Finally1() { <>1__state = -1; if (<>s__3 != null) { <>s__3.Dispose(); } } private void <>m__Finally2() { <>1__state = -1; ((IDisposable)<>s__7).Dispose(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static List descriptors = new List(); public static Material weaponMat; public static GameObject Agony; public static GameObject Tundra; public static Dictionary> enemiesByType = new Dictionary>(); private static int _loadsDone = 0; private const int TotalLoads = 2; public static GameObject napalmProj; public static GameObject mindflayerBeam; public static GameObject funnyPowerIntroSpawn; public static AudioClip StalkerWarning; public static Sprite ArmFeedbacker; public static Sprite ArmKnuckleBlaster; public static Sprite ArmWhiplash; public static bool IsReady { get; private set; } = false; public static void Init() { //IL_0035: 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_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0081: 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_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012d: 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) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) ((MonoBehaviour)Plugin.Instance).StartCoroutine(GetAllSpawnables()); ((MonoBehaviour)Plugin.Instance).StartCoroutine(GetAllEnemies()); if ((Object)(object)napalmProj == (Object)null) { napalmProj = Addressables.LoadAssetAsync((object)"Assets/Prefabs/Attacks and Projectiles/GasolineProjectile.prefab").WaitForCompletion(); } if ((Object)(object)Agony == (Object)null) { Agony = Addressables.LoadAssetAsync((object)"Assets/Prefabs/Enemies/SwordsMachine Agony.prefab").WaitForCompletion(); } if ((Object)(object)funnyPowerIntroSpawn == (Object)null) { funnyPowerIntroSpawn = Addressables.LoadAssetAsync((object)"Assets/Data/Cyber Grind Patterns/Data/PowerEndlessData.asset").WaitForCompletion().prefab; } if ((Object)(object)Tundra == (Object)null) { Tundra = Addressables.LoadAssetAsync((object)"Assets/Prefabs/Enemies/SwordsMachine Tundra.prefab").WaitForCompletion(); } if ((Object)(object)mindflayerBeam == (Object)null) { mindflayerBeam = Addressables.LoadAssetAsync((object)"Assets/Prefabs/Attacks and Projectiles/Hitscan Beams/Mindflayer Beam.prefab").WaitForCompletion(); } if ((Object)(object)StalkerWarning == (Object)null) { StalkerWarning = Addressables.LoadAssetAsync((object)"Assets/Sounds/Enemies/StalkerWarning.wav").WaitForCompletion(); } if ((Object)(object)ArmFeedbacker == (Object)null) { ArmFeedbacker = Addressables.LoadAssetAsync((object)"Assets/Textures/UI/ArmFeedbacker.png").WaitForCompletion(); } if ((Object)(object)ArmKnuckleBlaster == (Object)null) { ArmKnuckleBlaster = Addressables.LoadAssetAsync((object)"Assets/Textures/UI/ArmKnuckleblaster.png").WaitForCompletion(); } if ((Object)(object)ArmWhiplash == (Object)null) { ArmWhiplash = Addressables.LoadAssetAsync((object)"Assets/Textures/UI/ArmWhiplash.png").WaitForCompletion(); } } private static void OnLoadComplete() { _loadsDone++; if (_loadsDone >= 2) { IsReady = true; Plugin.Logger.LogInfo((object)($"AssetsManager ready — {descriptors.Count} weapon descriptors, " + $"{enemiesByType.Values.Sum((List l) => l.Count)} enemies across " + $"{enemiesByType.Count} type(s) loaded.")); } } [IteratorStateMachine(typeof(d__20))] private static IEnumerator GetAllSpawnables() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__20(0); } [IteratorStateMachine(typeof(d__21))] private static IEnumerator GetAllEnemies() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__21(0); } public static Sprite prefToDescriptor(string pref, bool alternate) { if (!IsReady) { Plugin.Logger.LogWarning((object)("prefToDescriptor called before assets finished loading! pref=" + pref)); return null; } char c = pref.Last(); if (pref.Contains("rev")) { IEnumerable source = descriptors.Where((WeaponDescriptor x) => x.weaponName.StartsWith((!alternate) ? "Revolver" : "Alternative Revolver")); switch (c) { case '0': return source.FirstOrDefault((Func)((WeaponDescriptor x) => x.weaponName.EndsWith("Pierce"))).icon; case '1': return source.FirstOrDefault((Func)((WeaponDescriptor x) => x.weaponName.EndsWith("Twirl"))).icon; case '2': return source.FirstOrDefault((Func)((WeaponDescriptor x) => x.weaponName.EndsWith("Ricochet"))).icon; } } else if (pref.Contains("sho")) { IEnumerable source = descriptors.Where((WeaponDescriptor x) => x.weaponName.StartsWith((!alternate) ? "Shotgun" : "Hammer")); switch (c) { case '0': return source.FirstOrDefault((Func)((WeaponDescriptor x) => x.weaponName.EndsWith("Grenade"))).icon; case '1': return source.FirstOrDefault((Func)((WeaponDescriptor x) => x.weaponName.EndsWith("Pump"))).icon; case '2': return source.FirstOrDefault((Func)((WeaponDescriptor x) => x.weaponName.EndsWith("Saw"))).icon; } } else if (pref.Contains("nai")) { IEnumerable source = descriptors.Where((WeaponDescriptor x) => x.weaponName.StartsWith((!alternate) ? "Nailgun" : "Sawblade Launcher")); switch (c) { case '0': return source.FirstOrDefault((Func)((WeaponDescriptor x) => x.weaponName.EndsWith("Magnet"))).icon; case '1': return source.FirstOrDefault((Func)((WeaponDescriptor x) => x.weaponName.EndsWith("Overheat"))).icon; case '2': return source.FirstOrDefault((Func)((WeaponDescriptor x) => x.weaponName.EndsWith("Jumpstart"))).icon; } } else if (pref.Contains("rai")) { IEnumerable source = descriptors.Where((WeaponDescriptor x) => x.weaponName.StartsWith("Railcannon")); switch (c) { case '0': return source.FirstOrDefault((Func)((WeaponDescriptor x) => x.weaponName.EndsWith("Electric"))).icon; case '1': return source.FirstOrDefault((Func)((WeaponDescriptor x) => x.weaponName.EndsWith("Harpoon"))).icon; case '2': return source.FirstOrDefault((Func)((WeaponDescriptor x) => x.weaponName.EndsWith("Malicious"))).icon; } } else if (pref.Contains("rock")) { IEnumerable source = descriptors.Where((WeaponDescriptor x) => x.weaponName.StartsWith("Rocket Launcher")); switch (c) { case '0': return source.FirstOrDefault((Func)((WeaponDescriptor x) => x.weaponName.EndsWith("Freeze"))).icon; case '1': return source.FirstOrDefault((Func)((WeaponDescriptor x) => x.weaponName.EndsWith("Cannonball"))).icon; case '2': return source.FirstOrDefault((Func)((WeaponDescriptor x) => x.weaponName.EndsWith("Napalm"))).icon; } } else if (pref.Contains("arm")) { switch (c) { case '0': return ArmFeedbacker; case '1': return ArmKnuckleBlaster; case '2': return ArmWhiplash; } } Plugin.Logger.LogWarning((object)("prefToDescriptor: no match for pref='" + pref + "'")); return descriptors.Find((WeaponDescriptor x) => x.weaponName == "UNKNOWN").icon; } public static List GetEnemiesOfType(EnemyType type) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) if (!IsReady) { Plugin.Logger.LogWarning((object)"GetEnemiesOfType called before assets finished loading!"); return null; } List value; return enemiesByType.TryGetValue(type, out value) ? value : new List(); } } public class Missle : MonoBehaviour { [CompilerGenerated] private sealed class d__12 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Missle <>4__this; 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() { <>1__state = -2; } private bool MoveNext() { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(<>4__this.homingDelay); <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.homingActive = 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 EnemyIdentifier enemyThatGotHit; private EnemyIdentifier target; public float speed = 25f; public float upwardForce = 15f; public float homingDelay = 0.5f; public float turnSpeed = 5f; public float damage = 10f; public float explosionRadius = 0.1f; private bool homingActive = false; private Rigidbody rb; private bool kaboomed = false; private void Start() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) rb = ((Component)this).GetComponent(); rb.velocity = Vector3.up * upwardForce; target = enemyThatGotHit; ((MonoBehaviour)this).StartCoroutine(ActivateHoming()); } [IteratorStateMachine(typeof(d__12))] private IEnumerator ActivateHoming() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__12(0) { <>4__this = this }; } private void FixedUpdate() { //IL_00ac: 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_00b1: 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_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) if (!homingActive) { return; } if ((Object)(object)target == (Object)null || target.dead) { List currentEnemies = MonoSingleton.Instance.GetCurrentEnemies(); if (currentEnemies.Count <= 0) { return; } target = currentEnemies[Random.Range(0, currentEnemies.Count)]; } Vector3 val = (((Object)(object)target.weakPoint == (Object)null) ? ((Component)target).transform.position : target.weakPoint.transform.position); Vector3 val2 = val - ((Component)this).transform.position; Vector3 normalized = ((Vector3)(ref val2)).normalized; Vector3 velocity = Vector3.Lerp(rb.velocity, normalized * speed, turnSpeed * Time.fixedDeltaTime); rb.velocity = velocity; Transform transform = ((Component)this).transform; val2 = rb.velocity; transform.forward = ((Vector3)(ref val2)).normalized; } private void OnTriggerEnter(Collider col) { //IL_00b8: 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) if (!Object.op_Implicit((Object)(object)((Component)col).gameObject.GetComponent()) && LayerMaskDefaults.IsMatchingLayer(((Component)col).gameObject.layer, (LMD)3) && !kaboomed) { kaboomed = true; Plugin.Logger.LogInfo((object)("I hit " + ((Object)((Component)col).gameObject).name)); EnemyIdentifierIdentifier component = ((Component)col).gameObject.GetComponent(); EnemyIdentifier val = (((Object)(object)component == (Object)null) ? ((Component)col).gameObject.GetComponent() : component.eid); if ((Object)(object)val != (Object)null) { val.hitter = "missle"; val.DeliverDamage(((Component)col).gameObject, Vector3.zero, ((Component)component).transform.position, damage, false, 0f, (GameObject)null, false, false); } Explode(); } } private void Explode() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) GameObject val = Object.Instantiate(MonoSingleton.Instance.explosion, ((Component)this).transform.position, Quaternion.identity); Explosion[] componentsInChildren = val.GetComponentsInChildren(); foreach (Explosion val2 in componentsInChildren) { val2.maxSize = explosionRadius; val2.canHit = (AffectedSubjects)2; val2.damage = Mathf.RoundToInt(damage) * 2; } Object.Destroy((Object)(object)((Component)this).gameObject); } } public class ExecuteOnSceneLoadRogue : MonoBehaviour { [Tooltip("Lower value ExecuteOnSceneLoad are executed first")] public int relativeExecutionOrder = 0; public UnityEvent onSceneLoad; public void Execute() { if (onSceneLoad != null) { onSceneLoad.Invoke(); } } } [Serializable] public class LayerInfoRogue { public string layerName = ""; public string[] layerLevels = new string[0]; } public class FirstRoomSpawnerRogue : MonoBehaviour, ISerializationCallbackReceiver { [HideInInspector] internal class PlayerForcedMovement : MonoBehaviour { public NewMovement player; private Rigidbody rb; public static float defaultMoveForce = 67f; public float force = defaultMoveForce; public void Awake() { if ((Object)(object)player == (Object)null) { player = MonoSingleton.Instance; } rb = ((Component)player).GetComponent(); rb.useGravity = false; } public void LateUpdate() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) rb.velocity = new Vector3(0f, force, 0f); } public void DestroyComp() { rb.useGravity = true; Object.Destroy((Object)(object)this); } } [HideInInspector] private class LocalMoveTowards : MonoBehaviour { public Vector3 targetLocalPosition; public bool active = false; public float speed = 10f; public void Update() { //IL_001c: 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_0033: 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_004a: Unknown result type (might be due to invalid IL or missing references) if (active) { ((Component)this).transform.localPosition = Vector3.MoveTowards(((Component)this).transform.localPosition, targetLocalPosition, Time.deltaTime * speed); if (((Component)this).transform.localPosition == targetLocalPosition) { Object.Destroy((Object)(object)this); } } } public void Activate() { active = true; } } [HideInInspector] private class CustomHellmapCursor : MonoBehaviour { public Vector2 targetPosition; public Image targetImage; public AudioSource aud; private bool white = true; private RectTransform rect; private void Start() { rect = ((Component)this).GetComponent(); ((MonoBehaviour)this).Invoke("FlashImage", 0.075f); } private void Update() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_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_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) rect.anchoredPosition = Vector2.MoveTowards(rect.anchoredPosition, targetPosition, Time.deltaTime * 4f * Vector3.Distance(Vector2.op_Implicit(rect.anchoredPosition), Vector2.op_Implicit(targetPosition))); } private void FlashImage() { //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) if (white) { white = false; ((Graphic)targetImage).color = new Color(0f, 0f, 0f, 0f); if (!((Component)this).gameObject.activeSelf) { return; } aud.Play(); } else { white = true; ((Graphic)targetImage).color = Color.white; } if (((Component)this).gameObject.activeInHierarchy) { ((MonoBehaviour)this).Invoke("FlashImage", 0.075f); } } } [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static UnityAction <>9__36_5; public static Func <>9__37_1; public static Func <>9__37_2; public static Func <>9__37_4; internal void b__36_5() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) MonoSingleton.Instance.spawnPos = ((Component)MonoSingleton.Instance).transform.position; } internal Transform b__37_1(GameObject go) { return go.transform; } internal OnLevelStart b__37_2(GameObject go) { return go.GetComponent(); } internal bool b__37_4(GameObject o) { return ((Object)o).name == "Canvas"; } } [Tooltip("Player will be moved to this position if the room is not ascending variant. If null, default position is used")] public Transform playerSpawnPos; [Tooltip("If set to true, room will not be deleted. Else, it will be replaced in game")] public bool doNotReplace = false; [Header("Replace Settings")] [Tooltip("Enabling this field causes room to be spawned as the secret variant")] public bool secretRoom = false; [Tooltip("Enabling this field causes room to be spawned as the prime variant")] public bool primeRoom = false; [Tooltip("Enabling this field causes room to be spawned as the encore variant")] public bool encoreRoom = false; [HideInInspector] [Tooltip("Enabling this field causes the whole room to be converted into the ascending variant where the player is spawned at the bottom and ascends upwards instead of falling")] public bool convertToUpwardRoom = false; [HideInInspector] [Tooltip("This clip will be played when the trap door closes beneath the player for ascending rooms")] public AudioClip upwardRoomDoorCloseClip; [HideInInspector] [Tooltip("If bottom part of the ascending room collides with out of bounds triggers, this list can temporarely disable them while the player is ascending")] public List upwardRoomOutOfBoundsToDisable; [Header("Player Fields")] [Space(10f)] public CameraClearFlags cameraFillMode = (CameraClearFlags)2; public Color backgroundColor = Color.black; [Header("Level Fields")] [Space(10f)] [Tooltip("If set to true, level title will be displayed when the door is opened")] public bool displayLevelTitle = true; [Tooltip("If set to true, music will start when the door is opened")] public bool startMusic = true; [Header("Hellmap")] [Tooltip("Enable the layer and level map when the player spawn")] [Space(10f)] public bool enableHellMap = false; [Tooltip("Sound clip which is played for each beep while falling")] public AudioClip hellmapBeepClip; [Tooltip("Each layer has a layer name and number of levels. For limbo the header is LIMBO and levels are [1-1, 1-2, 1-3, 1-4]")] public List layersAndLevels = new List(); [HideInInspector] public List levelSizes = new List(); [HideInInspector] public List layerNames = new List(); [HideInInspector] public List levelNames = new List(); [Tooltip("Which layer the cursor starts from. First layer is 0 and at the top")] public int layerIndexToStartFrom; [Tooltip("Which level in the layer the cursor starts from. The first level is 0 and is just below the layer title (the uppermost level)")] public int levelIndexToStartFrom; [Tooltip("Which layer the cursor ends at. First layer is 0 and at the top")] public int layerIndexToEndAt; [Tooltip("Which level in the layer the cursor ends at. The first level is 0 and is just below the layer title (the uppermost level)")] public int levelIndexToEndAt; private bool spawned = false; public static float upDisablePos = 60f; public static float doorClosePos = 10f; public static float doorCloseSpeed = 10f; public static float actDelay = 0.5f; public static float ascendingPlayerSpawnPos = -55f; public void OnBeforeSerialize() { levelSizes.Clear(); layerNames.Clear(); levelNames.Clear(); for (int i = 0; i < layersAndLevels.Count; i++) { layerNames.Add(layersAndLevels[i].layerName); levelSizes.Add(layersAndLevels[i].layerLevels.Length); levelNames.AddRange(layersAndLevels[i].layerLevels); } } public void Deserialize() { layersAndLevels.Clear(); int num = 0; for (int i = 0; i < levelSizes.Count; i++) { LayerInfoRogue layerInfoRogue = new LayerInfoRogue(); layerInfoRogue.layerName = layerNames[i]; int num2 = levelSizes[i]; layerInfoRogue.layerLevels = new string[num2]; for (int j = 0; j < num2; j++) { layerInfoRogue.layerLevels[j] = levelNames[num++]; } layersAndLevels.Add(layerInfoRogue); } } public void OnAfterDeserialize() { } private static Text MakeText(Transform parent) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_001c: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(); RectTransform val2 = val.AddComponent(); ((Transform)val2).SetParent(parent); val.transform.localScale = Vector3.one; return val.AddComponent(); } private static RectTransform MakeRect(Transform parent) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown GameObject val = new GameObject(); RectTransform val2 = val.AddComponent(); ((Transform)val2).SetParent(parent); return val2; } public static void ConvertToAscendingFirstRoom(GameObject firstRoom, AudioClip doorCloseAud, List toEnable, List toDisable, bool doNotReplace) { //IL_02be: Unknown result type (might be due to invalid IL or missing references) //IL_02ef: Unknown result type (might be due to invalid IL or missing references) //IL_02f4: Unknown result type (might be due to invalid IL or missing references) //IL_0379: 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_0399: Unknown result type (might be due to invalid IL or missing references) //IL_03b6: Unknown result type (might be due to invalid IL or missing references) //IL_03bd: Expected O, but got Unknown //IL_03f0: Unknown result type (might be due to invalid IL or missing references) //IL_0402: Unknown result type (might be due to invalid IL or missing references) //IL_0423: Unknown result type (might be due to invalid IL or missing references) //IL_0473: Unknown result type (might be due to invalid IL or missing references) //IL_047d: Expected O, but got Unknown //IL_0484: Unknown result type (might be due to invalid IL or missing references) //IL_048e: Expected O, but got Unknown //IL_04a1: Unknown result type (might be due to invalid IL or missing references) //IL_04ab: Expected O, but got Unknown //IL_04ac: Unknown result type (might be due to invalid IL or missing references) //IL_04b3: Expected O, but got Unknown //IL_04e6: Unknown result type (might be due to invalid IL or missing references) //IL_04f8: Unknown result type (might be due to invalid IL or missing references) //IL_0519: Unknown result type (might be due to invalid IL or missing references) //IL_0569: Unknown result type (might be due to invalid IL or missing references) //IL_0573: Expected O, but got Unknown //IL_057a: Unknown result type (might be due to invalid IL or missing references) //IL_0584: Expected O, but got Unknown //IL_0597: Unknown result type (might be due to invalid IL or missing references) //IL_05a1: Expected O, but got Unknown //IL_05b5: Unknown result type (might be due to invalid IL or missing references) //IL_05bf: Expected O, but got Unknown //IL_05d3: Unknown result type (might be due to invalid IL or missing references) //IL_05dd: Expected O, but got Unknown //IL_05f9: Unknown result type (might be due to invalid IL or missing references) //IL_0603: Expected O, but got Unknown //IL_060a: Unknown result type (might be due to invalid IL or missing references) //IL_0614: Expected O, but got Unknown //IL_0627: Unknown result type (might be due to invalid IL or missing references) //IL_0631: Expected O, but got Unknown //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: 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_020b: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_028d: Unknown result type (might be due to invalid IL or missing references) //IL_0652: Unknown result type (might be due to invalid IL or missing references) //IL_0657: Unknown result type (might be due to invalid IL or missing references) //IL_065d: Expected O, but got Unknown List toEnable2 = toEnable; List toDisable2 = toDisable; Transform val = firstRoom.transform.Find("Room"); if (!doNotReplace) { Transform val2 = val.Find("Pit (3)"); ((Component)val2).transform.localPosition = new Vector3(0f, 2f, 41.72f); ((Component)val2).transform.localRotation = Quaternion.Euler(0f, 0f, 180f); Object.Destroy((Object)(object)((Component)((Component)val).transform.Find("Room/Ceiling")).gameObject); Transform val3 = ((Component)val).transform.Find("Room/Floor"); GameObject gameObject = ((Component)val3.GetChild(0)).gameObject; GameObject val4 = Object.Instantiate(gameObject, val3); val4.transform.localPosition = new Vector3(-15f, 9.7f, 20.28f); val4.transform.localRotation = Quaternion.identity; GameObject val5 = Object.Instantiate(gameObject, val3); val5.transform.localPosition = new Vector3(5f, 9.7f, 20.28f); val5.transform.localRotation = Quaternion.identity; GameObject val6 = Object.Instantiate(gameObject, val3); val6.transform.localPosition = new Vector3(-5f, 9.7f, 0.2f); val6.transform.localRotation = Quaternion.Euler(0f, -90f, 0f); GameObject val7 = Object.Instantiate(gameObject, val3); val7.transform.localPosition = new Vector3(5f, 9.7f, 10.28f); val7.transform.localRotation = Quaternion.identity; ((Renderer)val7.GetComponent()).materials = (Material[])(object)new Material[2] { UtilsRogue.metalDec20, UtilsRogue.metalDec20 }; GameObject val8 = Object.Instantiate(gameObject, val3); val8.transform.localPosition = new Vector3(-15f, 9.7f, 10.28f); val8.transform.localRotation = Quaternion.identity; ((Renderer)val8.GetComponent()).materials = (Material[])(object)new Material[2] { UtilsRogue.metalDec20, UtilsRogue.metalDec20 }; GameObject val9 = Object.Instantiate(gameObject, val3); val9.transform.localPosition = new Vector3(-5f, -0.3f, 20.28f); val9.transform.localRotation = Quaternion.Euler(0f, -90f, -180f); } Transform val10 = val.Find("Decorations"); Transform child = val10.GetChild(12); child.localPosition = new Vector3(-5f, 2f, 52f); LocalMoveTowards floorMover = ((Component)child).gameObject.AddComponent(); floorMover.targetLocalPosition = new Vector3(-5f, 2f, 42f); floorMover.speed = doorCloseSpeed; AudioSource floorTileAud = ((Component)child).gameObject.AddComponent(); floorTileAud.playOnAwake = false; floorTileAud.loop = false; floorTileAud.clip = doorCloseAud; PlayerActivator act = firstRoom.GetComponentsInChildren().First(); ((Component)act).gameObject.SetActive(false); NewMovement instance = MonoSingleton.Instance; ((Component)instance).transform.localPosition = new Vector3(((Component)instance).transform.localPosition.x, ascendingPlayerSpawnPos, ((Component)instance).transform.localPosition.z); PlayerForcedMovement focedMov = ((Component)instance).gameObject.AddComponent(); GameObject val11 = new GameObject(); val11.transform.SetParent(((Component)act).transform.parent); val11.transform.localPosition = new Vector3(0f, upDisablePos, 0f); val11.transform.localRotation = Quaternion.identity; val11.transform.localScale = new Vector3(80f, 0.2f, 80f); val11.layer = ((Component)act).gameObject.layer; BoxCollider val12 = val11.AddComponent(); ((Collider)val12).isTrigger = true; ObjectActivator val13 = val11.AddComponent(); val13.dontActivateOnEnable = true; val13.oneTime = true; val13.events = new UltrakillEvent(); val13.events.onActivate = new UnityEvent(); val13.events.onActivate.AddListener((UnityAction)delegate { focedMov.DestroyComp(); }); GameObject val14 = new GameObject(); val14.transform.SetParent(((Component)act).transform.parent); val14.transform.localPosition = new Vector3(0f, doorClosePos, 0f); val14.transform.localRotation = Quaternion.identity; val14.transform.localScale = new Vector3(80f, 0.2f, 80f); val14.layer = ((Component)act).gameObject.layer; BoxCollider val15 = val14.AddComponent(); ((Collider)val15).isTrigger = true; ObjectActivator val16 = val14.AddComponent(); val16.dontActivateOnEnable = true; val16.oneTime = true; val16.events = new UltrakillEvent(); val16.events.onActivate = new UnityEvent(); val16.events.onActivate.AddListener((UnityAction)delegate { floorMover.Activate(); }); val16.events.onActivate.AddListener((UnityAction)delegate { floorTileAud.Play(); }); val16.events.onActivate.AddListener((UnityAction)delegate { foreach (GameObject item in toEnable2) { item.SetActive(true); } foreach (GameObject item2 in toDisable2) { item2.SetActive(false); } }); ObjectActivator val17 = val14.AddComponent(); val17.dontActivateOnEnable = true; val17.oneTime = true; val17.events = new UltrakillEvent(); val17.events.onActivate = new UnityEvent(); val17.events.onActivate.AddListener((UnityAction)delegate { ((Component)act).gameObject.SetActive(true); }); UnityEvent onActivate = val17.events.onActivate; object obj = <>c.<>9__36_5; if (obj == null) { UnityAction val18 = delegate { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) MonoSingleton.Instance.spawnPos = ((Component)MonoSingleton.Instance).transform.position; }; <>c.<>9__36_5 = val18; obj = (object)val18; } onActivate.AddListener((UnityAction)obj); val17.delay = actDelay; } public void Spawn() { //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: 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_023b: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0318: Unknown result type (might be due to invalid IL or missing references) //IL_032f: Unknown result type (might be due to invalid IL or missing references) //IL_0353: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_035c: Unknown result type (might be due to invalid IL or missing references) //IL_036b: Unknown result type (might be due to invalid IL or missing references) //IL_03ea: Unknown result type (might be due to invalid IL or missing references) //IL_03ef: Unknown result type (might be due to invalid IL or missing references) //IL_03b3: 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_041a: Unknown result type (might be due to invalid IL or missing references) //IL_0428: Unknown result type (might be due to invalid IL or missing references) //IL_0486: Unknown result type (might be due to invalid IL or missing references) //IL_048b: Unknown result type (might be due to invalid IL or missing references) //IL_050b: Unknown result type (might be due to invalid IL or missing references) //IL_0510: Unknown result type (might be due to invalid IL or missing references) //IL_0511: Unknown result type (might be due to invalid IL or missing references) //IL_0519: Unknown result type (might be due to invalid IL or missing references) //IL_052d: Unknown result type (might be due to invalid IL or missing references) //IL_0544: Unknown result type (might be due to invalid IL or missing references) //IL_0551: Unknown result type (might be due to invalid IL or missing references) //IL_055e: Unknown result type (might be due to invalid IL or missing references) //IL_0568: Unknown result type (might be due to invalid IL or missing references) //IL_0598: Unknown result type (might be due to invalid IL or missing references) //IL_05a5: Unknown result type (might be due to invalid IL or missing references) //IL_05bc: Unknown result type (might be due to invalid IL or missing references) //IL_05c9: Unknown result type (might be due to invalid IL or missing references) //IL_05d6: Unknown result type (might be due to invalid IL or missing references) //IL_05e3: Unknown result type (might be due to invalid IL or missing references) //IL_0630: Unknown result type (might be due to invalid IL or missing references) //IL_0635: Unknown result type (might be due to invalid IL or missing references) //IL_0636: Unknown result type (might be due to invalid IL or missing references) //IL_063e: Unknown result type (might be due to invalid IL or missing references) //IL_0652: Unknown result type (might be due to invalid IL or missing references) //IL_0669: Unknown result type (might be due to invalid IL or missing references) //IL_0676: Unknown result type (might be due to invalid IL or missing references) //IL_069a: Unknown result type (might be due to invalid IL or missing references) //IL_06e9: Unknown result type (might be due to invalid IL or missing references) //IL_06ff: Unknown result type (might be due to invalid IL or missing references) //IL_070c: Unknown result type (might be due to invalid IL or missing references) //IL_0719: Unknown result type (might be due to invalid IL or missing references) //IL_0730: Unknown result type (might be due to invalid IL or missing references) //IL_073d: Unknown result type (might be due to invalid IL or missing references) //IL_074a: Unknown result type (might be due to invalid IL or missing references) //IL_0df9: Unknown result type (might be due to invalid IL or missing references) //IL_0dfe: Unknown result type (might be due to invalid IL or missing references) //IL_0e15: Unknown result type (might be due to invalid IL or missing references) //IL_0b37: Unknown result type (might be due to invalid IL or missing references) //IL_0b3c: Unknown result type (might be due to invalid IL or missing references) //IL_0b45: Unknown result type (might be due to invalid IL or missing references) //IL_0b75: Unknown result type (might be due to invalid IL or missing references) //IL_0b7a: Unknown result type (might be due to invalid IL or missing references) //IL_0b83: Unknown result type (might be due to invalid IL or missing references) //IL_0bac: Unknown result type (might be due to invalid IL or missing references) //IL_0bb1: Unknown result type (might be due to invalid IL or missing references) //IL_0bb2: Unknown result type (might be due to invalid IL or missing references) //IL_0bba: Unknown result type (might be due to invalid IL or missing references) //IL_0bce: Unknown result type (might be due to invalid IL or missing references) //IL_0be5: Unknown result type (might be due to invalid IL or missing references) //IL_0c01: Unknown result type (might be due to invalid IL or missing references) //IL_0c0e: Unknown result type (might be due to invalid IL or missing references) //IL_0c1b: Unknown result type (might be due to invalid IL or missing references) //IL_0c89: Unknown result type (might be due to invalid IL or missing references) //IL_0c8b: Unknown result type (might be due to invalid IL or missing references) //IL_0ccb: Unknown result type (might be due to invalid IL or missing references) //IL_0cd5: Expected O, but got Unknown //IL_0786: Unknown result type (might be due to invalid IL or missing references) //IL_078b: Unknown result type (might be due to invalid IL or missing references) //IL_078c: Unknown result type (might be due to invalid IL or missing references) //IL_0794: Unknown result type (might be due to invalid IL or missing references) //IL_07a8: Unknown result type (might be due to invalid IL or missing references) //IL_07b5: Unknown result type (might be due to invalid IL or missing references) //IL_07c9: Unknown result type (might be due to invalid IL or missing references) //IL_07e0: Unknown result type (might be due to invalid IL or missing references) //IL_0811: Unknown result type (might be due to invalid IL or missing references) //IL_0816: Unknown result type (might be due to invalid IL or missing references) //IL_0817: Unknown result type (might be due to invalid IL or missing references) //IL_081f: Unknown result type (might be due to invalid IL or missing references) //IL_0833: Unknown result type (might be due to invalid IL or missing references) //IL_0840: Unknown result type (might be due to invalid IL or missing references) //IL_085c: Unknown result type (might be due to invalid IL or missing references) //IL_08d2: Unknown result type (might be due to invalid IL or missing references) //IL_08ed: Unknown result type (might be due to invalid IL or missing references) //IL_08fa: Unknown result type (might be due to invalid IL or missing references) //IL_0911: Unknown result type (might be due to invalid IL or missing references) //IL_091e: Unknown result type (might be due to invalid IL or missing references) //IL_0935: Unknown result type (might be due to invalid IL or missing references) //IL_0942: Unknown result type (might be due to invalid IL or missing references) //IL_098c: Unknown result type (might be due to invalid IL or missing references) //IL_0991: Unknown result type (might be due to invalid IL or missing references) //IL_0992: Unknown result type (might be due to invalid IL or missing references) //IL_099a: Unknown result type (might be due to invalid IL or missing references) //IL_09ae: Unknown result type (might be due to invalid IL or missing references) //IL_09c8: Unknown result type (might be due to invalid IL or missing references) //IL_09f0: Unknown result type (might be due to invalid IL or missing references) //IL_09fd: Unknown result type (might be due to invalid IL or missing references) //IL_0a35: Unknown result type (might be due to invalid IL or missing references) //IL_0a3a: Unknown result type (might be due to invalid IL or missing references) //IL_0a3b: Unknown result type (might be due to invalid IL or missing references) //IL_0a43: 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_0a6e: Unknown result type (might be due to invalid IL or missing references) //IL_0a89: Unknown result type (might be due to invalid IL or missing references) //IL_0a96: Unknown result type (might be due to invalid IL or missing references) //IL_1025: Unknown result type (might be due to invalid IL or missing references) //IL_112a: Unknown result type (might be due to invalid IL or missing references) if (spawned) { return; } GameObject onLevelStartObj = null; bool flag = (Object)(object)MonoSingleton.Instance != (Object)null; if (!flag) { Transform val = ((Component)this).gameObject.transform.Find("OnLevelStart"); if ((Object)(object)val != (Object)null) { flag = (Object)(object)((Component)val).GetComponent() != (Object)null; onLevelStartObj = ((Component)val).gameObject; } } else { onLevelStartObj = ((Component)MonoSingleton.Instance).gameObject; } GameObject val2 = ((Component)this).gameObject; GameObject val3 = Addressables.LoadAssetAsync((object)(secretRoom ? "FirstRoom Secret" : (primeRoom ? "FirstRoom Prime" : (encoreRoom ? "Assets/Prefabs/Levels/Special Rooms/FirstRoom Encore.prefab" : "FirstRoom")))).WaitForCompletion(); Scene activeScene; if (!doNotReplace) { val2 = Object.Instantiate(val3, ((Component)this).transform.parent); if (flag) { Transform? obj = val2.transform.Find("OnLevelStart"); if (obj == null) { activeScene = SceneManager.GetActiveScene(); obj = (from go in ((Scene)(ref activeScene)).GetRootGameObjects() where ((Object)go).name == "OnLevelStart" && (Object)(object)go.transform != (Object)(object)onLevelStartObj select go.transform).FirstOrDefault(); } Transform val4 = obj; if ((Object)(object)val4 != (Object)null) { Object.Destroy((Object)(object)((Component)val4).gameObject); } if ((Object)(object)onLevelStartObj != (Object)null) { onLevelStartObj.transform.SetParent(val2.transform); } } } else { GameObject val5 = Object.Instantiate(val3, ((Component)this).transform.position, ((Component)this).transform.rotation, ((Component)this).transform.parent); Object.Destroy((Object)(object)((Component)val5.transform.Find("Room")).gameObject); if (flag) { Transform val6 = val5.transform.Find("OnLevelStart"); if ((Object)(object)val6 != (Object)null) { Object.Destroy((Object)(object)((Component)val6).gameObject); } else { activeScene = SceneManager.GetActiveScene(); OnLevelStart val7 = (from go in ((Scene)(ref activeScene)).GetRootGameObjects() select go.GetComponent() into ls where (Object)(object)ls != (Object)null && (Object)(object)((Component)ls).gameObject != (Object)(object)onLevelStartObj select ls).FirstOrDefault(); if ((Object)(object)val7 != (Object)null) { Object.Destroy((Object)(object)((Component)val7).gameObject); } } } } MeshCollider[] componentsInChildren = val2.GetComponentsInChildren(); MeshFilter val9 = default(MeshFilter); foreach (MeshCollider val8 in componentsInChildren) { if (((Component)val8).gameObject.TryGetComponent(ref val9)) { val9.mesh = val8.sharedMesh; } } Transform transform = ((Component)MonoSingleton.Instance).transform; ((Component)transform).transform.parent = val2.transform; val2.transform.position = ((Component)this).transform.position; val2.transform.rotation = ((Component)this).transform.rotation; ((Component)transform).transform.parent = null; Quaternion rotation = ((Component)this).transform.rotation; UtilsRogue.SetPlayerWorldRotation(Quaternion.Euler(0f, ((Quaternion)(ref rotation)).eulerAngles.y, 0f)); if ((Object)(object)playerSpawnPos != (Object)null) { ((Component)transform).transform.parent = ((Component)playerSpawnPos).transform.parent; ((Component)transform).transform.localPosition = playerSpawnPos.localPosition; UtilsRogue.SetPlayerWorldRotation(playerSpawnPos.rotation); ((Component)transform).transform.SetParent((Transform)null); } MonoSingleton.Instance.spawnPos = ((Component)transform).transform.position; try { Transform val10 = val2.transform.Find("Room/FinalDoor"); FinalDoor component = ((Component)val10).GetComponent(); Camera main = Camera.main; main.backgroundColor = backgroundColor; main.clearFlags = cameraFillMode; FinalDoorOpener component2 = ((Component)val2.transform.Find("Room/FinalDoor/FinalDoorOpener")).GetComponent(); component2.startMusic = startMusic; FinalDoor component3 = ((Component)val2.transform.Find("Room/FinalDoor")).GetComponent(); Transform obj2 = ((Component)MonoSingleton.Instance).transform.Find("Canvas"); if (obj2 == null) { activeScene = SceneManager.GetActiveScene(); obj2 = (from o in ((Scene)(ref activeScene)).GetRootGameObjects() where ((Object)o).name == "Canvas" select o).First().transform; } Transform val11 = obj2; GameObject val12 = null; if (enableHellMap) { Deserialize(); RectTransform val13 = MakeRect(val11); ((Object)val13).name = "Hellmap"; val12 = ((Component)val13).gameObject; Vector2 anchorMin = (val13.anchorMax = new Vector2(0.5f, 0.5f)); val13.anchorMin = anchorMin; val13.pivot = new Vector2(0.5f, 0.5f); val13.sizeDelta = new Vector2(250f, 650f); val13.anchoredPosition = Vector2.zero; ((Transform)val13).localScale = Vector3.one * 0.82244f; ((Transform)val13).SetAsFirstSibling(); RectTransform val15 = MakeRect(((Component)val13).transform); ((Object)val15).name = "Hellmap Container"; val15.anchorMin = Vector2.zero; val15.anchorMax = Vector2.one; val15.pivot = new Vector2(0.5f, 0.5f); val15.sizeDelta = Vector2.zero; val15.anchoredPosition = Vector2.zero; ((Transform)val15).localScale = Vector3.one; float num = 0f; Stack stack = new Stack(); foreach (LayerInfoRogue layersAndLevel in layersAndLevels) { RectTransform val16 = MakeRect((Transform)(object)val15); anchorMin = (val16.anchorMax = new Vector2(0f, 1f)); val16.anchorMin = anchorMin; val16.sizeDelta = new Vector2(250f, 50f); val16.pivot = new Vector2(0f, 1f); ((Transform)val16).localScale = Vector3.one; val16.anchoredPosition = new Vector2(0f, (num == 0f) ? (-3.051758E-05f) : num); num -= 50f; Text val18 = MakeText((Transform)(object)val16); val18.text = layersAndLevel.layerName; val18.fontSize = 36; val18.font = UtilsRogue.gameFont; val18.alignment = (TextAnchor)3; ((Graphic)val18).color = Color.white; RectTransform component4 = ((Component)val18).GetComponent(); component4.anchorMin = Vector2.zero; component4.anchorMax = Vector2.one; component4.sizeDelta = Vector2.zero; component4.pivot = new Vector2(0.5f, 0.5f); ((Transform)component4).localScale = Vector3.one; component4.anchoredPosition = Vector2.zero; string[] layerLevels = layersAndLevel.layerLevels; foreach (string text in layerLevels) { RectTransform val19 = MakeRect((Transform)(object)val15); anchorMin = (val19.anchorMax = new Vector2(0f, 1f)); val19.anchorMin = anchorMin; val19.pivot = new Vector2(0f, 1f); ((Transform)val19).localScale = Vector3.one; val19.anchoredPosition = new Vector2(60f, num); val19.sizeDelta = new Vector2(125f, 45f); num -= 50f; RectTransform val21 = MakeRect(((Component)val19).transform); anchorMin = (val21.anchorMax = new Vector2(0.5f, 0.5f)); val21.anchorMin = anchorMin; val21.sizeDelta = new Vector2(25f, 9f); val21.anchoredPosition = Vector2.zero; ((Transform)val21).localScale = new Vector3(5f, 5f, 5f); Image val23 = ((Component)val21).gameObject.AddComponent(); val23.type = (Type)1; val23.sprite = UtilsRogue.levelPanel; val23.pixelsPerUnitMultiplier = 1f; Text val24 = MakeText(((Component)val19).transform); val24.text = text; val24.font = UtilsRogue.gameFont; val24.fontSize = 32; val24.alignment = (TextAnchor)4; ((Graphic)val24).color = Color.black; RectTransform component5 = ((Component)val24).gameObject.GetComponent(); component5.anchorMin = Vector2.zero; component5.anchorMax = Vector2.one; component5.pivot = new Vector2(0.5f, 0.5f); component5.sizeDelta = Vector2.zero; component5.anchoredPosition = new Vector2(0f, 0f); ((Transform)component5).localScale = Vector3.one; } if (layersAndLevel.layerLevels.Length != 0) { RectTransform val25 = MakeRect((Transform)(object)val15); anchorMin = (val25.anchorMax = new Vector2(0.5f, 1f)); val25.anchorMin = anchorMin; val25.pivot = new Vector2(0.5f, 0f); val25.anchoredPosition = new Vector2(-95f, num + 25f); val25.sizeDelta = new Vector2(3f, (float)layersAndLevel.layerLevels.Length * 50f - 27.5f); ((Transform)val25).localScale = Vector3.one; ((Component)val25).gameObject.AddComponent(); for (int k = 0; k < layersAndLevel.layerLevels.Length; k++) { RectTransform val27 = MakeRect((Transform)(object)val25); anchorMin = (val27.anchorMax = new Vector2(0.5f, 0f)); val27.anchorMin = anchorMin; val27.pivot = new Vector2(0f, 0.5f); val27.sizeDelta = new Vector2(20f, 3f); val27.anchoredPosition = new Vector2(-1.5f, (float)k * 50f); ((Transform)val27).localScale = Vector3.one; ((Component)val27).gameObject.AddComponent(); } stack.Push(val25); } } while (stack.Count != 0) { RectTransform val29 = stack.Pop(); ((Transform)val29).SetAsLastSibling(); } Vector2 anchoredPosition = ((Component)((Transform)val15).GetChild(GetChildIndexFromLayerAndLevel(layerIndexToStartFrom, levelIndexToStartFrom))).GetComponent().anchoredPosition; ((Vector2)(ref anchoredPosition))..ctor(210f, anchoredPosition.y - 22.5f); Vector2 anchoredPosition2 = ((Component)((Transform)val15).GetChild(GetChildIndexFromLayerAndLevel(layerIndexToEndAt, levelIndexToEndAt))).GetComponent().anchoredPosition; ((Vector2)(ref anchoredPosition2))..ctor(210f, anchoredPosition2.y - 22.5f); RectTransform val30 = MakeRect((Transform)(object)val13); anchorMin = (val30.anchorMax = new Vector2(0f, 1f)); val30.anchorMin = anchorMin; val30.pivot = new Vector2(0.5f, 0.5f); val30.sizeDelta = new Vector2(35f, 35f); ((Transform)val30).rotation = Quaternion.Euler(0f, 0f, 90f); ((Transform)val30).localScale = Vector3.one; val30.anchoredPosition = anchoredPosition; AudioSource val32 = ((Component)val30).gameObject.AddComponent(); val32.playOnAwake = false; val32.loop = false; val32.clip = hellmapBeepClip; val32.volume = 0.1f; Image val33 = ((Component)val30).gameObject.AddComponent(); val33.sprite = UtilsRogue.hellmapArrow; CustomHellmapCursor customHellmapCursor = ((Component)val30).gameObject.AddComponent(); customHellmapCursor.targetPosition = anchoredPosition2; customHellmapCursor.aud = val32; customHellmapCursor.targetImage = val33; ObjectActivator val34 = ((Component)UnityUtilsRogue.GetComponentInChildrenRecursive(val2.transform)).gameObject.AddComponent(); val34.dontActivateOnEnable = true; val34.oneTime = true; val34.events = new UltrakillEvent(); val34.events.toDisActivateObjects = (GameObject[])(object)new GameObject[1] { ((Component)val13).gameObject }; } if (convertToUpwardRoom) { foreach (GameObject item in upwardRoomOutOfBoundsToDisable) { item.SetActive(false); } List list = new List(); if ((Object)(object)val12 != (Object)null) { list.Add(val12); } List list2 = new List(); list2.AddRange(upwardRoomOutOfBoundsToDisable); ConvertToAscendingFirstRoom(val2, upwardRoomDoorCloseClip, list2, list, doNotReplace); } if (!encoreRoom) { return; } FinalRank instance = MonoSingleton.Instance; if (!((Object)(object)instance != (Object)null)) { return; } Transform val35 = ((Component)instance).transform.Find("Extra Info"); RectTransform val36 = default(RectTransform); if ((Object)(object)val35 != (Object)null && ((Component)val35).gameObject.TryGetComponent(ref val36)) { val36.anchoredPosition = Vector2.op_Implicit(new Vector3(0f, 200f, 0f)); val36.sizeDelta = new Vector2(480f, 180f); } Transform val37 = ((Component)instance).transform.Find("Secrets - Title"); Transform val38 = ((Component)instance).transform.Find("Secrets - Info"); Transform val39 = (((Object)(object)val38 == (Object)null) ? null : ((Component)val38).transform.Find("Text (1)")); Transform val40 = ((Component)instance).transform.Find("Challenge - Title"); Transform val41 = ((Component)instance).transform.Find("Challenge"); List list3 = instance.toAppear.ToList(); if ((Object)(object)val37 != (Object)null && !list3.Contains(((Component)val37).gameObject)) { list3.Insert(list3.Count - 1, ((Component)val37).gameObject); } if ((Object)(object)val38 != (Object)null && !list3.Contains(((Component)val38).gameObject)) { list3.Insert(list3.Count - 1, ((Component)val38).gameObject); } if ((Object)(object)val39 != (Object)null && !list3.Contains(((Component)val39).gameObject)) { list3.Insert(list3.Count - 1, ((Component)val39).gameObject); } if ((Object)(object)val40 != (Object)null && !list3.Contains(((Component)val40).gameObject)) { ((Component)val40).gameObject.SetActive(true); list3.Insert(list3.Count - 1, ((Component)val40).gameObject); } if ((Object)(object)val41 != (Object)null && !list3.Contains(((Component)val41).gameObject)) { list3.Insert(list3.Count - 1, ((Component)val41).gameObject); } instance.toAppear = list3.ToArray(); Transform val42 = ((Component)val11).transform.Find("Level Stats Controller"); if (!((Object)(object)val42 != (Object)null)) { return; } LevelStats componentInChildren = ((Component)val42).GetComponentInChildren(true); ((Component)componentInChildren).GetComponent().sizeDelta = new Vector2(285f, 315f); Transform obj3 = ((Component)componentInChildren).transform.Find("Challenge Title/Challenge"); componentInChildren.challenge = ((obj3 != null) ? ((Component)obj3).GetComponent() : null); Transform obj4 = ((Component)componentInChildren).transform.Find("Challenge Title"); if (obj4 != null) { ((Component)obj4).gameObject.SetActive(true); } Transform obj5 = ((Component)componentInChildren).transform.Find("Secrets Title"); if (obj5 != null) { ((Component)obj5).gameObject.SetActive(true); } List list4 = new List(); for (int num2 = 5; num2 >= 1; num2--) { Transform val43 = ((Component)componentInChildren).transform.Find($"Secrets Title/Secret {num2}"); if ((Object)(object)val43 != (Object)null) { list4.Add(((Component)val43).GetComponent()); } } componentInChildren.secrets = list4.ToArray(); Transform val44 = ((Component)componentInChildren).transform.Find("Assists Title"); ((Component)val44).GetComponent().anchoredPosition = new Vector2(10f, -275f); } catch (Exception ex) { throw ex; } finally { spawned = true; } int GetChildIndexFromLayerAndLevel(int layer, int level) { int num3 = 0; for (int l = 0; l < layer; l++) { num3 += 1 + levelSizes[l]; } return num3 + 1 + level; } } public void Awake() { Spawn(); } public void Start() { if ((Object)(object)MonoSingleton.Instance != (Object)null) { MonoSingleton.Instance.levelNameOnStart = displayLevelTitle; } else { Debug.LogWarning((object)"Could not find OnLevelStart"); } if (!doNotReplace) { Object.Destroy((Object)(object)((Component)this).gameObject); } } } public class Gambler : MonoBehaviour { [CompilerGenerated] private sealed class d__13 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Gambler <>4__this; private GameObject 5__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__13(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; <>1__state = -2; } private bool MoveNext() { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Expected O, but got Unknown //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; ((Component)<>4__this).gameObject.AddComponent().PlayOneShot(AssetsManager.StalkerWarning); <>2__current = (object)new WaitForSeconds(1f); <>1__state = 1; return true; case 1: <>1__state = -1; 5__1 = MonoSingleton.Instance.explosion; if ((Object)(object)5__1 != (Object)null) { Object.Instantiate(5__1, ((Component)<>4__this).transform.position, Quaternion.identity); } Object.Destroy((Object)(object)((Component)<>4__this).gameObject); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private const float GAMBLE_COOLDOWN = 1.5f; private const float EXPLOSION_BASE_CHANCE = 0.08f; private const float EXPLOSION_CHANCE_RAMP = 0.07f; private const float EXPLOSION_RADIUS = 5f; private const float EXPLOSION_DAMAGE = 40f; private float cooldown = 0f; private int useCount = 0; private bool exploded = false; private Transform itemPlacementThing; private void Update() { //IL_004e: 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) if (!exploded) { if (cooldown > 0f) { cooldown -= Time.deltaTime; } else if (!((Object)(object)MonoSingleton.Instance == (Object)null) && Vector3.Distance(((Component)MonoSingleton.Instance).transform.position, ((Component)this).transform.position) <= 2f) { Activate(); cooldown = 1.5f; } } } private void Awake() { //IL_0018: 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) if ((Object)(object)itemPlacementThing == (Object)null) { itemPlacementThing = new GameObject("ItemPar").transform; ((Component)itemPlacementThing).transform.parent = ((Component)this).transform.parent; itemPlacementThing.position = ((Component)this).transform.position; } } public void Activate() { RogueDifficultyManager instance = RogueDifficultyManager.Instance; if ((Object)(object)instance == (Object)null) { return; } if (instance.Gold <= 0) { HudMessageReceiver instance2 = MonoSingleton.Instance; if (instance2 != null) { instance2.SendHudMessage("No gold to gamble!", "", "", 0, false, false, true); } return; } instance.Gold--; useCount++; float num = 0.08f + 0.07f * (float)(useCount - 1); if (RogueDifficultyManager.GambleItemRNG.NextDouble() <= (double)num) { Explode(); } else if (RogueDifficultyManager.GambleItemRNG.NextDouble() <= 0.3499999940395355) { HudMessageReceiver instance3 = MonoSingleton.Instance; if (instance3 != null) { instance3.SendHudMessage("You won!", "", "", 0, false, false, true); } ItemPickup.CreatePickup(Plugin.GiveRandomItem(RogueDifficultyManager.GambleItemRNG), itemPlacementThing, 5f); } else { HudMessageReceiver instance4 = MonoSingleton.Instance; if (instance4 != null) { instance4.SendHudMessage("You lost... try again?", "", "", 0, false, false, true); } } } private void Explode() { exploded = true; ((MonoBehaviour)this).StartCoroutine(explosionNumerator()); } [IteratorStateMachine(typeof(d__13))] private IEnumerator explosionNumerator() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__13(0) { <>4__this = this }; } } public class GoldPickup : MonoBehaviour { private bool pickedUp = false; private void Update() { //IL_000b: 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) if (Vector3.Distance(((Component)MonoSingleton.Instance).transform.position, ((Component)this).transform.position) <= 2f && !pickedUp) { pickedUp = true; RogueDifficultyManager.Instance.Gold++; Object.Destroy((Object)(object)((Component)this).gameObject); } } public static void CreatePickup(Vector3 position) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) GameObject val = GameObject.CreatePrimitive((PrimitiveType)0); val.GetComponent().enabled = false; val.AddComponent(); val.transform.position = position + Vector3.up * 2f; } } public class ItemPedestal : MonoBehaviour { private BaseItem chosenItem; private void Start() { if ((float)RogueDifficultyManager.ItemRNG.NextDouble() <= 0.5f) { chosenItem = Plugin.GiveRandomItem(); ItemPickup.CreatePickup(chosenItem, ((Component)this).transform); } else { WeaponPickupRogue.CreatePickup(((Component)this).transform); } } } public class ItemPickup : MonoBehaviour { public BaseItem item; private bool pickedUp = false; private Func canPickup; private void Update() { //IL_0046: 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) ((Component)((Component)this).transform).transform.LookAt(((Component)Camera.main).transform); ((Component)((Component)this).transform).transform.Rotate(0f, 180f, 0f); if (Vector3.Distance(((Component)MonoSingleton.Instance).transform.position, ((Component)this).transform.position) <= 2f && !pickedUp && (canPickup == null || canPickup())) { pickedUp = true; HudMessageReceiver instance = MonoSingleton.Instance; if (instance != null) { instance.SendHudMessage(item.ToString(), "", "", 0, false, false, true); } Plugin.GiveItem(item); Object.Destroy((Object)(object)((Component)this).gameObject); } } public static void CreatePickup(BaseItem item, Transform position, float offset = 3f) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: 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) GameObject val = GameObject.CreatePrimitive((PrimitiveType)5); val.GetComponent().enabled = false; val.AddComponent().item = item; Material val2 = new Material(AssetsManager.weaponMat); val2.mainTexture = (Texture)(object)item.ItemTexture; ((Renderer)val.GetComponent()).material = val2; val.transform.position = position.position + Vector3.up * offset; val.transform.parent = position; Transform transform = val.transform; transform.localScale *= 3f; } public static void CreatePickupConditional(BaseItem item, Transform position, Func pickupCon, float offset = 3f) { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) GameObject val = GameObject.CreatePrimitive((PrimitiveType)5); val.GetComponent().enabled = false; val.AddComponent().item = item; val.GetComponent().canPickup = pickupCon; Material val2 = new Material(AssetsManager.weaponMat); val2.mainTexture = (Texture)(object)item.ItemTexture; ((Renderer)val.GetComponent()).material = val2; val.transform.position = position.position + Vector3.up * offset; Transform transform = val.transform; transform.localScale *= 3f; val.transform.parent = position; } } public class MinimapUI : MonoBehaviour { [Header("References")] [Tooltip("The RectTransform of the panel that contains the minimap.")] public RectTransform minimapPanel; [Header("Layout")] [Tooltip("Pixel size of each room cell.")] public float cellSize = 16f; [Tooltip("Width of corridor connectors between cells, as a fraction of cellSize.")] [Range(0.2f, 0.6f)] public float corridorFraction = 0.4f; [Header("Room Colors")] public Color colorNormal = new Color(0.52f, 0.52f, 0.55f); public Color colorStart = new Color(0.28f, 0.82f, 0.38f); public Color colorBoss = new Color(0.88f, 0.14f, 0.14f); public Color colorTreasure = new Color(0.95f, 0.78f, 0.08f); public Color colorShop = new Color(0.22f, 0.52f, 0.95f); public Color colorGambling = new Color(0.72f, 0.22f, 0.92f); [Header("UI Colors")] [Tooltip("Colour of rooms adjacent to visited ones but not yet entered.")] public Color colorSilhouette = new Color(0.28f, 0.28f, 0.3f); [Tooltip("Base colour flashed on the current room. It pulses between this and white.")] public Color colorCurrentBase = new Color(0.95f, 0.95f, 1f); [Tooltip("Colour of corridor connectors between revealed cells.")] public Color colorCorridor = new Color(0.38f, 0.38f, 0.4f); [Header("Animation")] [Tooltip("Speed of the current-room pulse. Higher = faster throb.")] public float pulseSpeed = 2.8f; private readonly Dictionary _cells = new Dictionary(); private readonly Dictionary<(Vector2Int, Vector2Int), Image> _corridors = new Dictionary<(Vector2Int, Vector2Int), Image>(); private readonly HashSet _visited = new HashSet(); private readonly HashSet _scouted = new HashSet(); private Vector2Int _currentPos = new Vector2Int(int.MinValue, 0); private float _pulseTimer; private static readonly Vector2Int[] Dirs = (Vector2Int[])(object)new Vector2Int[4] { Vector2Int.up, Vector2Int.down, Vector2Int.left, Vector2Int.right }; private Dictionary _placedRooms; public static MinimapUI Instance { get; private set; } private void Awake() { if ((Object)(object)Instance != (Object)null && (Object)(object)Instance != (Object)(object)this) { Object.Destroy((Object)(object)((Component)this).gameObject); } else { Instance = this; } } private void Update() { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00af: 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_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_0064: 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_006b: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) if (_placedRooms == null || (Object)(object)RoomGenerator.Instance == (Object)null) { return; } NewMovement instance = MonoSingleton.Instance; if (!((Object)(object)instance == (Object)null)) { Vector2Int val = RoomGenerator.Instance.WorldToGrid(((Component)instance).transform.position); if (val != _currentPos) { _currentPos = val; MarkVisited(val); } _pulseTimer += Time.deltaTime * pulseSpeed; float num = 0.6f + 0.4f * Mathf.Sin(_pulseTimer); Color color = Color.Lerp(colorCurrentBase * 0.7f, colorCurrentBase, num); if (_cells.TryGetValue(_currentPos, out Image value)) { ((Graphic)value).color = color; } } } public void BuildMinimap(Dictionary placedRooms) { //IL_003f: 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_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_030c: Unknown result type (might be due to invalid IL or missing references) //IL_0311: Unknown result type (might be due to invalid IL or missing references) //IL_0313: Unknown result type (might be due to invalid IL or missing references) //IL_0317: Unknown result type (might be due to invalid IL or missing references) //IL_031c: Unknown result type (might be due to invalid IL or missing references) //IL_031e: Unknown result type (might be due to invalid IL or missing references) //IL_0323: Unknown result type (might be due to invalid IL or missing references) //IL_032b: 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_034b: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_036a: Unknown result type (might be due to invalid IL or missing references) //IL_0390: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_026f: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Unknown result type (might be due to invalid IL or missing references) //IL_0287: Unknown result type (might be due to invalid IL or missing references) //IL_028c: Unknown result type (might be due to invalid IL or missing references) //IL_0295: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: 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_02b6: Unknown result type (might be due to invalid IL or missing references) DestroyChildren(); _cells.Clear(); _corridors.Clear(); _visited.Clear(); _scouted.Clear(); _currentPos = new Vector2Int(int.MinValue, 0); _placedRooms = placedRooms; if ((Object)(object)minimapPanel == (Object)null) { Debug.LogError((object)"[MinimapUI] minimapPanel is not assigned — assign it in the Inspector."); return; } int num = int.MaxValue; int num2 = int.MaxValue; int num3 = int.MinValue; int num4 = int.MinValue; foreach (Vector2Int key3 in placedRooms.Keys) { Vector2Int current = key3; if (((Vector2Int)(ref current)).x < num) { num = ((Vector2Int)(ref current)).x; } if (((Vector2Int)(ref current)).x > num3) { num3 = ((Vector2Int)(ref current)).x; } if (((Vector2Int)(ref current)).y < num2) { num2 = ((Vector2Int)(ref current)).y; } if (((Vector2Int)(ref current)).y > num4) { num4 = ((Vector2Int)(ref current)).y; } } float num5 = cellSize + cellSize * corridorFraction; float num6 = cellSize * corridorFraction; float num7 = num5 - cellSize; Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor((0f - (float)(num3 + num) / 2f) * num5, (0f - (float)(num4 + num2) / 2f) * num5); foreach (KeyValuePair placedRoom in placedRooms) { Vector2Int key = placedRoom.Key; Vector2 val2 = GridToPx(key, num5) + val; Vector2Int[] array = (Vector2Int[])(object)new Vector2Int[2] { Vector2Int.right, Vector2Int.up }; foreach (Vector2Int val3 in array) { if (placedRooms.ContainsKey(key + val3)) { bool flag = val3 == Vector2Int.right; float num8 = (flag ? num7 : num6); float num9 = (flag ? num6 : num7); float num10 = (flag ? (cellSize / 2f + num7 / 2f) : 0f); float num11 = (flag ? 0f : (cellSize / 2f + num7 / 2f)); Image val4 = MakeImage($"Corr_{key}_{val3}", minimapPanel, val2 + new Vector2(num10, num11), new Vector2(num8, num9)); ((Graphic)val4).color = Color.clear; _corridors[(key, val3)] = val4; } } } foreach (KeyValuePair placedRoom2 in placedRooms) { Vector2Int key2 = placedRoom2.Key; Vector2 anchoredPos = GridToPx(key2, num5) + val; Image val5 = MakeImage($"Room_{key2}", minimapPanel, anchoredPos, new Vector2(cellSize, cellSize)); ((Graphic)val5).color = Color.clear; _cells[key2] = val5; } MarkVisited(Vector2Int.zero); } public void ClearAndReset() { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) DestroyChildren(); _cells.Clear(); _corridors.Clear(); _visited.Clear(); _scouted.Clear(); _placedRooms = null; _currentPos = new Vector2Int(int.MinValue, 0); } private void MarkVisited(Vector2Int pos) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0032: 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_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) if (_placedRooms == null) { return; } _visited.Add(pos); Vector2Int[] dirs = Dirs; foreach (Vector2Int val in dirs) { Vector2Int val2 = pos + val; if (_placedRooms.ContainsKey(val2)) { _scouted.Add(val2); } } RefreshAll(); } private void RefreshAll() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002c: 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_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0075: 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_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) foreach (KeyValuePair cell in _cells) { Vector2Int key = cell.Key; Image value = cell.Value; if (key == _currentPos) { ((Graphic)value).color = colorCurrentBase; } else if (_visited.Contains(key)) { ((Graphic)value).color = RoomColor(_placedRooms[key].roomType) * 0.9f; } else if (_scouted.Contains(key)) { ((Graphic)value).color = colorSilhouette; } else { ((Graphic)value).color = Color.clear; } } foreach (KeyValuePair<(Vector2Int, Vector2Int), Image> corridor in _corridors) { Vector2Int item = corridor.Key.Item1; Vector2Int item2 = corridor.Key.Item2; Image value2 = corridor.Value; bool flag = _visited.Contains(item) || _scouted.Contains(item); bool flag2 = _visited.Contains(item + item2) || _scouted.Contains(item + item2); ((Graphic)value2).color = ((flag && flag2) ? colorCorridor : Color.clear); } } private Color RoomColor(RoomType type) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0035: 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_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) if (1 == 0) { } Color result = (Color)(type switch { RoomType.Start => colorStart, RoomType.Boss => colorBoss, RoomType.Treasure => colorTreasure, RoomType.Shop => colorShop, RoomType.Gambling => colorGambling, _ => colorNormal, }); if (1 == 0) { } return result; } private static Vector2 GridToPx(Vector2Int grid, float step) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) return new Vector2((float)((Vector2Int)(ref grid)).x * step, (float)((Vector2Int)(ref grid)).y * step); } private Image MakeImage(string objName, RectTransform parent, Vector2 anchoredPos, Vector2 size) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_0051: 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_005b: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0063: 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_0073: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(objName, new Type[2] { typeof(RectTransform), typeof(Image) }); val.transform.SetParent((Transform)(object)parent, false); RectTransform component = val.GetComponent(); Vector2 val2 = default(Vector2); ((Vector2)(ref val2))..ctor(0.5f, 0.5f); component.pivot = val2; Vector2 anchorMin = (component.anchorMax = val2); component.anchorMin = anchorMin; component.anchoredPosition = anchoredPos; component.sizeDelta = size; Image component2 = val.GetComponent(); ((Graphic)component2).raycastTarget = false; return component2; } private void DestroyChildren() { if (!((Object)(object)minimapPanel == (Object)null)) { for (int num = ((Transform)minimapPanel).childCount - 1; num >= 0; num--) { Object.Destroy((Object)(object)((Component)((Transform)minimapPanel).GetChild(num)).gameObject); } } } } [DefaultExecutionOrder(-1)] public class RogueDifficultyManager : MonoBehaviour { [SerializeField] private TMP_Text goldText; [SerializeField] private TMP_Text keyText; [SerializeField] private GridLayoutGroup itemParent; public float Difficulty; public int Gold; public int Keys; private float difficultyScaleMult = 1f; public int floor = 1; private Dictionary itemCounts; private Dictionary itemUIObjects; public static Random ItemRNG; public static Random GambleItemRNG; public static Random RoomRNG; public static Random BossRNG; private bool keepOpen; private float doubleTap; private GameObject itemsUI; private TMP_Text statSpeedText; private TMP_Text statDamageText; private TMP_Text statAtkSpeedText; private TMP_Text statCooldownText; public static RogueDifficultyManager Instance { get; private set; } private void Awake() { ItemRNG = new Random(Plugin.GameSeed.GetHashCode()); GambleItemRNG = new Random(Plugin.GameSeed.GetHashCode() * 2); RoomRNG = new Random(Plugin.GameSeed.GetHashCode() / 2); BossRNG = new Random(Plugin.GameSeed.GetHashCode() ^ 2); Instance = this; Difficulty = Plugin.CurrentDifficulty; itemCounts = new Dictionary(); itemUIObjects = new Dictionary(); itemsUI = ((Component)GameObject.Find("Items").transform.Find("Panel")).gameObject; itemsUI.SetActive(false); itemParent = itemsUI.GetComponent(); Transform val = GameObject.Find("Items").transform.Find("Stats"); statSpeedText = ((Component)val.Find("StatSpeed/Stt")).GetComponent(); statDamageText = ((Component)val.Find("StatDamage/Stt")).GetComponent(); statAtkSpeedText = ((Component)val.Find("StatAtkSpeed/Stt")).GetComponent(); statCooldownText = ((Component)val.Find("StatCooldown/Stt")).GetComponent(); } private void UpdateStatsUI() { if (!((Object)(object)MonoSingleton.Instance == (Object)null)) { float walkSpeed = MonoSingleton.Instance.walkSpeed; float normalMoveSpeed = Plugin.Instance.normalMoveSpeed; float num = walkSpeed / normalMoveSpeed; float num2 = Plugin.AttackSpeed.CalculateChanges(1f); float num3 = Plugin.globalDamageMult.CalculateChanges(1f); float num4 = Plugin.cooldownReduction.CalculateChanges(1f); statSpeedText.text = $"x{num:F2}"; statDamageText.text = $"x{num3:F2}"; statAtkSpeedText.text = $"x{num2:F2}"; statCooldownText.text = $"x{num4:F2}"; } } public void AddItem(BaseItem item) { //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Expected O, but got Unknown //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Expected O, but got Unknown //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01db: 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) if (item == null) { Plugin.Logger.LogError((object)"AddItem called with null item!"); return; } if ((Object)(object)itemParent == (Object)null) { Plugin.Logger.LogError((object)"itemParent is not assigned in the Inspector!"); return; } string itemName = item.ItemName; if (itemCounts.ContainsKey(itemName)) { itemCounts[itemName]++; if (itemUIObjects.TryGetValue(itemName, out GameObject value) && (Object)(object)value != (Object)null) { TMP_Text componentInChildren = value.GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { componentInChildren.text = $"(x{itemCounts[itemName]})"; } } return; } itemCounts[itemName] = 1; GameObject val = new GameObject(itemName); val.transform.SetParent(((Component)itemParent).transform, false); Image val2 = val.AddComponent(); if ((Object)(object)item.ItemIcon != (Object)null) { val2.sprite = item.ItemIcon; } else { Plugin.Logger.LogWarning((object)("Item '" + itemName + "' has no icon!")); } GameObject val3 = new GameObject("CountLabel"); val3.transform.SetParent(val.transform, false); TMP_Text val4 = (TMP_Text)(object)val3.AddComponent(); val4.text = ""; val4.fontSize = 14f; val4.alignment = (TextAlignmentOptions)1028; ((Graphic)val4).color = Color.white; RectTransform component = val3.GetComponent(); component.anchorMin = Vector2.zero; component.anchorMax = Vector2.one; component.offsetMin = Vector2.zero; component.offsetMax = Vector2.zero; itemUIObjects[itemName] = val; } private void Update() { if (!keepOpen) { if (MonoSingleton.Instance.InputSource.Stats.WasPerformedThisFrame) { if (!keepOpen) { if (doubleTap > 0f) { keepOpen = true; } else { doubleTap = 0.5f; } } itemsUI.SetActive(true); ((Component)statDamageText.transform.parent.parent).gameObject.SetActive(true); if ((Object)(object)MinimapUI.Instance != (Object)null) { ((Component)MinimapUI.Instance.minimapPanel).gameObject.SetActive(true); } } else if (MonoSingleton.Instance.InputSource.Stats.WasCanceledThisFrame) { itemsUI.SetActive(false); ((Component)statDamageText.transform.parent.parent).gameObject.SetActive(false); if ((Object)(object)MinimapUI.Instance != (Object)null) { ((Component)MinimapUI.Instance.minimapPanel).gameObject.SetActive(false); } } } else if (MonoSingleton.Instance.InputSource.Stats.WasPerformedThisFrame) { keepOpen = false; itemsUI.SetActive(false); ((Component)statDamageText.transform.parent.parent).gameObject.SetActive(false); if ((Object)(object)MinimapUI.Instance != (Object)null) { ((Component)MinimapUI.Instance.minimapPanel).gameObject.SetActive(false); } } if (doubleTap > 0f) { doubleTap = Mathf.MoveTowards(doubleTap, 0f, Time.deltaTime); } Difficulty += Time.deltaTime / 180f * difficultyScaleMult; goldText.text = "Gold: " + Gold; keyText.text = "Keys: " + Keys; UpdateStatsUI(); } public void MoveStage() { Difficulty *= 1.2f; Plugin.Logger.LogInfo((object)("Before: " + difficultyScaleMult)); int currentDifficulty = Plugin.CurrentDifficulty; Plugin.Logger.LogInfo((object)("Difficulty pref: " + currentDifficulty)); difficultyScaleMult *= 1.34f * (float)((currentDifficulty + 2) / 3); Plugin.Logger.LogInfo((object)("After: " + difficultyScaleMult)); floor++; GambleItemRNG = new Random(Plugin.GameSeed.GetHashCode() * (floor + 2)); } public int GetCountBeforeRadiance(EnemyType enemyType) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: 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_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Invalid comparison between Unknown and I4 //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Invalid comparison between Unknown and I4 //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected I4, but got Unknown //IL_0051: 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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Invalid comparison between Unknown and I4 //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Invalid comparison between Unknown and I4 //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Invalid comparison between Unknown and I4 //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Invalid comparison between Unknown and I4 //IL_0035: 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_003a: Invalid comparison between Unknown and I4 if ((int)enemyType <= 14) { switch ((int)enemyType) { default: if ((int)enemyType == 9) { break; } if (enemyType - 13 <= 1) { goto case 1; } goto IL_0072; case 3: return 10; case 1: case 6: return 5; case 0: break; case 2: case 4: case 5: goto IL_0072; } goto IL_006e; } if ((int)enemyType <= 21) { if ((int)enemyType == 20) { goto IL_006e; } if ((int)enemyType == 21) { goto IL_006a; } } else { if (enemyType - 33 <= 1) { goto IL_006e; } if ((int)enemyType == 39) { goto IL_006a; } } goto IL_0072; IL_006e: return 4; IL_006a: return 3; IL_0072: return 2; } public BossPick GetBoss() { List list = new List(); switch (floor) { case 1: case 2: list.Add(new BossPick(new List { new BossEntry(AssetsManager.GetEnemiesOfType((EnemyType)0)[0].gameObject), new BossEntry(AssetsManager.GetEnemiesOfType((EnemyType)0)[0].gameObject) })); list.Add(new BossPick(new List { new BossEntry(AssetsManager.GetEnemiesOfType((EnemyType)4)[0].gameObject, 30f) })); list.Add(new BossPick(new List { new BossEntry(AssetsManager.GetEnemiesOfType((EnemyType)24)[0].gameObject) })); list.Add(new BossPick(new List { new BossEntry(AssetsManager.GetEnemiesOfType((EnemyType)7)[0].gameObject) })); list.Add(new BossPick(new List { new BossEntry(AssetsManager.GetEnemiesOfType((EnemyType)7)[0].gameObject) })); list.Add(new BossPick(new List { new BossEntry(AssetsManager.funnyPowerIntroSpawn, 20f) })); list.Add(new BossPick(new List { new BossEntry(AssetsManager.GetEnemiesOfType((EnemyType)5)[0].gameObject) })); break; case 3: case 4: case 5: list.Add(new BossPick(new List { new BossEntry(AssetsManager.GetEnemiesOfType((EnemyType)8)[0].gameObject) })); list.Add(new BossPick(new List { new BossEntry(AssetsManager.GetEnemiesOfType((EnemyType)16)[0].gameObject, 50f) })); list.Add(new BossPick(new List { new BossEntry(AssetsManager.GetEnemiesOfType((EnemyType)2)[0].gameObject, 50f) })); list.Add(new BossPick(new List { new BossEntry(AssetsManager.GetEnemiesOfType((EnemyType)26)[0].gameObject, 50f) })); list.Add(new BossPick(new List { new BossEntry(AssetsManager.GetEnemiesOfType((EnemyType)19)[0].gameObject, 50f) })); break; case 6: case 7: { list.Add(new BossPick(new List { new BossEntry(AssetsManager.GetEnemiesOfType((EnemyType)26)[0].gameObject) })); list.Add(new BossPick(new List { new BossEntry(AssetsManager.GetEnemiesOfType((EnemyType)32)[0].gameObject) })); list.Add(new BossPick(new List { new BossEntry(AssetsManager.GetEnemiesOfType((EnemyType)28)[0].gameObject) })); list.Add(new BossPick(new List { new BossEntry(AssetsManager.GetEnemiesOfType((EnemyType)25)[0].gameObject) })); Enemy A = null; Enemy T = null; list.Add(new BossPick(new List { new BossEntry(AssetsManager.Agony), new BossEntry(AssetsManager.Tundra) }, delegate(EnemyIdentifier eid) { if ((Object)(object)A == (Object)null) { A = Room.FindEnemyComponent(((Component)eid).gameObject); } else { if ((Object)(object)T == (Object)null) { T = Room.FindEnemyComponent(((Component)eid).gameObject); } A.symbiote = T; T.symbiote = A; } })); list.Add(new BossPick(new List> { new List { new BossEntry(AssetsManager.funnyPowerIntroSpawn) }, new List { new BossEntry(AssetsManager.funnyPowerIntroSpawn), new BossEntry(AssetsManager.funnyPowerIntroSpawn) } })); break; } default: list.Add(new BossPick(new List { new BossEntry(AssetsManager.GetEnemiesOfType((EnemyType)18)[0].gameObject, 0f, 25f, 8) })); list.Add(new BossPick(new List { new BossEntry(AssetsManager.GetEnemiesOfType((EnemyType)29)[0].gameObject, 130f, 20f, 8) })); list.Add(new BossPick(new List { new BossEntry(AssetsManager.GetEnemiesOfType((EnemyType)41)[0].gameObject, 0f, 23f, 8) })); list.Add(new BossPick(new List { new BossEntry(AssetsManager.GetEnemiesOfType((EnemyType)37)[0].gameObject, 100f, 12f, 8) })); list.Add(new BossPick(new List { new BossEntry(AssetsManager.GetEnemiesOfType((EnemyType)4)[0].gameObject, 60f, 45f, 8), new BossEntry(AssetsManager.GetEnemiesOfType((EnemyType)4)[0].gameObject, 60f, 45f, 8) })); break; } if (list.Count == 0) { return null; } return list[Random.Range(0, list.Count)]; } public bool CanSpawn(EnemyType enemy) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: 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_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Expected I4, but got Unknown //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Invalid comparison between Unknown and I4 switch ((int)enemy) { default: if ((int)enemy != 40) { break; } goto case 19; case 1: case 3: case 13: case 14: case 15: return true; case 6: return Plugin.SelectedChar.GetType() != typeof(Streetcleaner); case 0: case 4: case 5: case 7: return floor >= 3; case 19: case 26: return floor >= 5; case 16: return floor >= 6; case 2: case 8: case 22: return false; case 9: case 10: case 11: case 12: case 17: case 18: case 20: case 21: case 23: case 24: case 25: break; } return floor >= 9; } public int GetCost(EnemyType enemyType) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: 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_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Expected I4, but got Unknown return (int)enemyType switch { 3 => 1, 13 => 2, 14 => 5, 6 => 5, 0 => 20, 7 => 25, 1 => 4, 2 => 48, 8 => 175, 22 => 200, 29 => 400, 18 => 350, 32 => 250, 16 => 325, 28 => 335, 15 => 4, 5 => 55, 19 => 75, 38 => 30, 20 => 30, 12 => 20, 33 => 45, 9 => 20, 21 => 30, 39 => 50, 34 => 40, 31 => 14, 41 => 125, 25 => 145, 26 => 55, 4 => 13, 40 => 100, _ => 2147483646, }; } } public class BossPick { public List> waves = new List>(); public Action onSpawn; public BossPick(List> waves, Action onSpawn = null) { this.waves = waves; this.onSpawn = onSpawn; } public BossPick(List singleWave, Action onSpawn = null) { waves = new List> { singleWave }; this.onSpawn = onSpawn; } } public class BossEntry { public GameObject prefab; public float healthMod; public float healthPerFloorMod; public int startFloor; public BossEntry(GameObject prefab, float healthMod = 0f, float healthPerFloorMod = 0f, int startFloor = 0) { this.prefab = prefab; this.healthMod = healthMod; this.healthPerFloorMod = healthPerFloorMod; this.startFloor = startFloor; } } public class RogueFinalRank : MonoBehaviour { [CompilerGenerated] private sealed class d__14 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public UnityAction action; public float seconds; public RogueFinalRank <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__14(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSecondsRealtime(seconds); <>1__state = 1; return true; case 1: <>1__state = -1; if (action != null) { action.Invoke(); } return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public const string PREF_KEY = "RogueModeBest"; public TMP_Text waveText; public TMP_Text killsText; public TMP_Text styleText; public TMP_Text timeText; public TMP_Text bestWaveText; public TMP_Text bestKillsText; public TMP_Text bestStyleText; public TMP_Text bestTimeText; public int totalPoints; public GameObject[] toAppear; private bool skipping; private float timeBetween = 0.25f; private bool countTime; public float savedTime; private float checkedSeconds; private float seconds; private float minutes; private bool countWaves; public float savedWaves; private float checkedWaves; private bool countKills; public int savedKills; private float checkedKills; private bool countStyle; public int savedStyle; private float checkedStyle; private bool flashFade; private Color flashColor; private Image flashPanel; private int i; private bool gameOver; private bool complete; private RogueSaveData previousBest; private bool newBest; private TimeController timeController; private OptionsManager opm; private bool wasPaused; private StatsManager sman; public static RogueFinalRank Instance { get; private set; } private void Awake() { Instance = this; GameObject[] array = toAppear; for (int i = 0; i < array.Length; i++) { array[i].SetActive(false); } ((Component)this).gameObject.SetActive(false); } public RogueSaveData GetBest() { string @string = PlayerPrefs.GetString("RogueModeBest", ""); RogueSaveData rogueSaveData = JsonConvert.DeserializeObject(@string); RogueSaveData rogueSaveData2 = new RogueSaveData(); if (rogueSaveData == null) { rogueSaveData2.datas = new List(); rogueSaveData2.BestRun = new RogueSaveDataData(); } else { rogueSaveData2 = rogueSaveData; } return rogueSaveData2; } public void GameOver() { if (gameOver) { return; } ((Component)this).gameObject.SetActive(true); if ((Object)(object)sman == (Object)null) { sman = MonoSingleton.Instance; } int @int = MonoSingleton.Instance.GetInt("difficulty", 0); gameOver = true; sman.StopTimer(); sman.HideShit(); MonoSingleton.Instance.controlTimeScale = false; savedTime = sman.seconds; savedKills = sman.kills; savedStyle = Plugin.items.Count; if (savedStyle < 0) { savedStyle = 0; } ActivateNextWave val = Object.FindObjectOfType(); savedWaves = RogueDifficultyManager.Instance.floor; previousBest = GetBest(); bestWaveText.text = Mathf.FloorToInt((float)previousBest.BestRun.Floor) + $"\n{CalculatePerc(previousBest.BestRun.Floor)}%"; bestKillsText.text = previousBest.BestRun.Kills.ToString() ?? ""; bestStyleText.text = previousBest.BestRun.ItemsGotten.ToString() ?? ""; int num = 0; float num2; for (num2 = previousBest.BestRun.Time; num2 >= 60f; num2 -= 60f) { num++; } bestTimeText.text = num + ":" + num2.ToString("00.000"); if (sman.majorUsed || MonoSingleton.Instance.cheatsEnabled) { return; } if (savedWaves > (float)previousBest.BestRun.Floor) { NewBest(); } else if (!(savedWaves < (float)previousBest.BestRun.Floor)) { if (savedKills > previousBest.BestRun.Kills) { NewBest(); } else if (savedKills >= previousBest.BestRun.Kills && savedStyle > previousBest.BestRun.ItemsGotten) { NewBest(); } } } private void NewBest() { previousBest.BestRun.Kills = savedKills; previousBest.BestRun.ItemsGotten = savedStyle; previousBest.BestRun.Floor = (int)savedWaves; previousBest.BestRun.Time = savedTime; PlayerPrefs.SetString("RogueModeBest", JsonConvert.SerializeObject((object)previousBest)); PlayerPrefs.Save(); newBest = true; } private void Update() { //IL_073f: Unknown result type (might be due to invalid IL or missing references) //IL_047e: Unknown result type (might be due to invalid IL or missing references) //IL_0494: Expected O, but got Unknown //IL_05a9: Unknown result type (might be due to invalid IL or missing references) //IL_05bf: Expected O, but got Unknown //IL_0314: Unknown result type (might be due to invalid IL or missing references) //IL_032a: Expected O, but got Unknown //IL_06af: Unknown result type (might be due to invalid IL or missing references) //IL_06c5: Expected O, but got Unknown if (gameOver) { if ((Object)(object)timeController == (Object)null) { timeController = MonoSingleton.Instance; } if (timeController.timeScale > 0f) { timeController.timeScale = Mathf.MoveTowards(timeController.timeScale, 0f, Time.unscaledDeltaTime * (timeController.timeScale + 0.01f)); Time.timeScale = timeController.timeScale * timeController.timeScaleModifier; MonoSingleton.Instance.allSound.SetFloat("allPitch", timeController.timeScale); if (timeController.timeScale < 0.1f) { MonoSingleton.Instance.forceOff = true; MonoSingleton.Instance.allSound.SetFloat("allVolume", MonoSingleton.Instance.CalculateVolume(timeController.timeScale * 10f * MonoSingleton.Instance.sfxVolume)); MonoSingleton.Instance.musicSound.SetFloat("allVolume", MonoSingleton.Instance.CalculateVolume(timeController.timeScale * 10f * MonoSingleton.Instance.musicVolume)); } MonoSingleton.Instance.musicSound.SetFloat("allPitch", timeController.timeScale); MonoSingleton.Instance.volume = 0.5f + timeController.timeScale / 2f; if (timeController.timeScale <= 0f) { Appear(); MonoSingleton.Instance.forcedOff = true; MonoSingleton.Instance.StopMusic(); } } } if (countTime) { if (savedTime >= checkedSeconds) { if (savedTime > checkedSeconds) { float num = savedTime - checkedSeconds; checkedSeconds += Time.unscaledDeltaTime * 20f + Time.unscaledDeltaTime * num * 1.5f; seconds += Time.unscaledDeltaTime * 20f + Time.unscaledDeltaTime * num * 1.5f; } if (checkedSeconds >= savedTime || skipping) { checkedSeconds = savedTime; seconds = savedTime; minutes = 0f; while (seconds >= 60f) { seconds -= 60f; minutes += 1f; } countTime = false; ((Component)timeText).GetComponent().Stop(); ((MonoBehaviour)this).StartCoroutine(InvokeRealtimeCoroutine(new UnityAction(Appear), timeBetween * 2f)); } if (seconds >= 60f) { seconds -= 60f; minutes += 1f; } timeText.text = minutes + ":" + seconds.ToString("00.000"); } } else if (countWaves) { if (savedWaves >= checkedWaves) { if (savedWaves > checkedWaves) { checkedWaves += Time.unscaledDeltaTime * 20f + Time.unscaledDeltaTime * (savedWaves - checkedWaves) * 1.5f; } if (checkedWaves >= savedWaves || skipping) { checkedWaves = savedWaves; countWaves = false; ((Component)waveText).GetComponent().Stop(); totalPoints += Mathf.FloorToInt(savedWaves) * 100; ((MonoBehaviour)this).StartCoroutine(InvokeRealtimeCoroutine(new UnityAction(Appear), timeBetween * 2f)); } waveText.text = Mathf.FloorToInt(checkedWaves) + $"\n{CalculatePerc(savedWaves)}%"; } } else if (countKills) { if ((float)savedKills >= checkedKills) { if ((float)savedKills > checkedKills) { checkedKills += Time.unscaledDeltaTime * 20f + Time.unscaledDeltaTime * ((float)savedKills - checkedKills) * 1.5f; } if (checkedKills >= (float)savedKills || skipping) { checkedKills = savedKills; countKills = false; ((Component)killsText).GetComponent().Stop(); ((MonoBehaviour)this).StartCoroutine(InvokeRealtimeCoroutine(new UnityAction(Appear), timeBetween * 2f)); } killsText.text = checkedKills.ToString("0"); } } else if (countStyle && (float)savedStyle >= checkedStyle) { float num2 = checkedStyle; if ((float)savedStyle > checkedStyle) { checkedStyle += Time.unscaledDeltaTime * 2500f + Time.unscaledDeltaTime * ((float)savedStyle - checkedStyle) * 1.5f; } if (checkedStyle >= (float)savedStyle || skipping) { checkedStyle = savedStyle; countStyle = false; ((Component)styleText).GetComponent().Stop(); ((MonoBehaviour)this).StartCoroutine(InvokeRealtimeCoroutine(new UnityAction(Appear), timeBetween * 2f)); totalPoints += savedStyle; } styleText.text = checkedStyle.ToString("0"); } if (flashFade) { flashColor.a = Mathf.MoveTowards(flashColor.a, 0f, Time.unscaledDeltaTime * 0.5f); ((Graphic)flashPanel).color = flashColor; if (flashColor.a <= 0f) { flashFade = false; } } if (gameOver) { if ((Object)(object)timeController == (Object)null) { timeController = MonoSingleton.Instance; } if ((Object)(object)opm == (Object)null) { opm = MonoSingleton.Instance; } if (opm.paused && !wasPaused) { wasPaused = true; } else if (!opm.paused && wasPaused) { wasPaused = false; MonoSingleton.Instance.allSound.SetFloat("allPitch", 0f); MonoSingleton.Instance.allSound.SetFloat("allVolume", MonoSingleton.Instance.CalculateVolume(timeController.timeScale * 10f * MonoSingleton.Instance.sfxVolume)); MonoSingleton.Instance.musicSound.SetFloat("allPitch", 0f); MonoSingleton.Instance.musicSound.SetFloat("allVolume", MonoSingleton.Instance.CalculateVolume(timeController.timeScale * 10f * MonoSingleton.Instance.musicVolume)); } if (!MonoSingleton.Instance.PerformingCheatMenuCombo() && (MonoSingleton.Instance.InputSource.Fire1.WasPerformedThisFrame || MonoSingleton.Instance.InputSource.Jump.WasPerformedThisFrame) && complete && !opm.paused) { SceneHelper.LoadScene("Main Menu", false); } else if (timeController.timeScale <= 0f && !MonoSingleton.Instance.PerformingCheatMenuCombo() && (MonoSingleton.Instance.InputSource.Fire1.WasPerformedThisFrame || MonoSingleton.Instance.InputSource.Jump.WasPerformedThisFrame) && !complete && !opm.paused) { skipping = true; timeBetween = 0.01f; } } } private int CalculatePerc(float value) { return Mathf.FloorToInt((value - (float)Mathf.FloorToInt(value)) * 100f); } private static string TruncateUsername(string value, int maxChars) { if (value.Length > maxChars) { return value.Substring(0, maxChars); } return value; } public void Appear() { //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Expected O, but got Unknown //IL_037a: Unknown result type (might be due to invalid IL or missing references) //IL_038a: Expected O, but got Unknown //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Expected O, but got Unknown //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Expected O, but got Unknown //IL_0345: Unknown result type (might be due to invalid IL or missing references) //IL_035b: Expected O, but got Unknown if (i < toAppear.Length) { if (skipping) { HudOpenEffect component = toAppear[i].GetComponent(); if ((Object)(object)component != (Object)null) { component.skip = true; } } if ((Object)(object)toAppear[i] == (Object)(object)((Component)timeText).gameObject) { if (skipping) { checkedSeconds = savedTime; seconds = savedTime; minutes = 0f; while (seconds >= 60f) { seconds -= 60f; minutes += 1f; } AudioSourceExtensions.SetPlayOnAwake(((Component)timeText).GetComponent(), false); ((MonoBehaviour)this).StartCoroutine(InvokeRealtimeCoroutine(new UnityAction(Appear), timeBetween * 2f)); timeText.text = minutes + ":" + seconds.ToString("00.000"); } else { countTime = true; } } else if ((Object)(object)toAppear[i] == (Object)(object)((Component)killsText).gameObject) { if (skipping) { checkedKills = savedKills; AudioSourceExtensions.SetPlayOnAwake(((Component)killsText).GetComponent(), false); ((MonoBehaviour)this).StartCoroutine(InvokeRealtimeCoroutine(new UnityAction(Appear), timeBetween * 2f)); killsText.text = checkedKills.ToString("0"); } else { countKills = true; } } else if ((Object)(object)toAppear[i] == (Object)(object)((Component)waveText).gameObject) { if (skipping) { checkedWaves = savedWaves; AudioSourceExtensions.SetPlayOnAwake(((Component)waveText).GetComponent(), false); ((MonoBehaviour)this).StartCoroutine(InvokeRealtimeCoroutine(new UnityAction(Appear), timeBetween * 2f)); waveText.text = Mathf.FloorToInt(savedWaves) + $"\n{CalculatePerc(savedWaves)}%"; } else { countWaves = true; } } else if ((Object)(object)toAppear[i] == (Object)(object)((Component)styleText).gameObject) { if (skipping) { checkedStyle = savedStyle; styleText.text = checkedStyle.ToString("0"); AudioSourceExtensions.SetPlayOnAwake(((Component)styleText).GetComponent(), false); ((MonoBehaviour)this).StartCoroutine(InvokeRealtimeCoroutine(new UnityAction(Appear), timeBetween * 2f)); } else { countStyle = true; } } else { ((MonoBehaviour)this).StartCoroutine(InvokeRealtimeCoroutine(new UnityAction(Appear), timeBetween)); } toAppear[i].gameObject.SetActive(true); i++; } else { if (newBest) { GameObject gameObject = ((Component)bestWaveText.transform.parent.parent.parent.GetChild(1)).gameObject; FlashPanel(gameObject); AudioSourceExtensions.Play(gameObject.GetComponent(), true); bestWaveText.text = waveText.text; bestKillsText.text = killsText.text; bestStyleText.text = styleText.text; bestTimeText.text = timeText.text; } if (!complete) { complete = true; GameProgressSaver.AddMoney(totalPoints); } } } public void FlashPanel(GameObject panel) { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) if (flashFade) { flashColor.a = 0f; ((Graphic)flashPanel).color = flashColor; } flashPanel = panel.GetComponent(); flashColor = ((Graphic)flashPanel).color; flashColor.a = 1f; ((Graphic)flashPanel).color = flashColor; flashFade = true; } [IteratorStateMachine(typeof(d__14))] private IEnumerator InvokeRealtimeCoroutine(UnityAction action, float seconds) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__14(0) { <>4__this = this, action = action, seconds = seconds }; } } public enum RoomType { Normal, Start, Boss, Treasure, Shop, Gambling } public class Room : MonoBehaviour { [CompilerGenerated] private sealed class <>c__DisplayClass22_0 { public GameObject bossInst; internal void b__1() { Object.Destroy((Object)(object)bossInst); } } [CompilerGenerated] private sealed class <>c__DisplayClass34_0 { public GameObject eixt; public Portal port; internal void b__0(IPortalTraveller IP, PortalTravelDetails D) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Invalid comparison between Unknown and I4 if ((int)IP.travellerType == 1) { Object.Destroy((Object)(object)eixt); RoomGenerator.Instance.RegenerateRooms(); Object.Destroy((Object)(object)((Component)port).gameObject); } } } [CompilerGenerated] private sealed class d__22 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Room <>4__this; private int 5__1; private List 5__2; private List 5__3; private bool 5__4; private List.Enumerator <>s__5; private BossEntry 5__6; private <>c__DisplayClass22_0 <>8__7; private Vector3 5__8; private EnemyIdentifier 5__9; private Enemy 5__10; private int 5__11; private float 5__12; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__22(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__2 = null; 5__3 = null; <>s__5 = default(List.Enumerator); 5__6 = null; <>8__7 = null; 5__9 = null; 5__10 = null; <>1__state = -2; } private bool MoveNext() { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Expected O, but got Unknown //IL_0429: Unknown result type (might be due to invalid IL or missing references) //IL_0433: Expected O, but got Unknown //IL_04ab: Unknown result type (might be due to invalid IL or missing references) //IL_04b5: Expected O, but got Unknown //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: 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_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_038c: Unknown result type (might be due to invalid IL or missing references) //IL_0393: Invalid comparison between Unknown and I4 //IL_039b: Unknown result type (might be due to invalid IL or missing references) //IL_03a2: Invalid comparison between Unknown and I4 //IL_03c5: Unknown result type (might be due to invalid IL or missing references) //IL_03cf: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>4__this.CloseOffRoom(); <>2__current = (object)new WaitForSeconds(0.5f); <>1__state = 1; return true; case 1: <>1__state = -1; if (<>4__this.bossEnemyType == null || <>4__this.bossEnemyType.waves == null || <>4__this.bossEnemyType.waves.Count == 0) { Debug.LogError((object)"[Room] BossPick has no waves defined."); return false; } 5__1 = 0; goto IL_04e6; case 2: <>1__state = -1; 5__4 = 5__3.Any((EnemyIdentifier e) => (Object)(object)e != (Object)null && !e.dead); goto IL_0474; case 3: { <>1__state = -1; goto IL_04c5; } IL_04e6: if (5__1 < <>4__this.bossEnemyType.waves.Count) { Debug.Log((object)$"[Room] Starting Boss Wave {5__1 + 1}/{<>4__this.bossEnemyType.waves.Count}"); 5__2 = <>4__this.bossEnemyType.waves[5__1]; 5__3 = new List(); <>s__5 = 5__2.GetEnumerator(); try { while (<>s__5.MoveNext()) { 5__6 = <>s__5.Current; <>8__7 = new <>c__DisplayClass22_0(); if ((Object)(object)5__6.prefab == (Object)null) { continue; } 5__8 = ((Component)<>4__this).transform.position + Vector3.up * 1f + new Vector3(Random.Range(-4f, 4f), 0f, Random.Range(-4f, 4f)); <>8__7.bossInst = Object.Instantiate(5__6.prefab, 5__8, 5__6.prefab.transform.rotation); <>8__7.bossInst.transform.parent = ((Component)<>4__this).transform; 5__9 = <>8__7.bossInst.GetComponent() ?? <>8__7.bossInst.GetComponentInChildren(); if ((Object)(object)5__9 != (Object)null) { 5__3.Add(5__9); if (5__6.healthMod != 0f || 5__6.healthPerFloorMod != 0f) { 5__10 = FindEnemyComponent(<>8__7.bossInst); 5__11 = Mathf.Max(0, RogueDifficultyManager.Instance.floor - 5__6.startFloor); 5__12 = 5__6.healthMod + 5__6.healthPerFloorMod * (float)5__11; 5__9.health = 5__12; 5__10.health = 5__12; 5__10.originalHealth = 5__12; 5__10 = null; } <>4__this.bossEnemyType.onSpawn?.Invoke(5__9); if ((Object)(object)((Component)5__9).gameObject.GetComponent() == (Object)null) { ((Component)5__9).gameObject.AddComponent(); } if ((int)5__9.enemyType == 16 || (int)5__9.enemyType == 28) { 5__9.onDeath.AddListener((UnityAction)delegate { Object.Destroy((Object)(object)<>8__7.bossInst); }); } } <>8__7 = null; 5__9 = null; 5__6 = null; } } finally { ((IDisposable)<>s__5).Dispose(); } <>s__5 = default(List.Enumerator); 5__4 = true; goto IL_0474; } <>4__this.hasSpawnedEnemies = true; return false; IL_0474: if (5__4) { <>2__current = (object)new WaitForSeconds(0.15f); <>1__state = 2; return true; } if (5__1 < <>4__this.bossEnemyType.waves.Count - 1) { <>2__current = (object)new WaitForSeconds(0.25f); <>1__state = 3; return true; } goto IL_04c5; IL_04c5: 5__2 = null; 5__3 = null; 5__1++; goto IL_04e6; } } 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__21 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Room <>4__this; private int 5__1; private EnemyType 5__2; private int 5__3; private int 5__4; private int 5__5; private int 5__6; private List 5__7; private int 5__8; private int 5__9; private int 5__10; private GameObject 5__11; private float 5__12; private int 5__13; private Transform 5__14; private Vector3 5__15; private GameObject 5__16; private EnemyIdentifier 5__17; private int 5__18; private BaseItem 5__19; private int 5__20; private int 5__21; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__21(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__7 = null; 5__11 = null; 5__14 = null; 5__16 = null; 5__17 = null; 5__19 = null; <>1__state = -2; } private bool MoveNext() { //IL_03d9: Unknown result type (might be due to invalid IL or missing references) //IL_03de: Unknown result type (might be due to invalid IL or missing references) //IL_03ea: Unknown result type (might be due to invalid IL or missing references) //IL_03b8: 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_0121: Unknown result type (might be due to invalid IL or missing references) //IL_041c: Unknown result type (might be due to invalid IL or missing references) //IL_0470: Unknown result type (might be due to invalid IL or missing references) //IL_0475: Unknown result type (might be due to invalid IL or missing references) //IL_047a: Unknown result type (might be due to invalid IL or missing references) //IL_0487: Unknown result type (might be due to invalid IL or missing references) //IL_0497: Unknown result type (might be due to invalid IL or missing references) //IL_03fc: 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_040b: Unknown result type (might be due to invalid IL or missing references) //IL_0410: Unknown result type (might be due to invalid IL or missing references) //IL_0415: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Expected O, but got Unknown //IL_0321: Unknown result type (might be due to invalid IL or missing references) //IL_032b: Expected O, but got Unknown //IL_02a8: Unknown result type (might be due to invalid IL or missing references) //IL_02b8: Unknown result type (might be due to invalid IL or missing references) //IL_02bf: Invalid comparison between Unknown and I4 switch (<>1__state) { default: return false; case 0: <>1__state = -1; if (<>4__this.SpawnCredits == 0) { return false; } <>4__this.CloseOffRoom(); <>4__this.playerHealthAtFightStart = MonoSingleton.Instance.hp; <>4__this.SpawnCredits = Mathf.RoundToInt((float)<>4__this.SpawnCredits * RogueDifficultyManager.Instance.Difficulty); <>4__this.SpawnCredits = Mathf.Max(<>4__this.SpawnCredits, 3); Plugin.Logger.LogInfo((object)$"Room has {<>4__this.SpawnCredits} spawn credits because difficulty is {RogueDifficultyManager.Instance.Difficulty}"); isFighting = true; 5__1 = 0; goto IL_0621; case 1: <>1__state = -1; goto IL_0368; case 2: { <>1__state = -1; goto IL_0368; } IL_0368: 5__14 = <>4__this.spawnPoints[<>4__this.enemyRando.Next(0, <>4__this.spawnPoints.Count)]; if ((Object)(object)5__14 == (Object)null) { Debug.LogWarning((object)$"[Room] No fitting spawn point for {5__2} — skipping this unit."); } else { 5__15 = 5__14.position; if (<>4__this.isFlying(5__2)) { 5__15 += Vector3.up * 3f; } 5__15 += new Vector3((float)(<>4__this.enemyRando.NextDouble() * 4.0 - 2.0), 0f, (float)(<>4__this.enemyRando.NextDouble() * 4.0 - 2.0)); 5__16 = Object.Instantiate(5__11, 5__15, 5__11.transform.rotation); 5__16.transform.parent = ((Component)<>4__this).transform; if (5__7.Count > 0) { 5__17 = 5__16.GetComponent(); if ((Object)(object)5__17 == (Object)null) { 5__17 = 5__16.GetComponentInChildren(); } 5__18 = 5__7[0]; 5__7.RemoveAt(0); 5__21 = 0; while (5__21 < 5__18) { 5__17.BuffAll(); 5__21++; } 5__19 = Plugin.getItem("Agonized Mask"); 5__20 = Plugin.GetItemCount(5__19); if (5__20 > 0 && Random.value <= 0.25f + 0.1f * (float)5__20) { 5__17.puppet = true; } 5__17 = null; 5__19 = null; } 5__14 = null; 5__16 = null; } 5__13++; goto IL_05fb; IL_05fb: if (5__13 < 5__5) { 5__1++; if (5__1 <= 25) { <>2__current = (object)new WaitForSeconds(0.05f); <>1__state = 1; return true; } <>2__current = (object)new WaitForSeconds(0.05f / (float)(5__1 - 24)); <>1__state = 2; return true; } 5__7 = null; 5__11 = null; goto IL_0621; IL_0621: while (true) { if (<>4__this.SpawnCredits > 0) { 5__2 = (EnemyType)<>4__this.enemyRando.Next(0, Enum.GetValues(typeof(EnemyType)).Length); if (!RogueDifficultyManager.Instance.CanSpawn(5__2)) { continue; } 5__3 = RogueDifficultyManager.Instance.GetCost(5__2); if (<>4__this.SpawnCredits - 5__3 >= 0) { 5__4 = Mathf.FloorToInt((float)(<>4__this.SpawnCredits / 5__3)); 5__5 = <>4__this.enemyRando.Next(1, 5__4 + 1); <>4__this.SpawnCredits -= 5__5 * 5__3; 5__6 = RogueDifficultyManager.Instance.GetCountBeforeRadiance(5__2); 5__7 = new List(); 5__8 = 5__6; 5__9 = 5__5; 5__10 = 1; while (5__9 >= 5__8) { 5__7.Add(5__10); 5__9 -= 5__8; 5__12 = (float)5__8 * Mathf.Sqrt((float)5__6); 5__8 = Mathf.RoundToInt(5__12); 5__10++; } 5__5 = 5__9 + 5__7.Count; 5__11 = MonoSingleton.Instance.GetEnemyPrefab(5__2); if ((int)5__2 == 40) { 5__11 = AssetsManager.funnyPowerIntroSpawn; } if (!((Object)(object)5__11 == (Object)null)) { break; } } continue; } <>4__this.hasSpawnedEnemies = true; return false; } 5__13 = 0; goto IL_05fb; } } 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__34 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Portal port; public GameObject eixt; public Room <>4__this; private <>c__DisplayClass34_0 <>8__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__34(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = null; <>1__state = -2; } private bool MoveNext() { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Expected O, but got Unknown //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>8__1 = new <>c__DisplayClass34_0(); <>8__1.eixt = eixt; <>8__1.port = port; <>2__current = (object)new WaitForEndOfFrame(); <>1__state = 1; return true; case 1: <>1__state = -1; if (<>8__1.port.onExitTravel == null) { <>8__1.port.onExitTravel = new UnityEventPortalTravel(); } ((UnityEvent)(object)<>8__1.port.onExitTravel).AddListener((UnityAction)delegate(IPortalTraveller IP, PortalTravelDetails D) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Invalid comparison between Unknown and I4 if ((int)IP.travellerType == 1) { Object.Destroy((Object)(object)<>8__1.eixt); RoomGenerator.Instance.RegenerateRooms(); Object.Destroy((Object)(object)((Component)<>8__1.port).gameObject); } }); 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 Vector2Int position; public float spawnChance; public Transform exitLeft; public Transform exitRight; public Transform exitTop; public Transform exitBottom; public int SpawnCredits = 0; public List spawnPoints = new List(); public RoomType roomType = RoomType.Normal; public static int roomIndex; private Random enemyRando; public BossPick bossEnemyType; public GameObject doorPrefab; public GameObject wallPrefab; private bool hasSpawnedEnemies = false; private bool rewardGiven = false; public static bool isFighting; private int playerHealthAtFightStart = -1; private bool tookNoDamage = true; public bool isBossRoom => roomType == RoomType.Boss; public void OnRoomEnter() { switch (roomType) { case RoomType.Boss: ((MonoBehaviour)this).StartCoroutine(SpawnBoss()); break; case RoomType.Normal: ((MonoBehaviour)this).StartCoroutine(SpawnEnemies()); break; case RoomType.Start: case RoomType.Treasure: case RoomType.Shop: case RoomType.Gambling: break; } } [IteratorStateMachine(typeof(d__21))] private IEnumerator SpawnEnemies() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__21(0) { <>4__this = this }; } [IteratorStateMachine(typeof(d__22))] private IEnumerator SpawnBoss() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__22(0) { <>4__this = this }; } public static Enemy FindEnemyComponent(GameObject obj) { if ((Object)(object)obj == (Object)null) { return null; } Enemy component = obj.GetComponent(); if ((Object)(object)component != (Object)null) { return component; } component = obj.GetComponentInChildren(true); if ((Object)(object)component != (Object)null) { return component; } return obj.GetComponentInParent(); } public void CreateDoor(Transform exit) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) GameObject val = null; if ((Object)(object)doorPrefab != (Object)null) { val = Object.Instantiate(doorPrefab, exit.position, exit.rotation * Quaternion.Euler(0f, 90f, 0f), ((Component)this).transform); } if ((Object)(object)val != (Object)null && roomType != 0 && roomType != RoomType.Boss && roomType != RoomType.Start && !(Random.value <= 0.75f)) { ((Component)val.GetComponentInChildren()).gameObject.AddComponent(); } } public void CreateWall(Transform exit) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)wallPrefab != (Object)null) { Object.Instantiate(wallPrefab, exit.position, exit.rotation, ((Component)this).transform); } } public void DisableExit(Transform exit) { ((Component)exit).gameObject.SetActive(false); } public void CloseOffRoom() { Door[] array = Object.FindObjectsByType((FindObjectsInactive)1, (FindObjectsSortMode)0); foreach (Door val in array) { val.Lock(); } } private void Awake() { //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) enemyRando = new Random(Plugin.GameSeed.GetHashCode() ^ (roomIndex + 1)); roomIndex++; ((Component)this).gameObject.AddComponent(); bossEnemyType = RogueDifficultyManager.Instance.GetBoss(); DeathZone[] componentsInChildren = ((Component)this).GetComponentsInChildren(); foreach (DeathZone val in componentsInChildren) { val.respawnTarget = spawnPoints[Random.Range(0, spawnPoints.Count)].position; } } private void Update() { if (tookNoDamage && hasSpawnedEnemies && playerHealthAtFightStart < MonoSingleton.Instance.hp) { tookNoDamage = false; } if (hasSpawnedEnemies && !rewardGiven) { EnemyIdentifier[] componentsInChildren = ((Component)this).GetComponentsInChildren(); EnemyIdentifier[] array = componentsInChildren.Where((EnemyIdentifier x) => !x.dead).ToArray(); if (array.Length == 0) { OnRoomCleared(); } } } private bool isFlying(EnemyType type) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) List list = new List { (EnemyType)1, (EnemyType)5, (EnemyType)38 }; return list.Contains(type); } private void OnRoomCleared() { //IL_02c4: Unknown result type (might be due to invalid IL or missing references) //IL_02ec: Unknown result type (might be due to invalid IL or missing references) //IL_02f1: Unknown result type (might be due to invalid IL or missing references) //IL_02f6: Unknown result type (might be due to invalid IL or missing references) //IL_02fd: Unknown result type (might be due to invalid IL or missing references) //IL_0304: Expected O, but got Unknown //IL_030b: 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_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Expected O, but got Unknown //IL_0181: Unknown result type (might be due to invalid IL or missing references) MonoSingleton.Instance.ArenaMusicEnd(); MonoSingleton.Instance.SlowDown(0.15f); MonoSingleton.Instance.ClearAll(); GasolineProjectile[] array = Object.FindObjectsByType((FindObjectsInactive)1, (FindObjectsSortMode)0); GasolineProjectile[] array2 = array; foreach (GasolineProjectile val in array2) { Object.Destroy((Object)(object)((Component)val).gameObject); } rewardGiven = true; isFighting = false; if (!isBossRoom) { if (Plugin.SelectedChar.GetType() != typeof(V1)) { int hp = MonoSingleton.Instance.hp; int maxHealth = Plugin.MaxHealth; if (hp < maxHealth) { float num = 1f - (float)hp / (float)maxHealth; float num2 = Mathf.Lerp(0.1f, 0.65f, num); if (Random.value <= num2) { int num3 = Random.Range(5, 50); MonoSingleton.Instance.GetHealth(num3, false, false, true); } } } float num4 = (tookNoDamage ? 0.05f : 0.015f); if (enemyRando.NextDouble() <= (double)num4) { Vector3 val2 = ((Component)this).transform.position + new Vector3(Random.Range(-2f, 2f), 1f, Random.Range(-2f, 2f)); GameObject val3 = new GameObject("ItemDropAnchor"); val3.transform.position = val2; ItemPickup.CreatePickup(Plugin.GiveRandomItem(), val3.transform); Debug.Log((object)"[Room] Bonus item dropped on room clear."); } else { float num5 = (float)enemyRando.NextDouble() + (tookNoDamage ? 0.2f : 0f); float num6 = Mathf.Min(0.75f + (float)RogueDifficultyManager.Instance.Keys * 0.08f, 0.97f); if (!(num5 <= 0.22f)) { if (num5 <= num6) { int num7 = enemyRando.Next(1, tookNoDamage ? 4 : 3); for (int j = 0; j < num7; j++) { RogueDifficultyManager.Instance.Gold++; } if (tookNoDamage) { Debug.Log((object)$"[Room] Flawless clear! Awarded {num7} gold."); } } else { RogueDifficultyManager.Instance.Keys++; if (tookNoDamage) { Debug.Log((object)"[Room] Flawless clear! Awarded a key."); } } } } } else { Vector3 val4 = ((Component)this).transform.position + new Vector3(Random.Range(-2f, 2f), 1f, Random.Range(-2f, 2f)); GameObject val5 = new GameObject("aaaaaaaaaaaa"); val5.transform.position = val4; ItemPickup.CreatePickupConditional(Plugin.GiveRandomItem(), val5.transform, delegate { CreatePortal(); return true; }); MonoSingleton.Instance.FullHeal(false); } Door[] array3 = Object.FindObjectsByType((FindObjectsInactive)1, (FindObjectsSortMode)0); Lockable lockable = default(Lockable); foreach (Door val6 in array3) { if (!((Component)val6).TryGetComponent(ref lockable) || !lockable.locked) { val6.Unlock(); } } } public void CreatePortal() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Expected O, but got Unknown //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("PortalEntry"); val.transform.position = GameObject.Find("PortalPlace").transform.position; val.transform.Rotate(90f, 0f, 0f); GameObject val2 = new GameObject("PortalExit"); val2.transform.position = GameObject.Find("PortalPos").transform.position; val2.transform.Rotate(-90f, 0f, 0f); Portal val3 = val.AddComponent(); val3.shape = (IPortalShape)(object)new PlaneShape { width = 10f, height = 10f }; val3.entry = val2.transform; val3.exit = val.transform; val3.supportInfiniteRecursion = true; val3.appearsInRecursions = true; val3.canSeeItself = true; val3.clippingMethod = (PortalClippingMethod)0; val3.maxRecursions = 3; val3.renderSettings = (PortalSideFlags)6; val3.useFogEnter = true; val3.useFogExit = true; val3.canSeePortalLayer = true; PortalIdentifier val4 = val2.AddComponent(); val4.isTraversable = true; GameObject.Find("PortalPlace").SetActive(false); ((MonoBehaviour)this).StartCoroutine(funnies(val3, val2)); } [IteratorStateMachine(typeof(d__34))] private IEnumerator funnies(Portal port, GameObject eixt) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__34(0) { <>4__this = this, port = port, eixt = eixt }; } public Vector3 GetOffset(Transform exit) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) float num = Vector3.Distance(exit.position, ((Component)this).transform.position); Vector3 val = exit.position - ((Component)this).transform.position; Vector3 normalized = ((Vector3)(ref val)).normalized; return normalized * num; } } public class RoomGenerator : MonoBehaviour { [CompilerGenerated] private sealed class <>c__DisplayClass23_0 { public GameObject quad1; public GameObject quad2; public RoomGenerator <>4__this; internal void b__1(IPortalTraveller IP, PortalTravelDetails D) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Invalid comparison between Unknown and I4 if ((int)IP.travellerType == 1) { ((MonoBehaviour)<>4__this).StartCoroutine(<>4__this.StartThingggg(quad1, quad2)); } } } [CompilerGenerated] private sealed class <>c__DisplayClass34_0 { public NavMeshSurface surface; internal bool b__0() { return (Object)(object)surface.navMeshData != (Object)null; } } [CompilerGenerated] private sealed class d__23 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public bool firstTime; public RoomGenerator <>4__this; private int 5__1; private Vector2Int 5__2; private int 5__3; private int 5__4; private int 5__5; private Vector2Int 5__6; private int 5__7; private int 5__8; private int 5__9; private Vector2Int 5__10; private <>c__DisplayClass23_0 <>8__11; private Portal 5__12; private PortalIdentifier 5__13; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__23(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__11 = null; 5__12 = null; 5__13 = null; <>1__state = -2; } private bool MoveNext() { //IL_0550: Unknown result type (might be due to invalid IL or missing references) //IL_055a: Expected O, but got Unknown //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Expected O, but got Unknown //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Expected O, but got Unknown //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0109: 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_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0352: Unknown result type (might be due to invalid IL or missing references) //IL_035c: Expected O, but got Unknown //IL_037b: Unknown result type (might be due to invalid IL or missing references) //IL_03b6: Unknown result type (might be due to invalid IL or missing references) //IL_03c0: Expected O, but got Unknown //IL_03e9: Unknown result type (might be due to invalid IL or missing references) //IL_03ee: Unknown result type (might be due to invalid IL or missing references) //IL_03f3: Unknown result type (might be due to invalid IL or missing references) //IL_0441: Unknown result type (might be due to invalid IL or missing references) //IL_045f: Unknown result type (might be due to invalid IL or missing references) //IL_04cc: Unknown result type (might be due to invalid IL or missing references) //IL_04e4: Unknown result type (might be due to invalid IL or missing references) //IL_0530: Unknown result type (might be due to invalid IL or missing references) //IL_053a: Expected O, but got Unknown //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0191: 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) //IL_027b: Unknown result type (might be due to invalid IL or missing references) //IL_0280: 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_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: 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 WaitUntil((Func)(() => (Object)(object)MonoSingleton.Instance != (Object)null)); <>1__state = 1; return true; case 1: <>1__state = -1; if (!firstTime) { <>2__current = (object)new WaitForSeconds(6f); <>1__state = 2; return true; } goto IL_009b; case 2: <>1__state = -1; goto IL_009b; case 3: { <>1__state = -1; 5__12.onExitTravel = new UnityEventPortalTravel(); ((UnityEvent)(object)5__12.onExitTravel).AddListener((UnityAction)delegate(IPortalTraveller IP, PortalTravelDetails D) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Invalid comparison between Unknown and I4 if ((int)IP.travellerType == 1) { ((MonoBehaviour)<>8__11.<>4__this).StartCoroutine(<>8__11.<>4__this.StartThingggg(<>8__11.quad1, <>8__11.quad2)); } }); RogueDifficultyManager.Instance.MoveStage(); ((MonoBehaviour)<>4__this).StartCoroutine(<>4__this.StartThingggg(<>8__11.quad1, <>8__11.quad2)); <>8__11 = null; 5__12 = null; 5__13 = null; break; } IL_009b: if (<>4__this.roomPrefabs == null || <>4__this.roomPrefabs.Count == 0) { Debug.LogWarning((object)"[RoomGenerator] No room prefabs assigned — skipping generation."); return false; } 5__1 = Mathf.RoundToInt((float)RogueDifficultyManager.RoomRNG.Next(<>4__this.minRooms, <>4__this.maxRooms) * (float)Plugin.CurrentDifficulty); 5__2 = Vector2Int.zero; <>4__this.PlaceRoom(5__2, isStart: true); 5__3 = 1; 5__4 = 0; while (5__3 < 5__1 && 5__4++ < 1000) { 5__6 = <>4__this.directions[RogueDifficultyManager.RoomRNG.Next(0, <>4__this.directions.Length)]; 5__7 = RogueDifficultyManager.RoomRNG.Next(1, 4); 5__9 = 0; while (5__9 < 5__7 && 5__3 < 5__1) { 5__10 = 5__2 + 5__6; if (<>4__this.placedRooms.ContainsKey(5__10)) { break; } <>4__this.PlaceRoom(5__10); 5__2 = 5__10; 5__3++; 5__9++; } 5__8 = RogueDifficultyManager.RoomRNG.Next(1, <>4__this.path.Count); 5__2 = <>4__this.path[<>4__this.path.Count - 1 - Mathf.Min(5__8, <>4__this.path.Count - 1)]; } <>4__this.DesignateBossRoom(); <>4__this.PlaceSpecialRooms(); <>4__this.FinalizeConnections(); <>4__this.BuildNavMesh(); 5__5 = 3; Debug.Log((object)$"[RoomGenerator] Spawned {5__3} combat rooms + {5__5} special rooms + 1 boss room."); if (!firstTime) { <>8__11 = new <>c__DisplayClass23_0(); <>8__11.<>4__this = <>4__this; <>8__11.quad1 = new GameObject("PortalEntry"); <>8__11.quad1.transform.position = new Vector3(0f, 10f, 0f); <>8__11.quad1.transform.Rotate(-90f, 0f, 0f); <>8__11.quad2 = new GameObject("PortalExit"); <>8__11.quad2.transform.position = GameObject.Find("Pit").transform.Find("Cube (2)").position + Vector3.up; <>8__11.quad2.transform.Rotate(-90f, 0f, 0f); 5__12 = <>8__11.quad1.AddComponent(); 5__12.shape = (IPortalShape)(object)new PlaneShape { width = 10f, height = 10f }; 5__12.entry = <>8__11.quad2.transform; 5__12.exit = <>8__11.quad1.transform; 5__12.supportInfiniteRecursion = true; 5__12.appearsInRecursions = true; 5__12.canSeeItself = true; 5__12.clippingMethod = (PortalClippingMethod)0; 5__12.maxRecursions = 3; 5__12.renderSettings = (PortalSideFlags)6; 5__12.useFogEnter = true; 5__12.useFogExit = true; 5__12.canSeePortalLayer = true; 5__13 = <>8__11.quad2.AddComponent(); 5__13.isTraversable = true; <>2__current = (object)new WaitForEndOfFrame(); <>1__state = 3; return 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 d__24 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public GameObject quad1; public GameObject quad2; public RoomGenerator <>4__this; private NewMovement 5__1; private GunControl 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__24(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_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Expected O, but got Unknown //IL_0121: 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_0141: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.5f); <>1__state = 1; return true; case 1: <>1__state = -1; 5__1 = MonoSingleton.Instance; 5__2 = MonoSingleton.Instance; GameStateManager.Instance.PopState("pit-falling"); if (!5__1.activated) { 5__1.activated = true; 5__1.cc.activated = true; 5__1.cc.CameraShake(1f); ((Behaviour)5__1.cc).enabled = true; } 5__2.YesWeapon(); MonoSingleton.Instance.ResetIndex(); MonoSingleton.Instance.Activate(); if (5__1.levelOver) { 5__1.levelOver = false; MonoSingleton.Instance.UnhideShit(); } PlayerActivator.lastActivatedPosition = ((Component)MonoSingleton.Instance).transform.position; MonoSingleton.Instance.YesFist(); quad1.transform.position = Vector3.one * 9999f; quad2.transform.position = Vector3.one * 9999f; <>2__current = (object)new WaitForSeconds(0.5f); <>1__state = 2; return true; case 2: <>1__state = -1; Object.Destroy((Object)(object)quad2); Object.Destroy((Object)(object)quad1); MonoSingleton.Instance.StartTimer(); MonoSingleton.Instance.StartMusic(); 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__34 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public RoomGenerator <>4__this; private <>c__DisplayClass34_0 <>8__1; private SandboxNavmesh 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__34(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = null; 5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Expected O, but got Unknown //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Expected O, but got Unknown //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Expected O, but got Unknown //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Expected O, but got Unknown //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>8__1 = new <>c__DisplayClass34_0(); <>2__current = (object)new WaitForSeconds(0.1f); <>1__state = 1; return true; case 1: <>1__state = -1; if ((Object)(object)MonoSingleton.Instance != (Object)null) { <>2__current = null; <>1__state = 2; return true; } <>8__1.surface = Object.FindObjectOfType(); if ((Object)(object)<>8__1.surface == (Object)null) { <>8__1.surface = ((Component)<>4__this).gameObject.AddComponent(); } <>8__1.surface.navMeshData = null; <>8__1.surface.BuildNavMesh(); <>2__current = (object)new WaitUntil((Func)(() => (Object)(object)<>8__1.surface.navMeshData != (Object)null)); <>1__state = 3; return true; case 2: <>1__state = -1; 5__2 = MonoSingleton.Instance; 5__2.navmeshBuilt = (UnityAction)Delegate.Combine((Delegate?)(object)5__2.navmeshBuilt, (Delegate?)new UnityAction(<>4__this.NavmeshBuilt)); MonoSingleton.Instance.Rebake(); return false; case 3: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.25f); <>1__state = 4; return true; case 4: <>1__state = -1; <>4__this._generationComplete = true; <>4__this.UpdateRoomActivation(); 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(); } } [Header("Generation Settings")] private int minRooms = 5; private int maxRooms = 12; [Header("Room Prefabs")] [Tooltip("Normal combat room prefabs — one is chosen at random per room.")] public List roomPrefabs = new List(); [Tooltip("Optional dedicated prefab for each special room type.\nFalls back to a random roomPrefab when left empty.")] public Room treasureRoomPrefab; public Room shopRoomPrefab; public Room gamblingRoomPrefab; public Room bossRoomPrefab; [Header("Boss Room Settings")] [Tooltip("EnemyType spawned in the boss room.")] public EnemyType bossEnemyType = (EnemyType)18; public Dictionary placedRooms = new Dictionary(); private List path = new List(); private readonly Vector2Int[] directions = (Vector2Int[])(object)new Vector2Int[4] { Vector2Int.up, Vector2Int.down, Vector2Int.left, Vector2Int.right }; [Header("Room Size")] private float roomWidth = 59.5f; private float roomHeight = 30f; [Header("Performance")] [Tooltip("How many grid cells away from the player rooms stay active (1 = current + immediate neighbors).")] private int activationRadius = 2; private bool _generationComplete = false; private float _nextActivationCheck = 0f; private const float ActivationCheckInterval = 0.3f; public static RoomGenerator Instance { get; private set; } private void Awake() { Room.roomIndex = 0; Instance = this; ((MonoBehaviour)this).StartCoroutine(GenerateRooms()); } public void RegenerateRooms() { ((MonoBehaviour)this).StopAllCoroutines(); MonoSingleton.Instance.StopTimer(); MonoSingleton.Instance.StopMusic(); foreach (Room value in placedRooms.Values) { if ((Object)(object)value != (Object)null) { Object.Destroy((Object)(object)((Component)value).gameObject); } } placedRooms.Clear(); path.Clear(); _generationComplete = false; if ((Object)(object)MinimapUI.Instance != (Object)null) { MinimapUI.Instance.ClearAndReset(); } ((MonoBehaviour)this).StartCoroutine(GenerateRooms(firstTime: false)); } [IteratorStateMachine(typeof(d__23))] private IEnumerator GenerateRooms(bool firstTime = true) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__23(0) { <>4__this = this, firstTime = firstTime }; } [IteratorStateMachine(typeof(d__24))] private IEnumerator StartThingggg(GameObject quad1, GameObject quad2) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__24(0) { <>4__this = this, quad1 = quad1, quad2 = quad2 }; } private Transform GetExitFacing(Room room, Vector2Int dir) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) if (dir == Vector2Int.up) { return room.exitTop; } if (dir == Vector2Int.down) { return room.exitBottom; } if (dir == Vector2Int.left) { return room.exitLeft; } if (dir == Vector2Int.right) { return room.exitRight; } return null; } private void AlignRoomToNeighborExit(Room room, Vector2Int gridPos) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004f: 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_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: 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_00c0: 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) Vector2Int[] array = directions; foreach (Vector2Int val in array) { Vector2Int key = gridPos + val; if (placedRooms.TryGetValue(key, out Room value)) { Transform exitFacing = GetExitFacing(value, -val); Transform exitFacing2 = GetExitFacing(room, val); if (!((Object)(object)exitFacing == (Object)null) && !((Object)(object)exitFacing2 == (Object)null)) { float num = exitFacing2.position.y - ((Component)room).transform.position.y; float num2 = exitFacing.position.y - num; Vector3 position = ((Component)room).transform.position; ((Component)room).transform.position = new Vector3(position.x, num2, position.z); break; } } } } private void PlaceRoom(Vector2Int gridPos, bool isStart = false) { //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006d: 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_00ac: 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_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) Room room = (isStart ? roomPrefabs[0] : roomPrefabs[RogueDifficultyManager.RoomRNG.Next(0, roomPrefabs.Count)]); Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor((float)((Vector2Int)(ref gridPos)).x * roomWidth, 0f, (float)((Vector2Int)(ref gridPos)).y * roomHeight); Room room2 = Object.Instantiate(room, val, Quaternion.identity); room2.position = gridPos; room2.roomType = RoomType.Normal; if (isStart) { room2.SpawnCredits = 0; } if (!isStart) { AlignRoomToNeighborExit(room2, gridPos); } placedRooms[gridPos] = room2; path.Add(gridPos); if (isStart) { NewMovement instance = MonoSingleton.Instance; if ((Object)(object)instance != (Object)null) { ((Component)instance).transform.position = val + Vector3.up * 2f; } } } private void PlaceSpecialRooms() { //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_0037: 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) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) List candidates = FindDeadEndCandidates(); for (int num = candidates.Count - 1; num > 0; num--) { int num2 = RogueDifficultyManager.RoomRNG.Next(0, num + 1); List list = candidates; int index = num; List list2 = candidates; int index2 = num2; Vector2Int value = candidates[num2]; Vector2Int value2 = candidates[num]; list[index] = value; list2[index2] = value2; } TryPlaceSpecialRoom(ref candidates, RoomType.Treasure); TryPlaceSpecialRoom(ref candidates, RoomType.Shop); TryPlaceSpecialRoom(ref candidates, RoomType.Gambling); } private List FindDeadEndCandidates() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_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_0042: 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_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0052: 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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) List list = new List(); foreach (Vector2Int key in placedRooms.Keys) { Vector2Int[] array = directions; foreach (Vector2Int val in array) { Vector2Int val2 = key + val; if (placedRooms.ContainsKey(val2)) { continue; } int num = 0; Vector2Int[] array2 = directions; foreach (Vector2Int val3 in array2) { if (placedRooms.ContainsKey(val2 + val3)) { num++; } } if (num == 1 && !list.Contains(val2)) { list.Add(val2); } } } if (list.Count < 3) { Debug.LogWarning((object)("[RoomGenerator] Fewer than 3 dead-end slots found for special rooms " + $"({list.Count} available). Some special rooms may be skipped.")); } return list; } private void TryPlaceSpecialRoom(ref List candidates, RoomType roomType) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0076: 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_0085: 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_008c: 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_025d: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Unknown result type (might be due to invalid IL or missing references) //IL_0272: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Unknown result type (might be due to invalid IL or missing references) Vector2Int pos = Vector2Int.zero; bool flag = false; while (candidates.Count > 0) { pos = candidates[0]; candidates.RemoveAt(0); candidates.RemoveAll(delegate(Vector2Int c) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: 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) Vector2Int[] array2 = directions; foreach (Vector2Int val3 in array2) { if (c == pos + val3) { return true; } } return false; }); bool flag2 = false; Vector2Int[] array = directions; foreach (Vector2Int val in array) { if (placedRooms.TryGetValue(pos + val, out Room value) && value.roomType != 0) { flag2 = true; break; } } if (!flag2) { flag = true; break; } Debug.Log((object)$"[RoomGenerator] Skipping {roomType} candidate {pos} — adjacent to a special room."); } if (!flag) { Debug.LogWarning((object)$"[RoomGenerator] No valid candidate for {roomType} room — skipping."); return; } if (1 == 0) { } Room room = roomType switch { RoomType.Treasure => ((Object)(object)treasureRoomPrefab != (Object)null) ? treasureRoomPrefab : roomPrefabs[RogueDifficultyManager.RoomRNG.Next(0, roomPrefabs.Count)], RoomType.Shop => ((Object)(object)shopRoomPrefab != (Object)null) ? shopRoomPrefab : roomPrefabs[RogueDifficultyManager.RoomRNG.Next(0, roomPrefabs.Count)], RoomType.Gambling => ((Object)(object)gamblingRoomPrefab != (Object)null) ? gamblingRoomPrefab : roomPrefabs[RogueDifficultyManager.RoomRNG.Next(0, roomPrefabs.Count)], _ => roomPrefabs[RogueDifficultyManager.RoomRNG.Next(0, roomPrefabs.Count)], }; if (1 == 0) { } Room room2 = room; Vector3 val2 = default(Vector3); ((Vector3)(ref val2))..ctor((float)((Vector2Int)(ref pos)).x * roomWidth, 0f, (float)((Vector2Int)(ref pos)).y * roomHeight); Room room3 = Object.Instantiate(room2, val2, Quaternion.identity); room3.position = pos; room3.roomType = roomType; if (roomType != RoomType.Boss) { room3.SpawnCredits = 0; } AlignRoomToNeighborExit(room3, pos); placedRooms[pos] = room3; Debug.Log((object)$"[RoomGenerator] {roomType} room placed at grid {pos}."); } private void DesignateBossRoom() { //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_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_0291: Unknown result type (might be due to invalid IL or missing references) //IL_0296: Unknown result type (might be due to invalid IL or missing references) //IL_02a9: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_02eb: 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_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_030f: Unknown result type (might be due to invalid IL or missing references) //IL_0310: Unknown result type (might be due to invalid IL or missing references) //IL_0320: Unknown result type (might be due to invalid IL or missing references) //IL_032d: Unknown result type (might be due to invalid IL or missing references) //IL_033b: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: 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_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) Vector2Int val = Vector2Int.zero; int num = -1; Vector2Int key; foreach (KeyValuePair placedRoom in placedRooms) { if (placedRoom.Key == Vector2Int.zero || placedRoom.Value.roomType != 0) { continue; } int num2 = 0; Vector2Int[] array = directions; foreach (Vector2Int val2 in array) { if (placedRooms.ContainsKey(placedRoom.Key + val2)) { num2++; } } if (num2 != 1) { continue; } bool flag = false; Vector2Int[] array2 = directions; foreach (Vector2Int val3 in array2) { if (placedRooms.TryGetValue(placedRoom.Key + val3, out Room value) && value.roomType != 0 && value.roomType != RoomType.Boss) { flag = true; break; } } if (!flag) { key = placedRoom.Key; int num3 = Mathf.Abs(((Vector2Int)(ref key)).x); key = placedRoom.Key; int num4 = num3 + Mathf.Abs(((Vector2Int)(ref key)).y); if (num4 > num) { num = num4; val = placedRoom.Key; } } } if (num < 0) { Debug.LogWarning((object)"[RoomGenerator] No dead-end normal room found for boss — falling back to farthest normal room."); foreach (KeyValuePair placedRoom2 in placedRooms) { if (!(placedRoom2.Key == Vector2Int.zero) && placedRoom2.Value.roomType == RoomType.Normal) { key = placedRoom2.Key; int num5 = Mathf.Abs(((Vector2Int)(ref key)).x); key = placedRoom2.Key; int num6 = num5 + Mathf.Abs(((Vector2Int)(ref key)).y); if (num6 > num) { num = num6; val = placedRoom2.Key; } } } } if (num < 0) { Debug.LogWarning((object)"[RoomGenerator] Could not find a valid boss room candidate."); return; } Room room = placedRooms[val]; Vector3 position = ((Component)room).transform.position; Object.Destroy((Object)(object)((Component)room).gameObject); placedRooms.Remove(val); Room room2 = (((Object)(object)bossRoomPrefab != (Object)null) ? bossRoomPrefab : roomPrefabs[RogueDifficultyManager.RoomRNG.Next(0, roomPrefabs.Count)]); Room room3 = Object.Instantiate(room2, new Vector3(position.x, 0f, position.z), Quaternion.identity); room3.position = val; room3.roomType = RoomType.Boss; AlignRoomToNeighborExit(room3, val); placedRooms[val] = room3; Debug.Log((object)$"[RoomGenerator] Boss room at grid {val} (Manhattan {num})."); } private void BuildNavMesh() { ((MonoBehaviour)this).StartCoroutine(buildDaMesh()); } private void NavmeshBuilt() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Expected O, but got Unknown SandboxNavmesh instance = MonoSingleton.Instance; instance.navmeshBuilt = (UnityAction)Delegate.Remove((Delegate?)(object)instance.navmeshBuilt, (Delegate?)new UnityAction(NavmeshBuilt)); _generationComplete = true; UpdateRoomActivation(); } [IteratorStateMachine(typeof(d__34))] private IEnumerator buildDaMesh() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__34(0) { <>4__this = this }; } private void FinalizeConnections() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0053: 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_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) foreach (KeyValuePair placedRoom in placedRooms) { Vector2Int key = placedRoom.Key; Room value = placedRoom.Value; HandleExit(value, key, Vector2Int.up, value.exitTop); HandleExit(value, key, Vector2Int.down, value.exitBottom); HandleExit(value, key, Vector2Int.left, value.exitLeft); HandleExit(value, key, Vector2Int.right, value.exitRight); } if ((Object)(object)MinimapUI.Instance != (Object)null) { MinimapUI.Instance.BuildMinimap(placedRooms); } } private void HandleExit(Room room, Vector2Int pos, Vector2Int dir, Transform exit) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_006a: 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_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: 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) if ((Object)(object)exit == (Object)null) { return; } Vector2Int val = pos + dir; if (placedRooms.TryGetValue(val, out Room value)) { Transform exitFacing = GetExitFacing(value, -dir); if ((Object)(object)exitFacing == (Object)null) { room.CreateWall(exit); return; } float num = Mathf.Abs(exit.position.y - exitFacing.position.y); if (num > 0.1f) { room.CreateWall(exit); Debug.LogWarning((object)$"[RoomGenerator] Exit mismatch at {pos} → {val} (ΔY={num:F2}) → wall placed."); } else if (IsSpecialRoomPriority(room.roomType, value.roomType) || (room.roomType == value.roomType && IsPrimary(pos, val))) { room.CreateDoor(exit); } else { room.DisableExit(exit); } } else { room.CreateWall(exit); } } private void Update() { if (_generationComplete && !(Time.time < _nextActivationCheck)) { _nextActivationCheck = Time.time + 0.3f; UpdateRoomActivation(); } } private void UpdateRoomActivation() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) NewMovement instance = MonoSingleton.Instance; if ((Object)(object)instance == (Object)null) { return; } Vector2Int val = WorldToGrid(((Component)instance).transform.position); foreach (KeyValuePair placedRoom in placedRooms) { if (!((Object)(object)placedRoom.Value == (Object)null)) { Vector2Int key = placedRoom.Key; int num = Mathf.Abs(((Vector2Int)(ref key)).x - ((Vector2Int)(ref val)).x); key = placedRoom.Key; int num2 = num + Mathf.Abs(((Vector2Int)(ref key)).y - ((Vector2Int)(ref val)).y); bool flag = num2 <= activationRadius; if (((Component)placedRoom.Value).gameObject.activeSelf != flag) { ((Component)placedRoom.Value).gameObject.SetActive(flag); } } } } public Vector2Int WorldToGrid(Vector3 worldPos) { //IL_0000: 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_0024: Unknown result type (might be due to invalid IL or missing references) return new Vector2Int(Mathf.RoundToInt(worldPos.x / roomWidth), Mathf.RoundToInt(worldPos.z / roomHeight)); } private bool IsSpecialRoomPriority(RoomType mine, RoomType theirs) { return mine != 0 && theirs == RoomType.Normal; } private bool IsPrimary(Vector2Int a, Vector2Int b) { return (((Vector2Int)(ref a)).x != ((Vector2Int)(ref b)).x) ? (((Vector2Int)(ref a)).x < ((Vector2Int)(ref b)).x) : (((Vector2Int)(ref a)).y < ((Vector2Int)(ref b)).y); } } public class ShopItem : MonoBehaviour { public BaseItem item; public int cost = 3; private bool purchased = false; private float messageCooldown = 0f; private void Start() { if ((float)RogueDifficultyManager.ItemRNG.NextDouble() >= 0.5f) { ItemPickup.CreatePickupConditional(Plugin.GiveRandomItem(), ((Component)this).transform, delegate { RogueDifficultyManager instance4 = RogueDifficultyManager.Instance; if ((Object)(object)instance4 == (Object)null) { return false; } if (instance4.Gold >= cost) { purchased = true; instance4.Gold -= cost; HudMessageReceiver instance5 = MonoSingleton.Instance; if (instance5 != null) { instance5.SendHudMessage($"Bought: {item} (-{cost} gold)", "", "", 0, false, false, true); } return true; } if (messageCooldown <= 0f) { HudMessageReceiver instance6 = MonoSingleton.Instance; if (instance6 != null) { instance6.SendHudMessage($"Need {cost} gold (you have {instance4.Gold})", "", "", 0, false, false, true); } messageCooldown = 2f; return false; } return false; }); return; } WeaponPickupRogue.CreatePickupConditional(((Component)this).transform, delegate { RogueDifficultyManager instance = RogueDifficultyManager.Instance; if ((Object)(object)instance == (Object)null) { return false; } if (instance.Gold >= cost) { purchased = true; instance.Gold -= cost; HudMessageReceiver instance2 = MonoSingleton.Instance; if (instance2 != null) { instance2.SendHudMessage($"Bought: {item} (-{cost} gold)", "", "", 0, false, false, true); } return true; } if (messageCooldown <= 0f) { HudMessageReceiver instance3 = MonoSingleton.Instance; if (instance3 != null) { instance3.SendHudMessage($"Need {cost} gold (you have {instance.Gold})", "", "", 0, false, false, true); } messageCooldown = 2f; return false; } return false; }); } private void Update() { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) if (!purchased) { if (messageCooldown > 0f) { messageCooldown -= Time.deltaTime; } if (!(Vector3.Distance(((Component)MonoSingleton.Instance).transform.position, ((Component)this).transform.position) > 2f)) { } } } public static ShopItem CreateShopItem(BaseItem item, Vector3 position, int cost = 3) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //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) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0052: 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_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_0110: 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) GameObject val = GameObject.CreatePrimitive((PrimitiveType)0); ((Object)val).name = "ShopItem"; val.GetComponent().enabled = false; val.transform.position = position + Vector3.up * 2f; val.transform.localScale = Vector3.one * 0.55f; ApplyMaterial(val, new Color(1f, 0.82f, 0.1f)); ShopItem shopItem = val.AddComponent(); shopItem.item = item; shopItem.cost = cost; int num = Mathf.Min(cost, 5); for (int i = 0; i < num; i++) { GameObject val2 = GameObject.CreatePrimitive((PrimitiveType)3); ((Object)val2).name = $"PricePip_{i}"; val2.transform.SetParent(val.transform); val2.transform.localPosition = new Vector3(0f, 1.4f + (float)i * 0.35f, 0f); val2.transform.localScale = new Vector3(0.25f, 0.2f, 0.25f); val2.GetComponent().enabled = false; ApplyMaterial(val2, new Color(0.9f, 0.15f, 0.1f)); } return shopItem; } private static void ApplyMaterial(GameObject go, Color color) { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Expected O, but got Unknown Renderer component = go.GetComponent(); if (!((Object)(object)component == (Object)null)) { Shader val = (((Object)(object)MonoSingleton.Instance != (Object)null) ? MonoSingleton.Instance.masterShader : Shader.Find("Standard")); component.material = new Material(val) { color = color }; } } } public static class UtilsRogue { private static Font _gameFont; private static Sprite _levelPanel; private static Sprite _hellmapArrow; private static Material _metalDec20; public static Font gameFont { get { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_gameFont == (Object)null) { _gameFont = Addressables.LoadAssetAsync((object)"Assets/Fonts/VCR_OSD_MONO_1.001.ttf").WaitForCompletion(); } return _gameFont; } } public static Sprite levelPanel { get { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_levelPanel == (Object)null) { _levelPanel = Addressables.LoadAssetAsync((object)"Assets/Textures/UI/meter.png").WaitForCompletion(); } return _levelPanel; } } public static Sprite hellmapArrow { get { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_hellmapArrow == (Object)null) { _hellmapArrow = Addressables.LoadAssetAsync((object)"Assets/Textures/UI/arrow.png").WaitForCompletion(); } return _hellmapArrow; } } public static Material metalDec20 { get { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_metalDec20 == (Object)null) { _metalDec20 = Addressables.LoadAssetAsync((object)"Assets/Materials/Environment/Metal/Metal Decoration 20.mat").WaitForCompletion(); } return _metalDec20; } } public static void SetPlayerWorldRotation(Quaternion newRotation) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) ((Component)MonoSingleton.Instance).transform.rotation = newRotation; float x = ((Component)MonoSingleton.Instance).transform.localEulerAngles.x; float rotationX = x; if (x <= 90f && x >= 0f) { rotationX = 0f - x; } else if (x >= 270f && x <= 360f) { rotationX = Mathf.Lerp(0f, 90f, Mathf.InverseLerp(360f, 270f, x)); } Quaternion rotation = ((Component)MonoSingleton.Instance).transform.rotation; float y = ((Quaternion)(ref rotation)).eulerAngles.y; MonoSingleton.Instance.rotationX = rotationX; MonoSingleton.Instance.rotationY = y; } } public static class UnityUtilsRogue { [CompilerGenerated] private sealed class d__0 : IEnumerable, IEnumerable, IEnumerator, IEnumerator, IDisposable where T : notnull, Component { private int <>1__state; private object <>2__current; private int <>l__initialThreadId; private Transform parent; public Transform <>3__parent; private IEnumerator <>s__1; private Transform 5__2; private T 5__3; private IEnumerator <>s__4; private T 5__5; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__0(int <>1__state) { this.<>1__state = <>1__state; <>l__initialThreadId = Environment.CurrentManagedThreadId; } [DebuggerHidden] void IDisposable.Dispose() { int num = <>1__state; if ((uint)(num - -4) <= 1u || (uint)(num - 1) <= 1u) { try { if (num == -4 || num == 2) { try { } finally { <>m__Finally2(); } } } finally { <>m__Finally1(); } } <>s__1 = null; 5__2 = null; 5__3 = default(T); <>s__4 = null; 5__5 = default(T); <>1__state = -2; } private bool MoveNext() { //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Expected O, but got Unknown try { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>s__1 = parent.GetEnumerator(); <>1__state = -3; goto IL_013b; case 1: <>1__state = -3; goto IL_00a5; case 2: { <>1__state = -4; 5__5 = default(T); goto IL_010c; } IL_013b: if (<>s__1.MoveNext()) { 5__2 = (Transform)<>s__1.Current; if (((Component)5__2).TryGetComponent(ref 5__3)) { <>2__current = 5__3; <>1__state = 1; return true; } goto IL_00a5; } <>m__Finally1(); <>s__1 = null; return false; IL_00a5: <>s__4 = GetComponentsInChildrenRecursive(5__2).GetEnumerator(); <>1__state = -4; goto IL_010c; IL_010c: if (<>s__4.MoveNext()) { 5__5 = (T)<>s__4.Current; <>2__current = 5__5; <>1__state = 2; return true; } <>m__Finally2(); <>s__4 = null; 5__3 = default(T); 5__2 = null; goto IL_013b; } } catch { //try-fault ((IDisposable)this).Dispose(); throw; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } private void <>m__Finally1() { <>1__state = -1; if (<>s__1 is IDisposable disposable) { disposable.Dispose(); } } private void <>m__Finally2() { <>1__state = -3; if (<>s__4 is IDisposable disposable) { disposable.Dispose(); } } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } [DebuggerHidden] IEnumerator IEnumerable.GetEnumerator() { d__0 d__; if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId) { <>1__state = 0; d__ = this; } else { d__ = new d__0(0); } d__.parent = <>3__parent; return d__; } [DebuggerHidden] IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable)this).GetEnumerator(); } } [IteratorStateMachine(typeof(d__0<>))] public static IEnumerable GetComponentsInChildrenRecursive(Transform parent) where T : Component { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__0(-2) { <>3__parent = parent }; } public static T GetComponentInChildrenRecursive(Transform parent) where T : Component { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown T result = default(T); foreach (Transform item in parent) { Transform val = item; if (((Component)val).TryGetComponent(ref result)) { return result; } T componentInChildrenRecursive = GetComponentInChildrenRecursive(val); if ((Object)(object)componentInChildrenRecursive != (Object)null) { return componentInChildrenRecursive; } } return default(T); } } namespace Ultrarogue { public static class BundleLoader { private static bool alrLoaded; public static string EpicScene => Path.Combine(Application.temporaryCachePath, "Ultrarogue"); public static void Load() { //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) if (alrLoaded) { return; } if (Directory.Exists(EpicScene)) { Directory.Delete(EpicScene, recursive: true); } Directory.CreateDirectory(EpicScene); Addressables.ResourceManager.InternalIdTransformFunc = delegate(IResourceLocation location) { string internalId = location.InternalId; return internalId.Contains("Ultrarogue.Bundleloader.EpicScene") ? internalId.Replace("Ultrarogue.Bundleloader.EpicScene", EpicScene) : internalId; }; Assembly assembly = typeof(Plugin).Assembly; string[] manifestResourceNames = assembly.GetManifestResourceNames(); foreach (string text in manifestResourceNames) { string path = (text.StartsWith("Ultrarogue.catalogStuff.") ? text.Substring("Ultrarogue.catalogStuff.".Length) : text); string path2 = Path.Combine(EpicScene, path); using Stream stream = assembly.GetManifestResourceStream(text); using FileStream destination = File.Create(path2); stream.CopyTo(destination); } Addressables.LoadContentCatalogAsync(Path.Combine(EpicScene, "catalog.json"), true, (string)null).WaitForCompletion(); alrLoaded = true; } } [BepInPlugin("com.bananastudio.ultrarogue", "My first plugin", "1.0.0")] public class Plugin : BaseUnityPlugin { public enum Weapon { Revolver, Shotgun, Nailgun, Railcannon, RocketLauncher, Arm } public enum Variant { Blue, Green, Red } [CompilerGenerated] private sealed class <>c__DisplayClass44_0 { public AsyncOperationHandle RogueButtonPref; public AsyncOperationHandle RogueMenu; public TMP_InputField seedField; public Plugin <>4__this; public TMP_Text info; public TMP_Text cName; public GameObject men; internal bool b__0() { return RogueButtonPref.IsDone; } internal bool b__2() { return RogueMenu.IsDone; } internal void b__3() { if (SelectedChar == null) { Logger.LogError((object)"[Play] SelectedChar is null!"); } else { LoadLevel(seedField.text); } } internal void b__4() { <>4__this.Previous(info, cName); } internal void b__5() { <>4__this.Next(info, cName); } internal void b__6() { men.SetActive(true); GameObject.Find("Chapter Select").SetActive(false); } internal void b__7() { ((Component)men.transform.Find("Back").parent.parent.Find("Chapter Select")).gameObject.SetActive(true); men.SetActive(false); } } [CompilerGenerated] private sealed class d__44 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Plugin <>4__this; private <>c__DisplayClass44_0 <>8__1; private GameObject 5__2; private GameObject 5__3; private GameObject 5__4; private Button 5__5; private Button 5__6; private Button 5__7; private TMP_Dropdown 5__8; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__44(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = null; 5__2 = null; 5__3 = null; 5__4 = null; 5__5 = null; 5__6 = null; 5__7 = null; 5__8 = null; <>1__state = -2; } private bool MoveNext() { //IL_007b: 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_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Expected O, but got Unknown //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_025a: Expected O, but got Unknown //IL_0392: Unknown result type (might be due to invalid IL or missing references) //IL_039c: Expected O, but got Unknown //IL_03b4: Unknown result type (might be due to invalid IL or missing references) //IL_03be: Expected O, but got Unknown //IL_03d6: Unknown result type (might be due to invalid IL or missing references) //IL_03e0: Expected O, but got Unknown //IL_0411: Unknown result type (might be due to invalid IL or missing references) //IL_041b: Expected O, but got Unknown //IL_0173: 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_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>8__1 = new <>c__DisplayClass44_0(); <>8__1.<>4__this = <>4__this; CurrentDifficulty = 1; <>2__current = null; <>1__state = 1; return true; case 1: <>1__state = -1; <>8__1.RogueButtonPref = Addressables.LoadAssetAsync((object)"Assets/Modding/RogueMode/RogueMode.prefab"); <>2__current = (object)new WaitUntil((Func)(() => <>8__1.RogueButtonPref.IsDone)); <>1__state = 2; return true; case 2: <>1__state = -1; 5__2 = ((IEnumerable)Object.FindObjectsByType((FindObjectsInactive)1, (FindObjectsSortMode)0)).FirstOrDefault((Func)((GameObject x) => ((Object)x).name.Contains("Chapters"))); if ((Object)(object)5__2 == (Object)null) { Logger.LogError((object)"[SpawnThings] Could not find a GameObject whose name contains 'Chapters'. Aborting."); return false; } 5__3 = Object.Instantiate(<>8__1.RogueButtonPref.Result, 5__2.transform); ((Component)5__3.transform.Find("RankPanel/RankText")).GetComponent().text = <>4__this.GetBest().BestRun.Floor.ToString(); <>8__1.RogueMenu = Addressables.LoadAssetAsync((object)"Assets/Modding/RogueMode/RogueMenu.prefab"); <>2__current = (object)new WaitUntil((Func)(() => <>8__1.RogueMenu.IsDone)); <>1__state = 3; return true; case 3: <>1__state = -1; 5__4 = ((Component)Object.FindObjectOfType()).gameObject; <>8__1.men = Object.Instantiate(<>8__1.RogueMenu.Result, 5__4.transform); <>8__1.men.SetActive(false); <>8__1.seedField = ((Component)<>8__1.men.transform.Find("SeedField")).GetComponent(); ((UnityEvent)((Component)<>8__1.men.transform.Find("Play")).GetComponent