using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using HarmonyLib;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("AutoFlyToCompany")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("AutoFlyToCompany")]
[assembly: AssemblyCopyright("Copyright © 2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("5afcb5f4-a42a-468b-8522-6d594f3117d9")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace AutoFlyToCompany;
[BepInPlugin("Blink.AutoFlyToCompany", "AutoFlyToCompany", "1.0.1")]
public class AutoFlyToCompanyBase : BaseUnityPlugin
{
private const string modGUID = "Blink.AutoFlyToCompany";
private const string modName = "AutoFlyToCompany";
private const string modVersion = "1.0.1";
private readonly Harmony harmony = new Harmony("Blink.AutoFlyToCompany");
private void Awake()
{
harmony.PatchAll();
Debug.Log((object)"loaded auto fly to ship mod");
}
}
[HarmonyPatch(typeof(StartMatchLever))]
internal class StartMatchLeverPatch
{
[HarmonyPatch("Update")]
[HarmonyPrefix]
private static void autoFlyToCompany(ref StartMatchLever __instance)
{
bool flag = TimeOfDay.Instance.daysUntilDeadline == 0;
int num = 3;
if (__instance.playersManager.currentLevel.levelID != 3 && flag && __instance.playersManager.CanChangeLevels())
{
__instance.playersManager.ChangeLevel(num);
__instance.StartGame();
}
}
}