Decompiled source of Devious Traps v1.1.2

DeviousTraps.dll

Decompiled 4 days ago
using System;
using System.Collections;
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 DeviousTraps.NetcodePatcher;
using GameNetcodeStuff;
using HarmonyLib;
using LethalConfig;
using LethalConfig.ConfigItems;
using LethalConfig.ConfigItems.Options;
using LethalLib.Extras;
using LethalLib.Modules;
using Microsoft.CodeAnalysis;
using Unity.Netcode;
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("bcs4313")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Adds an array of deadly traps")]
[assembly: AssemblyFileVersion("1.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+cd9e2c801759e115bb3ab98ef537ed8ed3634744")]
[assembly: AssemblyProduct("DeviousTraps")]
[assembly: AssemblyTitle("DeviousTraps")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: NetcodePatchedAssembly]
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.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace DeviousTraps
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("DeviousTraps", "DeviousTraps", "1.0.0")]
	public class Plugin : BaseUnityPlugin
	{
		public static Harmony _harmony;

		public static ManualLogSource Logger;

		public static AssetBundle TrapBundle;

		public static GameObject SawTurretPrefab;

		public static GameObject SawPrefab;

		public static SpawnableMapObjectDef SawTurretDef;

		public static GameObject FlameTurretPrefab;

		public static SpawnableMapObjectDef FlameTurretDef;

		public static ConfigEntry<float> SawSpawnrate;

		public static ConfigEntry<float> SawDmgMult;

		public static ConfigEntry<float> SawTargetRange;

		public static ConfigEntry<float> SawWindupTime;

		public static ConfigEntry<float> SawFirerate;

		public static ConfigEntry<int> SawAmmo;

		public static ConfigEntry<float> SawReloadTime;

		public static ConfigEntry<float> SawVolume;

		public static ConfigEntry<float> FlameSpawnrate;

		public static ConfigEntry<float> FlameDmgMult;

		public static ConfigEntry<float> FlameTargetRange;

		public static ConfigEntry<float> FlameRisingTime;

		public static ConfigEntry<float> FlameRestingTime;

		public static ConfigEntry<float> FlameRotationSpeed;

		public static ConfigEntry<float> FlameSpinningTime;

		public static ConfigEntry<float> FlameVolume;

		public static ConfigEntry<float> SmokeCooldown;

		public void LogIfDebugBuild(string text)
		{
			Logger.LogInfo((object)text);
		}

		private void Awake()
		{
			Logger = ((BaseUnityPlugin)this).Logger;
			PopulateAssets();
			bindVars();
			Type[] types = Assembly.GetExecutingAssembly().GetTypes();
			Type[] array = types;
			foreach (Type type in array)
			{
				MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic);
				MethodInfo[] array2 = methods;
				foreach (MethodInfo methodInfo in array2)
				{
					object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false);
					if (customAttributes.Length != 0)
					{
						methodInfo.Invoke(null, null);
					}
				}
			}
			SawTurretPrefab = TrapBundle.LoadAsset<GameObject>("SawTurretTrap");
			SawPrefab = TrapBundle.LoadAsset<GameObject>("SawBlade");
			SawTurretDef = TrapBundle.LoadAsset<SpawnableMapObjectDef>("SawTurretDef");
			FlameTurretPrefab = TrapBundle.LoadAsset<GameObject>("FlameTurret");
			FlameTurretDef = TrapBundle.LoadAsset<SpawnableMapObjectDef>("FlamePillarDef");
			Debug.Log((object)("Flame Turret Prefab: " + (object)FlameTurretPrefab));
			Debug.Log((object)("Flame Turret Def: " + (object)FlameTurretDef));
			Random.InitState((int)DateTime.Now.Ticks);
			MapObjects.RegisterMapObject(SawTurretDef, (LevelTypes)(-1), (Func<SelectableLevel, AnimationCurve>)delegate
			{
				//IL_0037: Unknown result type (might be due to invalid IL or missing references)
				//IL_003c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0061: Unknown result type (might be due to invalid IL or missing references)
				//IL_0066: Unknown result type (might be due to invalid IL or missing references)
				//IL_006b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0071: Expected O, but got Unknown
				int num3 = 0;
				float num4 = 6f * SawSpawnrate.Value;
				return new AnimationCurve((Keyframe[])(object)new Keyframe[2]
				{
					new Keyframe(0f, (float)num3, 0.267f, 0.267f, 0f, 0.246f),
					new Keyframe(1f, num4, 61f, 61f, 0.015f * num4, 0f)
				});
			});
			MapObjects.RegisterMapObject(FlameTurretDef, (LevelTypes)(-1), (Func<SelectableLevel, AnimationCurve>)delegate
			{
				//IL_0037: Unknown result type (might be due to invalid IL or missing references)
				//IL_003c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0061: Unknown result type (might be due to invalid IL or missing references)
				//IL_0066: Unknown result type (might be due to invalid IL or missing references)
				//IL_006b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0071: Expected O, but got Unknown
				int num = 0;
				float num2 = 6f * FlameSpawnrate.Value;
				return new AnimationCurve((Keyframe[])(object)new Keyframe[2]
				{
					new Keyframe(0f, (float)num, 0.267f, 0.267f, 0f, 0.246f),
					new Keyframe(1f, num2, 61f, 61f, 0.015f * num2, 0f)
				});
			});
			NetworkPrefabs.RegisterNetworkPrefab(SawPrefab);
			NetworkPrefabs.RegisterNetworkPrefab(SawTurretPrefab);
			NetworkPrefabs.RegisterNetworkPrefab(FlameTurretPrefab);
		}

		public void bindVars()
		{
			//IL_02ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c6: Expected O, but got Unknown
			//IL_02c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d2: Expected O, but got Unknown
			//IL_02d8: Expected O, but got Unknown
			//IL_02d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d9: Expected O, but got Unknown
			//IL_02de: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f6: Expected O, but got Unknown
			//IL_02f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0302: Expected O, but got Unknown
			//IL_0308: Expected O, but got Unknown
			//IL_0303: Unknown result type (might be due to invalid IL or missing references)
			//IL_0309: Expected O, but got Unknown
			//IL_030e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0313: Unknown result type (might be due to invalid IL or missing references)
			//IL_031b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0326: Expected O, but got Unknown
			//IL_0327: Unknown result type (might be due to invalid IL or missing references)
			//IL_0332: Expected O, but got Unknown
			//IL_0338: Expected O, but got Unknown
			//IL_0333: Unknown result type (might be due to invalid IL or missing references)
			//IL_0339: Expected O, but got Unknown
			//IL_033e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0343: Unknown result type (might be due to invalid IL or missing references)
			//IL_034b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0356: Expected O, but got Unknown
			//IL_0357: Unknown result type (might be due to invalid IL or missing references)
			//IL_0362: Expected O, but got Unknown
			//IL_0368: Expected O, but got Unknown
			//IL_0363: Unknown result type (might be due to invalid IL or missing references)
			//IL_0369: Expected O, but got Unknown
			//IL_036e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0373: Unknown result type (might be due to invalid IL or missing references)
			//IL_037b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0386: Expected O, but got Unknown
			//IL_0387: Unknown result type (might be due to invalid IL or missing references)
			//IL_0392: Expected O, but got Unknown
			//IL_0398: Expected O, but got Unknown
			//IL_0393: Unknown result type (might be due to invalid IL or missing references)
			//IL_039a: Expected O, but got Unknown
			//IL_039f: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b7: Expected O, but got Unknown
			//IL_03b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c3: Expected O, but got Unknown
			//IL_03c9: Expected O, but got Unknown
			//IL_03c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_03cb: Expected O, but got Unknown
			//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_03dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e8: Expected O, but got Unknown
			//IL_03e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f4: Expected O, but got Unknown
			//IL_03fa: Expected O, but got Unknown
			//IL_03f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_03fc: Expected O, but got Unknown
			//IL_0401: Unknown result type (might be due to invalid IL or missing references)
			//IL_0406: Unknown result type (might be due to invalid IL or missing references)
			//IL_040e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0419: Expected O, but got Unknown
			//IL_041a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0425: Expected O, but got Unknown
			//IL_042b: Expected O, but got Unknown
			//IL_0426: Unknown result type (might be due to invalid IL or missing references)
			//IL_042d: Expected O, but got Unknown
			//IL_0432: Unknown result type (might be due to invalid IL or missing references)
			//IL_0437: Unknown result type (might be due to invalid IL or missing references)
			//IL_043f: Unknown result type (might be due to invalid IL or missing references)
			//IL_044a: Expected O, but got Unknown
			//IL_044b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0456: Expected O, but got Unknown
			//IL_045c: Expected O, but got Unknown
			//IL_0457: Unknown result type (might be due to invalid IL or missing references)
			//IL_045e: Expected O, but got Unknown
			//IL_04a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_04bf: Expected O, but got Unknown
			//IL_04c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_04cb: Expected O, but got Unknown
			//IL_04d1: Expected O, but got Unknown
			//IL_04cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d3: Expected O, but got Unknown
			//IL_04d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_04dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f0: Expected O, but got Unknown
			//IL_04f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_04fc: Expected O, but got Unknown
			//IL_0502: Expected O, but got Unknown
			//IL_04fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0504: Expected O, but got Unknown
			//IL_0509: Unknown result type (might be due to invalid IL or missing references)
			//IL_050e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0516: Unknown result type (might be due to invalid IL or missing references)
			//IL_0521: Expected O, but got Unknown
			//IL_0522: Unknown result type (might be due to invalid IL or missing references)
			//IL_052d: Expected O, but got Unknown
			//IL_0533: Expected O, but got Unknown
			//IL_052e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0535: Expected O, but got Unknown
			//IL_053a: Unknown result type (might be due to invalid IL or missing references)
			//IL_053f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0547: Unknown result type (might be due to invalid IL or missing references)
			//IL_0552: Expected O, but got Unknown
			//IL_0553: Unknown result type (might be due to invalid IL or missing references)
			//IL_055e: Expected O, but got Unknown
			//IL_0564: Expected O, but got Unknown
			//IL_055f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0566: Expected O, but got Unknown
			//IL_056b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0570: Unknown result type (might be due to invalid IL or missing references)
			//IL_0578: Unknown result type (might be due to invalid IL or missing references)
			//IL_0583: Expected O, but got Unknown
			//IL_0584: Unknown result type (might be due to invalid IL or missing references)
			//IL_058f: Expected O, but got Unknown
			//IL_0595: Expected O, but got Unknown
			//IL_0590: Unknown result type (might be due to invalid IL or missing references)
			//IL_0597: Expected O, but got Unknown
			//IL_059c: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b4: Expected O, but got Unknown
			//IL_05b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c0: Expected O, but got Unknown
			//IL_05c6: Expected O, but got Unknown
			//IL_05c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c8: Expected O, but got Unknown
			//IL_05cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_05da: Unknown result type (might be due to invalid IL or missing references)
			//IL_05e1: Expected O, but got Unknown
			//IL_05e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ed: Expected O, but got Unknown
			//IL_05f3: Expected O, but got Unknown
			//IL_05ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_05f5: Expected O, but got Unknown
			//IL_05fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0607: Unknown result type (might be due to invalid IL or missing references)
			//IL_0612: Expected O, but got Unknown
			//IL_0613: Unknown result type (might be due to invalid IL or missing references)
			//IL_061e: Expected O, but got Unknown
			//IL_0624: Expected O, but got Unknown
			//IL_061f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0626: Expected O, but got Unknown
			SawSpawnrate = ((BaseUnityPlugin)this).Config.Bind<float>("Saw Turret", "Spawnrate", 1.6f, "How often do these turrets spawn? (default 0.48)");
			SawFirerate = ((BaseUnityPlugin)this).Config.Bind<float>("Saw Turret", "Time Between Shots", 1.45f, "Length of time between each saw after windup. (default 1.45)");
			SawDmgMult = ((BaseUnityPlugin)this).Config.Bind<float>("Saw Turret", "Dmg Multiplier", 1.8f, "Damage multiplier for saw blades. Dmg is also dependent on the velocity of a saw blade. You can make them heal with negative values too. (default 1.8)");
			SawTargetRange = ((BaseUnityPlugin)this).Config.Bind<float>("Saw Turret", "Range", 25f, "How far away a saw turret can see you. They can't see through walls though. (default 25)");
			SawWindupTime = ((BaseUnityPlugin)this).Config.Bind<float>("Saw Turret", "Windup Time", 1.45f, "How long a saw turret takes before it starts firing saws at you. (default 1.45)");
			SawFirerate = ((BaseUnityPlugin)this).Config.Bind<float>("Saw Turret", "Time Between Shots", 1.45f, "Length of time between each saw after windup. (default 1.45)");
			SawAmmo = ((BaseUnityPlugin)this).Config.Bind<int>("Saw Turret", "Ammo", 6, "Shots it takes before the turret has to reload. (default 6)");
			SawReloadTime = ((BaseUnityPlugin)this).Config.Bind<float>("Saw Turret", "Reload Time", 8f, "How long it takes for a saw turret to reload its sawblades (default 15)");
			SawFirerate = ((BaseUnityPlugin)this).Config.Bind<float>("Saw Turret", "Time Between Shots", 1.45f, "Length of time between each saw after windup. (default 1.45)");
			SawVolume = ((BaseUnityPlugin)this).Config.Bind<float>("Saw Turret", "Volume", 0.6f, "How loud are all sounds from this turret? (default 0.6)");
			FlameSpawnrate = ((BaseUnityPlugin)this).Config.Bind<float>("Flame Turret", "Spawnrate", 1.6f, "How often do these turrets spawn? (default 0.48)");
			FlameDmgMult = ((BaseUnityPlugin)this).Config.Bind<float>("Flame Turret", "Dmg Multiplier", 3.2f, "Damage Multiplier for flame turrets. You can make them heal with negative values too. (default 3.2)");
			FlameTargetRange = ((BaseUnityPlugin)this).Config.Bind<float>("Flame Turret", "Range", 7f, "How far away a flame turret can see you. They can't see through walls though. (default 7)");
			FlameRisingTime = ((BaseUnityPlugin)this).Config.Bind<float>("Flame Turret", "Rising Time", 1.4f, "Time in seconds it takes for a flame turret to rise up and fire at you. (default 1.4)");
			FlameRestingTime = ((BaseUnityPlugin)this).Config.Bind<float>("Flame Turret", "Resting Time", 3f, "How long does the flame turret rest before firing again? In seconds. (default 3)");
			FlameSpinningTime = ((BaseUnityPlugin)this).Config.Bind<float>("Flame Turret", "Spinning Time", 3f, "How long does the flame turret spin for? In seconds. (default 2)");
			FlameRotationSpeed = ((BaseUnityPlugin)this).Config.Bind<float>("Flame Turret", "Rotation Speed", 120f, "How fast does a flame turret rotate when attacking (degrees per second)? (default 120)");
			SmokeCooldown = ((BaseUnityPlugin)this).Config.Bind<float>("Flame Turret", "Warning Interval", 14.5f, "How often a flame turret release smoke to warn the player of its presence. The smoke release phase lasts for 4.5 seconds. (default 14.5)");
			FlameVolume = ((BaseUnityPlugin)this).Config.Bind<float>("Flame Turret", "Volume", 0.6f, "How loud are all sounds from this turret? (default 0.6)");
			ConfigEntry<float> flameSpawnrate = FlameSpawnrate;
			FloatInputFieldOptions val = new FloatInputFieldOptions
			{
				RequiresRestart = true
			};
			((BaseRangeOptions<float>)val).Min = 0f;
			((BaseRangeOptions<float>)val).Max = 100000000f;
			FloatInputFieldConfigItem val2 = new FloatInputFieldConfigItem(flameSpawnrate, val);
			ConfigEntry<float> flameDmgMult = FlameDmgMult;
			FloatSliderOptions val3 = new FloatSliderOptions
			{
				RequiresRestart = false
			};
			((BaseRangeOptions<float>)val3).Min = -5f;
			((BaseRangeOptions<float>)val3).Max = 5f;
			FloatSliderConfigItem val4 = new FloatSliderConfigItem(flameDmgMult, val3);
			ConfigEntry<float> flameTargetRange = FlameTargetRange;
			FloatSliderOptions val5 = new FloatSliderOptions
			{
				RequiresRestart = false
			};
			((BaseRangeOptions<float>)val5).Min = 0f;
			((BaseRangeOptions<float>)val5).Max = 100f;
			FloatSliderConfigItem val6 = new FloatSliderConfigItem(flameTargetRange, val5);
			ConfigEntry<float> flameRisingTime = FlameRisingTime;
			FloatSliderOptions val7 = new FloatSliderOptions
			{
				RequiresRestart = false
			};
			((BaseRangeOptions<float>)val7).Min = 0f;
			((BaseRangeOptions<float>)val7).Max = 10f;
			FloatSliderConfigItem val8 = new FloatSliderConfigItem(flameRisingTime, val7);
			ConfigEntry<float> flameRestingTime = FlameRestingTime;
			FloatSliderOptions val9 = new FloatSliderOptions
			{
				RequiresRestart = false
			};
			((BaseRangeOptions<float>)val9).Min = 0f;
			((BaseRangeOptions<float>)val9).Max = 20f;
			FloatSliderConfigItem val10 = new FloatSliderConfigItem(flameRestingTime, val9);
			ConfigEntry<float> flameSpinningTime = FlameSpinningTime;
			FloatSliderOptions val11 = new FloatSliderOptions
			{
				RequiresRestart = false
			};
			((BaseRangeOptions<float>)val11).Min = 0f;
			((BaseRangeOptions<float>)val11).Max = 20f;
			FloatSliderConfigItem val12 = new FloatSliderConfigItem(flameSpinningTime, val11);
			ConfigEntry<float> flameRotationSpeed = FlameRotationSpeed;
			FloatSliderOptions val13 = new FloatSliderOptions
			{
				RequiresRestart = false
			};
			((BaseRangeOptions<float>)val13).Min = 0f;
			((BaseRangeOptions<float>)val13).Max = 1080f;
			FloatSliderConfigItem val14 = new FloatSliderConfigItem(flameRotationSpeed, val13);
			ConfigEntry<float> flameVolume = FlameVolume;
			FloatSliderOptions val15 = new FloatSliderOptions
			{
				RequiresRestart = false
			};
			((BaseRangeOptions<float>)val15).Min = 0f;
			((BaseRangeOptions<float>)val15).Max = 2f;
			FloatSliderConfigItem val16 = new FloatSliderConfigItem(flameVolume, val15);
			ConfigEntry<float> smokeCooldown = SmokeCooldown;
			FloatInputFieldOptions val17 = new FloatInputFieldOptions
			{
				RequiresRestart = false
			};
			((BaseRangeOptions<float>)val17).Min = 6f;
			((BaseRangeOptions<float>)val17).Max = 1E+11f;
			FloatInputFieldConfigItem val18 = new FloatInputFieldConfigItem(smokeCooldown, val17);
			LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val2);
			LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val4);
			LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val18);
			LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val6);
			LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val8);
			LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val10);
			LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val12);
			LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val14);
			LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val16);
			ConfigEntry<float> sawSpawnrate = SawSpawnrate;
			FloatInputFieldOptions val19 = new FloatInputFieldOptions
			{
				RequiresRestart = true
			};
			((BaseRangeOptions<float>)val19).Min = 0f;
			((BaseRangeOptions<float>)val19).Max = 100000000f;
			FloatInputFieldConfigItem val20 = new FloatInputFieldConfigItem(sawSpawnrate, val19);
			ConfigEntry<float> sawDmgMult = SawDmgMult;
			FloatSliderOptions val21 = new FloatSliderOptions
			{
				RequiresRestart = false
			};
			((BaseRangeOptions<float>)val21).Min = -5f;
			((BaseRangeOptions<float>)val21).Max = 5f;
			FloatSliderConfigItem val22 = new FloatSliderConfigItem(sawDmgMult, val21);
			ConfigEntry<float> sawTargetRange = SawTargetRange;
			FloatSliderOptions val23 = new FloatSliderOptions
			{
				RequiresRestart = false
			};
			((BaseRangeOptions<float>)val23).Min = 0f;
			((BaseRangeOptions<float>)val23).Max = 100f;
			FloatSliderConfigItem val24 = new FloatSliderConfigItem(sawTargetRange, val23);
			ConfigEntry<float> sawWindupTime = SawWindupTime;
			FloatSliderOptions val25 = new FloatSliderOptions
			{
				RequiresRestart = false
			};
			((BaseRangeOptions<float>)val25).Min = 0f;
			((BaseRangeOptions<float>)val25).Max = 10f;
			FloatSliderConfigItem val26 = new FloatSliderConfigItem(sawWindupTime, val25);
			ConfigEntry<float> sawFirerate = SawFirerate;
			FloatInputFieldOptions val27 = new FloatInputFieldOptions
			{
				RequiresRestart = false
			};
			((BaseRangeOptions<float>)val27).Min = 0f;
			((BaseRangeOptions<float>)val27).Max = 100000000f;
			FloatInputFieldConfigItem val28 = new FloatInputFieldConfigItem(sawFirerate, val27);
			ConfigEntry<float> sawVolume = SawVolume;
			FloatSliderOptions val29 = new FloatSliderOptions
			{
				RequiresRestart = false
			};
			((BaseRangeOptions<float>)val29).Min = 0f;
			((BaseRangeOptions<float>)val29).Max = 2f;
			FloatSliderConfigItem val30 = new FloatSliderConfigItem(sawVolume, val29);
			ConfigEntry<int> sawAmmo = SawAmmo;
			IntInputFieldOptions val31 = new IntInputFieldOptions
			{
				RequiresRestart = false
			};
			((BaseRangeOptions<int>)val31).Min = 1;
			((BaseRangeOptions<int>)val31).Max = 100000000;
			IntInputFieldConfigItem val32 = new IntInputFieldConfigItem(sawAmmo, val31);
			ConfigEntry<float> sawReloadTime = SawReloadTime;
			FloatInputFieldOptions val33 = new FloatInputFieldOptions
			{
				RequiresRestart = false
			};
			((BaseRangeOptions<float>)val33).Min = 0f;
			((BaseRangeOptions<float>)val33).Max = 100000000f;
			FloatInputFieldConfigItem val34 = new FloatInputFieldConfigItem(sawReloadTime, val33);
			LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val20);
			LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val22);
			LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val24);
			LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val26);
			LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val28);
			LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val32);
			LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val34);
			LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val30);
		}

		public static void PopulateAssets()
		{
			string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
			TrapBundle = AssetBundle.LoadFromFile(Path.Combine(directoryName, "bcs_devioustraps"));
			Debug.Log((object)("DeviousTraps Bundle::: " + (object)TrapBundle));
		}
	}
}
namespace DeviousTraps.src
{
	public class FlameHitbox : NetworkBehaviour
	{
		internal Vector3 LaunchForce = Vector3.zero;

