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 Lion Lion v4.1.1
ExcaliburRoad.dll
Decompiled a day agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security.Permissions; using BepInEx; using HarmonyLib; using Jotunn; using Jotunn.Configs; using Jotunn.Entities; using Jotunn.Managers; using Jotunn.Utils; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("ExcaliburRoad")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("ExcaliburRoad")] [assembly: AssemblyCopyright("Copyright ? 2021")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("e3243d22-4307-4008-ba36-9f326008cde5")] [assembly: AssemblyFileVersion("4.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("4.0.0.0")] namespace ExcaliburRoad; [BepInPlugin("com.jotunn.ExcaliburRoad", "ExcaliburRoad", "4.0.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] internal class ExcaliburRoad : BaseUnityPlugin { public const string PluginGUID = "com.jotunn.ExcaliburRoad"; public const string PluginName = "ExcaliburRoad"; public const string PluginVersion = "4.0.0"; public static AssetBundle excaliburBundle; private CustomLocalization Localization; public static RuntimeAnimatorController NormalController; public static RuntimeAnimatorController FastController; private readonly Harmony harmony = new Harmony("com.jotunn.ExcaliburRoad"); public static bool isXMode; private ButtonConfig Mouse4AttackButton; private void Awake() { Logger.LogInfo((object)"ExcaliburRoad has landed"); LoadAssets(); AddLocalizations(); harmony.PatchAll(); AddInputs(); PrefabManager.OnVanillaPrefabsAvailable += CreateExcaliburs; } private void LoadAssets() { Logger.LogInfo((object)("Embedded resources: " + string.Join(", ", typeof(ExcaliburRoad).Assembly.GetManifestResourceNames()))); excaliburBundle = AssetUtils.LoadAssetBundleFromResources("excaliburfsn"); NormalController = excaliburBundle.LoadAsset<RuntimeAnimatorController>("Player_animator"); FastController = excaliburBundle.LoadAsset<RuntimeAnimatorController>("Player_animator fast"); List<MethodInfo> declaredMethods = AccessTools.GetDeclaredMethods(typeof(Attack)); foreach (MethodInfo item in declaredMethods) { if (item.Name.ToLower().Contains("spawn") || item.Name.ToLower().Contains("trigger") || item.Name.ToLower().Contains("hit")) { Logger.LogInfo((object)("Attack method: " + item.Name)); } } } private void AddItemsWithConfigs() { excaliburBundle = AssetUtils.LoadAssetBundleFromResources("excaliburfsn"); Logger.LogInfo((object)$"Loaded asset bundle: {excaliburBundle}"); CreateExcaliburs(); excaliburBundle.Unload(false); } private void CreateExcaliburs() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Expected O, but got Unknown //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Expected O, but got Unknown //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Expected O, but got Unknown //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Expected O, but got Unknown //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Expected O, but got Unknown //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Expected O, but got Unknown //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Expected O, but got Unknown //IL_0234: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Expected O, but got Unknown //IL_02c1: Unknown result type (might be due to invalid IL or missing references) //IL_02c8: Expected O, but got Unknown //IL_030b: Unknown result type (might be due to invalid IL or missing references) //IL_0315: Expected O, but got Unknown //IL_0353: Unknown result type (might be due to invalid IL or missing references) //IL_035a: Expected O, but got Unknown //IL_03a0: Unknown result type (might be due to invalid IL or missing references) //IL_03aa: Expected O, but got Unknown //IL_03df: Unknown result type (might be due to invalid IL or missing references) //IL_03e6: Expected O, but got Unknown //IL_042c: Unknown result type (might be due to invalid IL or missing references) //IL_0436: Expected O, but got Unknown //IL_046b: Unknown result type (might be due to invalid IL or missing references) //IL_0472: Expected O, but got Unknown //IL_04df: Unknown result type (might be due to invalid IL or missing references) //IL_04e6: Expected O, but got Unknown //IL_0528: Unknown result type (might be due to invalid IL or missing references) //IL_0532: Expected O, but got Unknown //IL_0567: Unknown result type (might be due to invalid IL or missing references) //IL_056e: Expected O, but got Unknown //IL_05b0: Unknown result type (might be due to invalid IL or missing references) //IL_05ba: Expected O, but got Unknown //IL_05ef: Unknown result type (might be due to invalid IL or missing references) //IL_05f6: Expected O, but got Unknown //IL_0639: Unknown result type (might be due to invalid IL or missing references) //IL_0643: Expected O, but got Unknown //IL_0678: Unknown result type (might be due to invalid IL or missing references) //IL_067f: Expected O, but got Unknown //IL_06c2: Unknown result type (might be due to invalid IL or missing references) //IL_06cc: Expected O, but got Unknown //IL_0701: Unknown result type (might be due to invalid IL or missing references) //IL_0708: Expected O, but got Unknown //IL_074b: Unknown result type (might be due to invalid IL or missing references) //IL_0755: Expected O, but got Unknown //IL_078a: Unknown result type (might be due to invalid IL or missing references) //IL_0791: Expected O, but got Unknown //IL_07c4: Unknown result type (might be due to invalid IL or missing references) //IL_07ce: Expected O, but got Unknown //IL_07d9: Unknown result type (might be due to invalid IL or missing references) //IL_07e3: Expected O, but got Unknown //IL_0818: Unknown result type (might be due to invalid IL or missing references) //IL_081f: Expected O, but got Unknown //IL_0862: Unknown result type (might be due to invalid IL or missing references) //IL_086c: Expected O, but got Unknown //IL_08ad: Unknown result type (might be due to invalid IL or missing references) //IL_08b4: Expected O, but got Unknown //IL_08cd: Unknown result type (might be due to invalid IL or missing references) //IL_08d4: Expected O, but got Unknown //IL_08ed: Unknown result type (might be due to invalid IL or missing references) //IL_08f4: Expected O, but got Unknown //IL_090e: Unknown result type (might be due to invalid IL or missing references) //IL_0915: Expected O, but got Unknown //IL_092e: Unknown result type (might be due to invalid IL or missing references) //IL_0935: Expected O, but got Unknown //IL_094f: Unknown result type (might be due to invalid IL or missing references) //IL_0956: Expected O, but got Unknown //IL_0970: Unknown result type (might be due to invalid IL or missing references) //IL_0977: Expected O, but got Unknown //IL_0991: Unknown result type (might be due to invalid IL or missing references) //IL_0998: Expected O, but got Unknown //IL_09b2: Unknown result type (might be due to invalid IL or missing references) //IL_09b9: Expected O, but got Unknown //IL_09d3: Unknown result type (might be due to invalid IL or missing references) //IL_09da: Expected O, but got Unknown //IL_09f4: Unknown result type (might be due to invalid IL or missing references) //IL_09fb: Expected O, but got Unknown //IL_0a15: Unknown result type (might be due to invalid IL or missing references) //IL_0a1c: Expected O, but got Unknown //IL_0a36: Unknown result type (might be due to invalid IL or missing references) //IL_0a3d: Expected O, but got Unknown //IL_0a57: Unknown result type (might be due to invalid IL or missing references) //IL_0a5e: Expected O, but got Unknown //IL_0a78: Unknown result type (might be due to invalid IL or missing references) //IL_0a7f: Expected O, but got Unknown //IL_0a99: Unknown result type (might be due to invalid IL or missing references) //IL_0aa0: Expected O, but got Unknown ItemConfig val = new ItemConfig(); val.Amount = 1; val.AddRequirement("TrophyEikthyr", 1, 0); val.AddRequirement("TrophyTheElder", 1, 0); val.AddRequirement("TrophyBonemass", 1, 0); val.AddRequirement("TrophyDragonQueen", 1, 0); val.AddRequirement("TrophyGoblinKing", 1, 0); val.AddRequirement("TrophySeekerQueen", 1, 0); val.CraftingStation = "blackforge"; val.RepairStation = "blackforge"; val.Name = "$item_drc"; val.Description = "$item_drc_desc"; ItemConfig val2 = new ItemConfig(); val2.Amount = 1; val2.AddRequirement("BlackMetal", 200, 0); val2.AddRequirement("YggdrasilWood", 500, 0); val2.AddRequirement("Eitr", 100, 0); val2.AddRequirement("DragonTear", 50, 0); val2.CraftingStation = "blackforge"; val2.RepairStation = "blackforge"; val2.Name = "$item_sword_exc"; val2.Description = "$item_sword_exc_desc"; ItemConfig val3 = new ItemConfig(); val3.Amount = 1; val3.AddRequirement("BlackMetal", 200, 0); val3.AddRequirement("YggdrasilWood", 500, 0); val3.AddRequirement("YagluthDrop", 15, 0); val3.AddRequirement("Thunderstone", 200, 0); val3.CraftingStation = "blackforge"; val3.RepairStation = "blackforge"; val3.MinStationLevel = 1; val3.Name = "$item_sword_exm"; val3.Description = "$item_sword_exm_desc"; ItemConfig val4 = new ItemConfig(); val4.Amount = 1; val4.AddRequirement(new RequirementConfig("THSwordExc", 1, 0, true)); val4.AddRequirement(new RequirementConfig("THSwordExm", 1, 0, true)); val4.AddRequirement(new RequirementConfig("THSwordExcP", 1, 0, true)); val4.AddRequirement(new RequirementConfig("DragonReactorCore", 5, 0, true)); val4.CraftingStation = "blackforge"; val4.MinStationLevel = 3; val4.RepairStation = "blackforge"; val4.Name = "$item_excelsus"; val4.Description = "$item_excelsus_desc"; ItemConfig val5 = new ItemConfig(); val5.Amount = 1; val5.AddRequirement("BlackMetal", 200, 0); val5.AddRequirement("YggdrasilWood", 500, 0); val5.AddRequirement("BlackMarble", 500, 0); val5.AddRequirement("Silver", 50, 0); val5.CraftingStation = "blackforge"; val5.RepairStation = "blackforge"; val5.Name = "$item_sword_excp"; val5.Description = "$item_sword_excp_desc"; ItemConfig val6 = new ItemConfig(); val6.Amount = 1; val6.AddRequirement("TrophyGoblinBrute", 25, 0); val6.AddRequirement("TrophyBjorn", 25, 0); val6.AddRequirement("UndeadBjornRibcage", 100, 0); val6.AddRequirement(new RequirementConfig("DragonReactorCore", 3, 0, true)); val6.CraftingStation = "blackforge"; val6.MinStationLevel = 3; val6.RepairStation = "blackforge"; val6.Name = "$item_sei"; val6.Description = "$item_sei_desc"; ItemConfig val7 = new ItemConfig(); val7.Amount = 1; val7.AddRequirement("BlackMetal", 150, 0); val7.AddRequirement("Bilebag", 50, 0); val7.AddRequirement("YmirRemains", 100, 0); val7.AddRequirement(new RequirementConfig("DragonReactorCore", 3, 0, true)); val7.CraftingStation = "blackforge"; val7.RepairStation = "blackforge"; val7.Name = "$item_shield_wen"; val7.Description = "$item_shield_wen_desc"; ItemConfig val8 = new ItemConfig(); val8.Amount = 1; val8.AddRequirement("Mandible", 10, 0); val8.AddRequirement("Eitr", 100, 0); val8.AddRequirement("Needle", 1000, 0); val8.AddRequirement(new RequirementConfig("DragonReactorCore", 2, 0, true)); val8.CraftingStation = "blackforge"; val8.RepairStation = "blackforge"; val8.Name = "$item_knife_wensk"; val8.Description = "$item_knife_wensk_desc"; ItemConfig val9 = new ItemConfig(); val9.Amount = 1; val9.AddRequirement("Wood", 10, 0); val9.AddRequirement("Stone", 10, 0); val9.AddRequirement("Flint", 10, 0); val9.CraftingStation = "piece_workbench"; val9.RepairStation = "piece_workbench"; val9.Name = "$item_zam_meadow"; val9.Description = "$item_zam_meadow_desc"; ItemConfig val10 = new ItemConfig(); val10.Amount = 1; val10.AddRequirement("Bronze", 10, 0); val10.AddRequirement("RoundLog", 10, 0); val10.AddRequirement("TrophyBjorn", 1, 0); val10.AddRequirement(new RequirementConfig("BattleaxeZam", 1, 0, true)); val10.CraftingStation = "forge"; val10.RepairStation = "forge"; val10.Name = "$item_zam_bf"; val10.Description = "$item_zam_bf_desc"; ItemConfig val11 = new ItemConfig(); val11.Amount = 1; val11.AddRequirement("ElderBark", 10, 0); val11.AddRequirement("Iron", 10, 0); val11.AddRequirement("TrophyAbomination", 1, 0); val11.AddRequirement(new RequirementConfig("BattleaxeZam1", 1, 0, true)); val11.CraftingStation = "forge"; val11.RepairStation = "forge"; val11.Name = "$item_zam_swamp"; val11.Description = "$item_zam_swamp_desc"; ItemConfig val12 = new ItemConfig(); val12.Amount = 1; val12.AddRequirement("Silver", 10, 0); val12.AddRequirement("Obsidian", 10, 0); val12.AddRequirement("OnionSeeds", 10, 0); val12.AddRequirement(new RequirementConfig("BattleaxeZam2", 1, 0, true)); val12.CraftingStation = "forge"; val12.RepairStation = "forge"; val12.Name = "$item_zam_mountain"; val12.Description = "$item_zam_mountain_desc"; ItemConfig val13 = new ItemConfig(); val13.Amount = 1; val13.AddRequirement("BlackMetal", 10, 0); val13.AddRequirement("Needle", 10, 0); val13.AddRequirement("Tar", 10, 0); val13.AddRequirement(new RequirementConfig("BattleaxeZam3", 1, 0, true)); val13.CraftingStation = "forge"; val13.RepairStation = "forge"; val13.Name = "$item_zam_plain"; val13.Description = "$item_zam_plain_desc"; ItemConfig val14 = new ItemConfig(); val14.Amount = 1; val14.AddRequirement("YggdrasilWood", 20, 0); val14.AddRequirement("BlackMarble", 20, 0); val14.AddRequirement("Mandible", 10, 0); val14.AddRequirement(new RequirementConfig("BattleaxeZam4", 1, 0, true)); val14.CraftingStation = "blackforge"; val14.RepairStation = "blackforge"; val14.Name = "$item_zam_ML"; val14.Description = "$item_zam_ML_desc"; ItemConfig val15 = new ItemConfig(); val15.Amount = 1; val15.AddRequirement("SurtlingCore", 10, 0); val15.AddRequirement("Thunderstone", 10, 0); val15.AddRequirement(new RequirementConfig("BattleaxeZam5", 1, 0, true)); val15.AddRequirement(new RequirementConfig("DragonReactorCore", 1, 0, true)); val15.CraftingStation = "blackforge"; val15.RepairStation = "blackforge"; val15.Name = "$item_zam_ashland"; val15.Description = "$item_zam_ashland_desc"; ItemConfig val16 = new ItemConfig(); val16.Amount = 1; val16.AddRequirement("YhhdrasilWood", 100, 0); val16.AddRequirement("MechanicalSpring", 30, 0); val16.AddRequirement("Iron", 100, 0); val16.AddRequirement(new RequirementConfig("DragonReactorCore", 2, 0, true)); val16.CraftingStation = "blackforge"; val16.RepairStation = "blackforge"; val16.Name = "$item_EE"; val16.Description = "$item_EE_desc"; CustomItem val17 = new CustomItem(excaliburBundle, "THSwordExc", false, val2); ItemManager.Instance.AddItem(val17); CustomItem val18 = new CustomItem(excaliburBundle, "THSwordExm", false, val3); ItemManager.Instance.AddItem(val18); CustomItem val19 = new CustomItem(excaliburBundle, "ExcaliburExcelsus", false, val4); ItemManager.Instance.AddItem(val19); CustomItem val20 = new CustomItem(excaliburBundle, "THSwordExcP", false, val5); ItemManager.Instance.AddItem(val20); CustomItem val21 = new CustomItem(excaliburBundle, "DragonReactorCore", false, val); ItemManager.Instance.AddItem(val21); CustomItem val22 = new CustomItem(excaliburBundle, "WensKnife", false, val8); ItemManager.Instance.AddItem(val22); CustomItem val23 = new CustomItem(excaliburBundle, "WensShield", false, val7); ItemManager.Instance.AddItem(val23); CustomItem val24 = new CustomItem(excaliburBundle, "Hound", false, val6); ItemManager.Instance.AddItem(val24); CustomItem val25 = new CustomItem(excaliburBundle, "BattleaxeZam", false, val9); ItemManager.Instance.AddItem(val25); CustomItem val26 = new CustomItem(excaliburBundle, "BattleaxeZam1", false, val10); ItemManager.Instance.AddItem(val26); CustomItem val27 = new CustomItem(excaliburBundle, "BattleaxeZam2", false, val11); ItemManager.Instance.AddItem(val27); CustomItem val28 = new CustomItem(excaliburBundle, "BattleaxeZam3", false, val12); ItemManager.Instance.AddItem(val28); CustomItem val29 = new CustomItem(excaliburBundle, "BattleaxeZam4", false, val13); ItemManager.Instance.AddItem(val29); CustomItem val30 = new CustomItem(excaliburBundle, "BattleaxeZam5", false, val14); ItemManager.Instance.AddItem(val30); CustomItem val31 = new CustomItem(excaliburBundle, "BattleaxeZam6", false, val15); ItemManager.Instance.AddItem(val31); CustomItem val32 = new CustomItem(excaliburBundle, "EmergencyExit", false, val16); ItemManager.Instance.AddItem(val32); PrefabManager.OnVanillaPrefabsAvailable -= CreateExcaliburs; } private void AddInputs() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown Mouse4AttackButton = new ButtonConfig { Name = "Lionclaw", Key = (KeyCode)327, BlockOtherInputs = false }; InputManager.Instance.AddButton("com.jotunn.ExcaliburRoad", Mouse4AttackButton); } private void Update() { if (ZInput.instance == null || (Object)(object)Player.m_localPlayer == (Object)null) { return; } ItemData currentWeapon = ((Humanoid)Player.m_localPlayer).GetCurrentWeapon(); if (currentWeapon != null && !(currentWeapon.m_shared.m_name != "$item_excelsus")) { Logger.LogInfo((object)$"isXMode: {isXMode} | current HP cost: {currentWeapon.m_shared.m_secondaryAttack.m_attackHealthPercentage}"); if (isXMode) { currentWeapon.m_shared.m_secondaryAttack.m_attackHealthPercentage = 0f; currentWeapon.m_shared.m_secondaryAttack.m_damageMultiplier = 3f; currentWeapon.m_shared.m_secondaryAttack.m_attackRange = 4f; currentWeapon.m_shared.m_secondaryAttack.m_attackStamina = 100f; currentWeapon.m_shared.m_secondaryAttack.m_attackRayWidth = 0.5f; } else { currentWeapon.m_shared.m_secondaryAttack.m_attackHealthPercentage = 95f; currentWeapon.m_shared.m_secondaryAttack.m_damageMultiplier = 4.5f; currentWeapon.m_shared.m_secondaryAttack.m_attackRange = 20f; currentWeapon.m_shared.m_secondaryAttack.m_attackStamina = 250f; currentWeapon.m_shared.m_secondaryAttack.m_attackRayWidth = 1.5f; } if (Input.GetMouseButtonDown(3)) { isXMode = !isXMode; Logger.LogInfo((object)$"M4 toggled! isXMode: {isXMode}"); } } } private void AddLocalizations() { Localization = LocalizationManager.Instance.GetLocalization(); CustomLocalization localization = Localization; string text = "English"; localization.AddTranslation(ref text, new Dictionary<string, string> { { "item_sword_exc", "Excalibur" }, { "item_sword_exc_desc", "This light is the planet's hope... Proof of the life that illuminates this world! Behold! Excalibur!" }, { "item_sword_exm", "Excalibur Morgan" }, { "item_sword_exm_desc", "Vortigern, Hammer of the Vile King, reverse the rising sun. Swallow the light, Excalibur Morgan!!" }, { "item_sword_excp", "Excalibur Proto" }, { "item_sword_excp_desc", "Let's put an end to this. Seal Thirteen Decision start Approved. Bedivere, Gareth, Lancelot, Mordred, Galahad. This is a battle to save the world. Excalibur!!" }, { "item_drc", "Dragon Reactor Core" }, { "item_drc_desc", "Inexhaustible magical energy and miracles far beyond human capacity, and the price paid for them." }, { "item_knife_wensk", "Mistilteinn" }, { "item_knife_wensk_desc", "Even in the hands of the blind, it shall slay even the immortal gods." }, { "item_shield_wen", "Svalin" }, { "item_shield_wen_desc", "The courageous shield the guards Jörð from Sól's dying flame." }, { "item_excelsus", "Excalibur Excelsus" }, { "item_excelsus_desc", "Sheathed in the breath of the planet. A shining torrent of life. Victory is in our hands! Excalibur Excelsus!!" }, { "item_sei", "Freki ,the ravenous one" }, { "item_sei_desc", "Yet, though serves with thine eyes clouded in chaos. Thou, bound in the cage of madness. I am he who command these chaos" }, { "item_zam_meadow", "Axe of the witch in the meadow" }, { "item_zam_meadow_desc", "utility axe." }, { "item_zam_bf", "Axe of the witch in the blackforest" }, { "item_zam_bf_desc", "She start to do drug now." }, { "item_zam_swamp", "Axe of the witch in the swamp" }, { "item_zam_swamp_desc", "She start to learn the art of poison" }, { "item_zam_mountain", "Axe of the witch in the mountain" }, { "item_zam_mountain_desc", "She put me inside the fridge and forget about me." }, { "item_zam_plain", "Axe of the witch in the plain" }, { "item_zam_plain_desc", "She steal the local shaman spell." }, { "item_zam_ML", "Axe of the witch in the mistland" }, { "item_zam_ML_desc", "She gonna get lost in the mist some day." }, { "item_zam_ashland", "Axe of the witch in the ashland" }, { "item_zam_ashland_desc", "Our adventure might end here." }, { "item_EE", "Emergency Exit" }, { "item_EE_desc", "Thou shall not kill." } }); } } [HarmonyPatch] public static class SwapAnimatorPatch { private static string lastWeapon = ""; private static AnimatorOverrideController normalAOC; private static AnimatorOverrideController fastAOC; public static AnimatorOverrideController xAOC; [HarmonyTargetMethod] private static MethodBase TargetMethod() { return AccessTools.Method(typeof(Player), "CustomFixedUpdate", (Type[])null, (Type[])null); } private static void Postfix(Player __instance) { //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Expected O, but got Unknown //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Expected O, but got Unknown //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Expected O, but got Unknown if ((Object)(object)Player.m_localPlayer == (Object)null || (Object)(object)__instance != (Object)(object)Player.m_localPlayer) { return; } Animator componentInChildren = ((Component)__instance).GetComponentInChildren<Animator>(); if ((Object)(object)componentInChildren == (Object)null || componentInChildren.layerCount < 2) { return; } ItemData currentWeapon = ((Humanoid)__instance).GetCurrentWeapon(); if (currentWeapon == null) { return; } string name = currentWeapon.m_shared.m_name; if (((Object)(object)normalAOC == (Object)null || (Object)(object)fastAOC == (Object)null) && name != lastWeapon) { lastWeapon = name; AnimationClip val = ExcaliburRoad.excaliburBundle.LoadAsset<AnimationClip>("Excaliburswing"); AnimationClip val2 = ExcaliburRoad.excaliburBundle.LoadAsset<AnimationClip>("Lionclaw"); if ((Object)(object)val == (Object)null) { return; } normalAOC = new AnimatorOverrideController(componentInChildren.runtimeAnimatorController); List<KeyValuePair<AnimationClip, AnimationClip>> list = new List<KeyValuePair<AnimationClip, AnimationClip>>(); AnimationClip[] animationClips = ((RuntimeAnimatorController)normalAOC).animationClips; foreach (AnimationClip val3 in animationClips) { list.Add(new KeyValuePair<AnimationClip, AnimationClip>(val3, val3)); } normalAOC.ApplyOverrides((IList<KeyValuePair<AnimationClip, AnimationClip>>)list); fastAOC = new AnimatorOverrideController(componentInChildren.runtimeAnimatorController); List<KeyValuePair<AnimationClip, AnimationClip>> list2 = new List<KeyValuePair<AnimationClip, AnimationClip>>(); AnimationClip[] animationClips2 = ((RuntimeAnimatorController)fastAOC).animationClips; foreach (AnimationClip val4 in animationClips2) { if (((Object)val4).name == "Sledge-Attack1") { list2.Add(new KeyValuePair<AnimationClip, AnimationClip>(val4, val)); } else { list2.Add(new KeyValuePair<AnimationClip, AnimationClip>(val4, val4)); } } fastAOC.ApplyOverrides((IList<KeyValuePair<AnimationClip, AnimationClip>>)list2); if ((Object)(object)val2 != (Object)null) { xAOC = new AnimatorOverrideController(componentInChildren.runtimeAnimatorController); List<KeyValuePair<AnimationClip, AnimationClip>> list3 = new List<KeyValuePair<AnimationClip, AnimationClip>>(); AnimationClip[] animationClips3 = ((RuntimeAnimatorController)xAOC).animationClips; foreach (AnimationClip val5 in animationClips3) { if (((Object)val5).name == "Sledge-Attack1") { list3.Add(new KeyValuePair<AnimationClip, AnimationClip>(val5, val2)); } else { list3.Add(new KeyValuePair<AnimationClip, AnimationClip>(val5, val5)); } } xAOC.ApplyOverrides((IList<KeyValuePair<AnimationClip, AnimationClip>>)list3); } } if (name == "$item_excelsus") { if (ExcaliburRoad.isXMode && (Object)(object)xAOC != (Object)null) { componentInChildren.runtimeAnimatorController = (RuntimeAnimatorController)(object)xAOC; } else { componentInChildren.runtimeAnimatorController = (RuntimeAnimatorController)(object)fastAOC; } } else if (name != lastWeapon) { lastWeapon = name; componentInChildren.runtimeAnimatorController = (RuntimeAnimatorController)(object)normalAOC; } } } [HarmonyPatch(typeof(Hud), "DamageFlash")] public static class ExcaliburFlashPatch { private static bool Prefix() { Player localPlayer = Player.m_localPlayer; ItemData val = ((localPlayer != null) ? ((Humanoid)localPlayer).GetCurrentWeapon() : null); if (val == null) { return true; } if (val.m_shared.m_name == "$item_excelsus") { return false; } return true; } } [HarmonyPatch(typeof(Humanoid), "StartAttack")] public static class EnergyBladePatch { private static bool isShowing; private static void Postfix(Humanoid __instance, Character target, bool secondaryAttack, bool __result) { Player val = (Player)(object)((__instance is Player) ? __instance : null); if (val == null || (Object)(object)val != (Object)(object)Player.m_localPlayer || !secondaryAttack || !__result || isShowing || ExcaliburRoad.isXMode) { return; } ItemData currentWeapon = ((Humanoid)val).GetCurrentWeapon(); if (currentWeapon == null || currentWeapon.m_shared.m_name != "$item_excelsus") { return; } VisEquipment componentInChildren = ((Component)val).GetComponentInChildren<VisEquipment>(); if ((Object)(object)componentInChildren == (Object)null) { return; } FieldInfo fieldInfo = AccessTools.Field(typeof(VisEquipment), "m_rightItemInstance"); object? value = fieldInfo.GetValue(componentInChildren); GameObject val2 = (GameObject)((value is GameObject) ? value : null); if (!((Object)(object)val2 == (Object)null)) { Transform val3 = val2.transform.Find("BeamBlade"); Logger.LogInfo((object)$"blade null: {(Object)(object)val3 == (Object)null}"); if (!((Object)(object)val3 == (Object)null)) { isShowing = true; ((MonoBehaviour)val).StartCoroutine(ShowBlades(val3)); } } } private static IEnumerator ShowBlades(Transform blade) { ((Component)blade).gameObject.SetActive(true); yield return (object)new WaitForSeconds(1.5f); ((Component)blade).gameObject.SetActive(false); isShowing = false; } } [HarmonyPatch(typeof(Attack), "DoMeleeAttack")] public static class BlockTriggerEffectPatch { private static void Prefix(Attack __instance) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Expected O, but got Unknown Player localPlayer = Player.m_localPlayer; ItemData val = ((localPlayer != null) ? ((Humanoid)localPlayer).GetCurrentWeapon() : null); if (val != null && !(val.m_shared.m_name != "$item_excelsus") && ExcaliburRoad.isXMode) { __instance.m_triggerEffect = new EffectList(); } } }