Decompiled source of Annihilator v1.0.0

Annihilator.dll

Decompiled 5 days 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]
public class Powerfist : FVRPhysicalObject
{
	[Header("Fist Properties")]
	public PunchArea punchArea;

	public float velocityThreshold;

	public Animator anim;

	public override void UpdateInteraction(FVRViveHand hand)
	{
		//IL_0036: Unknown result type (might be due to invalid IL or missing references)
		//IL_003b: Unknown result type (might be due to invalid IL or missing references)
		((FVRPhysicalObject)this).UpdateInteraction(hand);
		float triggerFloat = hand.Input.TriggerFloat;
		anim.SetFloat("Blend", triggerFloat);
		if (triggerFloat > 0.7f)
		{
			Vector3 velocity = ((FVRPhysicalObject)this).RootRigidbody.velocity;
			if (((Vector3)(ref velocity)).magnitude >= velocityThreshold)
			{
				hand.Buzz(hand.Buzzer.Buzz_GunShot);
				punchArea.canPunch = true;
				return;
			}
		}
		punchArea.canPunch = false;
	}
}
public class PunchArea : MonoBehaviour
{
	[HideInInspector]
	public bool canPunch;

	public GameObject spawnOnPunch;

	public Transform SOPPos;

	public void OnTriggerEnter(Collider other)
	{
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0037: Unknown result type (might be due to invalid IL or missing references)
		Rigidbody componentInParent = ((Component)other).GetComponentInParent<Rigidbody>();
		if (canPunch && Object.op_Implicit((Object)(object)componentInParent))
		{
			Object.Instantiate<GameObject>(spawnOnPunch, SOPPos.position, SOPPos.rotation);
		}
	}
}
namespace thewnbot.Annihilator;

[BepInPlugin("thewnbot.Annihilator", "Annihilator", "1.0.0")]
[BepInProcess("h3vr.exe")]
[Description("Built with MeatKit")]
[BepInDependency("h3vr.otherloader", "1.3.0")]
public class AnnihilatorPlugin : 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(), "thewnbot.Annihilator");
		OtherLoader.RegisterDirectLoad(BasePath, "thewnbot.Annihilator", "", "", "annihilator", "");
	}
}
public class Test : MonoBehaviour
{
	private void Start()
	{
	}

	private void Update()
	{
	}
}