Decompiled source of PeakRevolver v1.0.0

spidersgeorg.PeakRevolver.dll

Decompiled 5 days ago
using System;
using System.Collections;
using System.Collections.Generic;
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.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using PEAKLib.Core;
using PEAKLib.Items.UnityEditor;
using PeakRevolverMod;
using PeakRevolverMod.Utils;
using Photon.Pun;
using Photon.Realtime;
using UnityEngine;
using UnityEngine.Networking;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("spidersgeorg.PeakRevolver")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("0.1.0.0")]
[assembly: AssemblyInformationalVersion("0.1.0")]
[assembly: AssemblyProduct("spidersgeorg.PeakRevolver")]
[assembly: AssemblyTitle("PeakRevolver")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.1.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.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[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;
		}
	}
}
internal class Action_PeakRevolver_Others : ItemAction
{
	public bool consumeOnFullyUsed = true;

	public float revolverMaxDistance = 500f;

	public float revolverBulletCollisonSize = 0.25f;

	private static readonly ManualLogSource Logger = Logger.CreateLogSource("Action_PeakRevolver_Others");

	public PeakRevolver revolver;

	public Animator anim;

	private RaycastHit revolverLineHit;

	private RaycastHit[] revolverSphereHits;

	public Transform revolverSpawnTransform;

	public void Start()
	{
		revolver = ((Component)this).GetComponent<PeakRevolver>();
		anim = ((Component)revolver).GetComponent<Animator>();
	}

	public override void RunAction()
	{
		//IL_0028: 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)
		//IL_0048: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
		//IL_008f: Unknown result type (might be due to invalid IL or missing references)
		//IL_009e: 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_0115: Unknown result type (might be due to invalid IL or missing references)
		//IL_011a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0243: Unknown result type (might be due to invalid IL or missing references)
		//IL_024a: Unknown result type (might be due to invalid IL or missing references)
		int viewID = ((MonoBehaviourPun)Character.localCharacter).photonView.ViewID;
		revolverSpawnTransform = ((Component)revolver).transform;
		Physics.Raycast(revolverSpawnTransform.position, ((Component)MainCamera.instance).transform.forward, ref revolverLineHit, revolverMaxDistance, LayerMask.op_Implicit(HelperFunctions.terrainMapMask), (QueryTriggerInteraction)1);
		if (!Object.op_Implicit((Object)(object)((RaycastHit)(ref revolverLineHit)).collider))
		{
			((RaycastHit)(ref revolverLineHit)).distance = revolverMaxDistance;
			((RaycastHit)(ref revolverLineHit)).point = revolverSpawnTransform.position + ((Component)MainCamera.instance).transform.forward * revolverMaxDistance;
		}
		revolverSphereHits = Physics.SphereCastAll(revolverSpawnTransform.position, revolverBulletCollisonSize, ((Component)MainCamera.instance).transform.forward, ((RaycastHit)(ref revolverLineHit)).distance, LayerMask.GetMask(new string[1] { "Character" }), (QueryTriggerInteraction)1);
		RaycastHit[] array = revolverSphereHits;
		for (int i = 0; i < array.Length; i++)
		{
			RaycastHit val = array[i];
			if (!Object.op_Implicit((Object)(object)((RaycastHit)(ref val)).collider))
			{
				continue;
			}
			Character componentInParent = ((Component)((RaycastHit)(ref val)).collider).GetComponentInParent<Character>();
			if (Object.op_Implicit((Object)(object)componentInParent) && (Object)(object)componentInParent != (Object)(object)((ItemActionBase)this).character)
			{
				Debug.Log((object)("HIT confirmed " + ((Object)componentInParent).name));
				if (revolver.shotsLeft <= 0)
				{
					Logger.LogInfo((object)"The revolver is empty");
					((MonoBehaviourPun)Character.localCharacter).photonView.RPC("PlayPeakRevolverSoundGlobal", (RpcTarget)0, new object[2] { viewID, "Au_Empty_revolversfx.ogg" });
				}
				else if (revolver.shotsLeft > 0)
				{
					Logger.LogInfo((object)"The player got hit with the YouLose effect");
					revolver.useOnce();
					((MonoBehaviourPun)Character.localCharacter).photonView.RPC("PlayPeakRevolverSoundGlobal", (RpcTarget)0, new object[2] { viewID, "Au_Revolver_revolversfx.ogg" });
					RevolverImpactOthers(componentInParent, revolverSpawnTransform.position, ((RaycastHit)(ref val)).point);
				}
				return;
			}
		}
		if (revolver.shotsLeft > 0)
		{
			revolver.useOnce();
			((MonoBehaviourPun)Character.localCharacter).photonView.RPC("PlayPeakRevolverSoundGlobal", (RpcTarget)0, new object[2] { viewID, "Au_Revolver_revolversfx.ogg" });
		}
		else
		{
			((MonoBehaviourPun)Character.localCharacter).photonView.RPC("PlayPeakRevolverSoundGlobal", (RpcTarget)0, new object[2] { viewID, "Au_Empty_revolversfx.ogg" });
		}
	}

