using System;
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 BepInEx;
using BlackholeChaos.Scripts;
using HarmonyLib;
using TMPro;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("RepoCaosMod")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("ReviOS 11 24.12")]
[assembly: AssemblyProduct("RepoCaosMod")]
[assembly: AssemblyCopyright("Copyright © ReviOS 11 24.12 2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("b62091cf-1bc7-4d0e-be7b-011b6b98bf30")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace BlackholeChaos
{
[BepInPlugin("duviz.ultrakill.blackholechaos", "BLACKHOLE CHAOS", "0.0.69")]
public class Plugin : BaseUnityPlugin
{
public static Blackhole blackHole;
public void Awake()
{
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
//IL_001d: Expected O, but got Unknown
((BaseUnityPlugin)this).Logger.LogInfo((object)"Hello, the Instagram community!");
Harmony val = new Harmony("duviz.ultrakill.blackholechaos");
val.PatchAll();
((Object)((Component)this).gameObject).hideFlags = (HideFlags)4;
}
public void Update()
{
//IL_004b: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)blackHole == (Object)null && SceneHelper.CurrentScene != "Main Menu" && SceneHelper.PendingScene == null && (Object)(object)MonoSingleton<NewMovement>.Instance != (Object)null && (Object)(object)MonoSingleton<PrefsManager>.Instance != (Object)null)
{
blackHole = new GameObject("Blackhole").AddComponent<Blackhole>();
}
}
}
}
namespace BlackholeChaos.Scripts
{
public class Blackhole : MonoBehaviour
{
public float range = 0f;
public float force = 0f;
public int difficulty = 1;
public MeshRenderer meshRendeder;
public MeshRenderer meshRendeder2;
public MeshRenderer meshRendeder3;
private bool inHole = false;
private bool white = false;
private List<Rigidbody> touchedRigidbodies = new List<Rigidbody>();
private float A = 0f;
private void Awake()
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
//IL_003b: Unknown result type (might be due to invalid IL or missing references)
//IL_004f: Unknown result type (might be due to invalid IL or missing references)
//IL_0054: Unknown result type (might be due to invalid IL or missing references)
((Component)this).transform.position = Vector3.zero + new Vector3(0f, 25f, 0f);
((Component)this).transform.position = ((Component)MonoSingleton<NewMovement>.Instance).transform.position + new Vector3(0f, 25f, 0f);
difficulty = MonoSingleton<PrefsManager>.Instance.GetInt("difficulty", 0);
SetupVisual();
}
private void SetupVisual()
{
//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
//IL_00e4: Expected O, but got Unknown
//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
//IL_016d: Unknown result type (might be due to invalid IL or missing references)
//IL_0177: Unknown result type (might be due to invalid IL or missing references)
//IL_0187: Unknown result type (might be due to invalid IL or missing references)
//IL_018e: Expected O, but got Unknown
//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
//IL_01e2: Unknown result type (might be due to invalid IL or missing references)
//IL_01e9: Expected O, but got Unknown
//IL_01eb: Unknown result type (might be due to invalid IL or missing references)
//IL_028c: Unknown result type (might be due to invalid IL or missing references)
//IL_0293: Expected O, but got Unknown
//IL_02ad: Unknown result type (might be due to invalid IL or missing references)
//IL_02e7: Unknown result type (might be due to invalid IL or missing references)
//IL_02ee: Expected O, but got Unknown
//IL_02f0: Unknown result type (might be due to invalid IL or missing references)
//IL_03ca: Unknown result type (might be due to invalid IL or missing references)
//IL_03d1: Expected O, but got Unknown
//IL_03eb: Unknown result type (might be due to invalid IL or missing references)
//IL_0420: Unknown result type (might be due to invalid IL or missing references)
//IL_0427: Expected O, but got Unknown
//IL_0429: Unknown result type (might be due to invalid IL or missing references)
if (DateTime.Now.Hour == 0)
{
white = true;
MonoSingleton<HudMessageReceiver>.Instance.SendHudMessage("Go to fucking sleep.", "", "", 0, false, false, true);
}
Color color = default(Color);
((Color)(ref color))..ctor(0f, 0f, 0f, 0f);
if (white)
{
((Color)(ref color))..ctor(1f, 1f, 1f, 0f);
}
MeshFilter val = ((Component)this).gameObject.AddComponent<MeshFilter>();
MeshRenderer val2 = ((Component)this).gameObject.AddComponent<MeshRenderer>();
GameObject val3 = GameObject.CreatePrimitive((PrimitiveType)0);
MeshFilter component = val3.GetComponent<MeshFilter>();
if ((Object)(object)component != (Object)null)
{
val.mesh = component.sharedMesh;
}
Object.Destroy((Object)(object)val3);
((Renderer)val2).enabled = false;
Material val4 = new Material(Shader.Find("Standard"));
val4.color = color;
val4.SetFloat("_Mode", 3f);
val4.SetInt("_SrcBlend", 5);
val4.SetInt("_DstBlend", 10);
val4.SetInt("_ZWrite", 0);
val4.DisableKeyword("_ALPHATEST_ON");
val4.EnableKeyword("_ALPHABLEND_ON");
val4.DisableKeyword("_ALPHAPREMULTIPLY_ON");
val4.renderQueue = 3000;
((Renderer)val2).material = val4;
((Component)this).transform.localScale = Vector3.one * 2f;
GameObject val5 = new GameObject("BlackholeShell");
val5.transform.parent = ((Component)this).transform;
val5.transform.localPosition = Vector3.zero;
MeshFilter val6 = val5.AddComponent<MeshFilter>();
MeshRenderer val7 = val5.AddComponent<MeshRenderer>();
val6.mesh = Object.Instantiate<Mesh>(val.mesh);
Material val8 = new Material(Shader.Find("Standard"));
val8.color = color;
val8.SetFloat("_Mode", 3f);
val8.SetInt("_SrcBlend", 5);
val8.SetInt("_DstBlend", 10);
val8.SetInt("_ZWrite", 0);
val8.DisableKeyword("_ALPHATEST_ON");
val8.EnableKeyword("_ALPHABLEND_ON");
val8.DisableKeyword("_ALPHAPREMULTIPLY_ON");
val8.renderQueue = 3000;
val8.shader = MonoSingleton<DefaultReferenceManager>.Instance.masterShader;
((Renderer)val7).material = val8;
meshRendeder = val7;
val5 = new GameObject("BlackholeShell");
val5.transform.parent = ((Component)this).transform;
val5.transform.localPosition = Vector3.zero;
val6 = val5.AddComponent<MeshFilter>();
val7 = val5.AddComponent<MeshRenderer>();
val6.mesh = Object.Instantiate<Mesh>(val.mesh);
val8 = new Material(Shader.Find("Standard"));
val8.color = color;
val8.SetFloat("_Mode", 3f);
val8.SetInt("_SrcBlend", 5);
val8.SetInt("_DstBlend", 10);
val8.SetInt("_ZWrite", 0);
val8.DisableKeyword("_ALPHATEST_ON");
val8.EnableKeyword("_ALPHABLEND_ON");
val8.DisableKeyword("_ALPHAPREMULTIPLY_ON");
val8.renderQueue = 3000;
val8.shader = MonoSingleton<DefaultReferenceManager>.Instance.masterShader;
((Renderer)val7).material = val8;
Mesh val9 = Object.Instantiate<Mesh>(val6.mesh);
val9.triangles = val9.triangles.Reverse().ToArray();
val9.RecalculateNormals();
val6.mesh = val9;
meshRendeder3 = val7;
val5 = new GameObject("BlackholeShell");
val5.transform.parent = ((Component)this).transform;
val5.transform.localPosition = Vector3.zero;
val6 = val5.AddComponent<MeshFilter>();
val7 = val5.AddComponent<MeshRenderer>();
val6.mesh = val.mesh;
val8 = new Material(Shader.Find("Standard"));
val8.color = color;
val8.SetFloat("_Mode", 3f);
val8.SetInt("_SrcBlend", 5);
val8.SetInt("_DstBlend", 10);
val8.SetInt("_ZWrite", 0);
val8.DisableKeyword("_ALPHATEST_ON");
val8.EnableKeyword("_ALPHABLEND_ON");
val8.DisableKeyword("_ALPHAPREMULTIPLY_ON");
val8.renderQueue = 3000;
val8.shader = Shader.Find("Legacy Shaders/Diffuse");
if (white)
{
val8.shader = Shader.Find("Unlit/Texture");
}
((Renderer)val7).material = val8;
meshRendeder2 = val7;
}
public void Update()
{
//IL_0016: 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_003c: Unknown result type (might be due to invalid IL or missing references)
((Component)meshRendeder3).transform.position = ((Component)Camera.main).transform.position;
((Renderer)meshRendeder3).enabled = Vector3.Distance(((Component)MonoSingleton<NewMovement>.Instance).transform.position, ((Component)this).transform.position) <= range;
}
public void FixedUpdate()
{
//IL_0087: 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_00b7: 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_00e7: 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_0106: Unknown result type (might be due to invalid IL or missing references)
//IL_0111: Unknown result type (might be due to invalid IL or missing references)
//IL_0132: Unknown result type (might be due to invalid IL or missing references)
//IL_013d: Unknown result type (might be due to invalid IL or missing references)
//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
//IL_039d: Unknown result type (might be due to invalid IL or missing references)
//IL_03a9: Unknown result type (might be due to invalid IL or missing references)
//IL_022c: Unknown result type (might be due to invalid IL or missing references)
//IL_0233: Unknown result type (might be due to invalid IL or missing references)
//IL_0238: Unknown result type (might be due to invalid IL or missing references)
//IL_023d: Unknown result type (might be due to invalid IL or missing references)
//IL_0241: Unknown result type (might be due to invalid IL or missing references)
//IL_0246: Unknown result type (might be due to invalid IL or missing references)
//IL_024e: Unknown result type (might be due to invalid IL or missing references)
//IL_0255: Unknown result type (might be due to invalid IL or missing references)
//IL_037c: Unknown result type (might be due to invalid IL or missing references)
//IL_0380: Unknown result type (might be due to invalid IL or missing references)
//IL_02a6: Unknown result type (might be due to invalid IL or missing references)
//IL_02dd: Unknown result type (might be due to invalid IL or missing references)
//IL_02e2: Unknown result type (might be due to invalid IL or missing references)
//IL_02ec: Unknown result type (might be due to invalid IL or missing references)
//IL_02f1: Unknown result type (might be due to invalid IL or missing references)
float num = ((float)difficulty + 1f) / 4f;
force = force * (1f + Time.fixedDeltaTime / 2000f) + Time.fixedDeltaTime * 500f * num;
range = range * (1f + Time.fixedDeltaTime / 1000f) + Time.fixedDeltaTime * 7f * num;
((Component)meshRendeder).transform.localScale = new Vector3(1f, 1f, 1f) * range;
((Component)meshRendeder3).transform.localScale = new Vector3(1f, 1f, 1f);
((Component)meshRendeder2).transform.localScale = new Vector3(1f, 1f, 1f) * range / 5f;
if (Vector3.Distance(((Component)MonoSingleton<NewMovement>.Instance).transform.position, ((Component)this).transform.position) < range)
{
if (Vector3.Distance(((Component)MonoSingleton<NewMovement>.Instance).transform.position, ((Component)this).transform.position) < range / 5f)
{
MonoSingleton<NewMovement>.Instance.GetHurt(1000, false, 1f, false, false, 0.35f, false);
MonoSingleton<StatsManager>.Instance.currentCheckPoint = null;
MonoSingleton<CheckPointsController>.Instance.DisableCheckpoints();
}
inHole = true;
}
else
{
inHole = false;
}
Collider[] array = Physics.OverlapSphere(((Component)this).transform.position, range);
int num2 = 0;
Collider[] array2 = array;
foreach (Collider val in array2)
{
Rigidbody attachedRigidbody = val.attachedRigidbody;
EnemyIdentifier component = ((Component)val).GetComponent<EnemyIdentifier>();
if ((Object)(object)attachedRigidbody != (Object)null && (Object)(object)attachedRigidbody != (Object)(object)((Component)this).GetComponent<Rigidbody>())
{
num2++;
if (num2 > 25 && (Object)(object)component == (Object)null)
{
continue;
}
Vector3 val2 = ((Component)this).transform.position - attachedRigidbody.position;
Vector3 normalized = ((Vector3)(ref val2)).normalized;
float num3 = Vector3.Distance(((Component)this).transform.position, attachedRigidbody.position);
float num4 = (float)((!white) ? 1 : (-1)) * force / Mathf.Max(num3, 1f);
if (num3 < range / 5f)
{
Transform transform = ((Component)attachedRigidbody).transform;
transform.localScale += 10f * new Vector3(Random.Range(0f, 0.1f), Random.Range(0f, 0.2f), Random.Range(0f, 0.1f)) * Time.fixedDeltaTime;
if (!touchedRigidbodies.Contains(attachedRigidbody))
{
Fat();
touchedRigidbodies.Add(attachedRigidbody);
}
if (num3 <= range / 10f && (Object)(object)component == (Object)null && (Object)(object)((Component)MonoSingleton<NewMovement>.Instance).gameObject != (Object)(object)((Component)attachedRigidbody).gameObject)
{
Fat();
Object.Destroy((Object)(object)((Component)attachedRigidbody).gameObject);
continue;
}
}
attachedRigidbody.AddForce(normalized * num4, (ForceMode)0);
}
if ((Object)(object)component != (Object)null && Vector3.Distance(((Component)this).transform.position, ((Component)val).transform.position) < range / 5f)
{
Fat();
DamageEnemy(component);
}
}
}
private void Fat()
{
range += 3f;
force += 400f;
}
public void OnGUI()
{
//IL_0016: 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_0091: 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_00bb: 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_00ec: Unknown result type (might be due to invalid IL or missing references)
if (inHole)
{
float num = Vector3.Distance(((Component)MonoSingleton<NewMovement>.Instance).transform.position, ((Component)this).transform.position);
float num2 = range;
float num3 = Mathf.Clamp01(5f - num / num2) * 0.6f + 0.1f;
A -= (A - num3) / 200f;
}
else
{
A -= (A - 0f) / 20f;
}
Color color = GUI.color;
float num4 = (white ? 1f : 0f);
GUI.color = new Color(num4, num4, num4, A / 2f);
GUI.DrawTexture(new Rect(0f, 0f, (float)Screen.width, (float)Screen.height), (Texture)(object)Texture2D.whiteTexture);
GUI.color = color;
}
private void DamageEnemy(EnemyIdentifier eid)
{
//IL_0008: 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)
eid.DeliverDamage(((Component)this).gameObject, Vector3.zero, Vector3.zero, 1000f, false, 0f, (GameObject)null, false, false);
}
}
}
namespace BlackholeChaos.Patches
{
[HarmonyPatch]
public class RankPatch
{
[HarmonyPostfix]
[HarmonyPatch(typeof(FinalRank), "SetInfo")]
private static void RankExtra(FinalRank __instance)
{
if ((Object)(object)Plugin.blackHole != (Object)null)
{
TMP_Text extraInfo = __instance.extraInfo;
extraInfo.text += "- <color=#4f0c3d>BLACKHOLE</color>\n";
__instance.AddPoints(1000);
}
}
}
}