Decompiled source of ChefBazaar v1.4.1

ChefBazaar.dll

Decompiled 2 days ago
using System;
using System.Collections.Generic;
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.Configuration;
using BepInEx.Logging;
using Microsoft.CodeAnalysis;
using On.RoR2;
using R2API;
using R2API.Networking;
using R2API.Networking.Interfaces;
using RiskOfOptions;
using RiskOfOptions.OptionConfigs;
using RiskOfOptions.Options;
using RoR2;
using RoR2.ExpansionManagement;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Events;
using UnityEngine.Networking;
using UnityEngine.SceneManagement;

[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("ChefBazaar")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("ChefBazaar")]
[assembly: AssemblyTitle("ChefBazaar")]
[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 ChefBazaar
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("acanthi.ChefBazaar", "ChefBazaar", "1.4.1")]
	public class ChefBazaar : BaseUnityPlugin
	{
		public class SpawnBazaarShitMessage : INetMessage, ISerializableObject
		{
			private string message;

			public SpawnBazaarShitMessage()
			{
			}

			public SpawnBazaarShitMessage(string message)
			{
				this.message = message;
			}

			public void Deserialize(NetworkReader reader)
			{
				message = reader.ReadString();
			}

			public void OnReceived()
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				//IL_0167: Unknown result type (might be due to invalid IL or missing references)
				Scene activeScene = SceneManager.GetActiveScene();
				string name = ((Scene)(ref activeScene)).name;
				string text = name;
				if (!(text == "moon2"))
				{
					if (text == "bazaar")
					{
						GameObject val = null;
						GameObject[] array = Object.FindObjectsByType<GameObject>((FindObjectsInactive)1, (FindObjectsSortMode)0);
						GameObject[] array2 = array;
						foreach (GameObject val2 in array2)
						{
							if (((Object)val2).name == "HOLDER: Mealprep" && !val2.activeSelf)
							{
								val = val2;
								break;
							}
						}
						if ((Object)(object)val != (Object)null)
						{
							val.gameObject.SetActive(true);
							val.gameObject.transform.position = new Vector3(-82.2492f, -47.2163f, 14.0186f);
							((Component)val.transform.GetChild(0)).gameObject.SetActive(false);
						}
						else
						{
							Debug.Log((object)"HOLDER: Mealprep isn't available?");
						}
					}
					else
					{
						Debug.Log((object)"SpawnBazaarShitMessage called from invalid scene? How the fuck did you let this happen.");
					}
					return;
				}
				GameObject val3 = null;
				GameObject[] array3 = Object.FindObjectsByType<GameObject>((FindObjectsInactive)1, (FindObjectsSortMode)0);
				GameObject[] array4 = array3;
				foreach (GameObject val4 in array4)
				{
					if (((Object)val4).name == "HOLDER: Mealprep" && !val4.activeSelf)
					{
						val3 = val4;
						break;
					}
				}
				if ((Object)(object)val3 != (Object)null)
				{
					val3.gameObject.SetActive(true);
					((Component)val3.transform.GetChild(2)).gameObject.SetActive(false);
				}
				else
				{
					Debug.Log((object)"HOLDER: Mealprep isn't available?");
				}
			}

			public void Serialize(NetworkWriter writer)
			{
				writer.Write(message);
			}
		}

		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static UnityAction <>9__23_0;

			public static UnityAction <>9__23_1;

			public static UnityAction <>9__23_2;

			internal void <SceneDirector_onPostPopulateSceneServer>b__23_0()
			{
				isMoonFuckening = true;
			}

			internal void <SceneDirector_onPostPopulateSceneServer>b__23_1()
			{
				isMoonFuckening = false;
			}

			internal void <SceneDirector_onPostPopulateSceneServer>b__23_2()
			{
				isMoonFuckening = false;
			}
		}

		public const string PluginGUID = "acanthi.ChefBazaar";

		public const string PluginAuthor = "acanthi";

		public const string PluginName = "ChefBazaar";

		public const string PluginVersion = "1.4.1";

		public static List<string> chefPhrases;

		public static List<string> chefEscapePhrases;

		public static ConfigEntry<float> chefChance;

		public static ConfigEntry<bool> spawnScrapper;

		public static ConfigEntry<int> maxUsedTimes;

		public static ConfigEntry<bool> moonChef;

		public static ConfigEntry<bool> moonHooks;

		public static ConfigEntry<bool> classicChef;

		public static ConfigEntry<bool> guaranteedAfterSolusEvent;

		public static ConfigEntry<bool> allowedAfterSolusEvent;

		public static ExpansionDef expansionNeeded;

		public static GameObject tablePrefab;

		public static bool isMoonFuckening;

		private Dictionary<PlayerCharacterMasterController, int> usedTimes = new Dictionary<PlayerCharacterMasterController, int>();

		public void Awake()
		{
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: Unknown result type (might be due to invalid IL or missing references)
			//IL_0147: Unknown result type (might be due to invalid IL or missing references)
			//IL_0151: Expected O, but got Unknown
			//IL_0159: Unknown result type (might be due to invalid IL or missing references)
			//IL_0163: Expected O, but got Unknown
			Log.Init(((BaseUnityPlugin)this).Logger);
			InitConfig();
			CreateTablePrefab();
			NetworkingAPI.RegisterMessageType<SpawnBazaarShitMessage>();
			LanguageAPI.Add("CHEFBAZAAR_IAMHERE_1", "I come and I go, but today I am here.");
			LanguageAPI.Add("CHEFBAZAAR_IAMHERE_2", "Come, mon ami, we shall cook!");
			LanguageAPI.Add("CHEFBAZAAR_IAMHERE_3", "Tired, mon ami? Surely a meal will help.");
			LanguageAPI.Add("CHEFBAZAAR_IAMHERE_4", "It is okay to take a break every once in a while. Come now.");
			LanguageAPI.Add("CHEFBAZAAR_IAMHERE_5", "Mon Chéri! How wonderful it is to see you here.");
			chefPhrases = new List<string>(5) { "CHEFBAZAAR_IAMHERE_1", "CHEFBAZAAR_IAMHERE_2", "CHEFBAZAAR_IAMHERE_3", "CHEFBAZAAR_IAMHERE_4", "CHEFBAZAAR_IAMHERE_5" };
			chefEscapePhrases = new List<string>(3) { "MEALPREP_DIALOGUE_MOONDETONATION_1", "MEALPREP_DIALOGUE_MOONDETONATION_2", "MEALPREP_DIALOGUE_MOONDETONATION_3" };
			if (spawnScrapper.Value)
			{
				LanguageAPI.Add("CHEFBAZAAR_IAMHERE_SCRAPPER", "Please, do not use the scrapper as a garbage bin.");
				chefPhrases.Add("CHEFBAZAAR_IAMHERE_SCRAPPER");
			}
			expansionNeeded = Addressables.LoadAssetAsync<ExpansionDef>((object)"RoR2/DLC3/DLC3.asset").WaitForCompletion();
			SceneDirector.onPostPopulateSceneServer += SceneDirector_onPostPopulateSceneServer;
			PickupPickerController.OnInteractionBegin += new hook_OnInteractionBegin(PickupPickerController_OnInteractionBegin);
			MealPrepController.BeginCookingServer += new hook_BeginCookingServer(MealPrepController_BeginCookingServer);
		}

		private void MealPrepController_BeginCookingServer(orig_BeginCookingServer orig, MealPrepController self, Interactor activator, PickupIndex[] itemsToTake, PickupIndex reward, int count)
		{
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			PlayerCharacterMasterController component = ((Component)((Component)activator).GetComponent<CharacterBody>().master).GetComponent<PlayerCharacterMasterController>();
			usedTimes[component] = usedTimes.GetValueOrDefault(component) + 1;
			orig.Invoke(self, activator, itemsToTake, reward, count);
		}

		private void PickupPickerController_OnInteractionBegin(orig_OnInteractionBegin orig, PickupPickerController self, Interactor activator)
		{
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: 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_0068: Expected O, but got Unknown
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0111: Unknown result type (might be due to invalid IL or missing references)
			//IL_011d: Expected O, but got Unknown
			if (!Object.op_Implicit((Object)(object)((Component)self).GetComponent<MealPrepController>()))
			{
				orig.Invoke(self, activator);
				return;
			}
			if (isMoonFuckening)
			{
				Chat.SendBroadcastChat((ChatMessageBase)new NpcChatMessage
				{
					formatStringToken = "MEALPREP_DIALOGUE_FORMAT",
					baseToken = chefEscapePhrases[Random.Range(0, chefEscapePhrases.Count)],
					sender = null
				});
				return;
			}
			Scene activeScene = SceneManager.GetActiveScene();
			if (((Scene)(ref activeScene)).name != "bazaar")
			{
				orig.Invoke(self, activator);
				return;
			}
			PlayerCharacterMasterController component = ((Component)((Component)activator).GetComponent<CharacterBody>().master).GetComponent<PlayerCharacterMasterController>();
			if (Object.op_Implicit((Object)(object)component) && usedTimes.GetValueOrDefault(component) >= maxUsedTimes.Value && maxUsedTimes.Value > 0)
			{
				Chat.SendBroadcastChat((ChatMessageBase)new NpcChatMessage
				{
					formatStringToken = "MEALPREP_DIALOGUE_FORMAT",
					baseToken = chefEscapePhrases[Random.Range(0, chefEscapePhrases.Count)],
					sender = null
				});
			}
			else
			{
				orig.Invoke(self, activator);
			}
		}

		private void CreateTablePrefab()
		{
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: 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_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: Unknown result type (might be due to invalid IL or missing references)
			//IL_013e: Unknown result type (might be due to invalid IL or missing references)
			//IL_015f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0171: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
			tablePrefab = PrefabAPI.CreateEmptyPrefab("tablePrefab");
			tablePrefab.AddComponent<NetworkIdentity>();
			GameObject val = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/bazaar/Bazaar_LunarTable.prefab").WaitForCompletion();
			GameObject val2 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/bazaar/Bazaar_HangingLight.prefab").WaitForCompletion();
			GameObject val3 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/bazaar/Bazaar_CrystalLight.prefab").WaitForCompletion();
			GameObject val4 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC2/lemuriantemple/Assets/LTWok.prefab").WaitForCompletion();
			GameObject val5 = Object.Instantiate<GameObject>(val, tablePrefab.transform);
			val5.transform.localPosition = new Vector3(-97.28f, -25.3f, -48.88f);
			val5.transform.localRotation = Quaternion.Euler(270f, 0f, 0f);
			val5.transform.localScale = Vector3.one;
			GameObject val6 = Object.Instantiate<GameObject>(val2, tablePrefab.transform);
			val6.transform.localPosition = new Vector3(-97.3327f, -4.507f, -48.562f);
			val6.transform.localRotation = Quaternion.identity;
			GameObject val7 = Object.Instantiate<GameObject>(val3, tablePrefab.transform);
			val7.transform.localPosition = new Vector3(-95.1891f, -24.0915f, -48.829f);
			val7.transform.localRotation = Quaternion.Euler(270f, 0f, 0f);
			val7.transform.localScale = Vector3.one;
			GameObject val8 = Object.Instantiate<GameObject>(val4, tablePrefab.transform);
			val8.transform.localPosition = new Vector3(-99.0918f, -23.18367f, -47.74821f);
			val8.transform.localRotation = Quaternion.Euler(-90f, 0f, 0f);
			PrefabAPI.RegisterNetworkPrefab(tablePrefab);
		}

		private void SceneDirector_onPostPopulateSceneServer(SceneDirector obj)
		{
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_021e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0223: Unknown result type (might be due to invalid IL or missing references)
			//IL_013b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			//IL_0162: Unknown result type (might be due to invalid IL or missing references)
			//IL_0167: Unknown result type (might be due to invalid IL or missing references)
			//IL_0183: Unknown result type (might be due to invalid IL or missing references)
			//IL_0197: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Expected O, but got Unknown
			//IL_00e7: 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_00f2: Expected O, but got Unknown
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_011e: Expected O, but got Unknown
			//IL_036f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0374: Unknown result type (might be due to invalid IL or missing references)
			//IL_0390: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02db: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_0403: Unknown result type (might be due to invalid IL or missing references)
			//IL_0305: Unknown result type (might be due to invalid IL or missing references)
			//IL_030a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0326: Unknown result type (might be due to invalid IL or missing references)
			//IL_033a: Unknown result type (might be due to invalid IL or missing references)
			//IL_042a: Unknown result type (might be due to invalid IL or missing references)
			//IL_042f: Unknown result type (might be due to invalid IL or missing references)
			//IL_043a: Unknown result type (might be due to invalid IL or missing references)
			//IL_045a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0466: Expected O, but got Unknown
			if (!Run.instance.IsExpansionEnabled(expansionNeeded) || (!Run.instance.GetEventFlag("SolusHeartBeaten") && allowedAfterSolusEvent.Value))
			{
				return;
			}
			Scene activeScene;
			if (moonHooks.Value)
			{
				isMoonFuckening = false;
				activeScene = SceneManager.GetActiveScene();
				if (((Scene)(ref activeScene)).name == "moon2")
				{
					EscapeSequenceController component = GameObject.Find("EscapeSequenceController").GetComponent<EscapeSequenceController>();
					if ((Object)(object)component != (Object)null)
					{
						UnityEvent onEnterMainEscapeSequence = component.onEnterMainEscapeSequence;
						object obj2 = <>c.<>9__23_0;
						if (obj2 == null)
						{
							UnityAction val = delegate
							{
								isMoonFuckening = true;
							};
							<>c.<>9__23_0 = val;
							obj2 = (object)val;
						}
						onEnterMainEscapeSequence.AddListener((UnityAction)obj2);
						UnityEvent onFailEscapeSequenceServer = component.onFailEscapeSequenceServer;
						object obj3 = <>c.<>9__23_1;
						if (obj3 == null)
						{
							UnityAction val2 = delegate
							{
								isMoonFuckening = false;
							};
							<>c.<>9__23_1 = val2;
							obj3 = (object)val2;
						}
						onFailEscapeSequenceServer.AddListener((UnityAction)obj3);
						UnityEvent onCompleteEscapeSequenceServer = component.onCompleteEscapeSequenceServer;
						object obj4 = <>c.<>9__23_2;
						if (obj4 == null)
						{
							UnityAction val3 = delegate
							{
								isMoonFuckening = false;
							};
							<>c.<>9__23_2 = val3;
							obj4 = (object)val3;
						}
						onCompleteEscapeSequenceServer.AddListener((UnityAction)obj4);
					}
				}
			}
			if (moonChef.Value)
			{
				activeScene = SceneManager.GetActiveScene();
				if (((Scene)(ref activeScene)).name == "moon2")
				{
					GameObject val4 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC3/MealPrep/MealPrep.prefab").WaitForCompletion();
					GameObject val5 = Object.Instantiate<GameObject>(val4, new Vector3(-259.18f, -220.2f, -402.91f), Quaternion.Euler(0f, 120.9532f, 0f));
					NetworkServer.Spawn(val5);
					if (spawnScrapper.Value)
					{
						GameObject val6 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Scrapper/Scrapper.prefab").WaitForCompletion();
						GameObject val7 = Object.Instantiate<GameObject>(val6, new Vector3(-257.9419f, -221.2121f, -407.045f), Quaternion.Euler(359.7326f, 122.0352f, 346.4449f));
						NetworkServer.Spawn(val7);
					}
					NetMessageExtensions.Send((INetMessage)(object)new SpawnBazaarShitMessage("message"), (NetworkDestination)1);
				}
			}
			activeScene = SceneManager.GetActiveScene();
			if (((Scene)(ref activeScene)).name != "bazaar" || (Random.Range(0f, 100f) >= chefChance.Value && (!Run.instance.GetEventFlag("SolusHeartBeaten") || !guaranteedAfterSolusEvent.Value)))
			{
				return;
			}
			if (classicChef.Value)
			{
				GameObject val8 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC3/MealPrep/MealPrep.prefab").WaitForCompletion();
				GameObject val9 = Object.Instantiate<GameObject>(val8, new Vector3(-97.3184f, -24.2f, -49.48f), Quaternion.Euler(0f, 270f, 0f));
				NetworkServer.Spawn(val9);
				if (spawnScrapper.Value)
				{
					GameObject val10 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Scrapper/Scrapper.prefab").WaitForCompletion();
					GameObject val11 = Object.Instantiate<GameObject>(val10, new Vector3(-93.5723f, -25.8374f, -47.0965f), Quaternion.Euler(2.21f, 1.35f, 345.91f));
					NetworkServer.Spawn(val11);
				}
				GameObject val12 = Object.Instantiate<GameObject>(tablePrefab);
				NetworkServer.Spawn(val12);
			}
			else
			{
				GameObject val13 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC3/MealPrep/MealPrep.prefab").WaitForCompletion();
				GameObject val14 = Object.Instantiate<GameObject>(val13, new Vector3(-95.7066f, -24.9729f, 20.9845f), Quaternion.Euler(0f, 350.4501f, 0f));
				NetworkServer.Spawn(val14);
				if (spawnScrapper.Value)
				{
					GameObject val15 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Scrapper/Scrapper.prefab").WaitForCompletion();
					GameObject val16 = Object.Instantiate<GameObject>(val15, new Vector3(-94.3094f, -25.7118f, 25.2005f), Quaternion.Euler(2.21f, 1.35f, 0f));
					NetworkServer.Spawn(val16);
				}
				NetMessageExtensions.Send((INetMessage)(object)new SpawnBazaarShitMessage("message"), (NetworkDestination)1);
			}
			Chat.SendBroadcastChat((ChatMessageBase)new NpcChatMessage
			{
				formatStringToken = "MEALPREP_DIALOGUE_FORMAT",
				baseToken = chefPhrases[Random.Range(0, chefPhrases.Count)],
				sender = null
			});
			usedTimes.Clear();
		}

		private void InitConfig()
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Expected O, but got Unknown
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0133: Unknown result type (might be due to invalid IL or missing references)
			//IL_013e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0149: Unknown result type (might be due to invalid IL or missing references)
			//IL_0159: Expected O, but got Unknown
			//IL_0154: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: Expected O, but got Unknown
			//IL_0164: Unknown result type (might be due to invalid IL or missing references)
			//IL_016e: Expected O, but got Unknown
			//IL_0174: Unknown result type (might be due to invalid IL or missing references)
			//IL_017e: Expected O, but got Unknown
			//IL_0184: Unknown result type (might be due to invalid IL or missing references)
			//IL_018e: Expected O, but got Unknown
			//IL_0194: Unknown result type (might be due to invalid IL or missing references)
			//IL_0199: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ad: Expected O, but got Unknown
			//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b2: Expected O, but got Unknown
			//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c2: Expected O, but got Unknown
			//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d2: Expected O, but got Unknown
			//IL_01d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e2: Expected O, but got Unknown
			chefChance = ((BaseUnityPlugin)this).Config.Bind<float>("ChefBazaar", "Wandering CHEF Chance", 35f, new ConfigDescription("How likely is the Wandering CHEF to appear in the Bazaar?", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 100f), Array.Empty<object>()));
			guaranteedAfterSolusEvent = ((BaseUnityPlugin)this).Config.Bind<bool>("ChefBazaar", "Guaranteed After Solus Event", false, "Guarantees Wandering CHEF spawns in the Bazaar after the Solus Event.");
			allowedAfterSolusEvent = ((BaseUnityPlugin)this).Config.Bind<bool>("ChefBazaar", "Only Allowed After Solus Event", false, "Only allows Wandering CHEF spawns in the Bazaar or moon after the Solus Event.");
			spawnScrapper = ((BaseUnityPlugin)this).Config.Bind<bool>("ChefBazaar", "Spawn Scrapper", false, "Spawn a Scrapper next to the Wandering CHEF?");
			maxUsedTimes = ((BaseUnityPlugin)this).Config.Bind<int>("ChefBazaar", "Crafting Limit", 0, "How many times can the Wandering CHEF cook for you in the Bazaar? (0 = Infinite)");
			moonChef = ((BaseUnityPlugin)this).Config.Bind<bool>("Extras", "Moon CHEF", false, "Re-enables the unused Wandering CHEF on Commencement. Guaranteed.");
			moonHooks = ((BaseUnityPlugin)this).Config.Bind<bool>("Extras", "Moon Hooks", false, "Enable the Wandering CHEF shooing you away during moon detonation for mods that add the Wandering CHEF to the moon.");
			classicChef = ((BaseUnityPlugin)this).Config.Bind<bool>("Extras", "Classic Location", false, "Re-enables the pre-rework location for the Wandering CHEF! (Next to the lunar item table.)");
			ModSettingsManager.SetModDescription("Chance for the Wandering CHEF to appear in the Bazaar!");
			ModSettingsManager.AddOption((BaseOption)new StepSliderOption(chefChance, new StepSliderConfig
			{
				min = 0f,
				max = 100f,
				increment = 0.5f
			}));
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(guaranteedAfterSolusEvent));
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(allowedAfterSolusEvent));
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(spawnScrapper));
			ModSettingsManager.AddOption((BaseOption)new IntSliderOption(maxUsedTimes, new IntSliderConfig
			{
				min = 0,
				max = 100
			}));
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(moonChef));
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(moonHooks));
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(classicChef));
		}
	}
	internal static class Log
	{
		private static ManualLogSource _logSource;

		internal static void Init(ManualLogSource logSource)
		{
			_logSource = logSource;
		}

		internal static void Debug(object data)
		{
			_logSource.LogDebug(data);
		}

		internal static void Error(object data)
		{
			_logSource.LogError(data);
		}

		internal static void Fatal(object data)
		{
			_logSource.LogFatal(data);
		}

		internal static void Info(object data)
		{
			_logSource.LogInfo(data);
		}

		internal static void Message(object data)
		{
			_logSource.LogMessage(data);
		}

		internal static void Warning(object data)
		{
			_logSource.LogWarning(data);
		}
	}
}