Decompiled source of TerribleScripts v0.1.7

TerribleScripts.dll

Decompiled 2 days ago
using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using FistVR;
using Microsoft.CodeAnalysis;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyCompany("nootarc")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Scripts for my mods. It's like i'm a real modder now!")]
[assembly: AssemblyFileVersion("0.1.7.0")]
[assembly: AssemblyInformationalVersion("0.1.7+ee9ad842ab8a4fca335361666e3ccca6d2d3bbd8")]
[assembly: AssemblyProduct("TerribleScripts")]
[assembly: AssemblyTitle("TerribleScripts")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.1.7.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace BepInEx
{
	[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
	[Conditional("CodeGeneration")]
	internal sealed class BepInAutoPluginAttribute : Attribute
	{
		public BepInAutoPluginAttribute(string id = null, string name = null, string version = null)
		{
		}
	}
}
namespace BepInEx.Preloader.Core.Patching
{
	[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
	[Conditional("CodeGeneration")]
	internal sealed class PatcherAutoPluginAttribute : Attribute
	{
		public PatcherAutoPluginAttribute(string id = null, string name = null, string version = null)
		{
		}
	}
}
namespace nootarc
{
	[BepInProcess("h3vr.exe")]
	[BepInPlugin("TerribleScripts", "TerribleScripts", "0.1.7+ee9ad842ab8a4fca335361666e3ccca6d2d3bbd8")]
	public class TerribleScriptsBase : BaseUnityPlugin
	{
		public const string Id = "TerribleScripts";

		public static string Name => "TerribleScripts";

		public static string Version => "0.1.7+ee9ad842ab8a4fca335361666e3ccca6d2d3bbd8";

		private void Awake()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Expected O, but got Unknown
			ConfigFile val = new ConfigFile(Path.Combine(Paths.ConfigPath, "TerribleScripts.cfg"), true);
		}
	}
	[CreateAssetMenu(menuName = "Misc/CalculateBDCC", fileName = "NewBDCCurve")]
	public class ScaleBDCC : ScriptableObject
	{
		public AnimationCurve curve;

		public AnimationCurve scaledCurve;

		public float Width = 1f;

		public float Height = 0.1f;

		[ContextMenu("Scale Curve")]
		public void ScaleCurve()
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			for (int i = 0; i < curve.keys.Length; i++)
			{
				Keyframe val = curve.keys[i];
				((Keyframe)(ref val)).value = ((Keyframe)(ref curve.keys[i])).value * Height;
				((Keyframe)(ref val)).time = ((Keyframe)(ref curve.keys[i])).time * Width;
				((Keyframe)(ref val)).inTangent = ((Keyframe)(ref curve.keys[i])).inTangent * Height / Width;
				((Keyframe)(ref val)).outTangent = ((Keyframe)(ref curve.keys[i])).outTangent * Height / Width;
				scaledCurve.AddKey(val);
			}
		}
	}
}
namespace nootarc.HCBBoltStuff
{
	public class HCBBoltify : MonoBehaviour
	{
		public FVRFireArm FireArm;

		public FVRFireArmChamber Chamber;

		private void Hook()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Expected O, but got Unknown
			GM.CurrentSceneSettings.ShotFiredEvent += new ShotFired(OnShotFired);
		}

		private void OnShotFired(FVRFireArm firearm)
		{
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)firearm == (Object)(object)FireArm && (Object)(object)((Component)Chamber.GetRound()).GetComponent<RoundHCBBoltType>() != (Object)null)
			{
				FVRFireArmRound round = Chamber.GetRound();
				RoundHCBBoltType component = ((Component)round).GetComponent<RoundHCBBoltType>();
				GameObject roundHCBBolt = component.RoundHCBBolt;
				GameObject val = Object.Instantiate<GameObject>(roundHCBBolt, firearm.CurrentMuzzle.position, firearm.CurrentMuzzle.rotation);
				HCBBolt component2 = val.GetComponent<HCBBolt>();
				component2.SetCookedAmount(1f);
				component2.Fire(firearm.MuzzlePos.forward, firearm.MuzzlePos.position, 1f);
			}
		}

		public void Awake()
		{
			Hook();
		}
	}
	public class RoundHCBBoltType : MonoBehaviour
	{
		public GameObject RoundHCBBolt;
	}
}