	private void RevolverImpactOthers(Character hitCharacter, Vector3 origin, Vector3 endpoint)
	{
		//IL_005c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0065: Unknown result type (might be due to invalid IL or missing references)
		//IL_002e: 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)
		if (Object.op_Implicit((Object)(object)hitCharacter))
		{
			((MonoBehaviourPun)this).photonView.RPC("RPC_PeakRevolverImpactOthers", (RpcTarget)0, new object[3]
			{
				((MonoBehaviourPun)hitCharacter).photonView.Owner,
				origin,
				endpoint
			});
		}
		else
		{
			((MonoBehaviourPun)this).photonView.RPC("RPC_PeakRevolverImpactOthers", (RpcTarget)0, new object[3] { null, origin, endpoint });
		}
	}

	[PunRPC]
	private void RPC_PeakRevolverImpactOthers(Player hitPlayer, Vector3 origin, Vector3 endpoint)
	{
		//IL_0057: Unknown result type (might be due to invalid IL or missing references)
		//IL_0067: Unknown result type (might be due to invalid IL or missing references)
		if (hitPlayer != null && hitPlayer.IsLocal)
		{
			Character.localCharacter.refs.afflictions.AddStatus((STATUSTYPE)0, PeakRevolverConfig.revolverDamage.Value, false, true);
			((Component)Character.localCharacter).GetComponent<PeakRevolverBlowbackWatcher>().ShootSelfT(PeakRevolverConfig.revolverBlowback.Value, Character.localCharacter, ((Component)Camera.main).transform.forward);
			GamefeelHandler.instance.AddPerlinShakeProximity(endpoint, 5f, 0.2f, 15f, 10f);
		}
	}
}
public class PeakRevolver : ItemComponent
{
	private static readonly ManualLogSource Logger = Logger.CreateLogSource("PeakRevolver");

	public int shotsLeft;

	public const DataEntryKey Shots = 100;

	public PeakRevolver revolver;

	public Animator anim;

	public void Start()
	{
		((MonoBehaviour)this).StartCoroutine(InitShotsRoutine());
		revolver = ((Component)this).GetComponent<PeakRevolver>();
		anim = ((Component)revolver).GetComponent<Animator>();
	}

	private void InitShots()
	{
		if (((ItemComponent)this).HasData((DataEntryKey)100))
		{
			shotsLeft = ((ItemComponent)this).GetData<IntItemData>((DataEntryKey)100).Value;
		}
		else if (base.photonView.IsMine)
		{
			RandomizeShots();
			base.photonView.RPC("RPC_SyncPeakRevolverShots", (RpcTarget)0, new object[1] { shotsLeft });
		}
	}

	public void useOnce()
	{
		if (shotsLeft > 0)
		{
			int num = shotsLeft - 1;
			base.photonView.RPC("RPC_SyncPeakRevolverShots", (RpcTarget)0, new object[1] { num });
		}
	}

	private void RandomizeShots()
	{
		shotsLeft = PeakRevolverConfig.maxRevolverShots.Value;
		((ItemComponent)this).GetData<IntItemData>((DataEntryKey)100).Value = shotsLeft;
	}

