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 System.Text; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Logging; using GameConsole; using GameConsole.CommandTree; using HarmonyLib; using Microsoft.CodeAnalysis; using Newtonsoft.Json; using Steamworks; using TMPro; using ULTRAKILL.Portal; using ULTRAKILL.Portal.Geometry; using Ultrarogue; using Ultrarogue.Characters; using Ultrarogue.Curses; using Ultrarogue.Items; using Ultrarogue.SceneStuff; using Unity.AI.Navigation; using UnityEngine; using UnityEngine.AI; using UnityEngine.AddressableAssets; using UnityEngine.AddressableAssets.ResourceLocators; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.ResourceManagement.AsyncOperations; using UnityEngine.ResourceManagement.ResourceLocations; using UnityEngine.ResourceManagement.ResourceProviders; using UnityEngine.SceneManagement; using UnityEngine.UI; using plog; using plog.Models; [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("0.2.3.0")] [assembly: AssemblyInformationalVersion("0.2.3+fefdf11faa407d49dd21cf7032a5c015073a078f")] [assembly: AssemblyProduct("ULTRAROGUE")] [assembly: AssemblyTitle("Ultrarogue")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.2.3.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [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] [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] [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 { public static List descriptors = new List(); public static Material weaponMat; public static GameObject Agony; public static GameObject Tundra; public static GameObject MirrorReaper; public static GameObject VirtueBeam; public static GameObject BreakParticle; public static Dictionary> enemiesByType = new Dictionary>(); public static Dictionary> enemiesByClass = 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 GameObject zapThingy; public static GameObject spawnEffect; public static GameObject healingEffect; public static AudioClip StalkerWarning; public static AudioClip FilthAttack; public static Sprite ArmFeedbacker; public static Sprite ArmKnuckleBlaster; public static Sprite ArmWhiplash; private static Material _alchemyMat; 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_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0154: 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) //IL_017c: 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_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) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_021e: 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_0247: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) //IL_0270: 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)VirtueBeam == (Object)null) { VirtueBeam = Addressables.LoadAssetAsync((object)"Virtue Insignia").WaitForCompletion(); } if ((Object)(object)BreakParticle == (Object)null) { BreakParticle = Addressables.LoadAssetAsync((object)"Assets/Particles/Breaks/BreakParticle.prefab").WaitForCompletion(); } if ((Object)(object)Agony == (Object)null) { Agony = Addressables.LoadAssetAsync((object)"Assets/Prefabs/Enemies/SwordsMachine Agony.prefab").WaitForCompletion(); } if ((Object)(object)healingEffect == (Object)null) { healingEffect = Addressables.LoadAssetAsync((object)"Assets/Particles/HealingEffect.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)zapThingy == (Object)null) { zapThingy = Addressables.LoadAssetAsync((object)"Assets/Particles/HitSparkElectricity.prefab").WaitForCompletion(); } if ((Object)(object)spawnEffect == (Object)null) { spawnEffect = Addressables.LoadAssetAsync((object)"Assets/Particles/Spawn Effects/SpawnEffect Melee Hard.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)FilthAttack == (Object)null) { FilthAttack = Addressables.LoadAssetAsync((object)"Assets/Sounds/Enemies/Zombie Weak Death Reverse.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.")); } } private static IEnumerator GetAllSpawnables() { AsyncOperationHandle initHandle = Addressables.InitializeAsync(); yield return initHandle; List allLocations = new List(); foreach (IResourceLocator locator in Addressables.ResourceLocators) { List keys = locator.Keys.ToList(); if (keys.Count != 0) { AsyncOperationHandle> locHandle = Addressables.LoadResourceLocationsAsync((IList)keys, (MergeMode)1, typeof(WeaponDescriptor)); yield return locHandle; if ((int)locHandle.Status == 1) { allLocations.AddRange(locHandle.Result); } Addressables.Release>(locHandle); } } allLocations = (from l in allLocations group l by l.InternalId into g select g.First()).ToList(); Plugin.Logger.LogInfo((object)$"Found {allLocations.Count} WeaponDescriptor locations"); foreach (IResourceLocation location in allLocations) { AsyncOperationHandle loadHandle = Addressables.LoadAssetAsync(location); yield return loadHandle; if ((int)loadHandle.Status == 1) { descriptors.Add(loadHandle.Result); } } OnLoadComplete(); } private static IEnumerator GetAllEnemies() { AsyncOperationHandle initHandle = Addressables.InitializeAsync(); yield return initHandle; List allLocations = new List(); foreach (IResourceLocator locator in Addressables.ResourceLocators) { List keys = locator.Keys.ToList(); if (keys.Count != 0) { AsyncOperationHandle> locHandle = Addressables.LoadResourceLocationsAsync((IList)keys, (MergeMode)1, typeof(SpawnableObject)); yield return locHandle; if ((int)locHandle.Status == 1) { allLocations.AddRange(locHandle.Result); } Addressables.Release>(locHandle); } } allLocations = (from l in allLocations group l by l.InternalId into g select g.First()).ToList(); Plugin.Logger.LogInfo((object)$"Found {allLocations.Count} SpawnableObject locations"); int enemyCount = 0; foreach (IResourceLocation location in allLocations) { AsyncOperationHandle loadHandle = Addressables.LoadAssetAsync(location); yield return loadHandle; if ((int)loadHandle.Status != 1) { continue; } SpawnableObject obj = loadHandle.Result; if ((int)obj.spawnableObjectType == 1) { if (!enemiesByType.ContainsKey(obj.enemyType)) { enemiesByType[obj.enemyType] = new List(); } if (!enemiesByClass.ContainsKey(GetClassName(obj.type))) { enemiesByClass[GetClassName(obj.type)] = new List(); } enemiesByType[obj.enemyType].Add(obj); enemiesByClass[GetClassName(obj.type)].Add(obj); enemyCount++; } } Plugin.Logger.LogInfo((object)$"Loaded {enemyCount} enemy SpawnableObjects across {enemiesByType.Count} type(s)."); foreach (KeyValuePair> kvp in enemiesByType) { Plugin.Logger.LogInfo((object)$" {kvp.Key}: {kvp.Value.Count} variant(s)"); } OnLoadComplete(); } public static string GetClassName(string type) { type = type.Replace("Supreme ", ""); type = type.Replace("Lesser ", ""); type = type.Replace("Greater ", ""); return type; } public static Sprite prefToSprite(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 WeaponDescriptor 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"))); case '1': return source.FirstOrDefault((Func)((WeaponDescriptor x) => x.weaponName.EndsWith("Twirl"))); case '2': return source.FirstOrDefault((Func)((WeaponDescriptor x) => x.weaponName.EndsWith("Ricochet"))); } } 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"))); case '1': return source.FirstOrDefault((Func)((WeaponDescriptor x) => x.weaponName.EndsWith("Pump"))); case '2': return source.FirstOrDefault((Func)((WeaponDescriptor x) => x.weaponName.EndsWith("Saw"))); } } 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"))); case '1': return source.FirstOrDefault((Func)((WeaponDescriptor x) => x.weaponName.EndsWith("Overheat"))); case '2': return source.FirstOrDefault((Func)((WeaponDescriptor x) => x.weaponName.EndsWith("Jumpstart"))); } } 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"))); case '1': return source.FirstOrDefault((Func)((WeaponDescriptor x) => x.weaponName.EndsWith("Harpoon"))); case '2': return source.FirstOrDefault((Func)((WeaponDescriptor x) => x.weaponName.EndsWith("Malicious"))); } } 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"))); case '1': return source.FirstOrDefault((Func)((WeaponDescriptor x) => x.weaponName.EndsWith("Cannonball"))); case '2': return source.FirstOrDefault((Func)((WeaponDescriptor x) => x.weaponName.EndsWith("Napalm"))); } } Plugin.Logger.LogWarning((object)("prefToDescriptor: no match for pref='" + pref + "'")); return descriptors.Find((WeaponDescriptor x) => x.weaponName == "UNKNOWN"); } public static Material getAlchemy() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_alchemyMat == (Object)null) { _alchemyMat = Addressables.LoadAssetAsync((object)"Assets/Modding/RogueMode/balala.mat").WaitForCompletion(); } return _alchemyMat; } 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 { 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 float AliveTime = 0f; public GameObject freezeEffect; public GameObject levelEffect; private bool homingActive = false; private Rigidbody rb; private bool kaboomed = false; private bool super = false; public bool isRocket = false; private float frozenT = 0f; public bool frozen => Object.op_Implicit((Object)(object)MonoSingleton.Instance) && MonoSingleton.Instance.rocketFrozen; 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()); } private IEnumerator ActivateHoming() { yield return (object)new WaitForSeconds(homingDelay); homingActive = true; } private void FixedUpdate() { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_0190: 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_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)freezeEffect != (Object)null) { freezeEffect.SetActive(frozen); } if (frozen && isRocket) { rb.velocity = Vector3.zero; frozenT += Time.deltaTime; if (frozenT >= 0.5f && !super) { levelEffect.SetActive(true); super = true; speed *= 3f; } } else { if (!homingActive) { return; } AliveTime += Time.deltaTime; 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; ((Component)this).transform.up = -normalized; Vector3 velocity = Vector3.Lerp(rb.velocity, normalized * speed, turnSpeed * Time.fixedDeltaTime); rb.velocity = velocity; if (AliveTime >= 20f) { Explode(); } } } 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)0) && !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, super ? (damage * 2f) : damage, false, 0f, (GameObject)null, false, false); } Explode(); } } private void Explode() { //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) Plugin.Logger.LogInfo((object)$"super={super}, frozenT={frozenT}"); GameObject val = (super ? MonoSingleton.Instance.superExplosion : MonoSingleton.Instance.explosion); GameObject val2 = Object.Instantiate(val, ((Component)this).transform.position, Quaternion.identity); Explosion[] componentsInChildren = val2.GetComponentsInChildren(); foreach (Explosion val3 in componentsInChildren) { val3.maxSize = (super ? (explosionRadius * 3f) : explosionRadius); val3.canHit = (AffectedSubjects)2; val3.damage = (super ? (Mathf.RoundToInt(damage) * 4) : (Mathf.RoundToInt(damage) * 2)); } Object.Destroy((Object)(object)((Component)this).gameObject); } } public class BloodMachine : MonoBehaviour { public GameObject BloodObject; public int MinFullThreshold = 3; public int MaxFullThreshold = 10; public int FullThreshold = 10; public Vector3 localPositionPartial; public Vector3 localPositionFull; public UnityEvent onUse; public UnityEvent onFill; private int bloodDonated; private void Awake() { FullThreshold = RogueDifficultyManager.BloodRNG.Next(MinFullThreshold, MaxFullThreshold); } public void BLOOD() { //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) if (Plugin.SelectedChar.HasPassive(Passive.Greedy)) { MonoSingleton.Instance.SendHudMessage("INCOMPATIBLE BLOOD", "", "", 0, false, false, true); return; } Debug.Log((object)$"bloodDonated: {bloodDonated}, FullThreshold: {FullThreshold}"); if (bloodDonated == FullThreshold) { return; } int num = Mathf.FloorToInt((float)Plugin.MaxHealth * 0.25f); if (Plugin.SelectedChar.HasPassive(Passive.HealFromBlood)) { num = Mathf.RoundToInt(55f); } if (MonoSingleton.Instance.hp - num <= 0) { MonoSingleton.Instance.SendHudMessage("NOT ENOUGH BLOOD", "", "", 0, false, false, true); return; } bloodDonated++; onUse.Invoke(); if (bloodDonated == 1) { BloodObject.transform.localPosition = localPositionPartial; } else if (bloodDonated == FullThreshold) { BloodObject.transform.localPosition = localPositionFull; onFill.Invoke(); if (Plugin.SelectedChar.HasPassive(Passive.HealFromBlood)) { ItemPickup.CreatePickup(Plugin.GiveRandomItem(RogueDifficultyManager.BloodRNG, DroptableType.CommonOnly), ((Component)this).transform, 5f); } else { ItemPickup.CreatePickup(Plugin.GiveRandomItem(RogueDifficultyManager.BloodRNG, DroptableType.BloodMachine), ((Component)this).transform, 5f); } } if (Plugin.SelectedChar.GetType() != typeof(Filth)) { MonoSingleton.Instance.GetHurt(num, false, 1f, false, false, 0.35f, true); } else { for (int i = 0; i < num; i++) { MonoSingleton.Instance.GetHurt(1, false, 1f, false, false, 0.35f, true); } } RogueDifficultyManager.Instance.Gold++; } } 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 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 toEnable) { item.SetActive(true); } foreach (GameObject item2 in toDisable) { 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 num2 = 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, (num2 == 0f) ? (-3.051758E-05f) : num2); num2 -= 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, num2); val19.sizeDelta = new Vector2(125f, 45f); num2 -= 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, num2 + 25f); val25.sizeDelta = new Vector2(3f, (float)layersAndLevel.layerLevels.Length * 50f - 27.5f); ((Transform)val25).localScale = Vector3.one; ((Component)val25).gameObject.AddComponent(); for (int num4 = 0; num4 < layersAndLevel.layerLevels.Length; num4++) { 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)num4 * 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 num5 = 5; num5 >= 1; num5--) { Transform val43 = ((Component)componentInChildren).transform.Find($"Secrets Title/Secret {num5}"); 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 num6 = 0; for (int i = 0; i < layer; i++) { num6 += 1 + levelSizes[i]; } return num6 + 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 FloorTheme : MonoBehaviour { [Header("Properties")] public int StartFloor; public string Name; [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; public Room planetariumPrefab; public Room startRoomPrefab; [Tooltip("Other special rooms")] public List specialRoomPrefabs = new List(); [Tooltip("SECRET ROOOMMMS")] public List SecretRoomPrefabs = new List(); [Tooltip("Large room prefabs (RoomSizeWidth > 1 or RoomSizeHeight > 1). These are never instantiated directly — they are used as data sources to spawn sub-room GameObjects that each occupy one grid cell.")] public List largeRoomPrefabs = new List(); public List CalmMusic = new List(); public List UnCalmMusic = new List(); [Header("Room Size")] public float roomWidth = 60f; public float roomHeight = 30f; } public class Gambler : MonoBehaviour { private const float EXPLOSION_BASE_CHANCE = 0.02f; private const float EXPLOSION_CHANCE_RAMP = 0.02f; public GameObject ExplosionWarningThing; public ShopZone zone; private int useCount = 0; private bool exploded = false; private Coroutine activeRoutine = null; private Transform itemPlacementThing; public GameObject Slot1; public GameObject Slot2; public GameObject Slot3; public Texture2D coinText; public Texture2D keyText; private List slots = new List(); private const float ITEM_CHANCE = 0.35f; private const float COIN_CHANCE = 0.2f; private const float KEY_CHANCE = 0.05f; private Texture skullText; private List texts = new List(); private float Threshold = 240f; public void Gamble() { if (exploded || activeRoutine != null) { return; } 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); } } else { instance.Gold--; Spin(); } } 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) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Expected O, but got Unknown 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; } if ((Object)(object)Slot1 == (Object)null) { Slot1 = GetSlot("Slot (1)"); } if ((Object)(object)Slot2 == (Object)null) { Slot2 = GetSlot("Slot (2)"); } if ((Object)(object)Slot3 == (Object)null) { Slot3 = GetSlot("Slot (3)"); } slots.Add(Slot1); slots.Add(Slot2); slots.Add(Slot3); foreach (BaseItem possibleItem in Plugin.possibleItems) { texts.Add(possibleItem.ItemTexture); } skullText = ((Graphic)((Component)Slot1.transform.Find("Slots")).GetComponentInChildren()).mainTexture; texts.Add((Texture2D)skullText); texts.Add(coinText); texts.Add(keyText); foreach (GameObject slot in slots) { Transform parent = slot.transform.Find("Slots"); AssignImage(2, parent, texts[Random.Range(0, texts.Count)]); AssignImage(4, parent, texts[Random.Range(0, texts.Count)]); AssignImage(3, parent, texts[Random.Range(0, texts.Count)]); } } private GameObject GetSlot(string name) { return ((Component)((Component)this).transform.Find("Canvas/Background/Text Inset/" + name)).gameObject; } private void Spin() { activeRoutine = ((MonoBehaviour)this).StartCoroutine(SpinRoutine()); } private void AssignImage(int num, Transform parent, Texture2D text) { Transform val = parent.Find($"RawImage ({num})"); Transform val2 = parent.Find($"RawImage ({num + 3})"); ((Component)val).GetComponent().texture = (Texture)(object)text; ((Component)val2).GetComponent().texture = (Texture)(object)text; } private IEnumerator SpinRoutine() { BaseItem item = null; bool willExplode = false; bool winCoins = false; bool winKeys = false; useCount++; float explosionChance = 0.02f + 0.02f * (float)(useCount - 1); float explosionRoll = Plugin.getChanceVal(RogueDifficultyManager.GambleItemRNG, luckaffected: false); int luck = Plugin.luck; if (luck >= 0) { for (int i = 0; i < luck; i++) { float candidate = (float)RogueDifficultyManager.GambleItemRNG.NextDouble(); if (candidate > explosionRoll) { explosionRoll = candidate; } } } else { for (int j = 0; j < -luck; j++) { float candidate2 = (float)RogueDifficultyManager.GambleItemRNG.NextDouble(); if (candidate2 < explosionRoll) { explosionRoll = candidate2; } } } if (explosionRoll <= explosionChance) { willExplode = true; } else { float rewardRoll = Plugin.getChanceVal(); if (rewardRoll <= 0.35f) { item = Plugin.GiveRandomItem(RogueDifficultyManager.GambleItemRNG); } else if (rewardRoll <= 0.55f) { winCoins = true; } else if (rewardRoll <= 0.6f) { winKeys = true; } } foreach (GameObject s in slots) { Transform ss = s.transform.Find("Slots"); AssignImage(2, ss, texts[Random.Range(0, texts.Count)]); AssignImage(4, ss, texts[Random.Range(0, texts.Count)]); if (willExplode) { AssignImage(3, ss, (Texture2D)skullText); } else if (item != null) { AssignImage(3, ss, item.ItemTexture); } else if (winCoins) { AssignImage(3, ss, coinText); } else if (winKeys) { AssignImage(3, ss, keyText); } else { AssignImage(3, ss, texts[Random.Range(0, texts.Count)]); } } float snapTime = 0.35f; float duration = 1f; float t = 0f; Dictionary slotSpeeds = new Dictionary(); foreach (GameObject slot in slots) { slotSpeeds[slot] = Random.Range(0.7f, 1.3f); } while (t <= duration) { t += Time.deltaTime; float progress = t / duration; float baseSpeed = Mathf.Lerp(10f, 0f, progress); foreach (GameObject slot2 in slots) { Transform s2 = slot2.transform.Find("Slots"); float speed = baseSpeed * slotSpeeds[slot2]; float maxStep = 74f; float step = Mathf.Min(speed * Time.deltaTime, maxStep); s2.position -= Vector3.up * step; if (s2.localPosition.y <= 0f - Threshold) { float offset = s2.localPosition.y + Threshold; s2.localPosition = new Vector3(s2.localPosition.x, offset, s2.localPosition.z); } } yield return null; } t = 0f; while (t <= 1f) { t += Time.deltaTime / snapTime; foreach (GameObject slot3 in slots) { Transform s3 = slot3.transform.Find("Slots"); float position = Mathf.Lerp(s3.localPosition.y, 0f, t); s3.localPosition = new Vector3(s3.localPosition.x, position, s3.localPosition.z); } yield return null; } foreach (GameObject slot4 in slots) { Transform s4 = slot4.transform.Find("Slots"); s4.localPosition = new Vector3(s4.localPosition.x, 0f, s4.localPosition.z); } if (willExplode) { Explode(); } else if (item != null) { ItemPickup.CreatePickup(item, itemPlacementThing, 8f); MonoSingleton.Instance.SendHudMessage("You won an item!", "", "", 0, false, false, true); } else if (winCoins) { RogueDifficultyManager.Instance.Gold++; MonoSingleton.Instance.SendHudMessage("You won a coin!", "", "", 0, false, false, true); } else if (winKeys) { RogueDifficultyManager.Instance.Keys++; MonoSingleton.Instance.SendHudMessage("You won a key!", "", "", 0, false, false, true); } else { MonoSingleton.Instance.SendHudMessage("You lost... try again?", "", "", 0, false, false, true); } activeRoutine = null; } private void Explode() { exploded = true; ((MonoBehaviour)this).StartCoroutine(explosionNumerator()); } private IEnumerator explosionNumerator() { yield return (object)new WaitForSeconds(1.5f); GameObject explosionPrefab = MonoSingleton.Instance.explosion; if ((Object)(object)explosionPrefab != (Object)null) { Object.Instantiate(explosionPrefab, ((Component)this).transform.position, Quaternion.identity); zone.ForceOff(); MonoSingleton.Instance.SetMusicVolume(zone.originalMusicVolume); } Object.Destroy((Object)(object)((Component)this).gameObject); } } 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 { public UltrakillEvent onPickup; public float offset = 3f; public bool forceItem; public bool forceWeapon; public DroptableType tableType; private BaseItem chosenItem; private void Start() { if (Plugin.SelectedChar.GetType() == typeof(Filth)) { forceItem = true; } if (forceItem) { SpawnItem(); } else if (forceWeapon) { SpawnWeapon(); } else if ((float)RogueDifficultyManager.ItemRNG.NextDouble() <= 0.5f) { SpawnItem(); } else { SpawnWeapon(); } } public void SpawnItem() { chosenItem = Plugin.GiveRandomItem(null, tableType); ItemPickup.CreatePickupConditional(chosenItem, ((Component)this).transform, delegate { onPickup.Invoke(""); return true; }, offset); } public void SpawnWeapon() { WeaponPickupRogue.CreatePickupConditional(((Component)this).transform, delegate { onPickup.Invoke(""); return true; }, offset); } } 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); } if (Plugin.SelectedChar.GetType() == typeof(Filth)) { MonoSingleton.Instance.FullHeal(false); } Plugin.GiveItem(item); Object.Destroy((Object)(object)((Component)this).gameObject); } } public static void CreatePickup(BaseItem item, Transform position, float offset = 3f) { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Expected O, but got Unknown //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: 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(Object.op_Implicit((Object)(object)item.materialOverride) ? item.materialOverride : AssetsManager.weaponMat); val2.mainTexture = (Texture)(object)item.ItemTexture; item.OnMaterialApply(val2); ((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_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Expected O, but got Unknown //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_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) //IL_0090: 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) GameObject val = GameObject.CreatePrimitive((PrimitiveType)5); val.GetComponent().enabled = false; val.AddComponent().item = item; val.GetComponent().canPickup = pickupCon; Material val2 = new Material(Object.op_Implicit((Object)(object)item.materialOverride) ? item.materialOverride : 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 enum DroptableType { Shop, RationShop, Planetarium, RandomDrop, Boss, LegendaryOnly, UncommonOnly, CommonOnly, BloodMachine } public class KeyEater : MonoBehaviour { public UnityEvent OnKeyGotten; public UnityEvent OnNoKey; public float DistanceForActivation = 2f; private float cooldown = 1f; private float c = 0f; private bool canUse = true; private void Update() { //IL_001d: 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) c -= Time.deltaTime; if (!(Vector3.Distance(((Component)MonoSingleton.Instance).transform.position, ((Component)this).transform.position) <= DistanceForActivation) || !(c <= 0f) || !canUse) { return; } if (RogueDifficultyManager.Instance.Keys <= 0) { c = 2f; UnityEvent onNoKey = OnNoKey; if (onNoKey != null) { onNoKey.Invoke(); } MonoSingleton.Instance.SendHudMessage("NO KEYS TO GIVE", "", "", 0, false, false, true); return; } RogueDifficultyManager.Instance.Gold++; RogueDifficultyManager.Instance.Keys--; UnityEvent onKeyGotten = OnKeyGotten; if (onKeyGotten != null) { onKeyGotten.Invoke(); } canUse = false; } public void AllowUsageAgain() { canUse = true; } } public class MinimapUI : MonoBehaviour { [Header("References")] public RectTransform minimapPanel; [Header("Layout")] public float cellSize = 16f; [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); public Color colorPlanet = new Color(0f, 0f, 0.95f); [Header("UI Colors")] public Color colorSilhouette = new Color(0.28f, 0.28f, 0.3f); public Color colorCorridor = new Color(0.38f, 0.38f, 0.4f); [Header("Current Room Outline")] [Tooltip("Color of the pulsing outline drawn around the current room.")] public Color colorOutline = new Color(0.95f, 0.95f, 1f); [Tooltip("Extra pixels added to each side of the cell for the outline border.")] public float outlinePadding = 3f; [Header("Direction Arrow")] [Tooltip("Color of the direction arrow drawn on the current room.")] public Color colorArrow = new Color(1f, 1f, 1f, 0.92f); [Tooltip("Arrow size as a fraction of cellSize. 0.5 = half the cell.")] [Range(0.3f, 0.9f)] public float arrowFraction = 0.55f; [Tooltip("Which Transform to read the look direction from. Leave null to fall back to NewMovement.Instance's camera.")] public Transform lookTarget; [Header("Animation")] 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 RectTransform _outlineRT; private Image _outlineImg; private RectTransform _arrowRT; private Image _arrowImg; private static readonly Vector2Int[] Dirs = (Vector2Int[])(object)new Vector2Int[4] { Vector2Int.up, Vector2Int.down, Vector2Int.left, Vector2Int.right }; private Dictionary _placedRooms; private Vector2Int? _manualOverridePos = null; 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; } } public void SetRoomOverride(Vector2Int? pos) { _manualOverridePos = pos; } private void Update() { //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0062: 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_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0078: 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) if (_placedRooms == null || (Object)(object)RoomGenerator.Instance == (Object)null) { return; } NewMovement instance = MonoSingleton.Instance; if (!((Object)(object)instance == (Object)null)) { Vector2Int val = (Vector2Int)(((??)_manualOverridePos) ?? RoomGenerator.Instance.WorldToGrid(((Component)instance).transform.position)); if (val != _currentPos) { _currentPos = val; MarkVisited(val); } _pulseTimer += Time.deltaTime * pulseSpeed; UpdateOutline(); UpdateArrow(); } } public void BuildMinimap(Dictionary placedRooms, HashSet<(Vector2Int, Vector2Int)> validConnections, IReadOnlyDictionary largeRoomAnchorOf = null, IReadOnlyDictionary> largeRoomCells = null) { //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_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_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: 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_01b9: 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_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: 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_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: 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_0214: 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_0218: 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_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0376: Unknown result type (might be due to invalid IL or missing references) //IL_037b: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_0381: Unknown result type (might be due to invalid IL or missing references) //IL_05f4: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_023a: 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_056d: Unknown result type (might be due to invalid IL or missing references) //IL_0571: Unknown result type (might be due to invalid IL or missing references) //IL_0576: Unknown result type (might be due to invalid IL or missing references) //IL_0578: Unknown result type (might be due to invalid IL or missing references) //IL_057d: Unknown result type (might be due to invalid IL or missing references) //IL_0585: Unknown result type (might be due to invalid IL or missing references) //IL_0597: 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_05b3: Unknown result type (might be due to invalid IL or missing references) //IL_05c4: Unknown result type (might be due to invalid IL or missing references) //IL_03aa: Unknown result type (might be due to invalid IL or missing references) //IL_0392: Unknown result type (might be due to invalid IL or missing references) //IL_03e9: Unknown result type (might be due to invalid IL or missing references) //IL_03ee: Unknown result type (might be due to invalid IL or missing references) //IL_04b4: Unknown result type (might be due to invalid IL or missing references) //IL_04bb: Unknown result type (might be due to invalid IL or missing references) //IL_04c0: Unknown result type (might be due to invalid IL or missing references) //IL_04c2: Unknown result type (might be due to invalid IL or missing references) //IL_04c7: Unknown result type (might be due to invalid IL or missing references) //IL_04c9: Unknown result type (might be due to invalid IL or missing references) //IL_04e9: Unknown result type (might be due to invalid IL or missing references) //IL_04ee: Unknown result type (might be due to invalid IL or missing references) //IL_04f3: Unknown result type (might be due to invalid IL or missing references) //IL_04fb: Unknown result type (might be due to invalid IL or missing references) //IL_050d: Unknown result type (might be due to invalid IL or missing references) //IL_0513: Unknown result type (might be due to invalid IL or missing references) //IL_0521: Unknown result type (might be due to invalid IL or missing references) //IL_02c1: Unknown result type (might be due to invalid IL or missing references) //IL_02c8: Unknown result type (might be due to invalid IL or missing references) //IL_02da: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: Unknown result type (might be due to invalid IL or missing references) //IL_02e5: Unknown result type (might be due to invalid IL or missing references) //IL_02ee: 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_030d: 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_053a: Unknown result type (might be due to invalid IL or missing references) //IL_053f: Unknown result type (might be due to invalid IL or missing references) //IL_0547: 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; _outlineRT = null; _outlineImg = null; _arrowRT = null; _arrowImg = null; if ((Object)(object)minimapPanel == (Object)null) { Debug.LogError((object)"[MinimapUI] minimapPanel is not assigned."); return; } int num = int.MaxValue; int num2 = int.MaxValue; int num3 = int.MinValue; int num4 = int.MinValue; foreach (Vector2Int key4 in placedRooms.Keys) { Vector2Int current = key4; 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 (validConnections.Contains((key, val3))) { Vector2Int key2 = key + val3; if (largeRoomAnchorOf == null || !largeRoomAnchorOf.TryGetValue(key, out var value) || !largeRoomAnchorOf.TryGetValue(key2, out var value2) || !(value == value2)) { 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; } } } } CreateOutline(); HashSet hashSet = new HashSet(); foreach (KeyValuePair placedRoom2 in placedRooms) { Vector2Int key3 = placedRoom2.Key; if (largeRoomAnchorOf != null && largeRoomAnchorOf.TryGetValue(key3, out var value3) && largeRoomCells != null && largeRoomCells.TryGetValue(value3, out List value4)) { if (!hashSet.Add(value3)) { continue; } int num12 = int.MaxValue; int num13 = int.MaxValue; int num14 = int.MinValue; int num15 = int.MinValue; foreach (Vector2Int item in value4) { Vector2Int current2 = item; if (((Vector2Int)(ref current2)).x < num12) { num12 = ((Vector2Int)(ref current2)).x; } if (((Vector2Int)(ref current2)).x > num14) { num14 = ((Vector2Int)(ref current2)).x; } if (((Vector2Int)(ref current2)).y < num13) { num13 = ((Vector2Int)(ref current2)).y; } if (((Vector2Int)(ref current2)).y > num15) { num15 = ((Vector2Int)(ref current2)).y; } } int num16 = num14 - num12 + 1; int num17 = num15 - num13 + 1; float num18 = (float)num16 * cellSize + (float)(num16 - 1) * num7; float num19 = (float)num17 * cellSize + (float)(num17 - 1) * num7; Vector2 val5 = GridToPx(new Vector2Int(num12, num13), num5) + val; Vector2 anchoredPos = val5 + new Vector2((num18 - cellSize) / 2f, (num19 - cellSize) / 2f); Image val6 = MakeImage($"Room_{value3}_Large", minimapPanel, anchoredPos, new Vector2(num18, num19)); ((Graphic)val6).color = Color.clear; foreach (Vector2Int item2 in value4) { _cells[item2] = val6; } } else { Vector2 anchoredPos2 = GridToPx(key3, num5) + val; Image val7 = MakeImage($"Room_{key3}", minimapPanel, anchoredPos2, new Vector2(cellSize, cellSize)); ((Graphic)val7).color = Color.clear; _cells[key3] = val7; } } CreateArrow(); 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); _outlineRT = null; _outlineImg = null; _arrowRT = null; _arrowImg = null; } private void CreateOutline() { //IL_0022: 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_003e: Unknown result type (might be due to invalid IL or missing references) float num = cellSize + outlinePadding * 2f; _outlineImg = MakeImage("CurrentOutline", minimapPanel, Vector2.zero, new Vector2(num, num)); ((Graphic)_outlineImg).color = Color.clear; ((Graphic)_outlineImg).raycastTarget = false; _outlineRT = ((Component)_outlineImg).GetComponent(); ((Transform)_outlineRT).SetAsLastSibling(); } private void UpdateOutline() { //IL_001d: 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_004b: 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_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: 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) if (!((Object)(object)_outlineRT == (Object)null)) { if (_cells.TryGetValue(_currentPos, out Image value)) { RectTransform component = ((Component)value).GetComponent(); _outlineRT.anchoredPosition = component.anchoredPosition; Vector2 sizeDelta = component.sizeDelta; _outlineRT.sizeDelta = sizeDelta + new Vector2(outlinePadding * 2f, outlinePadding * 2f); ((Component)_outlineRT).gameObject.SetActive(true); float num = 0.55f + 0.45f * Mathf.Sin(_pulseTimer); ((Graphic)_outlineImg).color = new Color(colorOutline.r, colorOutline.g, colorOutline.b, colorOutline.a * num); } else { ((Component)_outlineRT).gameObject.SetActive(false); } } } private void CreateArrow() { //IL_001c: 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_004a: Unknown result type (might be due to invalid IL or missing references) float num = cellSize * arrowFraction; _arrowImg = MakeImage("PlayerArrow", minimapPanel, Vector2.zero, new Vector2(num, num)); _arrowImg.sprite = BuildArrowSprite(); ((Graphic)_arrowImg).color = colorArrow; ((Graphic)_arrowImg).raycastTarget = false; _arrowRT = ((Component)_arrowImg).GetComponent(); ((Transform)_arrowRT).SetAsLastSibling(); } private void UpdateArrow() { //IL_001a: 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_0085: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_arrowRT == (Object)null)) { if (_cells.TryGetValue(_currentPos, out Image value)) { _arrowRT.anchoredPosition = ((Component)value).GetComponent().anchoredPosition; ((Component)_arrowRT).gameObject.SetActive(true); float lookYaw = GetLookYaw(); ((Transform)_arrowRT).localRotation = Quaternion.Euler(0f, 0f, 0f - lookYaw); } else { ((Component)_arrowRT).gameObject.SetActive(false); } } } private float GetLookYaw() { //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //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) //IL_00ad: 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_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: 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) Transform transform = lookTarget; if ((Object)(object)transform == (Object)null && (Object)(object)MonoSingleton.Instance != (Object)null) { Camera componentInChildren = ((Component)MonoSingleton.Instance).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { transform = ((Component)componentInChildren).transform; } } if ((Object)(object)transform == (Object)null && (Object)(object)MonoSingleton.Instance != (Object)null) { transform = ((Component)MonoSingleton.Instance).transform; } if ((Object)(object)transform == (Object)null) { return 0f; } Vector3 val = Vector3.ProjectOnPlane(transform.forward, Vector3.up); if (((Vector3)(ref val)).sqrMagnitude < 0.001f) { val = Vector3.forward; } return Vector3.SignedAngle(Vector3.forward, val, Vector3.up); } private static Sprite BuildArrowSprite() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Expected O, but got Unknown //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) //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_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0183: 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_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) Texture2D val = new Texture2D(32, 32, (TextureFormat)4, false); ((Texture)val).filterMode = (FilterMode)1; Color clear = Color.clear; Color white = Color.white; for (int i = 0; i < 32; i++) { for (int j = 0; j < 32; j++) { val.SetPixel(j, i, clear); } } for (int k = 0; k < 32; k++) { float num = Mathf.InverseLerp(7.04f, 30f, (float)k); if (!(num < 0f)) { float num2 = Mathf.Lerp(11.2f, 0f, num); int num3 = Mathf.RoundToInt(16f - num2); int num4 = Mathf.RoundToInt(16f + num2); for (int l = num3; l <= num4; l++) { val.SetPixel(l, k, white); } } } int num5 = Mathf.RoundToInt(11.52f); int num6 = Mathf.RoundToInt(20.48f); int num7 = Mathf.RoundToInt(1.28f); int num8 = Mathf.RoundToInt(8.96f); for (int m = num7; m <= num8; m++) { for (int n = num5; n <= num6; n++) { val.SetPixel(n, m, white); } } val.Apply(); return Sprite.Create(val, new Rect(0f, 0f, 32f, 32f), new Vector2(0.5f, 0.5f)); } 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(); } public void RevealAll() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) foreach (KeyValuePair placedRoom in _placedRooms) { MarkVisited(placedRoom.Key); } } private void RefreshAll() { //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_0033: 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_008a: 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_00c1: 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_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0061: 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_00ce: 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_007f: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_016e: 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_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: 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_01bd: 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_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) HashSet hashSet = new HashSet(); foreach (KeyValuePair cell in _cells) { Vector2Int key = cell.Key; Image value = cell.Value; Room value2; Color val = ((key == _currentPos) ? (_placedRooms.TryGetValue(key, out value2) ? (RoomColor(value2.roomType) * 0.9f) : (colorNormal * 0.9f)) : (_visited.Contains(key) ? (RoomColor(_placedRooms[key].roomType) * 0.9f) : ((!_scouted.Contains(key)) ? Color.clear : colorSilhouette))); if (!hashSet.Contains(value)) { ((Graphic)value).color = val; hashSet.Add(value); } else { ((Graphic)value).color = MergeRoomColor(((Graphic)value).color, val); } } foreach (KeyValuePair<(Vector2Int, Vector2Int), Image> corridor in _corridors) { Vector2Int item = corridor.Key.Item1; Vector2Int item2 = corridor.Key.Item2; Image value3 = corridor.Value; bool flag = _visited.Contains(item) || _scouted.Contains(item); bool flag2 = _visited.Contains(item + item2) || _scouted.Contains(item + item2); ((Graphic)value3).color = ((flag && flag2) ? colorCorridor : Color.clear); } } private static Color MergeRoomColor(Color existing, Color incoming) { //IL_0001: 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_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_002d: 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_0029: 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_0046: 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_003f: 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) if (existing.a < 0.01f) { return incoming; } if (incoming.a < 0.01f) { return existing; } float num = ColorSaturation(existing); float num2 = ColorSaturation(incoming); return (num2 >= num) ? incoming : existing; } private static float ColorSaturation(Color c) { //IL_0009: 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_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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) float num = Mathf.Max(new float[3] { c.r, c.g, c.b }); float num2 = Mathf.Min(new float[3] { c.r, c.g, c.b }); return (num < 0.001f) ? 0f : ((num - num2) / num); } private Color RoomColor(RoomType type) { //IL_0027: 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_0030: 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_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_004b: 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_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0069: 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, RoomType.Planetarium => colorPlanet, _ => 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); } } } } public class MuffleTheMusic : MonoBehaviour { private void Awake() { AudioMuffleZone component = ((Component)this).GetComponent(); component.muffleTargets = new List { ((Component)MonoSingleton.Instance.cleanTheme).GetComponent(), ((Component)MonoSingleton.Instance.battleTheme).GetComponent(), ((Component)MonoSingleton.Instance.bossTheme).GetComponent() }; } } [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; public static Random BloodRNG; public static Random ChestRNG; 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; private TMP_Text statFloorText; public static RogueDifficultyManager Instance { get; private set; } private void Awake() { //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Expected O, but got Unknown 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); BloodRNG = new Random((int)Mathf.Log((float)Plugin.GameSeed.GetHashCode(), 2f)); ChestRNG = new Random((int)Mathf.PingPong((float)Plugin.GameSeed.GetHashCode(), 2f)); Instance = this; Difficulty = Plugin.CurrentDifficulty; itemCounts = new Dictionary(); itemUIObjects = new Dictionary(); itemsUI = ((Component)GameObject.Find("Items").transform.Find("Panel")).gameObject; itemsUI.SetActive(true); 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(); if (Plugin.SelectedChar.GetType() == typeof(Filth)) { ((Component)val.Find("StatAtkSpeed")).gameObject.SetActive(false); } statCooldownText = ((Component)val.Find("StatCooldown/Stt")).GetComponent(); statFloorText = ((Component)val.Find("StatFloor/Stt")).GetComponent(); foreach (KeyValuePair item in Plugin.items) { AddItem(item.Key); } GameObject val2 = new GameObject("ItemTooltip"); val2.transform.SetParent(GameObject.Find("Items").transform.root, false); val2.AddComponent(); } 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}"; statFloorText.text = $"{floor}"; } } public void RemoveItem(BaseItem item, int stacksRemoved = 1) { if (item == null) { return; } string itemName = item.ItemName; if (!itemCounts.ContainsKey(itemName)) { return; } itemCounts[itemName] -= stacksRemoved; GameObject value2; if (itemCounts[itemName] <= 0) { itemCounts.Remove(itemName); if (itemUIObjects.TryGetValue(itemName, out GameObject value) && (Object)(object)value != (Object)null) { Object.Destroy((Object)(object)value); } itemUIObjects.Remove(itemName); } else if (itemUIObjects.TryGetValue(itemName, out value2) && (Object)(object)value2 != (Object)null) { TMP_Text componentInChildren = value2.GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { int num = itemCounts[itemName]; componentInChildren.text = ((num > 1) ? $"(x{num})" : ""); } } } 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_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Expected O, but got Unknown //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_021a: 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!")); } if ((Object)(object)item.materialOverride != (Object)null) { ((Graphic)val2).material = item.materialOverride; } ItemHoverHandler itemHoverHandler = val.AddComponent(); itemHoverHandler.Item = item; 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() { Gold = Mathf.Clamp(Gold, 0, 99); 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() { int currentDifficulty = Plugin.CurrentDifficulty; Difficulty *= 1f + 0.1f * (float)currentDifficulty; Plugin.Logger.LogInfo((object)("Before: " + difficultyScaleMult)); 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 <= 15) { switch ((int)enemyType) { default: if ((int)enemyType == 9) { break; } if (enemyType - 13 <= 2) { 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_0072: return 2; IL_006a: return 3; IL_006e: return 4; } 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, 0f, 8f), new BossEntry(AssetsManager.GetEnemiesOfType((EnemyType)0)[0].gameObject, 0f, 8f) })); list.Add(new BossPick(new List { new BossEntry(AssetsManager.GetEnemiesOfType((EnemyType)4)[0].gameObject, 42f) })); list.Add(new BossPick(new List { new BossEntry(AssetsManager.GetEnemiesOfType((EnemyType)24)[0].gameObject, 0f, 18f) })); list.Add(new BossPick(new List { new BossEntry(AssetsManager.GetEnemiesOfType((EnemyType)7)[0].gameObject, 0f, 20f) })); list.Add(new BossPick(new List { new BossEntry(AssetsManager.funnyPowerIntroSpawn, 40f) })); list.Add(new BossPick(new List { new BossEntry(AssetsManager.GetEnemiesOfType((EnemyType)5)[0].gameObject, 0f, 28f) })); break; case 3: case 4: case 5: list.Add(new BossPick(new List { new BossEntry(AssetsManager.GetEnemiesOfType((EnemyType)8)[0].gameObject, 0f, 30f) })); list.Add(new BossPick(new List { new BossEntry(AssetsManager.GetEnemiesOfType((EnemyType)16)[0].gameObject, 65f) })); list.Add(new BossPick(new List { new BossEntry(AssetsManager.GetEnemiesOfType((EnemyType)26)[0].gameObject, 65f) })); list.Add(new BossPick(new List { new BossEntry(AssetsManager.GetEnemiesOfType((EnemyType)19)[0].gameObject, 70f) })); break; case 6: case 7: { list.Add(new BossPick(new List { new BossEntry(AssetsManager.GetEnemiesOfType((EnemyType)26)[0].gameObject, 0f, 30f) })); list.Add(new BossPick(new List { new BossEntry(AssetsManager.GetEnemiesOfType((EnemyType)32)[0].gameObject, 0f, 25f) })); list.Add(new BossPick(new List { new BossEntry(AssetsManager.GetEnemiesOfType((EnemyType)28)[0].gameObject, 0f, 35f) })); list.Add(new BossPick(new List { new BossEntry(AssetsManager.GetEnemiesOfType((EnemyType)25)[0].gameObject, 0f, 30f) })); Enemy A = null; Enemy T = null; list.Add(new BossPick(new List { new BossEntry(AssetsManager.Agony, 0f, 45f), new BossEntry(AssetsManager.Tundra, 0f, 45f) }, 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, 0f, 10f), new BossEntry(AssetsManager.funnyPowerIntroSpawn, 0f, 5f) } })); break; } case 8: case 9: list.Add(new BossPick(new List { new BossEntry(AssetsManager.GetEnemiesOfType((EnemyType)18)[0].gameObject, 40f, 0f, 12f, 8) })); list.Add(new BossPick(new List { new BossEntry(AssetsManager.GetEnemiesOfType((EnemyType)41)[0].gameObject, 0f, 0f, 12f, 8) })); list.Add(new BossPick(new List { new BossEntry(AssetsManager.GetEnemiesOfType((EnemyType)4)[0].gameObject, 80f, 0f, 50f, 8, 2, 0.5f), new BossEntry(AssetsManager.GetEnemiesOfType((EnemyType)4)[0].gameObject, 80f, 0f, 50f, 8, 2, 0.5f) })); break; default: list.Add(new BossPick(new List { new BossEntry(AssetsManager.GetEnemiesOfType((EnemyType)18)[0].gameObject, 55f, 0f, 18f, 8, 0, 0.35f) })); list.Add(new BossPick(new List { new BossEntry(AssetsManager.GetEnemiesOfType((EnemyType)29)[0].gameObject, 170f, 0f, 28f, 8, 0, 0.35f) })); list.Add(new BossPick(new List { new BossEntry(AssetsManager.GetEnemiesOfType((EnemyType)41)[0].gameObject, 0f, 45f, 18f, 8, 0, 1f) })); list.Add(new BossPick(new List { new BossEntry(AssetsManager.GetEnemiesOfType((EnemyType)37)[0].gameObject, 130f, 0f, 18f, 8, 0, 0.5f) })); list.Add(new BossPick(new List { new BossEntry(AssetsManager.GetEnemiesOfType((EnemyType)4)[0].gameObject, 95f, 0f, 60f, 8, 0, 1f), new BossEntry(AssetsManager.GetEnemiesOfType((EnemyType)4)[0].gameObject, 95f, 0f, 60f, 8, 0, 1f) })); 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_00af: Expected I4, but got Unknown switch ((int)enemy) { case 1: case 3: case 13: case 14: case 15: case 31: return true; case 6: return Plugin.SelectedChar.GetType() != typeof(Streetcleaner); case 0: case 4: case 5: case 7: case 12: return floor >= 3; case 21: case 26: return floor >= 5; case 39: return floor >= 5 && floor <= 12; case 16: case 40: return floor >= 6; case 2: case 8: case 19: case 22: return false; case 18: return floor >= 8; default: 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 healthAddition; public float healthPerFloorMod; public int startFloor; public int radianceBuffs; public float radianceBuffsPerFloor; public BossEntry(GameObject prefab, float healthMod = 0f, float healthAddition = 0f, float healthPerFloorMod = 0f, int startFloor = 0, int radianceBuffs = 0, float radianceBuffsPerFloor = 0f) { this.prefab = prefab; this.healthMod = healthMod; this.healthAddition = healthAddition; this.healthPerFloorMod = healthPerFloorMod; this.startFloor = startFloor; this.radianceBuffs = radianceBuffs; this.radianceBuffsPerFloor = radianceBuffsPerFloor; } } public class ItemTooltip : MonoBehaviour { private GameObject panel; private TMP_Text nameText; private TMP_Text descText; private RectTransform rectTransform; public static ItemTooltip Instance { get; private set; } private void Awake() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Expected O, but got Unknown //IL_00d1: 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_00e7: Expected O, but got Unknown //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Expected O, but got Unknown //IL_0183: Unknown result type (might be due to invalid IL or missing references) Instance = this; panel = new GameObject("TooltipPanel"); panel.transform.SetParent(((Component)this).transform, false); Image val = panel.AddComponent(); ((Graphic)val).color = new Color(0f, 0f, 0f, 0.85f); VerticalLayoutGroup val2 = panel.AddComponent(); ((LayoutGroup)val2).padding = new RectOffset(8, 8, 6, 6); ((HorizontalOrVerticalLayoutGroup)val2).spacing = 4f; ((HorizontalOrVerticalLayoutGroup)val2).childForceExpandWidth = true; ((HorizontalOrVerticalLayoutGroup)val2).childForceExpandHeight = false; ContentSizeFitter val3 = panel.AddComponent(); val3.horizontalFit = (FitMode)2; val3.verticalFit = (FitMode)2; rectTransform = panel.GetComponent(); rectTransform.pivot = new Vector2(0f, 1f); GameObject val4 = new GameObject("TooltipName"); val4.transform.SetParent(panel.transform, false); nameText = (TMP_Text)(object)val4.AddComponent(); nameText.fontSize = 16f; nameText.fontStyle = (FontStyles)1; ((Graphic)nameText).color = Color.yellow; GameObject val5 = new GameObject("TooltipDesc"); val5.transform.SetParent(panel.transform, false); descText = (TMP_Text)(object)val5.AddComponent(); descText.fontSize = 13f; ((Graphic)descText).color = Color.white; LayoutElement val6 = val5.AddComponent(); val6.preferredWidth = 220f; Hide(); } public void Show(string itemName, string description, Vector2 screenPos) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) nameText.text = itemName; descText.text = description; panel.SetActive(true); UpdatePosition(screenPos); } public void Hide() { panel.SetActive(false); } private void Update() { //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) if (panel.activeSelf) { UpdatePosition(Vector2.op_Implicit(Input.mousePosition)); } } private void UpdatePosition(Vector2 screenPos) { //IL_0011: 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_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) Vector2 val = default(Vector2); RectTransformUtility.ScreenPointToLocalPointInRectangle(((Component)((Component)this).transform.parent).GetComponent(), screenPos, (Camera)null, ref val); val += new Vector2(12f, -8f); rectTransform.anchoredPosition = val; } } public class ItemHoverHandler : MonoBehaviour, IPointerEnterHandler, IEventSystemHandler, IPointerExitHandler { public BaseItem Item { get; set; } public void OnPointerEnter(PointerEventData eventData) { //IL_0054: Unknown result type (might be due to invalid IL or missing references) if (Item != null && !((Object)(object)ItemTooltip.Instance == (Object)null)) { string description = (string.IsNullOrEmpty(Item.itemDescription) ? "No description available." : Item.itemDescription); ItemTooltip.Instance.Show(Item.ItemName, description, eventData.position); } } public void OnPointerExit(PointerEventData eventData) { ItemTooltip.Instance?.Hide(); } } public class RogueFinalRank : MonoBehaviour { 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 text = PlayerPrefs.GetString("RogueModeBest", ""); RogueSaveData rogueSaveData = JsonConvert.DeserializeObject(text); 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 num = 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() ?? ""; ((Component)((Component)this).transform.Find("Panel/SeedInfo/Text (1)")).GetComponent().text = Plugin.GameSeed; ((Component)((Component)this).transform.Find("Panel/DifficultyInfo/Text (1)")).GetComponent().text = ((Plugin.CurrentDifficulty == 1) ? "Easy" : "Hard"); int num2 = 0; float num3; for (num3 = previousBest.BestRun.Time; num3 >= 60f; num3 -= 60f) { num2++; } bestTimeText.text = num2 + ":" + num3.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; } private IEnumerator InvokeRealtimeCoroutine(UnityAction action, float seconds) { yield return (object)new WaitForSecondsRealtime(seconds); if (action != null) { action.Invoke(); } } } public class RogueTerminal : MonoBehaviour { public GameObject ItemPrefab; public TMP_Text CharacterInfo; public Image ItemInfoImage; public TMP_Text ItemInfoName; public TMP_Text ItemInfoNameName; public TMP_Text ItemInfoInfo; public TMP_Text TipDay; private Dictionary itemButtons = new Dictionary(); private void Awake() { FillItems(); CharacterInfo.text = GetCharacterInfo(); string text = SceneLoader.messages[Random.Range(0, SceneLoader.messages.Length)]; TipDay.text = text; } private string GetCharacterInfo() { BaseCharacter selectedChar = Plugin.SelectedChar; if (selectedChar == null) { return "NO CLASS SELECTED WHAT?"; } StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append("NAME: " + selectedChar.Name + "\n\n"); stringBuilder.Append("DESCRIPTION: " + selectedChar.Description + "\n\n"); stringBuilder.Append("DETAILS: " + selectedChar.Detail + "\n\n"); return stringBuilder.ToString(); } private void FillItem(BaseItem item) { //IL_0067: Unknown result type (might be due to invalid IL or missing references) GameObject val = Object.Instantiate(ItemPrefab); val.transform.SetParent(ItemPrefab.transform.parent, false); ((Component)val.transform.Find("Background/Enemy")).GetComponent().sprite = item.ItemIcon; ((Graphic)((Component)val.transform.Find("Background")).GetComponent()).color = rarityToColor(item.Rarity); itemButtons[item] = val; RefreshItem(item); } public void RefreshItem(BaseItem item) { //IL_009a: 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_00bc: Expected O, but got Unknown //IL_0072: 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_0094: Expected O, but got Unknown if (!itemButtons.TryGetValue(item, out GameObject value)) { return; } Image component = ((Component)value.transform.Find("Background/Enemy")).GetComponent(); Button component2 = value.GetComponent