Decompiled source of Lategame Upgrades Clay Glasses Smile Addon v1.0.0

BepInEx/plugins/ClayGlassesSmileAddon/ClayGlassesSmileAddon.dll

Decompiled 3 weeks ago
using System;
using System.Collections.Generic;
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.Logging;
using ClayGlassesSmileAddon.NetcodePatcher;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using MoreShipUpgrades.Misc.Util;
using MoreShipUpgrades.UpgradeComponents.TierUpgrades.Enemies;
using UnityEngine;
using WesleysInteriorTools.EnemyAiChanges;

[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.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: NetcodePatchedAssembly]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[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 ClayGlassesSmileAddon
{
	[BepInPlugin("com.whitespike.github.ClayGlassesSmileAddon", "Clay Glasses Smile Addon", "1.0.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	internal class ClayGlassesSmileAddon : BaseUnityPlugin
	{
		private readonly Harmony harmony = new Harmony("com.whitespike.github.ClayGlassesSmileAddon");

		internal ManualLogSource logger;

		internal static ClayGlassesSmileAddon Instance { get; set; }

		private void Awake()
		{
			logger = ((BaseUnityPlugin)this).Logger;
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			harmony.PatchAll();
			logger.LogInfo((object)"Plugin Clay Glasses Smile Addon 1.0.0 is loaded!");
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "ClayGlassesSmileAddon";

		public const string PLUGIN_NAME = "ProteinPowderJLLAddon";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}
namespace ClayGlassesSmileAddon.Utils
{
	public class PluginMetadata
	{
		public const string PLUGIN_GUID = "com.whitespike.github.ClayGlassesSmileAddon";

		public const string PLUGIN_NAME = "Clay Glasses Smile Addon";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}
namespace ClayGlassesSmileAddon.Patches
{
	[HarmonyPatch(typeof(DiscmanVariant))]
	internal static class DiscmanVariantPatcher
	{
		[HarmonyPatch("SetCurrentVisibility")]
		[HarmonyTranspiler]
		private static IEnumerable<CodeInstruction> SetCurrentVisibilityTranspiler(IEnumerable<CodeInstruction> instructions)
		{
			List<CodeInstruction> result = new List<CodeInstruction>(instructions);
			int num = 0;
			FieldInfo field = typeof(DiscmanVariant).GetField("MinVanishDistance", BindingFlags.Instance | BindingFlags.Public);
			MethodInfo method = typeof(ClayGlasses).GetMethod("GetAdditionalMaximumDistance", BindingFlags.Static | BindingFlags.Public);
			Tools.FindField(ref num, ref result, field, method, false, false, false, false, false, false, "Could not find first instance of MinVanishDistance");
			Tools.FindField(ref num, ref result, field, method, false, false, false, false, false, false, "Could not find second instance of MinVanishDistance");
			return result;
		}
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		public IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}
namespace __GEN
{
	internal class NetworkVariableSerializationHelper
	{
		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeSerialization()
		{
		}
	}
}
namespace ClayGlassesSmileAddon.NetcodePatcher
{
	[AttributeUsage(AttributeTargets.Module)]
	internal class NetcodePatchedAssemblyAttribute : Attribute
	{
	}
}