using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using WeatherRegistry;
using WeatherRegistry.Definitions;
using WeatherRegistry.Modules;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: IgnoresAccessChecksTo("MrovLib")]
[assembly: IgnoresAccessChecksTo("WeatherRegistry")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("OOPSAllEclipsed")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("A template for Lethal Company")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+4e9cca4633358fe963afd861e0499db48bc2281e")]
[assembly: AssemblyProduct("OOPSAllEclipsed")]
[assembly: AssemblyTitle("OOPSAllEclipsed")]
[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 OOPSAllEclipsed
{
internal class AllTheSameAlgorithm : WeatherSelectionAlgorithm
{
public override Dictionary<SelectableLevel, LevelWeatherType> SelectWeathers(int connectedPlayersOnServer, StartOfRound startOfRound)
{
//IL_004f: Unknown result type (might be due to invalid IL or missing references)
//IL_0054: Unknown result type (might be due to invalid IL or missing references)
//IL_0059: Unknown result type (might be due to invalid IL or missing references)
//IL_005e: Unknown result type (might be due to invalid IL or missing references)
//IL_0069: Unknown result type (might be due to invalid IL or missing references)
//IL_0063: Unknown result type (might be due to invalid IL or missing references)
Dictionary<SelectableLevel, LevelWeatherType> dictionary = new Dictionary<SelectableLevel, LevelWeatherType>();
List<SelectableLevel> list = startOfRound.levels.ToList();
foreach (SelectableLevel item in list)
{
Dictionary<SelectableLevel, LevelWeatherType> dictionary2 = dictionary;
SelectableLevel key = item;
dictionary2.Add(key, (LevelWeatherType)(ConfigManager.WeatherAlgorithm.Value switch
{
WeatherToApply.Rainy => 1,
WeatherToApply.Flooded => 4,
WeatherToApply.Stormy => 2,
WeatherToApply.Eclipsed => 5,
_ => -1,
}));
}
return dictionary;
}
}
internal class ConfigManager
{
internal static ConfigFile configFile;
internal static ConfigManager Instance { get; private set; }
internal static ConfigEntry<WeatherToApply> WeatherAlgorithm { get; private set; }
internal static void Init(ConfigFile config)
{
Instance = new ConfigManager(config);
}
private ConfigManager(ConfigFile config)
{
configFile = config;
WeatherAlgorithm = configFile.Bind<WeatherToApply>("Weather Selection", "Weather Selection", WeatherToApply.Eclipsed, "Select the weather to use during weather selection.");
}
}
[BepInPlugin("mrov.OOPSAllEclipsed", "OOPSAllEclipsed", "1.0.0")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class Plugin : BaseUnityPlugin
{
internal static ManualLogSource logger;
internal static Harmony harmony = new Harmony("mrov.OOPSAllEclipsed");
private void Awake()
{
logger = ((BaseUnityPlugin)this).Logger;
harmony.PatchAll();
ConfigManager.Init(((BaseUnityPlugin)this).Config);
WeatherCalculation.WeatherSelectionAlgorithm = (WeatherSelectionAlgorithm)(object)new AllTheSameAlgorithm();
ConfigManager.FirstDayClear.Value = false;
((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin mrov.OOPSAllEclipsed is loaded!");
}
}
public enum WeatherToApply
{
Rainy,
Flooded,
Stormy,
Eclipsed
}
public static class MyPluginInfo
{
public const string PLUGIN_GUID = "mrov.OOPSAllEclipsed";
public const string PLUGIN_NAME = "OOPSAllEclipsed";
public const string PLUGIN_VERSION = "1.0.0";
}
}
namespace System.Runtime.CompilerServices
{
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
internal sealed class IgnoresAccessChecksToAttribute : Attribute
{
public IgnoresAccessChecksToAttribute(string assemblyName)
{
}
}
}