using System;
using System.Collections;
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 HarmonyLib;
using InstableTruck.config;
using InstableTruck.patches;
using LethalConfig;
using LethalConfig.ConfigItems;
using LethalConfig.ConfigItems.Options;
using Unity.Netcode;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("InstableTruck")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("InstableTruck")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("3bf1170c-63a7-4544-a878-6fd8fc5a0ed1")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace InstableTruck
{
[BepInPlugin("Zesa.InstableTruck", "InstableTruck", "1.0.3.0")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class InstableTruckBase : BaseUnityPlugin
{
private const string modGUID = "Zesa.InstableTruck";
private const string modName = "InstableTruck";
private const string modVersion = "1.0.3.0";
private static InstableTruckBase Instance;
private readonly Harmony harmony = new Harmony("Zesa.InstableTruck");
public static ManualLogSource Log => ((BaseUnityPlugin)Instance).Logger;
internal static ITConfig ITC { get; private set; }
private void Awake()
{
if ((Object)(object)Instance == (Object)null)
{
Instance = this;
}
ITC = new ITConfig(((BaseUnityPlugin)this).Config);
Log.LogInfo((object)"Patching truck..");
harmony.PatchAll(typeof(VehicleControllerPatch));
Log.LogInfo((object)"Truck patched..");
}
}
}
namespace InstableTruck.patches
{
[HarmonyPatch(typeof(VehicleController))]
public class VehicleControllerPatch
{
internal static float explosionTimer;
internal static bool shouldTrigger(VehicleController truck, int configPercentage)
{
int num = 0;
int num2 = Random.Range(1, 100);
num = ((!InstableTruckBase.ITC.percentageBasedOnDamage.Value) ? configPercentage : (100 - truck.carHP / truck.baseCarHP * 100));
InstableTruckBase.Log.LogInfo((object)$"Chance: {num}% | Rolled: {num2}");
if (num2 <= num)
{
return true;
}
return false;
}
private static IEnumerator TriggerAfterSeconds(VehicleController truck, int clientId, bool withDelay = true)
{
if (withDelay)
{
int num = (InstableTruckBase.ITC.randomInstabilityDelay.Value ? Random.Range(0, 5) : InstableTruckBase.ITC.instabilityDelay.Value);
yield return (object)new WaitForSeconds((float)num);
}
string value = InstableTruckBase.ITC.instabilityResult.Value;
if (!(value == "Explosion"))
{
if (value == "Eject Driver")
{
truck.SpringDriverSeatLocalClient();
}
}
else
{
Traverse.Create((object)truck).Method("DestroyCar", Array.Empty<object>()).GetValue();
truck.DestroyCarServerRpc(clientId);
}
}
[HarmonyPatch("Update")]
[HarmonyPostfix]
public static void onUpdate(VehicleController __instance)
{
if (!InstableTruckBase.ITC.enableInstableTruck.Value || !InstableTruckBase.ITC.instabilityChanceAfterTime.Value || StartOfRound.Instance.inShipPhase)
{
explosionTimer = 0f;
return;
}
VehicleController val = Object.FindObjectOfType<VehicleController>();
if ((Object)(object)val == (Object)null || !val.ignitionStarted || val.magnetedToShip)
{
explosionTimer = 0f;
return;
}
explosionTimer += Time.deltaTime;
if (explosionTimer > (float)InstableTruckBase.ITC.instabilityChanceInterval.Value)
{
if (shouldTrigger(val, InstableTruckBase.ITC.intervalInstability.Value))
{
((MonoBehaviour)val).StartCoroutine(TriggerAfterSeconds(val, 0, withDelay: false));
}
explosionTimer -= InstableTruckBase.ITC.instabilityChanceInterval.Value;
}
}
[HarmonyPatch("__rpc_handler_548979688")]
[HarmonyPrefix]
[HarmonyWrapSafe]
public static void AddEngineOilServerRpc(FastBufferReader reader)
{
//IL_0050: Unknown result type (might be due to invalid IL or missing references)
if (InstableTruckBase.ITC.enableInstableTruck.Value && (float)InstableTruckBase.ITC.addEngineOilInstability.Value != 0f)
{
VehicleController val = Object.FindObjectOfType<VehicleController>();
if (!((Object)(object)val == (Object)null) && shouldTrigger(val, InstableTruckBase.ITC.addEngineOilInstability.Value))
{
int clientId = default(int);
ByteUnpacker.ReadValueBitPacked(reader, ref clientId);
((MonoBehaviour)val).StartCoroutine(TriggerAfterSeconds(val, clientId));
}
}
}
[HarmonyPatch("__rpc_handler_721150963")]
[HarmonyPrefix]
[HarmonyWrapSafe]
public static void SetRadioStationServerRpc(__RpcParams rpcParams)
{
//IL_0052: Unknown result type (might be due to invalid IL or missing references)
//IL_0053: Unknown result type (might be due to invalid IL or missing references)
//IL_0058: Unknown result type (might be due to invalid IL or missing references)
if (InstableTruckBase.ITC.enableInstableTruck.Value && (float)InstableTruckBase.ITC.setRadioStationInstability.Value != 0f)
{
VehicleController val = Object.FindObjectOfType<VehicleController>();
if (!((Object)(object)val == (Object)null) && shouldTrigger(val, InstableTruckBase.ITC.setRadioStationInstability.Value))
{
((MonoBehaviour)val).StartCoroutine(TriggerAfterSeconds(val, (int)rpcParams.Server.Receive.SenderClientId));
}
}
}
[HarmonyPatch("__rpc_handler_2416589835")]
[HarmonyPrefix]
[HarmonyWrapSafe]
public static void SetRadioOnServerRpc(__RpcParams rpcParams)
{
//IL_0052: Unknown result type (might be due to invalid IL or missing references)
//IL_0053: Unknown result type (might be due to invalid IL or missing references)
//IL_0058: Unknown result type (might be due to invalid IL or missing references)
if (InstableTruckBase.ITC.enableInstableTruck.Value && (float)InstableTruckBase.ITC.setRadioOnInstability.Value != 0f)
{
VehicleController val = Object.FindObjectOfType<VehicleController>();
if (!((Object)(object)val == (Object)null) && shouldTrigger(val, InstableTruckBase.ITC.setRadioOnInstability.Value))
{
((MonoBehaviour)val).StartCoroutine(TriggerAfterSeconds(val, (int)rpcParams.Server.Receive.SenderClientId));
}
}
}
[HarmonyPatch("__rpc_handler_2451439781")]
[HarmonyPrefix]
[HarmonyWrapSafe]
public static void MagnetCarServerRpc(__RpcParams rpcParams)
{
//IL_0052: Unknown result type (might be due to invalid IL or missing references)
//IL_0053: Unknown result type (might be due to invalid IL or missing references)
//IL_0058: Unknown result type (might be due to invalid IL or missing references)
if (InstableTruckBase.ITC.enableInstableTruck.Value && (float)InstableTruckBase.ITC.magnetCarInstability.Value != 0f)
{
VehicleController val = Object.FindObjectOfType<VehicleController>();
if (!((Object)(object)val == (Object)null) && shouldTrigger(val, InstableTruckBase.ITC.magnetCarInstability.Value))
{
((MonoBehaviour)val).StartCoroutine(TriggerAfterSeconds(val, (int)rpcParams.Server.Receive.SenderClientId));
}
}
}
[HarmonyPatch("__rpc_handler_2150817317")]
[HarmonyPrefix]
[HarmonyWrapSafe]
public static void PassengerLeaveVehicleServerRpc(__RpcParams rpcParams)
{
//IL_0052: Unknown result type (might be due to invalid IL or missing references)
//IL_0053: Unknown result type (might be due to invalid IL or missing references)
//IL_0058: Unknown result type (might be due to invalid IL or missing references)
if (InstableTruckBase.ITC.enableInstableTruck.Value && (float)InstableTruckBase.ITC.passengerLeaveVehicleInstability.Value != 0f)
{
VehicleController val = Object.FindObjectOfType<VehicleController>();
if (!((Object)(object)val == (Object)null) && shouldTrigger(val, InstableTruckBase.ITC.passengerLeaveVehicleInstability.Value))
{
((MonoBehaviour)val).StartCoroutine(TriggerAfterSeconds(val, (int)rpcParams.Server.Receive.SenderClientId));
}
}
}
[HarmonyPatch("__rpc_handler_4058179333")]
[HarmonyPrefix]
[HarmonyWrapSafe]
public static void PushTruckServerRpc(__RpcParams rpcParams)
{
//IL_0052: Unknown result type (might be due to invalid IL or missing references)
//IL_0053: Unknown result type (might be due to invalid IL or missing references)
//IL_0058: Unknown result type (might be due to invalid IL or missing references)
if (InstableTruckBase.ITC.enableInstableTruck.Value && (float)InstableTruckBase.ITC.pushTruckInstability.Value != 0f)
{
VehicleController val = Object.FindObjectOfType<VehicleController>();
if (!((Object)(object)val == (Object)null) && shouldTrigger(val, InstableTruckBase.ITC.pushTruckInstability.Value))
{
((MonoBehaviour)val).StartCoroutine(TriggerAfterSeconds(val, (int)rpcParams.Server.Receive.SenderClientId));
}
}
}
[HarmonyPatch("__rpc_handler_269855870")]
[HarmonyPrefix]
[HarmonyWrapSafe]
public static void RemoveKeyFromIgnitionServerRpc(__RpcParams rpcParams)
{
//IL_0052: Unknown result type (might be due to invalid IL or missing references)
//IL_0053: Unknown result type (might be due to invalid IL or missing references)
//IL_0058: Unknown result type (might be due to invalid IL or missing references)
if (InstableTruckBase.ITC.enableInstableTruck.Value && (float)InstableTruckBase.ITC.removeKeyFromIgnitionInstability.Value != 0f)
{
VehicleController val = Object.FindObjectOfType<VehicleController>();
if (!((Object)(object)val == (Object)null) && shouldTrigger(val, InstableTruckBase.ITC.removeKeyFromIgnitionInstability.Value))
{
((MonoBehaviour)val).StartCoroutine(TriggerAfterSeconds(val, (int)rpcParams.Server.Receive.SenderClientId));
}
}
}
[HarmonyPatch("__rpc_handler_735895017")]
[HarmonyPrefix]
[HarmonyWrapSafe]
public static void SetHonkServerRpc(__RpcParams rpcParams)
{
//IL_0052: Unknown result type (might be due to invalid IL or missing references)
//IL_0053: Unknown result type (might be due to invalid IL or missing references)
//IL_0058: Unknown result type (might be due to invalid IL or missing references)
if (InstableTruckBase.ITC.enableInstableTruck.Value && (float)InstableTruckBase.ITC.setHonkInstability.Value != 0f)
{
VehicleController val = Object.FindObjectOfType<VehicleController>();
if (!((Object)(object)val == (Object)null) && shouldTrigger(val, InstableTruckBase.ITC.setHonkInstability.Value))
{
((MonoBehaviour)val).StartCoroutine(TriggerAfterSeconds(val, (int)rpcParams.Server.Receive.SenderClientId));
}
}
}
[HarmonyPatch("__rpc_handler_3804995530")]
[HarmonyPrefix]
[HarmonyWrapSafe]
public static void SetHoodOpenServerRpc(__RpcParams rpcParams)
{
//IL_0052: Unknown result type (might be due to invalid IL or missing references)
//IL_0053: Unknown result type (might be due to invalid IL or missing references)
//IL_0058: Unknown result type (might be due to invalid IL or missing references)
if (InstableTruckBase.ITC.enableInstableTruck.Value && (float)InstableTruckBase.ITC.setHoodOpenInstability.Value != 0f)
{
VehicleController val = Object.FindObjectOfType<VehicleController>();
if (!((Object)(object)val == (Object)null) && shouldTrigger(val, InstableTruckBase.ITC.setHoodOpenInstability.Value))
{
((MonoBehaviour)val).StartCoroutine(TriggerAfterSeconds(val, (int)rpcParams.Server.Receive.SenderClientId));
}
}
}
[HarmonyPatch("__rpc_handler_835626980")]
[HarmonyPrefix]
[HarmonyWrapSafe]
public static void TryIgnitionServerRpc(__RpcParams rpcParams)
{
//IL_0052: Unknown result type (might be due to invalid IL or missing references)
//IL_0053: Unknown result type (might be due to invalid IL or missing references)
//IL_0058: Unknown result type (might be due to invalid IL or missing references)
if (InstableTruckBase.ITC.enableInstableTruck.Value && (float)InstableTruckBase.ITC.tryIgnitionInstability.Value != 0f)
{
VehicleController val = Object.FindObjectOfType<VehicleController>();
if (!((Object)(object)val == (Object)null) && shouldTrigger(val, InstableTruckBase.ITC.tryIgnitionInstability.Value))
{
((MonoBehaviour)val).StartCoroutine(TriggerAfterSeconds(val, (int)rpcParams.Server.Receive.SenderClientId));
}
}
}
[HarmonyPatch("__rpc_handler_369816798")]
[HarmonyPrefix]
[HarmonyWrapSafe]
public static void ToggleHeadlightsServerRpc(__RpcParams rpcParams)
{
//IL_0052: Unknown result type (might be due to invalid IL or missing references)
//IL_0053: Unknown result type (might be due to invalid IL or missing references)
//IL_0058: Unknown result type (might be due to invalid IL or missing references)
if (InstableTruckBase.ITC.enableInstableTruck.Value && (float)InstableTruckBase.ITC.toggleHeadlightsInstability.Value != 0f)
{
VehicleController val = Object.FindObjectOfType<VehicleController>();
if (!((Object)(object)val == (Object)null) && shouldTrigger(val, InstableTruckBase.ITC.toggleHeadlightsInstability.Value))
{
((MonoBehaviour)val).StartCoroutine(TriggerAfterSeconds(val, (int)rpcParams.Server.Receive.SenderClientId));
}
}
}
[HarmonyPatch("__rpc_handler_46143233")]
[HarmonyPrefix]
[HarmonyWrapSafe]
public static void SpringDriverSeatServerRpc(__RpcParams rpcParams)
{
//IL_0052: Unknown result type (might be due to invalid IL or missing references)
//IL_0053: Unknown result type (might be due to invalid IL or missing references)
//IL_0058: Unknown result type (might be due to invalid IL or missing references)
if (InstableTruckBase.ITC.enableInstableTruck.Value && (float)InstableTruckBase.ITC.springDriverSeatInstability.Value != 0f)
{
VehicleController val = Object.FindObjectOfType<VehicleController>();
if (!((Object)(object)val == (Object)null) && shouldTrigger(val, InstableTruckBase.ITC.springDriverSeatInstability.Value))
{
((MonoBehaviour)val).StartCoroutine(TriggerAfterSeconds(val, (int)rpcParams.Server.Receive.SenderClientId));
}
}
}
[HarmonyPatch("__rpc_handler_1427257619")]
[HarmonyPrefix]
[HarmonyWrapSafe]
public static void ShiftToGearServerRpc(__RpcParams rpcParams)
{
//IL_0052: Unknown result type (might be due to invalid IL or missing references)
//IL_0053: Unknown result type (might be due to invalid IL or missing references)
//IL_0058: Unknown result type (might be due to invalid IL or missing references)
if (InstableTruckBase.ITC.enableInstableTruck.Value && (float)InstableTruckBase.ITC.shiftToGearInstability.Value != 0f)
{
VehicleController val = Object.FindObjectOfType<VehicleController>();
if (!((Object)(object)val == (Object)null) && shouldTrigger(val, InstableTruckBase.ITC.shiftToGearInstability.Value))
{
((MonoBehaviour)val).StartCoroutine(TriggerAfterSeconds(val, (int)rpcParams.Server.Receive.SenderClientId));
}
}
}
}
}
namespace InstableTruck.config
{
internal class ITConfig
{
public readonly ConfigEntry<bool> enableInstableTruck;
public readonly ConfigEntry<string> instabilityResult;
public readonly ConfigEntry<bool> randomInstabilityDelay;
public readonly ConfigEntry<int> instabilityDelay;
public readonly ConfigEntry<bool> percentageBasedOnDamage;
public readonly ConfigEntry<bool> instabilityChanceAfterTime;
public readonly ConfigEntry<int> instabilityChanceInterval;
public readonly ConfigEntry<int> intervalInstability;
public readonly ConfigEntry<int> addEngineOilInstability;
public readonly ConfigEntry<int> setRadioStationInstability;
public readonly ConfigEntry<int> setRadioOnInstability;
public readonly ConfigEntry<int> magnetCarInstability;
public readonly ConfigEntry<int> passengerLeaveVehicleInstability;
public readonly ConfigEntry<int> pushTruckInstability;
public readonly ConfigEntry<int> removeKeyFromIgnitionInstability;
public readonly ConfigEntry<int> setHonkInstability;
public readonly ConfigEntry<int> setHoodOpenInstability;
public readonly ConfigEntry<int> tryIgnitionInstability;
public readonly ConfigEntry<int> toggleHeadlightsInstability;
public readonly ConfigEntry<int> springDriverSeatInstability;
public readonly ConfigEntry<int> shiftToGearInstability;
public ITConfig(ConfigFile cfg)
{
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_003a: Expected O, but got Unknown
//IL_0065: Unknown result type (might be due to invalid IL or missing references)
//IL_006b: Expected O, but got Unknown
//IL_008f: Unknown result type (might be due to invalid IL or missing references)
//IL_0099: Expected O, but got Unknown
//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
//IL_00c6: Expected O, but got Unknown
//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
//IL_00f3: Expected O, but got Unknown
//IL_0115: Unknown result type (might be due to invalid IL or missing references)
//IL_011a: Unknown result type (might be due to invalid IL or missing references)
//IL_0121: Expected O, but got Unknown
//IL_0121: Unknown result type (might be due to invalid IL or missing references)
//IL_0128: Expected O, but got Unknown
//IL_0128: Unknown result type (might be due to invalid IL or missing references)
//IL_0134: Expected O, but got Unknown
//IL_012f: Unknown result type (might be due to invalid IL or missing references)
//IL_0139: Expected O, but got Unknown
//IL_015c: Unknown result type (might be due to invalid IL or missing references)
//IL_0166: Expected O, but got Unknown
//IL_0189: Unknown result type (might be due to invalid IL or missing references)
//IL_018e: Unknown result type (might be due to invalid IL or missing references)
//IL_0196: Expected O, but got Unknown
//IL_0196: Unknown result type (might be due to invalid IL or missing references)
//IL_01a1: Expected O, but got Unknown
//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
//IL_01ad: Expected O, but got Unknown
//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
//IL_01b2: Expected O, but got Unknown
//IL_01d4: Unknown result type (might be due to invalid IL or missing references)
//IL_01d9: Unknown result type (might be due to invalid IL or missing references)
//IL_01e0: Expected O, but got Unknown
//IL_01e0: Unknown result type (might be due to invalid IL or missing references)
//IL_01e8: Expected O, but got Unknown
//IL_01e8: Unknown result type (might be due to invalid IL or missing references)
//IL_01f4: Expected O, but got Unknown
//IL_01ef: Unknown result type (might be due to invalid IL or missing references)
//IL_01f9: Expected O, but got Unknown
//IL_021b: Unknown result type (might be due to invalid IL or missing references)
//IL_0220: Unknown result type (might be due to invalid IL or missing references)
//IL_0227: Expected O, but got Unknown
//IL_0227: Unknown result type (might be due to invalid IL or missing references)
//IL_022f: Expected O, but got Unknown
//IL_022f: Unknown result type (might be due to invalid IL or missing references)
//IL_023b: Expected O, but got Unknown
//IL_0236: Unknown result type (might be due to invalid IL or missing references)
//IL_0240: Expected O, but got Unknown
//IL_0262: Unknown result type (might be due to invalid IL or missing references)
//IL_0267: Unknown result type (might be due to invalid IL or missing references)
//IL_026e: Expected O, but got Unknown
//IL_026e: Unknown result type (might be due to invalid IL or missing references)
//IL_0276: Expected O, but got Unknown
//IL_0276: Unknown result type (might be due to invalid IL or missing references)
//IL_0282: Expected O, but got Unknown
//IL_027d: Unknown result type (might be due to invalid IL or missing references)
//IL_0287: Expected O, but got Unknown
//IL_02a9: Unknown result type (might be due to invalid IL or missing references)
//IL_02ae: Unknown result type (might be due to invalid IL or missing references)
//IL_02b5: Expected O, but got Unknown
//IL_02b5: Unknown result type (might be due to invalid IL or missing references)
//IL_02bd: Expected O, but got Unknown
//IL_02bd: Unknown result type (might be due to invalid IL or missing references)
//IL_02c9: Expected O, but got Unknown
//IL_02c4: Unknown result type (might be due to invalid IL or missing references)
//IL_02ce: Expected O, but got Unknown
//IL_02f0: Unknown result type (might be due to invalid IL or missing references)
//IL_02f5: Unknown result type (might be due to invalid IL or missing references)
//IL_02fc: Expected O, but got Unknown
//IL_02fc: Unknown result type (might be due to invalid IL or missing references)
//IL_0304: Expected O, but got Unknown
//IL_0304: Unknown result type (might be due to invalid IL or missing references)
//IL_0310: Expected O, but got Unknown
//IL_030b: Unknown result type (might be due to invalid IL or missing references)
//IL_0315: Expected O, but got Unknown
//IL_0337: Unknown result type (might be due to invalid IL or missing references)
//IL_033c: Unknown result type (might be due to invalid IL or missing references)
//IL_0343: Expected O, but got Unknown
//IL_0343: Unknown result type (might be due to invalid IL or missing references)
//IL_034b: Expected O, but got Unknown
//IL_034b: Unknown result type (might be due to invalid IL or missing references)
//IL_0357: Expected O, but got Unknown
//IL_0352: Unknown result type (might be due to invalid IL or missing references)
//IL_035c: Expected O, but got Unknown
//IL_037e: Unknown result type (might be due to invalid IL or missing references)
//IL_0383: Unknown result type (might be due to invalid IL or missing references)
//IL_038a: Expected O, but got Unknown
//IL_038a: Unknown result type (might be due to invalid IL or missing references)
//IL_0392: Expected O, but got Unknown
//IL_0392: Unknown result type (might be due to invalid IL or missing references)
//IL_039e: Expected O, but got Unknown
//IL_0399: Unknown result type (might be due to invalid IL or missing references)
//IL_03a3: Expected O, but got Unknown
//IL_03c5: Unknown result type (might be due to invalid IL or missing references)
//IL_03ca: Unknown result type (might be due to invalid IL or missing references)
//IL_03d1: Expected O, but got Unknown
//IL_03d1: Unknown result type (might be due to invalid IL or missing references)
//IL_03d9: Expected O, but got Unknown
//IL_03d9: Unknown result type (might be due to invalid IL or missing references)
//IL_03e5: Expected O, but got Unknown
//IL_03e0: Unknown result type (might be due to invalid IL or missing references)
//IL_03ea: Expected O, but got Unknown
//IL_040c: Unknown result type (might be due to invalid IL or missing references)
//IL_0411: Unknown result type (might be due to invalid IL or missing references)
//IL_0418: Expected O, but got Unknown
//IL_0418: Unknown result type (might be due to invalid IL or missing references)
//IL_0420: Expected O, but got Unknown
//IL_0420: Unknown result type (might be due to invalid IL or missing references)
//IL_042c: Expected O, but got Unknown
//IL_0427: Unknown result type (might be due to invalid IL or missing references)
//IL_0431: Expected O, but got Unknown
//IL_0453: Unknown result type (might be due to invalid IL or missing references)
//IL_0458: Unknown result type (might be due to invalid IL or missing references)
//IL_045f: Expected O, but got Unknown
//IL_045f: Unknown result type (might be due to invalid IL or missing references)
//IL_0467: Expected O, but got Unknown
//IL_0467: Unknown result type (might be due to invalid IL or missing references)
//IL_0473: Expected O, but got Unknown
//IL_046e: Unknown result type (might be due to invalid IL or missing references)
//IL_0478: Expected O, but got Unknown
//IL_049a: Unknown result type (might be due to invalid IL or missing references)
//IL_049f: Unknown result type (might be due to invalid IL or missing references)
//IL_04a6: Expected O, but got Unknown
//IL_04a6: Unknown result type (might be due to invalid IL or missing references)
//IL_04ae: Expected O, but got Unknown
//IL_04ae: Unknown result type (might be due to invalid IL or missing references)
//IL_04ba: Expected O, but got Unknown
//IL_04b5: Unknown result type (might be due to invalid IL or missing references)
//IL_04bf: Expected O, but got Unknown
//IL_04e1: Unknown result type (might be due to invalid IL or missing references)
//IL_04e6: Unknown result type (might be due to invalid IL or missing references)
//IL_04ed: Expected O, but got Unknown
//IL_04ed: Unknown result type (might be due to invalid IL or missing references)
//IL_04f5: Expected O, but got Unknown
//IL_04f5: Unknown result type (might be due to invalid IL or missing references)
//IL_0501: Expected O, but got Unknown
//IL_04fc: Unknown result type (might be due to invalid IL or missing references)
//IL_0506: Expected O, but got Unknown
//IL_0528: Unknown result type (might be due to invalid IL or missing references)
//IL_052d: Unknown result type (might be due to invalid IL or missing references)
//IL_0534: Expected O, but got Unknown
//IL_0534: Unknown result type (might be due to invalid IL or missing references)
//IL_053c: Expected O, but got Unknown
//IL_053c: Unknown result type (might be due to invalid IL or missing references)
//IL_0548: Expected O, but got Unknown
//IL_0543: Unknown result type (might be due to invalid IL or missing references)
//IL_054d: Expected O, but got Unknown
//IL_056f: Unknown result type (might be due to invalid IL or missing references)
//IL_0574: Unknown result type (might be due to invalid IL or missing references)
//IL_057b: Expected O, but got Unknown
//IL_057b: Unknown result type (might be due to invalid IL or missing references)
//IL_0583: Expected O, but got Unknown
//IL_0583: Unknown result type (might be due to invalid IL or missing references)
//IL_058f: Expected O, but got Unknown
//IL_058a: Unknown result type (might be due to invalid IL or missing references)
//IL_0594: Expected O, but got Unknown
cfg.SaveOnConfigSet = false;
enableInstableTruck = cfg.Bind<bool>("General", "Instable Truck", true, "Enable/Disable truck instabilities. *Requires Host");
LethalConfigManager.AddConfigItem((BaseConfigItem)new BoolCheckBoxConfigItem(enableInstableTruck, false));
instabilityResult = cfg.Bind<string>("General", "Instability result", "Explosion", "When an instability is triggered this setting determines the result. *Requires Host");
ConfigEntry<string> obj = instabilityResult;
TextDropDownOptions val = new TextDropDownOptions(Array.Empty<string>());
((BaseOptions)val).RequiresRestart = false;
val.Values = new string[2] { "Explosion", "Eject Driver" };
LethalConfigManager.AddConfigItem((BaseConfigItem)new TextDropDownConfigItem(obj, val));
percentageBasedOnDamage = cfg.Bind<bool>("Instability", "Probability based on car damage", false, "When enabled the probability will be determined by car damage instead of config setting. *Requires Host");
LethalConfigManager.AddConfigItem((BaseConfigItem)new BoolCheckBoxConfigItem(percentageBasedOnDamage, false));
randomInstabilityDelay = cfg.Bind<bool>("Instability", "Random trigger delay", false, "Instability triggering will be delayed by random amount");
LethalConfigManager.AddConfigItem((BaseConfigItem)new BoolCheckBoxConfigItem(randomInstabilityDelay, false));
instabilityDelay = cfg.Bind<int>("Instability", "Trigger delay", 1, "Instability triggering will be delayed by this amount");
ConfigEntry<int> obj2 = instabilityDelay;
IntSliderOptions val2 = new IntSliderOptions();
((BaseRangeOptions<int>)val2).Min = 0;
((BaseRangeOptions<int>)val2).Max = 5;
((BaseOptions)val2).RequiresRestart = false;
LethalConfigManager.AddConfigItem((BaseConfigItem)new IntSliderConfigItem(obj2, val2));
instabilityChanceAfterTime = cfg.Bind<bool>("Interval Instability", "Instability chance after time", false, "Instability triggering can happen at set interval");
LethalConfigManager.AddConfigItem((BaseConfigItem)new BoolCheckBoxConfigItem(instabilityChanceAfterTime, false));
instabilityChanceInterval = cfg.Bind<int>("Interval Instability", "Instability chance interval", 60, "Interval at which the truck could trigger an instability");
ConfigEntry<int> obj3 = instabilityChanceInterval;
IntSliderOptions val3 = new IntSliderOptions();
((BaseRangeOptions<int>)val3).Min = 30;
((BaseRangeOptions<int>)val3).Max = 300;
((BaseOptions)val3).RequiresRestart = false;
LethalConfigManager.AddConfigItem((BaseConfigItem)new IntSliderConfigItem(obj3, val3));
intervalInstability = cfg.Bind<int>("Interval Instability", "Interval instability", 0, "Interval trigger probability percentage. *Requires Host");
ConfigEntry<int> obj4 = intervalInstability;
IntSliderOptions val4 = new IntSliderOptions();
((BaseRangeOptions<int>)val4).Min = 0;
((BaseRangeOptions<int>)val4).Max = 100;
((BaseOptions)val4).RequiresRestart = false;
LethalConfigManager.AddConfigItem((BaseConfigItem)new IntSliderConfigItem(obj4, val4));
addEngineOilInstability = cfg.Bind<int>("Instability triggers", "Repair truck instability", 0, "Trigger probability percentage. *Requires Host");
ConfigEntry<int> obj5 = addEngineOilInstability;
IntSliderOptions val5 = new IntSliderOptions();
((BaseRangeOptions<int>)val5).Min = 0;
((BaseRangeOptions<int>)val5).Max = 100;
((BaseOptions)val5).RequiresRestart = false;
LethalConfigManager.AddConfigItem((BaseConfigItem)new IntSliderConfigItem(obj5, val5));
setRadioStationInstability = cfg.Bind<int>("Instability triggers", "Set radio station instability", 0, "Trigger probability percentage. *Requires Host");
ConfigEntry<int> obj6 = setRadioStationInstability;
IntSliderOptions val6 = new IntSliderOptions();
((BaseRangeOptions<int>)val6).Min = 0;
((BaseRangeOptions<int>)val6).Max = 100;
((BaseOptions)val6).RequiresRestart = false;
LethalConfigManager.AddConfigItem((BaseConfigItem)new IntSliderConfigItem(obj6, val6));
setRadioOnInstability = cfg.Bind<int>("Instability triggers", "Turn on radio instability", 0, "Trigger probability percentage. *Requires Host");
ConfigEntry<int> obj7 = setRadioOnInstability;
IntSliderOptions val7 = new IntSliderOptions();
((BaseRangeOptions<int>)val7).Min = 0;
((BaseRangeOptions<int>)val7).Max = 100;
((BaseOptions)val7).RequiresRestart = false;
LethalConfigManager.AddConfigItem((BaseConfigItem)new IntSliderConfigItem(obj7, val7));
magnetCarInstability = cfg.Bind<int>("Instability triggers", "Attach to ship instability", 0, "Trigger probability percentage. *Requires Host");
ConfigEntry<int> obj8 = magnetCarInstability;
IntSliderOptions val8 = new IntSliderOptions();
((BaseRangeOptions<int>)val8).Min = 0;
((BaseRangeOptions<int>)val8).Max = 100;
((BaseOptions)val8).RequiresRestart = false;
LethalConfigManager.AddConfigItem((BaseConfigItem)new IntSliderConfigItem(obj8, val8));
passengerLeaveVehicleInstability = cfg.Bind<int>("Instability triggers", "Passenger leave truck instability", 0, "Trigger probability percentage. *Requires Host");
ConfigEntry<int> obj9 = passengerLeaveVehicleInstability;
IntSliderOptions val9 = new IntSliderOptions();
((BaseRangeOptions<int>)val9).Min = 0;
((BaseRangeOptions<int>)val9).Max = 100;
((BaseOptions)val9).RequiresRestart = false;
LethalConfigManager.AddConfigItem((BaseConfigItem)new IntSliderConfigItem(obj9, val9));
pushTruckInstability = cfg.Bind<int>("Instability triggers", "Push truck instability", 0, "Trigger probability percentage. *Requires Host");
ConfigEntry<int> obj10 = pushTruckInstability;
IntSliderOptions val10 = new IntSliderOptions();
((BaseRangeOptions<int>)val10).Min = 0;
((BaseRangeOptions<int>)val10).Max = 100;
((BaseOptions)val10).RequiresRestart = false;
LethalConfigManager.AddConfigItem((BaseConfigItem)new IntSliderConfigItem(obj10, val10));
removeKeyFromIgnitionInstability = cfg.Bind<int>("Instability triggers", "Remove key instability", 0, "Trigger probability percentage. *Requires Host");
ConfigEntry<int> obj11 = removeKeyFromIgnitionInstability;
IntSliderOptions val11 = new IntSliderOptions();
((BaseRangeOptions<int>)val11).Min = 0;
((BaseRangeOptions<int>)val11).Max = 100;
((BaseOptions)val11).RequiresRestart = false;
LethalConfigManager.AddConfigItem((BaseConfigItem)new IntSliderConfigItem(obj11, val11));
setHonkInstability = cfg.Bind<int>("Instability triggers", "Honk instability", 0, "Trigger probability percentage. *Requires Host");
ConfigEntry<int> obj12 = setHonkInstability;
IntSliderOptions val12 = new IntSliderOptions();
((BaseRangeOptions<int>)val12).Min = 0;
((BaseRangeOptions<int>)val12).Max = 100;
((BaseOptions)val12).RequiresRestart = false;
LethalConfigManager.AddConfigItem((BaseConfigItem)new IntSliderConfigItem(obj12, val12));
setHoodOpenInstability = cfg.Bind<int>("Instability triggers", "Open hood instability", 0, "Trigger probability percentage. *Requires Host");
ConfigEntry<int> obj13 = setHoodOpenInstability;
IntSliderOptions val13 = new IntSliderOptions();
((BaseRangeOptions<int>)val13).Min = 0;
((BaseRangeOptions<int>)val13).Max = 100;
((BaseOptions)val13).RequiresRestart = false;
LethalConfigManager.AddConfigItem((BaseConfigItem)new IntSliderConfigItem(obj13, val13));
tryIgnitionInstability = cfg.Bind<int>("Instability triggers", "Ignition instability", 0, "Trigger probability percentage. *Requires Host");
ConfigEntry<int> obj14 = tryIgnitionInstability;
IntSliderOptions val14 = new IntSliderOptions();
((BaseRangeOptions<int>)val14).Min = 0;
((BaseRangeOptions<int>)val14).Max = 100;
((BaseOptions)val14).RequiresRestart = false;
LethalConfigManager.AddConfigItem((BaseConfigItem)new IntSliderConfigItem(obj14, val14));
toggleHeadlightsInstability = cfg.Bind<int>("Instability triggers", "Headlight instability", 0, "Trigger probability percentage. *Requires Host");
ConfigEntry<int> obj15 = toggleHeadlightsInstability;
IntSliderOptions val15 = new IntSliderOptions();
((BaseRangeOptions<int>)val15).Min = 0;
((BaseRangeOptions<int>)val15).Max = 100;
((BaseOptions)val15).RequiresRestart = false;
LethalConfigManager.AddConfigItem((BaseConfigItem)new IntSliderConfigItem(obj15, val15));
springDriverSeatInstability = cfg.Bind<int>("Instability triggers", "Escape seat instability", 0, "Trigger probability percentage. *Requires Host");
ConfigEntry<int> obj16 = springDriverSeatInstability;
IntSliderOptions val16 = new IntSliderOptions();
((BaseRangeOptions<int>)val16).Min = 0;
((BaseRangeOptions<int>)val16).Max = 100;
((BaseOptions)val16).RequiresRestart = false;
LethalConfigManager.AddConfigItem((BaseConfigItem)new IntSliderConfigItem(obj16, val16));
shiftToGearInstability = cfg.Bind<int>("Instability triggers", "Gear shifting instability", 0, "Trigger probability percentage. *Requires Host");
ConfigEntry<int> obj17 = shiftToGearInstability;
IntSliderOptions val17 = new IntSliderOptions();
((BaseRangeOptions<int>)val17).Min = 0;
((BaseRangeOptions<int>)val17).Max = 100;
((BaseOptions)val17).RequiresRestart = false;
LethalConfigManager.AddConfigItem((BaseConfigItem)new IntSliderConfigItem(obj17, val17));
cfg.Save();
cfg.SaveOnConfigSet = true;
}
}
}