Decompiled source of Back4Blood The Belgian v1.0.1

Back4Blood_The_Belgian.dll

Decompiled a day 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 FistVR;
using HarmonyLib;
using OtherLoader;
using Sodalite.Api;
using UnityEngine;

[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]
public class BreakActionMainHandFireSelector : MonoBehaviour
{
	public BreakActionWeapon Weapon;

	public Transform SelectorSwitch;

	public Vector3 PosSingleFire;

	public Vector3 PosMultiFire;

	public bool IsRot = false;

	public Vector3 RotEngaged;

	public bool SwapsTrigger = false;

	public Transform SecondTrigger;

	public float SecondTriggerPulledAngle = 20f;

	private Transform OriginalTrigger;

	private float OriginalTriggerPulled;

	private void Awake()
	{
		OriginalTrigger = Weapon.Triggers[0];
		OriginalTriggerPulled = Weapon.TriggerPulled;
	}

	private void Update()
	{
		//IL_0074: Unknown result type (might be due to invalid IL or missing references)
		//IL_0079: Unknown result type (might be due to invalid IL or missing references)
		FVRViveHand hand = ((FVRInteractiveObject)Weapon).m_hand;
		if (!((Object)(object)hand == (Object)null) && ((hand.IsInStreamlinedMode && hand.Input.AXButtonDown) || (!hand.IsInStreamlinedMode && hand.Input.TouchpadDown && ((Vector2)(ref hand.Input.TouchpadAxes)).magnitude > 0.2f && Vector2.Angle(hand.Input.TouchpadAxes, Vector2.down) <= 45f)))
		{
			SwapFiremodes();
		}
	}

	public void SwapFiremodes()
	{
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
		//IL_0060: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
		((FVRFireArm)Weapon).PlayAudioEvent((FirearmAudioEventType)15, 1f);
		if (Weapon.FireAllBarrels)
		{
			Weapon.FireAllBarrels = false;
			if (!IsRot)
			{
				SelectorSwitch.localPosition = PosSingleFire;
			}
			if (IsRot)
			{
				SelectorSwitch.localEulerAngles = Vector3.zero;
			}
			if (SwapsTrigger)
			{
				Weapon.Triggers[0] = OriginalTrigger;
				Weapon.TriggerPulled = OriginalTriggerPulled;
			}
		}
		else if (!Weapon.FireAllBarrels)
		{
			Weapon.FireAllBarrels = true;
			if (!IsRot)
			{
				SelectorSwitch.localPosition = PosMultiFire;
			}
			if (IsRot)
			{
				SelectorSwitch.localEulerAngles = RotEngaged;
			}
			if (SwapsTrigger)
			{
				Weapon.Triggers[0] = SecondTrigger;
				Weapon.TriggerPulled = SecondTriggerPulledAngle;
			}
		}
	}
}
namespace biddin.Back4Blood_The_Belgian;

[BepInPlugin("biddin.Back4Blood_The_Belgian", "Back4Blood_The_Belgian", "1.0.1")]
[BepInProcess("h3vr.exe")]
[Description("Built with MeatKit")]
[BepInDependency("h3vr.otherloader", "1.3.0")]
[BepInDependency("h3vr.cityrobo.ModularWorkshopManager", "1.0.0")]
[BepInDependency("nrgill28.Sodalite", "1.4.1")]
public class Back4Blood_The_BelgianPlugin : 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(), "biddin.Back4Blood_The_Belgian");
		OtherLoader.RegisterDirectLoad(BasePath, "biddin.Back4Blood_The_Belgian", "", "", "back4blood_thebelgian", "");
		GameAPI.PreloadAllAssets(Path.Combine(BasePath, "mw_back4blood_the_belgian"));
	}
}