	[PunRPC]
	public void RPC_SyncPeakRevolverShots(int shots)
	{
		shotsLeft = shots;
		((ItemComponent)this).GetData<IntItemData>((DataEntryKey)100).Value = shotsLeft;
		Logger.LogInfo((object)("Synced shots to " + shotsLeft + " AND " + ((ItemComponent)this).GetData<IntItemData>((DataEntryKey)100).Value));
	}

	public override void OnInstanceDataSet()
	{
		((MonoBehaviour)this).StartCoroutine(InitShotsRoutine());
	}

	private IEnumerator InitShotsRoutine()
	{
		while (!Object.op_Implicit((Object)(object)Character.localCharacter))
		{
			yield return null;
		}
		InitShots();
	}
}
public class PeakRevolverBonkable : MonoBehaviour
{
	private static readonly ManualLogSource Logger = Logger.CreateLogSource("PeakRevolverBonkable");

	private Item item;

	public float minBonkVelocity = 20f;

	public float ragdollTime = 1f;

	public float bonkForce = 200f;

	public float bonkRange = 0.5f;

	public float lastBonkedTime;

	private float bonkCooldown = 1f;

	private void Awake()
	{
		item = ((Component)this).GetComponent<Item>();
	}

	private void OnCollisionEnter(Collision coll)
	{
		//IL_0019: Unknown result type (might be due to invalid IL or missing references)
		//IL_0033: Unknown result type (might be due to invalid IL or missing references)
		//IL_0038: Unknown result type (might be due to invalid IL or missing references)
		if (((MonoBehaviourPun)item).photonView.IsMine && (int)item.itemState == 0 && Object.op_Implicit((Object)(object)item.rig))
		{
			Vector3 relativeVelocity = coll.relativeVelocity;
			if (((Vector3)(ref relativeVelocity)).magnitude > minBonkVelocity)
			{
				Bonk(coll);
				Logger.LogInfo((object)"BONKING FIRED OFF");
			}
		}
	}

	private void Bonk(Collision coll)
	{
		//IL_007c: Unknown result type (might be due to invalid IL or missing references)
		//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
		//IL_00af: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
		Character componentInParent = coll.gameObject.GetComponentInParent<Character>();
		Logger.LogInfo((object)"IN BONKING FUNC");
		if (Object.op_Implicit((Object)(object)componentInParent) && Time.time > lastBonkedTime + bonkCooldown)
		{
			Logger.LogInfo((object)"FIRE OFF BONK");
			componentInParent.Fall(ragdollTime, 0f);
			for (int i = 0; i < Plugin.bonk.Count; i++)
			{
				Plugin.bonk[i].Play(((Component)this).transform.position);
			}
			lastBonkedTime = Time.time;
			Vector3 relativeVelocity = coll.relativeVelocity;
			componentInParent.AddForceAtPosition(-((Vector3)(ref relativeVelocity)).normalized * bonkForce, ((ContactPoint)(ref coll.contacts[0])).point, bonkRange);
		}
	}
}
public class SFXManagerForPeakRevolver : MonoBehaviourPun
{
	private static readonly ManualLogSource Logger = Logger.CreateLogSource("SFXManagerForPeakRevolver");

	[PunRPC]
	public void PlayPeakRevolverSoundGlobal(int photonID, string soundToPlay)
	{
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		Character val = default(Character);
		if (Character.GetCharacterWithPhotonID(photonID, ref val))
		{
			SFXManagerForPeakRevolver component = ((Component)val).GetComponent<SFXManagerForPeakRevolver>();
			component.PlaySound(val.Center, soundToPlay);
		}
	}

