Decompiled source of NutcrackerRework v1.0.0

NutcrackerRework.dll

Decompiled a month ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
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("NutcrackerRework")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("NutcrackerRework")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("9c765891-91bb-4eed-8029-7ef4364cb1b8")]
[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 NutcrackerRework
{
	[BepInPlugin("Zion.NutcrackerRework", "Nutcracker Rework", "1.0.0")]
	public class NutRework : BaseUnityPlugin
	{
		private const string modGUID = "Zion.NutcrackerRework";

		private const string modName = "Nutcracker Rework";

		private const string modVersion = "1.0.0";

		private readonly Harmony harmony = new Harmony("Zion.NutcrackerRework");

		private static NutRework Instance;

		internal ManualLogSource mls;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			mls = Logger.CreateLogSource("Zion.NutcrackerRework");
			mls.LogInfo((object)"8888888888P d8b                   \r\n      d88P  Y8P                   \r\n     d88P                         \r\n    d88P    888  .d88b.  88888b.  \r\n   d88P     888 d88\"\"88b 888 \"88b \r\n  d88P      888 888  888 888  888 \r\n d88P       888 Y88..88P 888  888 \r\nd8888888888 888  \"Y88P\"  888  888 \r\n                                  \r\n                                  \r\n                                  ");
			harmony.PatchAll();
		}
	}
}
namespace NutcrackerRework.Patches
{
	[HarmonyPatch(typeof(NutcrackerEnemyAI))]
	internal class NutcrackerEnemyAIPatch3
	{
		[HarmonyPatch("ReloadGunClientRpc")]
		[HarmonyPostfix]
		private static void patchShells(ref ShotgunItem ___gun)
		{
			___gun.shellsLoaded = 3;
			int scrapValue = Random.Range(70, 130);
			((GrabbableObject)___gun).SetScrapValue(scrapValue);
		}
	}
	[HarmonyPatch(typeof(NutcrackerEnemyAI))]
	internal class NutcrackerEnemyAIPatch2
	{
		[HarmonyPatch("Start")]
		[HarmonyPostfix]
		private static void patchShells(ref ShotgunItem ___gun)
		{
			___gun.shellsLoaded = 3;
			int scrapValue = Random.Range(70, 130);
			((GrabbableObject)___gun).SetScrapValue(scrapValue);
		}
	}
	[HarmonyPatch(typeof(NutcrackerEnemyAI))]
	internal class NutcrackerEnemyAIPatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void patchSpeed(ref float ___torsoTurnSpeed, ref NutcrackerEnemyAI __instance, ref float ___speedWhileAiming)
		{
			___torsoTurnSpeed = 2000f;
			___speedWhileAiming = 3.5f;
			((EnemyAI)__instance).agent.speed = 9f;
		}
	}
}