Decompiled source of CP2077 G58Dian v1.0.0

CP2077_G58Dian.dll

Decompiled 10 months ago
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using OtherLoader;

[assembly: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace Nikpo.CP2077_G58Dian;

[BepInPlugin("Nikpo.CP2077_G58Dian", "CP2077_G58Dian", "1.0.0")]
[BepInProcess("h3vr.exe")]
[Description("Built with MeatKit")]
[BepInDependency("h3vr.otherloader", "1.3.0")]
public class CP2077_G58DianPlugin : BaseUnityPlugin
{
	private static readonly string BasePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

	internal static ManualLogSource Logger;

	private void Awake()
	{
		Logger = ((BaseUnityPlugin)this).Logger;
		LoadAssets();
	}

	private void LoadAssets()
	{
		Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "Nikpo.CP2077_G58Dian");
		OtherLoader.RegisterDirectLoad(BasePath, "Nikpo.CP2077_G58Dian", "", "", "cp77_kangtaog58", "");
	}
}

DIANController.dll

Decompiled 10 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using FistVR;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using Nikpo.CP2077_G58Dian;
using OpenScripts2;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("DIANController")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DIANController")]
[assembly: AssemblyCopyright("Copyright ©  2021")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("fb790d1b-5d8a-4dc4-978c-e4626870cb75")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[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 Cityrobo
{
	public class Spinamathing : MonoBehaviour
	{
		public Transform SpinamathingThing;

		public Axis NotAxisButAllies;

		public DIANController Controlla;

		public SmartWeapon ReallySmartWeapon;

		public float SpinUpSpeedo = 5f;

		public float MaxSpeedo;

		public AudioSource Sauce;

		private float _speedo;

		public void Update()
		{
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			string[] stateNames = new string[4] { Controlla.StateWithMagIdle, Controlla.StateFiring, Controlla.StateMagInsertChamberEmptyTransition, Controlla.StateMagInsertChamberFullTransition };
			if (Controlla.AnimatorIsState(stateNames))
			{
				_speedo = Mathf.MoveTowards(_speedo, MaxSpeedo, Time.deltaTime * SpinUpSpeedo);
			}
			else
			{
				_speedo = Mathf.MoveTowards(_speedo, 0f, Time.deltaTime * SpinUpSpeedo);
			}
			SpinamathingThing.Rotate(OpenScripts2_BasePlugin.GetVectorFromAxis(NotAxisButAllies) * _speedo * Time.deltaTime);
			Sauce.pitch = _speedo / MaxSpeedo;
			((Behaviour)ReallySmartWeapon).enabled = Mathf.Approximately(_speedo, MaxSpeedo);
		}
	}
}
namespace Nikpo.CP2077_G58Dian
{
	public class DIANController : OpenScripts2_BasePlugin
	{
		public ClosedBoltWeapon DIAN;

		public int SafeFireSelectorPos;

		public Animator DIANAnimator;

		[Header("Animation State Configuration")]
		public string StateSafeIdle;

		public string StateWithMagIdle;

		public string StateWithoutMagIdle;

		public string StateChamberEmptyWithMagIdle;

		public string StateChamberEmptyWithoutMagIdle;

		public string StateFiring;

		public string StateMagInsertChamberFullTransition;

		public string StateMagInsertChamberEmptyTransition;

		[Header("Start Triggers Configuration")]
		public string StartToSafeIdle;

		public string StartToWithMagIdle;

		public string StartToWithoutMagIdle;

		public string StartToChamberEmptyWithMagIdle;

		public string StartToChamberEmptyWithoutMagIdle;

		[Header("Animation Triggers Configuration")]
		public string SafeToReadyWithMagTrigger;

		public string ReadyToSafeWithMagTrigger;

		public string SafeToReadyWithoutMagTrigger;

		public string ReadyToSafeWithoutMagTrigger;

		public string SafeToReadyChamberEmptyWithMagTrigger;

		public string ReadyToSafeChamberEmptyWithMagTrigger;

		public string SafeToReadyChamberEmptyWithoutMagTrigger;

		public string ReadyToSafeChamberEmptyWithoutMagTrigger;

		public string MagInsertFullReloadTrigger;

		public string MagEjectFullReloadTrigger;

		public string MagInsertPartialReloadTrigger;

		public string MagEjectPartialReloadTrigger;

		public string MagInsertEmpty;

		public string ChamberManuallyEmptiedWithMag;

		public string ChamberManuallyEmptiedWithoutMag;

		public string StartFiringTrigger;

		public string StopFiringTrigger;

		public string StopFiringTriggerEmptyChamber;

		[Header("Audio Event Configuration")]
		public AudioEvent SafeToReadyWithMagAudioEvent;

		public AudioEvent ReadyToSafeWithMagAudioEvent;

		public AudioEvent SafeToReadyWithoutMagAudioEvent;

		public AudioEvent ReadyToSafeWithoutMagAudioEvent;

		public AudioEvent SafeToReadyChamberEmptyWithMagAudioEvent;

		public AudioEvent ReadyToSafeChamberEmptyWithMagAudioEvent;

		public AudioEvent SafeToReadyChamberEmptyWithoutMagAudioEvent;

		public AudioEvent ReadyToSafeChamberEmptyWithoutMagAudioEvent;

		public AudioEvent MagInsertFullReloadAudioEvent;

		public AudioEvent MagEjectFullReloadAudioEvent;

		public AudioEvent MagInsertPartialReloadAudioEvent;

		public AudioEvent MagEjectPartialReloadAudioEvent;

		public AudioEvent MagInsertEmptyAudioEvent;

		public AudioEvent ChamberManuallyEmptiedWithMagAudioEvent;

		public AudioEvent ChamberManuallyEmptiedWithoutMagAudioEvent;

		[Header("Debugging")]
		public bool DebugLoggingEnabled;

		[HideInInspector]
		public bool EjectMag;

		[HideInInspector]
		public bool LoadRound;

		private FVRFireArmReloadTriggerWell _reloadTriggerWell;

		private string _lastAnimationTriggerEvent;

		private bool _IsSafetyOn;

		private bool _IsFireSelectorBlocked;

		private bool _chamberWasFullOnHandleGrab;

		private string _lastLog = string.Empty;

		private static readonly Dictionary<ClosedBoltWeapon, DIANController> _existingDIANControllers = new Dictionary<ClosedBoltWeapon, DIANController>();

		public void Awake()
		{
			_reloadTriggerWell = ((Component)DIAN).GetComponentInChildren<FVRFireArmReloadTriggerWell>();
			_existingDIANControllers.Add(DIAN, this);
		}

		public void OnDestroy()
		{
			_existingDIANControllers.Remove(DIAN);
		}

		public void Start()
		{
			DebugLog("Script Start");
			if (DIAN.FireSelectorModeIndex == SafeFireSelectorPos)
			{
				DIANAnimator.SetTrigger(StartToSafeIdle);
			}
			else if ((Object)(object)((FVRFireArm)DIAN).Magazine != (Object)null && DIAN.Chamber.IsFull)
			{
				DIANAnimator.SetTrigger(StartToWithMagIdle);
			}
			else if ((Object)(object)((FVRFireArm)DIAN).Magazine == (Object)null && DIAN.Chamber.IsFull)
			{
				DIANAnimator.SetTrigger(StartToWithoutMagIdle);
			}
			else if ((Object)(object)((FVRFireArm)DIAN).Magazine != (Object)null && !DIAN.Chamber.IsFull)
			{
				DIANAnimator.SetTrigger(StartToChamberEmptyWithMagIdle);
			}
			else if ((Object)(object)((FVRFireArm)DIAN).Magazine == (Object)null && !DIAN.Chamber.IsFull)
			{
				DIANAnimator.SetTrigger(StartToChamberEmptyWithoutMagIdle);
			}
		}

		public void Update()
		{
			//IL_0126: Unknown result type (might be due to invalid IL or missing references)
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_022b: Unknown result type (might be due to invalid IL or missing references)
			//IL_038f: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_0331: Unknown result type (might be due to invalid IL or missing references)
			//IL_05af: Unknown result type (might be due to invalid IL or missing references)
			//IL_0578: Unknown result type (might be due to invalid IL or missing references)
			//IL_0998: Unknown result type (might be due to invalid IL or missing references)
			//IL_093c: Unknown result type (might be due to invalid IL or missing references)
			//IL_08ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0470: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b29: Unknown result type (might be due to invalid IL or missing references)
			//IL_0adf: Unknown result type (might be due to invalid IL or missing references)
			if (EjectMag && (Object)(object)((FVRFireArm)DIAN).Magazine != (Object)null)
			{
				DebugLog("Chambering round...");
				EjectMag = false;
				((FVRFireArm)DIAN).EjectMag(false);
				DebugLog("Mag has " + (((Object)(object)((FVRFireArm)DIAN).Magazine == (Object)null) ? "been" : "not been") + " ejected!");
			}
			else if (EjectMag)
			{
				EjectMag = false;
			}
			if (LoadRound && !DIAN.Chamber.IsFull && (Object)(object)((FVRFireArm)DIAN).Magazine != (Object)null && ((FVRFireArm)DIAN).Magazine.HasARound())
			{
				DebugLog("Chambering round...");
				LoadRound = false;
				FVRFireArmRound component = ((FVRFireArm)DIAN).Magazine.RemoveRound(false).GetComponent<FVRFireArmRound>();
				DIAN.Chamber.SetRound(component, false);
				DIAN.CockHammer(false);
				DebugLog(string.Format("Chamber now filled with {0} of class {1} and hammer is {2}.", DIAN.Chamber.GetRound().RoundType, DIAN.Chamber.GetRound().RoundClass, DIAN.IsHammerCocked ? "cocked" : "not cocked"));
			}
			else if (LoadRound)
			{
				LoadRound = false;
			}
			if (DIAN.FireSelectorModeIndex == SafeFireSelectorPos && AnimatorIsState(StateWithMagIdle))
			{
				if (SendAnimationTriggerEvent(ReadyToSafeWithMagTrigger))
				{
					DebugLog("ReadyToSafeWithMagTrigger");
					PlayAudioAsFollowingHandling(ReadyToSafeWithMagAudioEvent, ((Component)DIAN).transform.position);
				}
			}
			else if (DIAN.FireSelectorModeIndex == SafeFireSelectorPos && AnimatorIsState(StateWithoutMagIdle))
			{
				if (SendAnimationTriggerEvent(ReadyToSafeWithoutMagTrigger))
				{
					DebugLog("ReadyToSafeWithoutMagTrigger");
					PlayAudioAsFollowingHandling(ReadyToSafeWithoutMagAudioEvent, ((Component)DIAN).transform.position);
				}
			}
			else if (DIAN.FireSelectorModeIndex != SafeFireSelectorPos && AnimatorIsState(StateSafeIdle) && (Object)(object)((FVRFireArm)DIAN).Magazine != (Object)null && DIAN.Chamber.IsFull)
			{
				if (SendAnimationTriggerEvent(SafeToReadyWithMagTrigger))
				{
					DebugLog("SafeToReadyWithMagTrigger");
					PlayAudioAsFollowingHandling(SafeToReadyWithMagAudioEvent, ((Component)DIAN).transform.position);
				}
			}
			else if (DIAN.FireSelectorModeIndex != SafeFireSelectorPos && AnimatorIsState(StateSafeIdle) && (Object)(object)((FVRFireArm)DIAN).Magazine == (Object)null && DIAN.Chamber.IsFull)
			{
				if (SendAnimationTriggerEvent(SafeToReadyWithoutMagTrigger))
				{
					DebugLog("SafeToReadyWithoutMagTrigger");
					PlayAudioAsFollowingHandling(SafeToReadyWithoutMagAudioEvent, ((Component)DIAN).transform.position);
				}
			}
			else if (DIAN.FireSelectorModeIndex == SafeFireSelectorPos && AnimatorIsState(StateChamberEmptyWithMagIdle))
			{
				if (SendAnimationTriggerEvent(ReadyToSafeChamberEmptyWithMagTrigger))
				{
					DebugLog("ReadyToSafeChamberEmptyWithMagTrigger");
					PlayAudioAsFollowingHandling(ReadyToSafeChamberEmptyWithMagAudioEvent, ((Component)DIAN).transform.position);
				}
			}
			else if (DIAN.FireSelectorModeIndex == SafeFireSelectorPos && AnimatorIsState(StateChamberEmptyWithoutMagIdle))
			{
				if (SendAnimationTriggerEvent(ReadyToSafeChamberEmptyWithoutMagTrigger))
				{
					DebugLog("ReadyToSafeChamberEmptyWithoutMagTrigger");
					PlayAudioAsFollowingHandling(ReadyToSafeChamberEmptyWithoutMagAudioEvent, ((Component)DIAN).transform.position);
				}
			}
			else if (DIAN.FireSelectorModeIndex != SafeFireSelectorPos && AnimatorIsState(StateSafeIdle) && (Object)(object)((FVRFireArm)DIAN).Magazine != (Object)null && !DIAN.Chamber.IsFull)
			{
				if (SendAnimationTriggerEvent(SafeToReadyChamberEmptyWithMagTrigger))
				{
					DebugLog("SafeToReadyChamberEmptyWithMagTrigger");
					PlayAudioAsFollowingHandling(SafeToReadyChamberEmptyWithMagAudioEvent, ((Component)DIAN).transform.position);
				}
			}
			else if (DIAN.FireSelectorModeIndex != SafeFireSelectorPos && AnimatorIsState(StateSafeIdle) && (Object)(object)((FVRFireArm)DIAN).Magazine == (Object)null && !DIAN.Chamber.IsFull && SendAnimationTriggerEvent(SafeToReadyChamberEmptyWithoutMagTrigger))
			{
				DebugLog("SafeToReadyChamberEmptyWithoutMagTrigger");
				PlayAudioAsFollowingHandling(SafeToReadyChamberEmptyWithoutMagAudioEvent, ((Component)DIAN).transform.position);
			}
			FVRViveHand hand = ((FVRInteractiveObject)DIAN).m_hand;
			if ((Object)(object)hand != (Object)null)
			{
				if (AnimatorIsState(new string[2] { StateWithMagIdle, StateChamberEmptyWithMagIdle }) && CheckMagReleaseInput(hand))
				{
					if (!DIAN.Chamber.IsFull)
					{
						if (SendAnimationTriggerEvent(MagEjectFullReloadTrigger))
						{
							DebugLog("MagEjectFullReloadTrigger");
							PlayAudioAsFollowingHandling(MagEjectFullReloadAudioEvent, ((Component)DIAN).transform.position);
						}
					}
					else if (SendAnimationTriggerEvent(MagEjectPartialReloadTrigger))
					{
						DebugLog("MagEjectPartialReloadTrigger");
						PlayAudioAsFollowingHandling(MagEjectPartialReloadAudioEvent, ((Component)DIAN).transform.position);
					}
				}
				if (AnimatorIsState(StateWithMagIdle))
				{
					if (hand.Input.TriggerFloat >= DIAN.TriggerFiringThreshold && (DIAN.Chamber.IsFull || DIAN.m_proxy.IsFull || ((Object)(object)((FVRFireArm)DIAN).Magazine != (Object)null && ((FVRFireArm)DIAN).Magazine.HasARound())) && SendAnimationTriggerEvent(StartFiringTrigger))
					{
						DebugLog("StartFiringTrigger");
					}
				}
				else if (AnimatorIsState(StateFiring))
				{
					if (hand.Input.TriggerFloat <= DIAN.TriggerResetThreshold)
					{
						if (!DIAN.Chamber.IsFull && !DIAN.m_proxy.IsFull && ((Object)(object)((FVRFireArm)DIAN).Magazine == (Object)null || ((Object)(object)((FVRFireArm)DIAN).Magazine != (Object)null && !((FVRFireArm)DIAN).Magazine.HasARound())))
						{
							if (SendAnimationTriggerEvent(StopFiringTriggerEmptyChamber))
							{
								DebugLog("StopFiringTriggerEmptyChamber");
							}
						}
						else if (SendAnimationTriggerEvent(StopFiringTrigger))
						{
							DebugLog("StopFiringTrigger");
						}
					}
					else if (hand.Input.TriggerFloat > DIAN.TriggerResetThreshold && !DIAN.Chamber.IsFull && !DIAN.m_proxy.IsFull && ((Object)(object)((FVRFireArm)DIAN).Magazine == (Object)null || ((Object)(object)((FVRFireArm)DIAN).Magazine != (Object)null && !((FVRFireArm)DIAN).Magazine.HasARound())) && SendAnimationTriggerEvent(StopFiringTriggerEmptyChamber))
					{
						DebugLog("StopFiringTriggerEmptyChamber");
					}
				}
			}
			else if (AnimatorIsState(StateFiring))
			{
				if (!DIAN.Chamber.IsFull && !DIAN.m_proxy.IsFull && ((Object)(object)((FVRFireArm)DIAN).Magazine == (Object)null || ((Object)(object)((FVRFireArm)DIAN).Magazine != (Object)null && !((FVRFireArm)DIAN).Magazine.HasARound())))
				{
					if (SendAnimationTriggerEvent(StopFiringTriggerEmptyChamber))
					{
						DebugLog("StopFiringTriggerEmptyChamber");
					}
				}
				else if (SendAnimationTriggerEvent(StopFiringTrigger))
				{
					DebugLog("StopFiringTrigger");
				}
			}
			if (AnimatorIsState(StateWithoutMagIdle) || AnimatorIsState(StateChamberEmptyWithoutMagIdle))
			{
				((Component)_reloadTriggerWell).gameObject.SetActive(true);
				if ((Object)(object)((FVRFireArm)DIAN).Magazine != (Object)null && ((FVRFireArm)DIAN).Magazine.HasARound())
				{
					if (!DIAN.Chamber.IsFull)
					{
						if (SendAnimationTriggerEvent(MagInsertFullReloadTrigger))
						{
							DebugLog("MagInsertFullReloadTrigger");
							PlayAudioAsFollowingHandling(MagInsertFullReloadAudioEvent, ((Component)DIAN).transform.position);
						}
					}
					else if (SendAnimationTriggerEvent(MagInsertPartialReloadTrigger))
					{
						DebugLog("MagInsertPartialReloadTrigger");
						PlayAudioAsFollowingHandling(MagInsertPartialReloadAudioEvent, ((Component)DIAN).transform.position);
					}
				}
				else if ((Object)(object)((FVRFireArm)DIAN).Magazine != (Object)null && !((FVRFireArm)DIAN).Magazine.HasARound() && SendAnimationTriggerEvent(MagInsertEmpty))
				{
					DebugLog("MagInsertEmpty");
					PlayAudioAsFollowingHandling(MagInsertEmptyAudioEvent, ((Component)DIAN).transform.position);
				}
			}
			else
			{
				((Component)_reloadTriggerWell).gameObject.SetActive(false);
			}
			_IsSafetyOn = !AnimatorIsState(new string[2] { StateFiring, StateWithMagIdle });
			string[] stateNames = new string[5] { StateSafeIdle, StateWithMagIdle, StateWithoutMagIdle, StateChamberEmptyWithMagIdle, StateChamberEmptyWithoutMagIdle };
			_IsFireSelectorBlocked = !AnimatorIsState(stateNames);
			((Component)DIAN.Handle).GetComponent<Collider>().isTrigger = AnimatorIsState(stateNames);
			if (((FVRInteractiveObject)DIAN.Handle).IsHeld)
			{
				if (DIAN.Chamber.IsFull)
				{
					_chamberWasFullOnHandleGrab = true;
				}
				else if (!DIAN.Chamber.IsFull && _chamberWasFullOnHandleGrab)
				{
					if ((Object)(object)((FVRFireArm)DIAN).Magazine != (Object)null && !((FVRFireArm)DIAN).Magazine.HasARound())
					{
						if (SendAnimationTriggerEvent(ChamberManuallyEmptiedWithMag))
						{
							DebugLog("ChamberManuallyEmptiedWithMag");
							PlayAudioAsFollowingHandling(ChamberManuallyEmptiedWithMagAudioEvent, ((Component)DIAN).transform.position);
						}
					}
					else if ((Object)(object)((FVRFireArm)DIAN).Magazine == (Object)null && SendAnimationTriggerEvent(ChamberManuallyEmptiedWithoutMag))
					{
						DebugLog("ChamberManuallyEmptiedWithoutMag");
						PlayAudioAsFollowingHandling(ChamberManuallyEmptiedWithoutMagAudioEvent, ((Component)DIAN).transform.position);
					}
					_chamberWasFullOnHandleGrab = false;
				}
			}
			else
			{
				_chamberWasFullOnHandleGrab = false;
			}
			if (DebugLoggingEnabled)
			{
				string stateName = GetStateName();
				if (stateName != _lastLog)
				{
					_lastLog = stateName;
					Debug.Log((object)_lastLog);
				}
			}
		}

		public bool AnimatorIsState(string stateName)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			AnimatorStateInfo currentAnimatorStateInfo = DIANAnimator.GetCurrentAnimatorStateInfo(0);
			return ((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName(stateName);
		}

		public bool AnimatorIsState(string[] stateNames)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			AnimatorStateInfo currentAnimatorStateInfo = DIANAnimator.GetCurrentAnimatorStateInfo(0);
			return ((IEnumerable<string>)stateNames).Any((Func<string, bool>)((AnimatorStateInfo)(object)currentAnimatorStateInfo).IsName);
		}

		private string GetStateName()
		{
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			List<string> obj = new List<string> { StateSafeIdle, StateWithMagIdle, StateWithoutMagIdle, StateChamberEmptyWithMagIdle, StateChamberEmptyWithoutMagIdle, StateFiring, StateMagInsertChamberEmptyTransition, StateMagInsertChamberFullTransition };
			AnimatorStateInfo currentAnimatorStateInfo = DIANAnimator.GetCurrentAnimatorStateInfo(0);
			foreach (string item in obj)
			{
				if (((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName(item))
				{
					return item;
				}
			}
			return "";
		}

		private bool SendAnimationTriggerEvent(string trigger)
		{
			if (trigger != _lastAnimationTriggerEvent)
			{
				_lastAnimationTriggerEvent = trigger;
				DIANAnimator.SetTrigger(trigger);
				return true;
			}
			return false;
		}

		private bool CheckMagReleaseInput(FVRViveHand hand)
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			if (hand.IsInStreamlinedMode)
			{
				return hand.Input.AXButtonDown;
			}
			return OpenScripts2_BasePlugin.TouchpadDirDown(hand, Vector2.down);
		}

		private void DebugLog(string msg)
		{
			if (DebugLoggingEnabled)
			{
				Debug.Log((object)msg);
			}
		}

		private void PlayAudioAsFollowingHandling(AudioEvent audioEvent, Vector3 pos)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			((FVRFireArm)DIAN).PlayAudioAsHandling(audioEvent, pos).FollowThisTransform(((Component)this).transform);
		}

		[HarmonyPatch(typeof(ClosedBoltWeapon), "DropHammer")]
		[HarmonyPrefix]
		public static bool ClosedBoltWeapon_DropHammer_Patch(ClosedBoltWeapon __instance)
		{
			if (_existingDIANControllers.TryGetValue(__instance, out var value) && value._IsSafetyOn)
			{
				return false;
			}
			return true;
		}

		[HarmonyPatch(typeof(ClosedBoltWeapon), "ToggleFireSelector")]
		[HarmonyPrefix]
		public static bool ClosedBoltWeapon_ToggleFireSelector_Patch(ClosedBoltWeapon __instance)
		{
			if (_existingDIANControllers.TryGetValue(__instance, out var value) && value._IsFireSelectorBlocked)
			{
				return false;
			}
			return true;
		}
	}
	[BepInPlugin("h3vr.cityrobo.DIANController", "DIANController", "1.0.0")]
	public class DIANController_BepInExPlugin : BaseUnityPlugin
	{
		public void Awake()
		{
			Harmony.CreateAndPatchAll(typeof(DIANController), (string)null);
		}
	}
}