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.Utils;
using BepInEx;
using BepInEx.Logging;
using Discord;
using HarmonyLib;
using TMPro;
using ULTRAKILL.Cheats;
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
{
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 GameObject projBeam;
public static GameObject projHoming;
public static GameObject idol;
public static GameObject RocketEnemy;
public static GameObject snakeProj;
public static GameObject insignificant;
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;
Log = ((BaseUnityPlugin)this).Logger;
GetAssets();
}
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;
}
private void OnDestroy()
{
Harmony.UnpatchAll();
}
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"));
}
public IEnumerator LoadAddressable<T>(Action<T> onLoad, string path)
{
AsyncOperationHandle<T> handle = Addressables.LoadAssetAsync<T>((object)path);
yield return (object)new WaitUntil((Func<bool>)(() => handle.IsDone));
onLoad(handle.Result);
}
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
{
[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) && !((Object)((Component)__instance).gameObject).name.StartsWith("DoubleInsig"))
{
((MonoBehaviour)__instance).StartCoroutine(SpawnInsignias(__instance));
}
}
private static IEnumerator SpawnInsignias(VirtueInsignia original)
{
yield return (object)new WaitForSeconds(0.1f);
VirtueInsignia insi = Object.Instantiate<VirtueInsignia>(original);
((Object)((Component)insi).gameObject).name = "DoubleInsig1";
((Component)insi).transform.Rotate(new Vector3(0f, 0f, 90f));
Transform transform = ((Component)insi).transform;
transform.localScale /= 3f;
insi.target = original.target;
yield return (object)new WaitForSeconds(0.1f);
VirtueInsignia insi2 = Object.Instantiate<VirtueInsignia>(original);
((Object)((Component)insi2).gameObject).name = "DoubleInsig2";
((Component)insi2).transform.Rotate(new Vector3(90f, 0f, 0f));
Transform transform2 = ((Component)insi2).transform;
transform2.localScale /= 3f;
insi2.target = original.target;
}
}
[HarmonyPatch(typeof(PhysicalShockwave))]
internal class DoubleShockwaves
{
[HarmonyPatch("Start")]
[HarmonyPostfix]
public static void Awake_Prefix(PhysicalShockwave __instance)
{
//IL_0058: Unknown result type (might be due to invalid IL or missing references)
if (BananaDifficultyPlugin.CanUseIt(-1) && !(((Object)((Component)__instance).gameObject).name == "DoubleShock"))
{
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_0095: Unknown result type (might be due to invalid IL or missing references)
//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
if (!BananaDifficultyPlugin.CanUseIt(__instance.difficulty) || __instance.decorative || __instance.friendly)
{
return;
}
alreadyExistingProjs.RemoveAll((Projectile x) => (Object)(object)x == (Object)null);
if ((Object)(object)BananaDifficultyPlugin.projBeam != (Object)null && alreadyExistingProjs.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)alreadyExistingProjs[alreadyExistingProjs.Count - 1]).transform;
__instance.connectedBeams.Add(val);
Projectile val2 = default(Projectile);
if (((Component)((Component)alreadyExistingProjs[alreadyExistingProjs.Count - 1]).transform).TryGetComponent<Projectile>(ref val2))
{
val2.connectedBeams.Add(val);
}
alreadyExistingBeams.Add(val);
}
alreadyExistingProjs.Add(__instance);
}
}
[HarmonyPatch(typeof(ZombieProjectiles))]
internal class ExponentialStray
{
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_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
if (BananaDifficultyPlugin.CanUseIt(__instance.difficulty))
{
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);
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));
}
private static IEnumerator FireProjectilesWithDelay(ZombieProjectiles __instance, int count)
{
if ((Object)(object)__instance.currentDecProjectile != (Object)null)
{
Object.Destroy((Object)(object)__instance.currentDecProjectile);
__instance.eid.weakPoint = __instance.origWP;
}
Vector3 targetPosition = GetTargetPosition(__instance);
float angleStep = 360f / (float)count;
for (int i = 0; i < count; i++)
{
float angle = angleStep * (float)i;
GameObject newProjectile = Object.Instantiate<GameObject>(__instance.projectile, __instance.shootPos.position, Quaternion.identity);
Projectile componentInChildren = newProjectile.GetComponentInChildren<Projectile>();
if ((Object)(object)componentInChildren != (Object)null)
{
componentInChildren.target = __instance.eid.target;
componentInChildren.safeEnemyType = (EnemyType)13;
componentInChildren.speed *= GetSpeedMultiplier(__instance.difficulty);
componentInChildren.damage *= __instance.eid.totalDamageModifier;
}
newProjectile.transform.LookAt(targetPosition);
newProjectile.transform.Rotate(Vector3.up, angle);
Rigidbody rb = newProjectile.GetComponent<Rigidbody>();
if ((Object)(object)rb != (Object)null)
{
rb.AddForce(newProjectile.transform.forward * 70f, (ForceMode)2);
}
yield return (object)new WaitForSeconds(0.1f);
}
}
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("Start")]
internal class ImmediatelyEnrage
{
[HarmonyPatch(typeof(SwordsMachine))]
[HarmonyPostfix]
public static void SwordAngry(SwordsMachine __instance)
{
if (BananaDifficultyPlugin.CanUseIt(__instance.difficulty))
{
__instance.eternalRage = true;
__instance.Enrage();
}
}
[HarmonyPatch(typeof(SpiderBody))]
[HarmonyPostfix]
public static void SpiderAngry(SpiderBody __instance)
{
if (BananaDifficultyPlugin.CanUseIt(__instance.difficulty))
{
__instance.Enrage();
}
}
[HarmonyPatch(typeof(Gutterman))]
[HarmonyPostfix]
public static void GuttermanAngry(Gutterman __instance)
{
if (BananaDifficultyPlugin.CanUseIt(__instance.difficulty))
{
__instance.eternalRage = true;
__instance.Enrage();
}
}
[HarmonyPatch(typeof(Mindflayer))]
[HarmonyPostfix]
public static void MindAngry(Mindflayer __instance)
{
if (BananaDifficultyPlugin.CanUseIt(__instance.difficulty))
{
__instance.Enrage();
}
}
[HarmonyPatch(typeof(V2))]
[HarmonyPostfix]
public static void V2Angry(V2 __instance)
{
if (BananaDifficultyPlugin.CanUseIt(__instance.difficulty))
{
__instance.Enrage();
}
}
[HarmonyPatch(typeof(StatueBoss))]
[HarmonyPostfix]
public static void StatueAngry(StatueBoss __instance)
{
if (BananaDifficultyPlugin.CanUseIt(__instance.difficulty))
{
__instance.Enrage();
}
}
[HarmonyPatch(typeof(Drone))]
[HarmonyPostfix]
public static void VirtueAngry(Drone __instance)
{
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
//IL_0022: 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))
{
if ((int)__instance.eid.enemyType != 9)
{
__instance.projectile = new AssetReference("6be53089211b2eb4ab93a26541e4e65b");
}
else
{
__instance.Enrage();
}
}
}
}
[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(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_0021: Unknown result type (might be due to invalid IL or missing references)
//IL_0028: Invalid comparison between Unknown and I4
//IL_0046: Unknown result type (might be due to invalid IL or missing references)
//IL_004c: Invalid comparison between Unknown and I4
//IL_006a: 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_0079: Unknown result type (might be due to invalid IL or missing references)
if (BananaDifficultyPlugin.CanUseIt(__instance.difficulty))
{
Debug.Log((object)"Is correct diff");
if ((int)__instance.enemyType == 21)
{
__instance.speedBuff = true;
__instance.damageBuff = true;
__instance.healthBuff = true;
}
if ((int)__instance.enemyType == 5 && !__instance.blessed)
{
Object.Instantiate<GameObject>(BananaDifficultyPlugin.idol, ModUtils.GetRandomNavMeshPoint(((Component)__instance).transform.position, 10f), Quaternion.identity);
}
}
}
}
[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(Stalker), "SandExplode")]
public class Stalker_SandExplode_Patch
{
private static bool Prefix(Stalker __instance, ref int ___difficulty, ref EnemyIdentifier ___eid, int __0, ref bool ___exploding, ref float ___countDownAmount, ref float ___explosionCharge, ref Color ___currentColor, Color[] ___lightColors, AudioSource ___lightAud, AudioClip[] ___lightSounds, ref bool ___blinking, Machine ___mach, ref bool ___exploded)
{
//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
//IL_0103: Unknown result type (might be due to invalid IL or missing references)
//IL_010d: Unknown result type (might be due to invalid IL or missing references)
//IL_0190: Unknown result type (might be due to invalid IL or missing references)
//IL_019a: Unknown result type (might be due to invalid IL or missing references)
//IL_0176: Unknown result type (might be due to invalid IL or missing references)
//IL_017d: Unknown result type (might be due to invalid IL or missing references)
//IL_024a: Unknown result type (might be due to invalid IL or missing references)
//IL_024f: Unknown result type (might be due to invalid IL or missing references)
if (___difficulty != 5)
{
return true;
}
bool flag = true;
if (!((Object)(object)StockMapInfo.Instance != (Object)null) || !(((MapInfoBase)StockMapInfo.Instance).levelName == "GOD DAMN THE SUN") || !((Object)(object)((Component)__instance).transform.parent != (Object)null) || !(((Object)((Component)__instance).transform.parent).name == "Wave 1") || !((Object)(object)((Component)__instance).transform.parent.parent != (Object)null) || !((Object)((Component)__instance).transform.parent.parent).name.StartsWith("5 Stuff"))
{
flag = false;
}
GameObject val = Object.Instantiate<GameObject>(AddressablesExtensions.ToAsset(__instance.explosion), ((Component)__instance).transform.position + Vector3.up * 2.5f, Quaternion.identity);
if (__0 != 1)
{
Transform transform = val.transform;
transform.localScale *= 1.5f;
}
if (___eid.stuckMagnets.Count > 0)
{
float num = 0.75f;
if (___eid.stuckMagnets.Count > 1)
{
num -= 0.125f * (float)(___eid.stuckMagnets.Count - 1);
}
Transform transform2 = val.transform;
transform2.localScale *= num;
}
Transform transform3 = val.transform;
transform3.localScale *= 3f;
SandificationZone componentInChildren = val.GetComponentInChildren<SandificationZone>();
componentInChildren.buffDamage = (componentInChildren.buffHealth = (componentInChildren.buffSpeed = false));
componentInChildren.healthBuff = ___eid.healthBuffModifier + 1f;
componentInChildren.damageBuff = ___eid.damageBuffModifier + 1f;
componentInChildren.speedBuff = ___eid.speedBuffModifier + 1f;
bool result;
if ((!flag || ___eid.blessed || InvincibleEnemies.Enabled) && __0 != 1)
{
___exploding = false;
___countDownAmount = 0f;
___explosionCharge = 0f;
___currentColor = ___lightColors[0];
___lightAud.clip = ___lightSounds[0];
___blinking = false;
result = false;
}
else
{
___exploded = true;
if (!___mach.limp)
{
___mach.GoLimp();
___eid.Death();
}
if (MonoSingleton<StalkerController>.Instance.targets != null)
{
}
if (___eid.drillers.Count != 0)
{
for (int num2 = ___eid.drillers.Count - 1; num2 >= 0; num2--)
{
Object.Destroy((Object)(object)((Component)___eid.drillers[num2]).gameObject);
}
}
((Component)__instance).gameObject.SetActive(false);
Object.Destroy((Object)(object)((Component)__instance).gameObject);
result = false;
}
return result;
}
}
[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_0085: 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] = -5f;
}
if (time - lastTeleportTimes[__instance] >= 5f)
{
((Component)__instance).transform.position = __instance.eid.target.position;
__instance.zmb.falling = false;
lastTeleportTimes[__instance] = time;
}
}
}
}
[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(Mass))]
internal class WorseMass
{
[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));
}
}
private static IEnumerator ShootSpearsWithDelay(Mass instance)
{
int spearCount = 3;
float delayBetweenShots = 0.25f;
MassSpear massSpear = default(MassSpear);
for (int i = 0; i < spearCount; i++)
{
yield return (object)new WaitForSeconds(delayBetweenShots);
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))
{
massSpear.target = instance.eid.target;
massSpear.originPoint = instance.tailSpear.transform;
massSpear.damageMultiplier = instance.eid.totalDamageModifier;
if (instance.difficulty >= 4)
{
MassSpear obj = massSpear;
obj.spearHealth *= 3f;
}
}
instance.tailSpear.SetActive(false);
instance.spearShot = true;
massSpear = null;
}
}
}
[HarmonyPatch(typeof(MinosPrime))]
internal class WorseMinos
{
[HarmonyPatch("FixedUpdate")]
[HarmonyPostfix]
public static void Postfix(MinosPrime __instance)
{
__instance.cooldown = 0f;
}
[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(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_002e: Unknown result type (might be due to invalid IL or missing references)
//IL_0034: Unknown result type (might be due to invalid IL or missing references)
if (!__instance.inAction && BananaDifficultyPlugin.CanUseIt(__instance.difficulty))
{
__instance.cooldown = 0f;
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)
{
sc2.DeflectShot();
}
Rigidbody component2 = ((Component)other).GetComponent<Rigidbody>();
Vector3 val = component2.velocity;
float magnitude = ((Vector3)(ref val)).magnitude;
val = ((Component)MonoSingleton<CameraController>.instance).transform.position - ((Component)other).transform.position;
Vector3 normalized = ((Vector3)(ref val)).normalized;
component2.velocity = normalized * magnitude;
((Component)other).transform.forward = normalized;
__instance.aud.Play();
return false;
}
Streetcleaner sc3 = __instance.sc;
if ((Object)(object)sc3 == (Object)null)
{
return false;
}
sc3.Dodge();
return false;
}
return false;
}
}
}