Decompiled source of Flaccid Hammer v1.0.0

Flaccid/goi.barackobusiness.flaccid.dll

Decompiled 17 hours ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using Microsoft.CodeAnalysis;
using UnityEngine;
using UnityEngine.SceneManagement;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = ".NET Standard 2.0")]
[assembly: AssemblyCompany("goi.barackobusiness.flaccid")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+c73bbb3f989c1e2946681a4871c02aec832d91a6")]
[assembly: AssemblyProduct("Flaccid Hammer")]
[assembly: AssemblyTitle("goi.barackobusiness.flaccid")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace Flaccid
{
	[BepInProcess("GettingOverIt.exe")]
	[BepInPlugin("goi.barackobusiness.flaccid", "Flaccid Hammer", "1.0.0")]
	public class Flaccid : BaseUnityPlugin
	{
		private enum Preset
		{
			Teraflop = 20,
			Gigaflop = 24,
			Megaflop = 28,
			Kiloflop = 32,
			Custom = -6814
		}

		private ConfigEntry<Preset> difficulty;

		private ConfigEntry<float> floppiness;

		private FixedJoint2D joint;

		public float Frequency
		{
			get
			{
				if (difficulty.Value == Preset.Custom)
				{
					return floppiness.Value;
				}
				return (float)difficulty.Value;
			}
		}

		private void Awake()
		{
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Expected O, but got Unknown
			difficulty = ((BaseUnityPlugin)this).Config.Bind<Preset>("", "Difficulty", Preset.Gigaflop, "A few preset configurations of flaccidity, more flop means more difficulty; hope you know your SI prefixes.");
			floppiness = ((BaseUnityPlugin)this).Config.Bind<float>("", "Custom Floppiness", 26f, new ConfigDescription("A custom value for how rigid the hammer pole is; lower is more flaccid, higher is more rigid.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 70f), Array.Empty<object>()));
			((BaseUnityPlugin)this).Config.SettingChanged += OnSettingChanged;
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Five, hundred, flops.");
		}

		private void OnEnable()
		{
			SceneManager.sceneLoaded += OnSceneLoad;
			if ((Object)(object)joint != (Object)null)
			{
				joint.frequency = Mathf.Clamp(Frequency, 0f, 70f);
			}
		}

		private void OnDisable()
		{
			SceneManager.sceneLoaded -= OnSceneLoad;
			if ((Object)(object)joint != (Object)null)
			{
				joint.frequency = 70f;
			}
		}

		private void OnSceneLoad(Scene scene, LoadSceneMode mode)
		{
			if (((Scene)(ref scene)).name == "Mian")
			{
				joint = GameObject.Find("Player/Hub/Slider/Handle").GetComponent<FixedJoint2D>();
				joint.frequency = Mathf.Clamp(Frequency, 0f, 70f);
			}
		}

		private void OnSettingChanged(object sender, SettingChangedEventArgs arg)
		{
			if (!((Object)(object)joint == (Object)null))
			{
				joint.frequency = Mathf.Clamp(Frequency, 0f, 70f);
			}
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "goi.barackobusiness.flaccid";

		public const string PLUGIN_NAME = "Flaccid Hammer";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}