Decompiled source of Lategame Company Cruiser Upgrades v1.1.2

BepInEx/plugins/LategameCompanyCruiserUpgrades/LategameCompanyCruiserUpgrades.dll

Decompiled 2 weeks ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Serialization;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using CSync.Extensions;
using CSync.Lib;
using GameNetcodeStuff;
using HarmonyLib;
using LategameCompanyCruiserUpgrades.Misc;
using LategameCompanyCruiserUpgrades.NetcodePatcher;
using LategameCompanyCruiserUpgrades.Patches;
using LategameCompanyCruiserUpgrades.Upgrades.TierUpgrades;
using LategameCompanyCruiserUpgrades.Util;
using LethalLib.Modules;
using Microsoft.CodeAnalysis;
using MoreShipUpgrades.Managers;
using MoreShipUpgrades.Misc.Upgrades;
using MoreShipUpgrades.Misc.Util;
using MoreShipUpgrades.UI.TerminalNodes;
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: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: NetcodePatchedAssembly]
internal class <Module>
{
	static <Module>()
	{
	}
}
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 LategameCompanyCruiserUpgrades
{
	[BepInPlugin("com.github.WhiteSpike.LategameCompanyCruiserUpgrades", "Lategame Company Cruiser Upgrades", "1.1.1")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BaseUnityPlugin
	{
		internal static readonly Harmony harmony = new Harmony("com.github.WhiteSpike.LategameCompanyCruiserUpgrades");

		internal static readonly ManualLogSource mls = Logger.CreateLogSource("Lategame Company Cruiser Upgrades");

		internal static readonly Dictionary<string, GameObject> networkPrefabs = new Dictionary<string, GameObject>();

		public static PluginConfig Config;

		private void Awake()
		{
			Config = new PluginConfig(((BaseUnityPlugin)this).Config);
			IEnumerable<Type> types;
			try
			{
				types = Assembly.GetExecutingAssembly().GetTypes();
			}
			catch (ReflectionTypeLoadException ex)
			{
				types = ex.Types.Where((Type t) => t != null);
			}
			foreach (Type item in types)
			{
				MethodInfo[] methods = item.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic);
				MethodInfo[] array = methods;
				foreach (MethodInfo methodInfo in array)
				{
					object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false);
					if (customAttributes.Length != 0)
					{
						methodInfo.Invoke(null, null);
					}
				}
			}
			SetupPerks(ref types);
			harmony.PatchAll(typeof(PlayerControllerBPatcher));
			mls.LogInfo((object)"Player controllers have been patched");
			harmony.PatchAll(typeof(VehicleControllerPatcher));
			mls.LogInfo((object)"Vehicles have been patched");
			mls.LogInfo((object)"Lategame Company Cruiser Upgrades 1.1.1 has been loaded successfully.");
		}

		private void SetupPerks(ref IEnumerable<Type> types)
		{
			foreach (Type type in types)
			{
				if (type.IsSubclassOf(typeof(BaseUpgrade)))
				{
					UpgradeBus.Instance.upgradeTypes.Add(type);
					MethodInfo method = type.GetMethod("RegisterUpgrade", BindingFlags.Static | BindingFlags.Public);
					method.Invoke(null, null);
				}
			}
			mls.LogInfo((object)"Upgrades have been setup");
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "LategameCompanyCruiserUpgrades";

		public const string PLUGIN_NAME = "MoreShipUpgrades";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}
namespace LategameCompanyCruiserUpgrades.Util
{
	internal static class Constants
	{
		internal static readonly string BRAKE_FLUID_OVERRIDE_NAME_KEY = string.Format("Alternative name for {0} upgrade", "Brake Fluid");

		internal static readonly string TURBO_TANK_OVERRIDE_NAME_KEY = string.Format("Alternative name for {0} upgrade", "Turbo Tank");

		internal static readonly string IGNITION_COIL_OVERRIDE_NAME_KEY = string.Format("Alternative name for {0} upgrade", "Ignition Coil");

		internal static readonly string FLUFFY_SEATS_OVERRIDE_NAME_KEY = string.Format("Alternative name for {0} upgrade", "Fluffy Seats");

		internal static readonly string IMPROVED_STEERING_OVERRIDE_NAME_KEY = string.Format("Alternative name for {0} upgrade", "Improved Steering");

		internal static readonly string SUPERCHARGED_PISTONS_OVERRIDE_NAME_KEY = string.Format("Alternative name for {0} upgrade", "Supercharged Pistons");

		internal static readonly string RAPID_MOTORS_OVERRIDE_NAME_KEY = string.Format("Alternative name for {0} upgrade", "Rapid Motors");

		internal static readonly string VEHICLE_PLATING_OVERRIDE_NAME_KEY = string.Format("Alternative name for {0} upgrade", "Vehicle Plating");

		internal const string BRAKE_FLUID_ENABLED_KEY = "Enable Brake Fluid Upgrade";

		internal const bool BRAKE_FLUID_ENABLED_DEFAULT = true;

		internal const string BRAKE_FLUID_ENABLED_DESCRIPTION = "Tier upgrade which increases the braking capability of the Company Cruiser vehicle.";

		internal const string BRAKE_FLUID_PRICE_KEY = "Price of Brake Fluid Upgrade";

		internal const int BRAKE_FLUID_PRICE_DEFAULT = 100;

		internal const string BRAKE_FLUID_CAPACITY_INITIAL_INCREASE_KEY = "Initial Break Power Increase";

		internal const int BRAKE_FLUID_CAPACITY_INITIAL_INCREASE_DEFAULT = 25;

		internal const string BRAKE_FLUID_CAPACITY_INITIAL_INCREASE_DESCRIPTION = "Percentage of break power increased when first purchasing the upgrade on the Company Cruiser Vehicle";

		internal const string BRAKE_FLUID_CAPACITY_INCREMENTAL_INCREASE_KEY = "Incremental Break Power Increase";

		internal const int BRAKE_FLUID_CAPACITY_INCREMENTAL_INCREASE_DEFAULT = 25;

		internal const string BRAKE_FLUID_CAPACITY_INCREMENTAL_INCREASE_DESCRIPTION = "Percentage of break power increased when purchasing further levels of the upgrade on the Company Cruiser Vehicle";

		internal const string TURBO_TANK_ENABLED_KEY = "Enable Turbo Tank Upgrade";

		internal const bool TURBO_TANK_ENABLED_DEFAULT = true;

		internal const string TURBO_TANK_ENABLED_DESCRIPTION = "Tier upgrade which increases the maximum capacity of Company Cruiser Vehicle's turbo";

		internal const string TURBO_TANK_PRICE_KEY = "Price of Turbo Tank Upgrade";

		internal const int TURBO_TANK_PRICE_DEFAULT = 200;

		internal const string TURBO_TANK_CAPACITY_INITIAL_INCREASE_KEY = "Initial Turbo Capacity Increase";

		internal const int TURBO_TANK_CAPACITY_INITIAL_INCREASE_DEFAULT = 2;

		internal const string TURBO_TANK_CAPACITY_INITIAL_INCREASE_DESCRIPTION = "Amount of turbo capacity increased when first purchasing the upgrade on the Company Cruiser Vehicle";

		internal const string TURBO_TANK_CAPACITY_INCREMENTAL_INCREASE_KEY = "Incremental Turbo Capacity Increase";

		internal const int TURBO_TANK_CAPACITY_INCREMENTAL_INCREASE_DEFAULT = 1;

		internal const string TURBO_TANK_CAPACITY_INCREMENTAL_INCREASE_DESCRIPTION = "Amount of turbo capacity increased when purchasing further levels of the upgrade on the Company Cruiser Vehicle";

		internal const string IGNITION_COIL_ENABLED_KEY = "Enable Ignition Coil Upgrade";

		internal const bool IGNITION_COIL_ENABLED_DEFAULT = true;

		internal const string IGNITION_COIL_ENABLED_DESCRIPTION = "Tier upgrade which increases the chance of ignition to turn on the Company Cruiser Vehicle.";

		internal const string IGNITION_COIL_PRICE_KEY = "Price of Ignition Coil Upgrade";

		internal const int IGNITION_COIL_PRICE_DEFAULT = 50;

		internal const string IGNITION_COIL_IGNITION_INITIAL_CHANCE_INCREASE_KEY = "Initial Ignition Chance Increase";

		internal const int IGNITION_COIL_IGNITION_INITIAL_CHANCE_INCREASE_DEFAULT = 25;

		internal const string IGNITION_COIL_IGNITION_INITIAL_CHANCE_INCREASE_DESCRIPTION = "Amount of chance (%) increased when first purchasing the upgrade to ignite on the Company Cruiser Vehicle";

		internal const string IGNITION_COIL_IGNITION_INCREMENTAL_CHANCE_INCREASE_KEY = "Incremental Ignition Chance Increase";

		internal const int IGNITION_COIL_IGNITION_INCREMENTAL_CHANCE_INCREASE_DEFAULT = 25;

		internal const string IGNITION_COIL_IGNITION_INCREMENTAL_CHANCE_INCREASE_DESCRIPTION = "Amount of chance (%) increased when purchasing further levels of the upgrade to ignite on the Company Cruiser Vehicle";

		internal const string FLUFFY_SEATS_ENABLED_KEY = "Enable Fluffy Seats Upgrade";

		internal const bool FLUFFY_SEATS_ENABLED_DEFAULT = true;

		internal const string FLUFFY_SEATS_ENABLED_DESCRIPTION = "Tier upgrade which provides player damage mitigation when bumping too hard with the Company Cruiser Vehicle.";

		internal const string FLUFFY_SEATS_PRICE_KEY = "Price of Fluffy Seats Upgrade";

		internal const int FLUFFY_SEATS_PRICE_DEFAULT = 100;

		internal const string FLUFFY_SEATS_DAMAGE_MITIGATION_INITIAL_INCREASE_KEY = "Initial Player Damage Mitigation Increase";

		internal const int FLUFFY_SEATS_DAMAGE_MITIGATION_INITIAL_INCREASE_DEFAULT = 25;

		internal const string FLUFFY_SEATS_DAMAGE_MITIGATION_INITIAL_INCREASE_DESCRIPTION = "Amount of damage mitigation (%) increased when first purchasing the upgrade when riding the Company Cruiser Vehicle.";

		internal const string FLUFFY_SEATS_DAMAGE_MITIGATION_INCREMENTAL_INCREASE_KEY = "Incremental Player Damage Mitigation Increase";

		internal const int FLUFFY_SEATS_DAMAGE_MITIGATION_INCREMENTAL_INCREASE_DEFAULT = 25;

		internal const string FLUFFY_SEATS_DAMAGE_MITIGATION_INCREMENTAL_INCREASE_DESCRIPTION = "Amount of damage mitigation (%) increased when purchasing further levels of the upgrade when riding the Company Cruiser Vehicle.";

		internal const string IMPROVED_STEERING_ENABLED_KEY = "Enable Improved Steering Upgrade";

		internal const bool IMPROVED_STEERING_ENABLED_DEFAULT = true;

		internal const string IMPROVED_STEERING_ENABLED_DESCRIPTION = "Tier upgrade which increases the turning speed of the Company Cruiser vehicle";

		internal const string IMPROVED_STEERING_PRICE_KEY = "Price of Improved Steering Upgrade";

		internal const int IMPROVED_STEERING_PRICE_DEFAULT = 100;

		internal const string IMPROVED_STEERING_TURNING_SPEED_INITIAL_INCREASE_KEY = "Initial Turning Speed Increase";

		internal const float IMPROVED_STEERING_TURNING_SPEED_INITIAL_INCREASE_DEFAULT = 1f;

		internal const string IMPROVED_STEERING_TURNING_SPEED_INITIAL_INCREASE_DESCRIPTION = "Amount of turning speed increased when first purchasing the upgrade to the Company Cruiser vehicle.";

		internal const string IMPROVED_STEERING_TURNING_SPEED_INCREMENTAL_INCREASE_KEY = "Incremental Turning Speed Increase";

		internal const float IMPROVED_STEERING_TURNING_SPEED_INCREMENTAL_INCREASE_DEFAULT = 0.5f;

		internal const string IMPROVED_STEERING_TURNING_SPEED_INCREMENTAL_INCREASE_DESCRIPTION = "Amount of turning speed increased when purchasing further levels of the upgrade to the Company Cruiser vehicle.";

		internal const string SUPERCHARGED_PISTONS_ENABLED_KEY = "Enable Supercharged Pistons Upgrade";

		internal const bool SUPERCHARGED_PISTONS_ENABLED_DEFAULT = true;

		internal const string SUPERCHARGED_PISTONS_ENABLED_DESCRIPTION = "Tier upgrade which increases the company cruiser's maximum speed when driving";

		internal const string SUPERCHARGED_PISTONS_PRICE_KEY = "Price of Supercharged Pistons Upgrade";

		internal const int SUPERCHARGED_PISTONS_PRICE_DEFAULT = 250;

		internal const string SUPERCHARGED_PISTONS_ENGINE_TORQUE_INITIAL_INCREASE_KEY = "Initial Engine Torque Increase";

		internal const float SUPERCHARGED_PISTONS_ENGINE_TORQUE_INITIAL_INCREASE_DEFAULT = 40f;

		internal const string SUPERCHARGED_PISTONS_ENGINE_TORQUE_INITIAL_INCREASE_DESCRIPTION = "Amount of maximum speed increased when first purchasing the upgrade to the Company Cruiser vehicle.";

		internal const string SUPERCHARGED_PISTONS_ENGINE_TORQUE_INCREMENTAL_INCREASE_KEY = "Incremental Engine Torque Increase";

		internal const float SUPERCHARGED_PISTONS_ENGINE_TORQUE_INCREMENTAL_INCREASE_DEFAULT = 20f;

		internal const string SUPERCHARGED_PISTONS_ENGINE_TORQUE_INCREMENTAL_INCREASE_DESCRIPTION = "Amount of maximum speed increased when purchasing further levels of the upgrade to the Company Cruiser vehicle.";

		internal const string RAPID_MOTORS_ENABLED_KEY = "Enable Rapid Motors Upgrade";

		internal const bool RAPID_MOTORS_ENABLED_DEFAULT = true;

		internal const string RAPID_MOTORS_ENABLED_DESCRIPTION = "Tier upgrade which increases the company cruiser's acceleration when driving.";

		internal const string RAPID_MOTORS_PRICE_KEY = "Price of Rapid Motors Upgrade";

		internal const int RAPID_MOTORS_PRICE_DEFAULT = 150;

		internal const string RAPID_MOTORS_ACCELERATION_INITIAL_INCREASE_KEY = "Initial Acceleration Increase";

		internal const float RAPID_MOTORS_ACCELERATION_INITIAL_INCREASE_DEFAULT = 2f;

		internal const string RAPID_MOTORS_ACCELERATION_INITIAL_INCREASE_DESCRIPTION = "Amount of acceleration increased when first purchasing the upgrade to the company cruiser vehicle.";

		internal const string RAPID_MOTORS_ACCELERATION_INCREMENTAL_INCREASE_KEY = "Incremental Acceleration Increase";

		internal const float RAPID_MOTORS_ACCELERATION_INCREMENTAL_INCREASE_DEFAULT = 0.5f;

		internal const string RAPID_MOTORS_ACCELERATION_INCREMENTAL_INCREASE_DESCRIPTION = "Amount of acceleration increased when purchasing further levels of the upgrade to the company cruiser vehicle.";

		internal const string VEHICLE_PLATING_ENABLED_KEY = "Enable Vehicle Plating Upgrade";

		internal const bool VEHICLE_PLATING_ENABLED_DEFAULT = true;

		internal const string VEHICLE_PLATING_ENABLED_DESCRIPTION = "Tier upgrade which increases the company cruiser's maximum health to sustain damage from outside sources.";

		internal const string VEHICLE_PLATING_PRICE_KEY = "Price of Vehicle Plating Upgrade";

		internal const int VEHICLE_PLATING_PRICE_DEFAULT = 150;

		internal const string VEHICLE_PLATING_HEALTH_INITIAL_INCREASE_KEY = "Initial Health Increase";

		internal const int VEHICLE_PLATING_HEALTH_INITIAL_INCREASE_DEFAULT = 10;

		internal const string VEHICLE_PLATING_HEALTH_INITIAL_INCREASE_DESCRIPTION = "Amount of health increased when first purchasing the upgrade to the company cruiser vehicle.";

		internal const string VEHICLE_PLATING_HEALTH_INCREMENTAL_INCREASE_KEY = "Incremental Health Increase";

		internal const int VEHICLE_PLATING_HEALTH_INCREMENTAL_INCREASE_DEFAULT = 5;

		internal const string VEHICLE_PLATING_HEALTH_INCREMENTAL_INCREASE_DESCRIPTION = "Amount of health increased when purchasing further levels of the upgrade to the company cruiser vehicle.";
	}
}
namespace LategameCompanyCruiserUpgrades.Upgrades.TierUpgrades
{
	internal class BrakeFluid : TierUpgrade
	{
		internal const string UPGRADE_NAME = "Brake Fluid";

		internal const string PRICES_DEFAULT = "100,150,250";

		public override bool CanInitializeOnStart
		{
			get
			{
				string[] array = Plugin.Config.BRAKE_FLUID_PRICES.Value.Split(',');
				return Plugin.Config.BRAKE_FLUID_PRICE.Value <= 0 && array.Length == 1 && (array[0] == "" || array[0] == "0");
			}
		}

		public override void Start()
		{
			((BaseUpgrade)this).upgradeName = "Brake Fluid";
			((BaseUpgrade)this).overridenUpgradeName = SyncedEntry<string>.op_Implicit(Plugin.Config.BRAKE_FLUID_OVERRIDE_NAME);
			((BaseUpgrade)this).Start();
		}

		public static float ComputeIncreasedBrakingPowerPercentage()
		{
			int num = SyncedEntry<int>.op_Implicit(Plugin.Config.BRAKE_FLUID_POWER_INITIAL_INCREASE) + BaseUpgrade.GetUpgradeLevel("Brake Fluid") * SyncedEntry<int>.op_Implicit(Plugin.Config.BRAKE_FLUID_POWER_INCREMENTAL_INCREASE);
			return (float)num / 100f;
		}

		public static int GetIncreasedBrakingPower(int defaultValue)
		{
			if (!SyncedEntry<bool>.op_Implicit(Plugin.Config.BRAKE_FLUID_ENABLED))
			{
				return defaultValue;
			}
			if (!BaseUpgrade.GetActiveUpgrade("Brake Fluid"))
			{
				return defaultValue;
			}
			float num = ComputeIncreasedBrakingPowerPercentage();
			return Mathf.Clamp((int)((float)defaultValue + (float)defaultValue * num), 0, defaultValue);
		}

		public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null)
		{
			return Tools.GenerateInfoForUpgrade("LVL {0} - ${1} - The Company Cruiser vehicle's breaks have an increased power of {2}%.\n", initialPrice, incrementalPrices, (Func<int, float>)infoFunction, false);
			static float infoFunction(int level)
			{
				return Plugin.Config.BRAKE_FLUID_POWER_INITIAL_INCREASE.Value + level * Plugin.Config.BRAKE_FLUID_POWER_INCREMENTAL_INCREASE.Value;
			}
		}

		public static (string, string[]) RegisterScrapToUpgrade()
		{
			return ("Brake Fluid", Plugin.Config.BRAKE_FLUID_ITEM_PROGRESSION_ITEMS.Value.Split(","));
		}

		public static void RegisterUpgrade()
		{
			GameObject val = NetworkPrefabs.CreateNetworkPrefab("Brake Fluid");
			val.AddComponent<BrakeFluid>();
			NetworkPrefabs.RegisterNetworkPrefab(val);
			Plugin.networkPrefabs["Brake Fluid"] = val;
		}

		public static CustomTerminalNode RegisterTerminalNode()
		{
			PluginConfig config = Plugin.Config;
			return UpgradeBus.Instance.SetupMultiplePurchasableTerminalNode("Brake Fluid", true, config.BRAKE_FLUID_ENABLED.Value, config.BRAKE_FLUID_PRICE.Value, UpgradeBus.ParseUpgradePrices(config.BRAKE_FLUID_PRICES.Value), SyncedEntry<bool>.op_Implicit(UpgradeBus.Instance.PluginConfiguration.OVERRIDE_UPGRADE_NAMES) ? SyncedEntry<string>.op_Implicit(config.BRAKE_FLUID_OVERRIDE_NAME) : "", Plugin.networkPrefabs["Brake Fluid"]);
		}

		protected override void __initializeVariables()
		{
			((TierUpgrade)this).__initializeVariables();
		}

		protected internal override string __getTypeName()
		{
			return "BrakeFluid";
		}
	}
	internal class FluffySeats : TierUpgrade
	{
		internal const string UPGRADE_NAME = "Fluffy Seats";

		internal const string PRICES_DEFAULT = "100,150,200";

		public override bool CanInitializeOnStart
		{
			get
			{
				string[] array = Plugin.Config.FLUFFY_SEATS_PRICES.Value.Split(',');
				return Plugin.Config.FLUFFY_SEATS_PRICE.Value <= 0 && array.Length == 1 && (array[0] == "" || array[0] == "0");
			}
		}

		public override void Start()
		{
			((BaseUpgrade)this).upgradeName = "Fluffy Seats";
			((BaseUpgrade)this).overridenUpgradeName = SyncedEntry<string>.op_Implicit(Plugin.Config.FLUFFY_SEATS_OVERRIDE_NAME);
			((BaseUpgrade)this).Start();
		}

		public static float ComputePlayerDamageMitigation()
		{
			int num = SyncedEntry<int>.op_Implicit(Plugin.Config.FLUFFY_SEATS_DAMAGE_MITIGATION_INITIAL_INCREASE) + BaseUpgrade.GetUpgradeLevel("Fluffy Seats") * SyncedEntry<int>.op_Implicit(Plugin.Config.FLUFFY_SEATS_DAMAGE_MITIGATION_INCREMENTAL_INCREASE);
			return (100f - (float)num) / 100f;
		}

		public static int GetPlayerDamageMitigation(int defaultValue)
		{
			if (!SyncedEntry<bool>.op_Implicit(Plugin.Config.FLUFFY_SEATS_ENABLED))
			{
				return defaultValue;
			}
			if (!BaseUpgrade.GetActiveUpgrade("Fluffy Seats"))
			{
				return defaultValue;
			}
			float num = ComputePlayerDamageMitigation();
			return Mathf.Clamp((int)((float)defaultValue * num), 0, defaultValue);
		}

		public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null)
		{
			return Tools.GenerateInfoForUpgrade("LVL {0} - ${1} - Player damage is reduced by {2}% when bumping too hard with the Company Cruiser Vehicle.\n", initialPrice, incrementalPrices, (Func<int, float>)infoFunction, false);
			static float infoFunction(int level)
			{
				return Plugin.Config.FLUFFY_SEATS_DAMAGE_MITIGATION_INITIAL_INCREASE.Value + level * Plugin.Config.FLUFFY_SEATS_DAMAGE_MITIGATION_INCREMENTAL_INCREASE.Value;
			}
		}

		public static (string, string[]) RegisterScrapToUpgrade()
		{
			return ("Fluffy Seats", Plugin.Config.FLUFFY_SEATS_ITEM_PROGRESSION_ITEMS.Value.Split(","));
		}

		public static void RegisterUpgrade()
		{
			GameObject val = NetworkPrefabs.CreateNetworkPrefab("Fluffy Seats");
			val.AddComponent<FluffySeats>();
			NetworkPrefabs.RegisterNetworkPrefab(val);
			Plugin.networkPrefabs["Fluffy Seats"] = val;
		}

		public static CustomTerminalNode RegisterTerminalNode()
		{
			PluginConfig config = Plugin.Config;
			return UpgradeBus.Instance.SetupMultiplePurchasableTerminalNode("Fluffy Seats", true, config.FLUFFY_SEATS_ENABLED.Value, config.FLUFFY_SEATS_PRICE.Value, UpgradeBus.ParseUpgradePrices(config.FLUFFY_SEATS_PRICES.Value), SyncedEntry<bool>.op_Implicit(UpgradeBus.Instance.PluginConfiguration.OVERRIDE_UPGRADE_NAMES) ? SyncedEntry<string>.op_Implicit(config.FLUFFY_SEATS_OVERRIDE_NAME) : "", Plugin.networkPrefabs["Fluffy Seats"]);
		}

		protected override void __initializeVariables()
		{
			((TierUpgrade)this).__initializeVariables();
		}

		protected internal override string __getTypeName()
		{
			return "FluffySeats";
		}
	}
	internal class IgnitionCoil : TierUpgrade
	{
		internal const string UPGRADE_NAME = "Ignition Coil";

		internal const string PRICES_DEFAULT = "50,100,100";

		public override bool CanInitializeOnStart
		{
			get
			{
				string[] array = Plugin.Config.IGNITION_COIL_PRICES.Value.Split(',');
				return Plugin.Config.IGNITION_COIL_PRICE.Value <= 0 && array.Length == 1 && (array[0].Length == 0 || array[0] == "0");
			}
		}

		public override void Start()
		{
			((BaseUpgrade)this).upgradeName = "Ignition Coil";
			((BaseUpgrade)this).overridenUpgradeName = SyncedEntry<string>.op_Implicit(Plugin.Config.IGNITION_COIL_OVERRIDE_NAME);
			((BaseUpgrade)this).Start();
		}

		public static float ComputeAdditionalIgnitionChance()
		{
			return SyncedEntry<int>.op_Implicit(Plugin.Config.IGNITION_COIL_IGNITION_INITIAL_CHANCE_INCREASE) + BaseUpgrade.GetUpgradeLevel("Ignition Coil") * SyncedEntry<int>.op_Implicit(Plugin.Config.IGNITION_COIL_IGNITION_INCREMENTAL_CHANCE_INCREASE);
		}

		public static float GetAdditionalIgnitionChance(float defaultValue)
		{
			if (!SyncedEntry<bool>.op_Implicit(Plugin.Config.IMPROVED_STEERING_ENABLED))
			{
				return defaultValue;
			}
			if (!BaseUpgrade.GetActiveUpgrade("Ignition Coil"))
			{
				return defaultValue;
			}
			float num = ComputeAdditionalIgnitionChance();
			return Mathf.Clamp(defaultValue + num, defaultValue, float.MaxValue);
		}

		public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null)
		{
			Func<int, float> func = (int level) => Plugin.Config.IGNITION_COIL_IGNITION_INITIAL_CHANCE_INCREASE.Value + level * Plugin.Config.IGNITION_COIL_IGNITION_INCREMENTAL_CHANCE_INCREASE.Value;
			return Tools.GenerateInfoForUpgrade("LVL {0} - ${1} - Chance to start ignition on Company Cruiser Vehicle is increased by {2}%.\n", initialPrice, incrementalPrices, func, false);
		}

		public static (string, string[]) RegisterScrapToUpgrade()
		{
			return ("Ignition Coil", Plugin.Config.IGNITION_COIL_ITEM_PROGRESSION_ITEMS.Value.Split(","));
		}

		public static void RegisterUpgrade()
		{
			GameObject val = NetworkPrefabs.CreateNetworkPrefab("Ignition Coil");
			val.AddComponent<IgnitionCoil>();
			NetworkPrefabs.RegisterNetworkPrefab(val);
			Plugin.networkPrefabs["Ignition Coil"] = val;
		}

		public static CustomTerminalNode RegisterTerminalNode()
		{
			PluginConfig config = Plugin.Config;
			return UpgradeBus.Instance.SetupMultiplePurchasableTerminalNode("Ignition Coil", true, config.IGNITION_COIL_ENABLED.Value, config.IGNITION_COIL_PRICE.Value, UpgradeBus.ParseUpgradePrices(config.IGNITION_COIL_PRICES.Value), SyncedEntry<bool>.op_Implicit(UpgradeBus.Instance.PluginConfiguration.OVERRIDE_UPGRADE_NAMES) ? SyncedEntry<string>.op_Implicit(config.IGNITION_COIL_OVERRIDE_NAME) : "", Plugin.networkPrefabs["Ignition Coil"]);
		}

		protected override void __initializeVariables()
		{
			((TierUpgrade)this).__initializeVariables();
		}

		protected internal override string __getTypeName()
		{
			return "IgnitionCoil";
		}
	}
	internal class ImprovedSteering : TierUpgrade
	{
		internal const string UPGRADE_NAME = "Improved Steering";

		internal const string PRICES_DEFAULT = "100,150,250";

		public override bool CanInitializeOnStart
		{
			get
			{
				string[] array = Plugin.Config.IMPROVED_STEERING_PRICES.Value.Split(',');
				return Plugin.Config.IMPROVED_STEERING_PRICE.Value <= 0 && array.Length == 1 && (array[0] == "" || array[0] == "0");
			}
		}

		public override void Start()
		{
			((BaseUpgrade)this).upgradeName = "Improved Steering";
			((BaseUpgrade)this).overridenUpgradeName = SyncedEntry<string>.op_Implicit(Plugin.Config.IMPROVED_STEERING_OVERRIDE_NAME);
			((BaseUpgrade)this).Start();
		}

		public override void Load()
		{
			((BaseUpgrade)this).Load();
			UpdateCurrentVehicleTurningSpeed(ComputeAdditionalAcceleration(), add: true);
		}

		public override void Increment()
		{
			((TierUpgrade)this).Increment();
			UpdateCurrentVehicleTurningSpeed(SyncedEntry<float>.op_Implicit(Plugin.Config.IMPROVED_STEERING_TURNING_SPEED_INCREMENTAL_INCREASE), add: true);
		}

		public override void Unwind()
		{
			UpdateCurrentVehicleTurningSpeed(ComputeAdditionalAcceleration(), add: false);
			((TierUpgrade)this).Unwind();
		}

		private void UpdateCurrentVehicleTurningSpeed(float additionalTurningSpeed, bool add)
		{
			VehicleController[] array = Object.FindObjectsOfType<VehicleController>();
			foreach (VehicleController val in array)
			{
				if (!((Object)(object)val == (Object)null))
				{
					if (add)
					{
						val.steeringWheelTurnSpeed += additionalTurningSpeed;
					}
					else
					{
						val.steeringWheelTurnSpeed -= additionalTurningSpeed;
					}
				}
			}
		}

		public static float ComputeAdditionalAcceleration()
		{
			return SyncedEntry<float>.op_Implicit(Plugin.Config.IMPROVED_STEERING_TURNING_SPEED_INITIAL_INCREASE) + (float)BaseUpgrade.GetUpgradeLevel("Improved Steering") * SyncedEntry<float>.op_Implicit(Plugin.Config.IMPROVED_STEERING_TURNING_SPEED_INCREMENTAL_INCREASE);
		}

		public static float GetAdditionalTurningSpeed(float defaultValue)
		{
			if (!SyncedEntry<bool>.op_Implicit(Plugin.Config.IMPROVED_STEERING_ENABLED))
			{
				return defaultValue;
			}
			if (!BaseUpgrade.GetActiveUpgrade("Improved Steering"))
			{
				return defaultValue;
			}
			float num = ComputeAdditionalAcceleration();
			return Mathf.Clamp(defaultValue + num, defaultValue, float.MaxValue);
		}

		public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null)
		{
			Func<int, float> func = (int level) => Plugin.Config.IMPROVED_STEERING_TURNING_SPEED_INITIAL_INCREASE.Value + (float)level * Plugin.Config.IMPROVED_STEERING_TURNING_SPEED_INCREMENTAL_INCREASE.Value;
			return Tools.GenerateInfoForUpgrade("LVL {0} - ${1} - Company Cruiser vehicle's steering speed (turning speed) is increased by {2}.\n", initialPrice, incrementalPrices, func, false);
		}

		public static (string, string[]) RegisterScrapToUpgrade()
		{
			return ("Improved Steering", Plugin.Config.IMPROVED_STEERING_ITEM_PROGRESSION_ITEMS.Value.Split(","));
		}

		public static void RegisterUpgrade()
		{
			GameObject val = NetworkPrefabs.CreateNetworkPrefab("Improved Steering");
			val.AddComponent<ImprovedSteering>();
			NetworkPrefabs.RegisterNetworkPrefab(val);
			Plugin.networkPrefabs["Improved Steering"] = val;
		}

		public static CustomTerminalNode RegisterTerminalNode()
		{
			PluginConfig config = Plugin.Config;
			return UpgradeBus.Instance.SetupMultiplePurchasableTerminalNode("Improved Steering", true, config.IMPROVED_STEERING_ENABLED.Value, config.IMPROVED_STEERING_PRICE.Value, UpgradeBus.ParseUpgradePrices(config.IMPROVED_STEERING_PRICES.Value), SyncedEntry<bool>.op_Implicit(UpgradeBus.Instance.PluginConfiguration.OVERRIDE_UPGRADE_NAMES) ? SyncedEntry<string>.op_Implicit(config.IMPROVED_STEERING_OVERRIDE_NAME) : "", Plugin.networkPrefabs["Improved Steering"]);
		}

		protected override void __initializeVariables()
		{
			((TierUpgrade)this).__initializeVariables();
		}

		protected internal override string __getTypeName()
		{
			return "ImprovedSteering";
		}
	}
	internal class RapidMotors : TierUpgrade
	{
		internal const string UPGRADE_NAME = "Rapid Motors";

		internal const string PRICES_DEFAULT = "200,300,400";

		public override bool CanInitializeOnStart
		{
			get
			{
				string[] array = Plugin.Config.RAPID_MOTORS_PRICES.Value.Split(',');
				return Plugin.Config.RAPID_MOTORS_PRICE.Value <= 0 && array.Length == 1 && (array[0] == "" || array[0] == "0");
			}
		}

		public override void Start()
		{
			((BaseUpgrade)this).upgradeName = "Rapid Motors";
			((BaseUpgrade)this).overridenUpgradeName = SyncedEntry<string>.op_Implicit(Plugin.Config.RAPID_MOTORS_OVERRIDE_NAME);
			((BaseUpgrade)this).Start();
		}

		public override void Load()
		{
			((BaseUpgrade)this).Load();
			UpdateCurrentVehicleAcceleration(ComputeAdditionalAcceleration(), add: true);
		}

		public override void Increment()
		{
			((TierUpgrade)this).Increment();
			UpdateCurrentVehicleAcceleration(SyncedEntry<float>.op_Implicit(Plugin.Config.RAPID_MOTORS_ACCELERATION_INCREMENTAL_INCREASE), add: true);
		}

		public override void Unwind()
		{
			UpdateCurrentVehicleAcceleration(ComputeAdditionalAcceleration(), add: false);
			((TierUpgrade)this).Unwind();
		}

		private void UpdateCurrentVehicleAcceleration(float additionalAcceleration, bool add)
		{
			VehicleController[] array = Object.FindObjectsOfType<VehicleController>();
			foreach (VehicleController val in array)
			{
				if (!((Object)(object)val == (Object)null))
				{
					if (add)
					{
						val.carAcceleration += additionalAcceleration;
					}
					else
					{
						val.carAcceleration -= additionalAcceleration;
					}
				}
			}
		}

		public static float ComputeAdditionalAcceleration()
		{
			return SyncedEntry<float>.op_Implicit(Plugin.Config.RAPID_MOTORS_ACCELERATION_INITIAL_INCREASE) + (float)BaseUpgrade.GetUpgradeLevel("Rapid Motors") * SyncedEntry<float>.op_Implicit(Plugin.Config.RAPID_MOTORS_ACCELERATION_INCREMENTAL_INCREASE);
		}

		public static float GetAdditionalAcceleration(float defaultValue)
		{
			if (!SyncedEntry<bool>.op_Implicit(Plugin.Config.RAPID_MOTORS_ENABLED))
			{
				return defaultValue;
			}
			if (!BaseUpgrade.GetActiveUpgrade("Rapid Motors"))
			{
				return defaultValue;
			}
			float num = ComputeAdditionalAcceleration();
			return Mathf.Clamp(defaultValue + num, defaultValue, float.MaxValue);
		}

		public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null)
		{
			Func<int, float> func = (int level) => Plugin.Config.RAPID_MOTORS_ACCELERATION_INITIAL_INCREASE.Value + (float)level * Plugin.Config.RAPID_MOTORS_ACCELERATION_INCREMENTAL_INCREASE.Value;
			return Tools.GenerateInfoForUpgrade("LVL {0} - ${1} - Company Cruiser vehicle's maximum acceleration is increased by {2}.\n", initialPrice, incrementalPrices, func, false);
		}

		public static (string, string[]) RegisterScrapToUpgrade()
		{
			return ("Rapid Motors", Plugin.Config.RAPID_MOTORS_ITEM_PROGRESSION_ITEMS.Value.Split(","));
		}

		public static void RegisterUpgrade()
		{
			GameObject val = NetworkPrefabs.CreateNetworkPrefab("Rapid Motors");
			val.AddComponent<RapidMotors>();
			NetworkPrefabs.RegisterNetworkPrefab(val);
			Plugin.networkPrefabs["Rapid Motors"] = val;
		}

		public static CustomTerminalNode RegisterTerminalNode()
		{
			PluginConfig config = Plugin.Config;
			return UpgradeBus.Instance.SetupMultiplePurchasableTerminalNode("Rapid Motors", true, config.RAPID_MOTORS_ENABLED.Value, config.RAPID_MOTORS_PRICE.Value, UpgradeBus.ParseUpgradePrices(config.RAPID_MOTORS_PRICES.Value), SyncedEntry<bool>.op_Implicit(UpgradeBus.Instance.PluginConfiguration.OVERRIDE_UPGRADE_NAMES) ? SyncedEntry<string>.op_Implicit(config.RAPID_MOTORS_OVERRIDE_NAME) : "", Plugin.networkPrefabs["Rapid Motors"]);
		}

		protected override void __initializeVariables()
		{
			((TierUpgrade)this).__initializeVariables();
		}

		protected internal override string __getTypeName()
		{
			return "RapidMotors";
		}
	}
	internal class SuperchargedPistons : TierUpgrade
	{
		internal const string UPGRADE_NAME = "Supercharged Pistons";

		internal const string PRICES_DEFAULT = "200,350";

		public override bool CanInitializeOnStart
		{
			get
			{
				string[] array = Plugin.Config.SUPERCHARGED_PISTONS_PRICES.Value.Split(',');
				return Plugin.Config.SUPERCHARGED_PISTONS_PRICE.Value <= 0 && array.Length == 1 && (array[0] == "" || array[0] == "0");
			}
		}

		public override void Start()
		{
			((BaseUpgrade)this).upgradeName = "Supercharged Pistons";
			((BaseUpgrade)this).overridenUpgradeName = SyncedEntry<string>.op_Implicit(Plugin.Config.SUPERCHARGED_PISTONS_OVERRIDE_NAME);
			((BaseUpgrade)this).Start();
		}

		public override void Load()
		{
			((BaseUpgrade)this).Load();
			UpdateCurrentVehicleEngineTorque(ComputeAdditionalEngineTorque(), add: true);
		}

		public override void Increment()
		{
			((TierUpgrade)this).Increment();
			UpdateCurrentVehicleEngineTorque(SyncedEntry<float>.op_Implicit(Plugin.Config.SUPERCHARGED_PISTONS_ENGINE_TORQUE_INCREMENTAL_INCREASE), add: true);
		}

		public override void Unwind()
		{
			UpdateCurrentVehicleEngineTorque(ComputeAdditionalEngineTorque(), add: false);
			((TierUpgrade)this).Unwind();
		}

		private void UpdateCurrentVehicleEngineTorque(float additionalEngineTorque, bool add)
		{
			VehicleController[] array = Object.FindObjectsOfType<VehicleController>();
			foreach (VehicleController val in array)
			{
				if (!((Object)(object)val == (Object)null))
				{
					if (add)
					{
						val.EngineTorque += additionalEngineTorque;
					}
					else
					{
						val.EngineTorque -= additionalEngineTorque;
					}
				}
			}
		}

		public static float ComputeAdditionalEngineTorque()
		{
			return SyncedEntry<float>.op_Implicit(Plugin.Config.SUPERCHARGED_PISTONS_ENGINE_TORQUE_INITIAL_INCREASE) + (float)BaseUpgrade.GetUpgradeLevel("Supercharged Pistons") * SyncedEntry<float>.op_Implicit(Plugin.Config.SUPERCHARGED_PISTONS_ENGINE_TORQUE_INCREMENTAL_INCREASE);
		}

		public static float GetAdditionalEngineTorque(float defaultValue)
		{
			if (!SyncedEntry<bool>.op_Implicit(Plugin.Config.SUPERCHARGED_PISTONS_ENABLED))
			{
				return defaultValue;
			}
			if (!BaseUpgrade.GetActiveUpgrade("Supercharged Pistons"))
			{
				return defaultValue;
			}
			float num = ComputeAdditionalEngineTorque();
			return Mathf.Clamp(defaultValue + num, defaultValue, float.MaxValue);
		}

		public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null)
		{
			Func<int, float> func = (int level) => Plugin.Config.SUPERCHARGED_PISTONS_ENGINE_TORQUE_INITIAL_INCREASE.Value + (float)level * Plugin.Config.SUPERCHARGED_PISTONS_ENGINE_TORQUE_INCREMENTAL_INCREASE.Value;
			return Tools.GenerateInfoForUpgrade("LVL {0} - ${1} - Company Cruiser vehicle's maximum speed is increased by {2}.\n", initialPrice, incrementalPrices, func, false);
		}

		public static (string, string[]) RegisterScrapToUpgrade()
		{
			return ("Supercharged Pistons", Plugin.Config.SUPERCHARGED_PISTONS_ITEM_PROGRESSION_ITEMS.Value.Split(","));
		}

		public static void RegisterUpgrade()
		{
			GameObject val = NetworkPrefabs.CreateNetworkPrefab("Supercharged Pistons");
			val.AddComponent<SuperchargedPistons>();
			NetworkPrefabs.RegisterNetworkPrefab(val);
			Plugin.networkPrefabs["Supercharged Pistons"] = val;
		}

		public static CustomTerminalNode RegisterTerminalNode()
		{
			PluginConfig config = Plugin.Config;
			return UpgradeBus.Instance.SetupMultiplePurchasableTerminalNode("Supercharged Pistons", true, config.SUPERCHARGED_PISTONS_ENABLED.Value, config.SUPERCHARGED_PISTONS_PRICE.Value, UpgradeBus.ParseUpgradePrices(config.SUPERCHARGED_PISTONS_PRICES.Value), SyncedEntry<bool>.op_Implicit(UpgradeBus.Instance.PluginConfiguration.OVERRIDE_UPGRADE_NAMES) ? SyncedEntry<string>.op_Implicit(config.SUPERCHARGED_PISTONS_OVERRIDE_NAME) : "", Plugin.networkPrefabs["Supercharged Pistons"]);
		}

		protected override void __initializeVariables()
		{
			((TierUpgrade)this).__initializeVariables();
		}

		protected internal override string __getTypeName()
		{
			return "SuperchargedPistons";
		}
	}
	internal class TurboTank : TierUpgrade
	{
		internal const string UPGRADE_NAME = "Turbo Tank";

		internal const string PRICES_DEFAULT = "100,200,300";

		public override bool CanInitializeOnStart
		{
			get
			{
				string[] array = Plugin.Config.TURBO_TANK_PRICES.Value.Split(',');
				return Plugin.Config.TURBO_TANK_PRICE.Value <= 0 && array.Length == 1 && (array[0] == "" || array[0] == "0");
			}
		}

		public override void Start()
		{
			((BaseUpgrade)this).upgradeName = "Turbo Tank";
			((BaseUpgrade)this).overridenUpgradeName = SyncedEntry<string>.op_Implicit(Plugin.Config.TURBO_TANK_OVERRIDE_NAME);
			((BaseUpgrade)this).Start();
		}

		public static int ComputeAdditionalTurboCapacity()
		{
			return SyncedEntry<int>.op_Implicit(Plugin.Config.TURBO_TANK_CAPACITY_INITIAL_INCREASE) + BaseUpgrade.GetUpgradeLevel("Turbo Tank") * SyncedEntry<int>.op_Implicit(Plugin.Config.TURBO_TANK_CAPACITY_INCREMENTAL_INCREASE);
		}

		public static int GetAdditionalTurboCapacity(int defaultValue)
		{
			if (!SyncedEntry<bool>.op_Implicit(Plugin.Config.TURBO_TANK_ENABLED))
			{
				return defaultValue;
			}
			if (!BaseUpgrade.GetActiveUpgrade("Turbo Tank"))
			{
				return defaultValue;
			}
			int num = ComputeAdditionalTurboCapacity();
			return Mathf.Clamp(defaultValue + num, defaultValue, int.MaxValue);
		}

		public static float GetAdditionalTurboCapacity(float defaultValue)
		{
			if (!SyncedEntry<bool>.op_Implicit(Plugin.Config.TURBO_TANK_ENABLED))
			{
				return defaultValue;
			}
			if (!BaseUpgrade.GetActiveUpgrade("Turbo Tank"))
			{
				return defaultValue;
			}
			float num = ComputeAdditionalTurboCapacity();
			return Mathf.Clamp(defaultValue + num, defaultValue, float.MaxValue);
		}

		public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null)
		{
			Func<int, float> func = (int level) => Plugin.Config.TURBO_TANK_CAPACITY_INITIAL_INCREASE.Value + level * Plugin.Config.TURBO_TANK_CAPACITY_INCREMENTAL_INCREASE.Value;
			return Tools.GenerateInfoForUpgrade("LVL {0} - ${1} - Company Cruiser vehicle's maximum turbo capacity is increased by {2}.\n", initialPrice, incrementalPrices, func, false);
		}

		public static (string, string[]) RegisterScrapToUpgrade()
		{
			return ("Turbo Tank", Plugin.Config.TURBO_TANK_ITEM_PROGRESSION_ITEMS.Value.Split(","));
		}

		public static void RegisterUpgrade()
		{
			GameObject val = NetworkPrefabs.CreateNetworkPrefab("Turbo Tank");
			val.AddComponent<TurboTank>();
			NetworkPrefabs.RegisterNetworkPrefab(val);
			Plugin.networkPrefabs["Turbo Tank"] = val;
		}

		public static CustomTerminalNode RegisterTerminalNode()
		{
			PluginConfig config = Plugin.Config;
			return UpgradeBus.Instance.SetupMultiplePurchasableTerminalNode("Turbo Tank", true, config.TURBO_TANK_ENABLED.Value, config.TURBO_TANK_PRICE.Value, UpgradeBus.ParseUpgradePrices(config.TURBO_TANK_PRICES.Value), SyncedEntry<bool>.op_Implicit(UpgradeBus.Instance.PluginConfiguration.OVERRIDE_UPGRADE_NAMES) ? SyncedEntry<string>.op_Implicit(config.TURBO_TANK_OVERRIDE_NAME) : "", Plugin.networkPrefabs["Turbo Tank"]);
		}

		protected override void __initializeVariables()
		{
			((TierUpgrade)this).__initializeVariables();
		}

		protected internal override string __getTypeName()
		{
			return "TurboTank";
		}
	}
	internal class VehiclePlating : TierUpgrade
	{
		internal const string UPGRADE_NAME = "Vehicle Plating";

		internal const string PRICES_DEFAULT = "300,400,500,600";

		public override bool CanInitializeOnStart
		{
			get
			{
				string[] array = Plugin.Config.VEHICLE_PLATING_PRICES.Value.Split(',');
				return Plugin.Config.VEHICLE_PLATING_PRICE.Value <= 0 && array.Length == 1 && (array[0] == "" || array[0] == "0");
			}
		}

		public override void Start()
		{
			((BaseUpgrade)this).upgradeName = "Vehicle Plating";
			((BaseUpgrade)this).overridenUpgradeName = SyncedEntry<string>.op_Implicit(Plugin.Config.VEHICLE_PLATING_OVERRIDE_NAME);
			((BaseUpgrade)this).Start();
		}

		public override void Load()
		{
			((BaseUpgrade)this).Load();
			UpdateCurrentVehicleHealth(ComputeAdditionalMaximumHealth(), add: true);
		}

		public override void Increment()
		{
			((TierUpgrade)this).Increment();
			UpdateCurrentVehicleHealth(SyncedEntry<int>.op_Implicit(Plugin.Config.VEHICLE_PLATING_HEALTH_INCREMENTAL_INCREASE), add: true);
		}

		public override void Unwind()
		{
			UpdateCurrentVehicleHealth(ComputeAdditionalMaximumHealth(), add: false);
			((TierUpgrade)this).Unwind();
		}

		public static int GetAdditionalMaximumHealth(int defaultValue)
		{
			if (!SyncedEntry<bool>.op_Implicit(Plugin.Config.VEHICLE_PLATING_ENABLED))
			{
				return defaultValue;
			}
			if (!BaseUpgrade.GetActiveUpgrade("Vehicle Plating"))
			{
				return defaultValue;
			}
			int num = ComputeAdditionalMaximumHealth();
			return Mathf.Clamp(defaultValue + num, defaultValue, int.MaxValue);
		}

		private void UpdateCurrentVehicleHealth(int additionalHealth, bool add)
		{
			VehicleController[] array = Object.FindObjectsOfType<VehicleController>();
			foreach (VehicleController val in array)
			{
				if (!((Object)(object)val == (Object)null))
				{
					if (add)
					{
						val.carHP += additionalHealth;
					}
					else
					{
						val.carHP -= additionalHealth;
					}
				}
			}
		}

		public static int ComputeAdditionalMaximumHealth()
		{
			return SyncedEntry<int>.op_Implicit(Plugin.Config.VEHICLE_PLATING_HEALTH_INITIAL_INCREASE) + BaseUpgrade.GetUpgradeLevel("Vehicle Plating") * SyncedEntry<int>.op_Implicit(Plugin.Config.VEHICLE_PLATING_HEALTH_INCREMENTAL_INCREASE);
		}

		public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null)
		{
			Func<int, float> func = (int level) => Plugin.Config.VEHICLE_PLATING_HEALTH_INITIAL_INCREASE.Value + level * Plugin.Config.VEHICLE_PLATING_HEALTH_INCREMENTAL_INCREASE.Value;
			return Tools.GenerateInfoForUpgrade("LVL {0} - ${1} - Company Cruiser vehicle's maximum health is increased by {2}.\n", initialPrice, incrementalPrices, func, false);
		}

		public static (string, string[]) RegisterScrapToUpgrade()
		{
			return ("Vehicle Plating", Plugin.Config.VEHICLE_PLATING_ITEM_PROGRESSION_ITEMS.Value.Split(","));
		}

		public static void RegisterUpgrade()
		{
			GameObject val = NetworkPrefabs.CreateNetworkPrefab("Vehicle Plating");
			val.AddComponent<VehiclePlating>();
			NetworkPrefabs.RegisterNetworkPrefab(val);
			Plugin.networkPrefabs["Vehicle Plating"] = val;
		}

		public static CustomTerminalNode RegisterTerminalNode()
		{
			PluginConfig config = Plugin.Config;
			return UpgradeBus.Instance.SetupMultiplePurchasableTerminalNode("Vehicle Plating", true, config.VEHICLE_PLATING_ENABLED.Value, config.VEHICLE_PLATING_PRICE.Value, UpgradeBus.ParseUpgradePrices(config.VEHICLE_PLATING_PRICES.Value), SyncedEntry<bool>.op_Implicit(UpgradeBus.Instance.PluginConfiguration.OVERRIDE_UPGRADE_NAMES) ? SyncedEntry<string>.op_Implicit(config.VEHICLE_PLATING_OVERRIDE_NAME) : "", Plugin.networkPrefabs["Vehicle Plating"]);
		}

		protected override void __initializeVariables()
		{
			((TierUpgrade)this).__initializeVariables();
		}

		protected internal override string __getTypeName()
		{
			return "VehiclePlating";
		}
	}
}
namespace LategameCompanyCruiserUpgrades.Patches
{
	[HarmonyPatch(typeof(PlayerControllerB))]
	internal static class PlayerControllerBPatcher
	{
		[HarmonyPrefix]
		[HarmonyPatch("KillPlayer")]
		private static bool KillPlayerPrefix(PlayerControllerB __instance, Vector3 bodyVelocity, bool spawnBody, CauseOfDeath causeOfDeath, int deathAnimation, Vector3 positionOffset)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			return PreventInstantKill(ref __instance, bodyVelocity, spawnBody, causeOfDeath, deathAnimation, positionOffset);
		}

