Decompiled source of NoDarkFogSeeds v1.0.0

No_DF_Seeds.dll

Decompiled 4 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using CommonAPI;
using CommonAPI.Systems;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = ".NET Standard 2.0")]
[assembly: AssemblyCompany("No_DF_Seeds")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("My first plugin")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("No_DF_Seeds")]
[assembly: AssemblyTitle("No_DF_Seeds")]
[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 No_DF_Seeds
{
	[BepInPlugin("org.kepler68.plugins.DSP.noDFSeeds", "No Dark Fog Seeds", "1.0.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[CommonAPISubmoduleDependency(new string[] { "ProtoRegistry" })]
	public class No_DF_Seeds : BaseUnityPlugin
	{
		private ConfigEntry<bool> configUseTech;

		public const string MODID = "noDFSeeds";

		public const string GUID = "org.kepler68.plugins.DSP.noDFSeeds";

		public const string NAME = "No Dark Fog Seeds";

		public bool useDFSeedTech = true;

		private void Awake()
		{
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Thank you for using my mod!");
			int num = 4190;
			configUseTech = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "useTechToStopSeeds", true, "Enables a tech to disable dark fog seeds, rather than always preventing them.");
			useDFSeedTech = configUseTech.Value;
			if (!useDFSeedTech)
			{
				Harmony.CreateAndPatchAll(typeof(No_Tech), (string)null);
				return;
			}
			using (ProtoRegistry.StartModLoad("org.kepler68.plugins.DSP.noDFSeeds"))
			{
				TechProto val = ProtoRegistry.RegisterTech(num, "Seed Navigation Scrambling", "By reverse engineering the dark fox matrixes, we are able to learn how Seeds navigate and prevent them from finding new stars!", "NoSeedsConc", "pic", new int[1] { 4104 }, new int[2] { 6006, 5201 }, new int[2] { 100, 100 }, 18000L, new int[0], new Vector2(25f, 37f));
				val.IsLabTech = false;
			}
		}
	}
	public class No_Tech
	{
		[HarmonyPrefix]
		[HarmonyPatch(typeof(DFTinderComponent), "PrepareDispatchLogic")]
		private static bool Prefix()
		{
			return false;
		}
	}
	public class Using_Tech
	{
		[HarmonyPrefix]
		[HarmonyPatch(typeof(DFTinderComponent), "PrepareDispatchLogic")]
		private static bool Prefix()
		{
			if (!GameMain.history.TechUnlocked(4190))
			{
				return true;
			}
			return false;
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "No_DF_Seeds";

		public const string PLUGIN_NAME = "No_DF_Seeds";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}