using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using CaptlandFreeBasicItems.Patches;
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("CaptlandFreeBasicItems")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CaptlandFreeBasicItems")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("64adc5cf-f47a-4f94-ba3b-d5d5b09af023")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace CaptlandFreeBasicItems
{
public class Config
{
public static ConfigEntry<int> configWalkieTalkiePrice;
public static ConfigEntry<int> configFlashlightPrice;
public static ConfigEntry<int> configShovelPrice;
public static ConfigEntry<int> configLockpickerPrice;
public static ConfigEntry<int> configProFlashlightPrice;
public static ConfigEntry<int> configStunGrenadePrice;
public static ConfigEntry<int> configBoomboxPrice;
public static ConfigEntry<int> configInhalantPrice;
public static ConfigEntry<int> configZapGunPrice;
public static ConfigEntry<int> configJetpackPrice;
public static ConfigEntry<int> configExtensionLadderPrice;
public static ConfigEntry<int> configRadarBoosterPrice;
public static ConfigEntry<int> configSprayPaintPrice;
public Config(ConfigFile cfg)
{
configWalkieTalkiePrice = cfg.Bind<int>("General", "WalkieTalkiePrice", 0, "Price of Walkie-Talkie");
configFlashlightPrice = cfg.Bind<int>("General", "FlashlightPrice", 0, "Price of Flashlight");
configShovelPrice = cfg.Bind<int>("General", "ShovelPrice", 0, "Price of Shovel");
configLockpickerPrice = cfg.Bind<int>("General", "LockerpickerPrice", 0, "Price of Lockpicker");
configProFlashlightPrice = cfg.Bind<int>("General", "ProFlashlightPrice", 0, "Price of Pro Flashlight");
configStunGrenadePrice = cfg.Bind<int>("General", "StunGrenadePrice", 0, "Price of Stun Grenade");
configBoomboxPrice = cfg.Bind<int>("General", "BoomboxPrice", 0, "Price of Boombox");
configInhalantPrice = cfg.Bind<int>("General", "InhalantPrice", 0, "Price of Inhalant");
configZapGunPrice = cfg.Bind<int>("General", "ZapGunPrice", 0, "Price of Zap Gun");
configJetpackPrice = cfg.Bind<int>("General", "JetpackPrice", 0, "Price of Jetpack");
configExtensionLadderPrice = cfg.Bind<int>("General", "ExtensionLadderPrice", 0, "Price of Extension Ladder");
configRadarBoosterPrice = cfg.Bind<int>("General", "RadarBoosterPrice", 0, "Price of Radar Booster");
configSprayPaintPrice = cfg.Bind<int>("General", "SprayPaintPrice", 0, "Price of Spray Paint");
}
}
[BepInPlugin("Captland.FreeBasicItems", "Captland's Free Basic Items", "1.0.0")]
public class FreeBasicItemsBase : BaseUnityPlugin
{
private const string modGUID = "Captland.FreeBasicItems";
private const string modName = "Captland's Free Basic Items";
private const string modVersion = "1.0.0";
private readonly Harmony harmony = new Harmony("Captland.FreeBasicItems");
private static FreeBasicItemsBase Instance;
public int test = 0;
internal ManualLogSource mls;
public static Config MyConfig { get; internal set; }
private void Awake()
{
if ((Object)(object)Instance == (Object)null)
{
Instance = this;
}
Config config = new Config(((BaseUnityPlugin)this).Config);
mls = Logger.CreateLogSource("Captland.FreeBasicItems");
mls.LogInfo((object)"Captland's Free Basic Items is loaded!");
harmony.PatchAll(typeof(FreeBasicItemsBase));
harmony.PatchAll(typeof(TerminalPatch));
}
}
}
namespace CaptlandFreeBasicItems.Patches
{
[HarmonyPatch(typeof(Terminal))]
internal class TerminalPatch
{
[HarmonyPatch("SetItemSales")]
[HarmonyPostfix]
private static void patchStorePrices(ref Item[] ___buyableItemsList)
{
___buyableItemsList[0].creditsWorth = Config.configWalkieTalkiePrice.Value;
___buyableItemsList[1].creditsWorth = Config.configFlashlightPrice.Value;
___buyableItemsList[2].creditsWorth = Config.configShovelPrice.Value;
___buyableItemsList[3].creditsWorth = Config.configLockpickerPrice.Value;
___buyableItemsList[4].creditsWorth = Config.configProFlashlightPrice.Value;
___buyableItemsList[5].creditsWorth = Config.configStunGrenadePrice.Value;
___buyableItemsList[6].creditsWorth = Config.configBoomboxPrice.Value;
___buyableItemsList[7].creditsWorth = Config.configInhalantPrice.Value;
___buyableItemsList[8].creditsWorth = Config.configZapGunPrice.Value;
___buyableItemsList[9].creditsWorth = Config.configJetpackPrice.Value;
___buyableItemsList[10].creditsWorth = Config.configExtensionLadderPrice.Value;
___buyableItemsList[11].creditsWorth = Config.configRadarBoosterPrice.Value;
___buyableItemsList[12].creditsWorth = Config.configSprayPaintPrice.Value;
}
}
}