Decompiled source of CombatOverhaulREwrite v1.1.8

CombatOverhaulREwrite.dll

Decompiled 5 months ago
using System;
using System.Collections;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text;
using System.Text.RegularExpressions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using CombatOverhaulREwrite.Integrations;
using CombatOverhaulREwrite.System;
using CombatOverhaulREwrite.Utils;
using HarmonyLib;
using JetBrains.Annotations;
using LocalizationManager;
using Microsoft.CodeAnalysis;
using ServerSync;
using TMPro;
using UnityEngine;
using YamlDotNet.Core;
using YamlDotNet.Core.Events;
using YamlDotNet.Core.Tokens;
using YamlDotNet.Helpers;
using YamlDotNet.Serialization;
using YamlDotNet.Serialization.Converters;
using YamlDotNet.Serialization.EventEmitters;
using YamlDotNet.Serialization.NamingConventions;
using YamlDotNet.Serialization.NodeDeserializers;
using YamlDotNet.Serialization.NodeTypeResolvers;
using YamlDotNet.Serialization.ObjectFactories;
using YamlDotNet.Serialization.ObjectGraphTraversalStrategies;
using YamlDotNet.Serialization.ObjectGraphVisitors;
using YamlDotNet.Serialization.Schemas;
using YamlDotNet.Serialization.TypeInspectors;
using YamlDotNet.Serialization.TypeResolvers;
using YamlDotNet.Serialization.Utilities;
using YamlDotNet.Serialization.ValueDeserializers;

