Decompiled source of SomePriceMod v1.0.1

SomePriceMod.dll

Decompiled 10 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("SomePriceMod")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyCopyright("Vaerik")]
[assembly: AssemblyDescription("Custom price for items in the game")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("SomePriceMod")]
[assembly: AssemblyTitle("SomePriceMod")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[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 SomePriceMod
{
	[BepInPlugin("com.vaerik.github.SomePricingMod", "SomePricingMod", "1.0.0")]
	public class Plugin : BaseUnityPlugin
	{
		public const string ID = "com.vaerik.github.SomePricingMod";

		public const string NOM = "SomePricingMod";

		public const string VERSION = "1.0.0";

		internal static ManualLogSource log;

		internal static ConfigEntry<int> config_WalkieTalkie;

		internal static ConfigEntry<int> config_Flashlight;

		internal static ConfigEntry<int> config_Shovel;

		internal static ConfigEntry<int> config_Lockpicker;

		internal static ConfigEntry<int> config_Proflashlight;

		internal static ConfigEntry<int> config_StunGrenade;

		internal static ConfigEntry<int> config_Boombox;

		internal static ConfigEntry<int> config_TZPInhalant;

		internal static ConfigEntry<int> config_ZapGun;

		internal static ConfigEntry<int> config_Jetpack;

		internal static ConfigEntry<int> config_ExtensionLadder;

		internal static ConfigEntry<int> config_Radarbooster;

		internal static ConfigEntry<int> config_SprayPaint;

		private readonly Harmony harmony = new Harmony("1.0.0");

		public static Plugin instance { get; private set; }

		private void Awake()
		{
			instance = this;
			log = ((BaseUnityPlugin)this).Logger;
			harmony.PatchAll();
			config_WalkieTalkie = ((BaseUnityPlugin)this).Config.Bind<int>("Settings", "Walkie-Talkie", 12, "Change the price for the Walkie-Talkie (default : 12)");
			config_Flashlight = ((BaseUnityPlugin)this).Config.Bind<int>("Settings", "Flashlight", 15, "Change the price for the Flashlight (default : 15)");
			config_Shovel = ((BaseUnityPlugin)this).Config.Bind<int>("Settings", "Shovel", 30, "Change the price for the Shovel (default : 30)");
			config_Lockpicker = ((BaseUnityPlugin)this).Config.Bind<int>("Settings", "Lockpicker", 20, "Change the price for the Lockpicker (default : 20)");
			config_Proflashlight = ((BaseUnityPlugin)this).Config.Bind<int>("Settings", "Pro-flashlight", 25, "Change the price for the Walkie-Talkie (default : 25)");
			config_StunGrenade = ((BaseUnityPlugin)this).Config.Bind<int>("Settings", "StunGrenade", 30, "Change the price for the StunGrenade (default : 30)");
			config_Boombox = ((BaseUnityPlugin)this).Config.Bind<int>("Settings", "Boombox", 60, "Change the price for the Boombox (default : 60)");
			config_TZPInhalant = ((BaseUnityPlugin)this).Config.Bind<int>("Settings", "TZP-Inhalant", 120, "Change the price for the TZP-Inhalant (default : 120)");
			config_ZapGun = ((BaseUnityPlugin)this).Config.Bind<int>("Settings", "ZapGun", 400, "Change the price for the ZapGun (default : 400)");
			config_Jetpack = ((BaseUnityPlugin)this).Config.Bind<int>("Settings", "Jetpack", 400, "Change the price for the Jetpack (default : 400)");
			config_ExtensionLadder = ((BaseUnityPlugin)this).Config.Bind<int>("Settings", "ExtensionLadder", 60, "Change the price for the ExtensionLadder (default : 60)");
			config_Radarbooster = ((BaseUnityPlugin)this).Config.Bind<int>("Settings", "Radar-booster", 60, "Change the price for the Radar-booster (default : 60)");
			config_SprayPaint = ((BaseUnityPlugin)this).Config.Bind<int>("Settings", "Spray-Paint", 50, "Change the price for the Spray-Paint (default : 50)");
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin SomePricingModis loaded!");
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "SomePriceMod";

		public const string PLUGIN_NAME = "SomePriceMod";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}
namespace SomePriceMod.Patches
{
	[HarmonyPatch(typeof(Terminal))]
	internal class PricePatches
	{
		[HarmonyPatch("SetItemSales")]
		[HarmonyPostfix]
		private static void StorePrices(ref Item[] ___buyableItemsList)
		{
			___buyableItemsList[0].creditsWorth = Plugin.config_WalkieTalkie.Value;
			___buyableItemsList[1].creditsWorth = Plugin.config_Flashlight.Value;
			___buyableItemsList[2].creditsWorth = Plugin.config_Shovel.Value;
			___buyableItemsList[3].creditsWorth = Plugin.config_Lockpicker.Value;
			___buyableItemsList[4].creditsWorth = Plugin.config_Proflashlight.Value;
			___buyableItemsList[5].creditsWorth = Plugin.config_StunGrenade.Value;
			___buyableItemsList[6].creditsWorth = Plugin.config_Boombox.Value;
			___buyableItemsList[7].creditsWorth = Plugin.config_TZPInhalant.Value;
			___buyableItemsList[8].creditsWorth = Plugin.config_ZapGun.Value;
			___buyableItemsList[9].creditsWorth = Plugin.config_Jetpack.Value;
			___buyableItemsList[10].creditsWorth = Plugin.config_ExtensionLadder.Value;
			___buyableItemsList[11].creditsWorth = Plugin.config_Radarbooster.Value;
			___buyableItemsList[12].creditsWorth = Plugin.config_SprayPaint.Value;
		}
	}
}