Decompiled source of Remington1187 v1.0.0

Remington1187.dll

Decompiled a day ago
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using FistVR;
using HarmonyLib;
using OpenScripts2;
using OtherLoader;
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 SuppressorAddSound : Suppressor
{
	public bool PlaysTail = true;

	public AudioEvent AudEvent_SoundToPlay;

	public override void OnShot(FVRFireArm f, FVRTailSoundClass tailClass)
	{
		//IL_0072: Unknown result type (might be due to invalid IL or missing references)
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_0080: Unknown result type (might be due to invalid IL or missing references)
		FVRFirearmAudioSet audioClipSet = f.AudioClipSet;
		if (PlaysTail)
		{
			f.PlayShotTail((FVRTailSoundClass)11, (FVRSoundEnvironment)12, 1f);
			int playerIFF = GM.CurrentPlayerBody.GetPlayerIFF();
			GM.CurrentSceneSettings.OnPerceiveableSound(200f, 80f, ((Component)this).transform.position, playerIFF, GM.CurrentPlayerBody.PlayerEntities[0]);
		}
		else
		{
			f.PlayAudioAsHandling(AudEvent_SoundToPlay, ((Component)this).transform.position);
		}
		((MuzzleDevice)this).OnShot(f, tailClass);
	}

	public override void OnShot(AttachableFirearm f, FVRTailSoundClass tailClass)
	{
		//IL_0072: Unknown result type (might be due to invalid IL or missing references)
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_0080: Unknown result type (might be due to invalid IL or missing references)
		FVRFirearmAudioSet audioClipSet = f.AudioClipSet;
		if (PlaysTail)
		{
			f.PlayShotTail((FVRTailSoundClass)11, (FVRSoundEnvironment)12, 1f);
			int playerIFF = GM.CurrentPlayerBody.GetPlayerIFF();
			GM.CurrentSceneSettings.OnPerceiveableSound(200f, 80f, ((Component)this).transform.position, playerIFF, GM.CurrentPlayerBody.PlayerEntities[0]);
		}
		else
		{
			f.PlayAudioAsHandling(AudEvent_SoundToPlay, ((Component)this).transform.position);
		}
		((MuzzleDevice)this).OnShot(f, tailClass);
	}

	[ContextMenu("Copy Suppressor")]
	public void CopySuppressor()
	{
		Suppressor[] components = ((Component)this).GetComponents<Suppressor>();
		Suppressor val = components.Single((Suppressor c) => (Object)(object)c != (Object)(object)this);
		foreach (FVRFireArmAttachmentMount attachmentMount in ((FVRPhysicalObject)val).AttachmentMounts)
		{
			attachmentMount.MyObject = (FVRPhysicalObject)(object)this;
			attachmentMount.Parent = (FVRPhysicalObject)(object)this;
		}
		((FVRFireArmAttachment)val).AttachmentInterface.Attachment = (FVRFireArmAttachment)(object)this;
		((FVRFireArmAttachment)val).Sensor.Attachment = (FVRFireArmAttachment)(object)this;
		UniversalCopy.CopyComponent<Suppressor>((Component)(object)this, val);
	}
}
namespace Volks.Remington1187;

[BepInPlugin("Volks.Remington1187", "Remington1187", "1.0.0")]
[BepInProcess("h3vr.exe")]
[Description("Built with MeatKit")]
[BepInDependency("h3vr.otherloader", "1.3.0")]
public class Remington1187Plugin : 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(), "Volks.Remington1187");
		OtherLoader.RegisterDirectLoad(BasePath, "Volks.Remington1187", "", "", "remington1187", "");
	}
}