Decompiled source of DineFix v1.0.0

DineFix.dll

Decompiled 5 hours ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using HarmonyLib;
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("DineFix")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DineFix")]
[assembly: AssemblyCopyright("Copyright ©  2026")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("535116ed-9c18-4179-9c69-6f367c10fb28")]
[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 DineFix;

[BepInPlugin("com.mod.dinefix", "Dine Fix", "1.0.0")]
public class Plugin : BaseUnityPlugin
{
	public static ConfigEntry<int> MaxScrap;

	public static ConfigEntry<int> MinScrap;

	private void Awake()
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		new Harmony("com.mod.dinefix").PatchAll();
		MaxScrap = ((BaseUnityPlugin)this).Config.Bind<int>("Scrap", "Max Scrap", 38, "Максимальное количество скрапа");
		MinScrap = ((BaseUnityPlugin)this).Config.Bind<int>("Scrap", "Min Scrap", 28, "Умножает количество генерируемого лута на фабрике.");
	}
}
[HarmonyPatch(typeof(StartOfRound), "Awake")]
public class Patch
{
	private static void Postfix(StartOfRound __instance)
	{
		SelectableLevel val = null;
		SelectableLevel val2 = null;
		SelectableLevel[] levels = __instance.levels;
		foreach (SelectableLevel val3 in levels)
		{
			if (!((Object)(object)val3 == (Object)null))
			{
				if (val3.PlanetName.Contains("Dine"))
				{
					val = val3;
				}
				if (val3.PlanetName.Contains("Rend"))
				{
					val2 = val3;
				}
			}
		}
		if ((Object)(object)val != (Object)null && (Object)(object)val2 != (Object)null)
		{
			val.spawnableScrap.Clear();
			val.spawnableScrap.AddRange(val2.spawnableScrap);
			val.minScrap = Plugin.MinScrap.Value;
			val.maxScrap = Plugin.MaxScrap.Value;
		}
	}
}