Decompiled source of FreeShop v35.2.2

plugins/FreeShopMod.dll

Decompiled a day ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("FreeShopMod")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("FreeShopMod")]
[assembly: AssemblyTitle("FreeShopMod")]
[assembly: AssemblyVersion("1.0.0.0")]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace FreeShopMod
{
	[BepInPlugin("com.freeshopmod.freeshop", "Free Shop", "12.0.0")]
	public class FreeShopMod : BaseUnityPlugin
	{
		internal static ManualLogSource Log;

		private void Awake()
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Expected O, but got Unknown
			Log = ((BaseUnityPlugin)this).Logger;
			((BaseUnityPlugin)this).Logger.LogInfo((object)"FreeShop Mod v12.0.0 loaded!");
			Harmony val = new Harmony("com.freeshopmod.freeshop");
			val.PatchAll();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"EVERYTHING IS FREE (negative pricing)!");
		}
	}
	[HarmonyPatch(typeof(ShopManager), "UpgradeValueGet")]
	public class UpgradeValueGetPatch
	{
		public static bool Prefix(ref float __result)
		{
			__result = -1000f;
			return false;
		}
	}
	[HarmonyPatch(typeof(ShopManager), "HealthPackValueGet")]
	public class HealthPackValueGetPatch
	{
		public static bool Prefix(ref float __result)
		{
			__result = -1000f;
			return false;
		}
	}
	[HarmonyPatch(typeof(ShopManager), "CrystalValueGet")]
	public class CrystalValueGetPatch
	{
		public static bool Prefix(ref float __result)
		{
			__result = -1000f;
			return false;
		}
	}
	[HarmonyPatch(typeof(ItemAttributes), "GetValue")]
	public class ItemAttributesGetValuePatch
	{
		public static void Prefix(ItemAttributes __instance)
		{
			FieldInfo field = typeof(ItemAttributes).GetField("itemValueMin", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
			FieldInfo field2 = typeof(ItemAttributes).GetField("itemValueMax", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
			if (field != null)
			{
				field.SetValue(__instance, -1000f);
			}
			if (field2 != null)
			{
				field2.SetValue(__instance, -1000f);
			}
		}

		public static void Postfix(ItemAttributes __instance)
		{
			FieldInfo field = typeof(ItemAttributes).GetField("itemValueMin", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
			FieldInfo field2 = typeof(ItemAttributes).GetField("itemValueMax", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
			if (field != null)
			{
				field.SetValue(__instance, -1000f);
			}
			if (field2 != null)
			{
				field2.SetValue(__instance, -1000f);
			}
		}
	}
}