Decompiled source of BananasDifficulty v1.0.4
BananaDifficulty.dll
Decompiled a month ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text.RegularExpressions; using BananaDifficulty.Patches; using BananaDifficulty.Utils; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using Discord; using HarmonyLib; using TMPro; using UnityEngine; using UnityEngine.AI; using UnityEngine.AddressableAssets; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.ResourceManagement.AsyncOperations; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("BananaDifficulty")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("BananaDifficulty")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("b7996125-3626-439e-a969-9dd238d5335f")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace BananaDifficulty { [BepInPlugin("com.michi.BananaDifficulty", "BananaDifficulty", "1.0.0")] public class BananaDifficultyPlugin : BaseUnityPlugin { [CompilerGenerated] private sealed class <>c__DisplayClass27_0<T> { public AsyncOperationHandle<T> handle; internal bool <LoadAddressable>b__0() { return handle.IsDone; } } [CompilerGenerated] private sealed class <LoadAddressable>d__27<T> : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public Action<T> onLoad; public string path; public BananaDifficultyPlugin <>4__this; private <>c__DisplayClass27_0<T> <>8__1; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <LoadAddressable>d__27(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = null; <>1__state = -2; } private bool MoveNext() { //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_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>8__1 = new <>c__DisplayClass27_0<T>(); <>8__1.handle = Addressables.LoadAssetAsync<T>((object)path); <>2__current = (object)new WaitUntil((Func<bool>)(() => <>8__1.handle.IsDone)); <>1__state = 1; return true; case 1: <>1__state = -1; onLoad(<>8__1.handle.Result); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private const string MyGUID = "com.michi.BananaDifficulty"; private const string PluginName = "BananaDifficulty"; private const string VersionString = "1.0.0"; private static readonly Harmony Harmony = new Harmony("com.michi.BananaDifficulty"); public static ManualLogSource Log = new ManualLogSource("BananaDifficulty"); public static ConfigEntry<bool> HardMode; public static GameObject projBeam; public static GameObject projHoming; public static GameObject idol; public static GameObject RocketEnemy; public static GameObject snakeProj; public static GameObject insignificant; public static GameObject bigExplosion; public static GameObject blackHole; public static GameObject spear; public static GameObject v2FlashUnpariable; public static GameObject summonedSwords; public static GameObject homingHH; public static GameObject homingBlue; public static Material WhiplashMat; public static GameObject WhiplashThrow; public static AudioClip WhiplashLoop; private void Awake() { ((BaseUnityPlugin)this).Logger.LogInfo((object)"PluginName: BananaDifficulty, VersionString: 1.0.0 is loading..."); Harmony.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"PluginName: BananaDifficulty, VersionString: 1.0.0 is loaded."); SceneManager.activeSceneChanged += SceneManager_activeSceneChanged; ((Object)((Component)this).gameObject).hideFlags = (HideFlags)4; Log = ((BaseUnityPlugin)this).Logger; HardMode = ((BaseUnityPlugin)this).Config.Bind<bool>("Difficulty Settings", "Hard Mode", false, "Makes virtue beams appear on every side, have double shockwaves, and also makes schisms fire thrice as many projectiles."); GetAssets(); GetBundleAssets(); } private void SceneManager_activeSceneChanged(Scene arg0, Scene arg1) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) string text = "b3e7f2f8052488a45b35549efb98d902"; Scene activeScene = SceneManager.GetActiveScene(); Scene val = activeScene; string name = ((Scene)(ref val)).name; if (name == text) { MakeTheNewDifficulty(); } } public static bool CanUseIt(int difficulty) { if (difficulty < 0) { difficulty = MonoSingleton<PrefsManager>.Instance.GetInt("difficulty", 0); } return difficulty == 5; } public void GetBundleAssets() { Assembly executingAssembly = Assembly.GetExecutingAssembly(); spear = AssetBundle.LoadFromStream(executingAssembly.GetManifestResourceStream("BananaDifficulty.Bundles.v2spear")).LoadAsset<GameObject>("V2Spear"); } public void GetAssets() { ((MonoBehaviour)this).StartCoroutine(LoadAddressable(delegate(GameObject x) { projBeam = x; }, "Assets/Prefabs/Attacks and Projectiles/Hitscan Beams/Projectile Beam.prefab")); ((MonoBehaviour)this).StartCoroutine(LoadAddressable(delegate(GameObject x) { projHoming = x; }, "Assets/Prefabs/Attacks and Projectiles/Projectile Homing.prefab")); ((MonoBehaviour)this).StartCoroutine(LoadAddressable(delegate(GameObject x) { idol = x; }, "Assets/Prefabs/Enemies/Idol.prefab")); ((MonoBehaviour)this).StartCoroutine(LoadAddressable(delegate(GameObject x) { RocketEnemy = x; }, "Assets/Prefabs/Attacks and Projectiles/RocketEnemy.prefab")); ((MonoBehaviour)this).StartCoroutine(LoadAddressable(delegate(GameObject x) { snakeProj = x; }, "Assets/Prefabs/Attacks and Projectiles/Projectile Minos Prime Snake.prefab")); ((MonoBehaviour)this).StartCoroutine(LoadAddressable(delegate(GameObject x) { insignificant = x; }, "Virtue Insignia")); ((MonoBehaviour)this).StartCoroutine(LoadAddressable(delegate(GameObject x) { bigExplosion = x; }, "Assets/Prefabs/Attacks and Projectiles/Explosions/Explosion Big.prefab")); ((MonoBehaviour)this).StartCoroutine(LoadAddressable(delegate(GameObject x) { blackHole = x; }, "Assets/Prefabs/Attacks and Projectiles/Black Hole Projectile.prefab")); ((MonoBehaviour)this).StartCoroutine(LoadAddressable(delegate(GameObject x) { v2FlashUnpariable = x; }, "Assets/Particles/Flashes/V2FlashUnparriable.prefab")); ((MonoBehaviour)this).StartCoroutine(LoadAddressable(delegate(GameObject x) { summonedSwords = x; }, "Assets/Prefabs/Attacks and Projectiles/Gabriel/GabrielSummonedSwords.prefab")); ((MonoBehaviour)this).StartCoroutine(LoadAddressable(delegate(GameObject x) { homingBlue = x; }, "Assets/Prefabs/Attacks and Projectiles/Projectile Homing.prefab")); ((MonoBehaviour)this).StartCoroutine(LoadAddressable(delegate(GameObject x) { homingHH = x; }, "Assets/Prefabs/Attacks and Projectiles/Projectile Explosive HH.prefab")); ((MonoBehaviour)this).StartCoroutine(LoadAddressable(delegate(GameObject x) { WhiplashThrow = x; }, "Assets/Particles/SoundBubbles/HookArmThrow.prefab")); ((MonoBehaviour)this).StartCoroutine(LoadAddressable(delegate(Material x) { WhiplashMat = x; }, "Assets/Materials/SnaketrailOpaque.mat")); ((MonoBehaviour)this).StartCoroutine(LoadAddressable(delegate(AudioClip x) { WhiplashLoop = x; }, "Assets/Sounds/Weapons/Whiplash Throw Loop.wav")); } [IteratorStateMachine(typeof(<LoadAddressable>d__27<>))] public IEnumerator LoadAddressable<T>(Action<T> onLoad, string path) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <LoadAddressable>d__27<T>(0) { <>4__this = this, onLoad = onLoad, path = path }; } private void MakeTheNewDifficulty() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_025a: Expected O, but got Unknown //IL_0273: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_027a: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Expected O, but got Unknown Scene activeScene = SceneManager.GetActiveScene(); activeScene = SceneManager.GetActiveScene(); Scene val = activeScene; Transform val2 = (from obj in ((Scene)(ref val)).GetRootGameObjects() where ((Object)obj).name == "Canvas" select obj).First().transform.Find("Difficulty Select (1)").Find("Interactables"); GameObject val3 = Object.Instantiate<GameObject>(((Component)val2.Find("Brutal")).gameObject, val2); DifficultySelectButton component = val3.GetComponent<DifficultySelectButton>(); component.difficulty = 5; Transform transform = ((Component)component).transform; transform.position += new Vector3(700f, 0f); Button component2 = ((Component)component).GetComponent<Button>(); ((Selectable)component2).interactable = true; TextMeshProUGUI component3 = ((Component)((Component)component).transform.Find("Name")).gameObject.GetComponent<TextMeshProUGUI>(); ((TMP_Text)component3).text = "Bananas Difficulty"; ((Graphic)component3).color = Color.white; Transform val4 = FindDeepChild(((Component)component).transform.parent, "Brutal Info"); if ((Object)(object)val4 == (Object)null) { Debug.LogError((object)("Could not find 'Brutal Info' under " + ((Object)((Component)component).transform.parent).name)); return; } GameObject val5 = Object.Instantiate<GameObject>(((Component)val4).gameObject, val4.parent); Transform info = val5.transform; Transform val6 = info.Find("Text"); if ((Object)(object)val6 == (Object)null) { Debug.LogError((object)"Could not find 'Text' under 'Brutal Info'"); return; } ((Component)((Component)info).transform.Find("Text")).GetComponent<TMP_Text>().text = "<color=white>Mod made by banana to make it very VERY difficult\nFast enemies. Changed behaviour. Alot of projectiles. Alot of beams. And much much more."; TMP_Text component4 = ((Component)((Component)info).transform.Find("Title (1)")).GetComponent<TMP_Text>(); component4.fontSize = 29f; component4.text = "--BANANAS DIFFICULTY--"; EventTrigger val7 = ((Component)component).gameObject.GetComponent<EventTrigger>(); if ((Object)(object)val7 == (Object)null) { val7 = ((Component)component).gameObject.AddComponent<EventTrigger>(); } if ((Object)(object)info == (Object)null) { Debug.LogError((object)"Info object is null, cannot set up EventTrigger!"); return; } val7.triggers.Clear(); Entry val8 = new Entry { eventID = (EventTriggerType)0 }; ((UnityEvent<BaseEventData>)(object)val8.callback).AddListener((UnityAction<BaseEventData>)delegate { ((Component)info).gameObject.SetActive(true); }); Entry val9 = new Entry { eventID = (EventTriggerType)1 }; ((UnityEvent<BaseEventData>)(object)val9.callback).AddListener((UnityAction<BaseEventData>)delegate { ((Component)info).gameObject.SetActive(false); }); val7.triggers.Add(val8); val7.triggers.Add(val9); } private Transform FindDeepChild(Transform parent, string name) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown foreach (Transform item in parent) { Transform val = item; Debug.Log((object)("Checking child: " + ((Object)val).name)); if (((Object)val).name == name) { return val; } Transform val2 = FindDeepChild(val, name); if ((Object)(object)val2 != (Object)null) { return val2; } } Debug.LogWarning((object)("Child '" + name + "' not found under '" + ((Object)parent).name + "'")); return null; } } [HarmonyPatch(typeof(DiscordController), "SendActivity")] internal class DiscordController_SendActivity_Patch { private static bool Prefix(DiscordController __instance, ref Activity ___cachedActivity) { if (___cachedActivity.State != null && ___cachedActivity.State == "DIFFICULTY: UKMD") { Regex regex = new Regex("<[^>]*>"); string text = "DIFFICULTY: BANANAS"; if (regex.IsMatch(text)) { ___cachedActivity.State = regex.Replace(text, string.Empty); } else { ___cachedActivity.State = text; } } return true; } } [HarmonyPatch(typeof(PrefsManager), "EnsureValid")] public class MakeNewDifficulty { public static void Postfix(ref object __result, string key, object value) { if (key == "difficulty" && (int)value == 5) { __result = 5; } } } [HarmonyPatch(typeof(DifficultyTitle), "Check")] public class DifficultyTitle_Check_Patch { private static void Postfix(DifficultyTitle __instance) { if (__instance.txt2.text.Contains("ULTRAKILL MUST DIE")) { __instance.txt2.text = __instance.txt2.text.Replace("ULTRAKILL MUST DIE", "BANANAS DIFFICULTY"); } } } } namespace BananaDifficulty.Utils { public static class ModUtils { public static Vector3 GetRandomNavMeshPoint(Vector3 origin, float radius) { //IL_0001: 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) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_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_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0015: 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_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Random.insideUnitSphere * radius; val += origin; NavMeshHit val2 = default(NavMeshHit); if (NavMesh.SamplePosition(val, ref val2, radius, -1)) { return ((NavMeshHit)(ref val2)).position; } return origin; } } } namespace BananaDifficulty.Patches { [HarmonyPatch("SpawnBlackHole")] internal class DoubleBlackHoles { [HarmonyPatch(typeof(FleshPrison))] [HarmonyPostfix] public static void Awake_Postfix(FleshPrison __instance) { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) if (BananaDifficultyPlugin.CanUseIt(__instance.difficulty)) { GameObject val = Object.Instantiate<GameObject>(__instance.blackHole, ((Component)__instance).transform); val.transform.position = __instance.rotationBone.position + new Vector3(3f, 3f, 3f); BlackHoleProjectile component = val.GetComponent<BlackHoleProjectile>(); component.target = __instance.eid.target; if (Object.op_Implicit((Object)(object)component)) { component.safeType = (EnemyType)17; component.Activate(); } } } } [HarmonyPatch(typeof(VirtueInsignia))] internal class DoubleInsigna { [CompilerGenerated] private sealed class <SpawnInsignias>d__1 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public VirtueInsignia original; private VirtueInsignia <insi>5__1; private VirtueInsignia <insi2>5__2; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <SpawnInsignias>d__1(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <insi>5__1 = null; <insi2>5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Expected O, but got Unknown //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Expected O, but got Unknown //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.1f); <>1__state = 1; return true; case 1: { <>1__state = -1; <insi>5__1 = Object.Instantiate<VirtueInsignia>(original); ((Object)((Component)<insi>5__1).gameObject).name = "DoubleInsig1"; ((Component)<insi>5__1).transform.Rotate(new Vector3(0f, 0f, 90f)); Transform transform2 = ((Component)<insi>5__1).transform; transform2.localScale /= 3f; <insi>5__1.target = original.target; <>2__current = (object)new WaitForSeconds(0.1f); <>1__state = 2; return true; } case 2: { <>1__state = -1; <insi2>5__2 = Object.Instantiate<VirtueInsignia>(original); ((Object)((Component)<insi2>5__2).gameObject).name = "DoubleInsig2"; ((Component)<insi2>5__2).transform.Rotate(new Vector3(90f, 0f, 0f)); Transform transform = ((Component)<insi2>5__2).transform; transform.localScale /= 3f; <insi2>5__2.target = original.target; return false; } } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [HarmonyPatch("Start")] [HarmonyPostfix] public static void StartInsignia(VirtueInsignia __instance) { int difficulty = (((Object)(object)__instance.parentDrone != (Object)null) ? __instance.parentDrone.difficulty : (-1)); if (BananaDifficultyPlugin.CanUseIt(difficulty) && BananaDifficultyPlugin.HardMode.Value && !((Object)((Component)__instance).gameObject).name.StartsWith("DoubleInsig")) { ((MonoBehaviour)__instance).StartCoroutine(SpawnInsignias(__instance)); } } [IteratorStateMachine(typeof(<SpawnInsignias>d__1))] private static IEnumerator SpawnInsignias(VirtueInsignia original) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <SpawnInsignias>d__1(0) { original = original }; } } [HarmonyPatch(typeof(PhysicalShockwave))] internal class DoubleShockwaves { [HarmonyPatch("Start")] [HarmonyPostfix] public static void Awake_Prefix(PhysicalShockwave __instance) { //IL_006b: Unknown result type (might be due to invalid IL or missing references) if (BananaDifficultyPlugin.CanUseIt(-1) && !(((Object)((Component)__instance).gameObject).name == "DoubleShock") && BananaDifficultyPlugin.HardMode.Value) { PhysicalShockwave val = Object.Instantiate<PhysicalShockwave>(__instance); ((Object)((Component)val).gameObject).name = "DoubleShock"; ((Component)val).transform.Rotate(new Vector3(0f, 0f, 90f)); } } } [HarmonyPatch(typeof(Projectile))] internal class EveryProjectileHasABeam { public static List<ContinuousBeam> alreadyExistingBeams = new List<ContinuousBeam>(); public static List<Projectile> alreadyExistingProjs = new List<Projectile>(); [HarmonyPatch("Start")] [HarmonyPostfix] public static void Awake_Postfix(Projectile __instance) { //IL_00e0: 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_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) if (!BananaDifficultyPlugin.CanUseIt(__instance.difficulty) || __instance.decorative || __instance.friendly) { return; } alreadyExistingProjs.RemoveAll((Projectile x) => (Object)(object)x == (Object)null || !((Component)x).gameObject.activeInHierarchy); List<Projectile> list = alreadyExistingProjs.FindAll((Projectile x) => x.safeEnemyType == __instance.safeEnemyType); list.RemoveAll((Projectile x) => Vector3.Distance(((Component)x).transform.position, ((Component)__instance).transform.position) > 1000f); if ((Object)(object)BananaDifficultyPlugin.projBeam != (Object)null && list.Count > 0) { ContinuousBeam val = Object.Instantiate<ContinuousBeam>(BananaDifficultyPlugin.projBeam.GetComponent<ContinuousBeam>(), ((Component)__instance).transform.position, ((Component)__instance).transform.rotation, ((Component)__instance).transform); val.safeEnemyType = __instance.safeEnemyType; val.target = __instance.target; val.endPoint = ((Component)list[list.Count - 1]).transform; __instance.connectedBeams.Add(val); Projectile val2 = default(Projectile); if (((Component)((Component)list[list.Count - 1]).transform).TryGetComponent<Projectile>(ref val2)) { val2.connectedBeams.Add(val); } alreadyExistingBeams.Add(val); } alreadyExistingProjs.Add(__instance); } } [HarmonyPatch(typeof(ZombieProjectiles))] internal class ExponentialStray { [CompilerGenerated] private sealed class <FireProjectilesWithDelay>d__8 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public ZombieProjectiles __instance; public int count; private Vector3 <targetPosition>5__1; private float <angleStep>5__2; private int <i>5__3; private float <angle>5__4; private GameObject <newProjectile>5__5; private Projectile <componentInChildren>5__6; private Rigidbody <rb>5__7; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <FireProjectilesWithDelay>d__8(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <newProjectile>5__5 = null; <componentInChildren>5__6 = null; <rb>5__7 = null; <>1__state = -2; } private bool MoveNext() { //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_0171: 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_011b: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Expected O, but got Unknown //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; if ((Object)(object)__instance.currentDecProjectile != (Object)null) { Object.Destroy((Object)(object)__instance.currentDecProjectile); __instance.eid.weakPoint = __instance.origWP; } <targetPosition>5__1 = GetTargetPosition(__instance); <angleStep>5__2 = 360f / (float)count; <i>5__3 = 0; break; case 1: <>1__state = -1; <newProjectile>5__5 = null; <componentInChildren>5__6 = null; <rb>5__7 = null; <i>5__3++; break; } if (<i>5__3 < count) { <angle>5__4 = <angleStep>5__2 * (float)<i>5__3; <newProjectile>5__5 = Object.Instantiate<GameObject>(__instance.projectile, __instance.shootPos.position, Quaternion.identity); <componentInChildren>5__6 = <newProjectile>5__5.GetComponentInChildren<Projectile>(); if ((Object)(object)<componentInChildren>5__6 != (Object)null) { <componentInChildren>5__6.target = __instance.eid.target; <componentInChildren>5__6.safeEnemyType = (EnemyType)13; Projectile obj = <componentInChildren>5__6; obj.speed *= GetSpeedMultiplier(__instance.difficulty); Projectile obj2 = <componentInChildren>5__6; obj2.damage *= __instance.eid.totalDamageModifier; } <newProjectile>5__5.transform.LookAt(<targetPosition>5__1); <newProjectile>5__5.transform.Rotate(Vector3.up, <angle>5__4); <rb>5__7 = <newProjectile>5__5.GetComponent<Rigidbody>(); if ((Object)(object)<rb>5__7 != (Object)null) { <rb>5__7.AddForce(<newProjectile>5__5.transform.forward * 70f, (ForceMode)2); } <>2__current = (object)new WaitForSeconds(0.1f); <>1__state = 1; return true; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static readonly Dictionary<int, int> zombieThrowCounts = new Dictionary<int, int>(); [HarmonyPatch("ThrowProjectile", new Type[] { })] [HarmonyPostfix] public static void Awake_Prefix(ZombieProjectiles __instance) { //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_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Invalid comparison between Unknown and I4 //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Invalid comparison between Unknown and I4 if (!BananaDifficultyPlugin.CanUseIt(__instance.difficulty)) { return; } EnemyType enemyType = __instance.eid.enemyType; EnemyType val = enemyType; if ((int)val != 13) { if ((int)val == 15) { FireSoldier(__instance); } } else { FireStray(__instance); } } [HarmonyPatch("ShootProjectile")] [HarmonyPostfix] public static void Shoot_Postfix(ZombieProjectiles __instance) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Invalid comparison between Unknown and I4 if (BananaDifficultyPlugin.CanUseIt(__instance.difficulty) && BananaDifficultyPlugin.HardMode.Value) { EnemyType enemyType = __instance.eid.enemyType; EnemyType val = enemyType; if ((int)val == 14) { FireSchism(__instance); } } } private static void FireProjectileAtAngle(GameObject projectile, float angleOffset, ZombieProjectiles __instance) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) GameObject val = Object.Instantiate<GameObject>(projectile, projectile.transform.position, projectile.transform.rotation); val.transform.Rotate(Vector3.up, angleOffset); Projectile componentInChildren = val.GetComponentInChildren<Projectile>(); if ((Object)(object)componentInChildren != (Object)null) { componentInChildren.target = __instance.eid.target; } } private static void FireSchism(ZombieProjectiles __instance) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) __instance.currentProjectile = Object.Instantiate<GameObject>(__instance.projectile, __instance.shootPos.position, Quaternion.identity); Projectile componentInChildren = __instance.currentProjectile.GetComponentInChildren<Projectile>(); if ((Object)(object)componentInChildren != (Object)null) { componentInChildren.target = __instance.eid.target; componentInChildren.safeEnemyType = (EnemyType)14; componentInChildren.speed *= GetSpeedMultiplier(__instance.difficulty); componentInChildren.damage *= __instance.eid.totalDamageModifier; } Vector3 targetPosition = GetTargetPosition(__instance); __instance.currentProjectile.transform.LookAt(targetPosition); FireProjectileAtAngle(__instance.currentProjectile, -10f, __instance); } private static void FireSoldier(ZombieProjectiles __instance) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: 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) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005d: 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_0070: 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_0089: 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_0098: Unknown result type (might be due to invalid IL or missing references) GameObject val = Object.Instantiate<GameObject>(BananaDifficultyPlugin.RocketEnemy, __instance.shootPos.position, Quaternion.identity); Vector3 val2 = ((Component)MonoSingleton<CameraController>.instance).transform.position - val.transform.position; Vector3 normalized = ((Vector3)(ref val2)).normalized; Rigidbody component = val.GetComponent<Rigidbody>(); val2 = component.velocity; float magnitude = ((Vector3)(ref val2)).magnitude; component.velocity = normalized * magnitude; val.transform.forward = normalized; Transform transform = val.transform; transform.position += __instance.shootPos.forward * 3.5f; } private static void FireStray(ZombieProjectiles __instance) { int instanceID = ((Object)__instance).GetInstanceID(); if (!zombieThrowCounts.ContainsKey(instanceID)) { zombieThrowCounts[instanceID] = 1; return; } zombieThrowCounts[instanceID]++; int num = zombieThrowCounts[instanceID] * (zombieThrowCounts[instanceID] + 1) / 2; if (num > 1) { num = ((num >= 12) ? 12 : num); FireAdditionalProjectiles(__instance, num - 1); } } private static void FireAdditionalProjectiles(ZombieProjectiles __instance, int count) { ((MonoBehaviour)__instance).StartCoroutine(FireProjectilesWithDelay(__instance, count)); } [IteratorStateMachine(typeof(<FireProjectilesWithDelay>d__8))] private static IEnumerator FireProjectilesWithDelay(ZombieProjectiles __instance, int count) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <FireProjectilesWithDelay>d__8(0) { __instance = __instance, count = count }; } private static float GetSpeedMultiplier(int difficulty) { if (difficulty > 2) { return 1.35f; } return difficulty switch { 1 => 0.75f, 0 => 0.5f, _ => 1f, }; } private static Vector3 GetTargetPosition(ZombieProjectiles __instance) { //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_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) EnemyTarget target = __instance.eid.target; if (target != null && target.isPlayer) { if (__instance.difficulty >= 4) { return MonoSingleton<PlayerTracker>.Instance.PredictPlayerPosition(Vector3.Distance(((Component)__instance).transform.position, __instance.camObj.transform.position) / (float)((__instance.difficulty == 5) ? 90 : Random.Range(110, 180)), true, false); } return __instance.camObj.transform.position; } if (__instance.eid.target != null) { EnemyIdentifierIdentifier componentInChildren = ((Component)__instance.eid.target.targetTransform).GetComponentInChildren<EnemyIdentifierIdentifier>(); if (Object.op_Implicit((Object)(object)componentInChildren)) { return ((Component)componentInChildren).transform.position; } return __instance.eid.target.position; } return Vector3.zero; } } [HarmonyPatch(typeof(Guttertank))] internal class GutterTankNeverFall { [HarmonyPatch("PunchStop")] [HarmonyPrefix] public static bool Awake_Postfix(Guttertank __instance) { //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) if (!BananaDifficultyPlugin.CanUseIt(__instance.difficulty)) { return true; } __instance.sc.DamageStop(); __instance.moveForward = false; if ((!__instance.punchHit || __instance.difficulty < 3) && (__instance.difficulty >= 4 || __instance.punchHit) && (!__instance.punchHit || __instance.difficulty < 3)) { Vector3Int val = StainVoxelManager.WorldToVoxelPosition(((Component)__instance).transform.position + Vector3.down * 1.8333334f); bool flag = MonoSingleton<StainVoxelManager>.Instance.HasProxiesAt(val, 3, (VoxelCheckingShape)1, (ProxySearchMode)31, true); } __instance.punchCooldown = 0f; return false; } } [HarmonyPatch(typeof(Countdown))] internal class LowerCountdown { [HarmonyPatch("GetCountdownLength")] [HarmonyPostfix] public static void Awake_Postfix(Countdown __instance, float __result) { if (BananaDifficultyPlugin.CanUseIt(__instance.difficulty)) { __result -= __result * 0.15f; } } [HarmonyPatch("Start")] [HarmonyPostfix] public static void Start_Postfix(Countdown __instance) { if (BananaDifficultyPlugin.CanUseIt(__instance.difficulty) && __instance.time != 0f && __instance.done) { __instance.time -= __instance.time * 0.15f; } } } [HarmonyPatch(typeof(SpiderBody))] internal class MauriceMyBeloved { [HarmonyPatch("BeamFire")] [HarmonyPrefix] public static bool FuckTonOfBeams(SpiderBody __instance) { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) if (!BananaDifficultyPlugin.CanUseIt(__instance.difficulty)) { return true; } __instance.parryable = false; if (!__instance.eid.dead) { __instance.currentBeam = Object.Instantiate<GameObject>(__instance.spiderBeam, __instance.mouth.position, __instance.mouth.rotation); __instance.rotating = false; RevolverBeam val = default(RevolverBeam); if (__instance.eid.totalDamageModifier != 1f && __instance.currentBeam.TryGetComponent<RevolverBeam>(ref val)) { RevolverBeam obj = val; obj.damage *= __instance.eid.totalDamageModifier; } __instance.currentBeam = Object.Instantiate<GameObject>(__instance.spiderBeam, __instance.mouth.position, Quaternion.Euler(-__instance.mouth.eulerAngles)); __instance.rotating = false; RevolverBeam val2 = default(RevolverBeam); if (__instance.eid.totalDamageModifier != 1f && __instance.currentBeam.TryGetComponent<RevolverBeam>(ref val2)) { RevolverBeam obj2 = val2; obj2.damage *= __instance.eid.totalDamageModifier; } if (__instance.beamsAmount > 1) { __instance.beamsAmount--; __instance.ceAud.pitch = 4f; __instance.ceAud.volume = 1f; ((MonoBehaviour)__instance).Invoke("BeamChargeEnd", 0.05f / __instance.eid.totalSpeedModifier); return false; } Object.Destroy((Object)(object)__instance.currentCE); ((MonoBehaviour)__instance).Invoke("StopWaiting", 1f / __instance.eid.totalSpeedModifier); } return false; } } [HarmonyPatch(typeof(ScreenDistortionField))] internal class MoreGlitchy { [HarmonyPatch("Start")] [HarmonyPostfix] public static void Awake_Postfix(ScreenDistortionField __instance) { if (BananaDifficultyPlugin.CanUseIt(-1)) { __instance.strength *= 3f; } } } [HarmonyPatch] internal class MoreHitsBeforeDeath { private static readonly Dictionary<int, int> idolHitCount = new Dictionary<int, int>(); [HarmonyPatch(typeof(Idol), "Death")] [HarmonyPrefix] public static bool Death_Prefix(Idol __instance) { //IL_0093: Unknown result type (might be due to invalid IL or missing references) if (!BananaDifficultyPlugin.CanUseIt(__instance.difficulty)) { return true; } int instanceID = ((Object)__instance).GetInstanceID(); if (!idolHitCount.ContainsKey(instanceID)) { idolHitCount[instanceID] = 1; Bloodsplatter val2 = default(Bloodsplatter); for (int i = 0; i < 3; i++) { GoreZone val = GoreZone.ResolveGoreZone(((Component)__instance).transform); GameObject gore = MonoSingleton<BloodsplatterManager>.Instance.GetGore((GoreType)0, __instance.eid, false); if (!Object.op_Implicit((Object)(object)gore)) { break; } gore.transform.position = ((Component)__instance.beam).transform.position; gore.transform.SetParent(val.goreZone, true); gore.SetActive(true); if (gore.TryGetComponent<Bloodsplatter>(ref val2)) { val2.GetReady(); } } __instance.dead = false; return false; } return true; } [HarmonyPatch(typeof(EnemyIdentifier), "Death", new Type[] { })] [HarmonyPrefix] public static bool DeathEnemy_Prefix(EnemyIdentifier __instance) { if (!BananaDifficultyPlugin.CanUseIt(__instance.difficulty)) { return true; } Idol idol = __instance.idol; if ((Object)(object)idol == (Object)null) { return true; } int instanceID = ((Object)__instance.idol).GetInstanceID(); if (!idolHitCount.ContainsKey(instanceID)) { return false; } return true; } [HarmonyPatch(typeof(EnemyIdentifier), "InstaKill")] [HarmonyPrefix] public static void InstaDeathEnemy_Prefix(EnemyIdentifier __instance) { if (BananaDifficultyPlugin.CanUseIt(__instance.difficulty)) { Idol idol = __instance.idol; if (!((Object)(object)idol == (Object)null)) { int instanceID = ((Object)__instance.idol).GetInstanceID(); idolHitCount[instanceID] = 1; } } } } [HarmonyPatch(typeof(EnemyIdentifier))] internal class AwakePatches { [HarmonyPatch("Start")] [HarmonyPostfix] public static void Awake_Prefix(EnemyIdentifier __instance) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Invalid comparison between Unknown and I4 //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Invalid comparison between Unknown and I4 //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) if (!BananaDifficultyPlugin.CanUseIt(__instance.difficulty)) { return; } Debug.Log((object)"Is correct diff"); if ((int)__instance.enemyType == 21 && !((Object)((Component)__instance).gameObject).name.EndsWith("DontRadiant")) { __instance.speedBuff = true; __instance.damageBuff = true; __instance.healthBuff = true; } if ((int)__instance.enemyType == 5 && !__instance.blessed) { GameObject val = Object.Instantiate<GameObject>(BananaDifficultyPlugin.idol, ModUtils.GetRandomNavMeshPoint(((Component)__instance).transform.position, 10f), Quaternion.identity); Idol val2 = default(Idol); if (val.TryGetComponent<Idol>(ref val2)) { val2.target = __instance; val2.eid.dontCountAsKills = true; } ((Object)val).name = ((Object)val).name + "DontRadiant"; val.AddComponent<DestroyOnCheckpointRestart>(); } } [HarmonyPatch("Death", new Type[] { typeof(bool) })] [HarmonyPrefix] public static void OnDeath_Postfix(EnemyIdentifier __instance) { if (BananaDifficultyPlugin.CanUseIt(__instance.difficulty) && AttachToPlayerOnDamage.joints.ContainsKey(__instance)) { FixedJoint val = AttachToPlayerOnDamage.joints[__instance]; AttachToPlayerOnDamage.joints.Remove(__instance); Object.Destroy((Object)(object)val); } } [HarmonyPatch("DeliverDamage")] [HarmonyPrefix] public static bool Damage_Postfix(EnemyIdentifier __instance) { if (!BananaDifficultyPlugin.CanUseIt(__instance.difficulty)) { return true; } List<string> list = new List<string> { "projectile", "ffexplosion" }; return !list.Contains(__instance.hitter); } } [HarmonyPatch(typeof(Gutterman))] internal class NoMoreBreakingShields { private static readonly Dictionary<Gutterman, int> gutterHitCount = new Dictionary<Gutterman, int>(); [HarmonyPatch("ShieldBreak")] [HarmonyPrefix] public static bool Awake_Prefix(Gutterman __instance, bool flash = true) { //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) if (!BananaDifficultyPlugin.CanUseIt(__instance.difficulty)) { return true; } if (gutterHitCount.ContainsKey(__instance)) { if (gutterHitCount[__instance] >= 2) { return true; } gutterHitCount[__instance]++; return false; } Object.Instantiate<GameObject>(__instance.shieldBreakEffect, __instance.shield[0].transform.position, Quaternion.identity); gutterHitCount.Add(__instance, 1); return false; } } [HarmonyPatch] internal class NoParryingSisyphusBalls { [HarmonyPatch(typeof(Cannonball))] [HarmonyPatch("Launch")] [HarmonyPrefix] public static void Launch_Prefix(Cannonball __instance) { int difficulty = (((Object)(object)__instance.sisy != (Object)null) ? __instance.sisy.difficulty : 0); if (BananaDifficultyPlugin.CanUseIt(difficulty) && Object.op_Implicit((Object)(object)__instance.sisy)) { __instance.launchable = false; } } [HarmonyPatch(typeof(Sisyphus))] [HarmonyPatch("Knockdown")] [HarmonyPrefix] public static bool Knockdown_Prefix(Sisyphus __instance) { return !BananaDifficultyPlugin.CanUseIt(__instance.difficulty); } [HarmonyPatch(typeof(Sisyphus))] [HarmonyPatch("Start")] [HarmonyPostfix] public static void NoMoreFlammables(Sisyphus __instance) { if (BananaDifficultyPlugin.CanUseIt(__instance.difficulty)) { Flammable[] componentsInChildren = ((Component)__instance).gameObject.GetComponentsInChildren<Flammable>(); foreach (Flammable val in componentsInChildren) { Object.Destroy((Object)(object)val); } } } } [HarmonyPatch] internal class SecuritySystems { [HarmonyPatch(typeof(MortarLauncher), "Start")] [HarmonyPostfix] public static void FasterFiring(MortarLauncher __instance) { if (BananaDifficultyPlugin.CanUseIt(__instance.difficulty)) { __instance.difficultySpeedModifier = 8f; } } } [HarmonyPatch(typeof(SandificationZone), "Enter")] public class Stalker_SandExplode_Patch { public static void Postfix(Collider other) { if ((((Component)other).gameObject.layer == 10 || ((Component)other).gameObject.layer == 11) && BananaDifficultyPlugin.CanUseIt(-1)) { EnemyIdentifierIdentifier component = ((Component)other).gameObject.GetComponent<EnemyIdentifierIdentifier>(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.eid) && !component.eid.dead) { component.eid.BuffAll(); } } } } [HarmonyPatch(typeof(ZombieMelee))] internal class TeleportOnFall { private static Dictionary<ZombieMelee, float> lastTeleportTimes = new Dictionary<ZombieMelee, float>(); private const float TELEPORT_COOLDOWN = 5f; [HarmonyPatch("Update")] [HarmonyPostfix] public static void Awake_Prefix(ZombieMelee __instance) { //IL_007e: Unknown result type (might be due to invalid IL or missing references) if (BananaDifficultyPlugin.CanUseIt(__instance.difficulty) && __instance.zmb.falling) { float time = Time.time; if (!lastTeleportTimes.ContainsKey(__instance)) { lastTeleportTimes[__instance] = time; } if (time - lastTeleportTimes[__instance] >= 5f) { ((Component)__instance).transform.position = __instance.eid.target.position; __instance.zmb.falling = false; lastTeleportTimes[__instance] = time; } } } } [HarmonyPatch] public class AttachToPlayerOnDamage { public static Dictionary<EnemyIdentifier, FixedJoint> joints = new Dictionary<EnemyIdentifier, FixedJoint>(); [HarmonyPatch(typeof(SwingCheck2), "CheckCollision")] [HarmonyPostfix] public static void AttachToHit(SwingCheck2 __instance, Collider other) { //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Invalid comparison between Unknown and I4 if (!((Object)(object)__instance.eid == (Object)null) && BananaDifficultyPlugin.CanUseIt(__instance.eid.difficulty) && ((Component)other).gameObject.CompareTag("Player") && !joints.ContainsKey(__instance.eid) && (int)__instance.eid.enemyType == 3 && !((Object)(object)((Component)__instance.eid).gameObject.GetComponent<FixedJoint>() != (Object)null)) { FixedJoint val = ((Component)__instance.eid).gameObject.AddComponent<FixedJoint>(); ((Joint)val).connectedBody = other.attachedRigidbody; joints.Add(__instance.eid, val); } } } [HarmonyPatch] public class MakeSomeZombiesFaster { [HarmonyPatch(typeof(Zombie), "SetSpeed")] [HarmonyPrefix] public static void BiegSpeeed(Zombie __instance) { //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_0026: 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_002a: Invalid comparison between Unknown and I4 if (BananaDifficultyPlugin.CanUseIt(__instance.eid.difficulty)) { EnemyType enemyType = __instance.eid.enemyType; EnemyType val = enemyType; if ((int)val == 3) { EnemyIdentifier eid = __instance.eid; eid.totalSpeedModifier *= 10f; } } } } [HarmonyPatch(typeof(Ferryman))] internal class ThrowProjWhenStopDamage { [HarmonyPatch("StopDamage")] [HarmonyPostfix] public static void Awake_Postfix(Ferryman __instance) { //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) if (BananaDifficultyPlugin.CanUseIt(__instance.difficulty) && (__instance.useKick || __instance.useOar)) { GameObject val = Object.Instantiate<GameObject>(BananaDifficultyPlugin.snakeProj, __instance.mach.chest.transform.position, Quaternion.identity); Projectile componentInChildren = val.GetComponentInChildren<Projectile>(); if ((Object)(object)componentInChildren != (Object)null) { componentInChildren.target = __instance.eid.target; componentInChildren.safeEnemyType = (EnemyType)26; } val.transform.SetParent(((Component)__instance.eid.gz).transform); } } } [HarmonyPatch(typeof(Wicked))] internal class WickedShot { [HarmonyPatch("GetHit")] [HarmonyPrefix] public static bool Awake_Prefix(Wicked __instance) { //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_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) if (!BananaDifficultyPlugin.CanUseIt(__instance.eid.difficulty)) { return true; } if (!((Component)__instance).gameObject.activeInHierarchy) { return false; } Object.Instantiate<GameObject>(__instance.hitSound, ((Component)__instance).transform.position, Quaternion.identity); Vector3 randomNavMeshPoint = ModUtils.GetRandomNavMeshPoint(((Component)__instance).transform.position, 25f); if (Object.op_Implicit((Object)(object)__instance.eid) && __instance.eid.hooked) { Debug.Log((object)"Hooked"); MonoSingleton<HookArm>.Instance.StopThrow(1f, true); } MonoSingleton<BestiaryData>.Instance.SetEnemy((EnemyType)10, 2); if (__instance.aud.isPlaying) { __instance.aud.Stop(); } __instance.nma.Warp(randomNavMeshPoint); __instance.playerSpotTime = 0f; return false; } } [HarmonyPatch(typeof(StatueBoss))] internal class WorseCerberi { private static void FireProjectileAtAngle(float angleOffset, StatueBoss __instance) { //IL_0017: 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_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) GameObject val = Object.Instantiate<GameObject>(AddressablesExtensions.ToAsset(__instance.orbProjectile), new Vector3(((Component)__instance.orbLight).transform.position.x, ((Component)__instance).transform.position.y + 3.5f, ((Component)__instance.orbLight).transform.position.z), Quaternion.identity); val.transform.LookAt(__instance.projectedPlayerPos); val.transform.Rotate(Vector3.up, angleOffset); if (__instance.difficulty > 2) { val.GetComponent<Rigidbody>().AddForce(val.transform.forward * 20000f); } else if (__instance.difficulty == 2) { val.GetComponent<Rigidbody>().AddForce(val.transform.forward * 15000f); } else { val.GetComponent<Rigidbody>().AddForce(val.transform.forward * 10000f); } Projectile val2 = default(Projectile); if (val.TryGetComponent<Projectile>(ref val2)) { val2.target = __instance.eid.target; if (__instance.difficulty <= 2) { if (__instance.difficulty <= 2) { val2.bigExplosion = false; } Projectile obj = val2; obj.damage *= __instance.eid.totalDamageModifier; } } __instance.orbGrowing = false; __instance.orbLight.range = 0f; } [HarmonyPatch("OrbSpawn")] [HarmonyPostfix] public static void Awake_Postfix(StatueBoss __instance) { if (BananaDifficultyPlugin.CanUseIt(__instance.difficulty)) { FireProjectileAtAngle(25f, __instance); FireProjectileAtAngle(-25f, __instance); } } [HarmonyPatch("Tackle")] [HarmonyPostfix] public static void ThreeTackles(StatueBoss __instance) { if (BananaDifficultyPlugin.CanUseIt(__instance.difficulty)) { __instance.extraTackles++; } } } [HarmonyPatch(typeof(Drone))] internal class WorseDrone { [HarmonyPatch("FixedUpdate")] [HarmonyPostfix] public static void Awake_Postfix(Drone __instance) { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) if (BananaDifficultyPlugin.CanUseIt(__instance.difficulty) && __instance.crashing && !__instance.parried) { Transform transform = ((Component)__instance).transform; Vector3 val = ((Component)MonoSingleton<NewMovement>.Instance).transform.position - ((Component)__instance).transform.position; transform.forward = ((Vector3)(ref val)).normalized; } } [HarmonyPatch("Start")] [HarmonyPostfix] public static void Start_Postfix(Drone __instance) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Invalid comparison between Unknown and I4 //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Expected O, but got Unknown if (BananaDifficultyPlugin.CanUseIt(__instance.difficulty) && (int)__instance.eid.enemyType == 1) { __instance.projectile = new AssetReference("6be53089211b2eb4ab93a26541e4e65b"); } } } [HarmonyPatch(typeof(FleshPrison))] internal class WorseFleshPrison { [CompilerGenerated] private sealed class <FireBlueHomingProjectiles>d__3 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public FleshPrison __instance; private int <i>5__1; private GameObject <gameObject2>5__2; private Projectile <component>5__3; private Rigidbody <rigidbody>5__4; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <FireBlueHomingProjectiles>d__3(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <gameObject2>5__2 = null; <component>5__3 = null; <rigidbody>5__4 = null; <>1__state = -2; } private bool MoveNext() { //IL_0041: 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_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Expected O, but got Unknown //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <i>5__1 = 0; break; case 1: <>1__state = -1; <gameObject2>5__2 = null; <component>5__3 = null; <rigidbody>5__4 = null; <i>5__1++; break; } if (<i>5__1 < 25) { <gameObject2>5__2 = Object.Instantiate<GameObject>(BananaDifficultyPlugin.homingBlue, __instance.rotationBone.position + __instance.rotationBone.up * 8f, __instance.rotationBone.rotation); <component>5__3 = <gameObject2>5__2.GetComponent<Projectile>(); <component>5__3.target = __instance.eid.target; <component>5__3.safeEnemyType = (EnemyType)30; <gameObject2>5__2.transform.SetParent(((Component)__instance).transform, true); if (<gameObject2>5__2.TryGetComponent<Rigidbody>(ref <rigidbody>5__4)) { <rigidbody>5__4.AddForce(Vector3.up * 50f, (ForceMode)2); } <>2__current = (object)new WaitForSeconds(0f); <>1__state = 1; return true; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [HarmonyPatch("SpawnFleshDrones")] [HarmonyPrefix] public static void Awake_Postfix(FleshPrison __instance) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) if (BananaDifficultyPlugin.CanUseIt(__instance.difficulty) && __instance.currentDrones.Count <= 0) { GameObject val = Object.Instantiate<GameObject>(BananaDifficultyPlugin.idol, ModUtils.GetRandomNavMeshPoint(((Component)__instance).transform.position, 20f), Quaternion.identity); Idol val2 = default(Idol); if (val.TryGetComponent<Idol>(ref val2)) { val2.target = __instance.eid; val2.eid.dontCountAsKills = true; } ((Object)val).name = ((Object)val).name + "DontRadiant"; } } [HarmonyPatch("Update")] [HarmonyPostfix] public static void Update_Postfix(FleshPrison __instance) { if (BananaDifficultyPlugin.CanUseIt(__instance.difficulty) && __instance.inAction) { HandleShooting(__instance); } } private static void HandleShooting(FleshPrison __instance) { if (!BananaDifficultyPlugin.HardMode.Value || __instance.currentProjectile >= __instance.projectileAmount) { return; } __instance.homingProjectileCooldown = Mathf.MoveTowards(__instance.homingProjectileCooldown, 0f, Time.deltaTime * (Mathf.Abs(__instance.rotationSpeed) / 10f) * __instance.eid.totalSpeedModifier); if (__instance.homingProjectileCooldown <= 0f) { if (__instance.altVersion) { ((MonoBehaviour)__instance).StartCoroutine(FireBlueHomingProjectiles(__instance)); } else { FireRegularHomingProjectile(__instance); } } } [IteratorStateMachine(typeof(<FireBlueHomingProjectiles>d__3))] private static IEnumerator FireBlueHomingProjectiles(FleshPrison __instance) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <FireBlueHomingProjectiles>d__3(0) { __instance = __instance }; } private static void FireRegularHomingProjectile(FleshPrison __instance) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0031: 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_007d: 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) GameObject val = Object.Instantiate<GameObject>(BananaDifficultyPlugin.homingHH, __instance.rotationBone.position + __instance.rotationBone.up * 8f, __instance.rotationBone.rotation); Projectile component = val.GetComponent<Projectile>(); component.target = __instance.eid.target; component.safeEnemyType = (EnemyType)17; val.transform.SetParent(((Component)__instance).transform, true); Rigidbody val2 = default(Rigidbody); if (val.TryGetComponent<Rigidbody>(ref val2)) { val2.AddForce(Vector3.up * 50f, (ForceMode)2); } } } [HarmonyPatch(typeof(Gabriel))] internal class WorseGabriel { [HarmonyPatch("Update")] [HarmonyPostfix] public static void Update_Postfix(Gabriel __instance) { if (BananaDifficultyPlugin.CanUseIt(__instance.difficulty)) { __instance.attackCooldown = 0f; __instance.summonedSwordsCooldown = 0f; } } [HarmonyPatch("SpearCombo")] [HarmonyPostfix] public static void Spear_Postfix(Gabriel __instance) { //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_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Invalid comparison between Unknown and I4 //IL_00e4: 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) if (BananaDifficultyPlugin.CanUseIt(__instance.difficulty) && BananaDifficultyPlugin.HardMode.Value) { GameObject val = Object.Instantiate<GameObject>(BananaDifficultyPlugin.insignificant, __instance.eid.target.position, Quaternion.identity); VirtueInsignia component = val.GetComponent<VirtueInsignia>(); component.target = __instance.eid.target; component.predictive = true; if (__instance.difficulty == 1) { component.windUpSpeedMultiplier = 0.875f; } else if (__instance.difficulty == 0) { component.windUpSpeedMultiplier = 0.75f; } if (__instance.difficulty >= 4) { component.explosionLength = ((__instance.difficulty == 5) ? 5f : 3.5f); } if ((int)MonoSingleton<PlayerTracker>.Instance.playerType == 1) { Transform transform = val.transform; transform.localScale *= 0.75f; component.windUpSpeedMultiplier *= 0.875f; } component.windUpSpeedMultiplier *= __instance.eid.totalSpeedModifier; component.damage = Mathf.RoundToInt((float)component.damage * __instance.eid.totalDamageModifier); } } private static void FireProjectileAtAngle(GameObject objectToSpawn, float angleOffset, Gabriel __instance) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) GameObject val = Object.Instantiate<GameObject>(objectToSpawn, ((Component)__instance).transform.position + ((Component)__instance).transform.forward * 3f, ((Component)__instance).transform.rotation); if (__instance.difficulty <= 1 || __instance.eid.totalSpeedModifier != 1f || __instance.eid.totalDamageModifier != 1f) { Projectile componentInChildren = __instance.thrownObject.GetComponentInChildren<Projectile>(); componentInChildren.target = __instance.target; if (Object.op_Implicit((Object)(object)componentInChildren)) { if (__instance.difficulty <= 1) { componentInChildren.speed *= 0.5f; } componentInChildren.damage *= __instance.eid.totalDamageModifier; } } val.transform.Rotate(Vector3.up, angleOffset); } [HarmonyPatch("ThrowWeapon")] [HarmonyPostfix] public static void RightHand_Postfix(Gabriel __instance, GameObject projectile) { if (BananaDifficultyPlugin.CanUseIt(__instance.difficulty) && !__instance.juggled) { FireProjectileAtAngle(projectile, 25f, __instance); FireProjectileAtAngle(projectile, -25f, __instance); } } } [HarmonyPatch(typeof(GabrielSecond))] internal class WorseGabriel2nd { [HarmonyPatch("FastCombo")] [HarmonyPostfix] public static void Awake_Postfix(GabrielSecond __instance) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Invalid comparison between Unknown and I4 //IL_00d5: 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) if (BananaDifficultyPlugin.CanUseIt(__instance.difficulty)) { GameObject val = Object.Instantiate<GameObject>(BananaDifficultyPlugin.insignificant, __instance.eid.target.position, Quaternion.identity); VirtueInsignia component = val.GetComponent<VirtueInsignia>(); component.target = __instance.eid.target; component.predictive = true; if (__instance.difficulty == 1) { component.windUpSpeedMultiplier = 0.875f; } else if (__instance.difficulty == 0) { component.windUpSpeedMultiplier = 0.75f; } if (__instance.difficulty >= 4) { component.explosionLength = ((__instance.difficulty == 5) ? 5f : 3.5f); } if ((int)MonoSingleton<PlayerTracker>.Instance.playerType == 1) { Transform transform = val.transform; transform.localScale *= 0.75f; component.windUpSpeedMultiplier *= 0.875f; } component.windUpSpeedMultiplier *= __instance.eid.totalSpeedModifier; component.damage = Mathf.RoundToInt((float)component.damage * __instance.eid.totalDamageModifier); } } private static void FireProjectileAtAngle(float angleOffset, GabrielSecond __instance) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) Projectile val = Object.Instantiate<Projectile>(__instance.combinedSwordsThrown, __instance.fakeCombinedSwords.transform.position, ((Component)__instance).transform.rotation, ((Component)__instance).transform.parent); val.target = __instance.eid.target; val.damage *= __instance.eid.totalDamageModifier; GabrielCombinedSwordsThrown val2 = default(GabrielCombinedSwordsThrown); if (((Component)val).TryGetComponent<GabrielCombinedSwordsThrown>(ref val2)) { val2.gabe = __instance; } ((Component)val).transform.Rotate(Vector3.up, angleOffset); } [HarmonyPatch("ThrowSwords")] [HarmonyPostfix] public static void Swords_Postfix(GabrielSecond __instance) { if (BananaDifficultyPlugin.CanUseIt(__instance.difficulty) && !__instance.juggled) { FireProjectileAtAngle(10f, __instance); FireProjectileAtAngle(-10f, __instance); FireProjectileAtAngle(20f, __instance); FireProjectileAtAngle(-20f, __instance); } } [HarmonyPatch("Update")] [HarmonyPostfix] public static void Update_Postfix(GabrielSecond __instance) { if (BananaDifficultyPlugin.CanUseIt(__instance.difficulty)) { __instance.attackCooldown = 0f; __instance.summonedSwordsCooldown = 0f; __instance.combinedSwordsCooldown = 0f; } } } [HarmonyPatch(typeof(MinosBoss))] internal class WorseGiantMinos { [HarmonyPatch("Start")] [HarmonyPostfix] public static void Awake_Postfix(MinosBoss __instance) { if (BananaDifficultyPlugin.CanUseIt(__instance.difficulty)) { __instance.SpawnParasites(); } } [HarmonyPatch("GotParried")] [HarmonyPrefix] public static bool Parried_Prefix(MinosBoss __instance) { //IL_00b1: 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) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) if (!BananaDifficultyPlugin.CanUseIt(__instance.difficulty)) { return true; } if (!__instance.dead) { if (!__instance.beenParried) { __instance.beenParried = true; if (__instance.parryChallenge) { MonoSingleton<ChallengeManager>.Instance.ChallengeDone(); } } MonoSingleton<StyleHUD>.Instance.AddPoints(500, "ultrakill.downtosize", (GameObject)null, __instance.eid, -1, "", ""); if (__instance.attackingRight) { Transform[] rightHandBones = __instance.rightHandBones; foreach (Transform val in rightHandBones) { __instance.stat.GetHurt(((Component)val).gameObject, Vector3.zero, (float)(35 / __instance.rightHandBones.Length), 0f, val.position, (GameObject)null, false); ((Component)val).gameObject.layer = 10; } } if (__instance.attackingLeft) { Transform[] leftHandBones = __instance.leftHandBones; foreach (Transform val2 in leftHandBones) { __instance.stat.GetHurt(((Component)val2).gameObject, Vector3.zero, (float)(35 / __instance.leftHandBones.Length), 0f, val2.position, (GameObject)null, false); ((Component)val2).gameObject.layer = 10; } } __instance.stat.partiallyParryable = false; __instance.stat.parryables.Clear(); __instance.eid.hitter = ""; } return false; } [HarmonyPatch("PhaseChange")] [HarmonyPostfix] public static void Phase_ChangePostfix(MinosBoss __instance) { //IL_007a: 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_00ac: Unknown result type (might be due to invalid IL or missing references) if (BananaDifficultyPlugin.CanUseIt(__instance.difficulty) && __instance.phase == 2) { List<Parasite> list = new List<Parasite>(); Parasite[] parasites = __instance.parasites; foreach (Parasite val in parasites) { Parasite val2 = Object.Instantiate<Parasite>(val); ((Component)val2).transform.parent = ((Component)val).transform.parent; ((Component)val2).transform.localPosition = ((Component)val).transform.localPosition; ((Component)val2).transform.localRotation = ((Component)val).transform.localRotation; ((Component)val2).transform.localScale = ((Component)val).transform.localScale; list.Add(val2); } __instance.parasites = CollectionExtensions.AddRangeToArray<Parasite>(__instance.parasites, list.ToArray()); } } } [HarmonyPatch(typeof(LeviathanHead))] internal class WorseLeviathan { [HarmonyPatch("BeamStart")] [HarmonyPostfix] public static void ExtendedBeamTime(LeviathanHead __instance) { if (BananaDifficultyPlugin.CanUseIt(__instance.lcon.difficulty)) { __instance.beamTime *= 1.5f; } } [HarmonyPatch("BeamAttack")] [HarmonyPostfix] public static void UseTailWhileBeam(LeviathanHead __instance) { if (BananaDifficultyPlugin.CanUseIt(__instance.lcon.difficulty)) { __instance.lcon.stopTail = false; } } } [HarmonyPatch(typeof(Mass))] internal class WorseMass { [CompilerGenerated] private sealed class <ShootSpearsWithDelay>d__1 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public Mass instance; private int <spearCount>5__1; private float <delayBetweenShots>5__2; private int <i>5__3; private MassSpear <massSpear>5__4; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <ShootSpearsWithDelay>d__1(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <massSpear>5__4 = null; <>1__state = -2; } private bool MoveNext() { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Expected O, but got Unknown //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <spearCount>5__1 = 3; <delayBetweenShots>5__2 = 0.25f; <i>5__3 = 0; break; case 1: <>1__state = -1; instance.inSemiAction = false; instance.tailEnd.LookAt(instance.eid.target.position); instance.tempSpear = Object.Instantiate<GameObject>(instance.spear, instance.tailSpear.transform.position, instance.tailEnd.rotation); instance.tempSpear.transform.LookAt(instance.eid.target.position); if (instance.tempSpear.TryGetComponent<MassSpear>(ref <massSpear>5__4)) { <massSpear>5__4.target = instance.eid.target; <massSpear>5__4.originPoint = instance.tailSpear.transform; <massSpear>5__4.damageMultiplier = instance.eid.totalDamageModifier; if (instance.difficulty >= 4) { MassSpear obj = <massSpear>5__4; obj.spearHealth *= 3f; } } instance.tailSpear.SetActive(false); instance.spearShot = true; <massSpear>5__4 = null; <i>5__3++; break; } if (<i>5__3 < <spearCount>5__1) { <>2__current = (object)new WaitForSeconds(<delayBetweenShots>5__2); <>1__state = 1; return true; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [HarmonyPatch("ShootSpear")] [HarmonyPostfix] public static void Awake_Postfix(Mass __instance) { if (BananaDifficultyPlugin.CanUseIt(__instance.difficulty) && __instance.eid.target != null && !__instance.dead && __instance.difficulty != 0) { ((MonoBehaviour)__instance).StartCoroutine(ShootSpearsWithDelay(__instance)); } } [IteratorStateMachine(typeof(<ShootSpearsWithDelay>d__1))] private static IEnumerator ShootSpearsWithDelay(Mass instance) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <ShootSpearsWithDelay>d__1(0) { instance = instance }; } } [HarmonyPatch(typeof(Mindflayer))] internal class WorseMindlfayer { [HarmonyPatch("StartBeam")] [HarmonyPostfix] public static void Awake_Postfix(Mindflayer __instance) { if (BananaDifficultyPlugin.CanUseIt(__instance.difficulty)) { ContinuousBeam component = __instance.tempBeam.GetComponent<ContinuousBeam>(); component.beamWidth *= 3f; __instance.tempBeam.GetComponent<ContinuousBeam>().ignoreInvincibility = true; LineRenderer component2 = __instance.tempBeam.GetComponent<LineRenderer>(); component2.widthMultiplier *= 3f; } } } [HarmonyPatch(typeof(MinosPrime))] internal class WorseMinos { [HarmonyPatch("FixedUpdate")] [HarmonyPostfix] public static void Postfix(MinosPrime __instance) { if (__instance.activated && !__instance.inAction) { __instance.cooldown = Mathf.MoveTowards(__instance.cooldown, 0f, Time.deltaTime * __instance.eid.totalSpeedModifier * 3f); } } [HarmonyPatch("FixedUpdate")] [HarmonyPostfix] public static void YOUCANTESCAPE(MinosPrime __instance) { //IL_0023: 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) if (!__instance.inAction && BananaDifficultyPlugin.CanUseIt(__instance.difficulty) && Vector3.Distance(((Component)__instance).transform.position, __instance.target.position) > 30f) { __instance.TeleportAnywhere(); } } [HarmonyPatch("RiderKickActivate")] [HarmonyPostfix] public static void DoubleShocker(MinosPrime __instance) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0094: 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) RaycastHit val = default(RaycastHit); Physics.Raycast(__instance.aimingBone.position, ((Component)__instance).transform.forward, ref val, 250f, LayerMask.op_Implicit(LayerMaskDefaults.Get((LMD)1))); if (BananaDifficultyPlugin.CanUseIt(__instance.difficulty)) { GameObject val2 = Object.Instantiate<GameObject>(__instance.groundWave, ((RaycastHit)(ref val)).point, Quaternion.identity); val2.transform.up = ((RaycastHit)(ref val)).normal; val2.transform.SetParent(((Component)__instance.gz).transform); val2.transform.Rotate(Vector3.forward * 90f, (Space)1); PhysicalShockwave val3 = default(PhysicalShockwave); if (val2.TryGetComponent<PhysicalShockwave>(ref val3)) { val3.enemyType = (EnemyType)18; val3.damage = Mathf.RoundToInt((float)val3.damage * __instance.eid.totalDamageModifier); } } } [HarmonyPatch("ProjectileShoot")] [HarmonyPostfix] public static void IGotTwoSnakes(MinosPrime __instance) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: 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) if (BananaDifficultyPlugin.CanUseIt(__instance.difficulty) && __instance.target != null) { Vector3 val = __instance.target.position - (((Component)__instance).transform.position + Vector3.up); Quaternion val2 = Quaternion.LookRotation(val); float num = 15f; Quaternion val3 = val2 * Quaternion.AngleAxis(0f - num, Vector3.up); GameObject val4 = Object.Instantiate<GameObject>(__instance.snakeProjectile, __instance.mach.chest.transform.position, __instance.snakeProjectile.transform.rotation); val4.transform.Rotate(Vector3.up, 0f - num); ConfigureProjectile(val4, __instance); Quaternion val5 = val2 * Quaternion.AngleAxis(num, Vector3.up); GameObject val6 = Object.Instantiate<GameObject>(__instance.snakeProjectile, __instance.mach.chest.transform.position, __instance.snakeProjectile.transform.rotation); val6.transform.Rotate(Vector3.up, num); ConfigureProjectile(val6, __instance); __instance.aiming = false; __instance.tracking = false; __instance.fullTracking = false; } } private static void ConfigureProjectile(GameObject projectile, MinosPrime __instance) { //IL_004a: Unknown result type (might be due to invalid IL or missing references) projectile.transform.SetParent(((Component)__instance.gz).transform); Projectile componentInChildren = projectile.GetComponentInChildren<Projectile>(); if (Object.op_Implicit((Object)(object)componentInChildren)) { object obj = componentInChildren; obj = ((!__instance.target.isPlayer) ? ((object)__instance.target) : ((object)new EnemyTarget(((Component)MonoSingleton<CameraController>.Instance).transform))); ((Projectile)obj).target = (EnemyTarget)obj; componentInChildren.damage *= __instance.eid.totalDamageModifier; } } } [HarmonyPatch(typeof(Minotaur))] internal class WorseMinotaur { [HarmonyPatch("GotParried")] [HarmonyPrefix] public static bool Parried_Prefix(Minotaur __instance) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) if (!BananaDifficultyPlugin.CanUseIt(__instance.difficulty)) { return true; } __instance.mach.GetHurt(((Component)((Component)__instance).GetComponentInChildren<EnemyIdentifierIdentifier>()).gameObject, Vector3.zero, 20f, 0f, (GameObject)null, false); return false; } [HarmonyPatch("MeatSplash")] [HarmonyPostfix] public static void MeatLow_Prefix(Minotaur __instance) { //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) if (BananaDifficultyPlugin.CanUseIt(__instance.difficulty)) { GameObject val = Object.Instantiate<GameObject>((__instance.difficulty >= 4) ? __instance.toxicCloudLong : __instance.toxicCloud, __instance.meatInHand.transform.position, Quaternion.identity); val.transform.SetParent(((Component)__instance.gz).transform, true); } } [HarmonyPatch("MeatExplode")] [HarmonyPostfix] public static void MeatHigh_Prefix(Minotaur __instance) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_005c: 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) //IL_006b: Unknown result type (might be due to invalid IL or missing references) if (BananaDifficultyPlugin.CanUseIt(__instance.difficulty)) { GameObject val = Object.Instantiate<GameObject>((__instance.difficulty >= 4) ? __instance.goopLong : __instance.goop, new Vector3(__instance.meatInHand.transform.position.x, ((Component)__instance).transform.position.y, __instance.meatInHand.transform.position.z), Quaternion.identity); val.transform.SetParent(((Component)__instance.gz).transform, true); } } } [HarmonyPatch(typeof(CancerousRodent))] internal class WorseRodent { private static Dictionary<CancerousRodent, float> lastDamageTimes = new Dictionary<CancerousRodent, float>(); private static float damageInterval = 0.35f; [HarmonyPatch("Update")] [HarmonyPostfix] public static void Awake_Postfix(CancerousRodent __instance) { if (BananaDifficultyPlugin.CanUseIt(__instance.eid.difficulty)) { if (!lastDamageTimes.ContainsKey(__instance)) { lastDamageTimes[__instance] = Time.time; } if (Time.time - lastDamageTimes[__instance] >= damageInterval) { DamagePlayer(__instance); lastDamageTimes[__instance] = Time.time; } } } private static void DamagePlayer(CancerousRodent rodent) { MonoSingleton<NewMovement>.instance.GetHurt(10, false, 1f, false, false, 0.35f, false); } } [HarmonyPatch(typeof(Turret))] internal class WorseSentries { [HarmonyPatch("Start")] [HarmonyPostfix] public static void Awake_Postfix(Turret __instance) { if (BananaDifficultyPlugin.CanUseIt(__instance.difficulty)) { __instance.maxAimTime = 0f; } } } [HarmonyPatch(typeof(SisyphusPrime))] internal class WorseSisyphus { [HarmonyPatch("StompShockwave")] [HarmonyPostfix] public static void Shocker(SisyphusPrime __instance) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0053: 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_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) if (BananaDifficultyPlugin.CanUseIt(__instance.difficulty) && __instance.difficulty >= 2) { PhysicalShockwave val = __instance.CreateShockwave(new Vector3(__instance.swingLimbs[2].position.x, ((Component)__instance).transform.position.y, __instance.swingLimbs[2].position.z)); val.target = __instance.target; ((Component)val).transform.rotation = ((Component)__instance).transform.rotation; ((Component)val).transform.Rotate(Vector3.forward * 90f, (Space)1); val.speed *= 2f; } } [HarmonyPatch("ClapShockwave")] [HarmonyPostfix] public static void ClapShocker(SisyphusPrime __instance) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_003b: 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) if (BananaDifficultyPlugin.CanUseIt(__instance.difficulty) && __instance.difficulty >= 2) { PhysicalShockwave val = __instance.CreateShockwave(new Vector3(__instance.swingLimbs[2].position.x, ((Component)__instance).transform.position.y, __instance.swingLimbs[2].position.z)); } } [HarmonyPatch("ProjectileShoot")] [HarmonyPostfix] public static void VirtueProj(SisyphusPrime __instance) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Invalid comparison between Unknown and I4 //IL_00d9: 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) if (BananaDifficultyPlugin.CanUseIt(__instance.difficulty)) { GameObject val = Object.Instantiate<GameObject>(BananaDifficultyPlugin.insignificant, __instance.target.position, Quaternion.identity); VirtueInsignia component = val.GetComponent<VirtueInsignia>(); component.target = __instance.target; if (__instance.enraged) { component.predictive = true; } if (__instance.difficulty == 1) { component.windUpSpeedMultiplier = 0.875f; } else if (__instance.difficulty == 0) { component.windUpSpeedMultiplier = 0.75f; } if (__instance.difficulty >= 4) { component.explosionLength = ((__instance.difficulty == 5) ? 5f : 3.5f); } if ((int)MonoSingleton<PlayerTracker>.Instance.playerType == 1) { Transform transform = val.transform; transform.localScale *= 0.75f; component.windUpSpeedMultiplier *= 0.875f; } component.windUpSpeedMultiplier *= __instance.eid.totalSpeedModifier; component.damage = Mathf.RoundToInt((float)component.damage * __instance.eid.totalDamageModifier); } } [HarmonyPatch("FixedUpdate")] [HarmonyPostfix] public static void YOUCANTESCAPE(SisyphusPrime __instance) { //IL_004a: 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) if (!__instance.inAction && BananaDifficultyPlugin.CanUseIt(__instance.difficulty)) { __instance.cooldown = Mathf.MoveTowards(__instance.cooldown, 0f, Time.deltaTime * __instance.eid.totalSpeedModifier); if (Vector3.Distance(((Component)__instance).transform.position, __instance.heightAdjustedTargetPos) > 30f) { __instance.TeleportAnywhere(true); } } } } [HarmonyPatch(typeof(Streetcleaner))] internal class WorseStreetCleaners { private static Dictionary<Streetcleaner, float> customCooldowns = new Dictionary<Streetcleaner, float>(); [HarmonyPatch("Update")] [HarmonyPostfix] public static void Awake_Postfix(Streetcleaner __instance) { //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0107: 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) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_013c: 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_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) if (BananaDifficultyPlugin.CanUseIt(__instance.difficulty) && !__instance.eid.dead && __instance.target.isValid) { if (!customCooldowns.ContainsKey(__instance)) { customCooldowns[__instance] = 3f; } if (customCooldowns[__instance] > 0f) { customCooldowns[__instance] -= Time.deltaTime; } else if (Vector3.Distance(((Component)MonoSingleton<NewMovement>.Instance).transform.position, ((Component)__instance).transform.position) > 10f && !__instance.attacking) { GameObject val = Object.Instantiate<GameObject>(BananaDifficultyPlugin.RocketEnemy, ((Component)__instance).transform.position, Quaternion.identity); Vector3 val2 = __instance.target.position - val.transform.position; Vector3 normalized = ((Vector3)(ref val2)).normalized; Rigidbody component = val.GetComponent<Rigidbody>(); Grenade component2 = val.GetComponent<Grenade>(); val2 = component.velocity; float magnitude = ((Vector3)(ref val2)).magnitude; component.velocity = normalized * magnitude; val.transform.forward = normalized; Transform transform = val.transform; transform.position += ((Component)__instance).transform.forward * 7.5f + new Vector3(0f, 2f); component2.ignoreEnemyType = new List<EnemyType> { (EnemyType)6 }; __instance.anim.SetTrigger("Deflect"); customCooldowns[__instance] = 3f; } } } } [HarmonyPatch(typeof(BulletCheck))] public class WorseStreetCleanerBlocker { [HarmonyPatch("OnTriggerEnter")] [HarmonyPrefix] public static bool Awake_Prefix(BulletCheck __instance, Collider other) { //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_003d: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Invalid comparison between Unknown and I4 //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) if (!BananaDifficultyPlugin.CanUseIt(__instance.difficulty)) { return true; } Streetcleaner sc = __instance.sc; if ((Object)(object)sc == (Object)null) { return true; } CheckerType type = __instance.type; if ((int)type > 0) { return true; } if (((Component)other).gameObject.layer == 14) { Grenade component = ((Component)other).GetComponent<Grenade>(); if ((Object)(object)component != (Object)null) { component.enemy = true; component.CanCollideWithPlayer(true); Streetcleaner sc2 = __instance.sc; if ((Object)(object)sc2 != (Object)null)