Decompiled source of 10x AmmoMultiplier v0.1.1

DSP_10xAmmoMultiplier.dll

Decompiled 10 months ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("DSP_10xAmmoMultiplier")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DSP_10xAmmoMultiplier")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("458a842b-1155-43ca-a989-cb8ef36692d7")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8.1", FrameworkDisplayName = ".NET Framework 4.8.1")]
[assembly: AssemblyVersion("1.0.0.0")]
[BepInPlugin("decxi.dsp.ammomultiplier", "ammomultiplier", "0.1.0.0")]
internal class Plugin : BaseUnityPlugin
{
	internal static ManualLogSource adLog;

	private void Awake()
	{
		adLog = ((BaseUnityPlugin)this).Logger;
		adLog.LogInfo((object)"Bullet thingy mod is now le on");
		Harmony.CreateAndPatchAll(typeof(Plugin), (string)null);
	}

	[HarmonyPostfix]
	[HarmonyPatch(typeof(VFPreload), "InvokeOnLoadWorkEnded")]
	private static void VFPreload_InvokeOnLoadWorkEnded__Postfix()
	{
		ItemProto[] dataArray = ((ProtoSet<ItemProto>)(object)LDB.items).dataArray;
		foreach (ItemProto val in dataArray)
		{
			if (val.isAmmo)
			{
				adLog.LogInfo((object)$"{((Proto)val).name} bullets: {val.HpMax} -> {val.HpMax * 10}");
				val.HpMax *= 10;
			}
		}
	}
}