Decompiled source of Battleaxe And Sledge Buffs v1.0.2

battleaxe_sledge_buffs.dll

Decompiled a day ago
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 BepInEx.Logging;
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("battleaxe_sledge_buffs")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("battleaxe_sledge_buffs")]
[assembly: AssemblyCopyright("Copyright ©  2026")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("d2a67589-e695-4640-b93c-13d4aa6250e4")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace battleaxe_sledge_buffs;

[BepInPlugin("doom_hamster.battleaxe_sledge_buffs", "Battleaxe And Sledge Buffs", "1.0.0")]
[BepInProcess("valheim.exe")]
public class BuffedStats : BaseUnityPlugin
{
	[HarmonyPatch(typeof(ObjectDB), "Awake")]
	public class ObjectDBPatch
	{
		[HarmonyPostfix]
		private static void Postfix(ObjectDB __instance)
		{
			foreach (GameObject item in __instance.m_items)
			{
				if (((Object)item).name == "BattleaxeWood" || ((Object)item).name == "Battleaxe" || ((Object)item).name == "BattleaxeCrystal" || ((Object)item).name == "BattleaxeSkullSplittur" || ((Object)item).name == "BattleaxeBlackmetal" || ((Object)item).name == "BattleaxeGold" || ((Object)item).name == "BattleaxeGold_FrostFire" || ((Object)item).name == "BattleaxeGold_BloodLightning")
				{
					ItemDrop component = item.GetComponent<ItemDrop>();
					if (component.m_itemData.m_shared.m_attack.m_attackAdrenaline < 2.45f)
					{
						component.m_itemData.m_shared.m_attackForce = 40f;
						Attack attack = component.m_itemData.m_shared.m_attack;
						attack.m_attackStamina += -3f;
						component.m_itemData.m_shared.m_attack.m_attackAdrenaline = 2.5f;
						component.m_itemData.m_shared.m_attack.m_speedFactorRotation = 0.7f;
						component.m_itemData.m_shared.m_attack.m_attackRange = 2.55f;
						component.m_itemData.m_shared.m_deflectionForce = 40f;
						component.m_itemData.m_shared.m_attack.m_speedFactor = 0.25f;
						component.m_itemData.m_shared.m_movementModifier = -0.05f;
						if (component.m_itemData.m_shared.m_secondaryAttack != null)
						{
							component.m_itemData.m_shared.m_secondaryAttack.m_forceMultiplier = 1.25f;
							Attack secondaryAttack = component.m_itemData.m_shared.m_secondaryAttack;
							secondaryAttack.m_attackStamina += -1f;
							component.m_itemData.m_shared.m_secondaryAttack.m_damageMultiplier = 0.4f;
							component.m_itemData.m_shared.m_secondaryAttack.m_staggerMultiplier = 3.75f;
							component.m_itemData.m_shared.m_secondaryAttack.m_attackRange = 2.65f;
						}
					}
				}
				if (((Object)item).name == "SledgeWood" || ((Object)item).name == "SledgeStagbreaker" || ((Object)item).name == "SledgeIron" || ((Object)item).name == "SledgeDemolisher" || ((Object)item).name == "SledgeGold" || ((Object)item).name == "SledgeGold_FrostFire" || ((Object)item).name == "SledgeGold_BloodLightning")
				{
					ItemDrop component2 = item.GetComponent<ItemDrop>();
					if (component2.m_itemData.m_shared.m_attack.m_attackAdrenaline < 2.45f)
					{
						Attack attack2 = component2.m_itemData.m_shared.m_attack;
						attack2.m_attackStamina += -2f;
						component2.m_itemData.m_shared.m_attack.m_attackAdrenaline = 2.5f;
						component2.m_itemData.m_shared.m_movementModifier = -0.1f;
					}
				}
			}
		}
	}

	private readonly Harmony harmony = new Harmony("doom_hamster.battleaxe_sledge_buffs");

	internal static ManualLogSource Log;

	private void Awake()
	{
		Log = ((BaseUnityPlugin)this).Logger;
		harmony.PatchAll();
	}
}