	public void PlaySound(Vector3 pos, string sound)
	{
		//IL_005a: Unknown result type (might be due to invalid IL or missing references)
		//IL_005b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0065: 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_0079: Unknown result type (might be due to invalid IL or missing references)
		//IL_007e: Unknown result type (might be due to invalid IL or missing references)
		foreach (KeyValuePair<string, SFX_Instance> sFXInstance in Plugin.SFXInstances)
		{
			Logger.LogInfo((object)("SFX Instance: " + sFXInstance.Key));
		}
		Plugin.SFXInstances[sound].Play(pos + Vector3.up * 0.2f + Vector3.forward * 0.1f);
	}
}
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 PeakRevolverMod
{
	internal class PeakRevolverBlowbackWatcher : MonoBehaviour
	{
		private static readonly ManualLogSource Logger = Logger.CreateLogSource("PeakRevolverBlowbackWatcher");

		public float shotTime;

		private Character characterGettingShot;

		private Vector3 shotDirection;

		public void Start()
		{
			characterGettingShot = Character.localCharacter;
		}

		public void Update()
		{
			if (shotTime > 0f)
			{
				shotTime -= Time.deltaTime;
				UpdateShotPhysicsT();
			}
		}

		public void ShootSelfT(float howLongToFly, Character whoIsGettingShot, Vector3 whichDirectionShooting)
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			shotTime = howLongToFly;
			characterGettingShot = whoIsGettingShot;
			shotDirection = whichDirectionShooting;
		}

		public void UpdateShotPhysicsT()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//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_0038: Unknown result type (might be due to invalid IL or missing references)
			Vector3 val = shotDirection * 25f * -1f;
			characterGettingShot.Fall(0.5f, 0f);
			characterGettingShot.AddForce(val, 1f, 1f);
		}
	}
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("spidersgeorg.PeakRevolver", "PeakRevolver", "0.1.0")]
	public class Plugin : BaseUnityPlugin
	{
		internal static Dictionary<string, SFX_Instance> SFXInstances = new Dictionary<string, SFX_Instance>();

		internal static List<SFX_Instance> bonk = new List<SFX_Instance>();

		public const string Id = "spidersgeorg.PeakRevolver";

		internal static ManualLogSource Log { get; private set; } = null;


		public static Plugin Instance { get; private set; }

		internal static AssetBundle Bundle { get; set; }

		internal static ModDefinition Definition { get; set; }

		public static string Name => "PeakRevolver";

		public static string Version => "0.1.0";

		private void Awake()
		{
			//IL_013c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0142: Expected O, but got Unknown
			PeakRevolverConfig.AllPeakRevolverConfigs(((BaseUnityPlugin)this).Config);
			Log = ((BaseUnityPlugin)this).Logger;
			BundleLoader.LoadBundleWithName((BaseUnityPlugin)(object)this, "peakrevolver.peakbundle", (Action<PeakBundle>)delegate(PeakBundle peakBundle)
			{
				peakBundle.Mod.RegisterContent();
				UnityItemContent val2 = peakBundle.LoadAsset<UnityItemContent>("PeakRevolver");
				GameObject itemPrefab = val2.ItemPrefab;
				itemPrefab.AddComponent<PeakRevolver>();
				Action_PeakRevolver_Others action_PeakRevolver_Others = itemPrefab.AddComponent<Action_PeakRevolver_Others>();
				((ItemAction)action_PeakRevolver_Others).OnCastFinished = true;
				PeakRevolverBonkable peakRevolverBonkable = itemPrefab.AddComponent<PeakRevolverBonkable>();
			});
			LocalizedText.mainTable["NAME_GUN"] = new List<string>(15)
			{
				"Gun", "Gun", "Gun", "Gun", "Gun", "Gun", "Gun", "Gun", "Gun", "Gun",
				"Gun", "Gun", "Gun", "Gun", "Gun"
			};
			Log.LogInfo((object)("Plugin " + Name + " is loaded!"));
			Harmony val = new Harmony(Name ?? "");
			val.PatchAll();
			LoadCustomAudio();
			LoadBonkAudio();
		}

		private void LoadCustomAudio()
		{
			string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
			string[] files = Directory.GetFiles(directoryName, "*_revolversfx.ogg");
			if (files.Length == 0)
			{
				((BaseUnityPlugin)this).Logger.LogWarning((object)"No .ogg file found.");
				return;
			}
			string[] array = files;
			foreach (string fileName in array)
			{
				((MonoBehaviour)this).StartCoroutine(LoadAudio(fileName));
			}
		}

		private void LoadBonkAudio()
		{
			string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
			string[] files = Directory.GetFiles(directoryName, "*_bonksfx.ogg");
			if (files.Length == 0)
			{
				((BaseUnityPlugin)this).Logger.LogWarning((object)"No .ogg file found.");
				return;
			}
			string[] array = files;
			foreach (string fileName in array)
			{
				((MonoBehaviour)this).StartCoroutine(LoadBonkAudio(fileName));
			}
		}

		private IEnumerator LoadBonkAudio(string fileName)
		{
			string url = "file://" + fileName;
			UnityWebRequest webRequest = UnityWebRequestMultimedia.GetAudioClip(url, (AudioType)14);
			try
			{
				yield return webRequest.SendWebRequest();
				if ((int)webRequest.result != 2 && (int)webRequest.result != 3)
				{
					SFX_Instance shotSFX = ScriptableObject.CreateInstance<SFX_Instance>();
					shotSFX.clips = (AudioClip[])(object)new AudioClip[1] { DownloadHandlerAudioClip.GetContent(webRequest) };
					shotSFX.settings = new SFX_Settings
					{
						volume = 1f,
						range = 500f,
						cooldown = 1f
					};
					bonk.Add(shotSFX);
				}
			}
			finally
			{
				((IDisposable)webRequest)?.Dispose();
			}
		}

		private IEnumerator LoadAudio(string fileName)
		{
			string url = "file://" + fileName;
			UnityWebRequest webRequest = UnityWebRequestMultimedia.GetAudioClip(url, (AudioType)14);
			try
			{
				yield return webRequest.SendWebRequest();
				if ((int)webRequest.result == 2 || (int)webRequest.result == 3)
				{
					((BaseUnityPlugin)this).Logger.LogInfo((object)("Failed to load .ogg file: " + webRequest.error));
					yield break;
				}
				SFX_Instance shotSFX = ScriptableObject.CreateInstance<SFX_Instance>();
				shotSFX.clips = (AudioClip[])(object)new AudioClip[1] { DownloadHandlerAudioClip.GetContent(webRequest) };
				shotSFX.settings = new SFX_Settings
				{
					volume = 1f,
					range = 500f,
					cooldown = 1f
				};
				((BaseUnityPlugin)this).Logger.LogInfo((object)("FILE NAME IS " + GetFileNameFromPath(fileName)));
				SFXInstances[GetFileNameFromPath(fileName)] = shotSFX;
			}
			finally
			{
				((IDisposable)webRequest)?.Dispose();
			}
		}

		private string GetFileNameFromPath(string filePath)
		{
			int num = filePath.LastIndexOf('\\');
			if (num == -1)
			{
				return filePath;
			}
			return filePath.Substring(num + 1);
		}
	}
}
namespace PeakRevolverMod.Utils
{
	public class PeakRevolverConfig
	{
		public static ConfigEntry<int> maxRevolverShots;

