using System;
using System.Collections.Generic;
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 HarmonyLib;
using LethalCompanyPluginTemplate.Patches;
using Microsoft.CodeAnalysis;
using UnityEngine;
[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("StorePrices")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("alter Store Prices")]
[assembly: AssemblyFileVersion("1.0.1.0")]
[assembly: AssemblyInformationalVersion("1.0.1+b49fca30c7fb3c90e1cd659fc3d189457dab2c37")]
[assembly: AssemblyProduct("StorePrices")]
[assembly: AssemblyTitle("StorePrices")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.1.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 LethalCompanyPluginTemplate
{
[BepInPlugin("StorePrices", "StorePrices", "1.0.1")]
public class Plugin : BaseUnityPlugin
{
public static Plugin Instance;
private readonly Harmony harmony = new Harmony("StorePrices");
public static ConfigEntry<int> WalkieTalkie;
public static ConfigEntry<int> Flashlight;
public static ConfigEntry<int> Shovel;
public static ConfigEntry<int> Lockpicker;
public static ConfigEntry<int> ProFlashlight;
public static ConfigEntry<int> Stun_granade;
public static ConfigEntry<int> Boombox;
public static ConfigEntry<int> TZP;
public static ConfigEntry<int> Zap_gun;
public static ConfigEntry<int> Jetpack;
public static ConfigEntry<int> Extension_ladder;
public static ConfigEntry<int> Radar_booster;
public static ConfigEntry<int> Spray_paint;
private void Awake()
{
if ((Object)(object)Instance == (Object)null)
{
Instance = this;
}
((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin StorePrices is loading!");
LoadConfigs();
harmony.PatchAll(typeof(Plugin));
harmony.PatchAll(typeof(salesPatch));
}
private void LoadConfigs()
{
WalkieTalkie = ((BaseUnityPlugin)this).Config.Bind<int>("Settings", "WalkieTalkie", 12, "");
Flashlight = ((BaseUnityPlugin)this).Config.Bind<int>("Settings", "Flashlight", 15, "");
Shovel = ((BaseUnityPlugin)this).Config.Bind<int>("Settings", "Shovel", 30, "");
Lockpicker = ((BaseUnityPlugin)this).Config.Bind<int>("Settings", "Lockpicker", 20, "");
ProFlashlight = ((BaseUnityPlugin)this).Config.Bind<int>("Settings", "ProFlashlight", 25, "");
Stun_granade = ((BaseUnityPlugin)this).Config.Bind<int>("Settings", "Stun granade", 40, "");
Boombox = ((BaseUnityPlugin)this).Config.Bind<int>("Settings", "Boombox", 60, "");
TZP = ((BaseUnityPlugin)this).Config.Bind<int>("Settings", "TZP", 120, "");
Zap_gun = ((BaseUnityPlugin)this).Config.Bind<int>("Settings", "Zap gun", 400, "");
Jetpack = ((BaseUnityPlugin)this).Config.Bind<int>("Settings", "Jetpack", 700, "");
Extension_ladder = ((BaseUnityPlugin)this).Config.Bind<int>("Settings", "Extension ladder", 60, "");
Radar_booster = ((BaseUnityPlugin)this).Config.Bind<int>("Settings", "Radar booster", 50, "");
Spray_paint = ((BaseUnityPlugin)this).Config.Bind<int>("Settings", "Spray paint", 50, "");
}
}
public static class PluginInfo
{
public const string PLUGIN_GUID = "StorePrices";
public const string PLUGIN_NAME = "StorePrices";
public const string PLUGIN_VERSION = "1.0.1";
}
}
namespace LethalCompanyPluginTemplate.Patches
{
[HarmonyPatch(typeof(Terminal))]
internal class salesPatch
{
[HarmonyPatch("SetItemSales")]
[HarmonyPostfix]
private static void StorePrices(ref Item[] ___buyableItemsList)
{
___buyableItemsList[0].creditsWorth = Plugin.WalkieTalkie.Value;
___buyableItemsList[1].creditsWorth = Plugin.Flashlight.Value;
___buyableItemsList[2].creditsWorth = Plugin.Shovel.Value;
___buyableItemsList[3].creditsWorth = Plugin.Lockpicker.Value;
___buyableItemsList[4].creditsWorth = Plugin.ProFlashlight.Value;
___buyableItemsList[5].creditsWorth = Plugin.Stun_granade.Value;
___buyableItemsList[6].creditsWorth = Plugin.Boombox.Value;
___buyableItemsList[7].creditsWorth = Plugin.TZP.Value;
___buyableItemsList[8].creditsWorth = Plugin.Zap_gun.Value;
___buyableItemsList[9].creditsWorth = Plugin.Jetpack.Value;
___buyableItemsList[10].creditsWorth = Plugin.Extension_ladder.Value;
___buyableItemsList[11].creditsWorth = Plugin.Radar_booster.Value;
___buyableItemsList[12].creditsWorth = Plugin.Spray_paint.Value;
}
}
public class Item : ScriptableObject
{
public int itemId;
public string itemName;
[Space(3f)]
public List<ItemGroup> spawnPositionTypes = new List<ItemGroup>();
[Space(3f)]
public bool twoHanded;
public bool twoHandedAnimation;
public bool canBeGrabbedBeforeGameStart;
[Space(3f)]
public float weight = 1f;
public bool itemIsTrigger;
public bool holdButtonUse;
public bool itemSpawnsOnGround = true;
[Space(5f)]
public bool isConductiveMetal;
[Header("Scrap-collection")]
public bool isScrap;
public int creditsWorth;
public bool lockedInDemo;
public int highestSalePercentage = 80;
[Space(3f)]
public int maxValue;
public int minValue;
public GameObject spawnPrefab;
[Space(3f)]
[Header("Battery")]
public bool requiresBattery = true;
public float batteryUsage = 15f;
public bool automaticallySetUsingPower = true;
[Space(5f)]
public Sprite itemIcon;
[Space(5f)]
[Header("Player animations")]
public string grabAnim;
public string useAnim;
public string pocketAnim;
public string throwAnim;
[Space(5f)]
public float grabAnimationTime;
[Header("Player SFX")]
public AudioClip grabSFX;
public AudioClip dropSFX;
public AudioClip pocketSFX;
public AudioClip throwSFX;
[Header("Netcode")]
public bool syncGrabFunction = true;
public bool syncUseFunction = true;
public bool syncDiscardFunction = true;
public bool syncInteractLRFunction = true;
[Header("Save data")]
public bool saveItemVariable;
[Header("MISC")]
public bool isDefensiveWeapon;
[Space(3f)]
public string[] toolTips;
public float verticalOffset;
public int floorYOffset;
public bool allowDroppingAheadOfPlayer = true;
public Vector3 restingRotation = new Vector3(0f, 0f, 90f);
public Vector3 rotationOffset = Vector3.zero;
public Vector3 positionOffset = Vector3.zero;
public bool meshOffset = true;
public Mesh[] meshVariants;
public Material[] materialVariants;
public bool usableInSpecialAnimations;
public bool canBeInspected = true;
}
}