Decompiled source of EmeraudeRepos v1.0.0

plugins/EmeraudeRepos.dll

Decompiled a week ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using HarmonyLib;
using Microsoft.CodeAnalysis;

[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("EmeraudeRepos")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("EmeraudeRepos")]
[assembly: AssemblyTitle("EmeraudeRepos")]
[assembly: AssemblyVersion("1.0.0.0")]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[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 EmeraudeRepos
{
	[BepInPlugin("emeraude.repos", "Emeraude Repos", "1.0.0")]
	public class Plugin : BaseUnityPlugin
	{
		public const string Guid = "emeraude.repos";

		public const string Name = "Emeraude Repos";

		public const string Version = "1.0.0";

		internal static ConfigEntry<float> DurationMultiplier;

		private void Awake()
		{
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Expected O, but got Unknown
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			DurationMultiplier = ((BaseUnityPlugin)this).Config.Bind<float>("Rested", "DurationMultiplier", 1.5f, new ConfigDescription("Multiplies the duration of the Rested buff (base time and time per comfort level).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 10f), Array.Empty<object>()));
			new Harmony("emeraude.repos").PatchAll(typeof(Plugin).Assembly);
			((BaseUnityPlugin)this).Logger.LogInfo((object)string.Format("{0} {1} loaded (Rested x{2})", "Emeraude Repos", "1.0.0", DurationMultiplier.Value));
		}
	}
	[HarmonyPatch(typeof(SE_Rested), "Setup")]
	internal static class RestedSetupPatch
	{
		private static void Prefix(SE_Rested __instance)
		{
			__instance.m_baseTTL *= Plugin.DurationMultiplier.Value;
			__instance.m_TTLPerComfortLevel *= Plugin.DurationMultiplier.Value;
		}
	}
}