[assembly: Guid("4BF548ED-2E83-4EFB-84B4-BA72F517B78A")]
[assembly: ComVisible(false)]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyProduct("CombatOverhaulREwrite")]
[assembly: AssemblyCompany("blacks7ar")]
[assembly: TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")]
[assembly: AssemblyDescription("https://valheim.thunderstore.io/package/blacks7ar/CombatOverhaulREwrite/")]
[assembly: AssemblyTitle("CombatOverhaulREwrite")]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: CompilationRelaxations(8)]
[assembly: AssemblyFileVersion("1.1.8")]
[assembly: AssemblyConfiguration("")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.1.8.0")]
[module: UnverifiableCode]
namespace CombatOverhaulREwrite
{
	[BepInPlugin("blacks7ar.CombatOverhaulREwrite", "CombatOverhaulREwrite", "1.1.8")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BaseUnityPlugin
	{
		private const string modGUID = "blacks7ar.CombatOverhaulREwrite";

		public const string modName = "CombatOverhaulREwrite";

		public const string modAuthor = "blacks7ar";

		public const string modVersion = "1.1.8";

		public const string modLink = "https://valheim.thunderstore.io/package/blacks7ar/CombatOverhaulREwrite/";

		private static string configFileName = "blacks7ar.CombatOverhaulREwrite.cfg";

		private static string configFileFullPath;

		public static readonly ManualLogSource CORLogger;

		private static readonly Harmony _harmony;

		private static readonly ConfigSync _configSync;

		private static ConfigEntry<Toggle> _serverConfigLocked;

		private static bool _hasTerraheim;

		private static bool _hasTerraheimItems;

		private static bool _hasBowPlugin;

		public static bool _hasDualWield;

		public static Plugin _Instance;

		public ConfigEntry<T> config<T>(string group, string name, T value, ConfigDescription description, bool synchronizedConfig = true)
		{
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Expected O, but got Unknown
			ConfigDescription val = new ConfigDescription(description.Description + (synchronizedConfig ? " [Synced with Server]" : " [Not Synced with Server]"), description.AcceptableValues, description.Tags);
			ConfigEntry<T> val2 = ((BaseUnityPlugin)this).Config.Bind<T>(group, name, value, val);
			_configSync.AddConfigEntry<T>(val2).SynchronizedConfig = synchronizedConfig;
			return val2;
		}

		private void ConfigWatcher()
		{
			FileSystemWatcher fileSystemWatcher = new FileSystemWatcher(Paths.ConfigPath, configFileName);
			fileSystemWatcher.Changed += OnConfigChanged;
			fileSystemWatcher.Created += OnConfigChanged;
			fileSystemWatcher.Renamed += OnConfigChanged;
			fileSystemWatcher.IncludeSubdirectories = true;
			fileSystemWatcher.SynchronizingObject = ThreadingHelper.SynchronizingObject;
			fileSystemWatcher.EnableRaisingEvents = true;
		}

		private void OnConfigChanged(object sender, FileSystemEventArgs e)
		{
			if (!File.Exists(configFileFullPath))
			{
				return;
			}
			try
			{
				Logging.LogDebug("OnConfigChanged called..");
				((BaseUnityPlugin)this).Config.Reload();
			}
			catch
			{
				Logging.LogError("There was an issue loading you " + configFileName);
				Logging.LogError("Please check your config entries for spelling and format!");
			}
		}

		public void Awake()
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Expected O, but got Unknown
			Localizer.Load();
			_Instance = this;
			_serverConfigLocked = config("01- ServerSync", "Lock Configuration", Toggle.On, new ConfigDescription("If On, the configuration is locked and can be changed by server admins only.", (AcceptableValueBase)null, Array.Empty<object>()));
			_configSync.AddLockingConfigEntry<Toggle>(_serverConfigLocked);
			ConfigSettings.Init();
			Assembly executingAssembly = Assembly.GetExecutingAssembly();
			_harmony.PatchAll(executingAssembly);
			_hasDualWield = CheckDualWieldMod();
			IntegrateTerraheim();
			IntegrateTerraheimItems();
			CheckBowPlugin();
			ConfigWatcher();
		}

		private void OnDestroy()
		{
			((BaseUnityPlugin)this).Config.Save();
		}

		private void IntegrateTerraheim()
		{
			if (Harmony.HasAnyPatches("DasSauerkraut.Terraheim"))
			{
				_hasTerraheim = true;
				Logging.LogInfo("Terraheim mod found..");
				UnpatchPostfixes(AccessTools.Method(typeof(Player), "GetJogSpeedFactor", (Type[])null, (Type[])null));
			}
		}

		private void IntegrateTerraheimItems()
		{
			if (Harmony.HasAnyPatches("DasSauerkraut.TerraheimItems"))
			{
				_hasTerraheimItems = true;
				Logging.LogInfo("TerraheimItems mod found..");
				TerraheimUtils.AddTerraheimData();
			}
		}

		private void CheckBowPlugin()
		{
			if (Harmony.HasAnyPatches("blacks7ar.BowPlugin"))
			{
				_hasBowPlugin = true;
				Logging.LogInfo("BowPlugin mod found..");
				UnpatchPostfixes(AccessTools.Method(typeof(Player), "AlwaysRotateCamera", (Type[])null, (Type[])null));
			}
		}

		private static bool CheckDualWieldMod()
		{
			if (!Chainloader.PluginInfos.ContainsKey("org.bepinex.plugins.dualwield"))
			{
				return false;
			}
			Logging.LogInfo("DualWield Skill found! Applying patch..");
			return true;
		}

		private static void UnpatchPostfixes(MethodInfo methodInfo)
		{
			foreach (Patch item in Harmony.GetPatchInfo((MethodBase)methodInfo).Postfixes.Where((Patch postfix) => postfix.owner == "blacks7ar.CombatOverhaulREwrite"))
			{
				Logging.LogInfo("Unpatching " + item.owner + ": " + item.PatchMethod.Name);
				_harmony.Unpatch((MethodBase)methodInfo, (HarmonyPatchType)2, item.owner);
			}
		}

		static Plugin()
		{
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Expected O, but got Unknown
			string configPath = Paths.ConfigPath;
			char directorySeparatorChar = Path.DirectorySeparatorChar;
			configFileFullPath = configPath + directorySeparatorChar + configFileName;
			CORLogger = Logger.CreateLogSource("CORE");
			_harmony = new Harmony("blacks7ar.CombatOverhaulREwrite");
			_configSync = new ConfigSync("blacks7ar.CombatOverhaulREwrite")
			{
				DisplayName = "CombatOverhaulREwrite",
				CurrentVersion = "1.1.8",
				MinimumRequiredVersion = "1.1.8",
				ModRequired = true
			};
		}
	}
}
namespace CombatOverhaulREwrite.Utils
{
	public static class ConfigSettings
	{
		private class ConfigurationManagerAttributes
		{
			[UsedImplicitly]
			public bool? ShowRangeAsPercent;
		}

		public static ConfigEntry<Toggle> EnableNegativeStamina;

		public static ConfigEntry<float> MinimumStamina;

		public static ConfigEntry<Toggle> EnableCameraCharacterRotation;

		public static ConfigEntry<float> DefaultFlankingAngle;

		public static ConfigEntry<Toggle> EnableNewArmorFormula;

		public static ConfigEntry<bool> EnableCustomFlankingBonus;

		public static ConfigEntry<bool> EnableCustomCriticalBonus;

		public static ConfigEntry<float> StaggerResetTimer;

		public static ConfigEntry<float> CounterDamageBonus;

		public static ConfigEntry<float> BowsMovementSpeedModifier;

		public static ConfigEntry<float> DrawSpeedSkillFactorMultiplier;

		public static ConfigEntry<float> BaseDrawSpeed;

		public static ConfigEntry<float> BowsCriticalBonus;

		public static ConfigEntry<float> BowsStaggerBonus;

		public static ConfigEntry<float> ReloadSpeedSkillFactorMultiplier;

		public static ConfigEntry<float> BaseReloadSpeed;

		public static ConfigEntry<float> CrossbowsCriticalBonus;

		public static ConfigEntry<float> CrossbowsStaggerBonus;

		public static ConfigEntry<float> SwordsAttackRotationModifier;

		public static ConfigEntry<float> SwordsSpecialAttackRotationModifier;

		public static ConfigEntry<float> SwordsCriticalBonus;

		public static ConfigEntry<float> SwordsFlankingBonus;

		public static ConfigEntry<float> SwordsStaggerBonus;

		public static ConfigEntry<float> SwordsSpecialStaggerBonus;

		public static ConfigEntry<float> SwordsSpecialDamage;

		public static ConfigEntry<float> KnivesAttackRotationModifier;

		public static ConfigEntry<float> KnivesSpecialAttackRotationModifier;

		public static ConfigEntry<float> KnivesCriticalBonus;

		public static ConfigEntry<float> KnivesFlankingBonus;

		public static ConfigEntry<float> KnivesFlankingAngle;

		public static ConfigEntry<float> KnivesStaggerBonus;

		public static ConfigEntry<float> KnivesSpecialStaggerBonus;

		public static ConfigEntry<float> DualKnivesAttackRotationModifier;

		public static ConfigEntry<float> DualKnivesSpecialAttackRotationModifier;

		public static ConfigEntry<float> DualKnivesCriticalBonus;

		public static ConfigEntry<float> DualKnivesFlankingBonus;

		public static ConfigEntry<float> DualKnivesFlankingAngle;

		public static ConfigEntry<float> DualKnivesStaggerBonus;

		public static ConfigEntry<float> DualKnivesSpecialStaggerBonus;

		public static ConfigEntry<float> ClubsAttackRotationModifier;

		public static ConfigEntry<float> ClubsSpecialAttackRotationModifier;

		public static ConfigEntry<float> ClubsCriticalBonus;

		public static ConfigEntry<float> ClubsFlankingBonus;

		public static ConfigEntry<float> ClubsStaggerBonus;

		public static ConfigEntry<float> ClubsSpecialStaggerBonus;

		public static ConfigEntry<float> SledgehammerAttackRotationModifier;

		public static ConfigEntry<float> SledgehammerCriticalBonus;

		public static ConfigEntry<float> SledgehammerStaggerBonus;

		public static ConfigEntry<float> PolearmsAttackRotationModifier;

		public static ConfigEntry<float> PolearmsSpecialAttackRotationModifier;

		public static ConfigEntry<float> PolearmsCriticalBonus;

		public static ConfigEntry<float> PolearmsFlankingBonus;

		public static ConfigEntry<float> PolearmsStaggerBonus;

		public static ConfigEntry<float> PolearmsSpecialStaggerBonus;

		public static ConfigEntry<float> SpearsAttackRotationModifier;

		public static ConfigEntry<float> SpearsSpecialAttackRotationModifier;

		public static ConfigEntry<float> SpearsCriticalBonus;

		public static ConfigEntry<float> SpearsFlankingBonus;

		public static ConfigEntry<float> SpearsStaggerBonus;

		public static ConfigEntry<float> SpearsSpecialStaggerBonus;

		public static ConfigEntry<float> ParryTimeWindow;

		public static ConfigEntry<float> BlockingStaminaRegenModifier;

		public static ConfigEntry<Toggle> EnableRemoteParry;

		public static ConfigEntry<float> ShieldProtectionArc;

		public static ConfigEntry<float> TowerShieldProtectionArc;

		public static ConfigEntry<float> AxesAttackRotationModifier;

		public static ConfigEntry<float> AxesCriticalBonus;

		public static ConfigEntry<float> AxesFlankingBonus;

		public static ConfigEntry<float> AxesStaggerBonus;

		public static ConfigEntry<Toggle> EnableBattleaxesAttackChaining;

		public static ConfigEntry<float> BattleaxesMovementSpeedModifier;

		public static ConfigEntry<float> BattleaxesAttackRotationModifier;

		public static ConfigEntry<float> BattleaxesSpecialAttackRotationModifier;

		public static ConfigEntry<float> BattleaxesCriticalBonus;

		public static ConfigEntry<float> BattleaxesFlankingBonus;

		public static ConfigEntry<float> BattleaxesStaggerBonus;

		public static ConfigEntry<float> BattleaxesSpecialStaggerBonus;

		public static ConfigEntry<float> PickaxesAttackRotationModifier;

		public static ConfigEntry<float> PickaxesCriticalBonus;

		public static ConfigEntry<float> PickaxesFlankingBonus;

		public static ConfigEntry<float> PickaxesStaggerBonus;

		public static ConfigEntry<Toggle> EnableSneakAttackScaling;

		public static ConfigEntry<float> MeleeSneakAttackModifier;

		public static ConfigEntry<float> RangeSneakAttackModifier;

		public static ConfigEntry<Toggle> EnableGreatswordAttackChaining;

		public static ConfigEntry<float> GreatswordMovementSpeedModifier;

		public static ConfigEntry<float> GreatswordAttackRotationModifier;

		public static ConfigEntry<float> GreatswordSpecialAttackRotationModifier;

		public static ConfigEntry<float> GreatswordCriticalBonus;

		public static ConfigEntry<float> GreatswordFlankingBonus;

		public static ConfigEntry<float> GreatswordStaggerBonus;

		public static ConfigEntry<float> GreatswordSpecialStaggerBonus;

		public static ConfigEntry<Toggle> EnableShieldAlteration;

		private const string GeneralSection = "02- General";

		private const string BowsSection = "05- Bows";

		private const string SwordsSection = "17- Swords";

		private const string KnivesSection = "10- Knives";

		private const string ClubsSection = "06- Clubs";

		private const string SledgehammerSection = "14- Sledgehammer";

		private const string PolearmsSection = "12- Polearms";

		private const string SpearsSection = "16- Spears";

		private const string ShieldsSection = "13- Shields";

		private const string AxesSection = "03- Axes";

		private const string BattleaxesSection = "04- Battleaxes";

		private const string PickaxesSection = "11- Pickaxes";

		private const string SneakSection = "15- Sneak";

		private const string DualKnivesSection = "08- DualKnives";

		private const string CrossbowsSection = "07- Crossbows";

		private const string GreatswordSection = "09- Greatsword";

		public static void Init()
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Expected O, but got Unknown
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Expected O, but got Unknown
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Expected O, but got Unknown
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Expected O, but got Unknown
			//IL_0100: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: Expected O, but got Unknown
			//IL_012b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0136: Expected O, but got Unknown
			//IL_0156: Unknown result type (might be due to invalid IL or missing references)
			//IL_0161: Expected O, but got Unknown
			//IL_0193: Unknown result type (might be due to invalid IL or missing references)
			//IL_019e: Expected O, but got Unknown
			//IL_01d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01db: Expected O, but got Unknown
			//IL_01fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0206: Expected O, but got Unknown
			//IL_024d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0258: Expected O, but got Unknown
			//IL_028a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0295: 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_0304: Unknown result type (might be due to invalid IL or missing references)
			//IL_030f: Expected O, but got Unknown
			//IL_0356: Unknown result type (might be due to invalid IL or missing references)
			//IL_0361: Expected O, but got Unknown
			//IL_03a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b3: Expected O, but got Unknown
			//IL_03fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0405: Expected O, but got Unknown
			//IL_0437: Unknown result type (might be due to invalid IL or missing references)
			//IL_0442: Expected O, but got Unknown
			//IL_0474: Unknown result type (might be due to invalid IL or missing references)
			//IL_047f: Expected O, but got Unknown
			//IL_04c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d1: Expected O, but got Unknown
			//IL_0518: Unknown result type (might be due to invalid IL or missing references)
			//IL_0523: Expected O, but got Unknown
			//IL_0555: Unknown result type (might be due to invalid IL or missing references)
			//IL_0560: Expected O, but got Unknown
			//IL_0592: Unknown result type (might be due to invalid IL or missing references)
			//IL_059d: Expected O, but got Unknown
			//IL_05e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ef: Expected O, but got Unknown
			//IL_0621: Unknown result type (might be due to invalid IL or missing references)
			//IL_062c: Expected O, but got Unknown
			//IL_065e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0669: Expected O, but got Unknown
			//IL_06b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_06bb: Expected O, but got Unknown
			//IL_0702: Unknown result type (might be due to invalid IL or missing references)
			//IL_070d: Expected O, but got Unknown
			//IL_0754: Unknown result type (might be due to invalid IL or missing references)
			//IL_075f: Expected O, but got Unknown
			//IL_07a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_07b1: Expected O, but got Unknown
			//IL_07f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0803: Expected O, but got Unknown
			//IL_0835: Unknown result type (might be due to invalid IL or missing references)
			//IL_0840: Expected O, but got Unknown
			//IL_0872: Unknown result type (might be due to invalid IL or missing references)
			//IL_087d: Expected O, but got Unknown
			//IL_08c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_08cf: Expected O, but got Unknown
			//IL_0901: Unknown result type (might be due to invalid IL or missing references)
			//IL_090c: Expected O, but got Unknown
			//IL_0953: Unknown result type (might be due to invalid IL or missing references)
			//IL_095e: Expected O, but got Unknown
			//IL_0990: Unknown result type (might be due to invalid IL or missing references)
			//IL_099b: Expected O, but got Unknown
			//IL_09cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_09d8: Expected O, but got Unknown
			//IL_0a1f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a2a: Expected O, but got Unknown
			//IL_0a71: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a7c: Expected O, but got Unknown
			//IL_0aae: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ab9: Expected O, but got Unknown
			//IL_0aeb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0af6: Expected O, but got Unknown
			//IL_0b3d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b48: Expected O, but got Unknown
			//IL_0b7a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b85: Expected O, but got Unknown
			//IL_0bcc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bd7: Expected O, but got Unknown
			//IL_0c09: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c14: Expected O, but got Unknown
			//IL_0c46: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c51: Expected O, but got Unknown
			//IL_0c83: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c8e: Expected O, but got Unknown
			//IL_0cd5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ce0: Expected O, but got Unknown
			//IL_0d27: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d32: Expected O, but got Unknown
			//IL_0d79: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d84: Expected O, but got Unknown
			//IL_0db6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0dc1: Expected O, but got Unknown
			//IL_0e08: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e13: Expected O, but got Unknown
			//IL_0e45: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e50: Expected O, but got Unknown
			//IL_0e70: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e7b: Expected O, but got Unknown
			//IL_0ec2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ecd: Expected O, but got Unknown
			//IL_0eff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f0a: Expected O, but got Unknown
			//IL_0f3c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f47: Expected O, but got Unknown
			//IL_0f8e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f99: Expected O, but got Unknown
			//IL_0fb9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0fc4: Expected O, but got Unknown
			//IL_0ff6: Unknown result type (might be due to invalid IL or missing references)
			//IL_1001: Expected O, but got Unknown
			//IL_1048: Unknown result type (might be due to invalid IL or missing references)
			//IL_1053: Expected O, but got Unknown
			//IL_109a: Unknown result type (might be due to invalid IL or missing references)
			//IL_10a5: Expected O, but got Unknown
			//IL_10d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_10e2: Expected O, but got Unknown
			//IL_1114: Unknown result type (might be due to invalid IL or missing references)
			//IL_111f: Expected O, but got Unknown
			//IL_1151: Unknown result type (might be due to invalid IL or missing references)
			//IL_115c: Expected O, but got Unknown
			//IL_118e: Unknown result type (might be due to invalid IL or missing references)
			//IL_1199: Expected O, but got Unknown
			//IL_11e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_11eb: Expected O, but got Unknown
			//IL_121d: Unknown result type (might be due to invalid IL or missing references)
			//IL_1228: Expected O, but got Unknown
			//IL_125a: Unknown result type (might be due to invalid IL or missing references)
			//IL_1265: Expected O, but got Unknown
			//IL_1297: Unknown result type (might be due to invalid IL or missing references)
			//IL_12a2: Expected O, but got Unknown
			//IL_12c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_12cd: Expected O, but got Unknown
			//IL_12ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_130a: Expected O, but got Unknown
			//IL_133c: Unknown result type (might be due to invalid IL or missing references)
			//IL_1347: Expected O, but got Unknown
			//IL_1379: Unknown result type (might be due to invalid IL or missing references)
			//IL_1384: Expected O, but got Unknown
			//IL_13b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_13c1: Expected O, but got Unknown
			//IL_13f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_13fe: Expected O, but got Unknown
			//IL_1445: Unknown result type (might be due to invalid IL or missing references)
			//IL_1450: Expected O, but got Unknown
			//IL_1482: Unknown result type (might be due to invalid IL or missing references)
			//IL_148d: Expected O, but got Unknown
			//IL_14d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_14df: Expected O, but got Unknown
			//IL_1511: Unknown result type (might be due to invalid IL or missing references)
			//IL_151c: Expected O, but got Unknown
			//IL_154e: Unknown result type (might be due to invalid IL or missing references)
			//IL_1559: Expected O, but got Unknown
			//IL_15a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_15ab: Expected O, but got Unknown
			//IL_15f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_15fd: Expected O, but got Unknown
			//IL_1644: Unknown result type (might be due to invalid IL or missing references)
			//IL_164f: Expected O, but got Unknown
			//IL_166f: Unknown result type (might be due to invalid IL or missing references)
			//IL_167a: Expected O, but got Unknown
			//IL_16ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_16b7: Expected O, but got Unknown
			//IL_16fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_1709: Expected O, but got Unknown
			//IL_1750: Unknown result type (might be due to invalid IL or missing references)
			//IL_175b: Expected O, but got Unknown
			//IL_178d: Unknown result type (might be due to invalid IL or missing references)
			//IL_1798: Expected O, but got Unknown
			//IL_17ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_17d5: Expected O, but got Unknown
			//IL_1807: Unknown result type (might be due to invalid IL or missing references)
			//IL_1812: Expected O, but got Unknown
			//IL_1844: Unknown result type (might be due to invalid IL or missing references)
			//IL_184f: Expected O, but got Unknown
			EnableNegativeStamina = Plugin._Instance.config("02- General", "Enable Negative Stamina", Toggle.On, new ConfigDescription("Enable negative stamina values - this option is here mostly for compatibillity reasons\nVanilla: false\nRecommended: true", (AcceptableValueBase)null, Array.Empty<object>()));
			MinimumStamina = Plugin._Instance.config("02- General", "Minimum Stamina", -50f, new ConfigDescription("Cap on player's negative stamina\nVanilla: 0\nRecommended: -50", (AcceptableValueBase)(object)new AcceptableValueRange<float>(-100f, 0f), Array.Empty<object>()));
			EnableCameraCharacterRotation = Plugin._Instance.config("02- General", "Enable Camera Character Rotation", Toggle.On, new ConfigDescription("Enable the feature allowing for rotating the character with camera while wielding a weapon\nVanilla: false\nRecommended: true", (AcceptableValueBase)null, Array.Empty<object>()));
			DefaultFlankingAngle = Plugin._Instance.config("02- General", "Flanking Angle", 0.5f, new ConfigDescription("Arc behind the enemy that the player should be positioned in to apply the flanking bonus when attacking with any weapon except knife\nVanilla: 0\nRecommended: 0 = 180°, 0.259 = 150°, 0.5 = 120°, 0.707 = 90°, 0.866 = 60°, 0.966 = 30°, 1 = 0°", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), new object[1]
			{
				new ConfigurationManagerAttributes
				{
					ShowRangeAsPercent = false
				}
			}));
			EnableNewArmorFormula = Plugin._Instance.config("02- General", "Enable New Armor Formula", Toggle.On, new ConfigDescription("Enable new armour formula (linear damage reduction / damage taken)\nVanilla: false\nRecommended: true", (AcceptableValueBase)null, Array.Empty<object>()));
			EnableCustomFlankingBonus = Plugin._Instance.config("02- General", "Enable Custom Flanking Bonus", value: false, new ConfigDescription("Enable custom flanking bonus values for all weapons, configurable below\nVanilla: false\nRecommended: false", (AcceptableValueBase)null, Array.Empty<object>()));
			EnableCustomCriticalBonus = Plugin._Instance.config("02- General", "Enable Custom Critical Bonus", value: false, new ConfigDescription("Enable custom critical damage multiplier bonuses for all weapons, configurable below\nVanilla: false\nRecommended: false", (AcceptableValueBase)null, Array.Empty<object>()));
			StaggerResetTimer = Plugin._Instance.config("02- General", "Stagger Reset Timer", 4f, new ConfigDescription("Time after which accumulated stagger damage resets on enemies or the player\nVanilla: 3\nRecommended: 4", (AcceptableValueBase)(object)new AcceptableValueRange<float>(3f, 5f), Array.Empty<object>()));
			CounterDamageBonus = Plugin._Instance.config("02- General", "Counter Damage Bonus", 1.2f, new ConfigDescription("Damage bonus applied when striking an enemy during their attack animation with a piercing weapon\nVanilla: 1\nRecommended: 1.2", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 1.4f), Array.Empty<object>()));
			EnableShieldAlteration = Plugin._Instance.config("02- General", "Enable Blocking Alteration", Toggle.Off, new ConfigDescription("If On, you can only block an attack using tower shields.\nIf you block an attack using round shield or any weapon\nAnd your block is lower than the attack you'll get staggered", (AcceptableValueBase)null, Array.Empty<object>()));
			BowsMovementSpeedModifier = Plugin._Instance.config("05- Bows", "Movement Speed Modifier", 0.5f, new ConfigDescription("Movement speed multiplier applied while drawing the bow\nVanilla: 1\nRecommended: 0.75, 0.5, 0.25", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), new object[1]
			{
				new ConfigurationManagerAttributes
				{
					ShowRangeAsPercent = false
				}
			}));
			DrawSpeedSkillFactorMultiplier = Plugin._Instance.config("05- Bows", "Draw Speed Skill Factor Multiplier", 1f, new ConfigDescription("Multiplier applied to bow's draw speed scaling\nRecommended: 1, 1.5, 2.33", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 10f), Array.Empty<object>()));
			BaseDrawSpeed = Plugin._Instance.config("05- Bows", "Base Draw Speed", 0f, new ConfigDescription("Subtrahend, in seconds, applied to base draw speed time\nVanilla: 0\nRecommended: 0, 0.5, 1", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 2f), Array.Empty<object>()));
			BowsCriticalBonus = Plugin._Instance.config("05- Bows", "Critical Bonus", 2f, new ConfigDescription("Multiplier to bonus damage on staggered enemies with a bow\nVanilla: 2\nRecommended: 1.4", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 3f), Array.Empty<object>()));
			BowsStaggerBonus = Plugin._Instance.config("05- Bows", "Stagger Bonus", 0.3f, new ConfigDescription("Part of the bow's attack damage that counts towards staggering enemies\nVanilla: 1\nRecommended: 0.3", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), new object[1]
			{
				new ConfigurationManagerAttributes
				{
					ShowRangeAsPercent = false
				}
			}));
			SwordsAttackRotationModifier = Plugin._Instance.config("17- Swords", "Attack Rotation Modifier", 0.4f, new ConfigDescription("Multiplier for turn speed during swords' regular attack\nVanilla: 0.3\nRecommended: 0.4", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), new object[1]
			{
				new ConfigurationManagerAttributes
				{
					ShowRangeAsPercent = false
				}
			}));
			SwordsSpecialAttackRotationModifier = Plugin._Instance.config("17- Swords", "Special Attack Rotation Modifier", 0.3f, new ConfigDescription("Multiplier for turn speed during swords' special attack\nVanilla: 0\nRecommended: 0.3", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), new object[1]
			{
				new ConfigurationManagerAttributes
				{
					ShowRangeAsPercent = false
				}
			}));
			SwordsCriticalBonus = Plugin._Instance.config("17- Swords", "Critical Bonus", 2.2f, new ConfigDescription("Multiplier to bonus damage on staggered enemies when attacking with a sword\nVanilla: 2\nRecommended: 2.2", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 3f), Array.Empty<object>()));
			SwordsFlankingBonus = Plugin._Instance.config("17- Swords", "Flanking Bonus", 1f, new ConfigDescription("Multiplier to bonus damage when striking an enemy from behind with a sword\nVanilla: 1\nRecommended: 1", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 10f), Array.Empty<object>()));
			SwordsStaggerBonus = Plugin._Instance.config("17- Swords", "Stagger Bonus", 0.7f, new ConfigDescription("Part of the sword's attack damage that counts towards staggering enemies\nVanilla: 1\nRecommended: 0.7", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), new object[1]
			{
				new ConfigurationManagerAttributes
				{
					ShowRangeAsPercent = false
				}
			}));
			SwordsSpecialStaggerBonus = Plugin._Instance.config("17- Swords", "Special Stagger Bonus", 0.7f, new ConfigDescription("Part of the sword's special attack damage that counts towards staggering enemies\nVanilla: 1\nRecommended: 0.7", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), new object[1]
			{
				new ConfigurationManagerAttributes
				{
					ShowRangeAsPercent = false
				}
			}));
			SwordsSpecialDamage = Plugin._Instance.config("17- Swords", "Special Damage", 2.5f, new ConfigDescription("Damage multiplier for sword's special attack\nVanilla: 3\nRecommended: 2.5", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 3f), Array.Empty<object>()));
			KnivesAttackRotationModifier = Plugin._Instance.config("10- Knives", "Attack Rotation Modifier", 2f, new ConfigDescription("Multiplier for turn speed during knives' regular attack\nVanilla: 1\nRecommended: 2", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 5f), Array.Empty<object>()));
			KnivesSpecialAttackRotationModifier = Plugin._Instance.config("10- Knives", "Special Attack Rotation Modifier", 0.3f, new ConfigDescription("Multiplier for turn speed during knives' special attack\nVanilla: 0\nRecommended: 0.3", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), new object[1]
			{
				new ConfigurationManagerAttributes
				{
					ShowRangeAsPercent = false
				}
			}));
			KnivesCriticalBonus = Plugin._Instance.config("10- Knives", "Critical Bonus", 3f, new ConfigDescription("Multiplier to bonus damage on staggered enemies when attacking with a knife\nVanilla: 2\nRecommended: 3", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 3f), Array.Empty<object>()));
			KnivesFlankingBonus = Plugin._Instance.config("10- Knives", "Flanking Bonus", 2f, new ConfigDescription("Multiplier to bonus damage when striking an enemy from behind with a knife\nVanilla: 1\nRecommended: 2", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 10f), Array.Empty<object>()));
			KnivesFlankingAngle = Plugin._Instance.config("10- Knives", "Flanking Angle", 0.5f, new ConfigDescription("Arc behind the enemy that the player should be positioned in to apply the flanking bonus when attacking with a knife\nVanilla: 0\nRecommended: 0 = 180°, 0.259 = 150°, 0.5 = 120°, 0.707 = 90°, 0.866 = 60°, 0.966 = 30°, 1 = 0°", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), new object[1]
			{
				new ConfigurationManagerAttributes
				{
					ShowRangeAsPercent = false
				}
			}));
			KnivesStaggerBonus = Plugin._Instance.config("10- Knives", "Stagger Bonus", 1f, new ConfigDescription("Part of the knife's attack damage that counts towards staggering enemies\nVanilla: 1\nRecommended: 1", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), new object[1]
			{
				new ConfigurationManagerAttributes
				{
					ShowRangeAsPercent = false
				}
			}));
			KnivesSpecialStaggerBonus = Plugin._Instance.config("10- Knives", "Special Stagger Bonus", 1f, new ConfigDescription("Part of the knife's special attack damage that counts towards staggering enemies\nVanilla: 1\nRecommended: 1", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), new object[1]
			{
				new ConfigurationManagerAttributes
				{
					ShowRangeAsPercent = false
				}
			}));
			ClubsAttackRotationModifier = Plugin._Instance.config("06- Clubs", "Attack Rotation Modifier", 0.4f, new ConfigDescription("Multiplier for turn speed during clubs' regular attack\nVanilla: 0.3\nRecommended: 0.4", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), new object[1]
			{
				new ConfigurationManagerAttributes
				{
					ShowRangeAsPercent = false
				}
			}));
			ClubsSpecialAttackRotationModifier = Plugin._Instance.config("06- Clubs", "Special Attack Rotation Modifier", 0.3f, new ConfigDescription("Multiplier for turn speed during clubs' special attack\nVanilla: 0\nRecommended: 0.3", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), new object[1]
			{
				new ConfigurationManagerAttributes
				{
					ShowRangeAsPercent = false
				}
			}));
			ClubsCriticalBonus = Plugin._Instance.config("06- Clubs", "Critical Bonus", 2f, new ConfigDescription("Multiplier to bonus damage on staggered enemies when attacking with a club\nVanilla: 2\nRecommended: 1.4", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 3f), Array.Empty<object>()));
			ClubsFlankingBonus = Plugin._Instance.config("06- Clubs", "Flanking Bonus", 1.2f, new ConfigDescription("Multiplier to bonus damage when striking an enemy from behind with a club\nVanilla: 1\nRecommended: 1.2", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 10f), Array.Empty<object>()));
			ClubsStaggerBonus = Plugin._Instance.config("06- Clubs", "Stagger Bonus", 1f, new ConfigDescription("Part of the club's attack damage that counts towards staggering enemies\nVanilla: 1\nRecommended: 1", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), new object[1]
			{
				new ConfigurationManagerAttributes
				{
					ShowRangeAsPercent = false
				}
			}));
			ClubsSpecialStaggerBonus = Plugin._Instance.config("06- Clubs", "Special Stagger Bonus", 1f, new ConfigDescription("Part of the club's special attack damage that counts towards staggering enemies\nVanilla: 2\nRecommended: 1", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 2f), Array.Empty<object>()));
			SledgehammerAttackRotationModifier = Plugin._Instance.config("14- Sledgehammer", "Attack Rotation Modifier", 0.3f, new ConfigDescription("Multiplier for turn speed during sledgehammers' regular attack\nVanilla: 0\nRecommended: 0.3", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), new object[1]
			{
				new ConfigurationManagerAttributes
				{
					ShowRangeAsPercent = false
				}
			}));
			SledgehammerCriticalBonus = Plugin._Instance.config("14- Sledgehammer", "Crtitical Bonus", 2f, new ConfigDescription("Multiplier to bonus damage on staggered enemies when attacking with a sledgehammer\nVanilla: 2\nRecommended: 1.4", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 3f), Array.Empty<object>()));
			SledgehammerStaggerBonus = Plugin._Instance.config("14- Sledgehammer", "Stagger Bonus", 1.6f, new ConfigDescription("Part of the sledge's attack damage that counts towards staggering enemies\nVanilla: 2\nRecommended: 1.6", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 2f), Array.Empty<object>()));
			PolearmsAttackRotationModifier = Plugin._Instance.config("12- Polearms", "Attack Rotatino Modifier", 0.5f, new ConfigDescription("Multiplier for turn speed during polearms' regular attack\nVanilla: 0.5\nRecommended: 0.5", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), new object[1]
			{
				new ConfigurationManagerAttributes
				{
					ShowRangeAsPercent = false
				}
			}));
			PolearmsSpecialAttackRotationModifier = Plugin._Instance.config("12- Polearms", "Special Attack Rotation Modifier", 0.2f, new ConfigDescription("Multiplier for turn speed during polearms' special attack\nVanilla: 0.2\nRecommended: 0.2", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), new object[1]
			{
				new ConfigurationManagerAttributes
				{
					ShowRangeAsPercent = false
				}
			}));
			PolearmsCriticalBonus = Plugin._Instance.config("12- Polearms", "Critical Bonus", 2f, new ConfigDescription("Multiplier to bonus damage on staggered enemies when attacking with a polearm\nVanilla: 2\nRecommended: 2", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 3f), Array.Empty<object>()));
			PolearmsFlankingBonus = Plugin._Instance.config("12- Polearms", "Flanking Bonus", 1.2f, new ConfigDescription("Multiplier to bonus damage when striking an enemy from behind with a polearm\nVanilla: 1\nRecommended: 1.5", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 10f), Array.Empty<object>()));
			PolearmsStaggerBonus = Plugin._Instance.config("12- Polearms", "Stagger Bonus", 0.8f, new ConfigDescription("Part of the polearm's attack damage that counts towards staggering enemies\nVanilla: 1\nRecommended: 0.8", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), new object[1]
			{
				new ConfigurationManagerAttributes
				{
					ShowRangeAsPercent = false
				}
			}));
			PolearmsSpecialStaggerBonus = Plugin._Instance.config("12- Polearms", "Speical Stagger Bonus", 1.4f, new ConfigDescription("Part of the polearm's special attack damage that counts towards staggering enemies\nVanilla: 6\nRecommended: 1.4", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 6f), Array.Empty<object>()));
			SpearsAttackRotationModifier = Plugin._Instance.config("16- Spears", "Attack Rotation Modifier", 0.3f, new ConfigDescription("Multiplier for turn speed during spears' regular attack\nVanilla: 0.2\nRecommended: 0.3", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), new object[1]
			{
				new ConfigurationManagerAttributes
				{
					ShowRangeAsPercent = false
				}
			}));
			SpearsSpecialAttackRotationModifier = Plugin._Instance.config("16- Spears", "Special Attack Rotation Modifier", 5f, new ConfigDescription("Multiplier for turn speed during spears' special attack\nVanilla: 5\nRecommended: 5", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 10f), Array.Empty<object>()));
			SpearsCriticalBonus = Plugin._Instance.config("16- Spears", "Critical Bonus", 2f, new ConfigDescription("Multiplier to bonus damage on staggered enemies when attacking with a spear\nVanilla: 2\nRecommended: 2", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 3f), Array.Empty<object>()));
			SpearsFlankingBonus = Plugin._Instance.config("16- Spears", "Flanking Bonus", 1.2f, new ConfigDescription("Multiplier to bonus damage when striking an enemy from behind with a spear\nVanilla: 1\nRecommended: 1.2", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 10f), Array.Empty<object>()));
			SpearsStaggerBonus = Plugin._Instance.config("16- Spears", "Stagger Bonus", 0.7f, new ConfigDescription("Part of the spear's attack damage that counts towards staggering enemies\nVanilla: 1\nRecommended: 0.7", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), new object[1]
			{
				new ConfigurationManagerAttributes
				{
					ShowRangeAsPercent = false
				}
			}));
			SpearsSpecialStaggerBonus = Plugin._Instance.config("16- Spears", "Special Stagger Bonus", 1f, new ConfigDescription("Part of the spear's special attack damage that counts towards staggering enemies\nVanilla: 1\nRecommended: 1", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), new object[1]
			{
				new ConfigurationManagerAttributes
				{
					ShowRangeAsPercent = false
				}
			}));
			ParryTimeWindow = Plugin._Instance.config("13- Shields", "Parry Time Windows", 0.13f, new ConfigDescription("Length of parry time window in seconds\nVanilla: 0.25\nRecommended: 0.25, 0.13, 0.1", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), new object[1]
			{
				new ConfigurationManagerAttributes
				{
					ShowRangeAsPercent = false
				}
			}));
			ShieldProtectionArc = Plugin._Instance.config("13- Shields", "Shield Protection Arc", 0.5f, new ConfigDescription("Shield protection arc\nVanilla: 0\nRecommended: 0 = 180°, 0.259 = 150°, 0.5 = 120°, 0.707 = 90°, 0.866 = 60°, 0.966 = 30°, 1 = 0°", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>()));
			TowerShieldProtectionArc = Plugin._Instance.config("13- Shields", "Tower Shield Protection Arc", 0.259f, new ConfigDescription("Shield protection arc\nVanilla: 0\nRecommended: 0 = 180°, 0.259 = 150°, 0.5 = 120°, 0.707 = 90°, 0.866 = 60°, 0.966 = 30°, 1 = 0°", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), new object[1]
			{
				new ConfigurationManagerAttributes
				{
					ShowRangeAsPercent = false
				}
			}));
			BlockingStaminaRegenModifier = Plugin._Instance.config("13- Shields", "Blocking Stamina Regen Modifier", 0.2f, new ConfigDescription("Multiplier to stamina regen while blocking\nVanilla: 0.8\nRecommended: 0.2", (AcceptableValueBase)(object)new AcceptableValueRange<float>(-1f, 1f), Array.Empty<object>()));
			EnableRemoteParry = Plugin._Instance.config("13- Shields", "Enable Remote Parry", Toggle.Off, new ConfigDescription("Allow staggering enemies on parrying their projectile attacks\nVanilla: true\nRecommended: false", (AcceptableValueBase)null, Array.Empty<object>()));
			AxesAttackRotationModifier = Plugin._Instance.config("03- Axes", "Attack Rotation Modifier", 0.4f, new ConfigDescription("Multiplier for turn speed during axes' regular attack\nVanilla: 0.3\nRecommended: 0.4", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), new object[1]
			{
				new ConfigurationManagerAttributes
				{
					ShowRangeAsPercent = false
				}
			}));
			AxesCriticalBonus = Plugin._Instance.config("03- Axes", "Critical Bonus", 2f, new ConfigDescription("Multiplier to bonus damage on staggered enemies when attacking with an axe\nVanilla: 2\nRecommended: 1.4", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 3f), Array.Empty<object>()));
			AxesFlankingBonus = Plugin._Instance.config("03- Axes", "Flanking Bonus", 1.2f, new ConfigDescription("Multiplier to bonus damage when striking an enemy from behind with an axe\nVanilla: 1\nRecommended: 1.2", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 10f), Array.Empty<object>()));
			AxesStaggerBonus = Plugin._Instance.config("03- Axes", "Stagger Bonus", 0.8f, new ConfigDescription("Part of the axe's attack damage that counts towards staggering enemies\nVanilla: 1\nRecommended: 0.8", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), new object[1]
			{
				new ConfigurationManagerAttributes
				{
					ShowRangeAsPercent = false
				}
			}));
			EnableBattleaxesAttackChaining = Plugin._Instance.config("04- Battleaxes", "Enable Attack Chaining", Toggle.On, new ConfigDescription("Enable the ability to chain 2nd and 3rd attack indefinitely\nVanilla: false\nRecommended: true", (AcceptableValueBase)null, Array.Empty<object>()));
			BattleaxesMovementSpeedModifier = Plugin._Instance.config("04- Battleaxes", "Movement Speed Modifier", -0.1f, new ConfigDescription("Modifier to player's movement speed applied while wielding a battleaxe\nVanilla: -0.2\nRecommended: -0.1", (AcceptableValueBase)(object)new AcceptableValueRange<float>(-1f, 0f), Array.Empty<object>()));
			BattleaxesAttackRotationModifier = Plugin._Instance.config("04- Battleaxes", "Attack Rotation Modifier", 0.7f, new ConfigDescription("Multiplier for turn speed during battleaxes' regular attacks", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), new object[1]
			{
				new ConfigurationManagerAttributes
				{
					ShowRangeAsPercent = false
				}
			}));
			BattleaxesSpecialAttackRotationModifier = Plugin._Instance.config("04- Battleaxes", "Special Attack Rotation Modifier", 1f, new ConfigDescription("Multiplier for turn speed during battleaxes' special attack", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), new object[1]
			{
				new ConfigurationManagerAttributes
				{
					ShowRangeAsPercent = false
				}
			}));
			BattleaxesCriticalBonus = Plugin._Instance.config("04- Battleaxes", "Critical Bonus", 2f, new ConfigDescription("Multiplier to bonus damage on staggered enemies when attacking with a battleaxe\nVanilla: 2\nRecommended: 1.4", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 3f), Array.Empty<object>()));
			BattleaxesFlankingBonus = Plugin._Instance.config("04- Battleaxes", "Flanking Bonus", 1.2f, new ConfigDescription("Multiplier to bonus damage when striking an enemy from behind with a battleaxe\nVanilla: 1\nRecommended: 1.2", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 10f), Array.Empty<object>()));
			BattleaxesStaggerBonus = Plugin._Instance.config("04- Battleaxes", "Stagger Bonus", 1.5f, new ConfigDescription("Part of the battleaxe's attack damage that counts towards staggering enemies\nVanilla: 1\nRecommended: 1.5", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1.5f), Array.Empty<object>()));
			BattleaxesSpecialStaggerBonus = Plugin._Instance.config("04- Battleaxes", "Special Stagger Bonus", 2f, new ConfigDescription("Part of the battleaxe's special attack damage that counts towards staggering enemies\nVanilla: 4\nRecommended: 2", (AcceptableValueBase)(object)new AcceptableValueRange<float>(2f, 4f), Array.Empty<object>()));
			PickaxesAttackRotationModifier = Plugin._Instance.config("11- Pickaxes", "Attack Rotation Modifier", 0.4f, new ConfigDescription("Multiplier for turn speed during pickaxes' regular attacks\nVanilla:0.3\nRecommended: 0.4", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), new object[1]
			{
				new ConfigurationManagerAttributes
				{
					ShowRangeAsPercent = false
				}
			}));
			PickaxesCriticalBonus = Plugin._Instance.config("11- Pickaxes", "Critical Bonus", 2f, new ConfigDescription("Multiplier to bonus damage on staggered enemies when attacking with a pickaxe\nVanilla: 2\nRecommended: 1.4", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 3f), Array.Empty<object>()));
			PickaxesFlankingBonus = Plugin._Instance.config("11- Pickaxes", "Flanking Bonus", 1.2f, new ConfigDescription("Multiplier to bonus damage when striking an enemy from behind with a pickaxe\nVanilla: 1\nRecommended: 1.2", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 10f), Array.Empty<object>()));
			PickaxesStaggerBonus = Plugin._Instance.config("11- Pickaxes", "Stagger Bonus", 1.6f, new ConfigDescription("Part of the pickaxe's attack damage that counts towards staggering enemies\nVanilla: 1\nRecommended: 1.6", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1.6f), Array.Empty<object>()));
			EnableSneakAttackScaling = Plugin._Instance.config("15- Sneak", "Enable Sneak Attack Scaling", Toggle.On, new ConfigDescription("Enable or disable new sneak attack bonus damage scaling - by default half vanilla value at sneak 0 and full vanilla value at sneak 100\nVanilla: Disabled\nRecommended: Enabled", (AcceptableValueBase)null, Array.Empty<object>()));
			MeleeSneakAttackModifier = Plugin._Instance.config("15- Sneak", "Melee Sneak Attack Modifier", 1f, new ConfigDescription("Multiplier for melee sneak attack damage values - setting this to 0 disables melee sneak attack bonuses altogether\nRecommended: 1", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 2f), Array.Empty<object>()));
			RangeSneakAttackModifier = Plugin._Instance.config("15- Sneak", "Range Sneak Attack Modifier", 1f, new ConfigDescription("Multiplier for ranged sneak attack damage values - setting this to 0 disables ranged sneak attack bonuses altogether\nRecommended: 1", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 2f), Array.Empty<object>()));
			BaseReloadSpeed = Plugin._Instance.config("07- Crossbows", "Base Reload Speed", 0f, new ConfigDescription("Subtrahend, in seconds, applied to base reload speed time\nVanilla: 0\nRecommended: 0, 0.5, 1", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 3f), Array.Empty<object>()));
			ReloadSpeedSkillFactorMultiplier = Plugin._Instance.config("07- Crossbows", "Reload Speed Skill Factor Multiplier", 1f, new ConfigDescription("Multiplier applied to crossbow's reload speed scaling\nRecommended: 1, 1.5, 2.33", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 10f), Array.Empty<object>()));
			CrossbowsCriticalBonus = Plugin._Instance.config("07- Crossbows", "Critical Bonus", 2f, new ConfigDescription("Multiplier to bonus damage on staggered enemies with a crossbow\nVanilla: 2\nRecommended: 1.4", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 3f), Array.Empty<object>()));
			CrossbowsStaggerBonus = Plugin._Instance.config("07- Crossbows", "Stagger Bonus", 0.3f, new ConfigDescription("Part of the crossbow's attack damage that counts towards staggering enemies\nVanilla: 1\nRecommended: 0.3", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), new object[1]
			{
				new ConfigurationManagerAttributes
				{
					ShowRangeAsPercent = false
				}
			}));
			DualKnivesAttackRotationModifier = Plugin._Instance.config("08- DualKnives", "Attack Rotation Modifier", 2f, new ConfigDescription("Multiplier for turn speed during  dualknives' regular attack\nVanilla: 1\nRecommended: 2", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 5f), Array.Empty<object>()));
			DualKnivesSpecialAttackRotationModifier = Plugin._Instance.config("08- DualKnives", "Special Attack Rotation Modifier", 0.3f, new ConfigDescription("Multiplier for turn speed during dualknives' special attack\nVanilla: 0\nRecommended: 0.3", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), new object[1]
			{
				new ConfigurationManagerAttributes
				{
					ShowRangeAsPercent = false
				}
			}));
			DualKnivesCriticalBonus = Plugin._Instance.config("08- DualKnives", "Critical Bonus", 3f, new ConfigDescription("Multiplier to bonus damage on staggered enemies when attacking with a dualknife\nVanilla: 2\nRecommended: 3", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 3f), Array.Empty<object>()));
			DualKnivesFlankingBonus = Plugin._Instance.config("08- DualKnives", "Flanking Bonus", 2f, new ConfigDescription("Multiplier to bonus damage when striking an enemy from behind with a dualknife\nVanilla: 1\nRecommended: 2", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 10f), Array.Empty<object>()));
			DualKnivesFlankingAngle = Plugin._Instance.config("08- DualKnives", "Flanking Angle", 0.5f, new ConfigDescription("Arc behind the enemy that the player should be positioned in to apply the flanking bonus when attacking with a dualknife\nVanilla: 0\nRecommended: 0 = 180°, 0.259 = 150°, 0.5 = 120°, 0.707 = 90°, 0.866 = 60°, 0.966 = 30°, 1 = 0°", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), new object[1]
			{
				new ConfigurationManagerAttributes
				{
					ShowRangeAsPercent = false
				}
			}));
			DualKnivesStaggerBonus = Plugin._Instance.config("08- DualKnives", "Stagger Bonus", 1f, new ConfigDescription("Part of the dualknife's attack damage that counts towards staggering enemies\nVanilla: 1\nRecommended: 1", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), new object[1]
			{
				new ConfigurationManagerAttributes
				{
					ShowRangeAsPercent = false
				}
			}));
			DualKnivesSpecialStaggerBonus = Plugin._Instance.config("08- DualKnives", "Special Stagger Bonus", 1f, new ConfigDescription("Part of the dualknife's special attack damage that counts towards staggering enemies\nVanilla: 1\nRecommended: 1", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), new object[1]
			{
				new ConfigurationManagerAttributes
				{
					ShowRangeAsPercent = false
				}
			}));
			EnableGreatswordAttackChaining = Plugin._Instance.config("09- Greatsword", "Enable Attack Chaining", Toggle.On, new ConfigDescription("Enable the ability to chain 2nd and 3rd attack indefinitely\nVanilla: false\nRecommended: true", (AcceptableValueBase)null, Array.Empty<object>()));
			GreatswordMovementSpeedModifier = Plugin._Instance.config("09- Greatsword", "Movement Speed Modifier", -0.1f, new ConfigDescription("Modifier to player's movement speed applied while wielding a greatsword\nVanilla: -0.2\nRecommended: -0.1", (AcceptableValueBase)(object)new AcceptableValueRange<float>(-1f, 0f), Array.Empty<object>()));
			GreatswordAttackRotationModifier = Plugin._Instance.config("09- Greatsword", "Attack Rotation Modifier", 0.7f, new ConfigDescription("Multiplier for turn speed during greatswords' regular attacks", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), new object[1]
			{
				new ConfigurationManagerAttributes
				{
					ShowRangeAsPercent = false
				}
			}));
			GreatswordSpecialAttackRotationModifier = Plugin._Instance.config("09- Greatsword", "Special Attack Rotation Modifier", 1f, new ConfigDescription("Multiplier for turn speed during greatswords' special attack", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), new object[1]
			{
				new ConfigurationManagerAttributes
				{
					ShowRangeAsPercent = false
				}
			}));
			GreatswordCriticalBonus = Plugin._Instance.config("09- Greatsword", "Critical Bonus", 2f, new ConfigDescription("Multiplier to bonus damage on staggered enemies when attacking with a greatsword\nVanilla: 2\nRecommended: 1.4", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 3f), Array.Empty<object>()));
			GreatswordFlankingBonus = Plugin._Instance.config("09- Greatsword", "Flanking Bonus", 1.2f, new ConfigDescription("Multiplier to bonus damage when striking an enemy from behind with a greatsword\nVanilla: 1\nRecommended: 1.2", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 10f), Array.Empty<object>()));
			GreatswordStaggerBonus = Plugin._Instance.config("09- Greatsword", "Stagger Bonus", 1.5f, new ConfigDescription("Part of the greatsword's attack damage that counts towards staggering enemies\nVanilla: 1\nRecommended: 1.5", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1.5f), Array.Empty<object>()));
			GreatswordSpecialStaggerBonus = Plugin._Instance.config("09- Greatsword", "Special Stagger Bonus", 2f, new ConfigDescription("Part of the greatsword's special attack damage that counts towards staggering enemies\nVanilla: 4\nRecommended: 2", (AcceptableValueBase)(object)new AcceptableValueRange<float>(2f, 4f), Array.Empty<object>()));
		}
	}
	internal class Logging
	{
		public static void LogInfo(string info)
		{
			Plugin.CORLogger.LogInfo((object)info);
		}

		public static void LogWarning(string warning)
		{
			Plugin.CORLogger.LogWarning((object)warning);
		}

		public static void LogError(string error)
		{
			Plugin.CORLogger.LogError((object)error);
		}

		public static void LogDebug(string debug)
		{
			Plugin.CORLogger.LogDebug((object)debug);
		}
	}
	public enum Toggle
	{
		On = 1,
		Off = 0
	}
	internal abstract class WeaponUtils
	{
		public static ItemData _attackWeapon = null;

		public static readonly Dictionary<Tuple<int, string>, float> AttackRotationValues = new Dictionary<Tuple<int, string>, float>
		{
			{
				new Tuple<int, string>(101, "swing_longsword"),
				ConfigSettings.SwordsAttackRotationModifier.Value
			},
			{
				new Tuple<int, string>(101, "sword_secondary"),
				ConfigSettings.SwordsSpecialAttackRotationModifier.Value
			},
			{
				new Tuple<int, string>(102, "knife_stab"),
				ConfigSettings.KnivesAttackRotationModifier.Value
			},
			{
				new Tuple<int, string>(102, "knife_secondary"),
				ConfigSettings.KnivesSpecialAttackRotationModifier.Value
			},
			{
				new Tuple<int, string>(103, "swing_longsword"),
				ConfigSettings.ClubsAttackRotationModifier.Value
			},
			{
				new Tuple<int, string>(103, "mace_secondary"),
				ConfigSettings.ClubsSpecialAttackRotationModifier.Value
			},
			{
				new Tuple<int, string>(104, "swing_sledge"),
				ConfigSettings.SledgehammerAttackRotationModifier.Value
			},
			{
				new Tuple<int, string>(105, "atgeir_attack"),
				ConfigSettings.PolearmsAttackRotationModifier.Value
			},
			{
				new Tuple<int, string>(105, "atgeir_secondary"),
				ConfigSettings.PolearmsSpecialAttackRotationModifier.Value
			},
			{
				new Tuple<int, string>(106, "spear_poke"),
				ConfigSettings.SpearsAttackRotationModifier.Value
			},
			{
				new Tuple<int, string>(106, "spear_throw"),
				ConfigSettings.SpearsSpecialAttackRotationModifier.Value
			},
			{
				new Tuple<int, string>(107, "swing_axe"),
				ConfigSettings.AxesAttackRotationModifier.Value
			},
			{
				new Tuple<int, string>(108, "battaxe_attack"),
				ConfigSettings.BattleaxesAttackRotationModifier.Value
			},
			{
				new Tuple<int, string>(108, "battleaxe_secondary"),
				ConfigSettings.BattleaxesSpecialAttackRotationModifier.Value
			},
			{
				new Tuple<int, string>(110, "swing_pickaxe"),
				ConfigSettings.PickaxesAttackRotationModifier.Value
			},
			{
				new Tuple<int, string>(111, "swing_longsword"),
				ConfigSettings.ClubsAttackRotationModifier.Value
			},
			{
				new Tuple<int, string>(112, "dual_knives"),
				ConfigSettings.DualKnivesAttackRotationModifier.Value
			},
			{
				new Tuple<int, string>(112, "dual_knives_secondary"),
				ConfigSettings.DualKnivesSpecialAttackRotationModifier.Value
			},
			{
				new Tuple<int, string>(113, "greatsword"),
				ConfigSettings.GreatswordAttackRotationModifier.Value
			},
			{
				new Tuple<int, string>(113, "greatsword_secondary"),
				ConfigSettings.GreatswordSpecialAttackRotationModifier.Value
			}
		};

		public static readonly Dictionary<Tuple<int, string>, float> AttackStaggerValues = new Dictionary<Tuple<int, string>, float>
		{
			{
				new Tuple<int, string>(101, "swing_longsword"),
				ConfigSettings.SwordsStaggerBonus.Value
			},
			{
				new Tuple<int, string>(101, "sword_secondary"),
				ConfigSettings.SwordsSpecialStaggerBonus.Value
			},
			{
				new Tuple<int, string>(102, "knife_stab"),
				ConfigSettings.KnivesStaggerBonus.Value
			},
			{
				new Tuple<int, string>(102, "knife_secondary"),
				ConfigSettings.KnivesSpecialStaggerBonus.Value
			},
			{
				new Tuple<int, string>(103, "swing_longsword"),
				ConfigSettings.ClubsStaggerBonus.Value
			},
			{
				new Tuple<int, string>(103, "mace_secondary"),
				ConfigSettings.ClubsSpecialStaggerBonus.Value
			},
			{
				new Tuple<int, string>(104, "swing_sledge"),
				ConfigSettings.SledgehammerStaggerBonus.Value
			},
			{
				new Tuple<int, string>(105, "atgeir_attack"),
				ConfigSettings.PolearmsStaggerBonus.Value
			},
			{
				new Tuple<int, string>(105, "atgeir_secondary"),
				ConfigSettings.PolearmsSpecialStaggerBonus.Value
			},
			{
				new Tuple<int, string>(106, "spear_poke"),
				ConfigSettings.SpearsStaggerBonus.Value
			},
			{
				new Tuple<int, string>(106, "spear_throw"),
				ConfigSettings.SpearsSpecialStaggerBonus.Value
			},
			{
				new Tuple<int, string>(107, "swing_axe"),
				ConfigSettings.AxesStaggerBonus.Value
			},
			{
				new Tuple<int, string>(108, "battleaxe_attack"),
				ConfigSettings.BattleaxesStaggerBonus.Value
			},
			{
				new Tuple<int, string>(108, "battleaxe_secondary"),
				ConfigSettings.BattleaxesSpecialStaggerBonus.Value
			},
			{
				new Tuple<int, string>(109, "bow_fire"),
				ConfigSettings.BowsStaggerBonus.Value
			},
			{
				new Tuple<int, string>(110, "swing_pickaxe"),
				ConfigSettings.PickaxesStaggerBonus.Value
			},
			{
				new Tuple<int, string>(111, "swing_longsword"),
				ConfigSettings.ClubsStaggerBonus.Value
			},
			{
				new Tuple<int, string>(112, "dual_knives"),
				ConfigSettings.DualKnivesStaggerBonus.Value
			},
			{
				new Tuple<int, string>(112, "dual_knives_secondary"),
				ConfigSettings.DualKnivesSpecialStaggerBonus.Value
			},
			{
				new Tuple<int, string>(113, "greatsword"),
				ConfigSettings.GreatswordStaggerBonus.Value
			},
			{
				new Tuple<int, string>(113, "greatsword_secondary"),
				ConfigSettings.GreatswordSpecialStaggerBonus.Value
			},
			{
				new Tuple<int, string>(114, "crossbow_fire"),
				ConfigSettings.CrossbowsStaggerBonus.Value
			}
		};

		public static readonly Dictionary<Tuple<int, string>, DamageTypes> AttackDamageType = new Dictionary<Tuple<int, string>, DamageTypes>
		{
			{
				new Tuple<int, string>(101, "sword_secondary"),
				new DamageTypes
				{
					m_blunt = 0f,
					m_slash = 0f,
					m_pierce = 1f,
					m_chop = 0f,
					m_pickaxe = 0f,
					m_fire = 1f,
					m_frost = 1f,
					m_lightning = 1f,
					m_poison = 1f,
					m_spirit = 1f
				}
			},
			{
				new Tuple<int, string>(105, "atgeir_secondary"),
				new DamageTypes
				{
					m_blunt = 0f,
					m_slash = 1f,
					m_pierce = 0f,
					m_chop = 0f,
					m_pickaxe = 0f,
					m_fire = 1f,
					m_frost = 1f,
					m_lightning = 1f,
					m_poison = 1f,
					m_spirit = 1f
				}
			},
			{
				new Tuple<int, string>(108, "battleaxe_secondary"),
				new DamageTypes
				{
					m_blunt = 1f,
					m_slash = 0f,
					m_pierce = 0f,
					m_chop = 0f,
					m_pickaxe = 0f,
					m_fire = 1f,
					m_frost = 1f,
					m_lightning = 1f,
					m_poison = 1f,
					m_spirit = 1f
				}
			},
			{
				new Tuple<int, string>(113, "greatsword_secondary"),
				new DamageTypes
				{
					m_blunt = 1f,
					m_slash = 0f,
					m_pierce = 0f,
					m_chop = 0f,
					m_pickaxe = 0f,
					m_fire = 1f,
					m_frost = 1f,
					m_lightning = 1f,
					m_poison = 1f,
					m_spirit = 1f
				}
			}
		};

		private static readonly Dictionary<int, float> WeaponCriticalBonuses = new Dictionary<int, float>
		{
			{
				101,
				ConfigSettings.EnableCustomCriticalBonus.Value ? ConfigSettings.SwordsCriticalBonus.Value : 2.2f
			},
			{
				102,
				ConfigSettings.EnableCustomCriticalBonus.Value ? ConfigSettings.KnivesCriticalBonus.Value : 3f
			},
			{
				103,
				ConfigSettings.EnableCustomCriticalBonus.Value ? ConfigSettings.ClubsCriticalBonus.Value : 2f
			},
			{
				104,
				ConfigSettings.EnableCustomCriticalBonus.Value ? ConfigSettings.SledgehammerCriticalBonus.Value : 2f
			},
			{
				105,
				ConfigSettings.EnableCustomCriticalBonus.Value ? ConfigSettings.PolearmsCriticalBonus.Value : 2f
			},
			{
				106,
				ConfigSettings.EnableCustomCriticalBonus.Value ? ConfigSettings.SpearsCriticalBonus.Value : 2f
			},
			{
				107,
				ConfigSettings.EnableCustomCriticalBonus.Value ? ConfigSettings.AxesCriticalBonus.Value : 2f
			},
			{
				108,
				ConfigSettings.EnableCustomCriticalBonus.Value ? ConfigSettings.BattleaxesCriticalBonus.Value : 2f
			},
			{
				109,
				ConfigSettings.EnableCustomCriticalBonus.Value ? ConfigSettings.BowsCriticalBonus.Value : 2f
			},
			{
				110,
				ConfigSettings.EnableCustomCriticalBonus.Value ? ConfigSettings.PickaxesCriticalBonus.Value : 2f
			},
			{
				112,
				ConfigSettings.EnableCustomCriticalBonus.Value ? ConfigSettings.DualKnivesCriticalBonus.Value : 3f
			},
			{
				113,
				ConfigSettings.EnableCustomCriticalBonus.Value ? ConfigSettings.GreatswordCriticalBonus.Value : 2f
			},
			{
				114,
				ConfigSettings.EnableCustomCriticalBonus.Value ? ConfigSettings.CrossbowsCriticalBonus.Value : 2f
			}
		};

		private static readonly Dictionary<int, float> WeaponFlankingBonuses = new Dictionary<int, float>
		{
			{
				101,
				ConfigSettings.EnableCustomFlankingBonus.Value ? ConfigSettings.SwordsFlankingBonus.Value : 1f
			},
			{
				102,
				ConfigSettings.EnableCustomFlankingBonus.Value ? ConfigSettings.KnivesFlankingBonus.Value : 2f
			},
			{
				103,
				ConfigSettings.EnableCustomFlankingBonus.Value ? ConfigSettings.ClubsFlankingBonus.Value : 1f
			},
			{
				105,
				ConfigSettings.EnableCustomFlankingBonus.Value ? ConfigSettings.PolearmsFlankingBonus.Value : 1f
			},
			{
				106,
				ConfigSettings.EnableCustomFlankingBonus.Value ? ConfigSettings.SpearsFlankingBonus.Value : 1f
			},
			{
				107,
				ConfigSettings.EnableCustomFlankingBonus.Value ? ConfigSettings.AxesFlankingBonus.Value : 1f
			},
			{
				108,
				ConfigSettings.EnableCustomFlankingBonus.Value ? ConfigSettings.BattleaxesFlankingBonus.Value : 1f
			},
			{ 109, 1f },
			{
				110,
				ConfigSettings.EnableCustomFlankingBonus.Value ? ConfigSettings.PickaxesFlankingBonus.Value : 1f
			},
			{
				112,
				ConfigSettings.EnableCustomFlankingBonus.Value ? ConfigSettings.DualKnivesFlankingBonus.Value : 2f
			},
			{
				113,
				ConfigSettings.EnableCustomFlankingBonus.Value ? ConfigSettings.GreatswordFlankingBonus.Value : 1f
			},
			{ 114, 1f }
		};

		private static readonly Dictionary<int, float> WeaponFlankingAngle = new Dictionary<int, float>
		{
			{
				102,
				ConfigSettings.KnivesFlankingAngle.Value
			},
			{
				112,
				ConfigSettings.DualKnivesFlankingAngle.Value
			}
		};

		public static readonly List<Func<ItemData, int>> WeaponTypeCheckers = new List<Func<ItemData, int>> { GetVanillaWeaponType };

		public static string AttackToCode(Attack attack)
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Expected I4, but got Unknown
			int weaponType = GetWeaponType(attack.m_weapon);
			int num = (int)attack.m_attackType;
			return $"{{CORE_{weaponType}_{num}}}";
		}

		public static string[] GetAttackCode(HitData hitData)
		{
			Match match = Regex.Match(hitData.m_statusEffectHash.ToString(), "{CORE_[0-9][0-9][0-9]_[0-9]}");
			if (!match.Success)
			{
				return null;
			}
			string[] array = match.Value.Trim('{', '}').Split(new char[1] { '_' });
			return new string[2]
			{
				array[1],
				array[2]
			};
		}

		public static void RemoveAttackCode(ref HitData hitData, string weaponType, string attackType)
		{
			hitData.m_statusEffectHash = StringExtensionMethods.GetStableHashCode(hitData.m_statusEffectHash.ToString().Replace("{CORE_" + weaponType + "_" + attackType + "}", ""));
		}

		public static bool GetDamageTypes(ItemData wepon, string attackAnimation, out DamageTypes damageTypes)
		{
			return AttackDamageType.TryGetValue(new Tuple<int, string>(GetWeaponType(wepon), attackAnimation), out damageTypes);
		}

		public static float CalculateBackstabBonus(float backstabBonus, float skillFactor, bool isRanged = false)
		{
			float num = backstabBonus;
			if (ConfigSettings.EnableSneakAttackScaling.Value == Toggle.On)
			{
				num = (1f + skillFactor) * backstabBonus / 2f;
			}
			num *= (isRanged ? ConfigSettings.RangeSneakAttackModifier.Value : ConfigSettings.MeleeSneakAttackModifier.Value);
			return Mathf.Max(num, 1f);
		}

		public static float GetTooltipCriticalBonus(ItemData itemData)
		{
			if (!WeaponCriticalBonuses.TryGetValue(GetWeaponType(itemData), out var value))
			{
				return 2f;
			}
			return value;
		}

		public static float GetCriticalBonus(ItemData itemData)
		{
			if (WeaponCriticalBonuses.TryGetValue(GetWeaponType(itemData), out var value))
			{
				return value / 2f;
			}
			return 1f;
		}

		public static float GetCriticalBonus(int weaponType)
		{
			if (WeaponCriticalBonuses.TryGetValue(weaponType, out var value))
			{
				return value / 2f;
			}
			return 1f;
		}

		public static float GetFlankingBonus(ItemData itemData)
		{
			if (!WeaponFlankingBonuses.TryGetValue(GetWeaponType(itemData), out var value))
			{
				return 1.2f;
			}
			return value;
		}

		public static float GetFlankingBonus(int weaponType)
		{
			if (!WeaponFlankingBonuses.TryGetValue(weaponType, out var value))
			{
				return 1.2f;
			}
			return value;
		}

		public static float GetFlankingAngle(ItemData itemData)
		{
			if (!WeaponFlankingAngle.TryGetValue(GetWeaponType(itemData), out var value))
			{
				return ConfigSettings.DefaultFlankingAngle.Value;
			}
			return value;
		}

		public static float GetFlankingAngle(int weaponType)
		{
			if (!WeaponFlankingAngle.TryGetValue(weaponType, out var value))
			{
				return ConfigSettings.DefaultFlankingAngle.Value;
			}
			return value;
		}

		public static int GetWeaponType(ItemData itemData)
		{
			int num = 100;
			if (itemData == null)
			{
				return num;
			}
			foreach (Func<ItemData, int> weaponTypeChecker in WeaponTypeCheckers)
			{
				num = weaponTypeChecker(itemData);
				if (num != 100)
				{
					break;
				}
			}
			return num;
		}

		private static int GetVanillaWeaponType(ItemData itemData)
		{
			if (IsSword(itemData))
			{
				return 101;
			}
			if (IsKnife(itemData))
			{
				return 102;
			}
			if (IsClub(itemData))
			{
				return 103;
			}
			if (IsSledge(itemData))
			{
				return 104;
			}
			if (IsPolearm(itemData))
			{
				return 105;
			}
			if (IsSpear(itemData))
			{
				return 106;
			}
			if (IsAxe(itemData))
			{
				return 107;
			}
			if (IsBattleaxe(itemData))
			{
				return 108;
			}
			if (IsBow(itemData))
			{
				return 109;
			}
			if (IsPickaxe(itemData))
			{
				return 110;
			}
			if (IsTorch(itemData))
			{
				return 111;
			}
			if (IsDualKnives(itemData))
			{
				return 112;
			}
			if (IsGreatSword(itemData))
			{
				return 113;
			}
			if (IsCrossbow(itemData))
			{
				return 114;
			}
			return 100;
		}

		public static bool IsSword(ItemData itemData)
		{
			return itemData.m_shared.m_name.ToLower().Contains("_sword");
		}

		public static bool IsKnife(ItemData itemData)
		{
			return itemData.m_shared.m_name.ToLower().Contains("_knife");
		}

		private static bool IsClub(ItemData itemData)
		{
			if (!itemData.m_shared.m_name.ToLower().Contains("_club"))
			{
				return itemData.m_shared.m_name.ToLower().Contains("_mace");
			}
			return true;
		}

		private static bool IsSledge(ItemData itemData)
		{
			if (!itemData.m_shared.m_name.ToLower().Contains("_stagbreaker"))
			{
				return itemData.m_shared.m_name.ToLower().Contains("_sledge");
			}
			return true;
		}

		private static bool IsPolearm(ItemData itemData)
		{
			return itemData.m_shared.m_name.ToLower().Contains("_atgeir");
		}

		private static bool IsSpear(ItemData itemData)
		{
			return itemData.m_shared.m_name.ToLower().Contains("_spear");
		}

		private static bool IsAxe(ItemData itemData)
		{
			return itemData.m_shared.m_name.ToLower().Contains("_axe");
		}

		public static bool IsBattleaxe(ItemData itemData)
		{
			return itemData.m_shared.m_name.ToLower().Contains("_battleaxe");
		}

		private static bool IsBow(ItemData itemData)
		{
			return itemData.m_shared.m_name.ToLower().Contains("_bow");
		}

		private static bool IsPickaxe(ItemData itemData)
		{
			return itemData.m_shared.m_name.ToLower().Contains("_pickaxe");
		}

		private static bool IsTorch(ItemData itemData)
		{
			return itemData.m_shared.m_name.ToLower().Contains("_torch");
		}

		public static bool IsDualKnives(ItemData itemData)
		{
			return itemData.m_shared.m_name.ToLower().Contains("_skoll");
		}

		public static bool IsGreatSword(ItemData itemData)
		{
			return itemData.m_shared.m_name.ToLower().Contains("_krom");
		}

		private static bool IsCrossbow(ItemData itemData)
		{
			return itemData.m_shared.m_name.ToLower().Contains("_crossbow");
		}
	}
}
namespace CombatOverhaulREwrite.System
{
	public static class ArrayExtensions
	{
		public static void ForEach(this Array array, Action<Array, int[]> action)
		{
			if (array.LongLength != 0L)
			{
				ArrayTraverse arrayTraverse = new ArrayTraverse(array);
				do
				{
					action(array, arrayTraverse.Position);
				}
				while (arrayTraverse.Step());
			}
		}
	}
	internal class ArrayTraverse
	{
		public readonly int[] Position;

