Decompiled source of FasterMagnetCharge v1.0.2

FMC.dll

Decompiled 3 months ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using HarmonyLib;
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("MFM")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("MFM")]
[assembly: AssemblyCopyright("Copyright ©  2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("7533495d-3849-43e3-9e7d-686c9ab9e155")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace MFsM;

[BepInPlugin("com.yourname.FMC", "FMC", "1.0.0")]
public class Plugin : BaseUnityPlugin
{
	private 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)"FasterMagnetCharge загружен");
		Harmony val = new Harmony("com.yourname.FMC");
		val.PatchAll();
	}
}
[HarmonyPatch(typeof(MagnetGun), "OnEnterAbility")]
public static class MagnetGunAnimationSpeedUpMod
{
	[HarmonyPostfix]
	public static void FasterMagnetEnterAnimation(MagnetGun __instance)
	{
		if ((Object)(object)__instance == (Object)null || (Object)(object)__instance.animData == (Object)null)
		{
			return;
		}
		string[] array = new string[2] { "enter", "prepull" };
		string[] array2 = array;
		foreach (string text in array2)
		{
			SpriteFrame[] animation = __instance.animData.GetAnimation(text);
			if (animation != null)
			{
				for (int j = 0; j < animation.Length; j++)
				{
					animation[j].frameDuration = Mathf.Max(1, animation[j].frameDuration / 2);
				}
			}
		}
	}
}