Decompiled source of Kebabs for the company v1.0.0

PluginMod.dll

Decompiled 2 months ago
using System;
using System.Collections;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using LethalLib.Modules;
using Microsoft.CodeAnalysis;
using PluginMod.Behaviours;
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 = "")]
[assembly: AssemblyCompany("PluginMod")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("PluginMod")]
[assembly: AssemblyTitle("PluginMod")]
[assembly: AssemblyVersion("1.0.0.0")]
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;
		}
	}
}
namespace PluginMod
{
	[BepInPlugin("kebabsforcomp.kebabMod", "Kebabs for company", "1.0")]
	public class PluginMod : BaseUnityPlugin
	{
		private const string GUID = "kebabsforcomp.kebabMod";

		private const string NAME = "Kebabs for company";

		private const string VERSION = "1.0";

		public static PluginMod instance;

		private Kebab_Behaviour Kebab_Script;

		public AssetBundle bundle;

		public AudioClip KebabEat;

		public Item Kebab;

		private void Awake()
		{
			instance = this;
			string text = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "kebabmod");
			bundle = AssetBundle.LoadFromFile(text);
			Item val = bundle.LoadAsset<Item>("Assets/Kebab_LAVASH/KebabLavash.asset");
			Kebab_Script = val.spawnPrefab.AddComponent<Kebab_Behaviour>();
			((GrabbableObject)Kebab_Script).grabbable = true;
			((GrabbableObject)Kebab_Script).grabbableToEnemies = true;
			((GrabbableObject)Kebab_Script).itemProperties = val;
			KebabEat = bundle.LoadAsset<AudioClip>("Assets/Kebab_LAVASH/EatSFX.mp3");
			NetworkPrefabs.RegisterNetworkPrefab(val.spawnPrefab);
			Utilities.FixMixerGroups(val.spawnPrefab);
			Items.RegisterScrap(val, 20, (LevelTypes)(-1));
			TerminalNode val2 = ScriptableObject.CreateInstance<TerminalNode>();
			val2.clearPreviousText = true;
			val2.displayText = "Great snack for the average worker!";
			Items.RegisterShopItem(val, (TerminalNode)null, (TerminalNode)null, val2, 25);
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Meals preped!");
		}
	}
}
namespace PluginMod.Behaviours
{
	internal class Kebab_Behaviour : PhysicsProp
	{
		private PluginMod PluginMod = global::PluginMod.PluginMod.instance;

		public override void ItemActivate(bool used, bool buttonDown = true)
		{
			((GrabbableObject)this).ItemActivate(used, buttonDown);
			if (((GrabbableObject)this).playerHeldBy.health != 100)
			{
				if (((GrabbableObject)this).playerHeldBy.health <= 80)
				{
					((GrabbableObject)this).playerHeldBy.health = ((GrabbableObject)this).playerHeldBy.health + 20;
				}
				else
				{
					((GrabbableObject)this).playerHeldBy.health = ((GrabbableObject)this).playerHeldBy.health + (100 - ((GrabbableObject)this).playerHeldBy.health);
				}
				((GrabbableObject)this).playerHeldBy.sprintMeter = ((GrabbableObject)this).playerHeldBy.sprintMeter + 50f;
				((GrabbableObject)this).playerHeldBy.itemAudio.PlayOneShot(PluginMod.KebabEat);
				((MonoBehaviour)this).StartCoroutine(KEBABTIMER());
			}
			else
			{
				((GrabbableObject)this).playerHeldBy.sprintMeter = ((GrabbableObject)this).playerHeldBy.sprintMeter + 50f;
				((GrabbableObject)this).playerHeldBy.itemAudio.PlayOneShot(PluginMod.KebabEat);
				((MonoBehaviour)this).StartCoroutine(KEBABTIMER());
			}
		}

		private IEnumerator KEBABTIMER()
		{
			((GrabbableObject)this).itemProperties.twoHanded = true;
			((GrabbableObject)this).itemProperties.positionOffset = new Vector3(0.1f, -0.14f, -0.25f);
			((GrabbableObject)this).itemProperties.rotationOffset = new Vector3(45f, 150f, 195f);
			yield return (object)new WaitForSeconds(3f);
			((GrabbableObject)this).playerHeldBy.DespawnHeldObject();
			((GrabbableObject)this).itemProperties.rotationOffset = new Vector3(0f, 90f, 195f);
			((GrabbableObject)this).itemProperties.positionOffset = new Vector3(0.1f, 0.07f, -0.05f);
			((GrabbableObject)this).itemProperties.twoHanded = false;
		}
	}
}