		private int[] maxLengths;

		public ArrayTraverse(Array array)
		{
			maxLengths = new int[array.Rank];
			for (int i = 0; i < array.Rank; i++)
			{
				maxLengths[i] = array.GetLength(i) - 1;
			}
			Position = new int[array.Rank];
		}

		public bool Step()
		{
			for (int i = 0; i < Position.Length; i++)
			{
				if (Position[i] < maxLengths[i])
				{
					Position[i]++;
					for (int j = 0; j < i; j++)
					{
						Position[j] = 0;
					}
					return true;
				}
			}
			return false;
		}
	}
	public static class DictionaryExtensions
	{
		public static void Merge<TKey, TValue>(this IDictionary<TKey, TValue> a, IDictionary<TKey, TValue> b)
		{
			foreach (KeyValuePair<TKey, TValue> item in b)
			{
				a[item.Key] = item.Value;
			}
		}
	}
	public static class ObjectExtensions
	{
		private static readonly MethodInfo CloneMethod = typeof(object).GetMethod("MemberwiseClone", BindingFlags.Instance | BindingFlags.NonPublic);

		private static bool IsPrimitive(this Type type)
		{
			if (type == typeof(string))
			{
				return true;
			}
			return type.IsValueType & type.IsPrimitive;
		}

		private static object Copy(this object originalObject)
		{
			return InternalCopy(originalObject, new Dictionary<object, object>(new ReferenceEqualityComparer()));
		}

