Decompiled source of Teliots Paper Rolls Saver v1.0.1

TeliotsPaperRollsLethalCompanyMod.dll

Decompiled 4 days 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 GameNetcodeStuff;
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("TeliotsPaperRollsLethalCompanyMod")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("TeliotsPaperRollsLethalCompanyMod")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("f5f77c01-780a-4165-819c-8ea229fd4190")]
[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 TeliotsPaperRollsLethalCompanyMod;

[HarmonyPatch(typeof(DepositItemsDesk))]
internal class DepositItemsDeskPatch
{
	private static ManualLogSource logger = Logger.CreateLogSource("B0BTR0N.teliots_saver");

	[HarmonyPatch("PlaceItemOnCounter")]
	[HarmonyPostfix]
	private static void dontSellTeliots(DepositItemsDesk __instance, PlayerControllerB playerWhoTriggered)
	{
		logger.LogInfo((object)("playerWhoTriggered: " + playerWhoTriggered.playerUsername));
		__instance.itemsOnCounter.ForEach(delegate(GrabbableObject item)
		{
			if ((Object)(object)item != (Object)null)
			{
				logger.LogInfo((object)$"{item}");
				if (((Object)item).name.Equals("ToiletPaperRolls") || ((Object)item).name.Equals("ToiletPaperRolls(Clone)"))
				{
					logger.LogInfo((object)"Attempting to sell Teliot's, oopsies");
					__instance.Attack();
				}
			}
		});
	}
}
[BepInPlugin("B0BTR0N.teliots_saver", "Teliots Paper Roll Saver", "1.0.0")]
public class ModBase : BaseUnityPlugin
{
	private const string modGUID = "B0BTR0N.teliots_saver";

	private const string modName = "Teliots Paper Roll Saver";

	private const string modVersion = "1.0.0";

	private readonly Harmony harmony = new Harmony("B0BTR0N.teliots_saver");

	internal ManualLogSource logger;

	private void Awake()
	{
		logger = Logger.CreateLogSource("B0BTR0N.teliots_saver");
		logger.LogInfo((object)"Loading Teliots Paper Roll Saver");
		Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), (string)null);
	}
}