Decompiled source of RedFerrymanSpawnable v1.0.0

plugins/RedFerryman/redferrymanmod.dll

Decompiled 3 days ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
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: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: AssemblyCompany("redferrymanmod")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("A non-boss version of the Red Ferryman from MEGACHEB's custom level: Destructive Rhapsody. Ready to be spawned in with the Spawner Arm.")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("redferrymanmod")]
[assembly: AssemblyTitle("redferrymanmod")]
[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 redferrymanmod
{
	[HarmonyPatch]
	[BepInPlugin("megacheb.ultrakill.redferryman", "redferrymanmod", "1.0.0")]
	public class Plugin : BaseUnityPlugin
	{
		private const string V = "redferrymanmod";

		public static Harmony Harmony = new Harmony("megacheb.ultrakill.redferryman");

		public static bool DoneSpawnMenu = false;

		public static AssetBundle Assets;

		public static SpawnableObject RedFerrymanSpawnable;

		public static GameObject RedFerrymanAssets;

		public void Start()
		{
			Assets = AssetBundle.LoadFromFile(Path.Combine(ModPath(), "redferryman.bundle"));
			RedFerrymanSpawnable = Assets.LoadAsset<SpawnableObject>("Ferryman (Red Variant).asset");
			Harmony.PatchAll();
			Debug.Log((object)"If you're reading this you're awesome. have a great day! \ud83d\ude0e");
		}

		[HarmonyPatch(typeof(SpawnMenu), "Awake")]
		[HarmonyPrefix]
		public static void AddRedFerrymanToArm(SpawnMenu __instance)
		{
			if (!DoneSpawnMenu)
			{
				__instance.objects.enemies = __instance.objects.enemies.Concat((IEnumerable<SpawnableObject>)(object)new SpawnableObject[1] { RedFerrymanSpawnable }).ToArray();
				DoneSpawnMenu = true;
			}
		}

		public static string ModPath()
		{
			return Assembly.GetExecutingAssembly().Location.Substring(0, Assembly.GetExecutingAssembly().Location.LastIndexOf(Path.DirectorySeparatorChar));
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "redferrymanmod";

		public const string PLUGIN_NAME = "redferrymanmod";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		internal IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}