using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using Nyxpiri.ULTRAKILL.NyxLib; using Nyxpiri.ULTRAKILL.NyxLib.EnemyTypes; using Nyxpiri.Unity.Collections; using UnityEngine; using UnityEngine.Events; using UnityEngine.SceneManagement; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyVersion("0.0.0.0")] namespace Nyxpiri.ULTRAKILL.CybergrindBosses; public static class Assets { internal static void Initialize() { } } public class BlackholeModifier : MonoBehaviour { [HarmonyPatch(typeof(BlackHoleProjectile), "OnTriggerEnter")] public static class BlackHoleProjectileOnTriggerEnterPatch { public static bool Prefix(BlackHoleProjectile __instance, Collider other) { if (!Cheats.Enabled) { return true; } BlackholeModifier component = ((Component)__instance).GetComponent(); if ((Object)(object)component == (Object)null) { return true; } if (!__instance.enemy || __instance.target == null) { return true; } if (!__instance.target.IsTargetTransform(((Component)other).gameObject.transform)) { return true; } __instance.Explode(); NewMovement instance = MonoSingleton.Instance; if (instance.hp > component.KillThreshold) { int num = Mathf.Min(component.Damage, instance.hp - 1); instance.GetHurt(num, true, 1f, false, false, 0.35f, false); instance.ForceAntiHP((float)(100 - instance.hp), false, false, true, false); } else { instance.GetHurt(component.KillThreshold, true, 1f, false, false, 0.35f, false); } return false; } public static void Postfix(BlackHoleProjectile __instance, Collider other) { } } public int KillThreshold = 10; public int Damage = 99; public float RescaleOnStart = 1f; public float SpeedScalar = 1f; public BlackHoleProjectile BlackHole { get; private set; } = null; protected void Start() { //IL_0015: 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) BlackHole = ((Component)this).GetComponent(); Transform transform = ((Component)this).transform; transform.localScale *= RescaleOnStart; BlackHoleProjectile blackHole = BlackHole; blackHole.speed *= SpeedScalar; } } [ConfigureSingleton(/*Could not decode attribute arguments.*/)] public class BossSpawner : MonoSingleton { private int _bossWaveCooldown = 0; private BossPicker _bossPicker = new BossPicker(); private float spawnTimer = 0f; private RegistrationTracker FakeFallRegistrator; public bool IsBossWave => Cheats.IsCheatEnabled("nyxpiri.cybergrind-bosses") && (_bossWaveCooldown <= 0 || !Options.UseBossWaveCooldown.Value); protected void Start() { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown FakeFallRegistrator = new RegistrationTracker((Func)delegate { MonoSingleton.Instance.EnableFakeFall(); return true; }, (Func)delegate { MonoSingleton.Instance.DisableFakeFall(); return true; }); } protected void OnEnable() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown Cybergrind.PostCybergrindNextWave += new CybergrindPostNextWaveEventHandler(NextWave); MonoSingleton.Instance.OnEnemySpawningFinished += OnEnemySpawningFinished; } protected void OnDisable() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown Cybergrind.PostCybergrindNextWave -= new CybergrindPostNextWaveEventHandler(NextWave); MonoSingleton.Instance.OnEnemySpawningFinished -= OnEnemySpawningFinished; } private void NextWave(EventMethodCancelInfo cancelInfo, EndlessGrid endlessGrid) { _bossPicker.ShouldFakeFall = false; if (!Cheats.IsCheatDisabled("nyxpiri.cybergrind-bosses")) { FakeFallRegistrator.Unregister(); if (IsBossWave) { _bossPicker.SolveBossesToSpawn(endlessGrid); _bossWaveCooldown = Random.Range(Options.BossWaveCooldownMin.Value, Options.BossWaveCooldownMax.Value + 1); } else { _bossPicker.TypesToSpawn.Clear(); _bossWaveCooldown--; } _bossPicker.UpdateForceFakeFallCooldown(); if (_bossPicker.ShouldFakeFall) { spawnTimer = 100f; } else { spawnTimer = 0.3f; } if (IsBossWave || !Options.OnlyCountBossWavesTowardsBossCooldowns.Value) { _bossPicker.UpdateBossCooldowns(); } } } private void OnEnemySpawningFinished(CyberArena arena) { if (!Cheats.IsCheatDisabled("nyxpiri.cybergrind-bosses") && _bossPicker.ShouldFakeFall) { SetupFakeFall(arena); } } private void BigHarmlessExplosionAt(Vector3 position) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) GameObject val = Object.Instantiate(Assets.ExplosionPrefab, position, Quaternion.identity); ExplosionAdditions component = val.GetComponent(); component.Harmless = true; component.ExplosionScale = 20f; component.ExplosionSpeedScale = 20f; component.ExplosionPushScale = 0f; val.SetActive(true); foreach (AudioSource audio in component.Audios) { audio.maxDistance *= 100f; audio.volume *= 1.2f; } } private void SetupFakeFall(CyberArena arena) { //IL_0022: 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_00fe: Unknown result type (might be due to invalid IL or missing references) EnemyComponents[] componentsInChildren = ((Component)arena.Grid).GetComponentsInChildren(); int points = 0; Dictionary spawnCostIncreases = new Dictionary(); FakeFallRegistrator.Register(); BigHarmlessExplosionAt(CyberArena.HorizontalCenter); BigHarmlessExplosionAt(CyberArena.HorizontalCenter); MonoSingleton.Instance.DisableGeometry(); List<(AEnemyType, Options.EnemyAttributes)> list = new List<(AEnemyType, Options.EnemyAttributes)>(); foreach (KeyValuePair enemiesAttribute in Options.EnemiesAttributes) { if (enemiesAttribute.Value.CanSpawnInFakeFall.Value && enemiesAttribute.Value.FakeFallSpawnCost.Value > 0 && (Object)(object)EnemyPrefabDatabase.GetPrefab(enemiesAttribute.Key) != (Object)null) { list.Add((enemiesAttribute.Key, enemiesAttribute.Value)); } } EnemyComponents[] array = componentsInChildren; foreach (EnemyComponents val in array) { Options.EnemyAttributes enemyAttributes = Options.EnemiesAttributes[MonoSingleton.Instance.GetVanillaType(val.Eid.enemyType)]; if (!enemyAttributes.CanSpawnInFakeFall.Value) { points += enemyAttributes.FakeFallDespawnValue.Value; SpawnFakeFallEnemy(list, ref points, spawnCostIncreases); val.Eid.InstaKill(); val.InstaDestroy(); } } for (int j = 0; j < 100; j++) { if (!SpawnFakeFallEnemy(list, ref points, spawnCostIncreases)) { break; } } spawnTimer = 0.3f; } private bool SpawnFakeFallEnemy(List<(AEnemyType, Options.EnemyAttributes)> spawnables, ref int points, Dictionary spawnCostIncreases) { //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: 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) (AEnemyType, Options.EnemyAttributes)? tuple = null; int num = 0; foreach (var spawnable in spawnables) { spawnCostIncreases.TryAdd(spawnable.Item1, 0); Options.EnemyAttributes item = spawnable.Item2; AEnemyType item2 = spawnable.Item1; int value = item.FakeFallSpawnCost.Value; if (value > num && points >= value + spawnCostIncreases[spawnable.Item1]) { tuple = spawnable; num = value; } } if (!tuple.HasValue) { return false; } GameObject val = EnemyPrefabDatabase.TrySpawnAt(tuple.Value.Item1, Vector3.Scale(Random.insideUnitSphere * 30f, new Vector3(1f, 0f, 1f)) + CyberArena.HorizontalCenter, Quaternion.identity, ((Component)MonoSingleton.Instance).transform, true); EnemyComponents componentInChildren = val.GetComponentInChildren(); componentInChildren.Eid.dontCountAsKills = false; Collider[] componentsInChildren = ((Component)componentInChildren).GetComponentsInChildren(); Collider[] array = componentsInChildren; foreach (Collider val2 in array) { ((Component)val2).gameObject.AddComponent(); } points -= num; spawnCostIncreases[tuple.Value.Item1] += tuple.Value.Item2.FakeFallSpawnCostIncreasePerSpawn.Value; EndlessGrid instance = MonoSingleton.Instance; instance.enemyAmount++; EndlessGrid instance2 = MonoSingleton.Instance; instance2.tempEnemyAmount++; return true; } protected void FixedUpdate() { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Expected I4, but got Unknown //IL_033a: Unknown result type (might be due to invalid IL or missing references) //IL_033b: Unknown result type (might be due to invalid IL or missing references) //IL_01da: 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_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0196: 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_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02dc: Unknown result type (might be due to invalid IL or missing references) //IL_02e1: Unknown result type (might be due to invalid IL or missing references) //IL_02e6: Unknown result type (might be due to invalid IL or missing references) //IL_0309: Unknown result type (might be due to invalid IL or missing references) //IL_030e: Unknown result type (might be due to invalid IL or missing references) //IL_0313: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_0279: Unknown result type (might be due to invalid IL or missing references) //IL_027e: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Unknown result type (might be due to invalid IL or missing references) //IL_02bd: Unknown result type (might be due to invalid IL or missing references) //IL_02c2: Unknown result type (might be due to invalid IL or missing references) //IL_02c7: Unknown result type (might be due to invalid IL or missing references) //IL_0328: Unknown result type (might be due to invalid IL or missing references) //IL_032d: Unknown result type (might be due to invalid IL or missing references) //IL_0332: Unknown result type (might be due to invalid IL or missing references) //IL_034f: Unknown result type (might be due to invalid IL or missing references) //IL_0354: Unknown result type (might be due to invalid IL or missing references) //IL_035e: Unknown result type (might be due to invalid IL or missing references) //IL_0363: Unknown result type (might be due to invalid IL or missing references) //IL_0368: Unknown result type (might be due to invalid IL or missing references) //IL_0372: Unknown result type (might be due to invalid IL or missing references) //IL_0377: Unknown result type (might be due to invalid IL or missing references) //IL_0347: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Invalid comparison between Unknown and I4 //IL_037c: Unknown result type (might be due to invalid IL or missing references) //IL_0434: Unknown result type (might be due to invalid IL or missing references) //IL_043b: Invalid comparison between Unknown and I4 //IL_063d: 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_0448: Unknown result type (might be due to invalid IL or missing references) //IL_044f: Invalid comparison between Unknown and I4 //IL_07dc: Unknown result type (might be due to invalid IL or missing references) //IL_07e3: Invalid comparison between Unknown and I4 //IL_0784: Unknown result type (might be due to invalid IL or missing references) //IL_0789: Unknown result type (might be due to invalid IL or missing references) //IL_079d: Unknown result type (might be due to invalid IL or missing references) //IL_0806: Unknown result type (might be due to invalid IL or missing references) //IL_080b: 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_0483: Unknown result type (might be due to invalid IL or missing references) //IL_048a: Invalid comparison between Unknown and I4 //IL_0467: Unknown result type (might be due to invalid IL or missing references) //IL_055d: Unknown result type (might be due to invalid IL or missing references) //IL_0564: Invalid comparison between Unknown and I4 //IL_04a2: Unknown result type (might be due to invalid IL or missing references) //IL_04a7: Unknown result type (might be due to invalid IL or missing references) //IL_04b1: Unknown result type (might be due to invalid IL or missing references) //IL_04b6: 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_04c5: Unknown result type (might be due to invalid IL or missing references) //IL_04ca: Unknown result type (might be due to invalid IL or missing references) //IL_05ca: Unknown result type (might be due to invalid IL or missing references) //IL_05d1: Invalid comparison between Unknown and I4 //IL_0574: Unknown result type (might be due to invalid IL or missing references) //IL_061b: Unknown result type (might be due to invalid IL or missing references) //IL_05e1: Unknown result type (might be due to invalid IL or missing references) //IL_05e2: Unknown result type (might be due to invalid IL or missing references) //IL_05ec: Unknown result type (might be due to invalid IL or missing references) //IL_05f1: Unknown result type (might be due to invalid IL or missing references) //IL_05f6: Unknown result type (might be due to invalid IL or missing references) //IL_0600: Unknown result type (might be due to invalid IL or missing references) //IL_0605: Unknown result type (might be due to invalid IL or missing references) if (Cheats.IsCheatDisabled("nyxpiri.cybergrind-bosses") || !MonoSingleton.Instance.GenerationFinished) { return; } spawnTimer -= Time.fixedDeltaTime; Vector3 val = Vector3.zero; if ((_bossPicker.ShouldFakeFall && !MonoSingleton.Instance.FakeFallActive) || !(spawnTimer <= 0f)) { return; } spawnTimer = 0.25f; if (_bossPicker.TypesToSpawn.Count == 0) { return; } AEnemyType val2 = _bossPicker.TypesToSpawn.Dequeue(); GameObject val3 = null; EnemyType? vanillaEnumValue = val2.VanillaEnumValue; EnemyType? val4 = vanillaEnumValue; if (val4.HasValue) { EnemyType valueOrDefault = val4.GetValueOrDefault(); switch (valueOrDefault - 8) { default: if ((int)valueOrDefault == 42) { val3 = ((Component)EnemyVariants.GeryonPrefab).gameObject; } break; case 8: val3 = EnemyPrefabDatabase.GetPrefab((EnemyType)16); val = MonoSingleton.Instance.FloorCenter + Vector3.up * 8f; break; case 20: val3 = EnemyPrefabDatabase.GetPrefab((EnemyType)28); val = MonoSingleton.Instance.FloorCenter + Vector3.up * 16f; break; case 0: val3 = EnemyPrefabDatabase.GetPrefab((EnemyType)8); val = CyberArena.RandomOneByOne.GetValueOrDefault(Vector3.zero); break; case 14: val3 = EnemyPrefabDatabase.GetPrefab((EnemyType)22); val = CyberArena.RandomOneByOne.GetValueOrDefault(Vector3.zero); break; case 9: val3 = EnemyPrefabDatabase.GetPrefab((EnemyType)17); break; case 22: val3 = EnemyPrefabDatabase.GetPrefab((EnemyType)30); break; case 10: val3 = EnemyPrefabDatabase.GetPrefab((EnemyType)18); val = CyberArena.RandomOneByOne.GetValueOrDefault(Vector3.zero); break; case 3: val3 = EnemyVariants.CorpseOfKingMinosPrefab; break; case 19: val3 = ((Component)EnemyVariants.LeviathanPrefab).gameObject; break; case 21: val3 = EnemyPrefabDatabase.GetPrefab((EnemyType)29); val = CyberArena.RandomTwoByTwo.GetValueOrDefault(Vector3.zero); break; case 15: val3 = EnemyPrefabDatabase.GetPrefab((EnemyType)23); val = CyberArena.RandomOneByOne.GetValueOrDefault(Vector3.zero); break; case 24: val3 = EnemyPrefabDatabase.GetPrefab((EnemyType)32); val = CyberArena.RandomThreeByThree.GetValueOrDefault(Vector3.zero); break; case 16: val3 = EnemyPrefabDatabase.GetPrefab((EnemyType)24); val = CyberArena.RandomTwoByTwo.GetValueOrDefault(Vector3.zero); break; case 17: val3 = EnemyPrefabDatabase.GetPrefab((EnemyType)25); val = CyberArena.RandomTwoByTwo.GetValueOrDefault(Vector3.zero); break; case 27: val = CyberArena.RandomThreeByThree.GetValueOrDefault(CyberArena.RandomTwoByTwo.Value); break; case 1: case 2: case 4: case 5: case 6: case 7: case 11: case 12: case 13: case 18: case 23: case 25: case 26: break; } } GameObject val5 = null; val = ((val == Vector3.zero) ? (MonoSingleton.Instance.FloorCenter + Vector3.up * 10f + Vector3.forward * 10f) : val); bool value = Options.EnemyEntries[val2].ShowBossBar.Value; if ((Object)(object)val3 != (Object)null) { val5 = Object.Instantiate(val3, ((Component)MonoSingleton.Instance).gameObject.transform); Log.Debug($"done spawning prefab for type {val2}"); EnemyComponents componentInChildren = val5.GetComponentInChildren(); ((Component)componentInChildren).gameObject.AddComponent(); val5.SetActive(true); EnemyIdentifier eid = componentInChildren.Eid; componentInChildren.Health *= Options.EnemyEntries[val2].HealthScalar.Value; eid.BossBar(value); if ((int)val2.VanillaEnumValue.GetValueOrDefault() == 17 || (int)val2.VanillaEnumValue.GetValueOrDefault() == 30) { val5.transform.position = MonoSingleton.Instance.FloorCenter; } else if ((int)val2.VanillaEnumValue.GetValueOrDefault() == 11) { val5.transform.position = MonoSingleton.Instance.FloorCenter + Vector3.right * 175f + Vector3.down * 600f; BoxCollider[] componentsInChildren = val5.GetComponentsInChildren(); BoxCollider[] array = componentsInChildren; foreach (BoxCollider val6 in array) { ((Collider)val6).enabled = (Object)(object)((Component)val6).GetComponent() != (Object)null; } Collider[] componentsInChildren2 = val5.GetComponentsInChildren(true); Collider[] array2 = componentsInChildren2; foreach (Collider val7 in array2) { GameObjectExtensions.GetOrAddComponent(((Component)val7).gameObject); } } else if ((int)val2.VanillaEnumValue.GetValueOrDefault() == 27) { val5.transform.position = val; Collider[] componentsInChildren3 = val5.GetComponentsInChildren(true); Collider[] array3 = componentsInChildren3; foreach (Collider val8 in array3) { GameObjectExtensions.GetOrAddComponent(((Component)val8).gameObject); } LeviathanController component = val5.GetComponent(); } else if ((int)val2.VanillaEnumValue.GetValueOrDefault() == 42) { val5.transform.position = val + Vector3.back * 125f + Vector3.up * 40f; } else { val5.transform.position = val; } } else if (val2 == EnemyVariants.TundraAgonyType) { GameObject val9 = EnemyVariants.SpawnAgonyAndTundra(val, Quaternion.identity, ((Component)MonoSingleton.Instance).transform); EnemyComponents[] componentsInChildren4 = val9.GetComponentsInChildren(); EnemyComponents[] array4 = componentsInChildren4; foreach (EnemyComponents val10 in array4) { val10.Health *= Options.EnemyEntries[val2].HealthScalar.Value; GrindBoss grindBoss = ((Component)val10.Eid).gameObject.AddComponent(); val10.ResetHealthInfo(); val10.Eid.BossBar(value); grindBoss.IsTundraAgony = true; } Transform[] array5 = (Transform[])(object)new Transform[val9.transform.childCount]; for (int m = 0; m < val9.transform.childCount; m++) { array5[m] = val9.transform.GetChild(m); } Transform[] array6 = array5; foreach (Transform val11 in array6) { val11.parent = ((Component)MonoSingleton.Instance).transform; } Object.Destroy((Object)(object)val9); } else if (val2 == EnemyVariants.BloodTree) { BloodFiller val12 = Object.Instantiate(EnemyVariants.BloodTreePrefab, CyberArena.RandomTwoByTwo.GetValueOrDefault(MonoSingleton.Instance.FloorCenter), Quaternion.Euler(-90f, 0f, 0f), ((Component)MonoSingleton.Instance).transform); ((Component)val12).gameObject.AddComponent(); ((Component)val12).gameObject.SetActive(true); } else if ((int)val2.VanillaEnumValue.GetValueOrDefault() == 35) { val3 = EnemyVariants.CentaurSecurityPrefab; GameObject val13 = Object.Instantiate(EnemyVariants.CentaurSecurityPrefab, CyberArena.RandomThreeByThree.GetValueOrDefault(MonoSingleton.Instance.FloorCenter), Quaternion.Euler(0f, 0f, 0f), ((Component)MonoSingleton.Instance).transform); val13.AddComponent(); val13.SetActive(true); } } } [ConfigureSingleton(/*Could not decode attribute arguments.*/)] [DefaultExecutionOrder(-10000)] public class CyberArena : MonoSingleton { public delegate void GenerationFinishedEventHandler(CyberArena arena); public delegate void EnemySpawningFinishedEventHandler(CyberArena arena); public static FieldAccess incompletePrefabsFA = new FieldAccess("incompletePrefabs", BindingFlags.Instance | BindingFlags.NonPublic); public static FieldAccess incompleteBlocksFA = new FieldAccess("incompleteBlocks", BindingFlags.Instance | BindingFlags.NonPublic); private List _threeByThrees = new List(); private List _twoByTwos = new List(); private List _oneByOnes = new List(); private bool _initialSpawn; private bool _enemySpawningFinished; private float _enableZapperTimer; private bool _geometryDisabled = false; public static Vector3 HorizontalCenter => new Vector3(0f, 0f, 62.5f); public Vector3 FloorCenter { get; private set; } = HorizontalCenter; public bool GenerationFinished { get; private set; } = false; public EndlessGrid Grid { get; private set; } = null; public GameObject FakeFallGo { get; private set; } public static IReadOnlyList ThreeByThrees => MonoSingleton.Instance._threeByThrees; public static IReadOnlyList TwoByTwos => MonoSingleton.Instance._twoByTwos; public static IReadOnlyList OneByOnes => MonoSingleton.Instance._oneByOnes; public static Vector3? RandomOneByOne => (OneByOnes.Count > 0) ? new Vector3?(OneByOnes[Random.Range(0, OneByOnes.Count)]) : null; public static Vector3? RandomTwoByTwo => (TwoByTwos.Count > 0) ? new Vector3?(TwoByTwos[Random.Range(0, TwoByTwos.Count)]) : null; public static Vector3? RandomThreeByThree => (ThreeByThrees.Count > 0) ? new Vector3?(ThreeByThrees[Random.Range(0, ThreeByThrees.Count)]) : null; public DeathZone ZapperDeathZone { get; private set; } = null; public bool ZapperDisabled { get; private set; } = false; public bool FakeFallActive { get; private set; } = false; public List FakeFallHookPoints { get; private set; } = new List(); public event GenerationFinishedEventHandler OnGenerationFinished; public event EnemySpawningFinishedEventHandler OnEnemySpawningFinished; public void DisableGeometry() { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: 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_005c: Unknown result type (might be due to invalid IL or missing references) Assert.IsTrue(Cheats.Enabled, ""); _geometryDisabled = true; for (int i = 0; i < Grid.cubes.Length; i++) { EndlessCube[] array = Grid.cubes[i]; EndlessCube[] array2 = array; foreach (EndlessCube val in array2) { Transform transform = ((Component)val).transform; transform.position += Vector3.down * 250f; } } FieldAccess val2 = default(FieldAccess); val2..ctor("combinedGridStaticObject", BindingFlags.Instance | BindingFlags.NonPublic); val2.GetValue(Grid).SetActive(false); FieldAccess> val3 = default(FieldAccess>); val3..ctor("jumpPadPool", BindingFlags.Instance | BindingFlags.NonPublic); FieldAccess> val4 = default(FieldAccess>); val4..ctor("spawnedPrefabs", BindingFlags.Instance | BindingFlags.NonPublic); List value = val3.GetValue(Grid); List value2 = val4.GetValue(Grid); DisableZapper(); foreach (CyberPooledPrefab item in value) { ((Component)item).gameObject.SetActive(false); } foreach (GameObject item2 in value2) { if ((Object)(object)item2.GetComponentInChildren() != (Object)null) { item2.SetActive(false); } } } private void EnableZapperIn(float seconds) { _enableZapperTimer = seconds; } private void EnableZapper() { ZapperDisabled = false; ((Behaviour)ZapperDeathZone).enabled = true; ((Renderer)((Component)ZapperDeathZone).gameObject.GetComponent()).enabled = true; } private void DisableZapper() { ZapperDisabled = true; EnforceZapperDisable(); } private void EnforceZapperDisable() { if (ZapperDisabled) { ((Behaviour)ZapperDeathZone).enabled = false; ((Renderer)((Component)ZapperDeathZone).gameObject.GetComponent()).enabled = false; } } protected void Awake() { Grid = ((Component)this).GetComponent(); EnsureFakeFallZoneExists(); } protected void Start() { DeathZone[] array = Object.FindObjectsOfType(); DeathZone[] array2 = array; foreach (DeathZone val in array2) { if (((Object)((Component)val).gameObject).name == "Cube") { ZapperDeathZone = val; } } if (!Cheats.IsCheatDisabled("nyxpiri.cybergrind-bosses")) { EnsureFakeFallHookPointsExist(); } } private void EnsureFakeFallZoneExists() { //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_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) if (!Cheats.IsCheatDisabled("nyxpiri.cybergrind-bosses") && (Object)(object)FakeFallGo == (Object)null) { FakeFallGo = Object.Instantiate(((Component)EnemyVariants.FakeFallZone).gameObject, HorizontalCenter, Quaternion.identity, ((Component)this).transform); FakeFallGo.SetActive(false); BoxCollider component = FakeFallGo.GetComponent(); Vector3 size = component.size; ((Vector3)(ref size)).Scale(new Vector3(100f, 1f, 100f)); component.size = size; FakeFallZone component2 = FakeFallGo.GetComponent(); component2.heightControlAmount = 30f; } } private void EnsureFakeFallHookPointsExist() { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0070: 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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) if (!Cheats.IsCheatDisabled("nyxpiri.cybergrind-bosses") && FakeFallHookPoints.Count == 0) { Vector3 val = Vector3.forward * 65f; int num = 5; for (int i = 0; i < num; i++) { val.y = 20f; Vector3 val2 = Quaternion.Euler(new Vector3(0f, Mathf.Lerp(0f, 360f, (float)i / (float)num), 0f)) * val; GameObject item = Object.Instantiate(HookPoints.SlingshotHookPoint, HorizontalCenter + val2, Quaternion.identity, ((Component)MonoSingleton.Instance).transform); FakeFallHookPoints.Add(item); } num = 3; for (int j = 0; j < num; j++) { val.y = 0f; Vector3 val3 = Quaternion.Euler(new Vector3(0f, Mathf.Lerp(0f, 360f, (float)j / (float)num), 0f)) * val; GameObject item2 = Object.Instantiate(HookPoints.SlingshotHookPoint, HorizontalCenter + val3, Quaternion.identity, ((Component)MonoSingleton.Instance).transform); FakeFallHookPoints.Add(item2); } } } protected void OnEnable() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown Cybergrind.PreCybergrindNextWave += new CybergrindPreNextWaveEventHandler(PreNextWave); Cybergrind.PostCybergrindNextWave += new CybergrindPostNextWaveEventHandler(NextWave); } private void PreNextWave(EventMethodCanceler canceler, EndlessGrid endlessGrid) { if (!Cheats.IsCheatDisabled("nyxpiri.cybergrind-bosses") && _geometryDisabled) { _geometryDisabled = false; } } protected void OnDisable() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown Cybergrind.PreCybergrindNextWave -= new CybergrindPreNextWaveEventHandler(PreNextWave); Cybergrind.PostCybergrindNextWave -= new CybergrindPostNextWaveEventHandler(NextWave); } public void EnableFakeFall() { if (Cheats.IsCheatDisabled("nyxpiri.cybergrind-bosses") || FakeFallActive) { return; } EnsureFakeFallZoneExists(); EnsureFakeFallHookPointsExist(); FakeFallActive = true; FakeFallGo.SetActive(true); foreach (GameObject fakeFallHookPoint in FakeFallHookPoints) { fakeFallHookPoint.SetActive(true); } } public void DisableFakeFall() { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //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_0074: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) if (Cheats.IsCheatDisabled("nyxpiri.cybergrind-bosses") || !FakeFallActive) { return; } FakeFallActive = false; FakeFallGo.SetActive(false); EnableZapperIn(2f); Vector3 val = HorizontalCenter - ((Component)MonoSingleton.Instance).transform.position; Transform transform = ((Component)MonoSingleton.Instance).transform; transform.position += val; foreach (EnemyIdentifier enemy in MonoSingleton.Instance.enemies) { if (!((Object)(object)enemy == (Object)null)) { GameObject rootGameObject = ((Component)enemy).GetComponent().RootGameObject; Transform transform2 = rootGameObject.transform; transform2.position += val; } } foreach (GameObject fakeFallHookPoint in FakeFallHookPoints) { fakeFallHookPoint.SetActive(false); } } private void NextWave(EventMethodCancelInfo cancelInfo, EndlessGrid endlessGrid) { if (!Cheats.IsCheatDisabled("nyxpiri.cybergrind-bosses")) { _initialSpawn = true; GenerationFinished = false; _enemySpawningFinished = false; if (ZapperDisabled) { EnableZapperIn(0.5f); } } } protected void Update() { if (!Cheats.IsCheatDisabled("nyxpiri.cybergrind-bosses")) { } } protected void FixedUpdate() { //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_00dc: 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_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) if (Cheats.IsCheatDisabled("nyxpiri.cybergrind-bosses") || !Cybergrind.IsActive) { return; } if (ZapperDisabled && _enableZapperTimer > 0f) { _enableZapperTimer -= Time.fixedDeltaTime; if (_enableZapperTimer <= 0f) { EnableZapper(); } } EnforceZapperDisable(); int value = incompletePrefabsFA.GetValue(MonoSingleton.Instance); int value2 = incompleteBlocksFA.GetValue(MonoSingleton.Instance); if (value2 <= 0 && value <= 0) { if (_initialSpawn) { _initialSpawn = false; RaycastHit val = default(RaycastHit); Physics.SphereCast(HorizontalCenter + Vector3.up * 200f, 2f, Vector3.down, ref val, float.PositiveInfinity, 16777216); FloorCenter = (((Object)(object)((RaycastHit)(ref val)).collider != (Object)null) ? ((RaycastHit)(ref val)).point : HorizontalCenter); UpdateSpawnPositions(); GenerationFinished = true; this.OnGenerationFinished?.Invoke(this); } if (!_enemySpawningFinished && Grid.enemyAmount != 999) { _enemySpawningFinished = true; this.OnEnemySpawningFinished?.Invoke(this); } } } private void UpdateSpawnPositions() { //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) _oneByOnes.Clear(); _twoByTwos.Clear(); _threeByThrees.Clear(); for (int i = 0; i < Grid.cubes.Length; i++) { for (int j = 0; j < Grid.cubes[i].Length; j++) { if (Grid.cubes[i][j].blockedByPrefab) { continue; } _oneByOnes.Add(GetCubeTopCenter(Grid.cubes[i][j])); Vector3? val = TestForSpawnPosition(2, 2, i, j); if (val.HasValue) { _twoByTwos.Add(val.Value); Vector3? val2 = TestForSpawnPosition(3, 3, i, j); if (val2.HasValue) { _threeByThrees.Add(val2.Value); } } } } } private Vector3? TestForSpawnPosition(int sizeI, int sizeJ, int iStart, int jStart) { //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: 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_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0169: 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_00b4: Unknown result type (might be due to invalid IL or missing references) List list = new List(sizeI * sizeJ); for (int i = iStart; i < iStart + sizeI; i++) { for (int j = jStart; j < jStart + sizeJ; j++) { if (Grid.cubes.Length <= i) { return null; } if (Grid.cubes[i].Length <= j) { return null; } if (Grid.cubes[i][j].blockedByPrefab) { return null; } list.Add(GetCubeTopCenter(Grid.cubes[i][j])); } } Vector3 val = Vector3.zero; float y = list[0].y; foreach (Vector3 item in list) { val += item; if (Mathf.Abs(item.y - y) > 0.5f) { return null; } } return val / (float)list.Count; } private Vector3 GetCubeTopCenter(EndlessCube endlessCube) { //IL_0007: 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_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0028: 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) return ((Component)endlessCube).transform.position + new Vector3(0f, 25f, 0f); } } public class GrindBoss : MonoBehaviour { public class AutoDeactivate : MonoBehaviour { protected void OnEnable() { ((Component)this).gameObject.SetActive(false); } } private EnemyComponents Enemy = null; private FieldAccess sisyPrimeOriginalHpFA = new FieldAccess("originalHp", BindingFlags.Instance | BindingFlags.NonPublic); private FieldAccess minosPrimeinActionFA = new FieldAccess("inAction", BindingFlags.Instance | BindingFlags.NonPublic); private FieldAccess minosPrimegravityInActionFA = new FieldAccess("gravityInAction", BindingFlags.Instance | BindingFlags.NonPublic); private FieldAccess V2DistancePatienceFA = new FieldAccess("distancePatience", BindingFlags.Instance | BindingFlags.NonPublic); private FieldAccess OverrideFullNameFA = new FieldAccess("overrideFullName", BindingFlags.Instance | BindingFlags.NonPublic); private FieldAccess GabrielBaseBossVersionFA = new FieldAccess("bossVersion", BindingFlags.Instance | BindingFlags.NonPublic); private int remainingBoostHelpers = 0; private FixedTimeStamp lastBoostHelperTimestamp = default(FixedTimeStamp); private bool _levAlreadySecondPhasing = false; private FixedTimeStamp _levSecondPhaseRequestTimestamp = default(FixedTimeStamp); private float symbioteSavePhase1Speed = 0f; private float symbioteSavePhase2Speed = 0f; private bool addDeadEnemyCalled = false; private SwordsMachine sm; private LeviathanController lev; private V2 v2; private MinosPrime minosP; private SisyphusPrime sisyprime; private GabrielBase garbage; private FleshPrison prison; private Geryon gery; private MinosBoss minos; private FixedTimeStamp symbioteSaveStart; private FixedTimeStamp waitingToDestroyTimestamp; private float waitingToDestroyTime = -1f; private bool leviathanSecondPhaseEventCalled = false; private float levSpawnHookPointsTimer = -1f; private float levDestroyFloorTimer = -1f; private float levDeathLaunchPlayerTimer = -1f; private float _verticalShiftVelocity = 0f; private Vector3 _minosTargetPos; public bool IsTundraAgony { get; internal set; } public EnemyComponents Symbiote { get; private set; } public SwordsMachine SymbioteSm { get; private set; } public Rigidbody SymbioteRb { get; private set; } public List GameObjectsToDestroy { get; private set; } = new List(); public int RemainingEnemies => MonoSingleton.Instance.enemyAmount - ((Component)MonoSingleton.Instance).GetComponent().deadEnemies; protected void Awake() { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Expected O, but got Unknown //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown v2 = ((Component)this).GetComponentInChildren(); sm = ((Component)this).GetComponent(); Enemy = ((Component)this).GetComponent(); Enemy.Eid.dontCountAsKills = true; Enemy.PreDeath += new PreDeathEventHandler(PreDeath); Enemy.PostDeath += new PostDeathEventHandler(PostDeath); Enemy.AvoidHealthBasedSlowDown = true; GameObject rootGameObject = Enemy.RootGameObject; Collider[] componentsInChildren = rootGameObject.GetComponentsInChildren(); Collider[] array = componentsInChildren; foreach (Collider val in array) { GameObjectExtensions.GetOrAddComponent(((Component)val).gameObject); } if ((Object)(object)v2 != (Object)null && v2.secondEncounter) { string text = "V2... 2!"; switch (Random.Range(0, 100)) { } OverrideFullNameFA.SetValue(((Component)v2).gameObject.GetComponent(), text); } } protected void Start() { //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Expected O, but got Unknown //IL_0258: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_028c: Unknown result type (might be due to invalid IL or missing references) //IL_0293: Expected O, but got Unknown if (Cheats.Enabled) { remainingBoostHelpers = Options.MaxGenericBoostHelpersPerEnemy.Value; garbage = ((Component)this).GetComponentInChildren(); prison = ((Component)this).GetComponentInChildren(); lev = ((Component)this).GetComponent(); sisyprime = ((Component)this).GetComponent(); minosP = ((Component)this).GetComponent(); minos = ((Component)this).GetComponent(); gery = ((Component)this).GetComponent(); if ((Object)(object)garbage != (Object)null) { GabrielBaseBossVersionFA.SetValue(garbage, false); ((MonoBehaviour)((Component)this).GetComponent()).Invoke("Taunt", Random.Range(0.1f, 0.5f)); } if ((Object)(object)minosP != (Object)null) { MonoSingleton.Instance.DisplaySubtitle("WEAK", (AudioSource)null, false); ((Component)minosP).GetComponent().clip = minosP.phaseChangeVoice; AudioSourceExtensions.SetPitch(((Component)minosP).GetComponent(), 1f); AudioSourceExtensions.Play(((Component)minosP).GetComponent(), true); } if ((Object)(object)sisyprime != (Object)null) { sisyprime.Taunt(); } if (IsTundraAgony) { Assert.IsNotNull((Object)(object)Enemy, ""); Assert.IsNotNull((Object)(object)((Component)Enemy).GetComponent(), ""); Assert.IsNotNull((Object)(object)((Component)Enemy).GetComponent().symbiote, ""); Symbiote = ((Component)((Component)Enemy).GetComponent().symbiote).GetComponent(); SymbioteSm = ((Component)Symbiote).GetComponent(); } if ((Object)(object)minos != (Object)null) { GameObject val = new GameObject(); val.transform.parent = ((Component)this).transform; val.SetActive(false); minos.blackHole = Object.Instantiate(minos.blackHole.gameObject, val.transform); BlackholeModifier blackholeModifier = minos.blackHole.AddComponent(); blackholeModifier.RescaleOnStart = 0.4f; blackholeModifier.Damage = 50; blackholeModifier.KillThreshold = 5; _minosTargetPos = ((Component)this).transform.position; } if ((Object)(object)prison != (Object)null && (Object)(object)prison.blackHole != (Object)null) { GameObject val2 = new GameObject(); val2.transform.parent = ((Component)this).transform; val2.SetActive(false); prison.blackHole = Object.Instantiate(prison.blackHole.gameObject, val2.transform); BlackholeModifier blackholeModifier2 = prison.blackHole.AddComponent(); blackholeModifier2.RescaleOnStart = 1f; blackholeModifier2.Damage = 50; blackholeModifier2.KillThreshold = 5; } if ((Object)(object)gery != (Object)null) { FieldAccess val3 = default(FieldAccess); val3..ctor("rotateAround", BindingFlags.Instance | BindingFlags.NonPublic); ((Component)gery).gameObject.AddComponent(); } GroundCheckEnemy componentInChildren = ((Component)this).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { componentInChildren.cols.Clear(); } } } protected void FixedUpdate() { //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_05b4: 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_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_019a: 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_01ac: 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_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_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_01f9: 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_020a: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_02a2: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_02ac: 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_063a: Unknown result type (might be due to invalid IL or missing references) //IL_040a: Unknown result type (might be due to invalid IL or missing references) //IL_040f: Unknown result type (might be due to invalid IL or missing references) //IL_0439: Unknown result type (might be due to invalid IL or missing references) //IL_043e: Unknown result type (might be due to invalid IL or missing references) //IL_0448: Unknown result type (might be due to invalid IL or missing references) //IL_044d: Unknown result type (might be due to invalid IL or missing references) //IL_0452: Unknown result type (might be due to invalid IL or missing references) //IL_045c: Unknown result type (might be due to invalid IL or missing references) //IL_0461: Unknown result type (might be due to invalid IL or missing references) //IL_0b2d: Unknown result type (might be due to invalid IL or missing references) //IL_0523: Unknown result type (might be due to invalid IL or missing references) //IL_0528: Unknown result type (might be due to invalid IL or missing references) //IL_0552: Unknown result type (might be due to invalid IL or missing references) //IL_0557: Unknown result type (might be due to invalid IL or missing references) //IL_0561: Unknown result type (might be due to invalid IL or missing references) //IL_0566: Unknown result type (might be due to invalid IL or missing references) //IL_056b: Unknown result type (might be due to invalid IL or missing references) //IL_0575: Unknown result type (might be due to invalid IL or missing references) //IL_057a: Unknown result type (might be due to invalid IL or missing references) //IL_0b49: Unknown result type (might be due to invalid IL or missing references) //IL_0b4f: Invalid comparison between Unknown and I4 //IL_0b5c: Unknown result type (might be due to invalid IL or missing references) //IL_0b62: Invalid comparison between Unknown and I4 //IL_0b6f: Unknown result type (might be due to invalid IL or missing references) //IL_0b76: Invalid comparison between Unknown and I4 //IL_0bb4: Unknown result type (might be due to invalid IL or missing references) //IL_0bbb: Invalid comparison between Unknown and I4 //IL_0bfc: 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_0c0c: Unknown result type (might be due to invalid IL or missing references) //IL_0c11: Unknown result type (might be due to invalid IL or missing references) //IL_0af4: Unknown result type (might be due to invalid IL or missing references) //IL_097c: Unknown result type (might be due to invalid IL or missing references) //IL_0981: Unknown result type (might be due to invalid IL or missing references) //IL_098b: Unknown result type (might be due to invalid IL or missing references) //IL_0995: 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_07d9: Unknown result type (might be due to invalid IL or missing references) //IL_07de: Unknown result type (might be due to invalid IL or missing references) //IL_07e9: Unknown result type (might be due to invalid IL or missing references) //IL_07f3: Unknown result type (might be due to invalid IL or missing references) //IL_07f8: Unknown result type (might be due to invalid IL or missing references) //IL_080f: Unknown result type (might be due to invalid IL or missing references) //IL_081a: Unknown result type (might be due to invalid IL or missing references) //IL_085b: Unknown result type (might be due to invalid IL or missing references) //IL_0866: Unknown result type (might be due to invalid IL or missing references) //IL_0876: Unknown result type (might be due to invalid IL or missing references) //IL_087b: Unknown result type (might be due to invalid IL or missing references) //IL_0880: Unknown result type (might be due to invalid IL or missing references) //IL_088b: Unknown result type (might be due to invalid IL or missing references) //IL_0895: Unknown result type (might be due to invalid IL or missing references) //IL_089a: Unknown result type (might be due to invalid IL or missing references) //IL_0c9a: Unknown result type (might be due to invalid IL or missing references) if (!Cheats.Enabled) { return; } if ((Object)(object)v2 != (Object)null) { float value = V2DistancePatienceFA.GetValue(v2); value = Mathf.Min(value, 4.5f); V2DistancePatienceFA.SetValue(v2, value); } Enemy.Eid.dontCountAsKills = true; float num = 5f; if ((Object)(object)sisyprime != (Object)null) { num = Mathf.Clamp(MonoSingleton.Instance.Position.y - 5f, -110f, num); } if ((Object)(object)minosP != (Object)null) { num = Mathf.Clamp(MonoSingleton.Instance.Position.y - 5f, -110f, num); } Vector3 val2; if (!Enemy.Eid.Dead && ((Component)Enemy).transform.position.y < num && remainingBoostHelpers > 0 && ((FixedTimeStamp)(ref lastBoostHelperTimestamp)).TimeSince > 0.75 && (Object)(object)garbage == (Object)null) { Rigidbody component = ((Component)Enemy).GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)minosP == (Object)null && (Object)(object)sisyprime == (Object)null) { Vector3 position = ((Component)component).transform.position; Vector3 val = position; ((Vector3)(ref val)).Scale(new Vector3(1f, 0f, 1f)); val2 = component.velocity; ((Vector3)(ref val2)).Scale(new Vector3(1f, 0f, 1f)); float num2 = Vector3.Distance(CyberArena.HorizontalCenter, val); Vector3 val3 = Vector3.up * 80f; val2 = CyberArena.HorizontalCenter - val; component.velocity = val3 + ((Vector3)(ref val2)).normalized * num2 * 0.25f; ((FixedTimeStamp)(ref lastBoostHelperTimestamp)).UpdateToNow(); if ((Object)(object)v2 != (Object)null) { EnemyComponents component2 = ((Component)v2).GetComponent(); EnemyUtils.ApplyDamage(component2.Eid, Vector3.zero, ((Component)component2.Eid).transform.position, (float)Options.V2FallOffArenaDamage.Value, 1f, (GameObject)null, true); GameObject val4 = Object.Instantiate(Assets.ExplosionPrefab, ((Component)this).transform.parent); val4.transform.position = ((Component)this).transform.position + Vector3.down; Explosion componentInChildren = val4.GetComponentInChildren(); componentInChildren.ignite = false; componentInChildren.harmless = true; componentInChildren.damage = 0; componentInChildren.pushForceMultiplier = 0f; componentInChildren.friendlyFire = true; val4.SetActive(true); } else if (IsTundraAgony && (Object)(object)Symbiote != (Object)null && !Symbiote.Eid.Dead) { ((Component)Symbiote).GetComponent().RequestSymbioteSave(); } else { remainingBoostHelpers--; } } GameObject prefab = EnemyPrefabDatabase.GetPrefab((EnemyType)21); Idol component3 = prefab.GetComponent(); FieldAccess val5 = default(FieldAccess); val5..ctor("deathParticle", BindingFlags.Instance | BindingFlags.NonPublic); GameObject value2 = val5.GetValue(component3); if ((Object)(object)sisyprime != (Object)null && ((FixedTimeStamp)(ref lastBoostHelperTimestamp)).TimeSince > 0.45 && !Enemy.Eid.dead) { if (Enemy.Eid.health > (float)Options.SisyphusPrimeFallOffArenaDamage.Value) { Enemy.Eid.SimpleDamage((float)Options.SisyphusPrimeFallOffArenaDamage.Value); GameObject val6 = Object.Instantiate(value2, ((Component)this).transform.position, Quaternion.identity, ((Component)MonoSingleton.Instance).transform); val6.SetActive(true); ((Component)sisyprime).transform.position = CyberArena.HorizontalCenter + Vector3.up * 100f + Vector3.forward * 20f; ((FixedTimeStamp)(ref lastBoostHelperTimestamp)).UpdateToNow(); } else { Enemy.Eid.InstaKill(); } } else if ((Object)(object)minosP != (Object)null && ((FixedTimeStamp)(ref lastBoostHelperTimestamp)).TimeSince > 0.45 && !Enemy.Eid.dead) { if (Enemy.Eid.health > (float)Options.MinosPrimeFallOffArenaDamage.Value) { Enemy.Eid.SimpleDamage((float)Options.MinosPrimeFallOffArenaDamage.Value); GameObject val7 = Object.Instantiate(value2, ((Component)this).transform.position, Quaternion.identity, ((Component)MonoSingleton.Instance).transform); val7.SetActive(true); ((Component)minosP).transform.position = CyberArena.HorizontalCenter + Vector3.up * 100f + Vector3.forward * 20f; ((FixedTimeStamp)(ref lastBoostHelperTimestamp)).UpdateToNow(); } else { Enemy.Eid.InstaKill(); } } } if (((Component)Enemy).transform.position.y < -5f && IsTundraAgony) { Enemy.Eid.InstaKill(); } if ((Object)(object)v2 != (Object)null && v2.isEnraged) { v2.UnEnrage(); } if ((Object)(object)v2 != (Object)null) { val2 = ((Component)v2).transform.position; if (((Vector3)(ref val2)).magnitude > 350f && !Enemy.Eid.Dead) { ((Component)v2).GetComponent().InstaKill(); MonoSingleton.Instance.AddPoints(10, "STRANDED", (GameObject)null, (EnemyIdentifier)null, -1, "", ""); } } if (((FixedTimeStamp)(ref symbioteSaveStart)).TimeSince < 4.0) { if (Enemy.Eid.Dead || (Object)(object)Symbiote == (Object)null || Symbiote.Eid.Dead) { return; } if (!(sm?.downed).GetValueOrDefault(true)) { sm.Knockdown(false, false, false, true); } if (!(SymbioteSm?.downed).GetValueOrDefault(true)) { SymbioteSm.Knockdown(false, false, false, true); } if (Enemy.Health <= 0.5f) { Enemy.Eid.InstaKill(); } if (((FixedTimeStamp)(ref symbioteSaveStart)).TimeSince < 2.0) { Transform transform = ((Component)SymbioteRb).transform; transform.position += Vector3.up * symbioteSavePhase1Speed * Time.fixedDeltaTime; symbioteSavePhase2Speed = Vector3.Distance(((Component)SymbioteRb).transform.position, ((Component)this).transform.position) * 2.75f; } else if (((FixedTimeStamp)(ref symbioteSaveStart)).TimeSince > 3.0) { Transform transform2 = ((Component)SymbioteRb).transform; transform2.position += Vector3.Normalize(((Component)this).transform.position - ((Component)SymbioteRb).transform.position) * symbioteSavePhase2Speed * Time.fixedDeltaTime; } Machine component4 = ((Component)this).GetComponent(); FieldAccess val8 = default(FieldAccess); val8..ctor("healing", BindingFlags.Instance | BindingFlags.NonPublic); if (val8.GetValue(component4)) { val8.SetValue(component4, false); } } if ((Object)(object)lev != (Object)null) { if (RemainingEnemies <= 1) { if (!lev.secondPhase && lev.readyForSecondPhase && ((FixedTimeStamp)(ref _levSecondPhaseRequestTimestamp)).TimeSince > 1.0) { lev.SubAttackOver(); } else if (!lev.secondPhase && lev.readyForSecondPhase) { Transform transform3 = ((Component)lev).transform; transform3.position += Vector3.down * 35f * Time.fixedDeltaTime; } LeviathanSecondPhase(); } if (levSpawnHookPointsTimer > 0f) { levSpawnHookPointsTimer -= Time.fixedDeltaTime; if (levSpawnHookPointsTimer <= 0f) { levSpawnHookPointsTimer = -1f; LeviathanSpawnHookPoints(); LevSecondPhaseLaunchPlayerUp(); } } if (levDestroyFloorTimer > 0f) { levDestroyFloorTimer -= Time.fixedDeltaTime; if (levDestroyFloorTimer <= 0f) { levDestroyFloorTimer = -1f; DestroyFloor(); } } if (levDeathLaunchPlayerTimer > 0f) { levDeathLaunchPlayerTimer -= Time.fixedDeltaTime; if (levDeathLaunchPlayerTimer <= 0f) { levDeathLaunchPlayerTimer = -1f; Collider[] componentsInChildren = ((Component)lev).gameObject.GetComponentsInChildren(); Collider[] array = componentsInChildren; foreach (Collider val9 in array) { val9.enabled = false; } LevDeathLaunchPlayer(); BigHarmlessExplosionAt(((Component)lev.head).transform.position); } } } if ((Object)(object)v2 != (Object)null) { v2.dontEnrage = true; } if (((Component)Enemy).transform.position.y < -15f && ((int)Enemy.Eid.enemyType == 7 || (int)Enemy.Eid.enemyType == 8 || (int)Enemy.Eid.enemyType == 22)) { Enemy.Eid.InstaKill(); } if (Enemy.Eid.Dead && (int)Enemy.Eid.enemyType == 11 && ((FixedTimeStamp)(ref waitingToDestroyTimestamp)).TimeSince > 0.2) { _verticalShiftVelocity -= Time.fixedDeltaTime * 60f; Transform transform4 = ((Component)this).transform; transform4.position += Vector3.up * _verticalShiftVelocity; } if ((Object)(object)sisyprime != (Object)null) { sisyPrimeOriginalHpFA.SetValue(sisyprime, 0f); } if (waitingToDestroyTime > 0f && ((FixedTimeStamp)(ref waitingToDestroyTimestamp)).TimeSince > (double)waitingToDestroyTime) { if ((Object)(object)lev != (Object)null) { BigHarmlessExplosionAt(((Component)lev.head).transform.position); } if ((Object)(object)gery != (Object)null) { BloodBomb(24, 34f); } if ((Object)(object)sisyprime != (Object)null) { BloodBomb(6, 4f); } if ((Object)(object)minosP != (Object)null) { BloodBomb(6, 4f); } Enemy.InstaDestroy(); } } private void BloodBomb(int iterations, float range) { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) GoreZone val = GoreZone.ResolveGoreZone(((Component)this).transform); Bloodsplatter val2 = default(Bloodsplatter); for (int i = 0; i < iterations; i++) { GameObject gore = MonoSingleton.Instance.GetGore((GoreType)0, false, false, false, ((Component)this).GetComponent(), false); if (!Object.op_Implicit((Object)(object)gore)) { break; } gore.transform.position = ((Component)this).transform.position + Random.insideUnitSphere * Random.Range(0f, range); if ((Object)(object)val.goreZone != (Object)null) { gore.transform.SetParent(val.goreZone, true); } gore.SetActive(true); if (gore.TryGetComponent(ref val2)) { val2.GetReady(); } } } private void BigHarmlessExplosionAt(Vector3 position) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) GameObject val = Object.Instantiate(Assets.ExplosionPrefab, position, Quaternion.identity); ExplosionAdditions component = val.GetComponent(); component.Harmless = true; component.ExplosionScale = 20f; component.ExplosionSpeedScale = 10f; component.ExplosionPushScale = 0f; val.SetActive(true); foreach (AudioSource audio in component.Audios) { audio.maxDistance *= 100f; audio.volume *= 1.2f; } } private void LeviathanSecondPhase() { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Expected O, but got Unknown if (_levAlreadySecondPhasing) { return; } ((FixedTimeStamp)(ref _levSecondPhaseRequestTimestamp)).UpdateToNow(); _levAlreadySecondPhasing = true; lev.phaseChangeHealth = 10000f; lev.onEnterSecondPhase.onActivate.AddListener((UnityAction)delegate { //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) if (!leviathanSecondPhaseEventCalled) { leviathanSecondPhaseEventCalled = true; Enemy stat = lev.stat; stat.health *= 0.5f; GameObject val = Object.Instantiate(Assets.ExplosionPrefab, CyberArena.HorizontalCenter, Quaternion.identity); ExplosionAdditions component = val.GetComponent(); component.Harmless = true; component.ExplosionScale = 20f; component.ExplosionSpeedScale = 10f; component.ExplosionPushScale = 0f; val.SetActive(true); foreach (AudioSource audio in component.Audios) { audio.maxDistance *= 100f; audio.volume *= 1.2f; } levDestroyFloorTimer = 0.2f; levSpawnHookPointsTimer = 0.35f; } }); } private static void DestroyFloor() { MonoSingleton.Instance.DisableGeometry(); } private static void LevSecondPhaseLaunchPlayerUp() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) if (((Component)MonoSingleton.Instance).transform.position.y < 50f) { MonoSingleton.Instance.gc.heavyFall = false; } MonoSingleton.Instance.LaunchUp(75f); } private void LeviathanSpawnHookPoints() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: 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_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.forward * 65f; int num = 4; for (int i = 0; i < num; i++) { val.y = 60f; Vector3 val2 = Quaternion.Euler(new Vector3(0f, Mathf.Lerp(0f, 360f, ((float)i + -0.5f) / (float)num), 0f)) * val; GameObject val3 = Object.Instantiate(HookPoints.SlingshotHookPoint, ((Component)lev.head).transform.position + val2, Quaternion.identity, ((Component)MonoSingleton.Instance).transform); val3.SetActive(true); GameObjectsToDestroy.Add(val3); } } protected void OnEnable() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown Cybergrind.PreCybergrindNextWave += new CybergrindPreNextWaveEventHandler(OnNextWave); } protected void OnDisable() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown Cybergrind.PreCybergrindNextWave -= new CybergrindPreNextWaveEventHandler(OnNextWave); } protected void OnNextWave(EventMethodCanceler canceler, EndlessGrid endlessGrid) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Invalid comparison between Unknown and I4 //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Invalid comparison between Unknown and I4 //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Invalid comparison between Unknown and I4 //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Invalid comparison between Unknown and I4 if (((int)Enemy.Eid.enemyType != 27 && (int)Enemy.Eid.enemyType != 11 && (int)Enemy.Eid.enemyType != 27 && (int)Enemy.Eid.enemyType != 27) || !Enemy.Eid.Dead) { Enemy.InstaDestroy(); } } private void RequestSymbioteSave() { //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) if (!Enemy.Eid.Dead && !(((FixedTimeStamp)(ref symbioteSaveStart)).TimeSince < 3.0)) { SymbioteRb = ((Component)SymbioteSm).GetComponent(); symbioteSavePhase1Speed = Mathf.Abs(((Component)SymbioteRb).transform.position.y - (((Component)this).transform.position.y + 20f)) * 0.8f; SymbioteRb.isKinematic = true; SwordsMachine obj = sm; if (obj != null) { obj.Knockdown(false, false, true, false); } ((FixedTimeStamp)(ref symbioteSaveStart)).UpdateToNow(); } } protected void OnDestroy() { foreach (GameObject item in GameObjectsToDestroy) { Object.Destroy((Object)(object)item); } } private void PreDeath(EventMethodCanceler canceler, bool instakill) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Invalid comparison between Unknown and I4 //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Invalid comparison between Unknown and I4 if ((int)Enemy.Eid.enemyType == 27) { waitingToDestroyTime = 3.5f; ((FixedTimeStamp)(ref waitingToDestroyTimestamp)).UpdateToNow(); levDeathLaunchPlayerTimer = 0.4f; } if ((int)Enemy.Eid.enemyType == 11) { waitingToDestroyTime = 1.75f; ((FixedTimeStamp)(ref waitingToDestroyTimestamp)).UpdateToNow(); } if ((Object)(object)sisyprime != (Object)null) { waitingToDestroyTime = 0.5f; ((FixedTimeStamp)(ref waitingToDestroyTimestamp)).UpdateToNow(); } if ((Object)(object)minosP != (Object)null) { waitingToDestroyTime = 0.8f; ((FixedTimeStamp)(ref waitingToDestroyTimestamp)).UpdateToNow(); } if ((Object)(object)gery != (Object)null) { waitingToDestroyTime = 0.6f; ((FixedTimeStamp)(ref waitingToDestroyTimestamp)).UpdateToNow(); } } private void LevDeathLaunchPlayer() { //IL_000b: 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_007c: 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_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_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_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) if (((Component)MonoSingleton.Instance).transform.position.y < 75f && lev.secondPhase) { MonoSingleton.Instance.gc.heavyFall = false; } if (((Component)MonoSingleton.Instance).transform.position.y < 120f && lev.secondPhase) { Vector3 position = ((Component)MonoSingleton.Instance).transform.position; ((Vector3)(ref position)).Scale(new Vector3(1f, 0f, 1f)); NewMovement instance = MonoSingleton.Instance; Vector3 val = Vector3.up * 100f; Vector3 val2 = CyberArena.HorizontalCenter - position; val2 = val + ((Vector3)(ref val2)).normalized * (Vector3.Distance(CyberArena.HorizontalCenter, position) * 0.4f); instance.Launch(((Vector3)(ref val2)).normalized, Vector3.Distance(CyberArena.HorizontalCenter, position) * 0.65f, true); } } private void PostDeath(EventMethodCancelInfo cancelInfo, bool instakill) { if (!addDeadEnemyCalled) { addDeadEnemyCalled = true; ((Component)MonoSingleton.Instance).GetComponent().AddDeadEnemy(); } } } [BepInPlugin("nyxpiri.ultrakill.cybergrind-bosses", "Cybergrind Bosses", "0.0.0")] [BepInProcess("ULTRAKILL.exe")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class CybergrindBosses : BaseUnityPlugin { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static OnSceneWasLoadedEventHandler <>9__0_0; public static Action <>9__2_0; public static Action <>9__2_1; internal void b__0_0(Scene scene, string levelName, string unitySceneName) { if ((Object)(object)MonoSingleton.Instance != (Object)null) { GameObjectExtensions.GetOrAddComponent(((Component)MonoSingleton.Instance).gameObject); GameObjectExtensions.GetOrAddComponent(((Component)MonoSingleton.Instance).gameObject); } } internal void b__2_0(ToggleCheat cheat) { } internal void b__2_1(ToggleCheat cheat, CheatsManager cheatsManager) { } } public const string CheatID = "nyxpiri.cybergrind-bosses"; protected void Awake() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown //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) //IL_0051: Expected O, but got Unknown Log.Initialize(((BaseUnityPlugin)this).Logger); Options.Initialize((BaseUnityPlugin)(object)this); Assets.Initialize(); EnemyVariants.Initialize(); Cheats.ReadyForCheatRegistration += new ReadyForCheatRegistrationEventHandler(RegisterCheats); object obj = <>c.<>9__0_0; if (obj == null) { OnSceneWasLoadedEventHandler val = delegate { if ((Object)(object)MonoSingleton.Instance != (Object)null) { GameObjectExtensions.GetOrAddComponent(((Component)MonoSingleton.Instance).gameObject); GameObjectExtensions.GetOrAddComponent(((Component)MonoSingleton.Instance).gameObject); } }; <>c.<>9__0_0 = val; obj = (object)val; } ScenesEvents.OnSceneWasLoaded += (OnSceneWasLoadedEventHandler)obj; Harmony.CreateAndPatchAll(((object)this).GetType().Assembly, (string)null); } private void RegisterCheats(CheatsManager cheatsManager) { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Expected O, but got Unknown cheatsManager.RegisterCheat((ICheat)new ToggleCheat("Cybergrind Bosses", "nyxpiri.cybergrind-bosses", (Action)delegate { }, (Action)delegate { }), "CYBERGRIND"); } protected void Start() { } protected void FixedUpdate() { } protected void Update() { } protected void LateUpdate() { } } [HarmonyPatch(typeof(EndlessGrid), "GetEnemies")] public static class EndlessGridGetEnemiesPatch { public static bool Prefix(EndlessGrid __instance) { return true; } public static void Postfix(EndlessGrid __instance) { __instance.tempEnemyAmount += BossPicker.EnemyAmountToAdd; BossPicker.EnemyAmountToAdd = 0; } } internal static class Log { private static ManualLogSource _logger; internal static void Initialize(ManualLogSource logger) { Assert.IsNull((object)_logger, "Log.Initialize called when _logger wasn't null?"); _logger = logger; } public static void Fatal(object data) { _logger.LogFatal(data); } public static void Error(object data) { _logger.LogError(data); } public static void Warning(object data) { _logger.LogWarning(data); } public static void Message(object data) { _logger.LogMessage(data); } public static void Info(object data) { _logger.LogInfo(data); } public static void Debug(object data) { if (Options.LogDebugInfo.Value) { _logger.LogDebug(data); } } } public class BossPicker { public static FieldAccess pointsFi = new FieldAccess("points", BindingFlags.Instance | BindingFlags.NonPublic); public bool ShouldFakeFall = false; private int _wavesSinceFakeFall = 0; private int _currentFakeFallDelay = -10; private Dictionary SpawnCooldowns = new Dictionary(); private Dictionary SpawnCostBoosts = new Dictionary(); public Queue TypesToSpawn { get; private set; } = new Queue(); public HashSet SpawnedLastWave { get; private set; } = new HashSet(); internal static int EnemyAmountToAdd { get; set; } = 0; private void Reset() { SpawnCooldowns.Clear(); TypesToSpawn.Clear(); EnemyAmountToAdd = 0; } public void SolveBossesToSpawn(EndlessGrid endlessGrid) { //IL_053d: Unknown result type (might be due to invalid IL or missing references) //IL_0544: Invalid comparison between Unknown and I4 //IL_0556: Unknown result type (might be due to invalid IL or missing references) //IL_055d: Invalid comparison between Unknown and I4 Assert.IsTrue(Cheats.Enabled, ""); if (_currentFakeFallDelay < 0) { _currentFakeFallDelay = Random.Range(Options.ForcedFakeFallDelayMinWaves.Value, Options.ForcedFakeFallDelayMaxWaves.Value); } EnemyAmountToAdd = 0; TypesToSpawn.Clear(); int currentWave = endlessGrid.currentWave; int value = pointsFi.GetValue(endlessGrid); int num = Mathf.FloorToInt((float)value * Options.PointsRatioAllocatedToBosses.Value); int num2 = num; int num3 = 0; int num4 = 0; Dictionary dictionary = new Dictionary(); Log.Debug($"---------- deciding bosses to spawn with {num2} points (allPoints = {value}) -------------"); bool flag = false; bool flag2 = true; SpawnedLastWave.Clear(); if (Options.UseForcedFakeFall.Value && currentWave >= Options.ForcedFakeFallMinWave.Value && _wavesSinceFakeFall >= _currentFakeFallDelay) { flag = true; Log.Debug("Forcing fake fall!"); } List> list = Options.EnemyEntries.ToList(); HashSet hashSet = new HashSet(); for (int i = 0; i < Options.BossPickerIterations.Value; i++) { bool flag3 = (float)i >= (float)Options.BossPickerIterations.Value / 2f; CollectionSorting.Shuffle>((IList>)list); foreach (KeyValuePair item in list) { Options.EnemyEntry value2 = item.Value; Log.Debug($"{item.Key} being TESTED to spawn"); SpawnCostBoosts.TryAdd(item.Key, 0); SpawnCooldowns.TryAdd(item.Key, 0); if (!value2.Enabled.Value) { Log.Debug($"{item.Key} DENIED on the basis of being not enabled"); continue; } if (SpawnCooldowns[item.Key] > 0) { Log.Debug($"{item.Key} DENIED on the basis of wave cooldown {SpawnCooldowns[item.Key]}"); continue; } if (currentWave < value2.SpawnWave.Value) { Log.Debug($"{item.Key} DENIED on the basis of wave {currentWave} being less than {value2.SpawnWave.Value}"); continue; } if (!flag3) { float num5 = Mathf.Clamp(NyxMath.InverseNormalizeToRange((float)SpawnCooldowns[item.Key], -10f, 0f), 0.2f, 1f); if (Random.Range(0f, 1f) > num5) { Log.Debug($"{item.Key} DENIED on the basis of choose odds {num5}, 'cooldown' {SpawnCooldowns[item.Key]}"); continue; } } dictionary.TryAdd(item.Key, 0); int value3 = value2.SpawnCost.Value; int num6 = value3 + num3 + dictionary[item.Key] + SpawnCostBoosts[item.Key]; float num7 = NyxMath.NormalizeToRange((float)SpawnCostBoosts[item.Key], 0f, (float)item.Value.IndividualPersistentSpawnCostBoostMax.Value); int num8 = (int)((float)value3 * value2.SpawnCostSpentScalar.Value) + num4; if (item.Value.IndividualPersistentSpawnCostBoostMax.Value == 0) { num7 = 0f; } if (Random.Range(0f, 1f) < num7 || hashSet.Contains(item.Key)) { Log.Debug($"{item.Key} DENIED on the basis of {num7} rng roll not working out for it"); continue; } float num9 = (int)((float)value3 * value2.SpawnCostBonusScalar.Value); float num10 = num6; num10 *= value2.SpawnCostRequirementScalar.Value; foreach (AEnemyType item2 in TypesToSpawn) { Options.EnemyEntry enemyEntry = Options.EnemyEntries[item2]; int value4 = enemyEntry.SpawnCost.Value; float num11 = (float)value4 + ((float)num3 + num9) + (float)dictionary[item2] + (float)SpawnCostBoosts[item2]; float num12 = (float)num6 * enemyEntry.SpawnCostRequirementScalar.Value; if (num10 < num12) { Log.Debug($"{item.Key} opting to use {num12} as the spawn cost requirement due to previously queued to be spawned type ({item2})"); } num10 = Math.Max(num10, num12); } if ((float)num2 < num10) { Log.Debug($"{item.Key} DENIED on the basis of {num2} being less than {num10}"); continue; } if (((int)item.Key.VanillaEnumValue.GetValueOrDefault() == 30 || (int)item.Key.VanillaEnumValue.GetValueOrDefault() == 17) && (TypesToSpawn.Contains(MonoSingleton.Instance.GetVanillaType((EnemyType)30)) || TypesToSpawn.Contains(MonoSingleton.Instance.GetVanillaType((EnemyType)17)))) { Log.Debug($"{item.Key} DENIED on the basis of conflicting type being intended to spawn"); continue; } Options.EnemyAttributes enemyAttributes = Options.EnemiesAttributes.GetValueOrDefault(item.Key, null); if (enemyAttributes == null) { enemyAttributes = Options.EnemiesAttributes[MonoSingleton.Instance.GetVanillaType((EnemyType)3)]; Log.Warning($"{item.Key} doesn't have an attributes entry, falling back to Filth attributes entry"); } if (!enemyAttributes.CanSpawnInFakeFall.Value) { if (!flag && flag2) { Log.Debug($"{item.Key} selected and canBeFakeFall is true yet isFakeFall is false, can no longer be fake fall."); flag2 = false; } else if (flag) { continue; } } if (item.Key == MonoSingleton.Instance.GetVanillaType((EnemyType)42) && flag2) { Log.Debug("Geryon selected, we shall fake fall."); flag = true; } else if (item.Key == MonoSingleton.Instance.GetVanillaType((EnemyType)42) && !flag2) { Log.Debug("Geryon tried but we can't be fake fall, no fake fall"); continue; } SpawnedLastWave.Add(item.Key); num2 -= num8; num3 += (int)num9; num4 += (int)((float)(int)((float)value3 * value2.SpawnCostBonusScalar.Value) * value2.SpawnCostBonusSpentScalar.Value); dictionary[item.Key] += value2.IndividualCostIncreasePerSpawn.Value; TypesToSpawn.Enqueue(item.Key); EnemyAmountToAdd++; if (item.Key == EnemyVariants.TundraAgonyType) { EnemyAmountToAdd++; } ShouldFakeFall = flag; Log.Debug($"adding type {item.Key} to types to spawn for a cost of {num8} leaving {num2} points left (spawnCostBonus: {num3}, spawnCostBonusSpent: {num4})"); } } if (ShouldFakeFall) { Log.Debug($"ShouldFakeFall will == true, _wavesSinceFakeFall: {_wavesSinceFakeFall}, _currentFakeFallDelay: {_currentFakeFallDelay}"); _currentFakeFallDelay = Random.Range(Options.ForcedFakeFallDelayMinWaves.Value, Options.ForcedFakeFallDelayMaxWaves.Value); _wavesSinceFakeFall = 0; Log.Debug($"ShouldFakeFall == true, _wavesSinceFakeFall: {_wavesSinceFakeFall}, _currentFakeFallDelay: {_currentFakeFallDelay}"); } foreach (AEnemyType item3 in TypesToSpawn) { SpawnCostBoosts[item3] += Options.EnemyEntries[item3].IndividualPersistentSpawnCostBoost.Value; SpawnCostBoosts[item3] = Math.Clamp(SpawnCostBoosts[item3], 0, Options.EnemyEntries[item3].IndividualPersistentSpawnCostBoostMax.Value); SpawnCooldowns[item3] = Options.EnemyEntries[item3].SpawnCooldown.Value; } pointsFi.SetValue(endlessGrid, value - (num - num2)); Log.Debug($"--------- should spawn {TypesToSpawn.Count} bosses -------------"); } internal void UpdateForceFakeFallCooldown() { _wavesSinceFakeFall++; } internal void UpdateBossCooldowns() { Dictionary dictionary = new Dictionary(SpawnCooldowns); foreach (AEnemyType key in SpawnCooldowns.Keys) { if (!SpawnedLastWave.Contains(key)) { dictionary[key]--; } } Dictionary dictionary2 = new Dictionary(SpawnCostBoosts); foreach (AEnemyType key2 in SpawnCostBoosts.Keys) { if (!SpawnedLastWave.Contains(key2) && SpawnCooldowns.GetValueOrDefault(key2, 0) <= 0) { dictionary2[key2] -= Options.EnemyEntries[key2].IndividualPersistentSpawnCostBoostDecay.Value; dictionary2[key2] = Math.Max(dictionary2[key2], 0); } } SpawnCooldowns = dictionary; SpawnCostBoosts = dictionary2; } } public static class EnemyVariants { public static AEnemyType TundraAgonyType = (AEnemyType)new VanillaEnemyType("SWORDSMACHINE \"AGONY\" AND \"TUNDRA\"", "TundraAndAgony", (EnemyType)7); public static AEnemyType BloodTree = (AEnemyType)new VanillaEnemyType("Blood Tree", "BloodTree"); public static LeviathanController LeviathanPrefab = null; public static GameObject CorpseOfKingMinosPrefab = null; public static GameObject CentaurSecurityPrefab = null; public static BloodFiller BloodTreePrefab = null; private static GameObject prefabHolder = null; public static Geryon GeryonPrefab = null; public static FakeFallZone FakeFallZone = null; public static GameObject FakeFallZoneHud = null; public static GameObject SpawnAgonyAndTundra(Vector3 position, Quaternion rotation, Transform parent) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) return EnemyPrefabDatabase.TrySpawnAt(TundraAgonyType, position, rotation, parent, true); } internal static void Initialize() { LevelQuickLoader.AddQuickLoadLevel("Level 2-4"); LevelQuickLoader.AddQuickLoadLevel("Level 1-3"); LevelQuickLoader.AddQuickLoadLevel("Level 5-4"); LevelQuickLoader.AddQuickLoadLevel("Level 7-3"); LevelQuickLoader.AddQuickLoadLevel("Level 7-4"); LevelQuickLoader.AddQuickLoadLevel("Level 8-4"); Assets.AddAssetPicker((Func)delegate(MinosBoss minos) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown if (prefabHolder == null) { prefabHolder = new GameObject(); } Object.DontDestroyOnLoad((Object)(object)prefabHolder); prefabHolder.SetActive(false); CorpseOfKingMinosPrefab = Object.Instantiate(((Component)minos).gameObject, prefabHolder.transform); MinosBoss component3 = CorpseOfKingMinosPrefab.GetComponent(); component3.parryChallenge = false; return true; }); Assets.AddAssetPicker((Func)delegate(CombinedBossBar bb) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown if (prefabHolder == null) { prefabHolder = new GameObject(); } Object.DontDestroyOnLoad((Object)(object)prefabHolder); prefabHolder.SetActive(false); if (((Object)((Component)bb).gameObject).name != "SecuritySystem") { return false; } if (SceneHelper.CurrentScene != "Level 7-4") { return false; } CentaurSecurityPrefab = Object.Instantiate(((Component)bb).gameObject, prefabHolder.transform); return true; }); Assets.AddAssetPicker((Func)delegate(Geryon geryon) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown if (prefabHolder == null) { prefabHolder = new GameObject(); } Object.DontDestroyOnLoad((Object)(object)prefabHolder); prefabHolder.SetActive(false); GeryonPrefab = Object.Instantiate(geryon, prefabHolder.transform); return true; }); Assets.AddAssetPicker((Func)delegate(FakeFallZone ffz) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown if (prefabHolder == null) { prefabHolder = new GameObject(); } Object.DontDestroyOnLoad((Object)(object)prefabHolder); prefabHolder.SetActive(false); FakeFallZone = Object.Instantiate(ffz, prefabHolder.transform); return true; }); Assets.AddAssetPicker((Func)delegate(BloodFiller bf) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Expected O, but got Unknown if (prefabHolder == null) { prefabHolder = new GameObject(); } Object.DontDestroyOnLoad((Object)(object)prefabHolder); prefabHolder.SetActive(false); if (!((Object)((Component)bf).gameObject).name.Contains("ideTree")) { return false; } BloodTreePrefab = Object.Instantiate(bf, prefabHolder.transform); bf.onFullyFilled = new UltrakillEvent(); ((Component)BloodTreePrefab).gameObject.SetActive(false); return true; }); Assets.AddAssetPicker((Func)delegate(LeviathanController leviathan) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown if (prefabHolder == null) { prefabHolder = new GameObject(); } Object.DontDestroyOnLoad((Object)(object)prefabHolder); prefabHolder.SetActive(false); LeviathanPrefab = Object.Instantiate(leviathan, prefabHolder.transform); LeviathanPrefab.phaseChangeHealth = -10f; LeviathanPrefab.tailAddHealth = ((Component)LeviathanPrefab).GetComponent().health * 0.5f; return true; }); Assets.AddAssetPicker((Func)delegate(SwordsMachine sm) { //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Expected O, but got Unknown //IL_00fe: 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) Enemy component = ((Component)sm).GetComponent(); if ((Object)(object)component.symbiote == (Object)null) { return false; } string text = "SwordsMachine Tundra"; string text2 = "SwordsMachine Agony"; EnemyIdentifier component2 = ((Component)component).GetComponent(); if (((Object)component2).name == text || ((Object)component2).name == text2) { GameObject val = new GameObject(); val.SetActive(false); GameObject val2 = null; GameObject val3 = null; if (((Object)component2).name == text) { val2 = Object.Instantiate(((Component)component).gameObject, val.transform); val3 = Object.Instantiate(((Component)component.symbiote).gameObject, val.transform); } else if (((Object)component2).name == text2) { val3 = Object.Instantiate(((Component)component).gameObject, val.transform); val2 = Object.Instantiate(((Component)component.symbiote).gameObject, val.transform); } val2.transform.localPosition = Vector3.zero; val3.transform.localPosition = Vector3.zero; val2.GetComponent().symbiote = val3.GetComponent(); val3.GetComponent().symbiote = val2.GetComponent(); val2.SetActive(true); val3.SetActive(true); Object.DontDestroyOnLoad((Object)(object)val); EnemyPrefabDatabase.Instance.RegisterPrefab(TundraAgonyType, val); return true; } return false; }); } } public class GeryonTweaks : MonoBehaviour { [HarmonyPatch(typeof(Geryon), "PickAttack")] public static class GeryonPickAttackPatch { public static bool Prefix(Geryon __instance) { if (!Cheats.Enabled) { return true; } GeryonTweaks component = ((Component)__instance).GetComponent(); if ((Object)(object)component != (Object)null) { return component.PrePickAttack(); } return true; } public static void Postfix(Geryon __instance) { } } private Geryon _gery = null; private GameObject rotateAroundGo = null; private EnemyIdentifier eid = null; private FieldAccess inActionFA = new FieldAccess("inAction", BindingFlags.Instance | BindingFlags.NonPublic); private FieldAccess originalHealthFA = new FieldAccess("originalHealth", BindingFlags.Instance | BindingFlags.NonPublic); private FieldAccess playerPushBackerCooldownFA = new FieldAccess("playerPushBackerCooldown", BindingFlags.Instance | BindingFlags.NonPublic); private FieldAccess cooldownFA = new FieldAccess("cooldown", BindingFlags.Instance | BindingFlags.NonPublic); private FieldAccess minimumAroundDistanceFA = new FieldAccess("minimumAroundDistance", BindingFlags.Instance | BindingFlags.NonPublic); private FieldAccess maximumAroundDistanceFA = new FieldAccess("maximumAroundDistance", BindingFlags.Instance | BindingFlags.NonPublic); private FieldAccess playerBlockerShieldFA = new FieldAccess("playerBlockerShield", BindingFlags.Instance | BindingFlags.NonPublic); private FieldAccess rotateAroundFA = new FieldAccess("rotateAround", BindingFlags.Instance | BindingFlags.NonPublic); private MethodInfo WaveClap = typeof(Geryon).GetMethod("WaveClap", BindingFlags.Instance | BindingFlags.NonPublic); private MethodInfo BowForward = typeof(Geryon).GetMethod("BowForward", BindingFlags.Instance | BindingFlags.NonPublic); private FixedTimeStamp _distancePreventionWaveClapTimestamp = default(FixedTimeStamp); protected void Awake() { //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Expected O, but got Unknown _gery = ((Component)this).GetComponent(); eid = ((Component)this).GetComponent(); Collider[] componentsInChildren = playerBlockerShieldFA.GetValue(_gery).GetComponentsInChildren(); Collider[] array = componentsInChildren; foreach (Collider val in array) { val.enabled = false; } minimumAroundDistanceFA.SetValue(_gery, 82f); maximumAroundDistanceFA.SetValue(_gery, 92f); originalHealthFA.SetValue(_gery, eid.health); rotateAroundGo = new GameObject(); rotateAroundGo.transform.parent = ((Component)this).transform; rotateAroundFA.SetValue(_gery, rotateAroundGo.transform); } protected void Start() { originalHealthFA.SetValue(_gery, eid.health); } protected void FixedUpdate() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) playerPushBackerCooldownFA.SetValue(_gery, 99f); Vector3 position = ((Component)MonoSingleton.Instance).transform.position; ((Vector3)(ref position)).Scale(new Vector3(1f, 0f, 1f)); rotateAroundGo.transform.position = NyxMath.EaseInterpTo(rotateAroundGo.transform.position, position, 2f, Time.fixedDeltaTime); } private bool PrePickAttack() { //IL_0050: 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) if (!inActionFA.GetValue(_gery) && cooldownFA.GetValue(_gery) <= 0f) { bool flag = Vector3.Distance(playerBlockerShieldFA.GetValue(_gery).transform.position, eid.target.position) < 22f; if (flag && ((FixedTimeStamp)(ref _distancePreventionWaveClapTimestamp)).TimeSince < 4.0) { WaveClap.Invoke(_gery, null); ((FixedTimeStamp)(ref _distancePreventionWaveClapTimestamp)).UpdateToNow(); return false; } if (flag) { BowForward.Invoke(_gery, null); ((FixedTimeStamp)(ref _distancePreventionWaveClapTimestamp)).UpdateToNow(); return false; } } return true; } } [HarmonyPatch(typeof(FleshPrison), "SpawnInsignia")] public static class FleshPrisonSpawnInsigniaPatch { private static bool _isGrindBoss; private static void SetLocalScaleReplacement(Transform transform, Vector3 value) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) Action action = delegate { //IL_0008: Unknown result type (might be due to invalid IL or missing references) transform.localScale = value; }; if (!Cheats.Enabled) { action(); } else if (value.y != 2f) { action(); } else if (!_isGrindBoss) { action(); } else { transform.localScale = value * Options.FleshPrisonInsigniaSizeScalar.Value; } } private static IEnumerable Transpiler(IEnumerable instructions) { foreach (CodeInstruction instr in instructions) { if (CodeInstructionExtensions.Calls(instr, typeof(Transform).GetProperty("localScale").SetMethod)) { instr.operand = typeof(FleshPrisonSpawnInsigniaPatch).GetMethod("SetLocalScaleReplacement", BindingFlags.Static | BindingFlags.NonPublic); } yield return instr; } } public static bool Prefix(FleshPrison __instance) { if (!Cheats.Enabled) { _isGrindBoss = false; return true; } _isGrindBoss = (Object)(object)((Component)__instance).GetComponent() != (Object)null; return true; } public static void Postfix(FleshPrison __instance) { _isGrindBoss = false; } } public class GrindSecurity : MonoBehaviour { public EnemyComponents[] enemies = (EnemyComponents[])(object)new EnemyComponents[0]; public EnemyIdentifier[] eids = (EnemyIdentifier[])(object)new EnemyIdentifier[0]; public BossIdentifier bid = null; private bool _selfDestructing = false; public EnemyComponents IdolEnemy { get; private set; } = null; public Idol Idol { get; private set; } = null; protected void Awake() { EnemyComponents[] array = enemies; foreach (EnemyComponents val in array) { val.Health *= Options.EnemyEntries[MonoSingleton.Instance.GetVanillaType((EnemyType)35)].HealthScalar.Value; } } protected void Start() { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Expected O, but got Unknown //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0158: 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_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Expected O, but got Unknown //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0322: Unknown result type (might be due to invalid IL or missing references) //IL_032c: Unknown result type (might be due to invalid IL or missing references) //IL_0331: Unknown result type (might be due to invalid IL or missing references) //IL_0354: Unknown result type (might be due to invalid IL or missing references) //IL_0355: Unknown result type (might be due to invalid IL or missing references) //IL_035f: Unknown result type (might be due to invalid IL or missing references) //IL_0364: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_0246: 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_025b: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_0265: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_028e: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_02bf: Unknown result type (might be due to invalid IL or missing references) //IL_02c4: Unknown result type (might be due to invalid IL or missing references) //IL_02ca: Unknown result type (might be due to invalid IL or missing references) //IL_02dc: Unknown result type (might be due to invalid IL or missing references) //IL_02e1: Unknown result type (might be due to invalid IL or missing references) //IL_02f3: Unknown result type (might be due to invalid IL or missing references) if (!Cheats.Enabled) { return; } enemies = ((Component)this).GetComponentsInChildren(true); eids = ((Component)this).GetComponentsInChildren(true); bid = ((Component)this).GetComponentInChildren(true); IdolEnemy = EnemyPrefabDatabase.TrySpawnAt((EnemyType)21, ((Component)this).transform.position, Quaternion.identity, ((Component)this).transform, true).GetComponent(); Idol = ((Component)IdolEnemy).GetComponent(); IdolEnemy.Eid.Bless(false); IdolEnemy.Eid.dontCountAsKills = true; ((Component)Idol).gameObject.transform.localScale = Vector3.one * 1E-05f; Collider[] componentsInChildren = ((Component)Idol).GetComponentsInChildren(); Collider[] array = componentsInChildren; foreach (Collider val in array) { val.enabled = false; } ((Component)IdolEnemy).gameObject.SetActive(true); IdolEnemy.PostDeath += (PostDeathEventHandler)delegate { Defeated(); }; Vector3 position = ((Component)bid).transform.parent.position; Vector3 val2 = ((Component)this).transform.position - position; Transform parent = ((Component)bid).transform.parent; parent.position += val2; Vector3 val3 = ((Component)bid).transform.parent.position + Vector3.right * 1.75f; EnemyIdentifier[] array2 = eids; foreach (EnemyIdentifier val4 in array2) { val4.onDeath.AddListener((UnityAction)delegate { CheckIfDefeated(); }); if (!((Component)val4).gameObject.transform.IsChildOf(((Component)bid).transform.parent)) { Transform transform = ((Component)val4).gameObject.transform; transform.position += val2; } if (!((Object)((Component)val4).gameObject).name.Contains("Mainframe")) { ((Component)val4).transform.position = val3 + Vector3.Scale(((Component)val4).transform.position - val3, new Vector3(-1f, 1f, 0f)); ((Component)val4).transform.position = Vector3.Lerp(((Component)val4).gameObject.transform.position, val3, 0.35f); float y = ((Component)val4).transform.position.y; ((Component)val4).transform.position = Vector3.Lerp(((Component)val4).gameObject.transform.position, val3, 0.5f); Vector3 position2 = ((Component)val4).transform.position; position2.y = y; ((Component)val4).transform.position = position2; } val4.dontCountAsKills = true; } Transform transform2 = ((Component)this).transform; transform2.position += Vector3.right * 0f; ContinuousBeam componentInChildren = ((Component)this).GetComponentInChildren(); ((Component)Idol).gameObject.transform.position = val3 + Vector3.up * 12f; } protected void FixedUpdate() { if (!Cheats.Enabled) { return; } EnemyIdentifier[] array = eids; foreach (EnemyIdentifier val in array) { if (val.blessed) { val.Unbless(false); } } } private void CheckIfDefeated() { EnemyComponents[] array = enemies; foreach (EnemyComponents val in array) { if (!val.Eid.Dead) { return; } } Defeated(); } private void Defeated() { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) if (!_selfDestructing) { _selfDestructing = true; GameObject val = Object.Instantiate(Assets.ExplosionPrefab, ((Component)this).transform.parent); val.transform.position = ((Component)this).transform.position + Vector3.down; Explosion componentInChildren = val.GetComponentInChildren(); componentInChildren.ignite = false; componentInChildren.harmless = true; componentInChildren.damage = 0; componentInChildren.pushForceMultiplier = 0f; componentInChildren.friendlyFire = true; val.SetActive(true); ((Component)MonoSingleton.Instance).GetComponent().AddDeadEnemy(); ((MonoBehaviour)this).Invoke("SelfDestruct", 0.25f); } } private void SelfDestruct() { Object.Destroy((Object)(object)((Component)this).gameObject); } } public class GrindTree : MonoBehaviour { private GoreZone _goreZone; public float TotalWaveHP = 0f; private RegistrationTracker activeRegTracker = null; private bool _beenFilled = false; private HashSet _trackedEnemies = new HashSet(); private FixedTimeStamp StartTimestamp = default(FixedTimeStamp); private FixedTimeStamp SpawnFailsafeFilthTimestamp = default(FixedTimeStamp); private EnemyComponents _failSafeFilth = null; public static int NumActive { get; private set; } public BloodFiller Bf { get; private set; } = null; public EndlessGrid Eg { get; private set; } = null; public ActivateNextWave Anw { get; private set; } = null; public EnemyComponents DeathcatcherEnemy { get; private set; } = null; public Deathcatcher Deathcatcher { get; private set; } = null; public int NumEnemiesBesidesTrees => Eg.enemyAmount - Anw.deadEnemies - NumActive; protected void Awake() { //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Expected O, but got Unknown Bf = ((Component)this).GetComponent(); Eg = MonoSingleton.Instance; Anw = ((Component)Eg).GetComponent(); activeRegTracker = new RegistrationTracker((Func)delegate { if (Bf.fullyFilled) { return false; } NumActive++; return true; }, (Func)delegate { NumActive--; return true; }); } protected void Start() { //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_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: 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_0115: Expected O, but got Unknown //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Expected O, but got Unknown _goreZone = GoreZone.ResolveGoreZone(((Component)this).transform); CapsuleCollider[] componentsInChildren = ((Component)this).GetComponentsInChildren(); CapsuleCollider[] array = componentsInChildren; foreach (CapsuleCollider val in array) { if (!(((Object)((Component)val).gameObject).name != "Bloodcatcher")) { val.radius = Options.BloodTreeCatcherRadius.Value; val.height = Options.BloodTreeCatcherHeight.Value; } } DeathcatcherEnemy = EnemyPrefabDatabase.TrySpawnAt((EnemyType)39, ((Component)this).transform.position, Quaternion.identity, ((Component)this).transform, true).GetComponent(); Deathcatcher = ((Component)DeathcatcherEnemy).GetComponent(); DeathcatcherEnemy.Eid.Bless(false); DeathcatcherEnemy.Eid.dontCountAsKills = true; ((Component)Deathcatcher).gameObject.transform.localScale = Vector3.one * 1E-05f; Bf.onFullyFilled.onActivate.AddListener((UnityAction)delegate { OnFilled(); }); ((Component)DeathcatcherEnemy).gameObject.SetActive(true); DeathcatcherEnemy.PostDeath += (PostDeathEventHandler)delegate { OnFilled(trueFill: false); }; ((FixedTimeStamp)(ref StartTimestamp)).UpdateToNow(); } protected void OnEnable() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected O, but got Unknown activeRegTracker.Register(); Cybergrind.PreCybergrindNextWave += new CybergrindPreNextWaveEventHandler(OnNextWave); } protected void OnDisable() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected O, but got Unknown activeRegTracker.Unregister(); Cybergrind.PreCybergrindNextWave -= new CybergrindPreNextWaveEventHandler(OnNextWave); } protected void OnNextWave(EventMethodCanceler canceler, EndlessGrid endlessGrid) { Object.Destroy((Object)(object)((Component)this).gameObject); } private void OnFilled(bool trueFill = true) { //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: 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_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) if (_beenFilled) { return; } activeRegTracker.Unregister(); _beenFilled = true; ((Component)MonoSingleton.Instance).GetComponent().AddDeadEnemy(); if ((Object)(object)DeathcatcherEnemy != (Object)null) { FieldAccess val = default(FieldAccess); val..ctor("deathParticle", BindingFlags.Instance | BindingFlags.NonPublic); GameObject val2 = Object.Instantiate(val.GetValue(Deathcatcher), ((Component)this).transform.position + Vector3.up * 8f, Quaternion.identity, _goreZone.gibZone); val2.SetActive(true); Explosion componentInChildren = val2.GetComponentInChildren(); componentInChildren.pushForceMultiplier = 0f; Bloodsplatter val3 = default(Bloodsplatter); for (int i = 0; i < 8; i++) { GameObject gore = MonoSingleton.Instance.GetGore((GoreType)0, false, false, false, (i == 3) ? DeathcatcherEnemy.Eid : null, false); if (!Object.op_Implicit((Object)(object)gore)) { break; } gore.transform.position = ((Component)this).transform.position + Vector3.up * (float)(4 * i); if ((Object)(object)_goreZone.goreZone != (Object)null) { gore.transform.SetParent(_goreZone.goreZone, true); } gore.SetActive(true); if (gore.TryGetComponent(ref val3)) { val3.GetReady(); } } DeathcatcherEnemy.InstaDestroy(); } if (trueFill) { MonoSingleton.Instance.AddPoints(100, "MERCY", (GameObject)null, (EnemyIdentifier)null, -1, "", ""); } if ((Object)(object)_failSafeFilth != (Object)null && !_failSafeFilth.Eid.Dead) { _failSafeFilth.Eid.InstaKill(); } Object.Destroy((Object)(object)((Component)this).gameObject); } protected void FixedUpdate() { List currentEnemies = MonoSingleton.Instance.GetCurrentEnemies(); foreach (EnemyIdentifier item in currentEnemies) { if (!_trackedEnemies.Contains(item) && !item.puppet && !item.dead) { _trackedEnemies.Add(item); TotalWaveHP += ((Component)item).GetComponent().HighestHealth; } } float num = Options.BloodTreeEnemyCountFillSpeedBase.Value / Mathf.Max((float)MonoSingleton.Instance.enemyAmount, 5f); float num2 = Options.BloodTreeWaveHpFillSpeedBase.Value / Mathf.Max(TotalWaveHP, 10f); Bf.fillSpeed = Mathf.Lerp(num, num2, Options.BloodTreeFillSpeedBlend.Value); if (NumEnemiesBesidesTrees <= 3 && ((FixedTimeStamp)(ref SpawnFailsafeFilthTimestamp)).TimeSince >= (double)Mathf.Clamp(30f / ((float)((FixedTimeStamp)(ref StartTimestamp)).TimeSince + 1f), 0.5f, 40f)) { TrySpawnFailsafeFilth(); } } private void TrySpawnFailsafeFilth() { //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_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_failSafeFilth != (Object)null) || _failSafeFilth.Eid.Dead) { GameObject val = EnemyPrefabDatabase.TrySpawnAt((EnemyType)3, ((Component)this).transform.position + Vector3.up, Quaternion.identity, ((Component)MonoSingleton.Instance).transform, true); EnemyComponents component = val.GetComponent(); component.Eid.dontCountAsKills = true; component.Eid.PuppetSpawn(); ((FixedTimeStamp)(ref SpawnFailsafeFilthTimestamp)).UpdateToNow(); _failSafeFilth = component; } } } public static class Options { public class EnemyEntry { public ConfigEntry Enabled = null; public ConfigEntry SpawnCost = null; public ConfigEntry SpawnCostBonusScalar = null; public ConfigEntry SpawnCostBonusSpentScalar = null; public ConfigEntry SpawnCostRequirementScalar = null; public ConfigEntry SpawnCostSpentScalar = null; public ConfigEntry SpawnWave = null; public ConfigEntry HealthScalar = null; public ConfigEntry SpawnCooldown = null; public ConfigEntry IndividualCostIncreasePerSpawn = null; public ConfigEntry IndividualPersistentSpawnCostBoostMax = null; public ConfigEntry IndividualPersistentSpawnCostBoostDecay = null; public ConfigEntry IndividualPersistentSpawnCostBoost = null; public ConfigEntry ShowBossBar { get; internal set; } } public class EnemyAttributes { public ConfigEntry CanSpawnInFakeFall = null; public ConfigEntry FakeFallSpawnCost = null; public ConfigEntry FakeFallSpawnCostIncreasePerSpawn = null; public ConfigEntry FakeFallDespawnValue = null; } public static Dictionary EnemyEntries = new Dictionary(); public static Dictionary EnemiesAttributes = new Dictionary(); public static bool EnemyEntriesInitialized = false; public static ConfigEntry BloodTreeEnemyCountFillSpeedBase = null; public static ConfigEntry BloodTreeWaveHpFillSpeedBase = null; public static ConfigEntry BloodTreeFillSpeedBlend = null; public static ConfigEntry BloodTreeCatcherRadius = null; public static ConfigEntry BloodTreeCatcherHeight = null; public static ConfigEntry UseForcedFakeFall = null; public static ConfigEntry ForcedFakeFallMinWave = null; public static ConfigEntry ForcedFakeFallDelayMinWaves = null; public static ConfigEntry ForcedFakeFallDelayMaxWaves = null; private static ConfigFile _config = null; private static ConfigFileManager _configFileManager; public static ConfigEntry BossPickerIterations { get; private set; } = null; public static ConfigEntry PointsRatioAllocatedToBosses { get; private set; } = null; public static ConfigEntry BossWaveCooldownMin { get; private set; } = null; public static ConfigEntry BossWaveCooldownMax { get; private set; } public static ConfigEntry OnlyCountBossWavesTowardsBossCooldowns { get; private set; } public static ConfigEntry MaxGenericBoostHelpersPerEnemy { get; private set; } public static ConfigEntry UseBossWaveCooldown { get; private set; } public static ConfigEntry LogDebugInfo { get; private set; } public static ConfigEntry FleshPrisonInsigniaSizeScalar { get; private set; } public static ConfigEntry MinosPrimeFallOffArenaDamage { get; private set; } public static ConfigEntry SisyphusPrimeFallOffArenaDamage { get; private set; } public static ConfigEntry V2FallOffArenaDamage { get; private set; } internal static void Initialize(BaseUnityPlugin plugin) { Assert.IsNotNull((Object)(object)plugin, ""); _config = plugin.Config; _configFileManager = ((Component)plugin).gameObject.AddComponent(); _configFileManager.Initialize(_config); ConfigFileManager configFileManager = _configFileManager; configFileManager.OnReload = (Action)Delegate.Combine(configFileManager.OnReload, new Action(Reload)); LogDebugInfo = _config.Bind("Logging", "LogDebugInfo", true, (ConfigDescription)null); UseForcedFakeFall = _config.Bind("FakeFall", "UseForcedFakeFall", false, (ConfigDescription)null); ForcedFakeFallMinWave = _config.Bind("FakeFall", "ForcedFakeFallMinWave", 30, (ConfigDescription)null); ForcedFakeFallDelayMinWaves = _config.Bind("FakeFall", "ForcedFakeFallDelayMinWaves", 9, (ConfigDescription)null); ForcedFakeFallDelayMaxWaves = _config.Bind("FakeFall", "ForcedFakeFallDelayMaxWaves", 12, (ConfigDescription)null); BossPickerIterations = _config.Bind("General", "BossPickerIterations", 6, (ConfigDescription)null); PointsRatioAllocatedToBosses = _config.Bind("General", "PointsRatioAllocatedToBosses", 0.5f, (ConfigDescription)null); BossWaveCooldownMin = _config.Bind("General", "GlobalBossWaveCooldownMin", 1, (ConfigDescription)null); BossWaveCooldownMax = _config.Bind("General", "GlobalBossWaveCooldownMax", 1, (ConfigDescription)null); UseBossWaveCooldown = _config.Bind("General", "UseGlobalBossWaveCooldown", true, (ConfigDescription)null); OnlyCountBossWavesTowardsBossCooldowns = _config.Bind("General", "OnlyCountBossWavesTowardsBossCooldowns", true, (ConfigDescription)null); MaxGenericBoostHelpersPerEnemy = _config.Bind("General", "MaxGenericBoostHelpersPerEnemy", 5, (ConfigDescription)null); AddEnemyType((EnemyType)42, enabled: true, 150, 30, showBossBar: true, 0.5f, 4, 0.5f, 0.75f, 1f, 1f, 10000, 350, 350, 70); AddEnemyType((EnemyType)23, enabled: true, 250, 1, showBossBar: true, 1f, 10, 0f, 1f, 1f, 0f, 10000, 0, 0, 0); AddEnemyType((EnemyType)24, enabled: true, 350, 30, showBossBar: true, 1f, 15, 0f, 1f, 1f, 0f, 10000, 0, 0, 0); AddEnemyType((EnemyType)25, enabled: true, 220, 40, showBossBar: true, 1f, 30, 0.4f, 1f, 1f, 0.5f, 10000, 0, 0, 0); AddEnemyType(EnemyVariants.TundraAgonyType, enabled: true, 10, 2, showBossBar: true, 1f, 1, 0.5f, 1f, 1f, 1f, 10000, 45, 45, 15); AddEnemyType(EnemyVariants.BloodTree, enabled: true, 120, 20, showBossBar: true, 1f, 1, 0.25f, 1f, 1f, 1f, 25, 140, 140, 50); AddEnemyType((EnemyType)8, enabled: true, 18, 4, showBossBar: true, 1f, 1, 1.2f, 0.5f, 1f, 1f, 10000, 18, 18, 6); V2FallOffArenaDamage = _config.Bind("Boss.V2", "FallOffArenaDamage", 6, (ConfigDescription)null); AddEnemyType((EnemyType)22, enabled: true, 45, 10, showBossBar: true, 1f, 2, 0.75f, 0.5f, 1f, 1f, 10000, 45, 45, 15); AddEnemyType((EnemyType)16, enabled: true, 35, 8, showBossBar: true, 1f, 1, 0.75f, 1f, 1f, 1f, 10000, 35, 35, 10); AddEnemyType((EnemyType)28, enabled: true, 90, 20, showBossBar: true, 1f, 2, 0.35f, 1f, 1f, 1f, 10000, 120, 120, 65); AddEnemyType((EnemyType)27, enabled: true, 65, 18, showBossBar: true, 1f, 3, 0.4f, 1f, 1f, 1f, 10000, 100, 100, 40); AddEnemyType((EnemyType)11, enabled: true, 50, 15, showBossBar: true, 1f, 4, 0.6f, 1f, 1f, 1f, 10000, 70, 70, 30); AddEnemyType((EnemyType)32, enabled: true, 75, 30, showBossBar: true, 1f, 3, 0.35f, 1f, 1f, 1f, 10000, 300, 300, 75); AddEnemyType((EnemyType)17, enabled: true, 140, 35, showBossBar: true, 0.6f, 4, 0.4f, 1f, 1f, 1f, 10000, 250, 300, 70); AddEnemyType((EnemyType)30, enabled: true, 175, 45, showBossBar: true, 0.6f, 6, 0.55f, 1f, 1f, 1f, 10000, 240, 300, 40); AddEnemyType((EnemyType)18, enabled: true, 175, 35, showBossBar: true, 1f, 2, 0.5f, 1f, 1f, 1f, 10000, 350, 350, 85); MinosPrimeFallOffArenaDamage = _config.Bind("Boss.MinosPrime", "FallOffArenaDamage", 14, (ConfigDescription)null); AddEnemyType((EnemyType)29, enabled: true, 185, 40, showBossBar: true, 1f, 2, 0.5f, 1f, 1f, 1f, 10000, 350, 350, 100); SisyphusPrimeFallOffArenaDamage = _config.Bind("Boss.SisyphusPrime", "FallOffArenaDamage", 20, (ConfigDescription)null); AddEnemyType((EnemyType)35, enabled: true, 80, 32, showBossBar: true, 0.5f, 2, 0.5f, 1f, 1f, 1f, 10000, 0, 0, 0); BloodTreeEnemyCountFillSpeedBase = _config.Bind("Boss.BloodTree", "EnemyCountFillSpeedBase", 1.85f, (ConfigDescription)null); BloodTreeWaveHpFillSpeedBase = _config.Bind("Boss.BloodTree", "WaveHpFillSpeedBase", 90f, (ConfigDescription)null); BloodTreeFillSpeedBlend = _config.Bind("Boss.BloodTree", "FillSpeedBlend", 0.65f, (ConfigDescription)null); BloodTreeCatcherRadius = _config.Bind("Boss.BloodTree", "BloodCatcherRadius", 12f, (ConfigDescription)null); BloodTreeCatcherHeight = _config.Bind("Boss.BloodTree", "BloodCatcherHeight", 46f, (ConfigDescription)null); FleshPrisonInsigniaSizeScalar = _config.Bind("Boss.FleshPrisons", "InsigniaSizeScalar", 0.5f, (ConfigDescription)null); AddEnemyAttribs(EnemyVariants.TundraAgonyType, canSpawnInFakeFall: false, 0, 0, 0); AddEnemyAttribs(EnemyVariants.BloodTree, canSpawnInFakeFall: false, 0, 0, 0); AddEnemyAttribs((EnemyType)37, canSpawnInFakeFall: false, 0, 0, 0); AddEnemyAttribs((EnemyType)35, canSpawnInFakeFall: false, 0, 0, 0); AddEnemyAttribs((EnemyType)23, canSpawnInFakeFall: true, 0, 0, 0); AddEnemyAttribs((EnemyType)0, canSpawnInFakeFall: false, 0, 0, 50); AddEnemyAttribs((EnemyType)39, canSpawnInFakeFall: false, 0, 0, 50); AddEnemyAttribs((EnemyType)1, canSpawnInFakeFall: true, 10, 5, 0); AddEnemyAttribs((EnemyType)26, canSpawnInFakeFall: false, 0, 0, 100); AddEnemyAttribs((EnemyType)3, canSpawnInFakeFall: false, 0, 0, 2); AddEnemyAttribs((EnemyType)30, canSpawnInFakeFall: false, 0, 0, 0); AddEnemyAttribs((EnemyType)17, canSpawnInFakeFall: false, 0, 0, 0); AddEnemyAttribs((EnemyType)16, canSpawnInFakeFall: true, 0, 0, 0); AddEnemyAttribs((EnemyType)28, canSpawnInFakeFall: true, 0, 0, 0); AddEnemyAttribs((EnemyType)42, canSpawnInFakeFall: true, 0, 0, 0); AddEnemyAttribs((EnemyType)33, canSpawnInFakeFall: false, 0, 0, 60); AddEnemyAttribs((EnemyType)34, canSpawnInFakeFall: false, 0, 0, 50); AddEnemyAttribs((EnemyType)2, canSpawnInFakeFall: false, 0, 0, 80); AddEnemyAttribs((EnemyType)21, canSpawnInFakeFall: false, 0, 0, 50); AddEnemyAttribs((EnemyType)27, canSpawnInFakeFall: false, 0, 0, 0); AddEnemyAttribs((EnemyType)4, canSpawnInFakeFall: false, 0, 0, 25); AddEnemyAttribs((EnemyType)25, canSpawnInFakeFall: true, 0, 0, 0); AddEnemyAttribs((EnemyType)31, canSpawnInFakeFall: false, 0, 0, 20); AddEnemyAttribs((EnemyType)5, canSpawnInFakeFall: true, 65, 65, 0); AddEnemyAttribs((EnemyType)11, canSpawnInFakeFall: false, 0, 0, 0); AddEnemyAttribs((EnemyType)18, canSpawnInFakeFall: false, 0, 0, 0); AddEnemyAttribs((EnemyType)32, canSpawnInFakeFall: false, 0, 0, 0); AddEnemyAttribs((EnemyType)41, canSpawnInFakeFall: false, 0, 0, 0); AddEnemyAttribs((EnemyType)40, canSpawnInFakeFall: true, 80, 80, 0); AddEnemyAttribs((EnemyType)38, canSpawnInFakeFall: true, 70, 70, 0); AddEnemyAttribs((EnemyType)36, canSpawnInFakeFall: false, 0, 0, 0); AddEnemyAttribs((EnemyType)14, canSpawnInFakeFall: false, 0, 0, 20); AddEnemyAttribs((EnemyType)19, canSpawnInFakeFall: false, 0, 0, 0); AddEnemyAttribs((EnemyType)29, canSpawnInFakeFall: false, 0, 0, 0); AddEnemyAttribs((EnemyType)15, canSpawnInFakeFall: false, 0, 0, 30); AddEnemyAttribs((EnemyType)12, canSpawnInFakeFall: false, 0, 0, 50); AddEnemyAttribs((EnemyType)13, canSpawnInFakeFall: false, 0, 0, 3); AddEnemyAttribs((EnemyType)6, canSpawnInFakeFall: false, 0, 0, 5); AddEnemyAttribs((EnemyType)7, canSpawnInFakeFall: false, 0, 0, 15); AddEnemyAttribs((EnemyType)20, canSpawnInFakeFall: false, 0, 0, 50); AddEnemyAttribs((EnemyType)8, canSpawnInFakeFall: false, 0, 0, 0); AddEnemyAttribs((EnemyType)22, canSpawnInFakeFall: false, 0, 0, 0); AddEnemyAttribs((EnemyType)24, canSpawnInFakeFall: true, 0, 0, 0); AddEnemyAttribs((EnemyType)9, canSpawnInFakeFall: true, 50, 25, 0); AddEnemyAttribs((EnemyType)10, canSpawnInFakeFall: false, 0, 0, 0); } private static void AddEnemyAttribs(EnemyType enemyType, bool canSpawnInFakeFall, int fakeFallSpawnCost, int fakeFallSpawnCostIncreasePerSpawn, int fakeFallDespawnValue) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) AddEnemyAttribs(MonoSingleton.Instance.GetVanillaType(enemyType), canSpawnInFakeFall, fakeFallSpawnCost, fakeFallSpawnCostIncreasePerSpawn, fakeFallDespawnValue); } private static void AddEnemyAttribs(AEnemyType enemyType, bool canSpawnInFakeFall, int fakeFallSpawnCost, int fakeFallSpawnCostIncreasePerSpawn, int fakeFallDespawnValue) { EnemyAttributes enemyAttributes = new EnemyAttributes(); enemyAttributes.CanSpawnInFakeFall = _config.Bind("Attributes." + enemyType.Name, "CanSpawnInFakeFall", canSpawnInFakeFall, $"set if {enemyType} can spawn/exist in fake falls"); enemyAttributes.FakeFallSpawnCost = _config.Bind("Attributes." + enemyType.Name, "FakeFallSpawnCost", fakeFallSpawnCost, $"the amount of fake fall points {enemyType} costs, if it can be spawned."); enemyAttributes.FakeFallDespawnValue = _config.Bind("Attributes." + enemyType.Name, "FakeFallDespawnValue", fakeFallDespawnValue, $"the amount of fake fall points {enemyType} will be worth when despawned, if it cannot be kept yet spawned"); enemyAttributes.FakeFallSpawnCostIncreasePerSpawn = _config.Bind("Attributes." + enemyType.Name, "FakeFallSpawnCostIncreasePerSpawn", fakeFallSpawnCostIncreasePerSpawn, $"the amount of extra fake fall points {enemyType} will cost when it is spawned"); EnemiesAttributes.TryAdd(enemyType, enemyAttributes); } private static void AddEnemyType(EnemyType enemyType, bool enabled, int spawnCost, int spawnWave, bool showBossBar, float healthScalar, int spawnCooldown, float spawnCostBonusScalar, float spawnCostBonusSpentScalar, float spawnCostRequirementScalar, float spawnCostSpentScalar, int individualCostIncreasePerSpawn, int individualPersistentSpawnCostBoost, int individualPersistentSpawnCostBoostMax, int individualPersistentSpawnCostBoostDecay) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) AddEnemyType(MonoSingleton.Instance.GetVanillaType(enemyType), enabled, spawnCost, spawnWave, showBossBar, healthScalar, spawnCooldown, spawnCostBonusScalar, spawnCostRequirementScalar, spawnCostSpentScalar, spawnCostBonusSpentScalar, individualCostIncreasePerSpawn, individualPersistentSpawnCostBoost, individualPersistentSpawnCostBoostMax, individualPersistentSpawnCostBoostDecay); } private static void AddEnemyType(AEnemyType enemyType, bool enabled, int spawnCost, int spawnWave, bool showBossBar, float healthScalar, int spawnCooldown, float spawnCostBonusScalar, float spawnCostRequirementScalar, float spawnCostSpentScalar, float spawnCostBonusSpentScalar, int individualCostIncreasePerSpawn, int individualPersistentSpawnCostBoost, int individualPersistentSpawnCostBoostMax, int individualPersistentSpawnCostBoostDecay) { if (!EnemyEntries.ContainsKey(enemyType)) { EnemyEntry enemyEntry = new EnemyEntry(); enemyEntry.Enabled = _config.Bind($"Boss.{enemyType}", "Enabled", enabled, $"Sets whether {enemyType} bosses are enabled and will spawn in the Cybergrind with the cheat active."); enemyEntry.SpawnCost = _config.Bind($"Boss.{enemyType}", "SpawnCost", spawnCost, $"Sets the base amount of spawn points {enemyType} costs"); enemyEntry.SpawnWave = _config.Bind($"Boss.{enemyType}", "SpawnWave", spawnWave, $"Sets the minimum wave that must be reached before {enemyType} can spawn."); enemyEntry.ShowBossBar = _config.Bind($"Boss.{enemyType}", "ShowBossBar", showBossBar, $"Toggles if {enemyType} has a bossbar. if applicable"); enemyEntry.HealthScalar = _config.Bind($"Boss.{enemyType}", "HealthScalar", healthScalar, $"Scales (multiplies) {enemyType} base health by this value when spawned"); enemyEntry.SpawnCooldown = _config.Bind($"Boss.{enemyType}", "SpawnCooldown", spawnCooldown, $"A cooldown in the form of a number of waves before {enemyType} can spawn again"); enemyEntry.SpawnCostBonusScalar = _config.Bind($"Boss.{enemyType}", "SpawnCostBonusScalar", spawnCostBonusScalar, $"When {enemyType} is picked to spawn in a wave, their base cost scaled by this value will be added as required cost for every other boss tried to be spawned that wave"); enemyEntry.SpawnCostBonusSpentScalar = _config.Bind($"Boss.{enemyType}", "SpawnCostBonusSpentScalar", spawnCostBonusSpentScalar, $"Scalar for the amount of bonus cost will be added to the full bonus spent cost pool for this wave. This effects how many extra points after {enemyType} will actually be spent, regardless of the base requirement. (using 'SpawnCost * SpawnCostBonusSpentScalar' as a base) "); enemyEntry.SpawnCostRequirementScalar = _config.Bind($"Boss.{enemyType}", "SpawnCostRequirementScalar", spawnCostRequirementScalar, $"Scalar for the required points that {enemyType} will cost (doesn't effect how much is *spent*)"); enemyEntry.SpawnCostSpentScalar = _config.Bind($"Boss.{enemyType}", "SpawnCostSpentScalar", spawnCostSpentScalar, $"Scalar for the points that {enemyType} will cost and be spent (doesn't effect how much is *required*)"); enemyEntry.IndividualCostIncreasePerSpawn = _config.Bind($"Boss.{enemyType}", "IndividualCostIncreasePerSpawn", individualCostIncreasePerSpawn, $"Additional amount that {enemyType} will cost within the same single wave for each time it is selected in that specific wave"); enemyEntry.IndividualPersistentSpawnCostBoost = _config.Bind($"Boss.{enemyType}", "IndividualPersistentSpawnCostBoost", individualPersistentSpawnCostBoost, $"Similar to IndividualCostIncreasePerSpawn, except the increase from this persists across waves. It is not spent, however the closer it is to the max value the lower the odds of {enemyType} being picked"); enemyEntry.IndividualPersistentSpawnCostBoostMax = _config.Bind($"Boss.{enemyType}", "IndividualPersistentSpawnCostBoostMax", individualPersistentSpawnCostBoostMax, $"Maximum spawn cost boost that can be built up for {enemyType}"); enemyEntry.IndividualPersistentSpawnCostBoostDecay = _config.Bind($"Boss.{enemyType}", "IndividualPersistentSpawnCostBoostDecay", individualPersistentSpawnCostBoostDecay, $"Amount of spawn cost boost that is lost per wave for {enemyType}"); EnemyEntries.Add(enemyType, enemyEntry); } } private static void Reload() { } }