Decompiled source of Vanilla Plus Addition v1.0.3

BepinEx/plugins/VanillaPlusAddition.dll

Decompiled a year ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using CompanyBuildingInfiniteStamina;
using GameNetcodeStuff;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using SkipGameInitialization;
using UnityEngine;
using UnityEngine.SceneManagement;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("VanillaPlusAddition")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("Senjay's Vanilla Plus Addition")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("VanillaPlusAddition")]
[assembly: AssemblyTitle("VanillaPlusAddition")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace SenjayVanillaPlusAdiition
{
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "VanillaPlusAddition";

		public const string PLUGIN_NAME = "VanillaPlusAddition";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}
namespace SenjayVPA
{
	[BepInPlugin("Senjay.VanillaPlusAddition", "Senjay's Vanilla Plus Addition", "1.0.3")]
	public class SenjayVanillaPlusAdditionClass : BaseUnityPlugin
	{
		private const string Author = "Senjay";

		private const string Name = "Senjay's Vanilla Plus Addition";

		private const string Version = "1.0.3";

		private const string GUID = "Senjay.VanillaPlusAddition";

		private readonly Harmony harmony = new Harmony("Senjay.VanillaPlusAddition");

		private static SenjayVanillaPlusAdditionClass Instance;

		internal ManualLogSource mls;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			harmony.PatchAll(typeof(SenjayVanillaPlusAdditionClass));
			harmony.PatchAll(typeof(SkipGameInitializationClass));
			harmony.PatchAll(typeof(InfiniteStaminaOnCompanyBuildingClass));
			mls = Logger.CreateLogSource("Senjay.VanillaPlusAddition");
			mls.LogInfo((object)"Senjay's Vanilla Plus Addition has been loaded into the game");
		}
	}
}
namespace SkipGameInitialization
{
	internal class SkipGameInitializationClass
	{
		[HarmonyPatch(typeof(PreInitSceneScript), "Awake")]
		[HarmonyPrefix]
		private static void SkipInitSelection(ref bool ___choseLaunchOption)
		{
			___choseLaunchOption = true;
			SceneManager.LoadScene("InitScene");
		}

		[HarmonyPatch(typeof(InitializeGame), "Awake")]
		[HarmonyPostfix]
		private static void SkipIntroAnimation(ref bool ___runBootUpScreen)
		{
			___runBootUpScreen = false;
		}
	}
}
namespace CompanyBuildingInfiniteStamina
{
	[HarmonyPatch(typeof(PlayerControllerB), "Update")]
	internal class InfiniteStaminaOnCompanyBuildingClass
	{
		[HarmonyPostfix]
		private static void InfiniteStaminaOnCompanyBuilding(ref float ___sprintMeter)
		{
			StartOfRound instance = StartOfRound.Instance;
			if (instance != null && instance.currentLevel.levelID == 3)
			{
				___sprintMeter = 1f;
			}
		}
	}
}