Decompiled source of CombatOverhaulREwrite v1.2.3
CombatOverhaulREwrite.dll
Decompiled 2 months ago
The result has been truncated due to the large size, download it to view full contents!
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: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyConfiguration("")] [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.2.3")] [assembly: AssemblyCompany("blacks7ar")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.2.3.0")] [module: <d4476a22-63de-46ee-81aa-ce7d5a0fd87e>RefSafetyRules(11)] [module: UnverifiableCode] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [<d300acf0-5f7f-4471-aa79-13527b06316c>Embedded] internal sealed class <d300acf0-5f7f-4471-aa79-13527b06316c>EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] [<d300acf0-5f7f-4471-aa79-13527b06316c>Embedded] [CompilerGenerated] internal sealed class <d4476a22-63de-46ee-81aa-ce7d5a0fd87e>RefSafetyRulesAttribute : Attribute { public readonly int Version; public <d4476a22-63de-46ee-81aa-ce7d5a0fd87e>RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace CombatOverhaulREwrite { [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("blacks7ar.CombatOverhaulREwrite", "CombatOverhaulREwrite", "1.2.3")] 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.2.3"; public const string modLink = "https://valheim.thunderstore.io/package/blacks7ar/CombatOverhaulREwrite/"; public static readonly ManualLogSource CORLogger = Logger.CreateLogSource("CORE"); private static readonly Harmony _harmony = new Harmony("blacks7ar.CombatOverhaulREwrite"); private static readonly ConfigSync _configSync = new ConfigSync("blacks7ar.CombatOverhaulREwrite") { DisplayName = "CombatOverhaulREwrite", CurrentVersion = "1.2.3", MinimumRequiredVersion = "1.2.3", ModRequired = true }; 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; } public void Awake() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown Localizer.Load(); _Instance = this; ((BaseUnityPlugin)this).Config.SaveOnConfigSet = false; _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(); ((BaseUnityPlugin)this).Config.SaveOnConfigSet = true; ((BaseUnityPlugin)this).Config.Save(); Assembly executingAssembly = Assembly.GetExecutingAssembly(); _harmony.PatchAll(executingAssembly); _hasDualWield = CheckDualWieldMod(); IntegrateTerraheim(); IntegrateTerraheimItems(); CheckBowPlugin(); } private void OnDestroy() { ((BaseUnityPlugin)this).Config.Save(); } private static 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 static void IntegrateTerraheimItems() { if (Harmony.HasAnyPatches("DasSauerkraut.TerraheimItems")) { _hasTerraheimItems = true; Logging.LogInfo("TerraheimItems mod found.."); TerraheimUtils.AddTerraheimData(); } } private static 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); } } } } 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> DualAxesAttackRotationModifier; public static ConfigEntry<float> DualAxesSpecialAttackRotationModifier; public static ConfigEntry<float> DualAxesCriticalBonus; public static ConfigEntry<float> DualAxesFlankingBonus; public static ConfigEntry<float> DualAxesStaggerBonus; public static ConfigEntry<float> DualAxesSpecialStaggerBonus; 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 AxesSection = "03- Axes"; private const string BattleaxesSection = "04- Battleaxes"; private const string BowsSection = "05- Bows"; private const string ClubsSection = "06- Clubs"; private const string CrossbowsSection = "07- Crossbows"; private const string DualAxesSection = "08- DualAxes"; private const string DualKnivesSection = "09- DualKnives"; private const string GreatswordSection = "10- Greatsword"; private const string KnivesSection = "11- Knives"; private const string PickaxesSection = "12- Pickaxes"; private const string PolearmsSection = "13- Polearms"; private const string ShieldsSection = "14- Shields"; private const string SledgehammerSection = "15- Sledgehammer"; private const string SpearsSection = "16- Spears"; private const string SwordsSection = "17- Swords"; private const string SneakSection = "18- Sneak"; 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 //IL_1881: Unknown result type (might be due to invalid IL or missing references) //IL_188c: Expected O, but got Unknown //IL_18d3: Unknown result type (might be due to invalid IL or missing references) //IL_18de: Expected O, but got Unknown //IL_1910: Unknown result type (might be due to invalid IL or missing references) //IL_191b: Expected O, but got Unknown //IL_194d: Unknown result type (might be due to invalid IL or missing references) //IL_1958: Expected O, but got Unknown //IL_199f: Unknown result type (might be due to invalid IL or missing references) //IL_19aa: Expected O, but got Unknown //IL_19f1: Unknown result type (might be due to invalid IL or missing references) //IL_19fc: 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("11- 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("11- 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("11- 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("11- 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("11- 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("11- 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("11- 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("15- 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("15- 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("15- 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("13- 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("13- 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("13- 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("13- 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("13- 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("13- 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("14- 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("14- 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("14- 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("14- 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("14- 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("12- 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("12- 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("12- 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("12- 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("18- 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("18- 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("18- 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("09- 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("09- 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("09- 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("09- 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("09- 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("09- 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("09- 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("10- 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("10- 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("10- 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("10- 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("10- 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("10- 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("10- 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("10- 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>())); DualAxesAttackRotationModifier = Plugin._Instance.config("08- DualAxes", "Attack Rotation Modifier", 2f, new ConfigDescription("Multiplier for turn speed during dualaxes' regular attack\nVanilla: 1\nRecommended: 2", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 5f), Array.Empty<object>())); DualAxesSpecialAttackRotationModifier = Plugin._Instance.config("08- DualAxes", "Special Attack Rotation Modifier", 0.3f, new ConfigDescription("Multiplier for turn speed during dualaxes' special attack\nVanilla: 0\nRecommend: 0.3", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), new object[1] { new ConfigurationManagerAttributes { ShowRangeAsPercent = false } })); DualAxesCriticalBonus = Plugin._Instance.config("08- DualAxes", "Critical Bonus", 3f, new ConfigDescription("Multiplier to bonus damage on staggered enemies when attacking with a dualaxe\nVanilla: 2\nRecommended: 3", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 3f), Array.Empty<object>())); DualAxesFlankingBonus = Plugin._Instance.config("08- DualAxes", "Flanking Bonus", 2f, new ConfigDescription("Multiplier to bonus damage when striking an enemy from behind with a dualaxe\nVanilla: 1\nRecommended: 2", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 10f), Array.Empty<object>())); DualAxesStaggerBonus = Plugin._Instance.config("08- DualAxes", "Stagger Bonus", 1f, new ConfigDescription("Part of the dualaxes 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 } })); DualAxesSpecialStaggerBonus = Plugin._Instance.config("08- DualAxes", "Special Stagger Bonus", 1f, new ConfigDescription("Part of the dualaxes 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 } })); } } internal static 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 }, { new Tuple<int, string>(115, "dualaxes"), ConfigSettings.DualAxesAttackRotationModifier.Value }, { new Tuple<int, string>(115, "dualaxes_secondary"), ConfigSettings.DualAxesSpecialAttackRotationModifier.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 }, { new Tuple<int, string>(115, "dualaxes"), ConfigSettings.DualAxesStaggerBonus.Value }, { new Tuple<int, string>(115, "dualaxes_secondary"), ConfigSettings.DualAxesSpecialStaggerBonus.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 }, { 115, ConfigSettings.EnableCustomCriticalBonus.Value ? ConfigSettings.DualAxesCriticalBonus.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 }, { 115, ConfigSettings.EnableCustomFlankingBonus.Value ? ConfigSettings.DualAxesFlankingBonus.Value : 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; } if (IsDualAxe(itemData)) { return 115; } return 100; } public static bool IsSword(ItemData itemData) { return itemData.m_shared.m_name.Contains("_sword"); } public static bool IsKnife(ItemData itemData) { return itemData.m_shared.m_name.Contains("_knife"); } private static bool IsClub(ItemData itemData) { if (!itemData.m_shared.m_name.Contains("_club")) { return itemData.m_shared.m_name.Contains("_mace"); } return true; } private static bool IsSledge(ItemData itemData) { if (!itemData.m_shared.m_name.Contains("_stagbreaker")) { return itemData.m_shared.m_name.Contains("_sledge"); } return true; } private static bool IsPolearm(ItemData itemData) { return itemData.m_shared.m_name.Contains("_atgeir"); } private static bool IsSpear(ItemData itemData) { return itemData.m_shared.m_name.Contains("_spear"); } private static bool IsAxe(ItemData itemData) { return itemData.m_shared.m_name.Contains("_axe"); } public static bool IsBattleaxe(ItemData itemData) { return itemData.m_shared.m_name.Contains("_battleaxe"); } private static bool IsBow(ItemData itemData) { return itemData.m_shared.m_name.Contains("_bow"); } private static bool IsPickaxe(ItemData itemData) { return itemData.m_shared.m_name.Contains("_pickaxe"); } private static bool IsTorch(ItemData itemData) { return itemData.m_shared.m_name.Contains("_torch"); } public static bool IsDualKnives(ItemData itemData) { return itemData.m_shared.m_name.Contains("_skoll"); } public static bool IsGreatSword(ItemData itemData) { return itemData.m_shared.m_name.Contains("_krom"); } private static bool IsCrossbow(ItemData itemData) { return itemData.m_shared.m_name.Contains("_crossbow"); } private static bool IsDualAxe(ItemData itemData) { return itemData.m_shared.m_name.Contains("_berzerkr"); } } } namespace CombatOverhaulREwrite.System { 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; } } } } 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; } } [HarmonyPatch("DoMeleeAttack")] [HarmonyPrefix] 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; } } [HarmonyPrefix] [HarmonyPatch("DoMeleeAttack")] public static bool DoMeleeAttack_Prefix(Attack __instance) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Invalid comparison between Unknown and I4 //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Invalid comparison between Unknown and I4 //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_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_009d: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0458: Unknown result type (might be due to invalid IL or missing references) //IL_045d: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Invalid comparison between Unknown and I4 //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: 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_0177: Unknown result type (might be due to invalid IL or missing references) //IL_048a: Unknown result type (might be due to invalid IL or missing references) //IL_0497: Unknown result type (might be due to invalid IL or missing references) //IL_049c: Unknown result type (might be due to invalid IL or missing references) //IL_049f: Unknown result type (might be due to invalid IL or missing references) //IL_04a4: Unknown result type (might be due to invalid IL or missing references) //IL_04a6: Unknown result type (might be due to invalid IL or missing references) //IL_04b9: Expected I4, but got Unknown //IL_04ce: 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_04bb: 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_04c3: Unknown result type (might be due to invalid IL or missing references) //IL_04c8: Unknown result type (might be due to invalid IL or missing references) //IL_04db: Unknown result type (might be due to invalid IL or missing references) //IL_04dd: Unknown result type (might be due to invalid IL or missing references) //IL_04e5: Unknown result type (might be due to invalid IL or missing references) //IL_04e7: Unknown result type (might be due to invalid IL or missing references) //IL_04e9: Unknown result type (might be due to invalid IL or missing references) //IL_04ee: Unknown result type (might be due to invalid IL or missing references) //IL_0500: Unknown result type (might be due to invalid IL or missing references) //IL_0502: Unknown result type (might be due to invalid IL or missing references) //IL_051a: Unknown result type (might be due to invalid IL or missing references) //IL_051c: Unknown result type (might be due to invalid IL or missing references) //IL_04d7: Unknown result type (might be due to invalid IL or missing references) //IL_04d9: Unknown result type (might be due to invalid IL or missing references) //IL_097b: Unknown result type (might be due to invalid IL or missing references) //IL_0980: Unknown result type (might be due to invalid IL or missing references) //IL_0985: Unknown result type (might be due to invalid IL or missing references) //IL_0540: Unknown result type (might be due to invalid IL or missing references) //IL_0545: Unknown result type (might be due to invalid IL or missing references) //IL_0552: 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_055a: Unknown result type (might be due to invalid IL or missing references) //IL_0ccd: Unknown result type (might be due to invalid IL or missing references) //IL_0ccf: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_08df: Unknown result type (might be due to invalid IL or missing references) //IL_08e1: Unknown result type (might be due to invalid IL or missing references) //IL_08f5: Unknown result type (might be due to invalid IL or missing references) //IL_08f7: Unknown result type (might be due to invalid IL or missing references) //IL_0584: Unknown result type (might be due to invalid IL or missing references) //IL_0587: Unknown result type (might be due to invalid IL or missing references) //IL_058c: 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_0564: Unknown result type (might be due to invalid IL or missing references) //IL_0569: Unknown result type (might be due to invalid IL or missing references) //IL_0cf5: Unknown result type (might be due to invalid IL or missing references) //IL_0a10: Unknown result type (might be due to invalid IL or missing references) //IL_0a12: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Unknown result type (might be due to invalid IL or missing references) //IL_091c: Unknown result type (might be due to invalid IL or missing references) //IL_059f: Unknown result type (might be due to invalid IL or missing references) //IL_0591: Unknown result type (might be due to invalid IL or missing references) //IL_056d: Unknown result type (might be due to invalid IL or missing references) //IL_0572: Unknown result type (might be due to invalid IL or missing references) //IL_0577: 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_05d5: Unknown result type (might be due to invalid IL or missing references) //IL_05dc: Expected O, but got Unknown //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02a1: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Unknown result type (might be due to invalid IL or missing references) //IL_02a8: Unknown result type (might be due to invalid IL or missing references) //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_0270: Unknown result type (might be due to invalid IL or missing references) //IL_0272: Unknown result type (might be due to invalid IL or missing references) //IL_0276: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Unknown result type (might be due to invalid IL or missing references) //IL_0a4e: Unknown result type (might be due to invalid IL or missing references) //IL_0a53: Unknown result type (might be due to invalid IL or missing references) //IL_0a5b: Unknown result type (might be due to invalid IL or missing references) //IL_0290: Unknown result type (might be due to invalid IL or missing references) //IL_0656: Unknown result type (might be due to invalid IL or missing references) //IL_0713: Unknown result type (might be due to invalid IL or missing references) //IL_0715: Unknown result type (might be due to invalid IL or missing references) //IL_072f: Unknown result type (might be due to invalid IL or missing references) //IL_0734: 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_0750: Unknown result type (might be due to invalid IL or missing references) //IL_0757: Unknown result type (might be due to invalid IL or missing references) //IL_0759: Unknown result type (might be due to invalid IL or missing references) //IL_075b: Unknown result type (might be due to invalid IL or missing references) //IL_0760: Unknown result type (might be due to invalid IL or missing references) //IL_0764: Unknown result type (might be due to invalid IL or missing references) //IL_0769: Unknown result type (might be due to invalid IL or missing references) //IL_0a97: Unknown result type (might be due to invalid IL or missing references) //IL_0a9c: Unknown result type (might be due to invalid IL or missing references) //IL_0ab8: Unknown result type (might be due to invalid IL or missing references) //IL_0abb: Invalid comparison between Unknown and I4 //IL_07cf: Unknown result type (might be due to invalid IL or missing references) //IL_0abd: Unknown result type (might be due to invalid IL or missing references) //IL_0ac0: Invalid comparison between Unknown and I4 //IL_081c: Unknown result type (might be due to invalid IL or missing references) //IL_0b15: Unknown result type (might be due to invalid IL or missing references) //IL_0b1b: Invalid comparison between Unknown and I4 //IL_0898: Unknown result type (might be due to invalid IL or missing references) //IL_089b: Unknown result type (might be due to invalid IL or missing references) //IL_08a0: Unknown result type (might be due to invalid IL or missing references) //IL_0419: Unknown result type (might be due to invalid IL or missing references) //IL_0b43: Unknown result type (might be due to invalid IL or missing references) //IL_0b4f: Unknown result type (might be due to invalid IL or missing references) //IL_0b69: Unknown result type (might be due to invalid IL or missing references) //IL_0b6e: Unknown result type (might be due to invalid IL or missing references) //IL_0b70: Unknown result type (might be due to invalid IL or missing references) //IL_0b73: Unknown result type (might be due to invalid IL or missing references) //IL_0b95: Expected I4, but got Unknown //IL_0bd2: Unknown result type (might be due to invalid IL or missing references) //IL_0c61: Unknown result type (might be due to invalid IL or missing references) //IL_0ca7: Unknown result type (might be due to invalid IL or missing references) //IL_0c1b: Unknown result type (might be due to invalid IL or missing references) SkillType skillType = __instance.m_character.GetCurrentWeapon().m_shared.m_skillType; if (((int)skillType == 12 || (int)skillType == 106) ? true : false) { 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_cha