using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using LethalLevelLoader;
using RandomInterior.Core;
using RandomInterior.Patches;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("RandomInterior")]
[assembly: AssemblyDescription("A mod for Lethal Company that randomizes the interior type")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Vulf")]
[assembly: AssemblyProduct("RandomInterior")]
[assembly: AssemblyCopyright("Copyright © 2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("605523d3-53fd-4326-85b2-f9d19aaac80a")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace RandomInterior.Patches
{
[HarmonyPatch]
internal class RoundManagementPatches
{
[HarmonyPatch(typeof(DungeonManager), "GetValidExtendedDungeonFlows")]
[HarmonyPostfix]
public static void OverwriteLevelRarities(ref List<ExtendedDungeonFlowWithRarity> __result)
{
Logger.LogInfo("Overwriting interior weights...");
foreach (ExtendedDungeonFlowWithRarity item in __result)
{
Logger.LogInfo($"\t{item.extendedDungeonFlow.DungeonName} (ID: {item.extendedDungeonFlow.DungeonID}): Rarity set to 100");
item.rarity = 100;
}
}
}
}
namespace RandomInterior.Core
{
internal static class Logger
{
public static void LogInfo(object message)
{
RandomInteriorBase.LogSource.LogInfo(message);
}
public static void LogWarning(object message)
{
RandomInteriorBase.LogSource.LogWarning(message);
}
public static void LogError(object message)
{
RandomInteriorBase.LogSource.LogError(message);
}
}
[BepInPlugin("Vulf.RandomInterior", "Random Interior", "1.0.0")]
public class RandomInteriorBase : BaseUnityPlugin
{
private static RandomInteriorBase _instance;
private readonly Harmony Harmony = new Harmony("Vulf.RandomInterior");
internal static RandomInteriorBase Instance
{
get
{
return _instance;
}
set
{
if ((Object)(object)_instance == (Object)null)
{
_instance = value;
}
else
{
Object.Destroy((Object)(object)value);
}
}
}
public static ManualLogSource LogSource => ((BaseUnityPlugin)Instance).Logger;
private void Awake()
{
Instance = this;
((BaseUnityPlugin)this).Logger.LogInfo((object)"Patching...");
Harmony.PatchAll(typeof(RoundManagementPatches));
}
}
internal static class PluginInfo
{
public const string GUID = "Vulf.RandomInterior";
public const string NAME = "Random Interior";
public const string VERSION = "1.0.0";
}
}