Decompiled source of WeedKillerUtils v1.0.1

WeedKillerUtils.dll

Decompiled a day ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
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("TestLCMod")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("TestLCMod")]
[assembly: AssemblyCopyright("Copyright ©  2026")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("d7aa81e1-2877-48fd-9e2e-174e5ad5a2d1")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace TestLCMod
{
	[HarmonyPatch(typeof(StartOfRound))]
	public class RoundStartPatch
	{
		[HarmonyPatch("Start")]
		[HarmonyPostfix]
		public static void RoundStartPostfix()
		{
			Debug.Log((object)"ROUND START DETECTED");
		}
	}
}
namespace BetterWeedKiller
{
	[HarmonyPatch(typeof(SprayPaintItem))]
	public class WeedKillerPatch
	{
		[HarmonyPatch("Start")]
		[HarmonyPostfix]
		public static void IncreaseFuelPostfix(SprayPaintItem __instance)
		{
			if (__instance.isWeedKillerSprayBottle)
			{
				Traverse.Create((object)__instance).Field("sprayCanTank").SetValue((object)Plugin.FuelMultiplier.Value);
			}
		}

		[HarmonyPatch("ResizeMatrix")]
		[HarmonyPrefix]
		public static void IncreaseDamagePrefix(ref float shrinkSpeed, bool shrink)
		{
			if (shrink)
			{
				shrinkSpeed *= Plugin.KillSpeedMultiplier.Value;
			}
		}
	}
	[HarmonyPatch(typeof(Terminal))]
	internal class PricePatch
	{
		[HarmonyPatch("SetItemSales")]
		[HarmonyPostfix]
		private static void Postfix_SetPrice(Terminal __instance)
		{
			Item[] buyableItemsList = __instance.buyableItemsList;
			foreach (Item val in buyableItemsList)
			{
				if ((Object)(object)val != (Object)null && val.itemName.Equals("Weed Killer", StringComparison.OrdinalIgnoreCase))
				{
					val.creditsWorth = Plugin.WeedKillerPrice.Value;
					Debug.Log((object)$"[WeedKillerTweaks] Set {val.itemName} price to {val.creditsWorth}");
					break;
				}
			}
		}
	}
	[BepInPlugin("com.donobus.WeedKillerUtils", "WeedKillerUtils", "1.0.0")]
	public class Plugin : BaseUnityPlugin
	{
		public static ConfigEntry<float> FuelMultiplier;

		public static ConfigEntry<float> KillSpeedMultiplier;

		public static ConfigEntry<int> WeedKillerPrice;

		private void Awake()
		{
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Expected O, but got Unknown
			FuelMultiplier = ((BaseUnityPlugin)this).Config.Bind<float>("General", "Tank Capacity Multiplier", 1f, "How much more fuel the Weed Killer has.");
			KillSpeedMultiplier = ((BaseUnityPlugin)this).Config.Bind<float>("General", "Effectiveness Multiplier", 1f, "How much faster the weeds get killed.");
			WeedKillerPrice = ((BaseUnityPlugin)this).Config.Bind<int>("General", "Price", 20, "The price of the Weed Killer in the terminal store.");
			Harmony val = new Harmony("com.donobus.WeedKillerUtils");
			val.PatchAll();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"WeedKillerUtils Loaded!");
		}
	}
}