Decompiled source of JaketProtector v1.0.0

JaketProtector.dll

Decompiled 11 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using Configgy;
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("UltraKillMod")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("UltraKillMod")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("1290AEA7-B75A-4945-995F-5ABAD936595C")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace JaketProtector;

[BepInPlugin("Dolfelive.JaketProtector", "JaketProtector", "1.1.0")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class JaketProtector : BaseUnityPlugin
{
	private List<GameObject> Coins = new List<GameObject>();

	[Configgable("", "CoinsLimit", 0, "Max amount of coins allowed at 1 time")]
	private static ConfigInputField<float> CoinsLimit = new ConfigInputField<float>(50f, (Func<float, bool>)null, (Func<string, ValueTuple<bool, float>>)null);

	[Configgable("", "PreventUltracoinUsers", 0, "Turns on Jaket Protector")]
	private static ConfigToggle PreventUltracoinUsers = new ConfigToggle(true);

	public static ConfigBuilder ConfigBuilder { get; private set; }

	public void Awake()
	{
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0015: Expected O, but got Unknown
		ConfigBuilder = new ConfigBuilder("Dolfelive.JaketProtector", "JaketProtector");
		ConfigBuilder.Build();
	}

	private void Update()
	{
		if (!((ConfigValueElement<bool>)(object)PreventUltracoinUsers).Value)
		{
			return;
		}
		GameObject[] array = GameObject.FindGameObjectsWithTag("Coin");
		((BaseUnityPlugin)this).Logger.LogInfo((object)array.Length);
		if ((float)array.Length >= ((ConfigValueElement<float>)(object)CoinsLimit).Value)
		{
			GameObject[] array2 = array;
			foreach (GameObject val in array2)
			{
				Object.Destroy((Object)(object)val);
				((BaseUnityPlugin)this).Logger.LogInfo((object)array.Length);
			}
		}
	}
}