Decompiled source of Type67ChicomGrenade v1.0.0

Type67ChicomGrenade.dll

Decompiled 3 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 FistVR;
using HarmonyLib;
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]
namespace Volksterism.Type67ChicomGrenade;

[BepInPlugin("Volksterism.Type67ChicomGrenade", "Type67ChicomGrenade", "1.0.0")]
[BepInProcess("h3vr.exe")]
[Description("Built with MeatKit")]
[BepInDependency("h3vr.otherloader", "1.3.0")]
public class Type67ChicomGrenadePlugin : 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(), "Volksterism.Type67ChicomGrenade");
		OtherLoader.RegisterDirectLoad(BasePath, "Volksterism.Type67ChicomGrenade", "", "", "type67grenade", "");
	}
}
public class Semtex : PinnedGrenade
{
	[Header("Semtex Values")]
	public bool isSticky;

	public LayerMask stickyMask;

	[Header("Semtex Extras (Leave Empty If Not Needed)")]
	[Tooltip("If not null, will play audio clip placed inside of source. Used for a stick sound if you want.")]
	public AudioSource StickSource;

	public override void OnCollisionEnter(Collision collision)
	{
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		if (collision.gameObject.layer == LayerMask.op_Implicit(stickyMask) && !((FVRInteractiveObject)this).IsHeld)
		{
			((Component)this).transform.parent = collision.transform;
			((Component)this).GetComponent<Rigidbody>().isKinematic = true;
			if ((Object)(object)StickSource != (Object)null)
			{
				StickSource.Play();
			}
		}
		((PinnedGrenade)this).OnCollisionEnter(collision);
	}
}