Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of ActiveCombatCompat v0.1.0
ActiveCombatCompat.dll
Decompiled 7 hours agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using ActiveCombat.Api; using ActiveCombat.Movesets; using ActiveCombatCompat.Core; using ActiveCombatCompat.Mods.Warfare; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using Jotunn.Managers; using Jotunn.Utils; using Microsoft.CodeAnalysis; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: IgnoresAccessChecksTo("")] [assembly: AssemblyCompany("ActiveCombatCompat")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyDescription("Makes ActiveCombat's movesets and dual wielding work with weapons from other mods, starting with Therzie's Warfare: its weapons get classes, attacks and animations of their own.")] [assembly: AssemblyFileVersion("0.1.0.0")] [assembly: AssemblyInformationalVersion("0.1.0+960fde63d890945a83fe1829996735a1c097483d")] [assembly: AssemblyProduct("ActiveCombatCompat")] [assembly: AssemblyTitle("ActiveCombatCompat")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.1.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace ActiveCombatCompat { [BepInPlugin("javidahmed64592.activecombatcompat", "Active Combat Compat", "0.1.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [NetworkCompatibility(/*Could not decode attribute arguments.*/)] public class ActiveCombatCompatPlugin : BaseUnityPlugin { public const string PluginGUID = "javidahmed64592.activecombatcompat"; public const string PluginName = "Active Combat Compat"; public const string PluginVersion = "0.1.0"; private Harmony _harmony; internal static ManualLogSource Log { get; private set; } private void Awake() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown Log = ((BaseUnityPlugin)this).Logger; _harmony = new Harmony("javidahmed64592.activecombatcompat"); CompatModules.Load(((BaseUnityPlugin)this).Config, _harmony); } private void OnDestroy() { Harmony harmony = _harmony; if (harmony != null) { harmony.UnpatchSelf(); } } } } namespace ActiveCombatCompat.Mods.Warfare { internal static class WarfareAttackSpeed { private const string SpeedPatch = "Warfare.WarfarePlugin+AttackSpeedSystem"; public static void Patch(Harmony harmony) { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Expected O, but got Unknown MethodInfo methodInfo = AccessTools.Method(AccessTools.TypeByName("Warfare.WarfarePlugin+AttackSpeedSystem"), "Prefix", (Type[])null, (Type[])null); if (methodInfo == null) { ActiveCombatCompatPlugin.Log.LogWarning((object)"Couldn't find Warfare's attack speed patch (Warfare.WarfarePlugin+AttackSpeedSystem), so Warfare may change the speed of ActiveCombat's attacks with its weapons."); } else { harmony.Patch((MethodBase)methodInfo, new HarmonyMethod(typeof(WarfareAttackSpeed), "SkipDuringActiveCombatAttacks", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } } private static bool SkipDuringActiveCombatAttacks(CharacterAnimEvent __0) { if (!((Object)(object)__0 == (Object)null)) { return !ActiveCombatApi.IsMovesetAttack(__0.m_character); } return true; } } internal sealed class WarfareModule : CompatModule { public const string Guid = "Therzie.Warfare"; private static readonly string[] Animations = new string[33] { "OverheadSlashBattleaxe", "ChargedSlashTwoHanded", "SpinAttackNonSpear", "JumpSecondaryAttack_TW", "DualBladeMain0", "DualBladeMain1", "DualBladeMain2", "YagluthBlade_Secondary_TW", "DualAxeMain0", "DualAxeMain1", "DualAxeMain2", "DualAxeSecondary_TW", "DualSwordsMain0", "DualSwordsMain1", "DualSwordsMain2", "DualSwordsSecondary_TW", "DualHammerMain0", "DualHammerMain1", "DualHammerMain2", "DualHammerSecondary_TW", "DualSpearMain0", "DualSpearMain1", "DualSpearMain2", "DualSpearSecondary_TW", "WarpikeMain0", "WarpikeMain1", "WarpikeMain2", "WarpikeSecondary_TW", "FistSlamJumpAnimation_TW", "FistLeftRightComboAnimation_TW", "FistAttackSecondary_TW", "FistDoubleHit_TW", "RightPowerUppercut_TW" }; private static readonly (string Class, string[] Prefabs)[] Items = new(string, string[])[8] { ("Sledges", new string[9] { "SledgeStagbreaker_TW", "SledgeBronze_TW", "SledgeIron_TW", "SledgeBonemass_TW", "SledgeSilver_TW", "SledgeBlackmetal_TW", "SledgeDemolisher_TW", "SledgeFlametal_TW", "GreatClub_TW" }), ("BastardSwords", new string[7] { "BastardFlint_TW", "BastardBone_TW", "BastardChitin_TW", "BastardSilver_TW", "BastardBlackmetal_TW", "BastardDvergr_TW", "BastardFlametal_TW" }), ("Battlehammers", new string[6] { "BattlehammerTrollbone_TW", "BattlehammerElder_TW", "BattlehammerIron_TW", "BattlehammerSilver_TW", "BattlehammerBlackmetal_TW", "BattlehammerDvergr_TW" }), ("Warpikes", new string[7] { "WarpikeBone_TW", "WarpikeElder_TW", "WarpikeChitin_TW", "WarpikeObsidian_TW", "WarpikeBlackmetal_TW", "WarpikeDvergr_TW", "WarpikeFlametal_TW" }), ("Scythes", new string[1] { "ScytheVampiric_TW" }), ("DualScythes", new string[1] { "DualScytheBloodthirst_TW" }), ("DualSwords", new string[1] { "DualSwordScimitar_TW" }), ("Greatblades", new string[1] { "BladeYagluth_TW" }) }; private static readonly string[] SkillNames = new string[2] { "Throwing", "Scythes" }; public override string Name => "Warfare"; public override string ModGuid => "Therzie.Warfare"; public override void Load(ConfigFile config, Harmony harmony) { //IL_0071: Unknown result type (might be due to invalid IL or missing references) WarnMissingAnimations(); ActiveCombatApi.AddAnimations(Animations); WeaponClassDefinition[] array = Classes(); foreach (WeaponClassDefinition val in array) { ActiveCombatApi.AddWeaponClass(config, val); } (string, string[])[] items = Items; for (int i = 0; i < items.Length; i++) { var (weaponClass, prefabs) = items[i]; SetWeaponClass(weaponClass, prefabs); } string[] skillNames = SkillNames; for (int i = 0; i < skillNames.Length; i++) { ActiveCombatApi.AddCombatSkill(SkillOf(skillNames[i])); } WarfareAttackSpeed.Patch(harmony); } private static void WarnMissingAnimations() { PluginInfo value; object obj = AccessTools.Field((Chainloader.PluginInfos.TryGetValue("Therzie.Warfare", out value) && (Object)(object)value.Instance != (Object)null) ? ((object)value.Instance).GetType().Assembly.GetType("KG_Managers.AnimationReplaceManager") : null, "AllExternalAnimations")?.GetValue(null); IDictionary known = obj as IDictionary; if (known == null) { ActiveCombatCompatPlugin.Log.LogWarning((object)"Couldn't find Warfare's animation list to check its animations against."); return; } string[] array = Array.FindAll(Animations, (string animation) => !known.Contains(animation)); if (array.Length != 0) { ActiveCombatCompatPlugin.Log.LogWarning((object)("Warfare has no animations named " + string.Join(", ", array) + "; moveset attacks set to them won't swing.")); } } private static SkillType SkillOf(string englishName) { return (SkillType)Math.Abs(StringExtensionMethods.GetStableHashCode(englishName)); } private static WeaponClassDefinition[] Classes() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Expected O, but got Unknown //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Expected O, but got Unknown //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Expected O, but got Unknown //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Expected O, but got Unknown //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Expected O, but got Unknown //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Expected O, but got Unknown //IL_0135: 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_0140: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Expected O, but got Unknown //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Expected O, but got Unknown //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Expected O, but got Unknown //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Expected O, but got Unknown //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: 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_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Expected O, but got Unknown //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_021e: 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_022e: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Expected O, but got Unknown //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Expected O, but got Unknown //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Unknown result type (might be due to invalid IL or missing references) //IL_026f: Unknown result type (might be due to invalid IL or missing references) //IL_027a: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Expected O, but got Unknown //IL_028a: Unknown result type (might be due to invalid IL or missing references) //IL_0296: Expected O, but got Unknown //IL_029d: Unknown result type (might be due to invalid IL or missing references) //IL_02a2: Unknown result type (might be due to invalid IL or missing references) //IL_02a8: Unknown result type (might be due to invalid IL or missing references) //IL_02ad: Unknown result type (might be due to invalid IL or missing references) //IL_02b8: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_02d9: Unknown result type (might be due to invalid IL or missing references) //IL_02e9: Expected O, but got Unknown //IL_02e9: Unknown result type (might be due to invalid IL or missing references) //IL_02ef: Unknown result type (might be due to invalid IL or missing references) //IL_02f4: Unknown result type (might be due to invalid IL or missing references) //IL_02ff: Unknown result type (might be due to invalid IL or missing references) //IL_030f: Expected O, but got Unknown //IL_030f: Unknown result type (might be due to invalid IL or missing references) //IL_0315: Unknown result type (might be due to invalid IL or missing references) //IL_031a: Unknown result type (might be due to invalid IL or missing references) //IL_0325: Unknown result type (might be due to invalid IL or missing references) //IL_0335: Expected O, but got Unknown //IL_0335: Unknown result type (might be due to invalid IL or missing references) //IL_033b: Unknown result type (might be due to invalid IL or missing references) //IL_0340: Unknown result type (might be due to invalid IL or missing references) //IL_034b: Unknown result type (might be due to invalid IL or missing references) //IL_0356: Unknown result type (might be due to invalid IL or missing references) //IL_0361: Unknown result type (might be due to invalid IL or missing references) //IL_036c: Unknown result type (might be due to invalid IL or missing references) //IL_037c: Expected O, but got Unknown //IL_037c: Unknown result type (might be due to invalid IL or missing references) //IL_0388: Expected O, but got Unknown //IL_038f: Unknown result type (might be due to invalid IL or missing references) //IL_0394: Unknown result type (might be due to invalid IL or missing references) //IL_039a: Unknown result type (might be due to invalid IL or missing references) //IL_039f: Unknown result type (might be due to invalid IL or missing references) //IL_03aa: Unknown result type (might be due to invalid IL or missing references) //IL_03b5: Unknown result type (might be due to invalid IL or missing references) //IL_03c5: Expected O, but got Unknown //IL_03c5: Unknown result type (might be due to invalid IL or missing references) //IL_03cb: Unknown result type (might be due to invalid IL or missing references) //IL_03d0: Unknown result type (might be due to invalid IL or missing references) //IL_03db: Unknown result type (might be due to invalid IL or missing references) //IL_03eb: Expected O, but got Unknown //IL_03eb: Unknown result type (might be due to invalid IL or missing references) //IL_03f1: Unknown result type (might be due to invalid IL or missing references) //IL_03f6: Unknown result type (might be due to invalid IL or missing references) //IL_0401: Unknown result type (might be due to invalid IL or missing references) //IL_0411: Expected O, but got Unknown //IL_0411: Unknown result type (might be due to invalid IL or missing references) //IL_0417: Unknown result type (might be due to invalid IL or missing references) //IL_041c: Unknown result type (might be due to invalid IL or missing references) //IL_0427: Unknown result type (might be due to invalid IL or missing references) //IL_0437: Expected O, but got Unknown //IL_0437: Unknown result type (might be due to invalid IL or missing references) //IL_0443: Expected O, but got Unknown //IL_044a: Unknown result type (might be due to invalid IL or missing references) //IL_044f: Unknown result type (might be due to invalid IL or missing references) //IL_0455: Unknown result type (might be due to invalid IL or missing references) //IL_045a: Unknown result type (might be due to invalid IL or missing references) //IL_0465: Unknown result type (might be due to invalid IL or missing references) //IL_0470: Unknown result type (might be due to invalid IL or missing references) //IL_047b: Unknown result type (might be due to invalid IL or missing references) //IL_048b: Expected O, but got Unknown //IL_048b: Unknown result type (might be due to invalid IL or missing references) //IL_0491: Unknown result type (might be due to invalid IL or missing references) //IL_0496: Unknown result type (might be due to invalid IL or missing references) //IL_04a1: Unknown result type (might be due to invalid IL or missing references) //IL_04ac: Unknown result type (might be due to invalid IL or missing references) //IL_04bc: Expected O, but got Unknown //IL_04bc: Unknown result type (might be due to invalid IL or missing references) //IL_04c2: Unknown result type (might be due to invalid IL or missing references) //IL_04c7: Unknown result type (might be due to invalid IL or missing references) //IL_04d2: 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_04e9: Expected O, but got Unknown //IL_04e9: Unknown result type (might be due to invalid IL or missing references) //IL_04ef: Unknown result type (might be due to invalid IL or missing references) //IL_04f4: Unknown result type (might be due to invalid IL or missing references) //IL_04ff: Unknown result type (might be due to invalid IL or missing references) //IL_050f: Expected O, but got Unknown //IL_050f: Unknown result type (might be due to invalid IL or missing references) //IL_051b: Expected O, but got Unknown //IL_0522: Unknown result type (might be due to invalid IL or missing references) //IL_0527: Unknown result type (might be due to invalid IL or missing references) //IL_052d: Unknown result type (might be due to invalid IL or missing references) //IL_0532: Unknown result type (might be due to invalid IL or missing references) //IL_053d: Unknown result type (might be due to invalid IL or missing references) //IL_0548: Unknown result type (might be due to invalid IL or missing references) //IL_0553: Unknown result type (might be due to invalid IL or missing references) //IL_0563: Expected O, but got Unknown //IL_0563: 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_056e: Unknown result type (might be due to invalid IL or missing references) //IL_0579: Unknown result type (might be due to invalid IL or missing references) //IL_0589: Expected O, but got Unknown //IL_0589: Unknown result type (might be due to invalid IL or missing references) //IL_058f: Unknown result type (might be due to invalid IL or missing references) //IL_0594: 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_05af: Expected O, but got Unknown //IL_05af: Unknown result type (might be due to invalid IL or missing references) //IL_05b5: Unknown result type (might be due to invalid IL or missing references) //IL_05ba: Unknown result type (might be due to invalid IL or missing references) //IL_05c5: Unknown result type (might be due to invalid IL or missing references) //IL_05d5: Expected O, but got Unknown //IL_05d5: Unknown result type (might be due to invalid IL or missing references) //IL_05e1: Expected O, but got Unknown return (WeaponClassDefinition[])(object)new WeaponClassDefinition[7] { new WeaponClassDefinition("BastardSwords") { Sprint = new MovesetEntry("battleaxe_attack1") { Damage = 1f, Stamina = 1.2f, Range = 1.1f, Windup = 1.2f, Speed = 1.2f }, Roll = new MovesetEntry("battleaxe_attack1") { Damage = 0.9f, Stamina = 1f }, Jump = new MovesetEntry("battleaxe_attack2") { Damage = 1f, Stamina = 1.2f }, Counter = new MovesetEntry("SpinAttackNonSpear") { Damage = 1.75f, Stamina = 1f, Angle = 360f }, TestKitPrefab = "BastardBone_TW" }, new WeaponClassDefinition("Battlehammers") { Sprint = new MovesetEntry("greatsword0") { Damage = 1f, Stamina = 1.2f, Range = 1.1f, Windup = 1.3f, Speed = 1.3f }, Roll = new MovesetEntry("greatsword1") { Damage = 0.9f, Stamina = 1.1f }, Jump = new MovesetEntry("JumpSecondaryAttack_TW") { Damage = 1f, Stamina = 1.3f, Type = (MovesetAttackType)3 }, Counter = new MovesetEntry("SpinAttackNonSpear") { Damage = 1.75f, Stamina = 1f, Stagger = 2f, Angle = 360f }, TestKitPrefab = "BattlehammerIron_TW" }, new WeaponClassDefinition("Warpikes") { Sprint = new MovesetEntry("WarpikeMain1") { Damage = 1f, Stamina = 1.2f, Range = 1.2f, Windup = 1.2f }, Roll = new MovesetEntry("WarpikeMain2") { Damage = 0.9f, Stamina = 0.9f }, Jump = new MovesetEntry("WarpikeMain1") { Damage = 1f, Stamina = 1.1f }, Counter = new MovesetEntry("WarpikeMain0") { Damage = 1.75f, Stamina = 1f }, TestKitPrefab = "WarpikeBone_TW" }, new WeaponClassDefinition("Scythes") { Sprint = new MovesetEntry("greatsword1") { Damage = 1f, Stamina = 1.2f, Range = 1.1f, Windup = 1.3f, Speed = 1.3f }, Roll = new MovesetEntry("greatsword1") { Damage = 0.9f, Stamina = 1.1f }, Jump = new MovesetEntry("greatsword2") { Damage = 1f, Stamina = 1.2f }, Counter = new MovesetEntry("atgeir_secondary") { Damage = 1.5f, Stamina = 1f, Angle = 360f, Windup = 1.5f, Speed = 1.2f }, TestKitPrefab = "ScytheVampiric_TW" }, new WeaponClassDefinition("DualScythes") { Sprint = new MovesetEntry("DualAxeSecondary_TW") { Damage = 0.5f, Stamina = 1.2f, Windup = 1.3f }, Roll = new MovesetEntry("DualHammerSecondary_TW") { Damage = 0.45f, Stamina = 1f }, Jump = new MovesetEntry("DualAxeMain2") { Damage = 1f, Stamina = 1.2f }, Counter = new MovesetEntry("DualAxeSecondary_TW") { Damage = 0.875f, Stamina = 1f }, TestKitPrefab = "DualScytheBloodthirst_TW" }, new WeaponClassDefinition("DualSwords") { Sprint = new MovesetEntry("DualSwordsMain2") { Damage = 1f, Stamina = 1.1f, Range = 1.2f, Windup = 1.2f }, Roll = new MovesetEntry("DualSwordsMain0") { Damage = 0.9f, Stamina = 1f, Speed = 1.2f }, Jump = new MovesetEntry("DualSwordsSecondary_TW") { Damage = 0.5f, Stamina = 1.2f, Type = (MovesetAttackType)2 }, Counter = new MovesetEntry("DualSwordsMain1") { Damage = 1.75f, Stamina = 1f }, TestKitPrefab = "DualSwordScimitar_TW" }, new WeaponClassDefinition("Greatblades") { Sprint = new MovesetEntry("battleaxe_secondary") { Damage = 1f, Stamina = 1.2f, Range = 1.1f, Windup = 1.2f }, Roll = new MovesetEntry("DualBladeMain1") { Damage = 0.9f, Stamina = 1.1f }, Jump = new MovesetEntry("DualBladeMain2") { Damage = 1f, Stamina = 1.2f }, Counter = new MovesetEntry("DualBladeMain1") { Damage = 1.75f, Stamina = 1f }, TestKitPrefab = "BladeYagluth_TW" } }; } } } namespace ActiveCombatCompat.Core { internal abstract class CompatModule { public abstract string Name { get; } public abstract string ModGuid { get; } public List<string> Prefabs { get; } = new List<string>(); public abstract void Load(ConfigFile config, Harmony harmony); protected void SetWeaponClass(string weaponClass, IEnumerable<string> prefabs) { foreach (string prefab in prefabs) { ActiveCombatApi.SetWeaponClass(prefab, weaponClass); Prefabs.Add(prefab); } } } internal static class CompatModules { public static readonly CompatModule[] All = new CompatModule[1] { new WarfareModule() }; private static readonly List<CompatModule> Loaded = new List<CompatModule>(); public static void Load(ConfigFile config, Harmony harmony) { CompatModule[] all = All; foreach (CompatModule compatModule in all) { ConfigEntry<bool> val = config.Bind<bool>("Mods", compatModule.Name, true, "Makes ActiveCombat work with " + compatModule.Name + "'s weapons when " + compatModule.Name + " is installed. Takes effect after a restart."); if (!Chainloader.PluginInfos.TryGetValue(compatModule.ModGuid, out var value)) { ActiveCombatCompatPlugin.Log.LogInfo((object)(compatModule.Name + " isn't installed, so its support is skipped.")); continue; } if (!val.Value) { ActiveCombatCompatPlugin.Log.LogInfo((object)(compatModule.Name + " support is turned off in the config.")); continue; } try { compatModule.Load(config, harmony); Loaded.Add(compatModule); ActiveCombatCompatPlugin.Log.LogInfo((object)$"Loaded support for {compatModule.Name} {value.Metadata.Version}."); } catch (Exception arg) { ActiveCombatCompatPlugin.Log.LogError((object)$"{compatModule.Name} support failed to load, so it may be incomplete: {arg}"); } } if (Loaded.Count > 0) { ItemManager.OnItemsRegistered += CheckPrefabs; } } private static void CheckPrefabs() { ItemManager.OnItemsRegistered -= CheckPrefabs; foreach (CompatModule item in Loaded) { List<string> list = item.Prefabs.Where((string prefab) => (Object)(object)ObjectDB.instance.GetItemPrefab(prefab) == (Object)null).ToList(); if (list.Count > 0) { ActiveCombatCompatPlugin.Log.LogWarning((object)(item.Name + " has no items named " + string.Join(", ", list) + ", so they keep the class their skill and attack give them.")); } else { ActiveCombatCompatPlugin.Log.LogInfo((object)$"Found all {item.Prefabs.Count} {item.Name} items given a weapon class."); } } } } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { internal IgnoresAccessChecksToAttribute(string assemblyName) { } } }