		private static bool PreventInstantKill(ref PlayerControllerB __instance, Vector3 bodyVelocity, bool spawnBody, CauseOfDeath causeOfDeath, int deathAnimation, Vector3 positionOffset)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Invalid comparison between Unknown and I4
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			if ((int)causeOfDeath == 16)
			{
				if (!BaseUpgrade.GetActiveUpgrade("Fluffy Seats"))
				{
					return true;
				}
				Plugin.mls.LogInfo((object)"Kill player fired due to car crash with Fluffy Seats upgrade on, mitigating 100 damage instead of instant kill...");
				__instance.DamagePlayer(FluffySeats.GetPlayerDamageMitigation(100), true, true, causeOfDeath, deathAnimation, false, bodyVelocity);
				return false;
			}
			return true;
		}
	}
	[HarmonyPatch(typeof(VehicleController))]
	internal static class VehicleControllerPatcher
	{
		[HarmonyTranspiler]
		[HarmonyPatch("Start")]
		private static IEnumerable<CodeInstruction> StartTranspiler(IEnumerable<CodeInstruction> instructions)
		{
			List<CodeInstruction> codes = new List<CodeInstruction>(instructions);
			int index = 0;
			IncreaseMaximumHealthTranspile(ref index, ref codes);
			return codes;
		}

		[HarmonyPatch("Update")]
		private static IEnumerable<CodeInstruction> UpdateTranspiler(IEnumerable<CodeInstruction> instructions)
		{
			List<CodeInstruction> codes = new List<CodeInstruction>(instructions);
			int index = 0;
			IncreaseMaximumHealthTranspile(ref index, ref codes);
			IncreaseBreakingPowerTranspile(ref index, ref codes);
			IncreaseBreakingPowerTranspile(ref index, ref codes);
			return codes;
		}

		[HarmonyTranspiler]
		[HarmonyPatch("ReactToDamage")]
		private static IEnumerable<CodeInstruction> ReactToDamageTranspiler(IEnumerable<CodeInstruction> instructions)
		{
			List<CodeInstruction> codes = new List<CodeInstruction>(instructions);
			int index = 0;
			IncreaseMaximumHealthTranspile(ref index, ref codes);
			IncreaseTurboCapacityTranspile(ref index, ref codes, isFloat: true);
			return codes;
		}

		private static void IncreaseMaximumHealthTranspile(ref int index, ref List<CodeInstruction> codes)
		{
			FieldInfo field = typeof(VehicleController).GetField("baseCarHP");
			MethodInfo method = typeof(VehiclePlating).GetMethod("GetAdditionalMaximumHealth");
			Tools.FindField(ref index, ref codes, field, method, false, false, false, false, false, false, "Couldn't find the baseCarHP field");
		}

		private static void IncreaseBreakingPowerTranspile(ref int index, ref List<CodeInstruction> codes)
		{
			MethodInfo method = typeof(BrakeFluid).GetMethod("GetIncreasedBrakingPower");
			Tools.FindFloat(ref index, ref codes, 2000f, method, false, false, false, false, false, false, "Couldn't find the 2000f value for the first wheel");
			Tools.FindFloat(ref index, ref codes, 2000f, method, false, false, false, false, false, false, "Couldn't find the 2000f value for the second wheel");
			Tools.FindFloat(ref index, ref codes, 2000f, method, false, false, false, false, false, false, "Couldn't find the 2000f value for the third wheel");
			Tools.FindFloat(ref index, ref codes, 2000f, method, false, false, false, false, false, false, "Couldn't find the 2000f value for the fourth wheel");
			Tools.FindFloat(ref index, ref codes, 2000f, method, false, false, false, false, false, false, "Couldn't find the 2000f value for the remaining wheels");
		}

		[HarmonyTranspiler]
		[HarmonyPatch("DamagePlayerInVehicle")]
		private static IEnumerable<CodeInstruction> DamagePlayerInVehicleTranspiler(IEnumerable<CodeInstruction> instructions)
		{
			MethodInfo method = typeof(FluffySeats).GetMethod("GetPlayerDamageMitigation");
			List<CodeInstruction> result = new List<CodeInstruction>(instructions);
			int num = 0;
			Tools.FindInteger(ref num, ref result, (sbyte)40, method, false, false, false, false, false, false, "Couldn't find the damage player with value of 40");
			Tools.FindInteger(ref num, ref result, (sbyte)30, method, false, false, false, false, false, false, "Couldn't find the damage player with value of 30");
			Tools.FindInteger(ref num, ref result, (sbyte)10, method, false, false, false, false, false, false, "Couldn't find the damage player with value of 10");
			return result;
		}

		[HarmonyTranspiler]
		[HarmonyPatch(/*Could not decode attribute arguments.*/)]
		private static IEnumerable<CodeInstruction> TryIgnitionTranspiler(IEnumerable<CodeInstruction> instructions)
		{
			FieldInfo field = typeof(VehicleController).GetField("chanceToStartIgnition", BindingFlags.Instance | BindingFlags.NonPublic);
			MethodInfo method = typeof(IgnitionCoil).GetMethod("GetAdditionalIgnitionChance");
			List<CodeInstruction> result = new List<CodeInstruction>(instructions);
			int num = 0;
			Tools.FindField(ref num, ref result, field, method, false, false, false, false, false, false, "Couldn't find usage of chanceToStartIgnition field");
			return result;
		}

		[HarmonyTranspiler]
		[HarmonyPatch("AddTurboBoost")]
		private static IEnumerable<CodeInstruction> AddTurboBoostTranspiler(IEnumerable<CodeInstruction> instructions)
		{
			List<CodeInstruction> codes = new List<CodeInstruction>(instructions);
			int index = 0;
			IncreaseTurboCapacityTranspile(ref index, ref codes);
			return codes;
		}

		private static void IncreaseTurboCapacityTranspile(ref int index, ref List<CodeInstruction> codes, bool isFloat = false)
		{
			if (!isFloat)
			{
				MethodInfo method = typeof(TurboTank).GetMethod("GetAdditionalTurboCapacity", new Type[1] { typeof(int) });
				Tools.FindInteger(ref index, ref codes, (sbyte)5, method, false, false, false, false, false, false, "Couldn't find the defined maximum turbo capacity when adding turbo boost");
			}
			else
			{
				MethodInfo method2 = typeof(TurboTank).GetMethod("GetAdditionalTurboCapacity", new Type[1] { typeof(float) });
				Tools.FindFloat(ref index, ref codes, 5f, method2, false, false, false, false, false, false, "Couldn't find the defined maximum turbo capacity when updating turbo scale");
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch("Start")]
		private static void StartPostfix(VehicleController __instance)
		{
			__instance.carAcceleration = RapidMotors.GetAdditionalAcceleration(__instance.carAcceleration);
			__instance.EngineTorque = SuperchargedPistons.GetAdditionalEngineTorque(__instance.EngineTorque);
			__instance.steeringWheelTurnSpeed = ImprovedSteering.GetAdditionalTurningSpeed(__instance.steeringWheelTurnSpeed);
		}
	}
}
namespace LategameCompanyCruiserUpgrades.Misc
{
	[DataContract]
	public class PluginConfig : SyncedConfig2<PluginConfig>
	{
		[field: SyncedEntryField]
		public SyncedEntry<bool> BRAKE_FLUID_ENABLED { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<int> BRAKE_FLUID_PRICE { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<string> BRAKE_FLUID_PRICES { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<string> BRAKE_FLUID_OVERRIDE_NAME { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<int> BRAKE_FLUID_POWER_INITIAL_INCREASE { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<int> BRAKE_FLUID_POWER_INCREMENTAL_INCREASE { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<string> BRAKE_FLUID_ITEM_PROGRESSION_ITEMS { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<bool> TURBO_TANK_ENABLED { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<int> TURBO_TANK_PRICE { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<string> TURBO_TANK_PRICES { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<string> TURBO_TANK_OVERRIDE_NAME { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<int> TURBO_TANK_CAPACITY_INITIAL_INCREASE { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<int> TURBO_TANK_CAPACITY_INCREMENTAL_INCREASE { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<string> TURBO_TANK_ITEM_PROGRESSION_ITEMS { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<bool> IGNITION_COIL_ENABLED { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<string> IGNITION_COIL_PRICES { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<string> IGNITION_COIL_OVERRIDE_NAME { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<int> IGNITION_COIL_IGNITION_INITIAL_CHANCE_INCREASE { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<int> IGNITION_COIL_IGNITION_INCREMENTAL_CHANCE_INCREASE { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<int> IGNITION_COIL_PRICE { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<string> IGNITION_COIL_ITEM_PROGRESSION_ITEMS { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<bool> FLUFFY_SEATS_ENABLED { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<int> FLUFFY_SEATS_PRICE { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<string> FLUFFY_SEATS_PRICES { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<string> FLUFFY_SEATS_OVERRIDE_NAME { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<int> FLUFFY_SEATS_DAMAGE_MITIGATION_INITIAL_INCREASE { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<int> FLUFFY_SEATS_DAMAGE_MITIGATION_INCREMENTAL_INCREASE { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<string> FLUFFY_SEATS_ITEM_PROGRESSION_ITEMS { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<bool> IMPROVED_STEERING_ENABLED { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<int> IMPROVED_STEERING_PRICE { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<string> IMPROVED_STEERING_PRICES { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<string> IMPROVED_STEERING_OVERRIDE_NAME { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<float> IMPROVED_STEERING_TURNING_SPEED_INITIAL_INCREASE { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<float> IMPROVED_STEERING_TURNING_SPEED_INCREMENTAL_INCREASE { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<string> IMPROVED_STEERING_ITEM_PROGRESSION_ITEMS { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<bool> SUPERCHARGED_PISTONS_ENABLED { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<int> SUPERCHARGED_PISTONS_PRICE { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<string> SUPERCHARGED_PISTONS_PRICES { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<string> SUPERCHARGED_PISTONS_OVERRIDE_NAME { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<float> SUPERCHARGED_PISTONS_ENGINE_TORQUE_INITIAL_INCREASE { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<float> SUPERCHARGED_PISTONS_ENGINE_TORQUE_INCREMENTAL_INCREASE { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<string> SUPERCHARGED_PISTONS_ITEM_PROGRESSION_ITEMS { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<bool> RAPID_MOTORS_ENABLED { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<int> RAPID_MOTORS_PRICE { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<string> RAPID_MOTORS_PRICES { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<string> RAPID_MOTORS_OVERRIDE_NAME { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<float> RAPID_MOTORS_ACCELERATION_INITIAL_INCREASE { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<float> RAPID_MOTORS_ACCELERATION_INCREMENTAL_INCREASE { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<string> RAPID_MOTORS_ITEM_PROGRESSION_ITEMS { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<bool> VEHICLE_PLATING_ENABLED { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<int> VEHICLE_PLATING_PRICE { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<string> VEHICLE_PLATING_PRICES { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<string> VEHICLE_PLATING_OVERRIDE_NAME { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<int> VEHICLE_PLATING_HEALTH_INITIAL_INCREASE { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<int> VEHICLE_PLATING_HEALTH_INCREMENTAL_INCREASE { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<string> VEHICLE_PLATING_ITEM_PROGRESSION_ITEMS { get; set; }

		public PluginConfig(ConfigFile cfg)
			: base("com.github.WhiteSpike.LategameCompanyCruiserUpgrades")
		{
			string text = "Brake Fluid";
			BRAKE_FLUID_ENABLED = SyncedBindingExtensions.BindSyncedEntry<bool>(cfg, text, "Enable Brake Fluid Upgrade", true, "Tier upgrade which increases the braking capability of the Company Cruiser vehicle.");
			BRAKE_FLUID_PRICE = SyncedBindingExtensions.BindSyncedEntry<int>(cfg, text, "Price of Brake Fluid Upgrade", 100, (ConfigDescription)null);
			BRAKE_FLUID_PRICES = SyncedBindingExtensions.BindSyncedEntry<string>(cfg, text, "Price of each additional upgrade", "100,150,250", "Value must be seperated by commas EX: '123,321,222'");
			BRAKE_FLUID_POWER_INITIAL_INCREASE = SyncedBindingExtensions.BindSyncedEntry<int>(cfg, text, "Initial Break Power Increase", 25, "Percentage of break power increased when first purchasing the upgrade on the Company Cruiser Vehicle");
			BRAKE_FLUID_POWER_INCREMENTAL_INCREASE = SyncedBindingExtensions.BindSyncedEntry<int>(cfg, text, "Incremental Break Power Increase", 25, "Percentage of break power increased when purchasing further levels of the upgrade on the Company Cruiser Vehicle");
			BRAKE_FLUID_ITEM_PROGRESSION_ITEMS = SyncedBindingExtensions.BindSyncedEntry<string>(cfg, text, "Contribution Items", "", "Items that when sold contribute to the purchase of the upgrade. Either the scan node's name or ItemProperties.itemName can be inserted here");
			text = "Turbo Tank";
			TURBO_TANK_ENABLED = SyncedBindingExtensions.BindSyncedEntry<bool>(cfg, text, "Enable Turbo Tank Upgrade", true, "Tier upgrade which increases the maximum capacity of Company Cruiser Vehicle's turbo");
			TURBO_TANK_PRICE = SyncedBindingExtensions.BindSyncedEntry<int>(cfg, text, "Price of Turbo Tank Upgrade", 200, (ConfigDescription)null);
			TURBO_TANK_PRICES = SyncedBindingExtensions.BindSyncedEntry<string>(cfg, text, "Price of each additional upgrade", "100,200,300", "Value must be seperated by commas EX: '123,321,222'");
			TURBO_TANK_CAPACITY_INITIAL_INCREASE = SyncedBindingExtensions.BindSyncedEntry<int>(cfg, text, "Initial Turbo Capacity Increase", 2, "Amount of turbo capacity increased when first purchasing the upgrade on the Company Cruiser Vehicle");
			TURBO_TANK_CAPACITY_INCREMENTAL_INCREASE = SyncedBindingExtensions.BindSyncedEntry<int>(cfg, text, "Incremental Turbo Capacity Increase", 1, "Amount of turbo capacity increased when purchasing further levels of the upgrade on the Company Cruiser Vehicle");
			TURBO_TANK_ITEM_PROGRESSION_ITEMS = SyncedBindingExtensions.BindSyncedEntry<string>(cfg, text, "Contribution Items", "", "Items that when sold contribute to the purchase of the upgrade. Either the scan node's name or ItemProperties.itemName can be inserted here");
			text = "Ignition Coil";
			IGNITION_COIL_ENABLED = SyncedBindingExtensions.BindSyncedEntry<bool>(cfg, text, "Enable Ignition Coil Upgrade", true, "Tier upgrade which increases the chance of ignition to turn on the Company Cruiser Vehicle.");
			IGNITION_COIL_PRICE = SyncedBindingExtensions.BindSyncedEntry<int>(cfg, text, "Price of Ignition Coil Upgrade", 50, (ConfigDescription)null);
			IGNITION_COIL_PRICES = SyncedBindingExtensions.BindSyncedEntry<string>(cfg, text, "Price of each additional upgrade", "50,100,100", "Value must be seperated by commas EX: '123,321,222'");
			IGNITION_COIL_IGNITION_INITIAL_CHANCE_INCREASE = SyncedBindingExtensions.BindSyncedEntry<int>(cfg, text, "Initial Ignition Chance Increase", 25, "Amount of chance (%) increased when first purchasing the upgrade to ignite on the Company Cruiser Vehicle");
			IGNITION_COIL_IGNITION_INCREMENTAL_CHANCE_INCREASE = SyncedBindingExtensions.BindSyncedEntry<int>(cfg, text, "Incremental Ignition Chance Increase", 25, "Amount of chance (%) increased when purchasing further levels of the upgrade to ignite on the Company Cruiser Vehicle");
			IGNITION_COIL_ITEM_PROGRESSION_ITEMS = SyncedBindingExtensions.BindSyncedEntry<string>(cfg, text, "Contribution Items", "", "Items that when sold contribute to the purchase of the upgrade. Either the scan node's name or ItemProperties.itemName can be inserted here");
			text = "Fluffy Seats";
			FLUFFY_SEATS_ENABLED = SyncedBindingExtensions.BindSyncedEntry<bool>(cfg, text, "Enable Fluffy Seats Upgrade", true, "Tier upgrade which provides player damage mitigation when bumping too hard with the Company Cruiser Vehicle.");
			FLUFFY_SEATS_PRICE = SyncedBindingExtensions.BindSyncedEntry<int>(cfg, text, "Price of Fluffy Seats Upgrade", 100, (ConfigDescription)null);
			FLUFFY_SEATS_PRICES = SyncedBindingExtensions.BindSyncedEntry<string>(cfg, text, "Price of each additional upgrade", "100,150,200", "Value must be seperated by commas EX: '123,321,222'");
			FLUFFY_SEATS_DAMAGE_MITIGATION_INITIAL_INCREASE = SyncedBindingExtensions.BindSyncedEntry<int>(cfg, text, "Initial Player Damage Mitigation Increase", 25, "Amount of damage mitigation (%) increased when first purchasing the upgrade when riding the Company Cruiser Vehicle.");
			FLUFFY_SEATS_DAMAGE_MITIGATION_INCREMENTAL_INCREASE = SyncedBindingExtensions.BindSyncedEntry<int>(cfg, text, "Incremental Player Damage Mitigation Increase", 25, "Amount of damage mitigation (%) increased when purchasing further levels of the upgrade when riding the Company Cruiser Vehicle.");
			FLUFFY_SEATS_ITEM_PROGRESSION_ITEMS = SyncedBindingExtensions.BindSyncedEntry<string>(cfg, text, "Contribution Items", "", "Items that when sold contribute to the purchase of the upgrade. Either the scan node's name or ItemProperties.itemName can be inserted here");
			text = "Improved Steering";
			IMPROVED_STEERING_ENABLED = SyncedBindingExtensions.BindSyncedEntry<bool>(cfg, text, "Enable Improved Steering Upgrade", true, "Tier upgrade which increases the turning speed of the Company Cruiser vehicle");
			IMPROVED_STEERING_PRICE = SyncedBindingExtensions.BindSyncedEntry<int>(cfg, text, "Price of Improved Steering Upgrade", 100, (ConfigDescription)null);
			IMPROVED_STEERING_PRICES = SyncedBindingExtensions.BindSyncedEntry<string>(cfg, text, "Price of each additional upgrade", "100,150,250", "Value must be seperated by commas EX: '123,321,222'");
			IMPROVED_STEERING_TURNING_SPEED_INITIAL_INCREASE = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, text, "Initial Turning Speed Increase", 1f, "Amount of turning speed increased when first purchasing the upgrade to the Company Cruiser vehicle.");
			IMPROVED_STEERING_TURNING_SPEED_INCREMENTAL_INCREASE = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, text, "Incremental Turning Speed Increase", 0.5f, "Amount of turning speed increased when purchasing further levels of the upgrade to the Company Cruiser vehicle.");
			IMPROVED_STEERING_ITEM_PROGRESSION_ITEMS = SyncedBindingExtensions.BindSyncedEntry<string>(cfg, text, "Contribution Items", "", "Items that when sold contribute to the purchase of the upgrade. Either the scan node's name or ItemProperties.itemName can be inserted here");
			text = "Supercharged Pistons";
			SUPERCHARGED_PISTONS_ENABLED = SyncedBindingExtensions.BindSyncedEntry<bool>(cfg, text, "Enable Supercharged Pistons Upgrade", true, "Tier upgrade which increases the company cruiser's maximum speed when driving");
			SUPERCHARGED_PISTONS_PRICE = SyncedBindingExtensions.BindSyncedEntry<int>(cfg, text, "Price of Supercharged Pistons Upgrade", 250, (ConfigDescription)null);
			SUPERCHARGED_PISTONS_PRICES = SyncedBindingExtensions.BindSyncedEntry<string>(cfg, text, "Price of each additional upgrade", "200,350", "Value must be seperated by commas EX: '123,321,222'");
			SUPERCHARGED_PISTONS_ENGINE_TORQUE_INITIAL_INCREASE = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, text, "Initial Engine Torque Increase", 40f, "Amount of maximum speed increased when first purchasing the upgrade to the Company Cruiser vehicle.");
			SUPERCHARGED_PISTONS_ENGINE_TORQUE_INCREMENTAL_INCREASE = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, text, "Incremental Engine Torque Increase", 20f, "Amount of maximum speed increased when purchasing further levels of the upgrade to the Company Cruiser vehicle.");
			SUPERCHARGED_PISTONS_ITEM_PROGRESSION_ITEMS = SyncedBindingExtensions.BindSyncedEntry<string>(cfg, text, "Contribution Items", "", "Items that when sold contribute to the purchase of the upgrade. Either the scan node's name or ItemProperties.itemName can be inserted here");
			text = "Rapid Motors";
			RAPID_MOTORS_ENABLED = SyncedBindingExtensions.BindSyncedEntry<bool>(cfg, text, "Enable Rapid Motors Upgrade", true, "Tier upgrade which increases the company cruiser's acceleration when driving.");
			RAPID_MOTORS_PRICE = SyncedBindingExtensions.BindSyncedEntry<int>(cfg, text, "Price of Rapid Motors Upgrade", 150, (ConfigDescription)null);
			RAPID_MOTORS_PRICES = SyncedBindingExtensions.BindSyncedEntry<string>(cfg, text, "Price of each additional upgrade", "200,300,400", "Value must be seperated by commas EX: '123,321,222'");
			RAPID_MOTORS_ACCELERATION_INITIAL_INCREASE = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, text, "Initial Acceleration Increase", 2f, "Amount of acceleration increased when first purchasing the upgrade to the company cruiser vehicle.");
			RAPID_MOTORS_ACCELERATION_INCREMENTAL_INCREASE = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, text, "Incremental Acceleration Increase", 0.5f, "Amount of acceleration increased when purchasing further levels of the upgrade to the company cruiser vehicle.");
			RAPID_MOTORS_ITEM_PROGRESSION_ITEMS = SyncedBindingExtensions.BindSyncedEntry<string>(cfg, text, "Contribution Items", "", "Items that when sold contribute to the purchase of the upgrade. Either the scan node's name or ItemProperties.itemName can be inserted here");
			text = "Vehicle Plating";
			VEHICLE_PLATING_ENABLED = SyncedBindingExtensions.BindSyncedEntry<bool>(cfg, text, "Enable Vehicle Plating Upgrade", true, "Tier upgrade which increases the company cruiser's maximum health to sustain damage from outside sources.");
			VEHICLE_PLATING_PRICE = SyncedBindingExtensions.BindSyncedEntry<int>(cfg, text, "Price of Vehicle Plating Upgrade", 150, (ConfigDescription)null);
			VEHICLE_PLATING_PRICES = SyncedBindingExtensions.BindSyncedEntry<string>(cfg, text, "Price of each additional upgrade", "300,400,500,600", "Value must be seperated by commas EX: '123,321,222'");
			VEHICLE_PLATING_HEALTH_INITIAL_INCREASE = SyncedBindingExtensions.BindSyncedEntry<int>(cfg, text, "Initial Health Increase", 10, "Amount of health increased when first purchasing the upgrade to the company cruiser vehicle.");
			VEHICLE_PLATING_HEALTH_INCREMENTAL_INCREASE = SyncedBindingExtensions.BindSyncedEntry<int>(cfg, text, "Incremental Health Increase", 5, "Amount of health increased when purchasing further levels of the upgrade to the company cruiser vehicle.");
			VEHICLE_PLATING_ITEM_PROGRESSION_ITEMS = SyncedBindingExtensions.BindSyncedEntry<string>(cfg, text, "Contribution Items", "", "Items that when sold contribute to the purchase of the upgrade. Either the scan node's name or ItemProperties.itemName can be inserted here");
			text = "Override Names";
			BRAKE_FLUID_OVERRIDE_NAME = SyncedBindingExtensions.BindSyncedEntry<string>(cfg, text, Constants.BRAKE_FLUID_OVERRIDE_NAME_KEY, "Brake Fluid", (ConfigDescription)null);
			TURBO_TANK_OVERRIDE_NAME = SyncedBindingExtensions.BindSyncedEntry<string>(cfg, text, Constants.TURBO_TANK_OVERRIDE_NAME_KEY, "Turbo Tank", (ConfigDescription)null);
			IGNITION_COIL_OVERRIDE_NAME = SyncedBindingExtensions.BindSyncedEntry<string>(cfg, text, Constants.IGNITION_COIL_OVERRIDE_NAME_KEY, "Ignition Coil", (ConfigDescription)null);
			FLUFFY_SEATS_OVERRIDE_NAME = SyncedBindingExtensions.BindSyncedEntry<string>(cfg, text, Constants.FLUFFY_SEATS_OVERRIDE_NAME_KEY, "Fluffy Seats", (ConfigDescription)null);
			IMPROVED_STEERING_OVERRIDE_NAME = SyncedBindingExtensions.BindSyncedEntry<string>(cfg, text, Constants.IMPROVED_STEERING_OVERRIDE_NAME_KEY, "Improved Steering", (ConfigDescription)null);
			SUPERCHARGED_PISTONS_OVERRIDE_NAME = SyncedBindingExtensions.BindSyncedEntry<string>(cfg, text, Constants.SUPERCHARGED_PISTONS_OVERRIDE_NAME_KEY, "Supercharged Pistons", (ConfigDescription)null);
			RAPID_MOTORS_OVERRIDE_NAME = SyncedBindingExtensions.BindSyncedEntry<string>(cfg, text, Constants.RAPID_MOTORS_OVERRIDE_NAME_KEY, "Rapid Motors", (ConfigDescription)null);
			VEHICLE_PLATING_OVERRIDE_NAME = SyncedBindingExtensions.BindSyncedEntry<string>(cfg, text, Constants.VEHICLE_PLATING_OVERRIDE_NAME_KEY, "Vehicle Plating", (ConfigDescription)null);
			base.InitialSyncCompleted += PluginConfig_InitialSyncCompleted;
			ConfigManager.Register<PluginConfig>((SyncedConfig2<PluginConfig>)this);
		}

		private void PluginConfig_InitialSyncCompleted(object sender, EventArgs e)
		{
			UpgradeBus.Instance.Reconstruct();
		}
	}
	internal static class Metadata
	{
		public const string GUID = "com.github.WhiteSpike.LategameCompanyCruiserUpgrades";

		public const string NAME = "Lategame Company Cruiser Upgrades";

		public const string VERSION = "1.1.1";
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		public IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}
namespace LategameCompanyCruiserUpgrades.NetcodePatcher
{
	[AttributeUsage(AttributeTargets.Module)]
	internal class NetcodePatchedAssemblyAttribute : Attribute
	{
	}
}