Decompiled source of Multibosses v1.0.0

BepInEx/plugins/Autoshoot/AutoShoot.dll

Decompiled 3 months 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 AutoShoot;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = ".NET Standard 2.0")]
[assembly: BuildDateTime("2024-02-17T00:27:31")]
[assembly: AssemblyCompany("AutoShoot")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("My first plugin")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+b3f4a71c8fb1461cff2a16b32ee032e7df9ec107")]
[assembly: AssemblyProduct("AutoShoot")]
[assembly: AssemblyTitle("AutoShoot")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.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 Template
{
	internal class ConsoleController : MonoBehaviour
	{
		private bool showConsole = false;

		private void Awake()
		{
			Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject);
		}

		private void Update()
		{
			if (Input.GetKeyUp((KeyCode)126))
			{
				Debug.Log((object)"hello from console controller!");
			}
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "AutoShoot";

		public const string PLUGIN_NAME = "AutoShoot";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}
namespace AutoShoot
{
	[AttributeUsage(AttributeTargets.Assembly)]
	public class BuildDateTimeAttribute : Attribute
	{
		public DateTime Built { get; }

		public BuildDateTimeAttribute(string date)
		{
			Built = DateTime.Parse(date);
		}
	}
	[HarmonyPatch(typeof(PlayerAutoFireWhileFarming), "Update")]
	internal class PlayerAutoFireWhileFarming_Patch
	{
		private static FieldRef<PlayerAutoFireWhileFarming, bool> hasEnemyInRange = AccessTools.FieldRefAccess<PlayerAutoFireWhileFarming, bool>("_hasEnemyInRange");

		private static FieldRef<PlayerAutoFireWhileFarming, float> isFiring = AccessTools.FieldRefAccess<PlayerAutoFireWhileFarming, float>("_isFiring");

		private static FieldRef<PlayerAutoFireWhileFarming, bool> isWaitingForReload = AccessTools.FieldRefAccess<PlayerAutoFireWhileFarming, bool>("_isWaitingForReload");

		private static FieldRef<PlayerAutoFireWhileFarming, float> triggerPressTimer = AccessTools.FieldRefAccess<PlayerAutoFireWhileFarming, float>("_triggerPressTimer");

		private static void Postfix(PlayerAutoFireWhileFarming __instance)
		{
			Traverse val = Traverse.Create((object)__instance);
			val.Field<float>("_isFiring").Value = 1f;
			if (isFiring.Invoke(__instance) == 1f)
			{
				Debug.Log((object)"traverse worked");
			}
			else
			{
				Debug.Log((object)"traverse did not work");
			}
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "fhghaha.plugin.AutoShoot";

		public const string PLUGIN_NAME = "AutoShoot";

		public const string PLUGIN_VERSION = "1.0.0";
	}
	[BepInPlugin("fhghaha.plugin.AutoShoot", "AutoShoot", "1.0.0")]
	public class Plugin : BaseUnityPlugin
	{
		public static ManualLogSource Log;

		private void Awake()
		{
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Expected O, but got Unknown
			Log = ((BaseUnityPlugin)this).Logger;
			((BaseUnityPlugin)this).Logger.LogMessage((object)"---------------Plugin fhghaha.plugin.AutoShoot is loaded!---------------");
			((BaseUnityPlugin)this).Logger.LogMessage((object)$"---------------{GetBuildDateTime()}---------------");
			Harmony val = new Harmony("fhghaha.plugin.AutoShoot");
			val.PatchAll();
		}

		private static DateTime? GetBuildDateTime()
		{
			Assembly executingAssembly = Assembly.GetExecutingAssembly();
			return (Attribute.GetCustomAttribute(executingAssembly, typeof(BuildDateTimeAttribute)) is BuildDateTimeAttribute buildDateTimeAttribute) ? new DateTime?(buildDateTimeAttribute.Built) : null;
		}
	}
}