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 balrond kickaxemajster v1.0.0
plugins/BalrondKickAxeMajster.dll
Decompiled 3 months agousing System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using HarmonyLib; 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("ProjectAshlands")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("ProjectAshlands")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("f405ea1c-ac25-47a3-9aa2-a8f56c14bfd6")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace BalrondKickAxeMajster; [BepInPlugin("balrond.astafaraios.BalrondKickAxeMajster", "ZZZ_BalrondKickAxeMajster", "1.0.0")] public class Launch : BaseUnityPlugin { [HarmonyPatch(typeof(Game), "Awake")] private static class Game_Awake_Patch { public static void Prefix() { ZNetScene_Awake_Patch.hasSpawned = false; } } [HarmonyPatch(typeof(ZNetScene), "Awake")] private static class ZNetScene_Awake_Patch { public static bool hasSpawned; public static void Prefix(ZNetScene __instance) { if ((Object)(object)__instance == (Object)null) { Debug.LogWarning((object)"ZZZ_BalrondKickAxeMajster: No ZNetScene found"); } else { if (hasSpawned) { return; } List<GameObject> list = __instance.m_prefabs.FindAll((GameObject x) => ((Object)x).name.Contains("AxeBerzerkr")); list.Add(__instance.m_prefabs.Find((GameObject x) => ((Object)x).name.Contains("AxeEarly"))); GameObject claw = __instance.m_prefabs.Find((GameObject x) => ((Object)x).name == "FistFenrirClaw"); foreach (GameObject item in list) { if (!((Object)item).name.Contains("Anchor")) { itemEdits.EditDoubleAxes(item, claw); } } hasSpawned = true; } } } private readonly Harmony harmony = new Harmony("balrond.astafaraios.BalrondKickAxeMajster"); public const string PluginGUID = "balrond.astafaraios.BalrondKickAxeMajster"; public const string PluginName = "ZZZ_BalrondKickAxeMajster"; public const string PluginVersion = "1.0.0"; public static AxeSetter itemEdits = new AxeSetter(); public static GameObject RootObject; public static GameObject PrefabContainer; private void Awake() { harmony.PatchAll(); } private void OnDestroy() { harmony.UnpatchSelf(); } private static bool IsObjectDBValid() { ObjectDB instance = ObjectDB.instance; return (Object)(object)instance != (Object)null && instance.m_items.Count > 0 && instance.m_recipes.Count > 0 && (Object)(object)instance.GetItemPrefab("Amber") != (Object)null; } } public class AxeSetter { public void EditDoubleAxes(GameObject doubleAxe, GameObject claw) { if ((Object)(object)doubleAxe == (Object)null) { Debug.LogWarning((object)"double Axe is null"); return; } ItemDrop component = doubleAxe.GetComponent<ItemDrop>(); if ((Object)(object)component == (Object)null) { return; } Debug.Log((object)("Working with doubleAxe: " + ((Object)doubleAxe).name)); Attack val = component.m_itemData.m_shared.m_secondaryAttack.Clone(); if (val == null || val.m_attackAnimation != "dualaxes_secondary") { Debug.Log((object)("Double Axe Secondary not standard skipping: " + ((Object)doubleAxe).name)); return; } ItemDrop component2 = claw.GetComponent<ItemDrop>(); if (!((Object)(object)component2 == (Object)null)) { Attack val2 = component2.m_itemData.m_shared.m_secondaryAttack.Clone(); if (val2 != null) { component.m_itemData.m_shared.m_secondaryAttack = val2; } } } private void CopyAttackEffects(Attack attack, SharedData shared) { attack.m_hitEffect = shared.m_hitEffect; attack.m_hitTerrainEffect = shared.m_hitTerrainEffect; attack.m_startEffect = shared.m_startEffect; attack.m_trailStartEffect = shared.m_trailStartEffect; attack.m_triggerEffect = shared.m_triggerEffect; } private void ClearAttackEffects(SharedData shared) { shared.m_hitEffect = null; shared.m_hitTerrainEffect = null; shared.m_startEffect = null; shared.m_trailStartEffect = null; shared.m_triggerEffect = null; } }