Decompiled source of TurretAlwaysLaser v1.0.0

TurretAlwaysLaserMod.dll

Decompiled a year ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using HarmonyLib;
using TurretAlwaysLaserMod.Patches;
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("TurretAlwaysLaserMod")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("TurretAlwaysLaserMod")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("a0c00b42-5017-458e-a3bd-9e36458950fc")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace TurretAlwaysLaserMod
{
	[BepInPlugin("tolstj.turretAlwaysLaser", "Turret Always Laser", "1.0.0.0")]
	public class TurretAlwaysLaserModBase : BaseUnityPlugin
	{
		private const string modGUID = "tolstj.turretAlwaysLaser";

		private const string modName = "Turret Always Laser";

		private const string modVersion = "1.0.0.0";

		private readonly Harmony harmony = new Harmony("tolstj.turretAlwaysLaser");

		private void Awake()
		{
			harmony.PatchAll(typeof(TurretPatch));
		}
	}
}
namespace TurretAlwaysLaserMod.Patches
{
	[HarmonyPatch(typeof(Turret))]
	internal class TurretPatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void TurretDetectionToChargingPatch(ref Animator ___turretAnimator, ref TurretMode ___turretMode)
		{
			if ((int)___turretMode == 0)
			{
				___turretAnimator.SetInteger("TurretMode", 1);
			}
		}
	}
}