Decompiled source of Megaphone v1.0.0

Megaphone.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 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 JerryMegaBullet
{
	public class MegaBullet : MonoBehaviour
	{
		public SphereCollider col;

		private void OnTriggerEnter(Collider other)
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			if ((Object)(object)((Component)other).gameObject.GetComponent<SosigLink>() != (Object)null && (int)((Component)other).gameObject.GetComponent<SosigLink>().S.BodyState != 3)
			{
				float num = Random.Range(0, 5);
				((Component)other).gameObject.GetComponent<SosigLink>().S.ActivatePower((PowerupType)16, (PowerUpIntensity)2, (PowerUpDuration)1, false, false);
				((Component)other).gameObject.GetComponent<SosigLink>().S.ActivatePower((PowerupType)0, (PowerUpIntensity)1, (PowerUpDuration)1, true, true);
				((Component)other).gameObject.GetComponent<SosigLink>().S.SetIFF(Random.Range(0, 10));
				if (num == 0f)
				{
					((Component)other).gameObject.GetComponent<SosigLink>().S.SetCurrentOrder((SosigOrder)7);
				}
				if (num == 1f)
				{
					((Component)other).gameObject.GetComponent<SosigLink>().S.SetCurrentOrder((SosigOrder)8);
				}
				if (num == 2f)
				{
					((Component)other).gameObject.GetComponent<SosigLink>().S.SetCurrentOrder((SosigOrder)3);
				}
				if (num == 3f)
				{
					((Component)other).gameObject.GetComponent<SosigLink>().S.SetCurrentOrder((SosigOrder)2);
				}
				if (num == 4f)
				{
					((Component)other).gameObject.GetComponent<SosigLink>().S.SetCurrentOrder((SosigOrder)5);
				}
			}
		}

		private void Update()
		{
			col.radius = Mathf.Lerp(col.radius, 2f, Time.deltaTime * 2.5f);
		}
	}
}
namespace JerryAr.Megaphone
{
	[BepInPlugin("JerryAr.Megaphone", "Megaphone", "1.0.0")]
	[BepInProcess("h3vr.exe")]
	[Description("Built with MeatKit")]
	[BepInDependency("h3vr.otherloader", "1.3.0")]
	public class MegaphonePlugin : 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(), "JerryAr.Megaphone");
			OtherLoader.RegisterDirectLoad(BasePath, "JerryAr.Megaphone", "", "", "megaphone", "");
		}
	}
}