Decompiled source of StockBracken v1.0.1

StockBracken.dll

Decompiled 9 months ago
using System;
using System.CodeDom.Compiler;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Reflection;
using System.Resources;
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.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("StockBracken")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Stock Photo Bracken")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("StockBracken")]
[assembly: AssemblyTitle("StockBracken")]
[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 StockBracken
{
	[BepInPlugin("StockBracken", "StockBracken", "1.0.0")]
	public class Plugin : BaseUnityPlugin
	{
		public static AssetBundle LoadedBundle;

		public Harmony harmonymain;

		private void Awake()
		{
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Expected O, but got Unknown
			string text = "StockBracken.Bundle.stock";
			Assembly executingAssembly = Assembly.GetExecutingAssembly();
			using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(text);
			if (stream == null)
			{
				((BaseUnityPlugin)this).Logger.LogError((object)("Failed to load BrackenRandomizer AssetBundle! (Embedded file '" + text + "' not found)"));
				return;
			}
			AssetBundle val = AssetBundle.LoadFromStream(stream);
			if ((Object)(object)val == (Object)null)
			{
				((BaseUnityPlugin)this).Logger.LogError((object)("Failed to load BrackenRandomizer AssetBundle! (Failed to load AssetBundle from embedded file '" + text + "')"));
				return;
			}
			harmonymain = new Harmony("StockBracken");
			harmonymain.PatchAll();
			LoadedBundle = val;
			((BaseUnityPlugin)this).Logger.LogInfo((object)"StockBracken loaded.");
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "StockBracken";

		public const string PLUGIN_NAME = "StockBracken";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}
namespace StockBracken.Properties
{
	[GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
	[DebuggerNonUserCode]
	[CompilerGenerated]
	internal class Resources
	{
		private static ResourceManager resourceMan;

		private static CultureInfo resourceCulture;

		[EditorBrowsable(EditorBrowsableState.Advanced)]
		internal static ResourceManager ResourceManager
		{
			get
			{
				if (resourceMan == null)
				{
					ResourceManager resourceManager = new ResourceManager("StockBracken.Properties.Resources", typeof(Resources).Assembly);
					resourceMan = resourceManager;
				}
				return resourceMan;
			}
		}

		[EditorBrowsable(EditorBrowsableState.Advanced)]
		internal static CultureInfo Culture
		{
			get
			{
				return resourceCulture;
			}
			set
			{
				resourceCulture = value;
			}
		}

		internal Resources()
		{
		}
	}
}
namespace StockBracken.Patches
{
	[HarmonyPatch]
	internal class EnemyTypes
	{
		[HarmonyPatch(typeof(FlowermanAI), "Start")]
		[HarmonyPostfix]
		public static void SummonGok(FlowermanAI __instance)
		{
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			PlayAudioAnimationEvent component = ((Component)((Component)__instance).gameObject.transform.Find("FlowermanModel").Find("AnimContainer")).GetComponent<PlayAudioAnimationEvent>();
			Object.Destroy((Object)(object)((Component)((Component)__instance).gameObject.transform.Find("FlowermanModel").Find("LOD1")).gameObject.GetComponent<SkinnedMeshRenderer>());
			__instance.creatureAngerVoice.clip = Plugin.LoadedBundle.LoadAsset<AudioClip>("Assets/sneaky.mp3");
			__instance.crackNeckSFX = Plugin.LoadedBundle.LoadAsset<AudioClip>("Assets/gotCha.mp3");
			__instance.crackNeckAudio.clip = Plugin.LoadedBundle.LoadAsset<AudioClip>("Assets/gotCha.mp3");
			GameObject val = Object.Instantiate<GameObject>(Plugin.LoadedBundle.LoadAsset<GameObject>("assets/Gok.prefab"), ((Component)__instance).gameObject.transform);
			val.transform.localPosition = new Vector3(0f, 1.5f, 0f);
		}
	}
}