Decompiled source of Eatable BingBong v0.1.1

com.atomic.eatablebingbong.dll

Decompiled 3 weeks ago
using System;
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 HarmonyLib;
using Microsoft.CodeAnalysis;
using Peak.Afflictions;
using Zorro.Core;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("com.atomic.eatablebingbong")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("0.1.1.0")]
[assembly: AssemblyInformationalVersion("0.1.1")]
[assembly: AssemblyProduct("com.atomic.eatablebingbong")]
[assembly: AssemblyTitle("Eatable_BingBong")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.1.1.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.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;
		}
	}
}
namespace BepInEx
{
	[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
	[Conditional("CodeGeneration")]
	internal sealed class BepInAutoPluginAttribute : Attribute
	{
		public BepInAutoPluginAttribute(string? id = null, string? name = null, string? version = null)
		{
		}
	}
}
namespace BepInEx.Preloader.Core.Patching
{
	[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
	[Conditional("CodeGeneration")]
	internal sealed class PatcherAutoPluginAttribute : Attribute
	{
		public PatcherAutoPluginAttribute(string? id = null, string? name = null, string? version = null)
		{
		}
	}
}
namespace Eatable_BingBong
{
	[BepInPlugin("com.atomic.eatablebingbong", "Eatable_BingBong", "0.1.1")]
	public class Plugin : BaseUnityPlugin
	{
		private static Harmony harmony;

		public const string Id = "com.atomic.eatablebingbong";

		internal static ManualLogSource Log { get; private set; }

		public static string Name => "Eatable_BingBong";

		public static string Version => "0.1.1";

		private void Awake()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Expected O, but got Unknown
			Log = ((BaseUnityPlugin)this).Logger;
			harmony = new Harmony("com.atomic.eatablebingbong");
			harmony.PatchAll();
			Log.LogInfo((object)("Plugin " + Name + " is loaded!"));
		}
	}
	[HarmonyPatch]
	public static class PatchesBingBong
	{
		[HarmonyPostfix]
		[HarmonyPatch(typeof(Item), "Awake")]
		public static void GetBingBong(Item __instance)
		{
			Item __instance2 = __instance;
			if (__instance2.itemID == 13)
			{
				__instance2.UIData.hasSecondInteract = true;
				__instance2.UIData.secondaryInteractPrompt = "eat";
				__instance2._useFeedback.useAnimation = "Eat";
				Item obj = __instance2;
				obj.OnSecondaryStarted = (Action)Delegate.Combine(obj.OnSecondaryStarted, (Action)delegate
				{
					__instance2._useFeedback.useAnimation = "Eat";
					__instance2.usingTimePrimary = 2f;
				});
				Item obj2 = __instance2;
				obj2.OnPrimaryStarted = (Action)Delegate.Combine(obj2.OnPrimaryStarted, (Action)delegate
				{
					__instance2._useFeedback.useAnimation = "";
					__instance2.usingTimePrimary = 0.25f;
				});
				Item obj3 = __instance2;
				obj3.OnSecondaryFinishedCast = (Action)Delegate.Combine(obj3.OnSecondaryFinishedCast, (Action)delegate
				{
					//IL_002b: Unknown result type (might be due to invalid IL or missing references)
					//IL_0030: Unknown result type (might be due to invalid IL or missing references)
					//IL_0041: Unknown result type (might be due to invalid IL or missing references)
					//IL_005c: Unknown result type (might be due to invalid IL or missing references)
					//IL_0086: Unknown result type (might be due to invalid IL or missing references)
					//IL_008b: Unknown result type (might be due to invalid IL or missing references)
					//IL_0097: Unknown result type (might be due to invalid IL or missing references)
					//IL_00a3: Expected O, but got Unknown
					//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
					//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
					//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
					//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
					//IL_00d6: Expected O, but got Unknown
					//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
					//IL_00db: Unknown result type (might be due to invalid IL or missing references)
					//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
					//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
					//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
					//IL_010a: Expected O, but got Unknown
					//IL_010a: Unknown result type (might be due to invalid IL or missing references)
					//IL_010f: Unknown result type (might be due to invalid IL or missing references)
					//IL_011b: Unknown result type (might be due to invalid IL or missing references)
					//IL_0124: Expected O, but got Unknown
					GlobalEvents.TriggerItemConsumed(__instance2, __instance2.holderCharacter);
					Optionable<byte> currentSelectedSlot = __instance2.holderCharacter.refs.items.currentSelectedSlot;
					__instance2.holderCharacter.player.EmptySlot(currentSelectedSlot);
					__instance2.holderCharacter.refs.items.EquipSlot(currentSelectedSlot);
					__instance2.holderCharacter.refs.afflictions.AddStatus((STATUSTYPE)5, 0.1f, false, true, true);
					Action_RestoreHunger val = new Action_RestoreHunger
					{
						item = __instance2,
						restorationAmount = 1f
					};
					((ItemActionBase)val).RunAction();
					Affliction_AdjustDrowsyOverTime drowsyAffliction = new Affliction_AdjustDrowsyOverTime
					{
						character = __instance2.holderCharacter,
						statusPerSecond = 0.1f,
						totalTime = 10f
					};
					Affliction_InfiniteStamina affliction = new Affliction_InfiniteStamina
					{
						character = __instance2.holderCharacter,
						drowsyAffliction = (Affliction)(object)drowsyAffliction,
						climbDelay = 3f,
						totalTime = 15f
					};
					Action_ApplyAffliction val2 = new Action_ApplyAffliction
					{
						item = __instance2,
						affliction = (Affliction)(object)affliction
					};
					((ItemActionBase)val2).RunAction();
				});
			}
		}
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		public IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}