		public Collider Collider;

		private float HitCooldown = 0f;

		private float HitCooldownReset = 0.2f;

		private float LastHitEnemyCooldown = 0f;

		public static float BaseDmg = 10f;

		public float dmgRamp = 0f;

		public static float dmgRampTime = 0.45f;

		public void Update()
		{
			HitCooldown -= Time.deltaTime;
			LastHitEnemyCooldown -= Time.deltaTime;
			if (dmgRamp < 1f)
			{
				dmgRamp += Time.deltaTime / dmgRampTime;
				if (dmgRamp > 1f)
				{
					dmgRamp = 1f;
				}
			}
		}

		public void ResetDmgRamp()
		{
			dmgRamp = 0f;
		}

		[ClientRpc]
		public void DmgPlayerClientRpc(ulong netid, int amount)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: 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)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2246517757u, val, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val2, netid);
				BytePacker.WriteValueBitPacked(val2, amount);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2246517757u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost))
			{
				return;
			}
			base.__rpc_exec_stage = (__RpcExecStage)0;
			PlayerControllerB[] allPlayerScripts = RoundManager.Instance.playersManager.allPlayerScripts;
			PlayerControllerB[] array = allPlayerScripts;
			foreach (PlayerControllerB val3 in array)
			{
				if (((NetworkBehaviour)val3).NetworkObject.NetworkObjectId == netid)
				{
					val3.DamagePlayer(amount, true, true, (CauseOfDeath)0, 0, false, default(Vector3));
				}
			}
		}

		[ClientRpc]
		public void KillPlayerClientRpc(ulong netid)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: 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_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_011d: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1308895154u, val, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val2, netid);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1308895154u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost))
			{
				return;
			}
			base.__rpc_exec_stage = (__RpcExecStage)0;
			PlayerControllerB[] allPlayerScripts = RoundManager.Instance.playersManager.allPlayerScripts;
			PlayerControllerB[] array = allPlayerScripts;
			foreach (PlayerControllerB val3 in array)
			{
				if (((NetworkBehaviour)val3).NetworkObject.NetworkObjectId == netid)
				{
					val3.KillPlayer(val3.playerRigidbody.velocity, true, (CauseOfDeath)13, 0, default(Vector3));
				}
			}
		}

		public void OnTriggerStay(Collider other)
		{
			if (!((NetworkBehaviour)RoundManager.Instance).IsHost)
			{
				return;
			}
			GameObject gameObject = ((Component)other).gameObject;
			PlayerControllerB component = gameObject.GetComponent<PlayerControllerB>();
			EnemyAI component2 = gameObject.GetComponent<EnemyAI>();
			if (Object.op_Implicit((Object)(object)component) && HitCooldown <= 0f)
			{
				int num = (int)(dmgRamp * BaseDmg * Plugin.FlameDmgMult.Value);
				if (num >= component.health)
				{
					KillPlayerClientRpc(((NetworkBehaviour)component).NetworkObject.NetworkObjectId);
				}
				else
				{
					DmgPlayerClientRpc(((NetworkBehaviour)component).NetworkObject.NetworkObjectId, num);
				}
				HitCooldown = HitCooldownReset;
			}
			if (Object.op_Implicit((Object)(object)component2) && LastHitEnemyCooldown <= 0f)
			{
				component2.HitEnemyClientRpc(3, -1, true, -1);
				LastHitEnemyCooldown = HitCooldownReset;
			}
		}

		protected override void __initializeVariables()
		{
			((NetworkBehaviour)this).__initializeVariables();
		}

		protected override void __initializeRpcs()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Expected O, but got Unknown
			((NetworkBehaviour)this).__registerRpc(2246517757u, new RpcReceiveHandler(__rpc_handler_2246517757), "DmgPlayerClientRpc");
			((NetworkBehaviour)this).__registerRpc(1308895154u, new RpcReceiveHandler(__rpc_handler_1308895154), "KillPlayerClientRpc");
			((NetworkBehaviour)this).__initializeRpcs();
		}

		private static void __rpc_handler_2246517757(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				ulong netid = default(ulong);
				ByteUnpacker.ReadValueBitPacked(reader, ref netid);
				int amount = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref amount);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((FlameHitbox)(object)target).DmgPlayerClientRpc(netid, amount);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_1308895154(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				ulong netid = default(ulong);
				ByteUnpacker.ReadValueBitPacked(reader, ref netid);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((FlameHitbox)(object)target).KillPlayerClientRpc(netid);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		protected internal override string __getTypeName()
		{
			return "FlameHitbox";
		}
	}
	public class FlameTurret : NetworkBehaviour
	{
		public AudioSource AudioFlameTurretOn;

		public AudioSource AudioFireFlames;

		public AudioSource AudioReload;

		public AudioSource AudioSmokeRelease;

		public GameObject ActivationGroup;

		public GameObject pillar;

		public GameObject SmokeSystem;

		internal Animator animator;

		private bool On = false;

		private bool lastOn = false;

		[Tooltip("How high the pillar moves up from its starting local Y (world units).")]
		public float ElevationAmount = 2.2f;

		private float t_SmokeReleaseTotal = 0f;

		private float t_SpinningTimeTotal = 0f;

		private float t_StandbyTimeTotal = 0f;

		private float t_ElevationState = 0f;

		private bool InStandby = false;

		private float pillarBaseY;

		public void Start()
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			ActivationGroup.SetActive(false);
			animator = ((Component)this).GetComponent<Animator>();
			pillarBaseY = pillar.transform.localPosition.y;
			AudioFlameTurretOn.volume = Plugin.FlameVolume.Value;
			AudioFireFlames.volume = Plugin.FlameVolume.Value;
			AudioReload.volume = Plugin.FlameVolume.Value;
			AudioSmokeRelease.volume = Plugin.FlameVolume.Value;
		}

		public void Update()
		{
			if (((NetworkBehaviour)this).IsServer)
			{
				OnOffConditional();
				if (On != lastOn)
				{
					SetOnStateClientRpc(On);
					ToggleTurretOnClientRpc(On);
					lastOn = On;
				}
			}
			if (((NetworkBehaviour)RoundManager.Instance).IsHost)
			{
				t_SmokeReleaseTotal -= Time.deltaTime;
				if (t_SmokeReleaseTotal < 0f)
				{
					t_SmokeReleaseTotal = Plugin.SmokeCooldown.Value;
					PlaySmokeReleaseClientRpc();
				}
			}
			AITick();
		}

		public void OnOffConditional()
		{
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: 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_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: 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_00ac: Unknown result type (might be due to invalid IL or missing references)
			float num = Plugin.FlameTargetRange.Value;
			PlayerControllerB val = null;
			PlayerControllerB[] allPlayerScripts = RoundManager.Instance.playersManager.allPlayerScripts;
			PlayerControllerB[] array = allPlayerScripts;
			foreach (PlayerControllerB val2 in array)
			{
				if (!((Object)(object)val2 == (Object)null) && !val2.isPlayerDead)
				{
					Vector3 val3 = ((Component)this).transform.position + Vector3.up * 1.2f;
					Vector3 position = ((Component)val2.gameplayCamera).transform.position;
					float num2 = Vector3.Distance(val3, position);
					if (!(num2 > Plugin.FlameTargetRange.Value) && !Physics.Linecast(val3, position, StartOfRound.Instance.collidersAndRoomMask, (QueryTriggerInteraction)1) && num2 < num)
					{
						num = num2;
						val = val2;
					}
				}
			}
			On = (Object)(object)val != (Object)null;
		}

		private void SetPillarHeight(float normalized)
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			normalized = Mathf.Clamp01(normalized);
			t_ElevationState = normalized;
			float num = ((Component)this).transform.lossyScale.y;
			if (num <= 0f)
			{
				num = 1f;
			}
			float num2 = ElevationAmount / num;
			Vector3 localPosition = pillar.transform.localPosition;
			localPosition.y = pillarBaseY + num2 * normalized;
			pillar.transform.localPosition = localPosition;
		}

		public void AITick()
		{
			if (!InStandby)
			{
				if (t_ElevationState < 1f)
				{
					if (!AudioFlameTurretOn.isPlaying)
					{
						PlayFireClientRpc();
					}
					float num = Time.deltaTime / Plugin.FlameRisingTime.Value;
					SetPillarHeight(t_ElevationState + num);
				}
				else if (t_SpinningTimeTotal < Plugin.FlameSpinningTime.Value)
				{
					if (((NetworkBehaviour)this).IsServer && !ActivationGroup.activeInHierarchy)
					{
						SetGroupActiveClientRpc(value: true);
					}
					t_SpinningTimeTotal += Time.deltaTime;
					pillar.transform.Rotate(0f, Plugin.FlameRotationSpeed.Value * Time.deltaTime, 0f, (Space)1);
				}
				else
				{
					InStandby = true;
				}
				return;
			}
			if (((NetworkBehaviour)this).IsServer && ActivationGroup.activeInHierarchy)
			{
				if (AudioFlameTurretOn.isPlaying)
				{
					StopFireClientRpc();
				}
				SetGroupActiveClientRpc(value: false);
			}
			if (t_ElevationState > 0f)
			{
				if (!AudioReload.isPlaying)
				{
					PlayReloadClientRpc();
				}
				float num2 = Time.deltaTime / Plugin.FlameRisingTime.Value;
				SetPillarHeight(t_ElevationState - num2);
			}
			else if (t_StandbyTimeTotal < Plugin.FlameRestingTime.Value)
			{
				t_StandbyTimeTotal += Time.deltaTime;
			}
			else if (On)
			{
				InStandby = false;
				t_StandbyTimeTotal = 0f;
				t_SpinningTimeTotal = 0f;
			}
		}

		[ClientRpc]
		public void PlaySmokeReleaseClientRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: 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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(941713206u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 941713206u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					base.__rpc_exec_stage = (__RpcExecStage)0;
					((MonoBehaviour)this).StartCoroutine(PlaySmokeCoroutine());
				}
			}
		}

		public IEnumerator PlaySmokeCoroutine()
		{
			SmokeSystem.SetActive(true);
			yield return (object)new WaitForSeconds(4.5f);
			SmokeSystem.SetActive(false);
		}

		[ClientRpc]
		private void SetOnStateClientRpc(bool value)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: 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_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1393123788u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref value, default(ForPrimitives));
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1393123788u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					base.__rpc_exec_stage = (__RpcExecStage)0;
					On = value;
				}
			}
		}

		[ClientRpc]
		public void SetGroupActiveClientRpc(bool value)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: 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_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2323146907u, val, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref value, default(ForPrimitives));
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2323146907u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				base.__rpc_exec_stage = (__RpcExecStage)0;
				ActivationGroup.SetActive(value);
				if (value)
				{
					AudioFireFlames.Play();
				}
				else
				{
					AudioFireFlames.Stop();
				}
			}
		}

		[ClientRpc]
		public void PlayFireClientRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: 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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(141116094u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 141116094u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					base.__rpc_exec_stage = (__RpcExecStage)0;
					AudioFlameTurretOn.Play();
				}
			}
		}

		[ClientRpc]
		public void StopFireClientRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: 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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2040491108u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2040491108u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					base.__rpc_exec_stage = (__RpcExecStage)0;
					AudioFlameTurretOn.Stop();
				}
			}
		}

		[ClientRpc]
		public void PlayReloadClientRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: 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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2148362063u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2148362063u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					base.__rpc_exec_stage = (__RpcExecStage)0;
					AudioReload.Play();
				}
			}
		}

		[ClientRpc]
		public void StopReloadClientRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: 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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1334700428u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1334700428u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					base.__rpc_exec_stage = (__RpcExecStage)0;
					AudioReload.Stop();
				}
			}
		}

		[ClientRpc]
		public void ToggleTurretOnClientRpc(bool on)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: 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_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1074175290u, val, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref on, default(ForPrimitives));
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1074175290u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				base.__rpc_exec_stage = (__RpcExecStage)0;
				if (on && AudioReload.isPlaying)
				{
					AudioReload.Stop();
				}
			}
		}

		protected override void __initializeVariables()
		{
			((NetworkBehaviour)this).__initializeVariables();
		}

		protected override void __initializeRpcs()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Expected O, but got Unknown
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Expected O, but got Unknown
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Expected O, but got Unknown
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Expected O, but got Unknown
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Expected O, but got Unknown
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Expected O, but got Unknown
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Expected O, but got Unknown
			((NetworkBehaviour)this).__registerRpc(941713206u, new RpcReceiveHandler(__rpc_handler_941713206), "PlaySmokeReleaseClientRpc");
			((NetworkBehaviour)this).__registerRpc(1393123788u, new RpcReceiveHandler(__rpc_handler_1393123788), "SetOnStateClientRpc");
			((NetworkBehaviour)this).__registerRpc(2323146907u, new RpcReceiveHandler(__rpc_handler_2323146907), "SetGroupActiveClientRpc");
			((NetworkBehaviour)this).__registerRpc(141116094u, new RpcReceiveHandler(__rpc_handler_141116094), "PlayFireClientRpc");
			((NetworkBehaviour)this).__registerRpc(2040491108u, new RpcReceiveHandler(__rpc_handler_2040491108), "StopFireClientRpc");
			((NetworkBehaviour)this).__registerRpc(2148362063u, new RpcReceiveHandler(__rpc_handler_2148362063), "PlayReloadClientRpc");
			((NetworkBehaviour)this).__registerRpc(1334700428u, new RpcReceiveHandler(__rpc_handler_1334700428), "StopReloadClientRpc");
			((NetworkBehaviour)this).__registerRpc(1074175290u, new RpcReceiveHandler(__rpc_handler_1074175290), "ToggleTurretOnClientRpc");
			((NetworkBehaviour)this).__initializeRpcs();
		}

		private static void __rpc_handler_941713206(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((FlameTurret)(object)target).PlaySmokeReleaseClientRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_1393123788(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: 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)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				bool onStateClientRpc = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref onStateClientRpc, default(ForPrimitives));
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((FlameTurret)(object)target).SetOnStateClientRpc(onStateClientRpc);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2323146907(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: 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)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				bool groupActiveClientRpc = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref groupActiveClientRpc, default(ForPrimitives));
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((FlameTurret)(object)target).SetGroupActiveClientRpc(groupActiveClientRpc);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_141116094(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((FlameTurret)(object)target).PlayFireClientRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2040491108(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((FlameTurret)(object)target).StopFireClientRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2148362063(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((FlameTurret)(object)target).PlayReloadClientRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_1334700428(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((FlameTurret)(object)target).StopReloadClientRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_1074175290(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: 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)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				bool on = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref on, default(ForPrimitives));
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((FlameTurret)(object)target).ToggleTurretOnClientRpc(on);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		protected internal override string __getTypeName()
		{
			return "FlameTurret";
		}
	}
	internal class FlameTurretSpawnCurves
	{
		public static readonly AnimationCurve WeakCurve = new AnimationCurve((Keyframe[])(object)new Keyframe[6]
		{
			new Keyframe(0f, 0f * Plugin.FlameSpawnrate.Value),
			new Keyframe(0.4f, 1f * Plugin.FlameSpawnrate.Value),
			new Keyframe(0.7f, 3f * Plugin.FlameSpawnrate.Value),
			new Keyframe(0.9f, 5f * Plugin.FlameSpawnrate.Value),
			new Keyframe(0.97f, 6f * Plugin.FlameSpawnrate.Value),
			new Keyframe(1f, 8f * Plugin.FlameSpawnrate.Value)
		});

		public static readonly AnimationCurve NormalCurve = new AnimationCurve((Keyframe[])(object)new Keyframe[6]
		{
			new Keyframe(0f, 0f * Plugin.FlameSpawnrate.Value),
			new Keyframe(0.4f, 2f * Plugin.FlameSpawnrate.Value),
			new Keyframe(0.7f, 5f * Plugin.FlameSpawnrate.Value),
			new Keyframe(0.9f, 8f * Plugin.FlameSpawnrate.Value),
			new Keyframe(0.97f, 10f * Plugin.FlameSpawnrate.Value),
			new Keyframe(1f, 15f * Plugin.FlameSpawnrate.Value)
		});

		public static readonly AnimationCurve AggressiveCurve = new AnimationCurve((Keyframe[])(object)new Keyframe[6]
		{
			new Keyframe(0f, 0f * Plugin.FlameSpawnrate.Value),
			new Keyframe(0.4f, 5f * Plugin.FlameSpawnrate.Value),
			new Keyframe(0.7f, 7f * Plugin.FlameSpawnrate.Value),
			new Keyframe(0.9f, 8f * Plugin.FlameSpawnrate.Value),
			new Keyframe(0.97f, 15f * Plugin.FlameSpawnrate.Value),
			new Keyframe(1f, 35f * Plugin.FlameSpawnrate.Value)
		});
	}
	public class SawProjectileV2 : NetworkBehaviour
	{
		internal Vector3 LaunchForce = Vector3.zero;

		public Rigidbody RigidBody;

		public Collider Collider;

		private float LastHitPlayerCooldown = 0f;

		private PlayerControllerB LastHitPlayer;

		private float LastHitEnemyCooldown = 0f;

		private EnemyAI LastHitEnemy;

		private float HitCooldownReset = 0.2f;

		private float Lifetime = 60f;

		public Material BloodMat;

		public MeshRenderer Renderer;

		public AudioSource AudioBlood1;

		public AudioSource AudioBlood2;

		public AudioSource AudioBlood3;

		public AudioSource AudioBounce;

		public GameObject BloodParticles;

		public GameObject SparkParticles;

		public float BloodLifetime = 0f;

		public static float BounceSoundThreshold = 5f;

		private Vector3 PreviousVelocity = Vector3.zero;

		public void Start()
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			if (((NetworkBehaviour)RoundManager.Instance).IsHost)
			{
				RigidBody.AddForce(LaunchForce);
			}
			AudioBlood1.volume = Plugin.SawVolume.Value;
			AudioBlood2.volume = Plugin.SawVolume.Value;
			AudioBlood3.volume = Plugin.SawVolume.Value;
			AudioBounce.volume = Plugin.SawVolume.Value;
		}

		public void SetScale(float mult)
		{
			//IL_0008: 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)
			Transform transform = ((Component)this).transform;
			transform.localScale *= mult;
		}

		public void Update()
		{
			//IL_0078: 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_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: 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)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			LastHitPlayerCooldown -= Time.deltaTime;
			LastHitEnemyCooldown -= Time.deltaTime;
			Lifetime -= Time.deltaTime;
			BloodLifetime -= Time.deltaTime;
			if (BloodLifetime < 0f && BloodParticles.activeInHierarchy)
			{
				ParticleSetClientRpc(active: false);
			}
			Vector3 velocity = RigidBody.velocity;
			Vector3 previousVelocity = PreviousVelocity;
			PreviousVelocity = velocity;
			Vector3 val = velocity - previousVelocity;
			if (((Vector3)(ref val)).magnitude > BounceSoundThreshold)
			{
				PlayBounceClientRpc();
			}
			if (Lifetime < 0f && ((NetworkBehaviour)RoundManager.Instance).IsHost)
			{
				Object.Destroy((Object)(object)((Component)this).gameObject);
			}
		}

		[ClientRpc]
		public void DmgPlayerClientRpc(ulong netid, int amount)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: 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)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3509185095u, val, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val2, netid);
				BytePacker.WriteValueBitPacked(val2, amount);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3509185095u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost))
			{
				return;
			}
			base.__rpc_exec_stage = (__RpcExecStage)0;
			PlayerControllerB[] allPlayerScripts = RoundManager.Instance.playersManager.allPlayerScripts;
			PlayerControllerB[] array = allPlayerScripts;
			foreach (PlayerControllerB val3 in array)
			{
				if (((NetworkBehaviour)val3).NetworkObject.NetworkObjectId == netid)
				{
					val3.DamagePlayer(amount, true, true, (CauseOfDeath)0, 0, false, default(Vector3));
					BloodLifetime = 0.8f;
					((Renderer)Renderer).material = BloodMat;
				}
			}
		}

		[ClientRpc]
		public void KillPlayerClientRpc(ulong netid, Vector3 launchVelocity)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: 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_0120: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3626191914u, val, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val2, netid);
				((FastBufferWriter)(ref val2)).WriteValueSafe(ref launchVelocity);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3626191914u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost))
			{
				return;
			}
			base.__rpc_exec_stage = (__RpcExecStage)0;
			PlayerControllerB[] allPlayerScripts = RoundManager.Instance.playersManager.allPlayerScripts;
			PlayerControllerB[] array = allPlayerScripts;
			foreach (PlayerControllerB val3 in array)
			{
				if (((NetworkBehaviour)val3).NetworkObject.NetworkObjectId == netid)
				{
					val3.KillPlayer(launchVelocity, true, (CauseOfDeath)17, 0, default(Vector3));
					BloodLifetime = 0.8f;
					((Renderer)Renderer).material = BloodMat;
				}
			}
		}

		[ClientRpc]
		public void ParticleSetClientRpc(bool active)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: 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_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(721753425u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref active, default(ForPrimitives));
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 721753425u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					base.__rpc_exec_stage = (__RpcExecStage)0;
					BloodParticles.SetActive(active);
				}
			}
		}

		[ClientRpc]
		public void PlayBounceClientRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: 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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1570402476u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1570402476u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					base.__rpc_exec_stage = (__RpcExecStage)0;
					AudioBounce.Play();
				}
			}
		}

		[ClientRpc]
		public void SparkSetClientRpc(bool active)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: 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_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2861241470u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref active, default(ForPrimitives));
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2861241470u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					base.__rpc_exec_stage = (__RpcExecStage)0;
					SparkParticles.SetActive(active);
				}
			}
		}

		[ClientRpc]
		public void PlayShredClientRpc(int id)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1722453318u, val, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val2, id);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1722453318u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				base.__rpc_exec_stage = (__RpcExecStage)0;
				switch (id)
				{
				case 1:
					AudioBlood1.Play();
					break;
				case 2:
					AudioBlood2.Play();
					break;
				case 3:
					AudioBlood3.Play();
					break;
				default:
					AudioBlood1.Play();
					break;
				}
			}
		}

		public void OnTriggerEnter(Collider other)
		{
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: 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)
			if (!((NetworkBehaviour)RoundManager.Instance).IsHost)
			{
				return;
			}
			GameObject gameObject = ((Component)other).gameObject;
			PlayerControllerB component = gameObject.GetComponent<PlayerControllerB>();
			EnemyAI component2 = gameObject.GetComponent<EnemyAI>();
			if (Object.op_Implicit((Object)(object)component) && (LastHitPlayerCooldown <= 0f || (Object)(object)component != (Object)(object)LastHitPlayer))
			{
				Random random = new Random();
				Vector3 velocity = component.playerRigidbody.velocity;
				float magnitude = ((Vector3)(ref velocity)).magnitude;
				velocity = RigidBody.velocity;
				int num = (int)(Math.Max(magnitude, ((Vector3)(ref velocity)).magnitude) * Plugin.SawDmgMult.Value);
				if (num > 10)
				{
					PlayShredClientRpc(random.Next(3) + 1);
					ParticleSetClientRpc(active: true);
				}
				if (num >= component.health)
				{
					KillPlayerClientRpc(((NetworkBehaviour)component).NetworkObject.NetworkObjectId, RigidBody.velocity);
				}
				else
				{
					DmgPlayerClientRpc(((NetworkBehaviour)component).NetworkObject.NetworkObjectId, num);
				}
				LastHitPlayerCooldown = HitCooldownReset;
				LastHitPlayer = component;
			}
			if (Object.op_Implicit((Object)(object)component2) && (LastHitEnemyCooldown <= 0f || (Object)(object)component2 != (Object)(object)LastHitEnemy))
			{
				component2.HitEnemyClientRpc(3, -1, true, -1);
				LastHitEnemyCooldown = HitCooldownReset;
				LastHitEnemy = component2;
			}
		}

		protected override void __initializeVariables()
		{
			((NetworkBehaviour)this).__initializeVariables();
		}

		protected override void __initializeRpcs()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Expected O, but got Unknown
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Expected O, but got Unknown
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Expected O, but got Unknown
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Expected O, but got Unknown
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Expected O, but got Unknown
			((NetworkBehaviour)this).__registerRpc(3509185095u, new RpcReceiveHandler(__rpc_handler_3509185095), "DmgPlayerClientRpc");
			((NetworkBehaviour)this).__registerRpc(3626191914u, new RpcReceiveHandler(__rpc_handler_3626191914), "KillPlayerClientRpc");
			((NetworkBehaviour)this).__registerRpc(721753425u, new RpcReceiveHandler(__rpc_handler_721753425), "ParticleSetClientRpc");
			((NetworkBehaviour)this).__registerRpc(1570402476u, new RpcReceiveHandler(__rpc_handler_1570402476), "PlayBounceClientRpc");
			((NetworkBehaviour)this).__registerRpc(2861241470u, new RpcReceiveHandler(__rpc_handler_2861241470), "SparkSetClientRpc");
			((NetworkBehaviour)this).__registerRpc(1722453318u, new RpcReceiveHandler(__rpc_handler_1722453318), "PlayShredClientRpc");
			((NetworkBehaviour)this).__initializeRpcs();
		}

		private static void __rpc_handler_3509185095(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				ulong netid = default(ulong);
				ByteUnpacker.ReadValueBitPacked(reader, ref netid);
				int amount = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref amount);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((SawProjectileV2)(object)target).DmgPlayerClientRpc(netid, amount);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_3626191914(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				ulong netid = default(ulong);
				ByteUnpacker.ReadValueBitPacked(reader, ref netid);
				Vector3 launchVelocity = default(Vector3);
				((FastBufferReader)(ref reader)).ReadValueSafe(ref launchVelocity);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((SawProjectileV2)(object)target).KillPlayerClientRpc(netid, launchVelocity);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_721753425(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: 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)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				bool active = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref active, default(ForPrimitives));
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((SawProjectileV2)(object)target).ParticleSetClientRpc(active);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_1570402476(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((SawProjectileV2)(object)target).PlayBounceClientRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2861241470(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: 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)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				bool active = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref active, default(ForPrimitives));
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((SawProjectileV2)(object)target).SparkSetClientRpc(active);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_1722453318(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				int id = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref id);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((SawProjectileV2)(object)target).PlayShredClientRpc(id);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		protected internal override string __getTypeName()
		{
			return "SawProjectileV2";
		}
	}
	internal class SawTurret : NetworkBehaviour
	{
		public AudioSource AudioSawTurretOn;

		public AudioSource AudioLaunchSaw;

		public GameObject ActivationGroup;

		public PlayerControllerB TargetPlayer;

		public Transform SawSpawnPoint;

		private bool Reloading = false;

		public GameObject VisibleSawBlade;

		public AudioSource AudioReload;

		public AudioSource AudioDoneReloading;

		private float TimeUntilDoneReloading = 0f;

		private int CurrentAmmo = 0;

		internal Animator animator;

		private bool On = false;

		private float WindTime = 0f;

		private float CooldownTime = 0f;

		public static float SawLaunchForce = 3000f;

		public void Start()
		{
			ActivationGroup.SetActive(false);
			VisibleSawBlade.SetActive(true);
			animator = ((Component)this).GetComponent<Animator>();
			AudioSawTurretOn.volume = Plugin.SawVolume.Value;
			AudioLaunchSaw.volume = Plugin.SawVolume.Value;
			AudioReload.volume = Plugin.SawVolume.Value;
			AudioDoneReloading.volume = Plugin.SawVolume.Value;
		}

		public void Update()
		{
			if (((NetworkBehaviour)RoundManager.Instance).IsHost)
			{
				OnOffConditional();
			}
			if (On)
			{
				if (((NetworkBehaviour)RoundManager.Instance).IsHost && !AudioSawTurretOn.isPlaying)
				{
					ToggleTurretOnClientRpc(on: true);
				}
				AITick();
			}
			else if (((NetworkBehaviour)RoundManager.Instance).IsHost && AudioSawTurretOn.isPlaying)
			{
				ToggleTurretOnClientRpc(on: false);
			}
			if (((NetworkBehaviour)RoundManager.Instance).IsHost)
			{
				if (TimeUntilDoneReloading < 0f && Reloading)
				{
					Reloading = false;
					PlayFinishReloadingClientRpc();
					CurrentAmmo = Plugin.SawAmmo.Value;
				}
				else if (!Reloading && CurrentAmmo <= 0)
				{
					Reloading = true;
					TimeUntilDoneReloading = Plugin.SawReloadTime.Value;
					PlayReloadingClientRpc();
				}
			}
			TimeUntilDoneReloading -= Time.deltaTime;
			WindTime += Time.deltaTime;
			CooldownTime -= Time.deltaTime;
		}

		[ClientRpc]
		public void PlayReloadingClientRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: 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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1163919899u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1163919899u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					base.__rpc_exec_stage = (__RpcExecStage)0;
					AudioReload.Play();
					VisibleSawBlade.SetActive(false);
				}
			}
		}

		[ClientRpc]
		public void PlayFinishReloadingClientRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: 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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3054136098u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3054136098u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					base.__rpc_exec_stage = (__RpcExecStage)0;
					AudioDoneReloading.Play();
					AudioReload.Stop();
					VisibleSawBlade.SetActive(true);
				}
			}
		}

		public void OnOffConditional()
		{
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: 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_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: 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_00ac: Unknown result type (might be due to invalid IL or missing references)
			float num = Plugin.SawTargetRange.Value;
			PlayerControllerB val = null;
			PlayerControllerB[] allPlayerScripts = RoundManager.Instance.playersManager.allPlayerScripts;
			PlayerControllerB[] array = allPlayerScripts;
			foreach (PlayerControllerB val2 in array)
			{
				if (!((Object)(object)val2 == (Object)null) && !val2.isPlayerDead)
				{
					Vector3 val3 = ((Component)this).transform.position + Vector3.up * 1.2f;
					Vector3 position = ((Component)val2.gameplayCamera).transform.position;
					float num2 = Vector3.Distance(val3, position);
					if (!(num2 > Plugin.SawTargetRange.Value) && !Physics.Linecast(val3, position, StartOfRound.Instance.collidersAndRoomMask, (QueryTriggerInteraction)1) && num2 < num)
					{
						num = num2;
						val = val2;
					}
				}
			}
			if ((Object)(object)val != (Object)null && CurrentAmmo > 0)
			{
				if ((Object)(object)TargetPlayer != (Object)(object)val)
				{
				}
				SetTargetPlayerClientRpc(((NetworkBehaviour)val).NetworkObject.NetworkObjectId);
				TurnOnClientRpc(value: true);
			}
			else
			{
				SetTargetPlayerClientRpc(9999999uL);
				TurnOnClientRpc(value: false);
				WindTime = 0f;
				CooldownTime = 0f;
			}
		}

		[ClientRpc]
		public void TurnOnClientRpc(bool value)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: 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_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3337074398u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref value, default(ForPrimitives));
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3337074398u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					base.__rpc_exec_stage = (__RpcExecStage)0;
					On = value;
				}
			}
		}

		[ClientRpc]
		public void SetTargetPlayerClientRpc(ulong netid)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(10035545u, val, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val2, netid);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 10035545u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost))
			{
				return;
			}
			base.__rpc_exec_stage = (__RpcExecStage)0;
			if (netid == 9999999)
			{
				TargetPlayer = null;
				return;
			}
			PlayerControllerB[] allPlayerScripts = RoundManager.Instance.playersManager.allPlayerScripts;
			PlayerControllerB[] array = allPlayerScripts;
			foreach (PlayerControllerB val3 in array)
			{
				if (!((Object)(object)val3 == (Object)null) && !val3.isPlayerDead && ((NetworkBehaviour)val3).NetworkObject.NetworkObjectId == netid)
				{
					TargetPlayer = val3;
				}
			}
		}

		public void AITick()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			facePosition(((Component)TargetPlayer).transform.position);
			if (((NetworkBehaviour)RoundManager.Instance).IsHost && WindTime > Plugin.SawWindupTime.Value && CooldownTime < 0f)
			{
				CooldownTime = Plugin.SawFirerate.Value;
				Fire();
			}
		}

		public void Fire()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: 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)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: 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_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: 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_005e: 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)
			Vector3 val = ((Component)TargetPlayer).transform.position - SawSpawnPoint.position;
			Vector3 normalized = ((Vector3)(ref val)).normalized;
			Quaternion val2 = Quaternion.LookRotation(normalized, Vector3.up);
			GameObject val3 = Object.Instantiate<GameObject>(Plugin.SawPrefab, SawSpawnPoint.position, val2);
			val3.GetComponent<SawProjectileV2>().LaunchForce = normalized * SawLaunchForce;
			val3.GetComponent<SawProjectileV2>().SetScale(((Component)this).transform.localScale.y);
			val3.GetComponent<NetworkObject>().Spawn(false);
			PlayLaunchSoundClientRpc();
			CurrentAmmo--;
		}

		[ClientRpc]
		public void PlayLaunchSoundClientRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: 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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2311595664u, val, (RpcDelivery)0);
					((Ne