Decompiled source of ChebsQuietDrakes v1.2.1

plugins/ChebsQuietDrakes.dll

Decompiled a year ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using Jotunn.Managers;
using Jotunn.Utils;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("ChebsQuietDrakes")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ChebsQuietDrakes")]
[assembly: AssemblyCopyright("Copyright ©  2021")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("e3243d22-4307-4008-ba36-9f326008cde5")]
[assembly: AssemblyFileVersion("1.2.1.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.2.1.0")]
[module: UnverifiableCode]
namespace ChebsQuietDrakes;

[BepInPlugin("com.chebgonaz.chebsquietdrakes", "ChebsQuietDrakes", "1.2.1")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
internal class ChebsQuietDrakes : BaseUnityPlugin
{
	public const string PluginGuid = "com.chebgonaz.chebsquietdrakes";

	public const string PluginName = "ChebsQuietDrakes";

	public const string PluginVersion = "1.2.1";

	private void Awake()
	{
		PrefabManager.OnVanillaPrefabsAvailable += DoOnVanillaPrefabsAvailable;
	}

	private void DoOnVanillaPrefabsAvailable()
	{
		PrefabManager.OnVanillaPrefabsAvailable -= DoOnVanillaPrefabsAvailable;
		GameObject prefab = PrefabManager.Instance.GetPrefab("Hatchling");
		if ((Object)(object)prefab == (Object)null)
		{
			((BaseUnityPlugin)this).Logger.LogError((object)"Failed to get drake prefab");
			return;
		}
		MonsterAI val = default(MonsterAI);
		if (!prefab.TryGetComponent<MonsterAI>(ref val))
		{
			((BaseUnityPlugin)this).Logger.LogError((object)"Failed to get drake prefab's MonsterAI component");
			return;
		}
		EffectData[] effectPrefabs = ((BaseAI)val).m_alertedEffects.m_effectPrefabs;
		for (int i = 0; i < effectPrefabs.Length; i++)
		{
			effectPrefabs[i].m_enabled = false;
		}
		effectPrefabs = ((BaseAI)val).m_idleSound.m_effectPrefabs;
		for (int i = 0; i < effectPrefabs.Length; i++)
		{
			effectPrefabs[i].m_enabled = false;
		}
	}
}