Decompiled source of PosterRandomizer v1.0.0

PosterRandomzier.dll

Decompiled 7 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using DunGen;
using HarmonyLib;
using LethalPosters;
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("PosterRandomzier")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("PosterRandomzier")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("78b9247e-547a-4517-a999-613fd4bec762")]
[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 PosterRandomizer;

[BepInPlugin("ironbean.PosterRandomizer", "Poster Randomizer", "1.0.0")]
public class PosterRandomizerMod : BaseUnityPlugin
{
	[HarmonyPatch(typeof(DungeonGenerator))]
	internal class DungeonPatch
	{
		[HarmonyPatch("Generate")]
		[HarmonyPostfix]
		public static void SetPosterSeed(ref int ___Seed)
		{
			mls.LogInfo((object)("Setting Poster seed to: " + ___Seed));
			Plugin.Rand = new Random(___Seed);
		}
	}

	private const string modGUID = "ironbean.PosterRandomizer";

	private const string modName = "Poster Randomizer";

	private const string modVersion = "1.0.0";

	private readonly Harmony harmony = new Harmony("ironbean.PosterRandomizer");

	private static PosterRandomizerMod Instance;

	internal static ManualLogSource mls;

	private void Awake()
	{
		if ((Object)(object)Instance == (Object)null)
		{
			Instance = this;
		}
		mls = Logger.CreateLogSource("ironbean.PosterRandomizer");
		mls.LogInfo((object)"Poster Randomizer loaded.");
		harmony.PatchAll(typeof(PosterRandomizerMod));
		harmony.PatchAll(typeof(DungeonPatch));
	}
}