		private static object InternalCopy(object originalObject, IDictionary<object, object> visited)
		{
			if (originalObject == null)
			{
				return null;
			}
			Type type = originalObject.GetType();
			if (type.IsPrimitive())
			{
				return originalObject;
			}
			if (visited.ContainsKey(originalObject))
			{
				return visited[originalObject];
			}
			if (typeof(Delegate).IsAssignableFrom(type))
			{
				return null;
			}
			object obj = CloneMethod.Invoke(originalObject, null);
			if (type.IsArray && !type.GetElementType().IsPrimitive())
			{
				Array clonedArray = (Array)obj;
				clonedArray.ForEach(delegate(Array array, int[] indices)
				{
					array.SetValue(InternalCopy(clonedArray.GetValue(indices), visited), indices);
				});
			}
			visited.Add(originalObject, obj);
			CopyFields(originalObject, visited, obj, type);
			RecursiveCopyBaseTypePrivateFields(originalObject, visited, obj, type);
			return obj;
		}

		private static void RecursiveCopyBaseTypePrivateFields(object originalObject, IDictionary<object, object> visited, object cloneObject, Type typeToReflect)
		{
			if (!(typeToReflect == null))
			{
				RecursiveCopyBaseTypePrivateFields(originalObject, visited, cloneObject, typeToReflect.BaseType);
				CopyFields(originalObject, visited, cloneObject, typeToReflect.BaseType, BindingFlags.Instance | BindingFlags.NonPublic, (FieldInfo info) => info.IsPrivate);
			}
		}