		public static ConfigEntry<float> revolverDamage;

		public static ConfigEntry<float> revolverBlowback;

		public static void AllPeakRevolverConfigs(ConfigFile peakRevolverConfigFile)
		{
			maxRevolverShots = peakRevolverConfigFile.Bind<int>("Revolver", "Max Shots", 4, "The maximum number of shots a revolver can have.");
			revolverDamage = peakRevolverConfigFile.Bind<float>("Revolver", "Revolver Damage", 0.5f, "The amount of damage you/a friend takes upon an unsuccessful shot of the revolver. Make this a value somewhere between 0.0 for no damage, to 1.0 for maximum damage!");
			revolverBlowback = peakRevolverConfigFile.Bind<float>("Revolver", "Revolver Blowback", 0.25f, "How far back you/a friend goes flying upon an unsuccessful shot of the revolver. Make this a value somewhere between 0.0 for no blowback, to 1.0 for a lot of blowback! You can of course go higher, but beware it has not been tested :) ");
		}
	}
}
namespace PeakRevolverMod.Patches
{
	[HarmonyPatch(typeof(Character))]
	internal class PeakRevolverPatch
	{
		[HarmonyPatch("Awake")]
		[HarmonyPostfix]
		private static void AddPeakRevolverBlowbackWatcher(Character __instance)
		{
			((Component)__instance).gameObject.AddComponent<PeakRevolverBlowbackWatcher>();
		}
	}
	[HarmonyPatch(typeof(Character))]
	internal static class CharacterAwake
	{
		[HarmonyPatch("Awake")]
		[HarmonyPostfix]
		private static void AddSFXManagerForPeakRevolver(Character __instance)
		{
			((Component)__instance).gameObject.AddComponent<SFXManagerForPeakRevolver>();
		}
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		public IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}