Decompiled source of 5CreditSprayPaintMod v1.1.0

5CreditSprayPaintMod.dll

Decompiled 11 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;
using UnityEngine;
using _5CreditSprayPaintMod.Patches;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("5CreditSprayPaintMod")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("5CreditSprayPaintMod")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("a5be9a2d-5228-4344-b5ad-f004aefb3e79")]
[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 _5CreditSprayPaintMod
{
	[BepInPlugin("YellowGameDev.5CreditSprayPaintMod", "5CreditSprayPaintMod", "2.0.0.0")]
	public class _5CreditSprayPaintBaseMod : BaseUnityPlugin
	{
		private const string modGUID = "YellowGameDev.5CreditSprayPaintMod";

		private const string modName = "5CreditSprayPaintMod";

		private const string modVersion = "2.0.0.0";

		private readonly Harmony harmony = new Harmony("YellowGameDev.5CreditSprayPaintMod");

		private static _5CreditSprayPaintBaseMod Instance;

		internal ManualLogSource mls;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			mls = Logger.CreateLogSource("YellowGameDev.5CreditSprayPaintMod");
			mls.LogInfo((object)"_5CreditSprayPaintMod has awaken");
			harmony.PatchAll(typeof(_5CreditSprayPaintBaseMod));
			harmony.PatchAll(typeof(CostFixForSprayPaint));
			harmony.PatchAll(typeof(InfiniteSprayPatch));
		}
	}
}
namespace _5CreditSprayPaintMod.Patches
{
	[HarmonyPatch(typeof(Terminal))]
	internal class CostFixForSprayPaint
	{
		[HarmonyPatch("Update")]
		[HarmonyPrefix]
		private static void sprayPaintCostFixPatch(ref Item[] ___buyableItemsList, ref int[] ___itemSalesPercentages)
		{
			for (int i = 0; i < ___buyableItemsList.Length; i++)
			{
				if (___buyableItemsList[i].itemName == "Spray paint")
				{
					___buyableItemsList[i].creditsWorth = 5 * (___itemSalesPercentages[i] / 100);
				}
			}
		}
	}
	[HarmonyPatch(typeof(SprayPaintItem))]
	internal class InfiniteSprayPatch
	{
		[HarmonyPatch("LateUpdate")]
		[HarmonyPostfix]
		private static void infiniteSprayPaintPatch(ref float ___sprayCanTank)
		{
			___sprayCanTank = 0.1f;
		}
	}
}