		private static void CopyFields(object originalObject, IDictionary<object, object> visited, object cloneObject, Type typeToReflect, BindingFlags bindingFlags = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy, Func<FieldInfo, bool> filter = null)
		{
			FieldInfo[] fields = typeToReflect.GetFields(bindingFlags);
			foreach (FieldInfo fieldInfo in fields)
			{
				if ((filter == null || filter(fieldInfo)) && !fieldInfo.FieldType.IsPrimitive())
				{
					object value = InternalCopy(fieldInfo.GetValue(originalObject), visited);
					fieldInfo.SetValue(cloneObject, value);
				}
			}
		}

		public static T Copy<T>(this T original)
		{
			return (T)((object)original).Copy();
		}
	}
	public class ReferenceEqualityComparer : EqualityComparer<object>
	{
		public override bool Equals(object x, object y)
		{
			return x == y;
		}

		public override int GetHashCode(object obj)
		{
			return obj?.GetHashCode() ?? 0;
		}
	}
}
namespace CombatOverhaulREwrite.Patches
{
	[HarmonyPatch(typeof(Attack))]
	internal class AttackPatch
	{
		[HarmonyPrefix]
		[HarmonyPatch("OnAttackTrigger")]
		public static void OnAttackTrigger_Prefix(Attack __instance)
		{
			if ((Object)(object)__instance.m_character == (Object)(object)Player.m_localPlayer)
			{
				WeaponUtils._attackWeapon = __instance.m_weapon;
			}
		}

