Decompiled source of FOV Changer v3.2.0

FOV_Changer.dll

Decompiled 2 weeks ago
using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using FOV_Changer;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using PluginConfig.API;
using PluginConfig.API.Decorators;
using PluginConfig.API.Fields;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("FOV_Changer")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("3.2.0.0")]
[assembly: AssemblyInformationalVersion("3.2.0")]
[assembly: AssemblyProduct("FOV Changer")]
[assembly: AssemblyTitle("FOV_Changer")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("3.2.0.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;
		}
	}
}
public class util
{
	public static Texture2D LoadEmbeddedTexture(string resourceName)
	{
		//IL_0055: Unknown result type (might be due to invalid IL or missing references)
		//IL_005b: Expected O, but got Unknown
		Assembly executingAssembly = Assembly.GetExecutingAssembly();
		using Stream stream = executingAssembly.GetManifestResourceStream(resourceName);
		if (stream == null)
		{
			Plugin.Logger.LogError((object)("Embedded resource '" + resourceName + "' not found"));
			return null;
		}
		byte[] array = new byte[stream.Length];
		stream.Read(array, 0, array.Length);
		Texture2D val = new Texture2D(2, 2);
		if (ImageConversion.LoadImage(val, array))
		{
			return val;
		}
		Plugin.Logger.LogError((object)"Failed to load embedded texture");
		return null;
	}
}
namespace FOV_ChangerPatches
{
	public class func
	{
		public static float GetDirectionValue(Vector3 velocity, Transform playerTransform)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: 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_0021: Unknown result type (might be due to invalid IL or missing references)
			Vector3 val = default(Vector3);
			((Vector3)(ref val))..ctor(velocity.x, 0f, velocity.z);
			float num = Vector3.Dot(((Vector3)(ref val)).normalized, playerTransform.forward);
			return Mathf.Clamp(num, -1f, 1f);
		}
	}
	[HarmonyPatch(typeof(CameraController), "Update")]
	public class CameraControllerPatch
	{
		public static void Prefix(ref CameraController __instance)
		{
			if (Plugin.fovEnabled.value && Plugin.modEnabled.value)
			{
				if (!Plugin.ogFovSet)
				{
					Plugin.ogFov = __instance.defaultFov;
					Plugin.ogFovSet = true;
				}
				__instance.defaultFov = Plugin.fov.value;
			}
			else if (Plugin.ogFovSet)
			{
				__instance.defaultFov = Plugin.ogFov;
				Plugin.ogFovSet = false;
			}
		}

		public static void Postfix(ref CameraController __instance, ref Camera ___hudCamera)
		{
			//IL_04e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0590: Unknown result type (might be due to invalid IL or missing references)
			//IL_053b: Unknown result type (might be due to invalid IL or missing references)
			//IL_05bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_0218: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0268: Unknown result type (might be due to invalid IL or missing references)
			//IL_0311: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0445: Unknown result type (might be due to invalid IL or missing references)
			//IL_044a: Unknown result type (might be due to invalid IL or missing references)
			//IL_044c: Unknown result type (might be due to invalid IL or missing references)
			if (Plugin.modEnabled.value)
			{
				float num = 0f;
				if (__instance.pm.sliding)
				{
					if (__instance.dodgeDirection == 0)
					{
						num = (Plugin.forwardSlidingMultiplierEnabled.value ? (__instance.defaultFov / 20f * Plugin.forwardSlidingMultiplier.value) : (__instance.defaultFov / 20f));
						__instance.cam.fieldOfView = __instance.defaultFov - num;
					}
					else if (__instance.dodgeDirection == 1)
					{
						num = (Plugin.backwardSlidingMultiplierEnabled.value ? (__instance.defaultFov / 10f * Plugin.backwardSlidingMultiplier.value) : (__instance.defaultFov / 10f));
						__instance.cam.fieldOfView = __instance.defaultFov + num;
					}
				}
				else if (__instance.pm.boost && !__instance.pm.sliding)
				{
					if (__instance.dodgeDirection == 0)
					{
						num = (Plugin.forwardDashingMultiplierEnabled.value ? (__instance.defaultFov / 20f * Plugin.forwardDashingMultiplier.value) : (__instance.defaultFov / 20f));
						__instance.cam.fieldOfView = __instance.defaultFov - num;
					}
					else if (__instance.dodgeDirection == 1)
					{
						num = (Plugin.backwardDashingMultiplierEnabled.value ? (__instance.defaultFov / 10f * Plugin.backwardDashingMultiplier.value) : (__instance.defaultFov / 10f));
						__instance.cam.fieldOfView = __instance.defaultFov + num;
					}
				}
				Transform val = ((Component)__instance.cam).transform.Find("Guns");
				if ((Object)(object)val != (Object)null)
				{
					val.localScale = new Vector3(Plugin.gunScaleX.value, Plugin.gunScaleY.value, Plugin.gunScaleZ.value);
				}
				Transform val2 = ((Component)__instance.cam).transform.Find("Punch");
				if ((Object)(object)val2 != (Object)null)
				{
					val2.localScale = new Vector3(Plugin.armScaleX.value, Plugin.armScaleY.value, Plugin.armScaleZ.value);
				}
				__instance.cam.farClipPlane = Plugin.farCutoffDistance.value;
				__instance.cam.nearClipPlane = Plugin.nearCutoffDistance.value;
				__instance.cam.rect = new Rect(0f, 0f, 1f / Plugin.sidewaysStretchMultiplier.value, 1f / Plugin.forwardStretchMultiplier.value);
				if (Object.op_Implicit((Object)(object)___hudCamera))
				{
					((Component)___hudCamera).transform.localScale = new Vector3(Plugin.hudScaleX.value, Plugin.hudScaleY.value, Plugin.hudScaleZ.value);
				}
				if (__instance.pm.gc.heavyFall || (Plugin.ignoreVelocityIfSliding.value && __instance.pm.sliding) || (Plugin.ignoreVelocityIfDashing.value && __instance.pm.boost && !__instance.pm.sliding))
				{
					return;
				}
				if (__instance.dodgeDirection == 0)
				{
					num = 0f - num;
				}
				if (Plugin.forwardVelocityMultiplierEnabled.value)
				{
					Vector3 playerVelocity = MonoSingleton<PlayerTracker>.Instance.GetPlayerVelocity(Plugin.trueVelocity.value);
					float directionValue = func.GetDirectionValue(playerVelocity, ((Component)__instance).transform);
					if (directionValue > 0f)
					{
						__instance.cam.fieldOfView = __instance.defaultFov - directionValue * ((Vector3)(ref playerVelocity)).magnitude * Plugin.forwardVelocityMultiplier.value + num;
					}
				}
				if (Plugin.backwardVelocityMultiplierEnabled.value)
				{
					Vector3 playerVelocity2 = MonoSingleton<PlayerTracker>.Instance.GetPlayerVelocity(Plugin.trueVelocity.value);
					float directionValue2 = func.GetDirectionValue(playerVelocity2, ((Component)__instance).transform);
					if (directionValue2 < 0f)
					{
						__instance.cam.fieldOfView = __instance.defaultFov - directionValue2 * ((Vector3)(ref playerVelocity2)).magnitude * Plugin.backwardVelocityMultiplier.value + num;
					}
				}
			}
			else
			{
				Transform val3 = ((Component)__instance.cam).transform.Find("Guns");
				if ((Object)(object)val3 != (Object)null)
				{
					val3.localScale = new Vector3(Plugin.gunScaleX.defaultValue, Plugin.gunScaleY.defaultValue, Plugin.gunScaleZ.defaultValue);
				}
				Transform val4 = ((Component)__instance.cam).transform.Find("Punch");
				if ((Object)(object)val4 != (Object)null)
				{
					val4.localScale = new Vector3(Plugin.armScaleX.defaultValue, Plugin.armScaleY.defaultValue, Plugin.armScaleZ.defaultValue);
				}
				__instance.cam.farClipPlane = Plugin.farCutoffDistance.defaultValue;
				__instance.cam.nearClipPlane = Plugin.nearCutoffDistance.defaultValue;
				__instance.cam.rect = new Rect(0f, 0f, 1f, 1f);
				if (Object.op_Implicit((Object)(object)___hudCamera))
				{
					((Component)___hudCamera).transform.localScale = new Vector3(1f, 1f, 1f);
				}
			}
		}
	}
	[HarmonyPatch(typeof(Revolver), "Shoot")]
	public class RevolverPatch
	{
		public static bool Prefix(int shotType, ref Revolver __instance, ref CameraController ___cc, ref Camera ___cam, ref bool ___shootReady, ref float ___shootCharge, ref CameraFrustumTargeter ___targeter, ref Animator ___anim, ref int ___currentGunShot, ref AudioSource ___gunAud, ref bool ___pierceReady, ref AudioSource ___screenAud, ref WeaponIdentifier ___wid, ref WeaponCharges ___wc, ref bool ___gunReady)
		{
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_010c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0111: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_0244: Unknown result type (might be due to invalid IL or missing references)
			//IL_0249: Unknown result type (might be due to invalid IL or missing references)
			//IL_0205: Unknown result type (might be due to invalid IL or missing references)
			//IL_020a: Unknown result type (might be due to invalid IL or missing references)
			//IL_020e: Unknown result type (might be due to invalid IL or missing references)
			//IL_029d: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_03de: Unknown result type (might be due to invalid IL or missing references)
			if (Plugin.changeFovOnHitstop.value)
			{
				return true;
			}
			___cc.StopShake();
			___shootReady = false;
			___shootCharge = 0f;
			if (__instance.altVersion)
			{
				MonoSingleton<WeaponCharges>.Instance.revaltpickupcharges[__instance.gunVariation] = 2f;
			}
			Bounds bounds;
			AnimatorStateInfo currentAnimatorStateInfo;
			switch (shotType)
			{
			case 1:
			{
				GameObject val2 = Object.Instantiate<GameObject>(__instance.revolverBeam, ((Component)___cc).transform.position, ((Component)___cc).transform.rotation);
				if (Object.op_Implicit((Object)(object)___targeter.CurrentTarget) && ___targeter.IsAutoAimed)
				{
					Transform transform2 = val2.transform;
					bounds = ___targeter.CurrentTarget.bounds;
					transform2.LookAt(((Bounds)(ref bounds)).center);
				}
				RevolverBeam component2 = val2.GetComponent<RevolverBeam>();
				component2.sourceWeapon = __instance.gc.currentWeapon;
				component2.alternateStartPoint = __instance.gunBarrel.transform.position;
				component2.gunVariation = __instance.gunVariation;
				currentAnimatorStateInfo = ___anim.GetCurrentAnimatorStateInfo(0);
				if (((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("PickUp"))
				{
					component2.quickDraw = true;
				}
				___currentGunShot = Random.Range(0, __instance.gunShots.Length);
				___gunAud.clip = __instance.gunShots[___currentGunShot];
				___gunAud.volume = 0.55f;
				___gunAud.pitch = Random.Range(0.9f, 1.1f);
				___gunAud.Play();
				MonoSingleton<RumbleManager>.Instance.SetVibrationTracked(RumbleProperties.GunFire, ((Component)__instance).gameObject);
				break;
			}
			case 2:
			{
				GameObject val = Object.Instantiate<GameObject>(__instance.revolverBeamSuper, ((Component)___cc).transform.position, ((Component)___cc).transform.rotation);
				if (Object.op_Implicit((Object)(object)___targeter.CurrentTarget) && ___targeter.IsAutoAimed)
				{
					Transform transform = val.transform;
					bounds = ___targeter.CurrentTarget.bounds;
					transform.LookAt(((Bounds)(ref bounds)).center);
				}
				RevolverBeam component = val.GetComponent<RevolverBeam>();
				component.sourceWeapon = __instance.gc.currentWeapon;
				component.alternateStartPoint = __instance.gunBarrel.transform.position;
				component.gunVariation = __instance.gunVariation;
				if (__instance.gunVariation == 2)
				{
					component.ricochetAmount = Mathf.Min(3, Mathf.FloorToInt(__instance.pierceShotCharge / 25f));
				}
				__instance.pierceShotCharge = 0f;
				currentAnimatorStateInfo = ___anim.GetCurrentAnimatorStateInfo(0);
				if (((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("PickUp"))
				{
					component.quickDraw = true;
				}
				___pierceReady = false;
				__instance.pierceCharge = 0f;
				if (__instance.gunVariation == 0)
				{
					___screenAud.clip = __instance.chargingSound;
					___screenAud.loop = true;
					if (__instance.altVersion)
					{
						___screenAud.pitch = 0.5f;
					}
					else
					{
						___screenAud.pitch = 1f;
					}
					___screenAud.volume = 0.55f;
					___screenAud.Play();
				}
				else if (!Object.op_Implicit((Object)(object)___wid) || ___wid.delay == 0f)
				{
					WeaponCharges obj = ___wc;
					obj.rev2charge -= (float)(__instance.altVersion ? 300 : 100);
				}
				if (Object.op_Implicit((Object)(object)__instance.superGunSound))
				{
					Object.Instantiate<AudioSource>(__instance.superGunSound);
				}
				if (__instance.gunVariation == 2 && Object.op_Implicit((Object)(object)__instance.twirlShotSound))
				{
					Object.Instantiate<GameObject>(__instance.twirlShotSound, ((Component)__instance).transform.position, Quaternion.identity);
				}
				MonoSingleton<RumbleManager>.Instance.SetVibrationTracked(RumbleProperties.GunFireStrong, ((Component)__instance).gameObject);
				break;
			}
			}
			if (!__instance.altVersion)
			{
				__instance.cylinder.DoTurn();
			}
			___anim.SetFloat("RandomChance", Random.Range(0f, 1f));
			if (shotType == 1)
			{
				___anim.SetTrigger("Shoot");
			}
			else
			{
				___anim.SetTrigger("ChargeShoot");
			}
			___gunReady = false;
			return false;
		}
	}
	[HarmonyPatch(typeof(SecondaryRevolver), "Shoot")]
	public class SecondaryRevolverPatch
	{
		public static bool Prefix(ref SecondaryRevolver __instance, ref Camera ___cam, ref GameObject ___camObj, ref int ___bulletForce, ref CameraFrustumTargeter ___targeter, ref GameObject ___gunBarrel, ref bool ___shootReady, ref float ___shootCharge, ref int ___currentGunShot, ref AudioSource ___gunAud)
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0133: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Unknown result type (might be due to invalid IL or missing references)
			//IL_0150: Unknown result type (might be due to invalid IL or missing references)
			//IL_0155: Unknown result type (might be due to invalid IL or missing references)
			//IL_0159: Unknown result type (might be due to invalid IL or missing references)
			if (Plugin.changeFovOnHitstop.value)
			{
				return true;
			}
			___bulletForce = 5000;
			Vector3 val = ___camObj.transform.forward;
			Bounds bounds;
			if (Object.op_Implicit((Object)(object)___targeter.CurrentTarget) && ___targeter.IsAutoAimed)
			{
				bounds = ___targeter.CurrentTarget.bounds;
				val = ((Bounds)(ref bounds)).center - ___camObj.transform.position;
			}
			Physics.Raycast(___camObj.transform.position, val, ref __instance.hit, float.PositiveInfinity, LayerMask.op_Implicit(LayerMaskDefaults.Get((LMD)3)));
			__instance.shotHitPoint = ((RaycastHit)(ref __instance.hit)).point;
			GameObject val2 = Object.Instantiate<GameObject>(__instance.secBeamPoint, ___gunBarrel.transform.position, ___gunBarrel.transform.rotation);
			GameObject val3 = Object.Instantiate<GameObject>(__instance.secHitParticle, ((RaycastHit)(ref __instance.hit)).point, ((Component)__instance).transform.rotation);
			if (Object.op_Implicit((Object)(object)___targeter.CurrentTarget) && ___targeter.IsAutoAimed)
			{
				Transform transform = val2.transform;
				bounds = ___targeter.CurrentTarget.bounds;
				transform.LookAt(((Bounds)(ref bounds)).center);
				Transform transform2 = val3.transform;
				bounds = ___targeter.CurrentTarget.bounds;
				transform2.LookAt(((Bounds)(ref bounds)).center);
			}
			___shootReady = false;
			___shootCharge = 0f;
			___currentGunShot = Random.Range(0, __instance.rev.gunShots.Length);
			___gunAud.clip = __instance.rev.gunShots[___currentGunShot];
			___gunAud.volume = 0.5f;
			___gunAud.pitch = Random.Range(0.95f, 1.05f);
			___gunAud.Play();
			return false;
		}
	}
}
namespace FOV_Changer
{
	[BepInPlugin("billy.fov_changer", "FOV Changer", "3.2.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BaseUnityPlugin
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static FloatValueChangeEventDelegate <>9__39_8;

			public static FloatValueChangeEventDelegate <>9__39_9;

			public static FloatValueChangeEventDelegate <>9__39_10;

			public static FloatValueChangeEventDelegate <>9__39_11;

			internal void <Awake>b__39_8(FloatValueChangeEvent e)
			{
				if (e.value <= 0f)
				{
					forwardStretchMultiplier.value = 1f;
					e.value = 1f;
				}
			}

			internal void <Awake>b__39_9(FloatValueChangeEvent e)
			{
				if (e.value <= 0f)
				{
					sidewaysStretchMultiplier.value = 1f;
					e.value = 1f;
				}
			}

			internal void <Awake>b__39_10(FloatValueChangeEvent e)
			{
				if (e.value <= 0.1f)
				{
					farCutoffDistance.value = 0.11f;
					e.value = 0.11f;
				}
			}

			internal void <Awake>b__39_11(FloatValueChangeEvent e)
			{
				if (e.value <= 0f)
				{
					nearCutoffDistance.value = 0.01f;
					e.value = 0.01f;
				}
			}
		}

		private static readonly Harmony Harmony = new Harmony("billy.fov_changer");

		internal static ManualLogSource Logger;

		private static PluginConfigurator config;

		public static Texture2D fovSquareTexture = util.LoadEmbeddedTexture("FOV_Changer.assets.fov_square.png");

		public static Sprite fovSquareSprite = Sprite.Create(fovSquareTexture, new Rect(0f, 0f, (float)((Texture)fovSquareTexture).width, (float)((Texture)fovSquareTexture).height), new Vector2(0.5f, 0.5f), 100f);

		public static BoolField modEnabled;

		public static BoolField fovEnabled;

		public static IntField fov;

		public static bool ogFovSet;

		public static float ogFov;

		public static BoolField changeFovOnHitstop;

		public static BoolField forwardSlidingMultiplierEnabled;

		public static FloatField forwardSlidingMultiplier;

		public static BoolField backwardSlidingMultiplierEnabled;

		public static FloatField backwardSlidingMultiplier;

		public static BoolField forwardDashingMultiplierEnabled;

		public static FloatField forwardDashingMultiplier;

		public static BoolField backwardDashingMultiplierEnabled;

		public static FloatField backwardDashingMultiplier;

		public static BoolField ignoreVelocityIfSliding;

		public static BoolField ignoreVelocityIfDashing;

		public static BoolField trueVelocity;

		public static BoolField forwardVelocityMultiplierEnabled;

		public static FloatField forwardVelocityMultiplier;

		public static BoolField backwardVelocityMultiplierEnabled;

		public static FloatField backwardVelocityMultiplier;

		public static FloatField hudScaleX;

		public static FloatField hudScaleY;

		public static FloatField hudScaleZ;

		public static FloatField gunScaleX;

		public static FloatField gunScaleY;

		public static FloatField gunScaleZ;

		public static FloatField armScaleX;

		public static FloatField armScaleY;

		public static FloatField armScaleZ;

		public static FloatField forwardStretchMultiplier;

		public static FloatField sidewaysStretchMultiplier;

		public static FloatField farCutoffDistance;

		public static FloatField nearCutoffDistance;

		private void Awake()
		{
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Expected O, but got Unknown
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Expected O, but got Unknown
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Expected O, but got Unknown
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Expected O, but got Unknown
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Expected O, but got Unknown
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Expected O, but got Unknown
			//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0108: Expected O, but got Unknown
			//IL_0132: Unknown result type (might be due to invalid IL or missing references)
			//IL_0138: Expected O, but got Unknown
			//IL_013e: Unknown result type (might be due to invalid IL or missing references)
			//IL_014c: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0168: Expected O, but got Unknown
			//IL_0170: Unknown result type (might be due to invalid IL or missing references)
			//IL_017e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0190: Unknown result type (might be due to invalid IL or missing references)
			//IL_019a: Expected O, but got Unknown
			//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ab: Expected O, but got Unknown
			//IL_01b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c1: Expected O, but got Unknown
			//IL_01d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e1: Expected O, but got Unknown
			//IL_01ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f7: Expected O, but got Unknown
			//IL_01fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0208: Expected O, but got Unknown
			//IL_0214: Unknown result type (might be due to invalid IL or missing references)
			//IL_021e: Expected O, but got Unknown
			//IL_0234: Unknown result type (might be due to invalid IL or missing references)
			//IL_023e: Expected O, but got Unknown
			//IL_0246: Unknown result type (might be due to invalid IL or missing references)
			//IL_0258: Unknown result type (might be due to invalid IL or missing references)
			//IL_0262: Expected O, but got Unknown
			//IL_0269: Unknown result type (might be due to invalid IL or missing references)
			//IL_0273: Expected O, but got Unknown
			//IL_027f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0289: Expected O, but got Unknown
			//IL_029f: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a9: Expected O, but got Unknown
			//IL_02b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bf: Expected O, but got Unknown
			//IL_02c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d0: Expected O, but got Unknown
			//IL_02dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e6: Expected O, but got Unknown
			//IL_02fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0306: Expected O, but got Unknown
			//IL_030c: Unknown result type (might be due to invalid IL or missing references)
			//IL_031a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0328: Unknown result type (might be due to invalid IL or missing references)
			//IL_0335: Unknown result type (might be due to invalid IL or missing references)
			//IL_033f: Expected O, but got Unknown
			//IL_0350: Unknown result type (might be due to invalid IL or missing references)
			//IL_035a: Expected O, but got Unknown
			//IL_036b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0375: Expected O, but got Unknown
			//IL_0382: Unknown result type (might be due to invalid IL or missing references)
			//IL_0399: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a3: Expected O, but got Unknown
			//IL_03b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_03cc: Expected O, but got Unknown
			//IL_03d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_03dd: Expected O, but got Unknown
			//IL_03e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f3: Expected O, but got Unknown
			//IL_0409: Unknown result type (might be due to invalid IL or missing references)
			//IL_0413: Expected O, but got Unknown
			//IL_0441: Unknown result type (might be due to invalid IL or missing references)
			//IL_044b: Expected O, but got Unknown
			//IL_0452: Unknown result type (might be due to invalid IL or missing references)
			//IL_045c: Expected O, but got Unknown
			//IL_0468: Unknown result type (might be due to invalid IL or missing references)
			//IL_0472: Expected O, but got Unknown
			//IL_0488: Unknown result type (might be due to invalid IL or missing references)
			//IL_0492: Expected O, but got Unknown
			//IL_04f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_04fb: Expected O, but got Unknown
			//IL_0501: Unknown result type (might be due to invalid IL or missing references)
			//IL_050f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0525: Unknown result type (might be due to invalid IL or missing references)
			//IL_052f: Expected O, but got Unknown
			//IL_053f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0549: Expected O, but got Unknown
			//IL_0559: Unknown result type (might be due to invalid IL or missing references)
			//IL_0563: Expected O, but got Unknown
			//IL_0573: Unknown result type (might be due to invalid IL or missing references)
			//IL_0579: Expected O, but got Unknown
			//IL_057f: Unknown result type (might be due to invalid IL or missing references)
			//IL_058d: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ad: Expected O, but got Unknown
			//IL_05bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c7: Expected O, but got Unknown
			//IL_05d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_05e1: Expected O, but got Unknown
			//IL_05f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_05f8: Expected O, but got Unknown
			//IL_05ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_060e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0625: Unknown result type (might be due to invalid IL or missing references)
			//IL_062f: Expected O, but got Unknown
			//IL_0640: Unknown result type (might be due to invalid IL or missing references)
			//IL_064a: Expected O, but got Unknown
			//IL_065b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0665: Expected O, but got Unknown
			//IL_0675: Unknown result type (might be due to invalid IL or missing references)
			//IL_067c: Expected O, but got Unknown
			//IL_0683: Unknown result type (might be due to invalid IL or missing references)
			//IL_069a: Unknown result type (might be due to invalid IL or missing references)
			//IL_06a4: Expected O, but got Unknown
			//IL_06df: Unknown result type (might be due to invalid IL or missing references)
			//IL_06e9: Expected O, but got Unknown
			//IL_06bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_06c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_06c8: Expected O, but got Unknown
			//IL_0724: Unknown result type (might be due to invalid IL or missing references)
			//IL_072e: Expected O, but got Unknown
			//IL_0702: Unknown result type (might be due to invalid IL or missing references)
			//IL_0707: Unknown result type (might be due to invalid IL or missing references)
			//IL_070d: Expected O, but got Unknown
			//IL_0769: Unknown result type (might be due to invalid IL or missing references)
			//IL_0773: Expected O, but got Unknown
			//IL_0747: Unknown result type (might be due to invalid IL or missing references)
			//IL_074c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0752: Expected O, but got Unknown
			//IL_078c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0791: Unknown result type (might be due to invalid IL or missing references)
			//IL_0797: Expected O, but got Unknown
			Logger = ((BaseUnityPlugin)this).Logger;
			Logger.LogInfo((object)"Plugin FOV_Changer is loaded!");
			Harmony.PatchAll();
			config = PluginConfigurator.Create("FOV Changer", "billy.fov_changer");
			config.image = fovSquareSprite;
			modEnabled = new BoolField(config.rootPanel, "Enable the whole mod", "modEnabled", true);
			ConfigDivision allDiv = new ConfigDivision(config.rootPanel, "allDiv");
			modEnabled.onValueChange += (BoolValueChangeEventDelegate)delegate(BoolValueChangeEvent e)
			{
				((ConfigField)allDiv).interactable = e.value;
			};
			fovEnabled = new BoolField((ConfigPanel)(object)allDiv, "Enable FOV override", "fovEnabled", true);
			ConfigDivision fovDiv = new ConfigDivision((ConfigPanel)(object)allDiv, "fovDiv");
			fovEnabled.onValueChange += (BoolValueChangeEventDelegate)delegate(BoolValueChangeEvent e)
			{
				((ConfigField)fovDiv).interactable = e.value;
			};
			fov = new IntField((ConfigPanel)(object)fovDiv, "FOV value", "fov", 170);
			fov.maximumValue = 180;
			fov.minimumValue = 0;
			ConfigPanel val = new ConfigPanel((ConfigPanel)(object)allDiv, "More FOV options", "fovPanel");
			new ConfigSpace(val, 10f);
			new ConfigHeader(val, "Change FOV when hitting something like a core with a revolver shot", 16);
			changeFovOnHitstop = new BoolField(val, "Revolver shot FOV change", "changeFovOnHitstop", true);
			new ConfigHeader(val, "The values below determine how much the FOV changes when you're sliding or dashing\r\n0 - FOV doesn't change\r\n0.5 - FOV change is half as strong\r\n1 - vanilla FOV change\r\n2 - FOV change is doubled\r\n-1 - FOV change direction is reversed", 16);
			new ConfigHeader(val, "Sliding", 28);
			forwardSlidingMultiplierEnabled = new BoolField(val, "Enable forward sliding multiplier", "forwardSlidingMultiplierEnabled", true);
			ConfigDivision forwardSlidingDiv = new ConfigDivision(val, "forwardSlidingDiv");
			forwardSlidingMultiplierEnabled.onValueChange += (BoolValueChangeEventDelegate)delegate(BoolValueChangeEvent e)
			{
				((ConfigField)forwardSlidingDiv).interactable = e.value;
			};
			forwardSlidingMultiplier = new FloatField((ConfigPanel)(object)forwardSlidingDiv, "Forward sliding FOV multiplier", "forwardSlidingMultiplier", 0f);
			backwardSlidingMultiplierEnabled = new BoolField(val, "Enable backward sliding multiplier", "backwardSlidingMultiplierEnabled", true);
			ConfigDivision backwardSlidingDiv = new ConfigDivision(val, "backwardSlidingDiv");
			backwardSlidingMultiplierEnabled.onValueChange += (BoolValueChangeEventDelegate)delegate(BoolValueChangeEvent e)
			{
				((ConfigField)backwardSlidingDiv).interactable = e.value;
			};
			backwardSlidingMultiplier = new FloatField((ConfigPanel)(object)backwardSlidingDiv, "Backward sliding FOV multiplier", "backwardSlidingMultiplier", 0f);
			new ConfigHeader(val, "Dashing", 28);
			forwardDashingMultiplierEnabled = new BoolField(val, "Enable forward dashing multiplier", "forwardDashingMultiplierEnabled", true);
			ConfigDivision forwardDashingDiv = new ConfigDivision(val, "forwardDashingDiv");
			forwardDashingMultiplierEnabled.onValueChange += (BoolValueChangeEventDelegate)delegate(BoolValueChangeEvent e)
			{
				((ConfigField)forwardDashingDiv).interactable = e.value;
			};
			forwardDashingMultiplier = new FloatField((ConfigPanel)(object)forwardDashingDiv, "Forward dashing FOV multiplier", "forwardDashingMultiplier", 0.35f);
			backwardDashingMultiplierEnabled = new BoolField(val, "Enable backward dashing multiplier", "backwardDashingMultiplierEnabled", true);
			ConfigDivision backwardDashingDiv = new ConfigDivision(val, "backwardDashingDiv");
			backwardDashingMultiplierEnabled.onValueChange += (BoolValueChangeEventDelegate)delegate(BoolValueChangeEvent e)
			{
				((ConfigField)backwardDashingDiv).interactable = e.value;
			};
			backwardDashingMultiplier = new FloatField((ConfigPanel)(object)backwardDashingDiv, "Backward dashing FOV multiplier", "backwardDashingMultiplier", 0.25f);
			new ConfigSpace(val, 10f);
			new ConfigHeader(val, "Velocity-based", 28);
			new ConfigHeader(val, "The following settings determine how much the FOV changes based on your velocity\r\n0 - FOV doesn't change\r\n0.25 - FOV change is noticeable but not that strong\r\n1 - FOV change is the same as your velocity (which is way too much)", 16);
			ConfigDivision velocityIgnoreDiv = new ConfigDivision(val, "velocityIgnoreDiv");
			ignoreVelocityIfSliding = new BoolField((ConfigPanel)(object)velocityIgnoreDiv, "Prevent sliding velocity FOV change", "ignoreVelocityIfSliding", false);
			ignoreVelocityIfDashing = new BoolField((ConfigPanel)(object)velocityIgnoreDiv, "Prevent dashing velocity FOV change", "ignoreVelocityIfDashing", true);
			new ConfigHeader((ConfigPanel)(object)velocityIgnoreDiv, "When the options above are turned on, you'll always have the same FOV when sliding or dashing and it won't depend on how fast you're going", 14);
			trueVelocity = new BoolField((ConfigPanel)(object)velocityIgnoreDiv, "Enable true velocity", "trueVelocity", false);
			new ConfigHeader((ConfigPanel)(object)velocityIgnoreDiv, "When true velocity is disabled, dashing will affect the FOV 3 times less. This is the same reason why dashing with an Impact Hammer only counts as a green gauge", 14);
			forwardVelocityMultiplierEnabled = new BoolField(val, "Enable forward velocity multiplier", "forwardVelocityMultiplierEnabled", false);
			ConfigDivision forwardVelocityDiv = new ConfigDivision(val, "forwardVelocityDiv");
			forwardVelocityMultiplierEnabled.onValueChange += (BoolValueChangeEventDelegate)delegate(BoolValueChangeEvent e)
			{
				((ConfigField)forwardVelocityDiv).interactable = e.value;
				if (!e.value && !backwardVelocityMultiplierEnabled.value)
				{
					((ConfigField)velocityIgnoreDiv).interactable = false;
				}
				else
				{
					((ConfigField)velocityIgnoreDiv).interactable = true;
				}
			};
			forwardVelocityMultiplier = new FloatField((ConfigPanel)(object)forwardVelocityDiv, "Forward velocity FOV multiplier", "forwardVelocityMultiplier", 0.25f);
			if (!forwardVelocityMultiplierEnabled.value)
			{
				((ConfigField)forwardVelocityDiv).interactable = false;
			}
			backwardVelocityMultiplierEnabled = new BoolField(val, "Enable backward velocity multiplier", "backwardVelocityMultiplierEnabled", false);
			ConfigDivision backwardVelocityDiv = new ConfigDivision(val, "backwardVelocityDiv");
			backwardVelocityMultiplierEnabled.onValueChange += (BoolValueChangeEventDelegate)delegate(BoolValueChangeEvent e)
			{
				((ConfigField)backwardVelocityDiv).interactable = e.value;
				if (!e.value && !forwardVelocityMultiplierEnabled.value)
				{
					((ConfigField)velocityIgnoreDiv).interactable = false;
				}
				else
				{
					((ConfigField)velocityIgnoreDiv).interactable = true;
				}
			};
			backwardVelocityMultiplier = new FloatField((ConfigPanel)(object)backwardVelocityDiv, "Backward velocity FOV multiplier", "backwardVelocityMultiplier", 0.25f);
			if (!backwardVelocityMultiplierEnabled.value)
			{
				((ConfigField)backwardVelocityDiv).interactable = false;
			}
			if (!backwardVelocityMultiplierEnabled.value && !forwardVelocityMultiplierEnabled.value)
			{
				((ConfigField)velocityIgnoreDiv).interactable = false;
			}
			ConfigPanel val2 = new ConfigPanel((ConfigPanel)(object)allDiv, "HUD options", "hudPanel");
			new ConfigSpace(val2, 10f);
			new ConfigHeader(val2, "X - horizontal strech\r\nY - vertical stretch\r\nZ - distance from the camera\r\nIf you want to change both X and Y to the same value, it's better to change Z to the inverse of that value to prevent particles from looking weird, e.g. instead of X = 0.25 and Y = 0.25 it's better to do Z = 4", 16);
			hudScaleX = new FloatField(val2, "HUD scale X", "hudScaleX", 1f);
			hudScaleY = new FloatField(val2, "HUD scale Y", "hudScaleY", 1f);
			hudScaleZ = new FloatField(val2, "HUD scale Z", "hudScaleZ", 1f);
			ConfigPanel val3 = new ConfigPanel((ConfigPanel)(object)allDiv, "Weapon options", "gunPanel");
			new ConfigSpace(val3, 10f);
			new ConfigHeader(val3, "X - horizontal strech\r\nY - vertical stretch\r\nZ - distance from the camera\r\nIf you want to change both X and Y to the same value, it's better to change Z to the inverse of that value to prevent particles from looking weird, e.g. instead of X = 0.25 and Y = 0.25 it's better to do Z = 4", 16);
			gunScaleX = new FloatField(val3, "Weapon scale X", "gunScaleX", 1f);
			gunScaleY = new FloatField(val3, "Weapon scale Y", "gunScaleY", 1f);
			gunScaleZ = new FloatField(val3, "Weapon scale Z", "gunScaleZ", 1f);
			ConfigPanel val4 = new ConfigPanel((ConfigPanel)(object)allDiv, "Arm options", "armPanel");
			new ConfigSpace(val4, 10f);
			new ConfigHeader(val4, "X - horizontal strech\r\nY - vertical stretch\r\nZ - distance from the camera\r\nIf you want to change both X and Y to the same value, it's better to change Z to the inverse of that value to prevent particles from looking weird, e.g. instead of X = 0.25 and Y = 0.25 it's better to do Z = 4", 16);
			armScaleX = new FloatField(val4, "Arm scale X", "armScaleX", 1f);
			armScaleY = new FloatField(val4, "Arm scale Y", "armScaleY", 1f);
			armScaleZ = new FloatField(val4, "Arm scale Z", "armScaleZ", 1f);
			ConfigPanel val5 = new ConfigPanel((ConfigPanel)(object)allDiv, "Other options", "otherPanel");
			new ConfigSpace(val5, 10f);
			forwardStretchMultiplier = new FloatField(val5, "Forward stretch multiplier", "forwardStretchMultiplier", 1f);
			FloatField obj = forwardStretchMultiplier;
			object obj2 = <>c.<>9__39_8;
			if (obj2 == null)
			{
				FloatValueChangeEventDelegate val6 = delegate(FloatValueChangeEvent e)
				{
					if (e.value <= 0f)
					{
						forwardStretchMultiplier.value = 1f;
						e.value = 1f;
					}
				};
				<>c.<>9__39_8 = val6;
				obj2 = (object)val6;
			}
			obj.onValueChange += (FloatValueChangeEventDelegate)obj2;
			sidewaysStretchMultiplier = new FloatField(val5, "Sideways stretch multiplier", "sidewaysStretchMultiplier", 1f);
			FloatField obj3 = sidewaysStretchMultiplier;
			object obj4 = <>c.<>9__39_9;
			if (obj4 == null)
			{
				FloatValueChangeEventDelegate val7 = delegate(FloatValueChangeEvent e)
				{
					if (e.value <= 0f)
					{
						sidewaysStretchMultiplier.value = 1f;
						e.value = 1f;
					}
				};
				<>c.<>9__39_9 = val7;
				obj4 = (object)val7;
			}
			obj3.onValueChange += (FloatValueChangeEventDelegate)obj4;
			farCutoffDistance = new FloatField(val5, "Far cutoff distance", "farCutoffDistance", 4000f);
			FloatField obj5 = farCutoffDistance;
			object obj6 = <>c.<>9__39_10;
			if (obj6 == null)
			{
				FloatValueChangeEventDelegate val8 = delegate(FloatValueChangeEvent e)
				{
					if (e.value <= 0.1f)
					{
						farCutoffDistance.value = 0.11f;
						e.value = 0.11f;
					}
				};
				<>c.<>9__39_10 = val8;
				obj6 = (object)val8;
			}
			obj5.onValueChange += (FloatValueChangeEventDelegate)obj6;
			nearCutoffDistance = new FloatField(val5, "Near cutoff distance", "nearCutoffDistance", 0.1f);
			FloatField obj7 = nearCutoffDistance;
			object obj8 = <>c.<>9__39_11;
			if (obj8 == null)
			{
				FloatValueChangeEventDelegate val9 = delegate(FloatValueChangeEvent e)
				{
					if (e.value <= 0f)
					{
						nearCutoffDistance.value = 0.01f;
						e.value = 0.01f;
					}
				};
				<>c.<>9__39_11 = val9;
				obj8 = (object)val9;
			}
			obj7.onValueChange += (FloatValueChangeEventDelegate)obj8;
			if (!modEnabled.value)
			{
				((ConfigField)allDiv).interactable = false;
			}
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "FOV_Changer";

		public const string PLUGIN_NAME = "FOV Changer";

		public const string PLUGIN_VERSION = "3.2.0";
	}
}