Decompiled source of Wolfs Eat Bear Meat v1.0.0

plugins\A2.WolfsEatBearMeat.dll

Decompiled 2 days ago
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security.Permissions;
using BepInEx;
using HarmonyLib;
using Jotunn.Utils;
using Microsoft.CodeAnalysis;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("Wolfs Eat Bear Meat")]
[assembly: AssemblyDescription("A mod that allows wolves to consume bear meat.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Wolfs Eat Bear Meat")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("907f97dd-ab52-db58-fe97-d73d3d1e1d50")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[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.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[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;
		}
	}
}
internal static class PluginInfo
{
	public const string PluginGUID = "A2.WolfsEatBearMeat";

	public const string PluginName = "Wolfs Eat Bear Meat";

	public const string PluginDescription = "A mod that allows wolves to consume bear meat.";

	public const string PluginSemanticVersion = "1.0.0";

	public const string PluginFullVersion = "1.0.0.0";
}
namespace System.Runtime.CompilerServices
{
	[EditorBrowsable(EditorBrowsableState.Never)]
	internal static class IsExternalInit
	{
	}
}
namespace A2.WolfsEatBearMeat
{
	[BepInPlugin("A2.WolfsEatBearMeat", "Wolfs Eat Bear Meat", "1.0.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
	internal class Plugin : BaseUnityPlugin
	{
		private static readonly Harmony _harmony = new Harmony("A2.WolfsEatBearMeat");

		private static bool _isPatched = false;

		public void Awake()
		{
			_isPatched = true;
			_harmony.PatchAll();
		}

		public void OnDestroy()
		{
			if (_isPatched)
			{
				_harmony.UnpatchSelf();
			}
		}
	}
}
namespace A2.WolfsEatBearMeat.Patches
{
	public static class MonsterAIPatch
	{
		[HarmonyPatch(typeof(MonsterAI), "CanConsume")]
		public static class CanConsume
		{
			public static void Postfix(ref bool __result, MonsterAI __instance, ItemData item)
			{
				if (!__result && ((BaseAI)(__instance?)).m_character?.m_name == "$enemy_wolf" && item?.m_shared?.m_name == "$item_bjorn_meat")
				{
					__result = true;
				}
			}
		}
	}
}