		[HarmonyPrefix]
		[HarmonyPatch("DoMeleeAttack")]
		private static void AttackDoMeleeAttack_Prefix(ref Attack __instance, ref float ___m_maxYAngle, ref float ___m_attackOffset, ref float ___m_attackHeight)
		{
			Humanoid character = __instance.m_character;
			Player val = (Player)(object)((character is Player) ? character : null);
			if (val != null && !((Object)(object)val != (Object)(object)Player.m_localPlayer))
			{
				___m_maxYAngle = 180f;
				___m_attackOffset = 0f;
				___m_attackHeight = 1f;
			}
		}

		[HarmonyPatch("DoMeleeAttack")]
		[HarmonyPrefix]
		public static bool DoMeleeAttack_Prefix(Attack __instance)
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Invalid comparison between Unknown and I4
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: 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_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: 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_0073: 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_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: 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_011a: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: 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)
			//IL_0442: Unknown result type (might be due to invalid IL or missing references)
			//IL_0447: Unknown result type (might be due to invalid IL or missing references)
			//IL_013e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0143: Unknown result type (might be due to invalid IL or missing references)
			//IL_0125: Unknown result type (might be due to invalid IL or missing references)
			//IL_0128: Invalid comparison between Unknown and I4
			//IL_0163: Unknown result type (might be due to invalid IL or missing references)
			//IL_0165: Unknown result type (might be due to invalid IL or missing references)
			//IL_0172: Unknown result type (might be due to invalid IL or missing references)
			//IL_0174: Unknown result type (might be due to invalid IL or missing references)
			//IL_0175: Unknown result type (might be due to invalid IL or missing references)
			//IL_017a: Unknown result type (might be due to invalid IL or missing references)
			//IL_017f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0181: Unknown result type (might be due to invalid IL or missing references)
			//IL_0183: Unknown result type (might be due to invalid IL or missing references)
			//IL_0185: Unknown result type (might be due to invalid IL or missing references)
			//IL_0189: Unknown result type (might be due to invalid IL or missing references)
			//IL_018e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0153: Unknown result type (might be due to invalid IL or missing references)
			//IL_0158: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_015c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0161: Unknown result type (might be due to invalid IL or missing references)
			//IL_0474: Unknown result type (might be due to invalid IL or missing references)
			//IL_0481: Unknown result type (might be due to invalid IL or missing references)
			//IL_0486: Unknown result type (might be due to invalid IL or missing references)
			//IL_0489: Unknown result type (might be due to invalid IL or missing references)
			//IL_048e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0490: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a3: Expected I4, but got Unknown
			//IL_04b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_04bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_04cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_0504: Unknown result type (might be due to invalid IL or missing references)
			//IL_0506: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0949: Unknown result type (might be due to invalid IL or missing references)
			//IL_094e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0953: Unknown result type (might be due to invalid IL or missing references)
			//IL_052a: Unknown result type (might be due to invalid IL or missing references)
			//IL_052f: Unknown result type (might be due to invalid IL or missing references)
			//IL_053c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0541: Unknown result type (might be due to invalid IL or missing references)
			//IL_0544: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c9b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c9d: Unknown result type (might be due to invalid IL or missing references)
			//IL_020d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0212: Unknown result type (might be due to invalid IL or missing references)
			//IL_08c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_08c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_08dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_08de: Unknown result type (might be due to invalid IL or missing references)
			//IL_056e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0571: Unknown result type (might be due to invalid IL or missing references)
			//IL_0576: Unknown result type (might be due to invalid IL or missing references)
			//IL_054b: Unknown result type (might be due to invalid IL or missing references)
			//IL_054e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0553: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cc3: Unknown result type (might be due to invalid IL or missing references)
			//IL_09de: Unknown result type (might be due to invalid IL or missing references)
			//IL_09e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0237: Unknown result type (might be due to invalid IL or missing references)
			//IL_023c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0904: Unknown result type (might be due to invalid IL or missing references)
			//IL_0589: Unknown result type (might be due to invalid IL or missing references)
			//IL_057b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0557: Unknown result type (might be due to invalid IL or missing references)
			//IL_055c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0561: Unknown result type (might be due to invalid IL or missing references)
			//IL_09f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_05bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c6: Expected O, but got Unknown
			//IL_0289: Unknown result type (might be due to invalid IL or missing references)
			//IL_028b: Unknown result type (might be due to invalid IL or missing references)
			//IL_028d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0292: Unknown result type (might be due to invalid IL or missing references)
			//IL_0273: Unknown result type (might be due to invalid IL or missing references)
			//IL_0275: Unknown result type (might be due to invalid IL or missing references)
			//IL_025a: Unknown result type (might be due to invalid IL or missing references)
			//IL_025c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0260: Unknown result type (might be due to invalid IL or missing references)
			//IL_0265: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a1c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a21: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a29: Unknown result type (might be due to invalid IL or missing references)
			//IL_027a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0640: Unknown result type (might be due to invalid IL or missing references)
			//IL_06fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0719: Unknown result type (might be due to invalid IL or missing references)
			//IL_071e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0738: Unknown result type (might be due to invalid IL or missing references)
			//IL_073a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0741: Unknown result type (might be due to invalid IL or missing references)
			//IL_0743: Unknown result type (might be due to invalid IL or missing references)
			//IL_0745: Unknown result type (might be due to invalid IL or missing references)
			//IL_074a: Unknown result type (might be due to invalid IL or missing references)
			//IL_074e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0753: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a65: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a6a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a86: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a89: Invalid comparison between Unknown and I4
			//IL_07b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a8b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a8e: Invalid comparison between Unknown and I4
			//IL_0806: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ae3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ae9: Invalid comparison between Unknown and I4
			//IL_0882: Unknown result type (might be due to invalid IL or missing references)
			//IL_0885: Unknown result type (might be due to invalid IL or missing references)
			//IL_088a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0403: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b11: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b1d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b37: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b3c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b3e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b41: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b63: Expected I4, but got Unknown
			//IL_0ba0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c2f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c75: Unknown result type (might be due to invalid IL or missing references)
			//IL_0be9: Unknown result type (might be due to invalid IL or missing references)
			if ((int)__instance.m_character.GetCurrentWeapon().m_shared.m_skillType == 12)
			{
				return true;
			}
			if (!((Character)__instance.m_character).IsPlayer())
			{
				return true;
			}
			LockMovement(ref __instance);
			Transform val = default(Transform);
			Vector3 val2 = default(Vector3);
			__instance.GetMeleeAttackDir(ref val, ref val2);
			Vector3 val3 = ((Component)__instance.m_character).transform.InverseTransformDirection(val2);
			Quaternion val4 = Quaternion.LookRotation(val2, Vector3.up);
			Vector3 position = val.position;
			__instance.m_weapon.m_shared.m_triggerEffect.Create(position, val4, val, 1f, -1);
			__instance.m_triggerEffect.Create(position, val4, val, 1f, -1);
			Vector3 val5 = position + Vector3.up * __instance.m_attackHeight + ((Component)__instance.m_character).transform.right * __instance.m_attackOffset;
			float num = __instance.m_attackAngle / 2f;
			float attackRange = __instance.m_attackRange;
			List<HitPoint> list = new List<HitPoint>();
			HashSet<SkillType> hashSet = new HashSet<SkillType>();
			int num2 = (__instance.m_hitTerrain ? Attack.m_attackMaskTerrain : Attack.m_attackMask);
			for (float num3 = 0f - num; num3 <= num; num3 += 4f)
			{
				AttackType attackType = __instance.m_attackType;
				Quaternion val6 = (((int)attackType == 0) ? Quaternion.Euler(0f, 0f - num3, 0f) : (((int)attackType != 1) ? Quaternion.identity : Quaternion.Euler(num3, 0f, 0f)));
				Quaternion val7 = val6;
				Vector3 val8 = ((Component)__instance.m_character).transform.TransformDirection(val7 * val3);
				Debug.DrawLine(val5, val5 + val8 * attackRange);
				RaycastHit[] obj = ((!(__instance.m_attackRayWidth > 0f)) ? Physics.RaycastAll(val5, val8, attackRange, num2, (QueryTriggerInteraction)1) : Physics.SphereCastAll(val5, __instance.m_attackRayWidth, val8, Mathf.Max(0f, attackRange - __instance.m_attackRayWidth), num2, (QueryTriggerInteraction)1));
				Array.Sort(obj, (RaycastHit x, RaycastHit y) => ((RaycastHit)(ref x)).distance.CompareTo(((RaycastHit)(ref y)).distance));
				RaycastHit[] array = obj;
				for (int i = 0; i < array.Length; i++)
				{
					RaycastHit val9 = array[i];
					if ((Object)(object)((Component)((RaycastHit)(ref val9)).collider).gameObject == (Object)(object)((Component)__instance.m_character).gameObject)
					{
						continue;
					}
					Vector3 val10 = ((RaycastHit)(ref val9)).point;
					if (((RaycastHit)(ref val9)).distance < float.Epsilon)
					{
						val10 = ((!(((RaycastHit)(ref val9)).collider is MeshCollider)) ? ((RaycastHit)(ref val9)).collider.ClosestPoint(val5) : (val5 + val8 * attackRange));
					}
					if (__instance.m_attackAngle < 180f && Vector3.Dot(val10 - val5, val2) <= 0f)
					{
						continue;
					}
					GameObject val11 = Projectile.FindHitObject(((RaycastHit)(ref val9)).collider);
					if ((Object)(object)val11 == (Object)(object)((Component)__instance.m_character).gameObject)
					{
						continue;
					}
					Vagon component = val11.GetComponent<Vagon>();
					if (Object.op_Implicit((Object)(object)component) && component.IsAttached((Character)(object)__instance.m_character))
					{
						continue;
					}
					Character component2 = val11.GetComponent<Character>();
					if ((Object)(object)component2 != (Object)null)
					{
						bool flag = BaseAI.IsEnemy((Character)(object)__instance.m_character, component2) || (Object.op_Implicit((Object)(object)component2.GetBaseAI()) && component2.GetBaseAI().IsAggravatable() && ((Character)__instance.m_character).IsPlayer());
						if ((!((Character)__instance.m_character).IsPlayer() && !flag) || (!__instance.m_weapon.m_shared.m_tamedOnly && ((Character)__instance.m_character).IsPlayer() && !((Character)__instance.m_character).IsPVPEnabled() && !flag) || (__instance.m_weapon.m_shared.m_tamedOnly && !component2.IsTamed()) || (__instance.m_weapon.m_shared.m_dodgeable && component2.IsDodgeInvincible()))
						{
							continue;
						}
					}
					else if (__instance.m_weapon.m_shared.m_tamedOnly)
					{
						continue;
					}
					bool flag2 = (__instance.m_pickaxeSpecial && Object.op_Implicit((Object)(object)val11.GetComponent<MineRock5>())) || Object.op_Implicit((Object)(object)val11.GetComponent<MineRock>());
					__instance.AddHitPoint(list, val11, ((RaycastHit)(ref val9)).collider, val10, ((RaycastHit)(ref val9)).distance, flag2);
					if (!__instance.m_hitThroughWalls)
					{
						break;
					}
				}
			}
			int num4 = 0;
			Vector3 val12 = Vector3.zero;
			bool flag3 = false;
			bool flag4 = false;
			Character val13 = null;
			foreach (HitPoint item in list)
			{
				GameObject go = item.go;
				Vector3 val14 = item.avgPoint / (float)item.count;
				HitPointType hitPointtype = __instance.m_hitPointtype;
				Vector3 val15 = (Vector3)((int)hitPointtype switch
				{
					1 => val14, 
					2 => item.firstPoint, 
					0 => item.closestPoint, 
					_ => val14, 
				});
				Vector3 val16 = val15;
				num4++;
				val12 += val14;
				__instance.m_weapon.m_shared.m_hitEffect.Create(val16, Quaternion.identity, (Transform)null, 1f, -1);
				__instance.m_hitEffect.Create(val16, Quaternion.identity, (Transform)null, 1f, -1);
				IDestructible component3 = go.GetComponent<IDestructible>();
				if (component3 != null)
				{
					DestructibleType destructibleType = component3.GetDestructibleType();
					SkillType val17 = __instance.m_weapon.m_shared.m_skillType;
					if ((int)__instance.m_specialHitSkill != 0 && (destructibleType & __instance.m_specialHitType) != 0)
					{
						val17 = __instance.m_specialHitSkill;
						hashSet.Add(__instance.m_specialHitSkill);
					}
					else if ((destructibleType & __instance.m_skillHitType) != 0)
					{
						hashSet.Add(val17);
					}
					float num5 = ((Character)__instance.m_character).GetRandomSkillFactor(val17);
					if (__instance.m_multiHit && __instance.m_lowerDamagePerHit && list.Count > 1)
					{
						num5 /= (float)list.Count * 0.75f;
					}
					HitData hit = new HitData();
					hit.m_toolTier = (short)__instance.m_weapon.m_shared.m_toolTier;
					hit.m_statusEffectHash = (Object.op_Implicit((Object)(object)__instance.m_weapon.m_shared.m_attackStatusEffect) ? __instance.m_weapon.m_shared.m_attackStatusEffect.NameHash() : 0);
					HitData obj2 = hit;
					obj2.m_statusEffectHash += StringExtensionMethods.GetStableHashCode(WeaponUtils.AttackToCode(__instance));
					hit.m_skillLevel = ((Character)__instance.m_character).GetSkillLevel(__instance.m_weapon.m_shared.m_skillType);
					hit.m_itemLevel = (short)__instance.m_weapon.m_quality;
					hit.m_itemWorldLevel = (byte)__instance.m_weapon.m_worldLevel;
					hit.m_pushForce = __instance.m_weapon.m_shared.m_attackForce * num5 * __instance.m_forceMultiplier;
					hit.m_backstabBonus = WeaponUtils.CalculateBackstabBonus(__instance.m_weapon.m_shared.m_backstabBonus, ((Character)__instance.m_character).GetSkillFactor((SkillType)101));
					hit.m_staggerMultiplier = __instance.m_staggerMultiplier;
					hit.m_dodgeable = __instance.m_weapon.m_sh